From e6e4e9443661bab3bb69a6c32dacfaf0e54f32ef Mon Sep 17 00:00:00 2001 From: Přemysl Janouch
Date: Sun, 30 Sep 2018 16:32:47 +0200 Subject: nexgb: regenerate from xcb-proto 1.12 To refresh documentation. --- nexgb/xproto/xproto.go | 1824 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 1207 insertions(+), 617 deletions(-) (limited to 'nexgb/xproto/xproto.go') diff --git a/nexgb/xproto/xproto.go b/nexgb/xproto/xproto.go index b18315f..82f893d 100644 --- a/nexgb/xproto/xproto.go +++ b/nexgb/xproto/xproto.go @@ -369,17 +369,32 @@ const ( 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 + Sequence uint16 + // The keycode (a number representing a physical key on the keyboard) of the key + // which was pressed. + Detail Button + // Time when the event was generated (in milliseconds). + Time Timestamp + // The root window of Child. + Root Window + Event Window + Child Window + // The X coordinate of the pointer relative to the Root window at the time of + // the event. + RootX int16 + // The Y coordinate of the pointer relative to the Root window at the time of + // the event. + RootY int16 + // If SameScreen is true, this is the X coordinate relative to the Event + // window's origin. Otherwise, EventX will be set to zero. + EventX int16 + // If SameScreen is true, this is the Y coordinate relative to the Event + // window's origin. Otherwise, EventY will be set to zero. + EventY int16 + // The logical state of the pointer buttons and modifier keys just prior to the + // event. + State uint16 + // Whether the Event window is on the same screen as the Root window. SameScreen bool // padding: 1 bytes } @@ -713,7 +728,10 @@ const CirculateNotify = 26 type CirculateNotifyEvent struct { Sequence uint16 // padding: 1 bytes - Event Window + // Either the restacked window or its parent, depending on whether + // StructureNotify or SubstructureNotify was selected. + Event Window + // The restacked window. Window Window // padding: 4 bytes Place byte @@ -836,10 +854,14 @@ const ClientMessage = 33 type ClientMessageEvent struct { Sequence uint16 - Format byte - Window Window - Type Atom - Data ClientMessageDataUnion + // Specifies how to interpret Data. Can be either 8, 16 or 32. + Format byte + Window Window + // An atom which indicates how the data should be interpreted by the receiving + // client. + Type Atom + // The data itself (20 bytes max). + Data ClientMessageDataUnion } // ClientMessageEventNew constructs a ClientMessageEvent value that implements xgb.Event from a byte slice. @@ -1259,7 +1281,10 @@ const ColormapNotify = 32 type ColormapNotifyEvent struct { Sequence uint16 // padding: 1 bytes - Window Window + // The window whose associated colormap is changed, installed or uninstalled. + Window Window + // The colormap which is changed, installed or uninstalled. This is None + // when the colormap is changed by a call to FreeColormap. Colormap Colormap New bool State byte @@ -1374,14 +1399,28 @@ const ConfigureNotify = 22 type ConfigureNotifyEvent struct { Sequence uint16 // padding: 1 bytes - Event Window - Window Window - AboveSibling Window - X int16 - Y int16 - Width uint16 - Height uint16 - BorderWidth uint16 + // The reconfigured window or its parent, depending on whether StructureNotify + // or SubstructureNotify was selected. + Event Window + // The window whose size, position, border, and/or stacking order was changed. + Window Window + // If None, the Window is on the bottom of the stack with respect to + // sibling windows. However, if set to a sibling window, the Window is placed on + // top of this sibling window. + AboveSibling Window + // The X coordinate of the upper-left outside corner of Window, relative to the + // parent window's origin. + X int16 + // The Y coordinate of the upper-left outside corner of Window, relative to the + // parent window's origin. + Y int16 + // The inside width of Window, not including the border. + Width uint16 + // The inside height of Window, not including the border. + Height uint16 + // The border width of Window. + BorderWidth uint16 + // Window managers should ignore this window if OverrideRedirect is 1. OverrideRedirect bool // padding: 1 bytes } @@ -1930,7 +1969,10 @@ const DestroyNotify = 17 type DestroyNotifyEvent struct { Sequence uint16 // padding: 1 bytes - Event Window + // The reconfigured window or its parent, depending on whether StructureNotify + // or SubstructureNotify was selected. + Event Window + // The window that is destroyed. Window Window } @@ -2047,15 +2089,25 @@ func init() { const EnterNotify = 7 type EnterNotifyEvent struct { - Sequence uint16 - Detail byte - Time Timestamp - Root Window - Event Window - Child Window - RootX int16 - RootY int16 - EventX int16 + Sequence uint16 + Detail byte + Time Timestamp + // The root window for the final cursor position. + Root Window + // The window on which the event was generated. + Event Window + // If the Event window has subwindows and the final pointer position is in one + // of them, then Child is set to that subwindow, WindowNone otherwise. + Child Window + // The pointer X coordinate relative to Root's origin at the time of the event. + RootX int16 + // The pointer Y coordinate relative to Root's origin at the time of the event. + RootY int16 + // If Event is on the same screen as Root, this is the pointer X coordinate + // relative to the event window's origin. + EventX int16 + // If Event is on the same screen as Root, this is the pointer Y coordinate + // relative to the event window's origin. EventY int16 State uint16 Mode byte @@ -2224,12 +2276,23 @@ const Expose = 12 type ExposeEvent struct { Sequence uint16 // padding: 1 bytes + // The exposed (damaged) window. Window Window - X uint16 - Y uint16 - Width uint16 + // The X coordinate of the left-upper corner of the exposed rectangle, relative to + // the Window's origin. + X uint16 + // The Y coordinate of the left-upper corner of the exposed rectangle, relative to + // the Window's origin. + Y uint16 + // The width of the exposed rectangle. + Width uint16 + // The height of the exposed rectangle. Height uint16 - Count uint16 + // The amount of Expose events following this one. Simple applications that do + // not want to optimize redisplay by distinguishing between subareas of its window + // can just ignore all Expose events with nonzero counts and perform full + // redisplays on events with zero counts. + Count uint16 // padding: 2 bytes } @@ -2358,8 +2421,10 @@ const FocusIn = 9 type FocusInEvent struct { Sequence uint16 Detail byte - Event Window - Mode byte + // The window on which the focus event was generated. This is the window used by + // the X server to report the event. + Event Window + Mode byte // padding: 3 bytes } @@ -3260,17 +3325,32 @@ const ( 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 + Sequence uint16 + // The keycode (a number representing a physical key on the keyboard) of the key + // which was pressed. + Detail Keycode + // Time when the event was generated (in milliseconds). + Time Timestamp + // The root window of Child. + Root Window + Event Window + Child Window + // The X coordinate of the pointer relative to the Root window at the time of + // the event. + RootX int16 + // The Y coordinate of the pointer relative to the Root window at the time of + // the event. + RootY int16 + // If SameScreen is true, this is the X coordinate relative to the Event + // window's origin. Otherwise, EventX will be set to zero. + EventX int16 + // If SameScreen is true, this is the Y coordinate relative to the Event + // window's origin. Otherwise, EventY will be set to zero. + EventY int16 + // The logical state of the pointer buttons and modifier keys just prior to the + // event. + State uint16 + // Whether the Event window is on the same screen as the Root window. SameScreen bool // padding: 1 bytes } @@ -3621,8 +3701,12 @@ const MapNotify = 19 type MapNotifyEvent struct { Sequence uint16 // padding: 1 bytes - Event Window - Window Window + // The window which was mapped or its parent, depending on whether + // StructureNotify or SubstructureNotify was selected. + Event Window + // The window that was mapped. + Window Window + // Window managers should ignore this window if OverrideRedirect is 1. OverrideRedirect bool // padding: 3 bytes } @@ -3713,7 +3797,9 @@ const MapRequest = 20 type MapRequestEvent struct { Sequence uint16 // padding: 1 bytes + // The parent of Window. Parent Window + // The window to be mapped. Window Window } @@ -3796,9 +3882,11 @@ const MappingNotify = 34 type MappingNotifyEvent struct { Sequence uint16 // padding: 1 bytes - Request byte + Request byte + // The first number in the range of the altered mapping. FirstKeycode Keycode - Count byte + // The number of keycodes altered. + Count byte // padding: 1 bytes } @@ -3939,17 +4027,32 @@ const ( 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 + Sequence uint16 + // The keycode (a number representing a physical key on the keyboard) of the key + // which was pressed. + Detail byte + // Time when the event was generated (in milliseconds). + Time Timestamp + // The root window of Child. + Root Window + Event Window + Child Window + // The X coordinate of the pointer relative to the Root window at the time of + // the event. + RootX int16 + // The Y coordinate of the pointer relative to the Root window at the time of + // the event. + RootY int16 + // If SameScreen is true, this is the X coordinate relative to the Event + // window's origin. Otherwise, EventX will be set to zero. + EventX int16 + // If SameScreen is true, this is the Y coordinate relative to the Event + // window's origin. Otherwise, EventY will be set to zero. + EventY int16 + // The logical state of the pointer buttons and modifier keys just prior to the + // event. + State uint16 + // Whether the Event window is on the same screen as the Root window. SameScreen bool // padding: 1 bytes } @@ -4360,10 +4463,13 @@ const PropertyNotify = 28 type PropertyNotifyEvent struct { Sequence uint16 // padding: 1 bytes + // The window whose associated property was changed. Window Window - Atom Atom - Time Timestamp - State byte + // The property's atom, to indicate which property was changed. + Atom Atom + // A timestamp of the server time when the property was changed. + Time Timestamp + State byte // padding: 3 bytes } @@ -6036,8 +6142,13 @@ const UnmapNotify = 18 type UnmapNotifyEvent struct { Sequence uint16 // padding: 1 bytes - Event Window - Window Window + // The reconfigured window or its parent, depending on whether StructureNotify + // or SubstructureNotify was selected. + Event Window + // The window that was unmapped. + Window Window + // Set to 1 if the event was generated as a result of a resizing of the window's + // parent when Window had a win_gravity of UnmapGravity. FromConfigure bool // padding: 3 bytes } @@ -6460,9 +6571,17 @@ type AllocColorCookie struct { *xgb.Cookie } +// Allocates a read-only colormap entry corresponding to the closest RGB value +// supported by the hardware. If you are using TrueColor, you can take a shortcut +// and directly calculate the color pixel value to avoid the round trip. But, for +// example, on 16-bit color setups (VNC), you can easily get the closest supported +// RGB value to the RGB value you are specifying. +// +// May return a Colormap error if the specified colormap Cmap does not exist. +// // 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 { +// If an error occurs, it will be returned with the reply by calling AllocColorCookie.Reply. +func AllocColor(c *xgb.Conn, Cmap Colormap, Red, Green, Blue uint16) AllocColorCookie { cookie := c.NewCookie(true, true) c.NewRequest(allocColorRequest(c, Cmap, Red, Green, Blue), cookie) return AllocColorCookie{cookie} @@ -6470,7 +6589,7 @@ func AllocColor(c *xgb.Conn, Cmap Colormap, Red uint16, Green uint16, Blue uint1 // 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 { +func AllocColorUnchecked(c *xgb.Conn, Cmap Colormap, Red, Green, Blue uint16) AllocColorCookie { cookie := c.NewCookie(false, true) c.NewRequest(allocColorRequest(c, Cmap, Red, Green, Blue), cookie) return AllocColorCookie{cookie} @@ -6530,9 +6649,8 @@ func allocColorReply(buf []byte) *AllocColorReply { 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 { +// allocColorRequest writes a AllocColor request to a byte slice for transfer. +func allocColorRequest(c *xgb.Conn, Cmap Colormap, Red, Green, Blue uint16) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -6568,8 +6686,8 @@ type AllocColorCellsCookie struct { } // 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 { +// 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, Planes uint16) AllocColorCellsCookie { cookie := c.NewCookie(true, true) c.NewRequest(allocColorCellsRequest(c, Contiguous, Cmap, Colors, Planes), cookie) return AllocColorCellsCookie{cookie} @@ -6577,7 +6695,7 @@ func AllocColorCells(c *xgb.Conn, Contiguous bool, Cmap Colormap, Colors uint16, // 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 { +func AllocColorCellsUnchecked(c *xgb.Conn, Contiguous bool, Cmap Colormap, Colors, Planes uint16) AllocColorCellsCookie { cookie := c.NewCookie(false, true) c.NewRequest(allocColorCellsRequest(c, Contiguous, Cmap, Colors, Planes), cookie) return AllocColorCellsCookie{cookie} @@ -6643,9 +6761,8 @@ func allocColorCellsReply(buf []byte) *AllocColorCellsReply { 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 { +// allocColorCellsRequest writes a AllocColorCells request to a byte slice for transfer. +func allocColorCellsRequest(c *xgb.Conn, Contiguous bool, Cmap Colormap, Colors, Planes uint16) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -6681,8 +6798,8 @@ type AllocColorPlanesCookie struct { } // 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 { +// 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, Reds, Greens, Blues uint16) AllocColorPlanesCookie { cookie := c.NewCookie(true, true) c.NewRequest(allocColorPlanesRequest(c, Contiguous, Cmap, Colors, Reds, Greens, Blues), cookie) return AllocColorPlanesCookie{cookie} @@ -6690,7 +6807,7 @@ func AllocColorPlanes(c *xgb.Conn, Contiguous bool, Cmap Colormap, Colors uint16 // 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 { +func AllocColorPlanesUnchecked(c *xgb.Conn, Contiguous bool, Cmap Colormap, Colors, Reds, Greens, Blues uint16) AllocColorPlanesCookie { cookie := c.NewCookie(false, true) c.NewRequest(allocColorPlanesRequest(c, Contiguous, Cmap, Colors, Reds, Greens, Blues), cookie) return AllocColorPlanesCookie{cookie} @@ -6760,9 +6877,8 @@ func allocColorPlanesReply(buf []byte) *AllocColorPlanesReply { 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 { +// allocColorPlanesRequest writes a AllocColorPlanes request to a byte slice for transfer. +func allocColorPlanesRequest(c *xgb.Conn, Contiguous bool, Cmap Colormap, Colors, Reds, Greens, Blues uint16) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -6804,7 +6920,7 @@ type AllocNamedColorCookie struct { } // AllocNamedColor sends a checked request. -// If an error occurs, it will be returned with the reply by calling AllocNamedColorCookie.Reply() +// 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) @@ -6882,8 +6998,7 @@ func allocNamedColorReply(buf []byte) *AllocNamedColorReply { return v } -// Write request to wire for AllocNamedColor -// allocNamedColorRequest writes a AllocNamedColor request to a byte slice. +// allocNamedColorRequest writes a AllocNamedColor request to a byte slice for transfer. func allocNamedColorRequest(c *xgb.Conn, Cmap Colormap, NameLen uint16, Name string) []byte { size := xgb.Pad((12 + xgb.Pad((int(NameLen) * 1)))) b := 0 @@ -6916,6 +7031,13 @@ type AllowEventsCookie struct { *xgb.Cookie } +// Releases queued events if the client has caused a device (pointer/keyboard) to +// freeze due to grabbing it actively. This request has no effect if Time is +// earlier than the last-grab time of the most recent active grab for this client +// or if Time is later than the current X server time. +// +// May return a Value error if you specified an invalid Mode. +// // 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 { @@ -6925,7 +7047,7 @@ func AllowEvents(c *xgb.Conn, Mode byte, Time Timestamp) AllowEventsCookie { } // AllowEventsChecked sends a checked request. -// If an error occurs, it can be retrieved using AllowEventsCookie.Check() +// 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) @@ -6938,8 +7060,7 @@ func (cook AllowEventsCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for AllowEvents -// allowEventsRequest writes a AllowEvents request to a byte slice. +// allowEventsRequest writes a AllowEvents request to a byte slice for transfer. func allowEventsRequest(c *xgb.Conn, Mode byte, Time Timestamp) []byte { size := 8 b := 0 @@ -6974,7 +7095,7 @@ func Bell(c *xgb.Conn, Percent int8) BellCookie { } // BellChecked sends a checked request. -// If an error occurs, it can be retrieved using BellCookie.Check() +// 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) @@ -6987,8 +7108,7 @@ func (cook BellCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for Bell -// bellRequest writes a Bell request to a byte slice. +// bellRequest writes a Bell request to a byte slice for transfer. func bellRequest(c *xgb.Conn, Percent int8) []byte { size := 4 b := 0 @@ -7020,7 +7140,7 @@ func ChangeActivePointerGrab(c *xgb.Conn, Cursor Cursor, Time Timestamp, EventMa } // ChangeActivePointerGrabChecked sends a checked request. -// If an error occurs, it can be retrieved using ChangeActivePointerGrabCookie.Check() +// 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) @@ -7033,8 +7153,7 @@ func (cook ChangeActivePointerGrabCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for ChangeActivePointerGrab -// changeActivePointerGrabRequest writes a ChangeActivePointerGrab request to a byte slice. +// changeActivePointerGrabRequest writes a ChangeActivePointerGrab request to a byte slice for transfer. func changeActivePointerGrabRequest(c *xgb.Conn, Cursor Cursor, Time Timestamp, EventMask uint16) []byte { size := 16 b := 0 @@ -7067,6 +7186,12 @@ type ChangeGCCookie struct { *xgb.Cookie } +// Changes the components specified by ValueMask for the specified graphics context. +// +// May return a Alloc error if the X server could not allocate the requested resources (no memory?). +// +// May return Font, GContext, Match, Pixmap, Value errors. +// // 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 { @@ -7076,7 +7201,7 @@ func ChangeGC(c *xgb.Conn, Gc Gcontext, ValueMask uint32, ValueList []uint32) Ch } // ChangeGCChecked sends a checked request. -// If an error occurs, it can be retrieved using ChangeGCCookie.Check() +// 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) @@ -7089,8 +7214,7 @@ func (cook ChangeGCCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for ChangeGC -// changeGCRequest writes a ChangeGC request to a byte slice. +// changeGCRequest writes a ChangeGC request to a byte slice for transfer. func changeGCRequest(c *xgb.Conn, Gc Gcontext, ValueMask uint32, ValueList []uint32) []byte { size := xgb.Pad((12 + xgb.Pad((4 * xgb.PopCount(int(ValueMask)))))) b := 0 @@ -7126,15 +7250,15 @@ type ChangeHostsCookie struct { // 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 { +func ChangeHosts(c *xgb.Conn, Mode, 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 { +// If an error occurs, it can be retrieved using ChangeHostsCookie.Check. +func ChangeHostsChecked(c *xgb.Conn, Mode, Family byte, AddressLen uint16, Address []byte) ChangeHostsCookie { cookie := c.NewCookie(true, false) c.NewRequest(changeHostsRequest(c, Mode, Family, AddressLen, Address), cookie) return ChangeHostsCookie{cookie} @@ -7146,9 +7270,8 @@ 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 { +// changeHostsRequest writes a ChangeHosts request to a byte slice for transfer. +func changeHostsRequest(c *xgb.Conn, Mode, Family byte, AddressLen uint16, Address []byte) []byte { size := xgb.Pad((8 + xgb.Pad((int(AddressLen) * 1)))) b := 0 buf := make([]byte, size) @@ -7190,7 +7313,7 @@ func ChangeKeyboardControl(c *xgb.Conn, ValueMask uint32, ValueList []uint32) Ch } // ChangeKeyboardControlChecked sends a checked request. -// If an error occurs, it can be retrieved using ChangeKeyboardControlCookie.Check() +// 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) @@ -7203,8 +7326,7 @@ func (cook ChangeKeyboardControlCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for ChangeKeyboardControl -// changeKeyboardControlRequest writes a ChangeKeyboardControl request to a byte slice. +// changeKeyboardControlRequest writes a ChangeKeyboardControl request to a byte slice for transfer. func changeKeyboardControlRequest(c *xgb.Conn, ValueMask uint32, ValueList []uint32) []byte { size := xgb.Pad((8 + xgb.Pad((4 * xgb.PopCount(int(ValueMask)))))) b := 0 @@ -7244,7 +7366,7 @@ func ChangeKeyboardMapping(c *xgb.Conn, KeycodeCount byte, FirstKeycode Keycode, } // ChangeKeyboardMappingChecked sends a checked request. -// If an error occurs, it can be retrieved using ChangeKeyboardMappingCookie.Check() +// 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) @@ -7257,8 +7379,7 @@ func (cook ChangeKeyboardMappingCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for ChangeKeyboardMapping -// changeKeyboardMappingRequest writes a ChangeKeyboardMapping request to a byte slice. +// changeKeyboardMappingRequest writes a ChangeKeyboardMapping request to a byte slice for transfer. 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 @@ -7296,15 +7417,15 @@ type ChangePointerControlCookie struct { // 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 { +func ChangePointerControl(c *xgb.Conn, AccelerationNumerator, AccelerationDenominator, Threshold int16, DoAcceleration, 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 { +// If an error occurs, it can be retrieved using ChangePointerControlCookie.Check. +func ChangePointerControlChecked(c *xgb.Conn, AccelerationNumerator, AccelerationDenominator, Threshold int16, DoAcceleration, DoThreshold bool) ChangePointerControlCookie { cookie := c.NewCookie(true, false) c.NewRequest(changePointerControlRequest(c, AccelerationNumerator, AccelerationDenominator, Threshold, DoAcceleration, DoThreshold), cookie) return ChangePointerControlCookie{cookie} @@ -7316,9 +7437,8 @@ 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 { +// changePointerControlRequest writes a ChangePointerControl request to a byte slice for transfer. +func changePointerControlRequest(c *xgb.Conn, AccelerationNumerator, AccelerationDenominator, Threshold int16, DoAcceleration, DoThreshold bool) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -7362,17 +7482,30 @@ type ChangePropertyCookie struct { *xgb.Cookie } +// Sets or updates a property on the specified Window. Properties are for +// example the window title (WM_NAME) or its minimum size (WM_NORMAL_HINTS). +// Protocols such as EWMH also use properties - for example EWMH defines the +// window title, encoded as UTF-8 string, in the _NET_WM_NAME property. +// +// May return a Alloc error if the X server could not store the property (no memory?). +// +// May return a Atom error if property or Type do not refer to a valid atom. +// +// May return a Window error if the specified Window does not exist. +// +// May return Match, Value errors. +// // 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 { +func ChangeProperty(c *xgb.Conn, Mode byte, Window Window, Property, 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 { +// If an error occurs, it can be retrieved using ChangePropertyCookie.Check. +func ChangePropertyChecked(c *xgb.Conn, Mode byte, Window Window, Property, 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} @@ -7384,9 +7517,8 @@ 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 { +// changePropertyRequest writes a ChangeProperty request to a byte slice for transfer. +func changePropertyRequest(c *xgb.Conn, Mode byte, Window Window, Property, 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) @@ -7428,6 +7560,16 @@ type ChangeSaveSetCookie struct { *xgb.Cookie } +// This function either adds or removes the specified window to the client's (your +// application's) save set. +// +// May return a Match error if you created the specified window. This does not make sense, you can only add +// windows created by other clients to your save set. +// +// May return a Value error if you specified an invalid mode. +// +// May return a Window error if the specified window does not exist. +// // 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 { @@ -7437,7 +7579,7 @@ func ChangeSaveSet(c *xgb.Conn, Mode byte, Window Window) ChangeSaveSetCookie { } // ChangeSaveSetChecked sends a checked request. -// If an error occurs, it can be retrieved using ChangeSaveSetCookie.Check() +// 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) @@ -7450,8 +7592,7 @@ func (cook ChangeSaveSetCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for ChangeSaveSet -// changeSaveSetRequest writes a ChangeSaveSet request to a byte slice. +// changeSaveSetRequest writes a ChangeSaveSet request to a byte slice for transfer. func changeSaveSetRequest(c *xgb.Conn, Mode byte, Window Window) []byte { size := 8 b := 0 @@ -7477,6 +7618,12 @@ type ChangeWindowAttributesCookie struct { *xgb.Cookie } +// Changes the attributes specified by ValueMask for the specified Window. +// +// May return a Window error if the specified Window does not exist. +// +// May return Access, Colormap, Cursor, Match, Pixmap, Value errors. +// // 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 { @@ -7486,7 +7633,7 @@ func ChangeWindowAttributes(c *xgb.Conn, Window Window, ValueMask uint32, ValueL } // ChangeWindowAttributesChecked sends a checked request. -// If an error occurs, it can be retrieved using ChangeWindowAttributesCookie.Check() +// 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) @@ -7499,8 +7646,7 @@ func (cook ChangeWindowAttributesCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for ChangeWindowAttributes -// changeWindowAttributesRequest writes a ChangeWindowAttributes request to a byte slice. +// changeWindowAttributesRequest writes a ChangeWindowAttributes request to a byte slice for transfer. func changeWindowAttributesRequest(c *xgb.Conn, Window Window, ValueMask uint32, ValueList []uint32) []byte { size := xgb.Pad((12 + xgb.Pad((4 * xgb.PopCount(int(ValueMask)))))) b := 0 @@ -7534,6 +7680,16 @@ type CirculateWindowCookie struct { *xgb.Cookie } +// If Direction is CirculateRaiseLowest, the lowest mapped child (if +// any) will be raised to the top of the stack. +// +// If Direction is CirculateLowerHighest, the highest mapped child will +// be lowered to the bottom of the stack. +// +// May return a Value error if the specified Direction is invalid. +// +// May return a Window error if the specified Window does not exist. +// // 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 { @@ -7543,7 +7699,7 @@ func CirculateWindow(c *xgb.Conn, Direction byte, Window Window) CirculateWindow } // CirculateWindowChecked sends a checked request. -// If an error occurs, it can be retrieved using CirculateWindowCookie.Check() +// 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) @@ -7556,8 +7712,7 @@ func (cook CirculateWindowCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for CirculateWindow -// circulateWindowRequest writes a CirculateWindow request to a byte slice. +// circulateWindowRequest writes a CirculateWindow request to a byte slice for transfer. func circulateWindowRequest(c *xgb.Conn, Direction byte, Window Window) []byte { size := 8 b := 0 @@ -7585,15 +7740,15 @@ type ClearAreaCookie struct { // 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 { +func ClearArea(c *xgb.Conn, Exposures bool, Window Window, X, Y int16, Width, 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 { +// If an error occurs, it can be retrieved using ClearAreaCookie.Check. +func ClearAreaChecked(c *xgb.Conn, Exposures bool, Window Window, X, Y int16, Width, Height uint16) ClearAreaCookie { cookie := c.NewCookie(true, false) c.NewRequest(clearAreaRequest(c, Exposures, Window, X, Y, Width, Height), cookie) return ClearAreaCookie{cookie} @@ -7605,9 +7760,8 @@ 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 { +// clearAreaRequest writes a ClearArea request to a byte slice for transfer. +func clearAreaRequest(c *xgb.Conn, Exposures bool, Window Window, X, Y int16, Width, Height uint16) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -7657,7 +7811,7 @@ func CloseFont(c *xgb.Conn, Font Font) CloseFontCookie { } // CloseFontChecked sends a checked request. -// If an error occurs, it can be retrieved using CloseFontCookie.Check() +// 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) @@ -7670,8 +7824,7 @@ func (cook CloseFontCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for CloseFont -// closeFontRequest writes a CloseFont request to a byte slice. +// closeFontRequest writes a CloseFont request to a byte slice for transfer. func closeFontRequest(c *xgb.Conn, Font Font) []byte { size := 8 b := 0 @@ -7696,6 +7849,15 @@ type ConfigureWindowCookie struct { *xgb.Cookie } +// Configures a window's size, position, border width and stacking order. +// +// May return a Match error if you specified a Sibling without also specifying StackMode or the window is not +// actually a Sibling. +// +// May return a Window error if the specified window does not exist. +// +// May return Value errors. +// // 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 { @@ -7705,7 +7867,7 @@ func ConfigureWindow(c *xgb.Conn, Window Window, ValueMask uint16, ValueList []u } // ConfigureWindowChecked sends a checked request. -// If an error occurs, it can be retrieved using ConfigureWindowCookie.Check() +// 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) @@ -7718,8 +7880,7 @@ func (cook ConfigureWindowCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for ConfigureWindow -// configureWindowRequest writes a ConfigureWindow request to a byte slice. +// configureWindowRequest writes a ConfigureWindow request to a byte slice for transfer. func configureWindowRequest(c *xgb.Conn, Window Window, ValueMask uint16, ValueList []uint32) []byte { size := xgb.Pad((12 + xgb.Pad((4 * xgb.PopCount(int(ValueMask)))))) b := 0 @@ -7757,15 +7918,15 @@ type ConvertSelectionCookie struct { // 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 { +func ConvertSelection(c *xgb.Conn, Requestor Window, Selection, Target, 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 { +// If an error occurs, it can be retrieved using ConvertSelectionCookie.Check. +func ConvertSelectionChecked(c *xgb.Conn, Requestor Window, Selection, Target, Property Atom, Time Timestamp) ConvertSelectionCookie { cookie := c.NewCookie(true, false) c.NewRequest(convertSelectionRequest(c, Requestor, Selection, Target, Property, Time), cookie) return ConvertSelectionCookie{cookie} @@ -7777,9 +7938,8 @@ 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 { +// convertSelectionRequest writes a ConvertSelection request to a byte slice for transfer. +func convertSelectionRequest(c *xgb.Conn, Requestor Window, Selection, Target, Property Atom, Time Timestamp) []byte { size := 24 b := 0 buf := make([]byte, size) @@ -7815,17 +7975,25 @@ type CopyAreaCookie struct { *xgb.Cookie } +// Copies the specified rectangle from SrcDrawable to DstDrawable. +// +// May return a Drawable error if the specified Drawable (Window or Pixmap) does not exist. +// +// May return a GContext error if the specified graphics context does not exist. +// +// May return a Match error if srcDrawable has a different root or depth than DstDrawable. +// // 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 { +func CopyArea(c *xgb.Conn, SrcDrawable, DstDrawable Drawable, Gc Gcontext, SrcX, SrcY, DstX, DstY int16, Width, 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 { +// If an error occurs, it can be retrieved using CopyAreaCookie.Check. +func CopyAreaChecked(c *xgb.Conn, SrcDrawable, DstDrawable Drawable, Gc Gcontext, SrcX, SrcY, DstX, DstY int16, Width, 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} @@ -7837,9 +8005,8 @@ 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 { +// copyAreaRequest writes a CopyArea request to a byte slice for transfer. +func copyAreaRequest(c *xgb.Conn, SrcDrawable, DstDrawable Drawable, Gc Gcontext, SrcX, SrcY, DstX, DstY int16, Width, Height uint16) []byte { size := 28 b := 0 buf := make([]byte, size) @@ -7889,15 +8056,15 @@ type CopyColormapAndFreeCookie struct { // 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 { +func CopyColormapAndFree(c *xgb.Conn, Mid, 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 { +// If an error occurs, it can be retrieved using CopyColormapAndFreeCookie.Check. +func CopyColormapAndFreeChecked(c *xgb.Conn, Mid, SrcCmap Colormap) CopyColormapAndFreeCookie { cookie := c.NewCookie(true, false) c.NewRequest(copyColormapAndFreeRequest(c, Mid, SrcCmap), cookie) return CopyColormapAndFreeCookie{cookie} @@ -7909,9 +8076,8 @@ 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 { +// copyColormapAndFreeRequest writes a CopyColormapAndFree request to a byte slice for transfer. +func copyColormapAndFreeRequest(c *xgb.Conn, Mid, SrcCmap Colormap) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -7940,15 +8106,15 @@ type CopyGCCookie struct { // 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 { +func CopyGC(c *xgb.Conn, SrcGc, 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 { +// If an error occurs, it can be retrieved using CopyGCCookie.Check. +func CopyGCChecked(c *xgb.Conn, SrcGc, DstGc Gcontext, ValueMask uint32) CopyGCCookie { cookie := c.NewCookie(true, false) c.NewRequest(copyGCRequest(c, SrcGc, DstGc, ValueMask), cookie) return CopyGCCookie{cookie} @@ -7960,9 +8126,8 @@ 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 { +// copyGCRequest writes a CopyGC request to a byte slice for transfer. +func copyGCRequest(c *xgb.Conn, SrcGc, DstGc Gcontext, ValueMask uint32) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -7994,15 +8159,15 @@ type CopyPlaneCookie struct { // 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 { +func CopyPlane(c *xgb.Conn, SrcDrawable, DstDrawable Drawable, Gc Gcontext, SrcX, SrcY, DstX, DstY int16, Width, 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 { +// If an error occurs, it can be retrieved using CopyPlaneCookie.Check. +func CopyPlaneChecked(c *xgb.Conn, SrcDrawable, DstDrawable Drawable, Gc Gcontext, SrcX, SrcY, DstX, DstY int16, Width, 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} @@ -8014,9 +8179,8 @@ 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 { +// copyPlaneRequest writes a CopyPlane request to a byte slice for transfer. +func copyPlaneRequest(c *xgb.Conn, SrcDrawable, DstDrawable Drawable, Gc Gcontext, SrcX, SrcY, DstX, DstY int16, Width, Height uint16, BitPlane uint32) []byte { size := 32 b := 0 buf := make([]byte, size) @@ -8076,7 +8240,7 @@ func CreateColormap(c *xgb.Conn, Alloc byte, Mid Colormap, Window Window, Visual } // CreateColormapChecked sends a checked request. -// If an error occurs, it can be retrieved using CreateColormapCookie.Check() +// 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) @@ -8089,8 +8253,7 @@ func (cook CreateColormapCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for CreateColormap -// createColormapRequest writes a CreateColormap request to a byte slice. +// createColormapRequest writes a CreateColormap request to a byte slice for transfer. func createColormapRequest(c *xgb.Conn, Alloc byte, Mid Colormap, Window Window, Visual Visualid) []byte { size := 16 b := 0 @@ -8124,15 +8287,15 @@ 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 Cursor, Source Pixmap, Mask Pixmap, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16, X uint16, Y uint16) CreateCursorCookie { +func CreateCursor(c *xgb.Conn, Cid Cursor, Source, Mask Pixmap, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue, X, 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 { +// If an error occurs, it can be retrieved using CreateCursorCookie.Check. +func CreateCursorChecked(c *xgb.Conn, Cid Cursor, Source, Mask Pixmap, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue, X, 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} @@ -8144,9 +8307,8 @@ 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 { +// createCursorRequest writes a CreateCursor request to a byte slice for transfer. +func createCursorRequest(c *xgb.Conn, Cid Cursor, Source, Mask Pixmap, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue, X, Y uint16) []byte { size := 32 b := 0 buf := make([]byte, size) @@ -8200,6 +8362,15 @@ type CreateGCCookie struct { *xgb.Cookie } +// Creates a graphics context. The graphics context can be used with any drawable +// that has the same root and depth as the specified drawable. +// +// May return a Alloc error if the X server could not allocate the requested resources (no memory?). +// +// May return a Drawable error if the specified Drawable (Window or Pixmap) does not exist. +// +// May return Font, Match, Pixmap, Value errors. +// // 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 { @@ -8209,7 +8380,7 @@ func CreateGC(c *xgb.Conn, Cid Gcontext, Drawable Drawable, ValueMask uint32, Va } // CreateGCChecked sends a checked request. -// If an error occurs, it can be retrieved using CreateGCCookie.Check() +// 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) @@ -8222,8 +8393,7 @@ func (cook CreateGCCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for CreateGC -// createGCRequest writes a CreateGC request to a byte slice. +// createGCRequest writes a CreateGC request to a byte slice for transfer. func createGCRequest(c *xgb.Conn, Cid Gcontext, Drawable Drawable, ValueMask uint32, ValueList []uint32) []byte { size := xgb.Pad((16 + xgb.Pad((4 * xgb.PopCount(int(ValueMask)))))) b := 0 @@ -8260,17 +8430,33 @@ type CreateGlyphCursorCookie struct { *xgb.Cookie } +// Creates a cursor from a font glyph. X provides a set of standard cursor shapes +// in a special font named cursor. Applications are encouraged to use this +// interface for their cursors because the font can be customized for the +// individual display type. +// +// All pixels which are set to 1 in the source will use the foreground color (as +// specified by ForeRed, ForeGreen and ForeBlue). All pixels set to 0 +// will use the background color (as specified by BackRed, BackGreen and +// BackBlue). +// +// May return a Alloc error if the X server could not allocate the requested resources (no memory?). +// +// May return a Font error if the specified SourceFont or MaskFont does not exist. +// +// May return a Value error if either SourceChar or MaskChar are not defined in SourceFont or MaskFont, respectively. +// // 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 { +func CreateGlyphCursor(c *xgb.Conn, Cid Cursor, SourceFont, MaskFont Font, SourceChar, MaskChar, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, 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 { +// If an error occurs, it can be retrieved using CreateGlyphCursorCookie.Check. +func CreateGlyphCursorChecked(c *xgb.Conn, Cid Cursor, SourceFont, MaskFont Font, SourceChar, MaskChar, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, 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} @@ -8282,9 +8468,8 @@ 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 { +// createGlyphCursorRequest writes a CreateGlyphCursor request to a byte slice for transfer. +func createGlyphCursorRequest(c *xgb.Conn, Cid Cursor, SourceFont, MaskFont Font, SourceChar, MaskChar, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue uint16) []byte { size := 32 b := 0 buf := make([]byte, size) @@ -8338,17 +8523,26 @@ type CreatePixmapCookie struct { *xgb.Cookie } +// Creates a pixmap. The pixmap can only be used on the same screen as Drawable +// is on and only with drawables of the same Depth. +// +// May return a Alloc error if the X server could not allocate the requested resources (no memory?). +// +// May return a Drawable error if the specified Drawable (Window or Pixmap) does not exist. +// +// May return Value errors. +// // 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 { +func CreatePixmap(c *xgb.Conn, Depth byte, Pid Pixmap, Drawable Drawable, Width, 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 { +// If an error occurs, it can be retrieved using CreatePixmapCookie.Check. +func CreatePixmapChecked(c *xgb.Conn, Depth byte, Pid Pixmap, Drawable Drawable, Width, Height uint16) CreatePixmapCookie { cookie := c.NewCookie(true, false) c.NewRequest(createPixmapRequest(c, Depth, Pid, Drawable, Width, Height), cookie) return CreatePixmapCookie{cookie} @@ -8360,9 +8554,8 @@ 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 { +// createPixmapRequest writes a CreatePixmap request to a byte slice for transfer. +func createPixmapRequest(c *xgb.Conn, Depth byte, Pid Pixmap, Drawable Drawable, Width, Height uint16) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -8396,17 +8589,36 @@ type CreateWindowCookie struct { *xgb.Cookie } +// Creates an unmapped window as child of the specified Parent window. A +// CreateNotify event will be generated. The new window is placed on top in the +// stacking order with respect to siblings. +// +// The coordinate system has the X axis horizontal and the Y axis vertical with +// the origin [0, 0] at the upper-left corner. Coordinates are integral, in terms +// of pixels, and coincide with pixel centers. Each window and pixmap has its own +// coordinate system. For a window, the origin is inside the border at the inside, +// upper-left corner. +// +// The created window is not yet displayed (mapped), call MapWindow to +// display it. +// +// The created window will initially use the same cursor as its parent. +// +// May return a Alloc error if the X server could not allocate the requested resources (no memory?). +// +// May return Colormap, Cursor, Match, Pixmap, Value, Window errors. +// // 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 { +func CreateWindow(c *xgb.Conn, Depth byte, Wid, Parent Window, X, Y int16, Width, Height, BorderWidth, 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 { +// If an error occurs, it can be retrieved using CreateWindowCookie.Check. +func CreateWindowChecked(c *xgb.Conn, Depth byte, Wid, Parent Window, X, Y int16, Width, Height, BorderWidth, 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} @@ -8418,9 +8630,8 @@ 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 { +// createWindowRequest writes a CreateWindow request to a byte slice for transfer. +func createWindowRequest(c *xgb.Conn, Depth byte, Wid, Parent Window, X, Y int16, Width, Height, BorderWidth, Class uint16, Visual Visualid, ValueMask uint32, ValueList []uint32) []byte { size := xgb.Pad((32 + xgb.Pad((4 * xgb.PopCount(int(ValueMask)))))) b := 0 buf := make([]byte, size) @@ -8487,7 +8698,7 @@ func DeleteProperty(c *xgb.Conn, Window Window, Property Atom) DeletePropertyCoo } // DeletePropertyChecked sends a checked request. -// If an error occurs, it can be retrieved using DeletePropertyCookie.Check() +// 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) @@ -8500,8 +8711,7 @@ func (cook DeletePropertyCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for DeleteProperty -// deletePropertyRequest writes a DeleteProperty request to a byte slice. +// deletePropertyRequest writes a DeleteProperty request to a byte slice for transfer. func deletePropertyRequest(c *xgb.Conn, Window Window, Property Atom) []byte { size := 12 b := 0 @@ -8538,7 +8748,7 @@ func DestroySubwindows(c *xgb.Conn, Window Window) DestroySubwindowsCookie { } // DestroySubwindowsChecked sends a checked request. -// If an error occurs, it can be retrieved using DestroySubwindowsCookie.Check() +// 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) @@ -8551,8 +8761,7 @@ func (cook DestroySubwindowsCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for DestroySubwindows -// destroySubwindowsRequest writes a DestroySubwindows request to a byte slice. +// destroySubwindowsRequest writes a DestroySubwindows request to a byte slice for transfer. func destroySubwindowsRequest(c *xgb.Conn, Window Window) []byte { size := 8 b := 0 @@ -8577,6 +8786,15 @@ type DestroyWindowCookie struct { *xgb.Cookie } +// Destroys the specified window and all of its subwindows. A DestroyNotify event +// is generated for each destroyed window (a DestroyNotify event is first generated +// for any given window's inferiors). If the window was mapped, it will be +// automatically unmapped before destroying. +// +// Calling DestroyWindow on the root window will do nothing. +// +// May return a Window error if the specified window does not exist. +// // 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 { @@ -8586,7 +8804,7 @@ func DestroyWindow(c *xgb.Conn, Window Window) DestroyWindowCookie { } // DestroyWindowChecked sends a checked request. -// If an error occurs, it can be retrieved using DestroyWindowCookie.Check() +// 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) @@ -8599,8 +8817,7 @@ func (cook DestroyWindowCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for DestroyWindow -// destroyWindowRequest writes a DestroyWindow request to a byte slice. +// destroyWindowRequest writes a DestroyWindow request to a byte slice for transfer. func destroyWindowRequest(c *xgb.Conn, Window Window) []byte { size := 8 b := 0 @@ -8627,15 +8844,15 @@ type FillPolyCookie struct { // 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 { +func FillPoly(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Shape, 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 { +// If an error occurs, it can be retrieved using FillPolyCookie.Check. +func FillPolyChecked(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Shape, CoordinateMode byte, Points []Point) FillPolyCookie { cookie := c.NewCookie(true, false) c.NewRequest(fillPolyRequest(c, Drawable, Gc, Shape, CoordinateMode, Points), cookie) return FillPolyCookie{cookie} @@ -8647,9 +8864,8 @@ 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 { +// fillPolyRequest writes a FillPoly request to a byte slice for transfer. +func fillPolyRequest(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Shape, CoordinateMode byte, Points []Point) []byte { size := xgb.Pad((16 + xgb.Pad((len(Points) * 4)))) b := 0 buf := make([]byte, size) @@ -8695,7 +8911,7 @@ func ForceScreenSaver(c *xgb.Conn, Mode byte) ForceScreenSaverCookie { } // ForceScreenSaverChecked sends a checked request. -// If an error occurs, it can be retrieved using ForceScreenSaverCookie.Check() +// 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) @@ -8708,8 +8924,7 @@ func (cook ForceScreenSaverCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for ForceScreenSaver -// forceScreenSaverRequest writes a ForceScreenSaver request to a byte slice. +// forceScreenSaverRequest writes a ForceScreenSaver request to a byte slice for transfer. func forceScreenSaverRequest(c *xgb.Conn, Mode byte) []byte { size := 4 b := 0 @@ -8741,7 +8956,7 @@ func FreeColormap(c *xgb.Conn, Cmap Colormap) FreeColormapCookie { } // FreeColormapChecked sends a checked request. -// If an error occurs, it can be retrieved using FreeColormapCookie.Check() +// 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) @@ -8754,8 +8969,7 @@ func (cook FreeColormapCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for FreeColormap -// freeColormapRequest writes a FreeColormap request to a byte slice. +// freeColormapRequest writes a FreeColormap request to a byte slice for transfer. func freeColormapRequest(c *xgb.Conn, Cmap Colormap) []byte { size := 8 b := 0 @@ -8789,7 +9003,7 @@ func FreeColors(c *xgb.Conn, Cmap Colormap, PlaneMask uint32, Pixels []uint32) F } // FreeColorsChecked sends a checked request. -// If an error occurs, it can be retrieved using FreeColorsCookie.Check() +// 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) @@ -8802,8 +9016,7 @@ func (cook FreeColorsCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for FreeColors -// freeColorsRequest writes a FreeColors request to a byte slice. +// freeColorsRequest writes a FreeColors request to a byte slice for transfer. func freeColorsRequest(c *xgb.Conn, Cmap Colormap, PlaneMask uint32, Pixels []uint32) []byte { size := xgb.Pad((12 + xgb.Pad((len(Pixels) * 4)))) b := 0 @@ -8836,6 +9049,11 @@ type FreeCursorCookie struct { *xgb.Cookie } +// Deletes the association between the cursor resource ID and the specified +// cursor. The cursor is freed when no other resource references it. +// +// May return a Cursor error if the specified cursor does not exist. +// // 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 { @@ -8845,7 +9063,7 @@ func FreeCursor(c *xgb.Conn, Cursor Cursor) FreeCursorCookie { } // FreeCursorChecked sends a checked request. -// If an error occurs, it can be retrieved using FreeCursorCookie.Check() +// 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) @@ -8858,8 +9076,7 @@ func (cook FreeCursorCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for FreeCursor -// freeCursorRequest writes a FreeCursor request to a byte slice. +// freeCursorRequest writes a FreeCursor request to a byte slice for transfer. func freeCursorRequest(c *xgb.Conn, Cursor Cursor) []byte { size := 8 b := 0 @@ -8884,6 +9101,10 @@ type FreeGCCookie struct { *xgb.Cookie } +// Destroys the specified Gc and all associated storage. +// +// May return a GContext error if the specified graphics context does not exist. +// // 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 { @@ -8893,7 +9114,7 @@ func FreeGC(c *xgb.Conn, Gc Gcontext) FreeGCCookie { } // FreeGCChecked sends a checked request. -// If an error occurs, it can be retrieved using FreeGCCookie.Check() +// 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) @@ -8906,8 +9127,7 @@ func (cook FreeGCCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for FreeGC -// freeGCRequest writes a FreeGC request to a byte slice. +// freeGCRequest writes a FreeGC request to a byte slice for transfer. func freeGCRequest(c *xgb.Conn, Gc Gcontext) []byte { size := 8 b := 0 @@ -8932,6 +9152,11 @@ type FreePixmapCookie struct { *xgb.Cookie } +// Deletes the association between the pixmap ID and the pixmap. The pixmap +// storage will be freed when there are no more references to it. +// +// May return a Pixmap error if the specified pixmap does not exist. +// // 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 { @@ -8941,7 +9166,7 @@ func FreePixmap(c *xgb.Conn, Pixmap Pixmap) FreePixmapCookie { } // FreePixmapChecked sends a checked request. -// If an error occurs, it can be retrieved using FreePixmapCookie.Check() +// 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) @@ -8954,8 +9179,7 @@ func (cook FreePixmapCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for FreePixmap -// freePixmapRequest writes a FreePixmap request to a byte slice. +// freePixmapRequest writes a FreePixmap request to a byte slice for transfer. func freePixmapRequest(c *xgb.Conn, Pixmap Pixmap) []byte { size := 8 b := 0 @@ -8981,7 +9205,7 @@ type GetAtomNameCookie struct { } // GetAtomName sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetAtomNameCookie.Reply() +// 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) @@ -9046,8 +9270,7 @@ func getAtomNameReply(buf []byte) *GetAtomNameReply { return v } -// Write request to wire for GetAtomName -// getAtomNameRequest writes a GetAtomName request to a byte slice. +// getAtomNameRequest writes a GetAtomName request to a byte slice for transfer. func getAtomNameRequest(c *xgb.Conn, Atom Atom) []byte { size := 8 b := 0 @@ -9073,7 +9296,7 @@ type GetFontPathCookie struct { } // GetFontPath sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetFontPathCookie.Reply() +// 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) @@ -9134,8 +9357,7 @@ func getFontPathReply(buf []byte) *GetFontPathReply { return v } -// Write request to wire for GetFontPath -// getFontPathRequest writes a GetFontPath request to a byte slice. +// getFontPathRequest writes a GetFontPath request to a byte slice for transfer. func getFontPathRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -9156,8 +9378,12 @@ type GetGeometryCookie struct { *xgb.Cookie } +// Gets the current geometry of the specified drawable (either Window or Pixmap). +// +// May return Drawable, Window errors. +// // GetGeometry sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetGeometryCookie.Reply() +// 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) @@ -9174,14 +9400,25 @@ func GetGeometryUnchecked(c *xgb.Conn, Drawable Drawable) GetGeometryCookie { // 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 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // The depth of the drawable (bits per pixel for the object). + Depth byte + // Root window of the screen containing Drawable. + Root Window + // The X coordinate of Drawable. If Drawable is a window, the coordinate + // specifies the upper-left outer corner relative to its parent's origin. If + // Drawable is a pixmap, the X coordinate is always 0. + X int16 + // The Y coordinate of Drawable. If Drawable is a window, the coordinate + // specifies the upper-left outer corner relative to its parent's origin. If + // Drawable is a pixmap, the Y coordinate is always 0. + Y int16 + // The width of Drawable. + Width uint16 + // The height of Drawable. + Height uint16 + // The border width (in pixels). BorderWidth uint16 // padding: 2 bytes } @@ -9235,8 +9472,7 @@ func getGeometryReply(buf []byte) *GetGeometryReply { return v } -// Write request to wire for GetGeometry -// getGeometryRequest writes a GetGeometry request to a byte slice. +// getGeometryRequest writes a GetGeometry request to a byte slice for transfer. func getGeometryRequest(c *xgb.Conn, Drawable Drawable) []byte { size := 8 b := 0 @@ -9262,8 +9498,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, Format byte, Drawable Drawable, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32) GetImageCookie { +// 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, Y int16, Width, 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} @@ -9271,7 +9507,7 @@ func GetImage(c *xgb.Conn, Format byte, Drawable Drawable, X int16, Y int16, Wid // 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 { +func GetImageUnchecked(c *xgb.Conn, Format byte, Drawable Drawable, X, Y int16, Width, 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} @@ -9325,9 +9561,8 @@ func getImageReply(buf []byte) *GetImageReply { 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 { +// getImageRequest writes a GetImage request to a byte slice for transfer. +func getImageRequest(c *xgb.Conn, Format byte, Drawable Drawable, X, Y int16, Width, Height uint16, PlaneMask uint32) []byte { size := 20 b := 0 buf := make([]byte, size) @@ -9368,7 +9603,7 @@ type GetInputFocusCookie struct { } // GetInputFocus sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetInputFocusCookie.Reply() +// 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) @@ -9423,8 +9658,7 @@ func getInputFocusReply(buf []byte) *GetInputFocusReply { return v } -// Write request to wire for GetInputFocus -// getInputFocusRequest writes a GetInputFocus request to a byte slice. +// getInputFocusRequest writes a GetInputFocus request to a byte slice for transfer. func getInputFocusRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -9446,7 +9680,7 @@ type GetKeyboardControlCookie struct { } // GetKeyboardControl sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetKeyboardControlCookie.Reply() +// 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) @@ -9525,8 +9759,7 @@ func getKeyboardControlReply(buf []byte) *GetKeyboardControlReply { return v } -// Write request to wire for GetKeyboardControl -// getKeyboardControlRequest writes a GetKeyboardControl request to a byte slice. +// getKeyboardControlRequest writes a GetKeyboardControl request to a byte slice for transfer. func getKeyboardControlRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -9548,7 +9781,7 @@ type GetKeyboardMappingCookie struct { } // GetKeyboardMapping sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetKeyboardMappingCookie.Reply() +// 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) @@ -9609,8 +9842,7 @@ func getKeyboardMappingReply(buf []byte) *GetKeyboardMappingReply { return v } -// Write request to wire for GetKeyboardMapping -// getKeyboardMappingRequest writes a GetKeyboardMapping request to a byte slice. +// getKeyboardMappingRequest writes a GetKeyboardMapping request to a byte slice for transfer. func getKeyboardMappingRequest(c *xgb.Conn, FirstKeycode Keycode, Count byte) []byte { size := 8 b := 0 @@ -9639,7 +9871,7 @@ type GetModifierMappingCookie struct { } // GetModifierMapping sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetModifierMappingCookie.Reply() +// 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) @@ -9700,8 +9932,7 @@ func getModifierMappingReply(buf []byte) *GetModifierMappingReply { return v } -// Write request to wire for GetModifierMapping -// getModifierMappingRequest writes a GetModifierMapping request to a byte slice. +// getModifierMappingRequest writes a GetModifierMapping request to a byte slice for transfer. func getModifierMappingRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -9723,8 +9954,8 @@ type GetMotionEventsCookie struct { } // 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 { +// If an error occurs, it will be returned with the reply by calling GetMotionEventsCookie.Reply. +func GetMotionEvents(c *xgb.Conn, Window Window, Start, Stop Timestamp) GetMotionEventsCookie { cookie := c.NewCookie(true, true) c.NewRequest(getMotionEventsRequest(c, Window, Start, Stop), cookie) return GetMotionEventsCookie{cookie} @@ -9732,7 +9963,7 @@ func GetMotionEvents(c *xgb.Conn, Window Window, Start Timestamp, Stop Timestamp // 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 { +func GetMotionEventsUnchecked(c *xgb.Conn, Window Window, Start, Stop Timestamp) GetMotionEventsCookie { cookie := c.NewCookie(false, true) c.NewRequest(getMotionEventsRequest(c, Window, Start, Stop), cookie) return GetMotionEventsCookie{cookie} @@ -9784,9 +10015,8 @@ func getMotionEventsReply(buf []byte) *GetMotionEventsReply { 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 { +// getMotionEventsRequest writes a GetMotionEvents request to a byte slice for transfer. +func getMotionEventsRequest(c *xgb.Conn, Window Window, Start, Stop Timestamp) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -9817,7 +10047,7 @@ type GetPointerControlCookie struct { } // GetPointerControl sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetPointerControlCookie.Reply() +// 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) @@ -9882,8 +10112,7 @@ func getPointerControlReply(buf []byte) *GetPointerControlReply { return v } -// Write request to wire for GetPointerControl -// getPointerControlRequest writes a GetPointerControl request to a byte slice. +// getPointerControlRequest writes a GetPointerControl request to a byte slice for transfer. func getPointerControlRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -9905,7 +10134,7 @@ type GetPointerMappingCookie struct { } // GetPointerMapping sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetPointerMappingCookie.Reply() +// 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) @@ -9964,8 +10193,7 @@ func getPointerMappingReply(buf []byte) *GetPointerMappingReply { return v } -// Write request to wire for GetPointerMapping -// getPointerMappingRequest writes a GetPointerMapping request to a byte slice. +// getPointerMappingRequest writes a GetPointerMapping request to a byte slice for transfer. func getPointerMappingRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -9986,9 +10214,22 @@ type GetPropertyCookie struct { *xgb.Cookie } +// Gets the specified Property from the specified Window. Properties are for +// example the window title (WM_NAME) or its minimum size (WM_NORMAL_HINTS). +// Protocols such as EWMH also use properties - for example EWMH defines the +// window title, encoded as UTF-8 string, in the _NET_WM_NAME property. +// +// May return a Atom error if property or Type do not refer to a valid atom. +// +// May return a Value error if the specified LongOffset is beyond the actual property length (e.g. the +// property has a length of 3 bytes and you are setting LongOffset to 1, +// resulting in a byte offset of 4). +// +// May return a Window error if the specified Window does not exist. +// // 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 { +// 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, Type Atom, LongOffset, LongLength uint32) GetPropertyCookie { cookie := c.NewCookie(true, true) c.NewRequest(getPropertyRequest(c, Delete, Window, Property, Type, LongOffset, LongLength), cookie) return GetPropertyCookie{cookie} @@ -9996,7 +10237,7 @@ func GetProperty(c *xgb.Conn, Delete bool, Window Window, Property Atom, Type At // 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 { +func GetPropertyUnchecked(c *xgb.Conn, Delete bool, Window Window, Property, Type Atom, LongOffset, LongLength uint32) GetPropertyCookie { cookie := c.NewCookie(false, true) c.NewRequest(getPropertyRequest(c, Delete, Window, Property, Type, LongOffset, LongLength), cookie) return GetPropertyCookie{cookie} @@ -10004,12 +10245,20 @@ func GetPropertyUnchecked(c *xgb.Conn, Delete bool, Window Window, Property Atom // 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 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // Specifies whether the data should be viewed as a list of 8-bit, 16-bit, or + // 32-bit quantities. Possible values are 8, 16, and 32. This information allows + // the X server to correctly perform byte-swap operations as necessary. + Format byte + // The actual type of the property (an atom). + Type Atom + // The number of bytes remaining to be read in the property if a partial read was + // performed. BytesAfter uint32 - ValueLen uint32 + // The length of value. You should use the corresponding accessor instead of this + // field. + ValueLen uint32 // padding: 12 bytes Value []byte // size: xgb.Pad(((int(ValueLen) * (int(Format) / 8)) * 1)) } @@ -10058,9 +10307,8 @@ func getPropertyReply(buf []byte) *GetPropertyReply { 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 { +// getPropertyRequest writes a GetProperty request to a byte slice for transfer. +func getPropertyRequest(c *xgb.Conn, Delete bool, Window Window, Property, Type Atom, LongOffset, LongLength uint32) []byte { size := 24 b := 0 buf := make([]byte, size) @@ -10102,7 +10350,7 @@ type GetScreenSaverCookie struct { } // GetScreenSaver sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetScreenSaverCookie.Reply() +// 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) @@ -10171,8 +10419,7 @@ func getScreenSaverReply(buf []byte) *GetScreenSaverReply { return v } -// Write request to wire for GetScreenSaver -// getScreenSaverRequest writes a GetScreenSaver request to a byte slice. +// getScreenSaverRequest writes a GetScreenSaver request to a byte slice for transfer. func getScreenSaverRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -10193,8 +10440,12 @@ type GetSelectionOwnerCookie struct { *xgb.Cookie } +// Gets the owner of the specified selection. +// +// May return a Atom error if selection does not refer to a valid atom. +// // GetSelectionOwner sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetSelectionOwnerCookie.Reply() +// 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) @@ -10214,6 +10465,7 @@ type GetSelectionOwnerReply struct { Sequence uint16 // sequence number of the request for this reply Length uint32 // number of bytes in this reply // padding: 1 bytes + // The current selection owner window. Owner Window } @@ -10248,8 +10500,7 @@ func getSelectionOwnerReply(buf []byte) *GetSelectionOwnerReply { return v } -// Write request to wire for GetSelectionOwner -// getSelectionOwnerRequest writes a GetSelectionOwner request to a byte slice. +// getSelectionOwnerRequest writes a GetSelectionOwner request to a byte slice for transfer. func getSelectionOwnerRequest(c *xgb.Conn, Selection Atom) []byte { size := 8 b := 0 @@ -10274,8 +10525,14 @@ type GetWindowAttributesCookie struct { *xgb.Cookie } +// Gets the current attributes for the specified Window. +// +// May return a Window error if the specified Window does not exist. +// +// May return Drawable errors. +// // GetWindowAttributes sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetWindowAttributesCookie.Reply() +// 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) @@ -10292,22 +10549,31 @@ func GetWindowAttributesUnchecked(c *xgb.Conn, Window Window) GetWindowAttribute // GetWindowAttributesReply represents the data returned from a GetWindowAttributes request. type GetWindowAttributesReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - BackingStore byte - Visual Visualid - Class uint16 - BitGravity byte - WinGravity byte - BackingPlanes uint32 - BackingPixel uint32 - SaveUnder bool - MapIsInstalled bool - MapState byte - OverrideRedirect bool - Colormap Colormap - AllEventMasks uint32 - YourEventMask uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + BackingStore byte + // The associated visual structure of Window. + Visual Visualid + Class uint16 + BitGravity byte + WinGravity byte + // Planes to be preserved if possible. + BackingPlanes uint32 + // Value to be used when restoring planes. + BackingPixel uint32 + // Boolean, should bits under be saved? + SaveUnder bool + MapIsInstalled bool + MapState byte + // Window managers should ignore this window if OverrideRedirect is 1. + OverrideRedirect bool + // Color map to be associated with window. + Colormap Colormap + // Set of events all people have interest in. + AllEventMasks uint32 + // My event mask. + YourEventMask uint32 + // Set of events that should not propagate. DoNotPropagateMask uint16 // padding: 2 bytes } @@ -10397,8 +10663,7 @@ func getWindowAttributesReply(buf []byte) *GetWindowAttributesReply { return v } -// Write request to wire for GetWindowAttributes -// getWindowAttributesRequest writes a GetWindowAttributes request to a byte slice. +// getWindowAttributesRequest writes a GetWindowAttributes request to a byte slice for transfer. func getWindowAttributesRequest(c *xgb.Conn, Window Window) []byte { size := 8 b := 0 @@ -10423,17 +10688,62 @@ type GrabButtonCookie struct { *xgb.Cookie } +// This request establishes a passive grab. The pointer is actively grabbed as +// described in GrabPointer, the last-pointer-grab time is set to the time at +// which the button was pressed (as transmitted in the ButtonPress event), and the +// ButtonPress event is reported if all of the following conditions are true: +// +// The pointer is not grabbed and the specified button is logically pressed when +// the specified modifier keys are logically down, and no other buttons or +// modifier keys are logically down. +// +// The grab-window contains the pointer. +// +// The confine-to window (if any) is viewable. +// +// A passive grab on the same button/key combination does not exist on any +// ancestor of grab-window. +// +// The interpretation of the remaining arguments is the same as for GrabPointer. +// The active grab is terminated automatically when the logical state of the +// pointer has all buttons released, independent of the logical state of modifier +// keys. Note that the logical state of a device (as seen by means of the +// protocol) may lag the physical state if device event processing is frozen. This +// request overrides all previous passive grabs by the same client on the same +// button/key combinations on the same window. A modifier of AnyModifier is +// equivalent to issuing the request for all possible modifier combinations +// (including the combination of no modifiers). It is not required that all +// specified modifiers have currently assigned keycodes. A button of AnyButton is +// equivalent to issuing the request for all possible buttons. Otherwise, it is +// not required that the button specified currently be assigned to a physical +// button. +// +// An Access error is generated if some other client has already issued a +// GrabButton request with the same button/key combination on the same window. +// When using AnyModifier or AnyButton, the request fails completely (no grabs are +// established), and an Access error is generated if there is a conflicting grab +// for any combination. The request has no effect on an active grab. +// +// May return a Access error if another client has already issued a GrabButton with the same button/key +// combination on the same window. +// +// May return a Cursor error if the specified Cursor does not exist. +// +// May return a Window error if the specified Window does not exist. +// +// May return Value errors. +// // 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 { +func GrabButton(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, EventMask uint16, PointerMode, 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 { +// If an error occurs, it can be retrieved using GrabButtonCookie.Check. +func GrabButtonChecked(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, EventMask uint16, PointerMode, 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} @@ -10445,9 +10755,8 @@ 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 { +// grabButtonRequest writes a GrabButton request to a byte slice for transfer. +func grabButtonRequest(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, EventMask uint16, PointerMode, KeyboardMode byte, ConfineTo Window, Cursor Cursor, Button byte, Modifiers uint16) []byte { size := 24 b := 0 buf := make([]byte, size) @@ -10499,17 +10808,55 @@ type GrabKeyCookie struct { *xgb.Cookie } +// Establishes a passive grab on the keyboard. In the future, the keyboard is +// actively grabbed (as for GrabKeyboard), the last-keyboard-grab time is set to +// the time at which the key was pressed (as transmitted in the KeyPress event), +// and the KeyPress event is reported if all of the following conditions are true: +// +// The keyboard is not grabbed and the specified key (which can itself be a +// modifier key) is logically pressed when the specified modifier keys are +// logically down, and no other modifier keys are logically down. +// +// Either the grab_window is an ancestor of (or is) the focus window, or the +// grab_window is a descendant of the focus window and contains the pointer. +// +// A passive grab on the same key combination does not exist on any ancestor of +// grab_window. +// +// The interpretation of the remaining arguments is as for XGrabKeyboard. The active grab is terminated +// automatically when the logical state of the keyboard has the specified key released (independent of the +// logical state of the modifier keys), at which point a KeyRelease event is reported to the grabbing window. +// +// Note that the logical state of a device (as seen by client applications) may lag the physical state if +// device event processing is frozen. +// +// A modifiers argument of AnyModifier is equivalent to issuing the request for all possible modifier combinations (including the combination of no modifiers). It is not required that all modifiers specified +// have currently assigned KeyCodes. A keycode argument of AnyKey is equivalent to issuing the request for +// all possible KeyCodes. Otherwise, the specified keycode must be in the range specified by min_keycode +// and max_keycode in the connection setup, or a BadValue error results. +// +// If some other client has issued a XGrabKey with the same key combination on the same window, a BadAccess +// error results. When using AnyModifier or AnyKey, the request fails completely, and a BadAccess error +// results (no grabs are established) if there is a conflicting grab for any combination. +// +// May return a Access error if another client has already issued a GrabKey with the same button/key +// combination on the same window. +// +// May return a Window error if the specified Window does not exist. +// +// May return Value errors. +// // 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 { +func GrabKey(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, Modifiers uint16, Key Keycode, PointerMode, 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 { +// 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, KeyboardMode byte) GrabKeyCookie { cookie := c.NewCookie(true, false) c.NewRequest(grabKeyRequest(c, OwnerEvents, GrabWindow, Modifiers, Key, PointerMode, KeyboardMode), cookie) return GrabKeyCookie{cookie} @@ -10521,9 +10868,8 @@ 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 { +// grabKeyRequest writes a GrabKey request to a byte slice for transfer. +func grabKeyRequest(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, Modifiers uint16, Key Keycode, PointerMode, KeyboardMode byte) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -10566,9 +10912,24 @@ type GrabKeyboardCookie struct { *xgb.Cookie } +// Actively grabs control of the keyboard and generates FocusIn and FocusOut +// events. Further key events are reported only to the grabbing client. +// +// Any active keyboard grab by this client is overridden. If the keyboard is +// actively grabbed by some other client, AlreadyGrabbed is returned. If +// GrabWindow is not viewable, GrabNotViewable is returned. If the keyboard +// is frozen by an active grab of another client, GrabFrozen is returned. If the +// specified Time is earlier than the last-keyboard-grab time or later than the +// current X server time, GrabInvalidTime is returned. Otherwise, the +// last-keyboard-grab time is set to the specified time. +// +// May return a Window error if the specified Window does not exist. +// +// May return Value errors. +// // 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 { +// 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, KeyboardMode byte) GrabKeyboardCookie { cookie := c.NewCookie(true, true) c.NewRequest(grabKeyboardRequest(c, OwnerEvents, GrabWindow, Time, PointerMode, KeyboardMode), cookie) return GrabKeyboardCookie{cookie} @@ -10576,7 +10937,7 @@ func GrabKeyboard(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, Time Timesta // 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 { +func GrabKeyboardUnchecked(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, Time Timestamp, PointerMode, KeyboardMode byte) GrabKeyboardCookie { cookie := c.NewCookie(false, true) c.NewRequest(grabKeyboardRequest(c, OwnerEvents, GrabWindow, Time, PointerMode, KeyboardMode), cookie) return GrabKeyboardCookie{cookie} @@ -10618,9 +10979,8 @@ func grabKeyboardReply(buf []byte) *GrabKeyboardReply { 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 { +// grabKeyboardRequest writes a GrabKeyboard request to a byte slice for transfer. +func grabKeyboardRequest(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, Time Timestamp, PointerMode, KeyboardMode byte) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -10660,9 +11020,15 @@ type GrabPointerCookie struct { *xgb.Cookie } +// Actively grabs control of the pointer. Further pointer events are reported only to the grabbing client. Overrides any active pointer grab by this client. +// +// May return a Window error if the specified Window does not exist. +// +// May return Value errors. +// // 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 { +// 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, 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} @@ -10670,7 +11036,7 @@ func GrabPointer(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, EventMask uin // 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 { +func GrabPointerUnchecked(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, EventMask uint16, PointerMode, 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} @@ -10712,9 +11078,8 @@ func grabPointerReply(buf []byte) *GrabPointerReply { return v } -// 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 { +// grabPointerRequest writes a GrabPointer request to a byte slice for transfer. +func grabPointerRequest(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, EventMask uint16, PointerMode, KeyboardMode byte, ConfineTo Window, Cursor Cursor, Time Timestamp) []byte { size := 24 b := 0 buf := make([]byte, size) @@ -10770,7 +11135,7 @@ func GrabServer(c *xgb.Conn) GrabServerCookie { } // GrabServerChecked sends a checked request. -// If an error occurs, it can be retrieved using GrabServerCookie.Check() +// 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) @@ -10783,8 +11148,7 @@ func (cook GrabServerCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for GrabServer -// grabServerRequest writes a GrabServer request to a byte slice. +// grabServerRequest writes a GrabServer request to a byte slice for transfer. func grabServerRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -10805,17 +11169,32 @@ type ImageText16Cookie struct { *xgb.Cookie } +// Fills the destination rectangle with the background pixel from Gc, then +// paints the text with the foreground pixel from Gc. The upper-left corner of +// the filled rectangle is at [x, y - font-ascent]. The width is overall-width, +// the height is font-ascent + font-descent. The overall-width, font-ascent and +// font-descent are as returned by QueryTextExtents. +// +// Note that using X core fonts is deprecated (but still supported) in favor of +// client-side rendering using Xft. +// +// May return a Drawable error if the specified Drawable (Window or Pixmap) does not exist. +// +// May return a GContext error if the specified graphics context does not exist. +// +// May return Match errors. +// // 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 { +func ImageText16(c *xgb.Conn, StringLen byte, Drawable Drawable, Gc Gcontext, X, 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 { +// If an error occurs, it can be retrieved using ImageText16Cookie.Check. +func ImageText16Checked(c *xgb.Conn, StringLen byte, Drawable Drawable, Gc Gcontext, X, Y int16, String []Char2b) ImageText16Cookie { cookie := c.NewCookie(true, false) c.NewRequest(imageText16Request(c, StringLen, Drawable, Gc, X, Y, String), cookie) return ImageText16Cookie{cookie} @@ -10827,9 +11206,8 @@ 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 { +// imageText16Request writes a ImageText16 request to a byte slice for transfer. +func imageText16Request(c *xgb.Conn, StringLen byte, Drawable Drawable, Gc Gcontext, X, Y int16, String []Char2b) []byte { size := xgb.Pad((16 + xgb.Pad((int(StringLen) * 2)))) b := 0 buf := make([]byte, size) @@ -10865,17 +11243,32 @@ type ImageText8Cookie struct { *xgb.Cookie } +// Fills the destination rectangle with the background pixel from Gc, then +// paints the text with the foreground pixel from Gc. The upper-left corner of +// the filled rectangle is at [x, y - font-ascent]. The width is overall-width, +// the height is font-ascent + font-descent. The overall-width, font-ascent and +// font-descent are as returned by QueryTextExtents. +// +// Note that using X core fonts is deprecated (but still supported) in favor of +// client-side rendering using Xft. +// +// May return a Drawable error if the specified Drawable (Window or Pixmap) does not exist. +// +// May return a GContext error if the specified graphics context does not exist. +// +// May return Match errors. +// // 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 { +func ImageText8(c *xgb.Conn, StringLen byte, Drawable Drawable, Gc Gcontext, X, 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 { +// If an error occurs, it can be retrieved using ImageText8Cookie.Check. +func ImageText8Checked(c *xgb.Conn, StringLen byte, Drawable Drawable, Gc Gcontext, X, Y int16, String string) ImageText8Cookie { cookie := c.NewCookie(true, false) c.NewRequest(imageText8Request(c, StringLen, Drawable, Gc, X, Y, String), cookie) return ImageText8Cookie{cookie} @@ -10887,9 +11280,8 @@ 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 { +// imageText8Request writes a ImageText8 request to a byte slice for transfer. +func imageText8Request(c *xgb.Conn, StringLen byte, Drawable Drawable, Gc Gcontext, X, Y int16, String string) []byte { size := xgb.Pad((16 + xgb.Pad((int(StringLen) * 1)))) b := 0 buf := make([]byte, size) @@ -10935,7 +11327,7 @@ func InstallColormap(c *xgb.Conn, Cmap Colormap) InstallColormapCookie { } // InstallColormapChecked sends a checked request. -// If an error occurs, it can be retrieved using InstallColormapCookie.Check() +// 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) @@ -10948,8 +11340,7 @@ func (cook InstallColormapCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for InstallColormap -// installColormapRequest writes a InstallColormap request to a byte slice. +// installColormapRequest writes a InstallColormap request to a byte slice for transfer. func installColormapRequest(c *xgb.Conn, Cmap Colormap) []byte { size := 8 b := 0 @@ -10974,8 +11365,20 @@ type InternAtomCookie struct { *xgb.Cookie } +// Retrieves the identifier for the atom with the specified +// name. Atoms are used in protocols like EWMH, for example to store window titles +// (_NET_WM_NAME atom) as property of a window. +// +// If OnlyIfExists is 0, the atom will be created if it does not already exist. +// If OnlyIfExists is 1, AtomNone will be returned if the atom does +// not yet exist. +// +// May return a Value error if a value other than 0 or 1 was specified for OnlyIfExists. +// +// May return Alloc errors. +// // InternAtom sends a checked request. -// If an error occurs, it will be returned with the reply by calling InternAtomCookie.Reply() +// 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) @@ -11029,8 +11432,7 @@ func internAtomReply(buf []byte) *InternAtomReply { return v } -// Write request to wire for InternAtom -// internAtomRequest writes a InternAtom request to a byte slice. +// internAtomRequest writes a InternAtom request to a byte slice for transfer. func internAtomRequest(c *xgb.Conn, OnlyIfExists bool, NameLen uint16, Name string) []byte { size := xgb.Pad((8 + xgb.Pad((int(NameLen) * 1)))) b := 0 @@ -11065,6 +11467,10 @@ type KillClientCookie struct { *xgb.Cookie } +// Forces a close down of the client that created the specified Resource. +// +// May return a Value error if the specified Resource does not exist. +// // 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 { @@ -11074,7 +11480,7 @@ func KillClient(c *xgb.Conn, Resource uint32) KillClientCookie { } // KillClientChecked sends a checked request. -// If an error occurs, it can be retrieved using KillClientCookie.Check() +// 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) @@ -11087,8 +11493,7 @@ func (cook KillClientCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for KillClient -// killClientRequest writes a KillClient request to a byte slice. +// killClientRequest writes a KillClient request to a byte slice for transfer. func killClientRequest(c *xgb.Conn, Resource uint32) []byte { size := 8 b := 0 @@ -11114,7 +11519,7 @@ type ListExtensionsCookie struct { } // ListExtensions sends a checked request. -// If an error occurs, it will be returned with the reply by calling ListExtensionsCookie.Reply() +// 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) @@ -11172,8 +11577,7 @@ func listExtensionsReply(buf []byte) *ListExtensionsReply { return v } -// Write request to wire for ListExtensions -// listExtensionsRequest writes a ListExtensions request to a byte slice. +// listExtensionsRequest writes a ListExtensions request to a byte slice for transfer. func listExtensionsRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -11194,9 +11598,11 @@ type ListFontsCookie struct { *xgb.Cookie } +// Gets a list of available font names which match the given Pattern. +// // 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 { +// If an error occurs, it will be returned with the reply by calling ListFontsCookie.Reply. +func ListFonts(c *xgb.Conn, MaxNames, PatternLen uint16, Pattern string) ListFontsCookie { cookie := c.NewCookie(true, true) c.NewRequest(listFontsRequest(c, MaxNames, PatternLen, Pattern), cookie) return ListFontsCookie{cookie} @@ -11204,7 +11610,7 @@ func ListFonts(c *xgb.Conn, MaxNames uint16, PatternLen uint16, Pattern string) // 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 { +func ListFontsUnchecked(c *xgb.Conn, MaxNames, PatternLen uint16, Pattern string) ListFontsCookie { cookie := c.NewCookie(false, true) c.NewRequest(listFontsRequest(c, MaxNames, PatternLen, Pattern), cookie) return ListFontsCookie{cookie} @@ -11215,6 +11621,7 @@ type ListFontsReply struct { Sequence uint16 // sequence number of the request for this reply Length uint32 // number of bytes in this reply // padding: 1 bytes + // The number of font names. NamesLen uint16 // padding: 22 bytes Names []Str // size: StrListSize(Names) @@ -11256,9 +11663,8 @@ func listFontsReply(buf []byte) *ListFontsReply { return v } -// 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 { +// listFontsRequest writes a ListFonts request to a byte slice for transfer. +func listFontsRequest(c *xgb.Conn, MaxNames, PatternLen uint16, Pattern string) []byte { size := xgb.Pad((8 + xgb.Pad((int(PatternLen) * 1)))) b := 0 buf := make([]byte, size) @@ -11288,9 +11694,11 @@ type ListFontsWithInfoCookie struct { *xgb.Cookie } +// Gets a list of available font names which match the given Pattern. +// // 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 { +// If an error occurs, it will be returned with the reply by calling ListFontsWithInfoCookie.Reply. +func ListFontsWithInfo(c *xgb.Conn, MaxNames, PatternLen uint16, Pattern string) ListFontsWithInfoCookie { cookie := c.NewCookie(true, true) c.NewRequest(listFontsWithInfoRequest(c, MaxNames, PatternLen, Pattern), cookie) return ListFontsWithInfoCookie{cookie} @@ -11298,7 +11706,7 @@ func ListFontsWithInfo(c *xgb.Conn, MaxNames uint16, PatternLen uint16, Pattern // 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 { +func ListFontsWithInfoUnchecked(c *xgb.Conn, MaxNames, PatternLen uint16, Pattern string) ListFontsWithInfoCookie { cookie := c.NewCookie(false, true) c.NewRequest(listFontsWithInfoRequest(c, MaxNames, PatternLen, Pattern), cookie) return ListFontsWithInfoCookie{cookie} @@ -11306,26 +11714,39 @@ func ListFontsWithInfoUnchecked(c *xgb.Conn, MaxNames uint16, PatternLen uint16, // ListFontsWithInfoReply represents the data returned from a ListFontsWithInfo request. type ListFontsWithInfoReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - NameLen byte + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // The number of matched font names. + NameLen byte + // minimum bounds over all existing char MinBounds Charinfo // padding: 4 bytes + // maximum bounds over all existing char MaxBounds Charinfo // padding: 4 bytes + // first character MinCharOrByte2 uint16 + // last character MaxCharOrByte2 uint16 - DefaultChar uint16 - PropertiesLen uint16 - DrawDirection byte - MinByte1 byte - MaxByte1 byte - AllCharsExist bool - FontAscent int16 - FontDescent int16 - RepliesHint uint32 - Properties []Fontprop // size: xgb.Pad((int(PropertiesLen) * 8)) - Name string // size: xgb.Pad((int(NameLen) * 1)) + // char to print for undefined character + DefaultChar uint16 + // how many properties there are + PropertiesLen uint16 + DrawDirection byte + MinByte1 byte + MaxByte1 byte + // flag if all characters have nonzero size + AllCharsExist bool + // baseline to top edge of raster + FontAscent int16 + // baseline to bottom edge of raster + FontDescent int16 + // An indication of how many more fonts will be returned. This is only a hint and + // may be larger or smaller than the number of fonts actually returned. A zero + // value does not guarantee that no more fonts will be returned. + RepliesHint uint32 + Properties []Fontprop // size: xgb.Pad((int(PropertiesLen) * 8)) + Name string // size: xgb.Pad((int(NameLen) * 1)) } // Reply blocks and returns the reply data for a ListFontsWithInfo request. @@ -11414,9 +11835,8 @@ func listFontsWithInfoReply(buf []byte) *ListFontsWithInfoReply { return v } -// 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 { +// listFontsWithInfoRequest writes a ListFontsWithInfo request to a byte slice for transfer. +func listFontsWithInfoRequest(c *xgb.Conn, MaxNames, PatternLen uint16, Pattern string) []byte { size := xgb.Pad((8 + xgb.Pad((int(PatternLen) * 1)))) b := 0 buf := make([]byte, size) @@ -11447,7 +11867,7 @@ type ListHostsCookie struct { } // ListHosts sends a checked request. -// If an error occurs, it will be returned with the reply by calling ListHostsCookie.Reply() +// 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) @@ -11509,8 +11929,7 @@ func listHostsReply(buf []byte) *ListHostsReply { return v } -// Write request to wire for ListHosts -// listHostsRequest writes a ListHosts request to a byte slice. +// listHostsRequest writes a ListHosts request to a byte slice for transfer. func listHostsRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -11532,7 +11951,7 @@ type ListInstalledColormapsCookie struct { } // ListInstalledColormaps sends a checked request. -// If an error occurs, it will be returned with the reply by calling ListInstalledColormapsCookie.Reply() +// 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) @@ -11596,8 +12015,7 @@ func listInstalledColormapsReply(buf []byte) *ListInstalledColormapsReply { return v } -// Write request to wire for ListInstalledColormaps -// listInstalledColormapsRequest writes a ListInstalledColormaps request to a byte slice. +// listInstalledColormapsRequest writes a ListInstalledColormaps request to a byte slice for transfer. func listInstalledColormapsRequest(c *xgb.Conn, Window Window) []byte { size := 8 b := 0 @@ -11623,7 +12041,7 @@ type ListPropertiesCookie struct { } // ListProperties sends a checked request. -// If an error occurs, it will be returned with the reply by calling ListPropertiesCookie.Reply() +// 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) @@ -11687,8 +12105,7 @@ func listPropertiesReply(buf []byte) *ListPropertiesReply { return v } -// Write request to wire for ListProperties -// listPropertiesRequest writes a ListProperties request to a byte slice. +// listPropertiesRequest writes a ListProperties request to a byte slice for transfer. func listPropertiesRequest(c *xgb.Conn, Window Window) []byte { size := 8 b := 0 @@ -11714,7 +12131,7 @@ type LookupColorCookie struct { } // LookupColor sends a checked request. -// If an error occurs, it will be returned with the reply by calling LookupColorCookie.Reply() +// 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) @@ -11788,8 +12205,7 @@ func lookupColorReply(buf []byte) *LookupColorReply { return v } -// Write request to wire for LookupColor -// lookupColorRequest writes a LookupColor request to a byte slice. +// lookupColorRequest writes a LookupColor request to a byte slice for transfer. func lookupColorRequest(c *xgb.Conn, Cmap Colormap, NameLen uint16, Name string) []byte { size := xgb.Pad((12 + xgb.Pad((int(NameLen) * 1)))) b := 0 @@ -11831,7 +12247,7 @@ func MapSubwindows(c *xgb.Conn, Window Window) MapSubwindowsCookie { } // MapSubwindowsChecked sends a checked request. -// If an error occurs, it can be retrieved using MapSubwindowsCookie.Check() +// 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) @@ -11844,8 +12260,7 @@ func (cook MapSubwindowsCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for MapSubwindows -// mapSubwindowsRequest writes a MapSubwindows request to a byte slice. +// mapSubwindowsRequest writes a MapSubwindows request to a byte slice for transfer. func mapSubwindowsRequest(c *xgb.Conn, Window Window) []byte { size := 8 b := 0 @@ -11870,6 +12285,28 @@ type MapWindowCookie struct { *xgb.Cookie } +// Maps the specified window. This means making the window visible (as long as its +// parent is visible). +// +// This MapWindow request will be translated to a MapRequest request if a window +// manager is running. The window manager then decides to either map the window or +// not. Set the override-redirect window attribute to true if you want to bypass +// this mechanism. +// +// If the window manager decides to map the window (or if no window manager is +// running), a MapNotify event is generated. +// +// If the window becomes viewable and no earlier contents for it are remembered, +// the X server tiles the window with its background. If the window's background +// is undefined, the existing screen contents are not altered, and the X server +// generates zero or more Expose events. +// +// If the window type is InputOutput, an Expose event will be generated when the +// window becomes visible. The normal response to an Expose event should be to +// repaint the window. +// +// May return a Match error if the specified window does not exist. +// // 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 { @@ -11879,7 +12316,7 @@ func MapWindow(c *xgb.Conn, Window Window) MapWindowCookie { } // MapWindowChecked sends a checked request. -// If an error occurs, it can be retrieved using MapWindowCookie.Check() +// 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) @@ -11892,8 +12329,7 @@ func (cook MapWindowCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for MapWindow -// mapWindowRequest writes a MapWindow request to a byte slice. +// mapWindowRequest writes a MapWindow request to a byte slice for transfer. func mapWindowRequest(c *xgb.Conn, Window Window) []byte { size := 8 b := 0 @@ -11927,7 +12363,7 @@ func NoOperation(c *xgb.Conn) NoOperationCookie { } // NoOperationChecked sends a checked request. -// If an error occurs, it can be retrieved using NoOperationCookie.Check() +// 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) @@ -11940,8 +12376,7 @@ func (cook NoOperationCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for NoOperation -// noOperationRequest writes a NoOperation request to a byte slice. +// noOperationRequest writes a NoOperation request to a byte slice for transfer. func noOperationRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -11962,6 +12397,13 @@ type OpenFontCookie struct { *xgb.Cookie } +// Opens any X core font matching the given Name (for example "-misc-fixed-*"). +// +// Note that X core fonts are deprecated (but still supported) in favor of +// client-side rendering using Xft. +// +// May return a Name error if no font matches the given Name. +// // 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 { @@ -11971,7 +12413,7 @@ func OpenFont(c *xgb.Conn, Fid Font, NameLen uint16, Name string) OpenFontCookie } // OpenFontChecked sends a checked request. -// If an error occurs, it can be retrieved using OpenFontCookie.Check() +// 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) @@ -11984,8 +12426,7 @@ func (cook OpenFontCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for OpenFont -// openFontRequest writes a OpenFont request to a byte slice. +// openFontRequest writes a OpenFont request to a byte slice for transfer. func openFontRequest(c *xgb.Conn, Fid Font, NameLen uint16, Name string) []byte { size := xgb.Pad((12 + xgb.Pad((int(NameLen) * 1)))) b := 0 @@ -12027,7 +12468,7 @@ func PolyArc(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Arcs []Arc) PolyArcCoo } // PolyArcChecked sends a checked request. -// If an error occurs, it can be retrieved using PolyArcCookie.Check() +// 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) @@ -12040,8 +12481,7 @@ func (cook PolyArcCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for PolyArc -// polyArcRequest writes a PolyArc request to a byte slice. +// polyArcRequest writes a PolyArc request to a byte slice for transfer. func polyArcRequest(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Arcs []Arc) []byte { size := xgb.Pad((12 + xgb.Pad((len(Arcs) * 12)))) b := 0 @@ -12080,7 +12520,7 @@ func PolyFillArc(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Arcs []Arc) PolyFi } // PolyFillArcChecked sends a checked request. -// If an error occurs, it can be retrieved using PolyFillArcCookie.Check() +// 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) @@ -12093,8 +12533,7 @@ func (cook PolyFillArcCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for PolyFillArc -// polyFillArcRequest writes a PolyFillArc request to a byte slice. +// polyFillArcRequest writes a PolyFillArc request to a byte slice for transfer. func polyFillArcRequest(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Arcs []Arc) []byte { size := xgb.Pad((12 + xgb.Pad((len(Arcs) * 12)))) b := 0 @@ -12124,6 +12563,16 @@ type PolyFillRectangleCookie struct { *xgb.Cookie } +// Fills the specified rectangle(s) in the order listed in the array. For any +// given rectangle, each pixel is not drawn more than once. If rectangles +// intersect, the intersecting pixels are drawn multiple times. +// +// May return a Drawable error if the specified Drawable (Window or Pixmap) does not exist. +// +// May return a GContext error if the specified graphics context does not exist. +// +// May return Match errors. +// // 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 { @@ -12133,7 +12582,7 @@ func PolyFillRectangle(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Rectangles [ } // PolyFillRectangleChecked sends a checked request. -// If an error occurs, it can be retrieved using PolyFillRectangleCookie.Check() +// 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) @@ -12146,8 +12595,7 @@ func (cook PolyFillRectangleCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for PolyFillRectangle -// polyFillRectangleRequest writes a PolyFillRectangle request to a byte slice. +// polyFillRectangleRequest writes a PolyFillRectangle request to a byte slice for transfer. func polyFillRectangleRequest(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Rectangles []Rectangle) []byte { size := xgb.Pad((12 + xgb.Pad((len(Rectangles) * 8)))) b := 0 @@ -12177,6 +12625,17 @@ type PolyLineCookie struct { *xgb.Cookie } +// Draws PointsLen-1 lines between each pair of points (point[i], point[i+1]) +// in the Points array. The lines are drawn in the order listed in the array. +// They join correctly at all intermediate points, and if the first and last +// points coincide, the first and last lines also join correctly. For any given +// line, a pixel is not drawn more than once. If thin (zero line-width) lines +// intersect, the intersecting pixels are drawn multiple times. If wide lines +// intersect, the intersecting pixels are drawn only once, as though the entire +// request were a single, filled shape. +// +// May return Drawable, GContext, Match, Value errors. +// // 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 { @@ -12186,7 +12645,7 @@ func PolyLine(c *xgb.Conn, CoordinateMode byte, Drawable Drawable, Gc Gcontext, } // PolyLineChecked sends a checked request. -// If an error occurs, it can be retrieved using PolyLineCookie.Check() +// 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) @@ -12199,8 +12658,7 @@ func (cook PolyLineCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for PolyLine -// polyLineRequest writes a PolyLine request to a byte slice. +// polyLineRequest writes a PolyLine request to a byte slice for transfer. 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 @@ -12240,7 +12698,7 @@ func PolyPoint(c *xgb.Conn, CoordinateMode byte, Drawable Drawable, Gc Gcontext, } // PolyPointChecked sends a checked request. -// If an error occurs, it can be retrieved using PolyPointCookie.Check() +// 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) @@ -12253,8 +12711,7 @@ func (cook PolyPointCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for PolyPoint -// polyPointRequest writes a PolyPoint request to a byte slice. +// polyPointRequest writes a PolyPoint request to a byte slice for transfer. 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 @@ -12294,7 +12751,7 @@ func PolyRectangle(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Rectangles []Rec } // PolyRectangleChecked sends a checked request. -// If an error occurs, it can be retrieved using PolyRectangleCookie.Check() +// 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) @@ -12307,8 +12764,7 @@ func (cook PolyRectangleCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for PolyRectangle -// polyRectangleRequest writes a PolyRectangle request to a byte slice. +// polyRectangleRequest writes a PolyRectangle request to a byte slice for transfer. func polyRectangleRequest(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Rectangles []Rectangle) []byte { size := xgb.Pad((12 + xgb.Pad((len(Rectangles) * 8)))) b := 0 @@ -12338,6 +12794,18 @@ type PolySegmentCookie struct { *xgb.Cookie } +// Draws multiple, unconnected lines. For each segment, a line is drawn between +// (x1, y1) and (x2, y2). The lines are drawn in the order listed in the array of +// Segment structures and does not perform joining at coincident +// endpoints. For any given line, a pixel is not drawn more than once. If lines +// intersect, the intersecting pixels are drawn multiple times. +// +// May return a Drawable error if the specified Drawable does not exist. +// +// May return a GContext error if the specified Gc does not exist. +// +// May return Match errors. +// // 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 { @@ -12347,7 +12815,7 @@ func PolySegment(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Segments []Segment } // PolySegmentChecked sends a checked request. -// If an error occurs, it can be retrieved using PolySegmentCookie.Check() +// 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) @@ -12360,8 +12828,7 @@ func (cook PolySegmentCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for PolySegment -// polySegmentRequest writes a PolySegment request to a byte slice. +// polySegmentRequest writes a PolySegment request to a byte slice for transfer. func polySegmentRequest(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Segments []Segment) []byte { size := xgb.Pad((12 + xgb.Pad((len(Segments) * 8)))) b := 0 @@ -12393,15 +12860,15 @@ type PolyText16Cookie struct { // 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 { +func PolyText16(c *xgb.Conn, Drawable Drawable, Gc Gcontext, X, 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 { +// If an error occurs, it can be retrieved using PolyText16Cookie.Check. +func PolyText16Checked(c *xgb.Conn, Drawable Drawable, Gc Gcontext, X, Y int16, Items []byte) PolyText16Cookie { cookie := c.NewCookie(true, false) c.NewRequest(polyText16Request(c, Drawable, Gc, X, Y, Items), cookie) return PolyText16Cookie{cookie} @@ -12413,9 +12880,8 @@ 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 { +// polyText16Request writes a PolyText16 request to a byte slice for transfer. +func polyText16Request(c *xgb.Conn, Drawable Drawable, Gc Gcontext, X, Y int16, Items []byte) []byte { size := xgb.Pad((16 + xgb.Pad((len(Items) * 1)))) b := 0 buf := make([]byte, size) @@ -12453,15 +12919,15 @@ type PolyText8Cookie struct { // 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 { +func PolyText8(c *xgb.Conn, Drawable Drawable, Gc Gcontext, X, 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 { +// If an error occurs, it can be retrieved using PolyText8Cookie.Check. +func PolyText8Checked(c *xgb.Conn, Drawable Drawable, Gc Gcontext, X, Y int16, Items []byte) PolyText8Cookie { cookie := c.NewCookie(true, false) c.NewRequest(polyText8Request(c, Drawable, Gc, X, Y, Items), cookie) return PolyText8Cookie{cookie} @@ -12473,9 +12939,8 @@ 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 { +// polyText8Request writes a PolyText8 request to a byte slice for transfer. +func polyText8Request(c *xgb.Conn, Drawable Drawable, Gc Gcontext, X, Y int16, Items []byte) []byte { size := xgb.Pad((16 + xgb.Pad((len(Items) * 1)))) b := 0 buf := make([]byte, size) @@ -12513,15 +12978,15 @@ 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, Format byte, Drawable Drawable, Gc Gcontext, Width uint16, Height uint16, DstX int16, DstY int16, LeftPad byte, Depth byte, Data []byte) PutImageCookie { +func PutImage(c *xgb.Conn, Format byte, Drawable Drawable, Gc Gcontext, Width, Height uint16, DstX, DstY int16, LeftPad, 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 { +// If an error occurs, it can be retrieved using PutImageCookie.Check. +func PutImageChecked(c *xgb.Conn, Format byte, Drawable Drawable, Gc Gcontext, Width, Height uint16, DstX, DstY int16, LeftPad, 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} @@ -12533,9 +12998,8 @@ 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 { +// putImageRequest writes a PutImage request to a byte slice for transfer. +func putImageRequest(c *xgb.Conn, Format byte, Drawable Drawable, Gc Gcontext, Width, Height uint16, DstX, DstY int16, LeftPad, Depth byte, Data []byte) []byte { size := xgb.Pad((24 + xgb.Pad((len(Data) * 1)))) b := 0 buf := make([]byte, size) @@ -12587,8 +13051,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, Class byte, Drawable Drawable, Width uint16, Height uint16) QueryBestSizeCookie { +// 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, Height uint16) QueryBestSizeCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryBestSizeRequest(c, Class, Drawable, Width, Height), cookie) return QueryBestSizeCookie{cookie} @@ -12596,7 +13060,7 @@ func QueryBestSize(c *xgb.Conn, Class byte, Drawable Drawable, Width uint16, Hei // 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 { +func QueryBestSizeUnchecked(c *xgb.Conn, Class byte, Drawable Drawable, Width, Height uint16) QueryBestSizeCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryBestSizeRequest(c, Class, Drawable, Width, Height), cookie) return QueryBestSizeCookie{cookie} @@ -12645,9 +13109,8 @@ func queryBestSizeReply(buf []byte) *QueryBestSizeReply { 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 { +// queryBestSizeRequest writes a QueryBestSize request to a byte slice for transfer. +func queryBestSizeRequest(c *xgb.Conn, Class byte, Drawable Drawable, Width, Height uint16) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -12679,7 +13142,7 @@ type QueryColorsCookie struct { } // QueryColors sends a checked request. -// If an error occurs, it will be returned with the reply by calling QueryColorsCookie.Reply() +// 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) @@ -12740,8 +13203,7 @@ func queryColorsReply(buf []byte) *QueryColorsReply { return v } -// Write request to wire for QueryColors -// queryColorsRequest writes a QueryColors request to a byte slice. +// queryColorsRequest writes a QueryColors request to a byte slice for transfer. func queryColorsRequest(c *xgb.Conn, Cmap Colormap, Pixels []uint32) []byte { size := xgb.Pad((8 + xgb.Pad((len(Pixels) * 4)))) b := 0 @@ -12771,8 +13233,18 @@ type QueryExtensionCookie struct { *xgb.Cookie } +// Determines if the specified extension is present on this X11 server. +// +// Every extension has a unique MajorOpcode to identify requests, the minor +// opcodes and request formats are extension-specific. If the extension provides +// events and errors, the FirstEvent and FirstError fields in the reply are +// set accordingly. +// +// There should rarely be a need to use this request directly, XCB provides the +// GetExtensionData function instead. +// // QueryExtension sends a checked request. -// If an error occurs, it will be returned with the reply by calling QueryExtensionCookie.Reply() +// 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) @@ -12792,10 +13264,14 @@ 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 + // Whether the extension is present on this X11 server. + Present bool + // The major opcode for requests. MajorOpcode byte - FirstEvent byte - FirstError byte + // The first event code, if any. + FirstEvent byte + // The first error code, if any. + FirstError byte } // Reply blocks and returns the reply data for a QueryExtension request. @@ -12842,8 +13318,7 @@ func queryExtensionReply(buf []byte) *QueryExtensionReply { return v } -// Write request to wire for QueryExtension -// queryExtensionRequest writes a QueryExtension request to a byte slice. +// queryExtensionRequest writes a QueryExtension request to a byte slice for transfer. func queryExtensionRequest(c *xgb.Conn, NameLen uint16, Name string) []byte { size := xgb.Pad((8 + xgb.Pad((int(NameLen) * 1)))) b := 0 @@ -12873,8 +13348,10 @@ type QueryFontCookie struct { *xgb.Cookie } +// Queries information associated with the font. +// // QueryFont sends a checked request. -// If an error occurs, it will be returned with the reply by calling QueryFontCookie.Reply() +// 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) @@ -12894,23 +13371,32 @@ type QueryFontReply struct { Sequence uint16 // sequence number of the request for this reply Length uint32 // number of bytes in this reply // padding: 1 bytes + // minimum bounds over all existing char MinBounds Charinfo // padding: 4 bytes + // maximum bounds over all existing char MaxBounds Charinfo // padding: 4 bytes + // first character MinCharOrByte2 uint16 + // last character 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)) + // char to print for undefined character + DefaultChar uint16 + // how many properties there are + PropertiesLen uint16 + DrawDirection byte + MinByte1 byte + MaxByte1 byte + // flag if all characters have nonzero size + AllCharsExist bool + // baseline to top edge of raster + FontAscent int16 + // baseline to bottom edge of raster + 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. @@ -12994,8 +13480,7 @@ func queryFontReply(buf []byte) *QueryFontReply { return v } -// Write request to wire for QueryFont -// queryFontRequest writes a QueryFont request to a byte slice. +// queryFontRequest writes a QueryFont request to a byte slice for transfer. func queryFontRequest(c *xgb.Conn, Font Fontable) []byte { size := 8 b := 0 @@ -13021,7 +13506,7 @@ type QueryKeymapCookie struct { } // QueryKeymap sends a checked request. -// If an error occurs, it will be returned with the reply by calling QueryKeymapCookie.Reply() +// 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) @@ -13076,8 +13561,7 @@ func queryKeymapReply(buf []byte) *QueryKeymapReply { return v } -// Write request to wire for QueryKeymap -// queryKeymapRequest writes a QueryKeymap request to a byte slice. +// queryKeymapRequest writes a QueryKeymap request to a byte slice for transfer. func queryKeymapRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -13098,8 +13582,13 @@ type QueryPointerCookie struct { *xgb.Cookie } +// Gets the root window the pointer is logically on and the pointer coordinates +// relative to the root window's origin. +// +// May return a Window error if the specified Window does not exist. +// // QueryPointer sends a checked request. -// If an error occurs, it will be returned with the reply by calling QueryPointerCookie.Reply() +// 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) @@ -13116,16 +13605,33 @@ func QueryPointerUnchecked(c *xgb.Conn, Window Window) QueryPointerCookie { // 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 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // If SameScreen is False, then the pointer is not on the same screen as the + // argument window, Child is None, and WinX and WinY are zero. If + // SameScreen is True, then WinX and WinY are the pointer coordinates + // relative to the argument window's origin, and child is the child containing the + // pointer, if any. SameScreen bool - Root Window - Child Window - RootX int16 - RootY int16 - WinX int16 - WinY int16 - Mask uint16 + // The root window the pointer is logically on. + Root Window + // The child window containing the pointer, if any, if SameScreen is true. If + // SameScreen is false, None is returned. + Child Window + // The pointer X position, relative to Root. + RootX int16 + // The pointer Y position, relative to Root. + RootY int16 + // The pointer X coordinate, relative to Child, if SameScreen is true. Zero + // otherwise. + WinX int16 + // The pointer Y coordinate, relative to Child, if SameScreen is true. Zero + // otherwise. + WinY int16 + // The current logical state of the modifier keys and the buttons. Note that the + // logical state of a device (as seen by means of the protocol) may lag the + // physical state if device event processing is frozen. + Mask uint16 // padding: 2 bytes } @@ -13185,8 +13691,7 @@ func queryPointerReply(buf []byte) *QueryPointerReply { return v } -// Write request to wire for QueryPointer -// queryPointerRequest writes a QueryPointer request to a byte slice. +// queryPointerRequest writes a QueryPointer request to a byte slice for transfer. func queryPointerRequest(c *xgb.Conn, Window Window) []byte { size := 8 b := 0 @@ -13211,8 +13716,34 @@ type QueryTextExtentsCookie struct { *xgb.Cookie } +// Query text extents from the X11 server. This request returns the bounding box +// of the specified 16-bit character string in the specified Font or the font +// contained in the specified graphics context. +// +// FontAscent is set to the maximum of the ascent metrics of all characters in +// the string. FontDescent is set to the maximum of the descent metrics. +// OverallWidth is set to the sum of the character-width metrics of all +// characters in the string. For each character in the string, let W be the sum of +// the character-width metrics of all characters preceding it in the string. Let L +// be the left-side-bearing metric of the character plus W. Let R be the +// right-side-bearing metric of the character plus W. The lbearing member is set +// to the minimum L of all characters in the string. The rbearing member is set to +// the maximum R. +// +// For fonts defined with linear indexing rather than 2-byte matrix indexing, each +// Char2b structure is interpreted as a 16-bit number with byte1 as the +// most significant byte. If the font has no defined default character, undefined +// characters in the string are taken to have all zero metrics. +// +// Characters with all zero metrics are ignored. If the font has no defined +// default_char, the undefined characters in the string are also ignored. +// +// May return a Font error if the specified Font does not exist. +// +// May return a GContext error if the specified graphics context does not exist. +// // QueryTextExtents sends a checked request. -// If an error occurs, it will be returned with the reply by calling QueryTextExtentsCookie.Reply() +// 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) @@ -13291,8 +13822,7 @@ func queryTextExtentsReply(buf []byte) *QueryTextExtentsReply { return v } -// Write request to wire for QueryTextExtents -// queryTextExtentsRequest writes a QueryTextExtents request to a byte slice. +// queryTextExtentsRequest writes a QueryTextExtents request to a byte slice for transfer. func queryTextExtentsRequest(c *xgb.Conn, Font Fontable, String []Char2b, StringLen uint16) []byte { size := xgb.Pad((8 + xgb.Pad((len(String) * 2)))) b := 0 @@ -13322,8 +13852,11 @@ type QueryTreeCookie struct { *xgb.Cookie } +// Gets the root window ID, parent window ID and list of children windows for the +// specified Window. The children are listed in bottom-to-top stacking order. +// // QueryTree sends a checked request. -// If an error occurs, it will be returned with the reply by calling QueryTreeCookie.Reply() +// 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) @@ -13343,8 +13876,11 @@ 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 + // The root window of Window. + Root Window + // The parent window of Window. + Parent Window + // The number of child windows. ChildrenLen uint16 // padding: 14 bytes Children []Window // size: xgb.Pad((int(ChildrenLen) * 4)) @@ -13395,8 +13931,7 @@ func queryTreeReply(buf []byte) *QueryTreeReply { return v } -// Write request to wire for QueryTree -// queryTreeRequest writes a QueryTree request to a byte slice. +// queryTreeRequest writes a QueryTree request to a byte slice for transfer. func queryTreeRequest(c *xgb.Conn, Window Window) []byte { size := 8 b := 0 @@ -13423,15 +13958,15 @@ type RecolorCursorCookie struct { // 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 { +func RecolorCursor(c *xgb.Conn, Cursor Cursor, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, 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 { +// If an error occurs, it can be retrieved using RecolorCursorCookie.Check. +func RecolorCursorChecked(c *xgb.Conn, Cursor Cursor, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue uint16) RecolorCursorCookie { cookie := c.NewCookie(true, false) c.NewRequest(recolorCursorRequest(c, Cursor, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue), cookie) return RecolorCursorCookie{cookie} @@ -13443,9 +13978,8 @@ 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 { +// recolorCursorRequest writes a RecolorCursor request to a byte slice for transfer. +func recolorCursorRequest(c *xgb.Conn, Cursor Cursor, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue uint16) []byte { size := 20 b := 0 buf := make([]byte, size) @@ -13487,17 +14021,34 @@ type ReparentWindowCookie struct { *xgb.Cookie } +// Makes the specified window a child of the specified parent window. If the +// window is mapped, it will automatically be unmapped before reparenting and +// re-mapped after reparenting. The window is placed in the stacking order on top +// with respect to sibling windows. +// +// After reparenting, a ReparentNotify event is generated. +// +// May return a Match error if the new parent window is not on the same screen as the old parent window. +// +// The new parent window is the specified window or an inferior of the specified window. +// +// The new parent is InputOnly and the window is not. +// +// The specified window has a ParentRelative background and the new parent window is not the same depth as the specified window. +// +// May return a Window error if the specified window does not exist. +// // 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 { +func ReparentWindow(c *xgb.Conn, Window, Parent Window, X, 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 { +// If an error occurs, it can be retrieved using ReparentWindowCookie.Check. +func ReparentWindowChecked(c *xgb.Conn, Window, Parent Window, X, Y int16) ReparentWindowCookie { cookie := c.NewCookie(true, false) c.NewRequest(reparentWindowRequest(c, Window, Parent, X, Y), cookie) return ReparentWindowCookie{cookie} @@ -13509,9 +14060,8 @@ 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 { +// reparentWindowRequest writes a ReparentWindow request to a byte slice for transfer. +func reparentWindowRequest(c *xgb.Conn, Window, Parent Window, X, Y int16) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -13553,7 +14103,7 @@ func RotateProperties(c *xgb.Conn, Window Window, AtomsLen uint16, Delta int16, } // RotatePropertiesChecked sends a checked request. -// If an error occurs, it can be retrieved using RotatePropertiesCookie.Check() +// 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) @@ -13566,8 +14116,7 @@ func (cook RotatePropertiesCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for RotateProperties -// rotatePropertiesRequest writes a RotateProperties request to a byte slice. +// rotatePropertiesRequest writes a RotateProperties request to a byte slice for transfer. 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 @@ -13603,6 +14152,18 @@ type SendEventCookie struct { *xgb.Cookie } +// Identifies the Destination window, determines which clients should receive +// the specified event and ignores any active grabs. +// +// The Event must be one of the core events or an event defined by an extension, +// so that the X server can correctly byte-swap the contents as necessary. The +// contents of Event are otherwise unaltered and unchecked except for the +// SendEvent field which is forced to 'true'. +// +// May return a Value error if the given Event is neither a core event nor an event defined by an extension. +// +// May return a Window error if the specified Destination window does not exist. +// // 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 { @@ -13612,7 +14173,7 @@ func SendEvent(c *xgb.Conn, Propagate bool, Destination Window, EventMask uint32 } // SendEventChecked sends a checked request. -// If an error occurs, it can be retrieved using SendEventCookie.Check() +// 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) @@ -13625,8 +14186,7 @@ func (cook SendEventCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for SendEvent -// sendEventRequest writes a SendEvent request to a byte slice. +// sendEventRequest writes a SendEvent request to a byte slice for transfer. func sendEventRequest(c *xgb.Conn, Propagate bool, Destination Window, EventMask uint32, Event string) []byte { size := 44 b := 0 @@ -13671,7 +14231,7 @@ func SetAccessControl(c *xgb.Conn, Mode byte) SetAccessControlCookie { } // SetAccessControlChecked sends a checked request. -// If an error occurs, it can be retrieved using SetAccessControlCookie.Check() +// 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) @@ -13684,8 +14244,7 @@ func (cook SetAccessControlCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for SetAccessControl -// setAccessControlRequest writes a SetAccessControl request to a byte slice. +// setAccessControlRequest writes a SetAccessControl request to a byte slice for transfer. func setAccessControlRequest(c *xgb.Conn, Mode byte) []byte { size := 4 b := 0 @@ -13710,15 +14269,15 @@ type SetClipRectanglesCookie struct { // 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 { +func SetClipRectangles(c *xgb.Conn, Ordering byte, Gc Gcontext, ClipXOrigin, 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 { +// If an error occurs, it can be retrieved using SetClipRectanglesCookie.Check. +func SetClipRectanglesChecked(c *xgb.Conn, Ordering byte, Gc Gcontext, ClipXOrigin, ClipYOrigin int16, Rectangles []Rectangle) SetClipRectanglesCookie { cookie := c.NewCookie(true, false) c.NewRequest(setClipRectanglesRequest(c, Ordering, Gc, ClipXOrigin, ClipYOrigin, Rectangles), cookie) return SetClipRectanglesCookie{cookie} @@ -13730,9 +14289,8 @@ 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 { +// setClipRectanglesRequest writes a SetClipRectangles request to a byte slice for transfer. +func setClipRectanglesRequest(c *xgb.Conn, Ordering byte, Gc Gcontext, ClipXOrigin, ClipYOrigin int16, Rectangles []Rectangle) []byte { size := xgb.Pad((12 + xgb.Pad((len(Rectangles) * 8)))) b := 0 buf := make([]byte, size) @@ -13774,7 +14332,7 @@ func SetCloseDownMode(c *xgb.Conn, Mode byte) SetCloseDownModeCookie { } // SetCloseDownModeChecked sends a checked request. -// If an error occurs, it can be retrieved using SetCloseDownModeCookie.Check() +// 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) @@ -13787,8 +14345,7 @@ func (cook SetCloseDownModeCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for SetCloseDownMode -// setCloseDownModeRequest writes a SetCloseDownMode request to a byte slice. +// setCloseDownModeRequest writes a SetCloseDownMode request to a byte slice for transfer. func setCloseDownModeRequest(c *xgb.Conn, Mode byte) []byte { size := 4 b := 0 @@ -13813,15 +14370,15 @@ type SetDashesCookie struct { // 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 { +func SetDashes(c *xgb.Conn, Gc Gcontext, DashOffset, 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 { +// If an error occurs, it can be retrieved using SetDashesCookie.Check. +func SetDashesChecked(c *xgb.Conn, Gc Gcontext, DashOffset, DashesLen uint16, Dashes []byte) SetDashesCookie { cookie := c.NewCookie(true, false) c.NewRequest(setDashesRequest(c, Gc, DashOffset, DashesLen, Dashes), cookie) return SetDashesCookie{cookie} @@ -13833,9 +14390,8 @@ 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 { +// setDashesRequest writes a SetDashes request to a byte slice for transfer. +func setDashesRequest(c *xgb.Conn, Gc Gcontext, DashOffset, DashesLen uint16, Dashes []byte) []byte { size := xgb.Pad((12 + xgb.Pad((int(DashesLen) * 1)))) b := 0 buf := make([]byte, size) @@ -13877,7 +14433,7 @@ func SetFontPath(c *xgb.Conn, FontQty uint16, Font []Str) SetFontPathCookie { } // SetFontPathChecked sends a checked request. -// If an error occurs, it can be retrieved using SetFontPathCookie.Check() +// 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) @@ -13890,8 +14446,7 @@ func (cook SetFontPathCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for SetFontPath -// setFontPathRequest writes a SetFontPath request to a byte slice. +// setFontPathRequest writes a SetFontPath request to a byte slice for transfer. func setFontPathRequest(c *xgb.Conn, FontQty uint16, Font []Str) []byte { size := xgb.Pad((8 + StrListSize(Font))) b := 0 @@ -13920,6 +14475,18 @@ type SetInputFocusCookie struct { *xgb.Cookie } +// Changes the input focus and the last-focus-change time. If the specified Time +// is earlier than the current last-focus-change time, the request is ignored (to +// avoid race conditions when running X over the network). +// +// A FocusIn and FocusOut event is generated when focus is changed. +// +// May return a Match error if the specified Focus window is not viewable. +// +// May return a Window error if the specified Focus window does not exist. +// +// May return Value errors. +// // 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 { @@ -13929,7 +14496,7 @@ func SetInputFocus(c *xgb.Conn, RevertTo byte, Focus Window, Time Timestamp) Set } // SetInputFocusChecked sends a checked request. -// If an error occurs, it can be retrieved using SetInputFocusCookie.Check() +// 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) @@ -13942,8 +14509,7 @@ func (cook SetInputFocusCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for SetInputFocus -// setInputFocusRequest writes a SetInputFocus request to a byte slice. +// setInputFocusRequest writes a SetInputFocus request to a byte slice for transfer. func setInputFocusRequest(c *xgb.Conn, RevertTo byte, Focus Window, Time Timestamp) []byte { size := 12 b := 0 @@ -13973,7 +14539,7 @@ type SetModifierMappingCookie struct { } // SetModifierMapping sends a checked request. -// If an error occurs, it will be returned with the reply by calling SetModifierMappingCookie.Reply() +// 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) @@ -14024,8 +14590,7 @@ func setModifierMappingReply(buf []byte) *SetModifierMappingReply { return v } -// Write request to wire for SetModifierMapping -// setModifierMappingRequest writes a SetModifierMapping request to a byte slice. +// setModifierMappingRequest writes a SetModifierMapping request to a byte slice for transfer. func setModifierMappingRequest(c *xgb.Conn, KeycodesPerModifier byte, Keycodes []Keycode) []byte { size := xgb.Pad((4 + xgb.Pad(((int(KeycodesPerModifier) * 8) * 1)))) b := 0 @@ -14054,7 +14619,7 @@ type SetPointerMappingCookie struct { } // SetPointerMapping sends a checked request. -// If an error occurs, it will be returned with the reply by calling SetPointerMappingCookie.Reply() +// 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) @@ -14105,8 +14670,7 @@ func setPointerMappingReply(buf []byte) *SetPointerMappingReply { return v } -// Write request to wire for SetPointerMapping -// setPointerMappingRequest writes a SetPointerMapping request to a byte slice. +// setPointerMappingRequest writes a SetPointerMapping request to a byte slice for transfer. func setPointerMappingRequest(c *xgb.Conn, MapLen byte, Map []byte) []byte { size := xgb.Pad((4 + xgb.Pad((int(MapLen) * 1)))) b := 0 @@ -14134,15 +14698,15 @@ type SetScreenSaverCookie struct { // 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 { +func SetScreenSaver(c *xgb.Conn, Timeout, Interval int16, PreferBlanking, 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 { +// If an error occurs, it can be retrieved using SetScreenSaverCookie.Check. +func SetScreenSaverChecked(c *xgb.Conn, Timeout, Interval int16, PreferBlanking, AllowExposures byte) SetScreenSaverCookie { cookie := c.NewCookie(true, false) c.NewRequest(setScreenSaverRequest(c, Timeout, Interval, PreferBlanking, AllowExposures), cookie) return SetScreenSaverCookie{cookie} @@ -14154,9 +14718,8 @@ 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 { +// setScreenSaverRequest writes a SetScreenSaver request to a byte slice for transfer. +func setScreenSaverRequest(c *xgb.Conn, Timeout, Interval int16, PreferBlanking, AllowExposures byte) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -14189,6 +14752,11 @@ type SetSelectionOwnerCookie struct { *xgb.Cookie } +// Makes Window the owner of the selection Selection and updates the +// last-change time of the specified selection. +// +// May return a Atom error if selection does not refer to a valid atom. +// // 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 { @@ -14198,7 +14766,7 @@ func SetSelectionOwner(c *xgb.Conn, Owner Window, Selection Atom, Time Timestamp } // SetSelectionOwnerChecked sends a checked request. -// If an error occurs, it can be retrieved using SetSelectionOwnerCookie.Check() +// 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) @@ -14211,8 +14779,7 @@ func (cook SetSelectionOwnerCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for SetSelectionOwner -// setSelectionOwnerRequest writes a SetSelectionOwner request to a byte slice. +// setSelectionOwnerRequest writes a SetSelectionOwner request to a byte slice for transfer. func setSelectionOwnerRequest(c *xgb.Conn, Owner Window, Selection Atom, Time Timestamp) []byte { size := 16 b := 0 @@ -14252,7 +14819,7 @@ func StoreColors(c *xgb.Conn, Cmap Colormap, Items []Coloritem) StoreColorsCooki } // StoreColorsChecked sends a checked request. -// If an error occurs, it can be retrieved using StoreColorsCookie.Check() +// 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) @@ -14265,8 +14832,7 @@ func (cook StoreColorsCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for StoreColors -// storeColorsRequest writes a StoreColors request to a byte slice. +// storeColorsRequest writes a StoreColors request to a byte slice for transfer. func storeColorsRequest(c *xgb.Conn, Cmap Colormap, Items []Coloritem) []byte { size := xgb.Pad((8 + xgb.Pad((len(Items) * 12)))) b := 0 @@ -14302,7 +14868,7 @@ func StoreNamedColor(c *xgb.Conn, Flags byte, Cmap Colormap, Pixel uint32, NameL } // StoreNamedColorChecked sends a checked request. -// If an error occurs, it can be retrieved using StoreNamedColorCookie.Check() +// 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) @@ -14315,8 +14881,7 @@ func (cook StoreNamedColorCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for StoreNamedColor -// storeNamedColorRequest writes a StoreNamedColor request to a byte slice. +// storeNamedColorRequest writes a StoreNamedColor request to a byte slice for transfer. 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 @@ -14354,8 +14919,8 @@ type TranslateCoordinatesCookie struct { } // 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 { +// If an error occurs, it will be returned with the reply by calling TranslateCoordinatesCookie.Reply. +func TranslateCoordinates(c *xgb.Conn, SrcWindow, DstWindow Window, SrcX, SrcY int16) TranslateCoordinatesCookie { cookie := c.NewCookie(true, true) c.NewRequest(translateCoordinatesRequest(c, SrcWindow, DstWindow, SrcX, SrcY), cookie) return TranslateCoordinatesCookie{cookie} @@ -14363,7 +14928,7 @@ func TranslateCoordinates(c *xgb.Conn, SrcWindow Window, DstWindow Window, SrcX // 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 { +func TranslateCoordinatesUnchecked(c *xgb.Conn, SrcWindow, DstWindow Window, SrcX, SrcY int16) TranslateCoordinatesCookie { cookie := c.NewCookie(false, true) c.NewRequest(translateCoordinatesRequest(c, SrcWindow, DstWindow, SrcX, SrcY), cookie) return TranslateCoordinatesCookie{cookie} @@ -14421,9 +14986,8 @@ func translateCoordinatesReply(buf []byte) *TranslateCoordinatesReply { 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 { +// translateCoordinatesRequest writes a TranslateCoordinates request to a byte slice for transfer. +func translateCoordinatesRequest(c *xgb.Conn, SrcWindow, DstWindow Window, SrcX, SrcY int16) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -14465,7 +15029,7 @@ func UngrabButton(c *xgb.Conn, Button byte, GrabWindow Window, Modifiers uint16) } // UngrabButtonChecked sends a checked request. -// If an error occurs, it can be retrieved using UngrabButtonCookie.Check() +// 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) @@ -14478,8 +15042,7 @@ func (cook UngrabButtonCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for UngrabButton -// ungrabButtonRequest writes a UngrabButton request to a byte slice. +// ungrabButtonRequest writes a UngrabButton request to a byte slice for transfer. func ungrabButtonRequest(c *xgb.Conn, Button byte, GrabWindow Window, Modifiers uint16) []byte { size := 12 b := 0 @@ -14510,6 +15073,13 @@ type UngrabKeyCookie struct { *xgb.Cookie } +// Releases the key combination on GrabWindow if you grabbed it using +// GrabKey before. +// +// May return a Window error if the specified GrabWindow does not exist. +// +// May return Value errors. +// // 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 { @@ -14519,7 +15089,7 @@ func UngrabKey(c *xgb.Conn, Key Keycode, GrabWindow Window, Modifiers uint16) Un } // UngrabKeyChecked sends a checked request. -// If an error occurs, it can be retrieved using UngrabKeyCookie.Check() +// 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) @@ -14532,8 +15102,7 @@ func (cook UngrabKeyCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for UngrabKey -// ungrabKeyRequest writes a UngrabKey request to a byte slice. +// ungrabKeyRequest writes a UngrabKey request to a byte slice for transfer. func ungrabKeyRequest(c *xgb.Conn, Key Keycode, GrabWindow Window, Modifiers uint16) []byte { size := 12 b := 0 @@ -14573,7 +15142,7 @@ func UngrabKeyboard(c *xgb.Conn, Time Timestamp) UngrabKeyboardCookie { } // UngrabKeyboardChecked sends a checked request. -// If an error occurs, it can be retrieved using UngrabKeyboardCookie.Check() +// 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) @@ -14586,8 +15155,7 @@ func (cook UngrabKeyboardCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for UngrabKeyboard -// ungrabKeyboardRequest writes a UngrabKeyboard request to a byte slice. +// ungrabKeyboardRequest writes a UngrabKeyboard request to a byte slice for transfer. func ungrabKeyboardRequest(c *xgb.Conn, Time Timestamp) []byte { size := 8 b := 0 @@ -14612,6 +15180,12 @@ type UngrabPointerCookie struct { *xgb.Cookie } +// Releases the pointer and any queued events if you actively grabbed the pointer +// before using GrabPointer, GrabButton or within a normal button +// press. +// +// EnterNotify and LeaveNotify events are generated. +// // 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 { @@ -14621,7 +15195,7 @@ func UngrabPointer(c *xgb.Conn, Time Timestamp) UngrabPointerCookie { } // UngrabPointerChecked sends a checked request. -// If an error occurs, it can be retrieved using UngrabPointerCookie.Check() +// 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) @@ -14634,8 +15208,7 @@ func (cook UngrabPointerCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for UngrabPointer -// ungrabPointerRequest writes a UngrabPointer request to a byte slice. +// ungrabPointerRequest writes a UngrabPointer request to a byte slice for transfer. func ungrabPointerRequest(c *xgb.Conn, Time Timestamp) []byte { size := 8 b := 0 @@ -14669,7 +15242,7 @@ func UngrabServer(c *xgb.Conn) UngrabServerCookie { } // UngrabServerChecked sends a checked request. -// If an error occurs, it can be retrieved using UngrabServerCookie.Check() +// 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) @@ -14682,8 +15255,7 @@ func (cook UngrabServerCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for UngrabServer -// ungrabServerRequest writes a UngrabServer request to a byte slice. +// ungrabServerRequest writes a UngrabServer request to a byte slice for transfer. func ungrabServerRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -14713,7 +15285,7 @@ func UninstallColormap(c *xgb.Conn, Cmap Colormap) UninstallColormapCookie { } // UninstallColormapChecked sends a checked request. -// If an error occurs, it can be retrieved using UninstallColormapCookie.Check() +// 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) @@ -14726,8 +15298,7 @@ func (cook UninstallColormapCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for UninstallColormap -// uninstallColormapRequest writes a UninstallColormap request to a byte slice. +// uninstallColormapRequest writes a UninstallColormap request to a byte slice for transfer. func uninstallColormapRequest(c *xgb.Conn, Cmap Colormap) []byte { size := 8 b := 0 @@ -14761,7 +15332,7 @@ func UnmapSubwindows(c *xgb.Conn, Window Window) UnmapSubwindowsCookie { } // UnmapSubwindowsChecked sends a checked request. -// If an error occurs, it can be retrieved using UnmapSubwindowsCookie.Check() +// 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) @@ -14774,8 +15345,7 @@ func (cook UnmapSubwindowsCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for UnmapSubwindows -// unmapSubwindowsRequest writes a UnmapSubwindows request to a byte slice. +// unmapSubwindowsRequest writes a UnmapSubwindows request to a byte slice for transfer. func unmapSubwindowsRequest(c *xgb.Conn, Window Window) []byte { size := 8 b := 0 @@ -14800,6 +15370,14 @@ type UnmapWindowCookie struct { *xgb.Cookie } +// Unmaps the specified window. This means making the window invisible (and all +// its child windows). +// +// Unmapping a window leads to the UnmapNotify event being generated. Also, +// Expose events are generated for formerly obscured windows. +// +// May return a Window error if the specified window does not exist. +// // 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 { @@ -14809,7 +15387,7 @@ func UnmapWindow(c *xgb.Conn, Window Window) UnmapWindowCookie { } // UnmapWindowChecked sends a checked request. -// If an error occurs, it can be retrieved using UnmapWindowCookie.Check() +// 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) @@ -14822,8 +15400,7 @@ func (cook UnmapWindowCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for UnmapWindow -// unmapWindowRequest writes a UnmapWindow request to a byte slice. +// unmapWindowRequest writes a UnmapWindow request to a byte slice for transfer. func unmapWindowRequest(c *xgb.Conn, Window Window) []byte { size := 8 b := 0 @@ -14848,17 +15425,31 @@ type WarpPointerCookie struct { *xgb.Cookie } +// Moves the mouse pointer to the specified position. +// +// If SrcWindow is not None, the move will only take place if the +// pointer is inside SrcWindow and within the rectangle specified by (SrcX, +// SrcY, SrcWidth, SrcHeight). The rectangle coordinates are relative to +// SrcWindow. +// +// If DstWindow is not None, the pointer will be moved to the +// offsets (DstX, DstY) relative to DstWindow. If DstWindow is +// None, the pointer will be moved by the offsets (DstX, DstY) +// relative to the current position of the pointer. +// +// May return Window errors. +// // 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 { +func WarpPointer(c *xgb.Conn, SrcWindow, DstWindow Window, SrcX, SrcY int16, SrcWidth, SrcHeight uint16, DstX, 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 { +// If an error occurs, it can be retrieved using WarpPointerCookie.Check. +func WarpPointerChecked(c *xgb.Conn, SrcWindow, DstWindow Window, SrcX, SrcY int16, SrcWidth, SrcHeight uint16, DstX, DstY int16) WarpPointerCookie { cookie := c.NewCookie(true, false) c.NewRequest(warpPointerRequest(c, SrcWindow, DstWindow, SrcX, SrcY, SrcWidth, SrcHeight, DstX, DstY), cookie) return WarpPointerCookie{cookie} @@ -14870,9 +15461,8 @@ 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 { +// warpPointerRequest writes a WarpPointer request to a byte slice for transfer. +func warpPointerRequest(c *xgb.Conn, SrcWindow, DstWindow Window, SrcX, SrcY int16, SrcWidth, SrcHeight uint16, DstX, DstY int16) []byte { size := 24 b := 0 buf := make([]byte, size) -- cgit v1.2.3-70-g09d2