diff options
Diffstat (limited to 'nexgb/xprint/xprint.go')
-rw-r--r-- | nexgb/xprint/xprint.go | 437 |
1 files changed, 266 insertions, 171 deletions
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 |