diff options
author | Andrew Gallant <jamslam@gmail.com> | 2013-12-28 09:25:18 -0500 |
---|---|---|
committer | Přemysl Janouch <p@janouch.name> | 2018-09-08 16:49:20 +0200 |
commit | f0385db3a71c33f19d27dafb2a5d158a8a875200 (patch) | |
tree | 066ddb0dbf9dae912836e784f8e05389b875d45f /nexgb/xproto/xproto.go | |
parent | 5a07ac7108ef2b4074c058fbbd104c49d3cfdc9b (diff) | |
download | haven-f0385db3a71c33f19d27dafb2a5d158a8a875200.tar.gz haven-f0385db3a71c33f19d27dafb2a5d158a8a875200.tar.xz haven-f0385db3a71c33f19d27dafb2a5d158a8a875200.zip |
Regenerate xgb with latest XML descriptions.
Diffstat (limited to 'nexgb/xproto/xproto.go')
-rw-r--r-- | nexgb/xproto/xproto.go | 58 |
1 files changed, 54 insertions, 4 deletions
diff --git a/nexgb/xproto/xproto.go b/nexgb/xproto/xproto.go index 0de64fd..9b33030 100644 --- a/nexgb/xproto/xproto.go +++ b/nexgb/xproto/xproto.go @@ -2484,10 +2484,6 @@ func NewFontId(c *xgb.Conn) (Font, error) { return Font(id), nil } -const ( - FontNone = 0 -) - // BadFont is the error number for a BadFont. const BadFont = 7 @@ -2527,6 +2523,10 @@ func init() { } const ( + FontNone = 0 +) + +const ( FontDrawLeftToRight = 0 FontDrawRightToLeft = 1 ) @@ -2735,6 +2735,56 @@ func NewGcontextId(c *xgb.Conn) (Gcontext, error) { return Gcontext(id), nil } +// GeGeneric is the event number for a GeGenericEvent. +const GeGeneric = 35 + +type GeGenericEvent struct { + Sequence uint16 + // padding: 22 bytes +} + +// GeGenericEventNew constructs a GeGenericEvent value that implements xgb.Event from a byte slice. +func GeGenericEventNew(buf []byte) xgb.Event { + v := GeGenericEvent{} + b := 1 // don't read event number + + b += 22 // padding + + return v +} + +// Bytes writes a GeGenericEvent value to a byte slice. +func (v GeGenericEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 35 + b += 1 + + b += 22 // padding + + return buf +} + +// SequenceId returns the sequence id attached to the GeGeneric event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. +func (v GeGenericEvent) SequenceId() uint16 { + return v.Sequence +} + +// String is a rudimentary string representation of GeGenericEvent. +func (v GeGenericEvent) String() string { + fieldVals := make([]string, 0, 1) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + return "GeGeneric {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewEventFuncs[35] = GeGenericEventNew +} + const ( GetPropertyTypeAny = 0 ) |