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/screensaver/screensaver.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/screensaver/screensaver.go')
-rw-r--r-- | nexgb/screensaver/screensaver.go | 37 |
1 files changed, 8 insertions, 29 deletions
diff --git a/nexgb/screensaver/screensaver.go b/nexgb/screensaver/screensaver.go index e552c6d..ea60367 100644 --- a/nexgb/screensaver/screensaver.go +++ b/nexgb/screensaver/screensaver.go @@ -53,15 +53,12 @@ const Notify = 0 type NotifyEvent struct { Sequence uint16 - Code byte State byte - // padding: 1 bytes - SequenceNumber uint16 - Time xproto.Timestamp - Root xproto.Window - Window xproto.Window - Kind byte - Forced bool + Time xproto.Timestamp + Root xproto.Window + Window xproto.Window + Kind byte + Forced bool // padding: 14 bytes } @@ -70,18 +67,10 @@ func NotifyEventNew(buf []byte) xgb.Event { v := NotifyEvent{} b := 1 // don't read event number - v.Code = buf[b] - b += 1 - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - v.State = buf[b] b += 1 - b += 1 // padding - - v.SequenceNumber = xgb.Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 v.Time = xproto.Timestamp(xgb.Get32(buf[b:])) @@ -117,18 +106,10 @@ func (v NotifyEvent) Bytes() []byte { buf[b] = 0 b += 1 - buf[b] = v.Code - b += 1 - - b += 2 // skip sequence number - buf[b] = v.State b += 1 - b += 1 // padding - - xgb.Put16(buf[b:], v.SequenceNumber) - b += 2 + b += 2 // skip sequence number xgb.Put32(buf[b:], uint32(v.Time)) b += 4 @@ -163,11 +144,9 @@ func (v NotifyEvent) SequenceId() uint16 { // String is a rudimentary string representation of NotifyEvent. func (v NotifyEvent) String() string { - fieldVals := make([]string, 0, 10) + fieldVals := make([]string, 0, 7) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("Code: %d", v.Code)) fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) - fieldVals = append(fieldVals, xgb.Sprintf("SequenceNumber: %d", v.SequenceNumber)) fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) fieldVals = append(fieldVals, xgb.Sprintf("Root: %d", v.Root)) fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) |