// Code generated by xtgen; DO NOT EDIT. package shape import "bnema.dev/xturbo/xproto" import "encoding/binary" import "bnema.dev/xturbo" // KindNotify identifies Notify events in xturbo.Event.Kind. const KindNotify = xturbo.EventKind(xturbo.ExtShape) << 8 // NotifyEvent is a view over a Notify event's 32 bytes. Getters read the copied Event.Raw, so a view stays valid as long as the Event value it was taken from. type NotifyEvent struct{ raw *[32]byte } // NotifyOf views ev as Notify without checking ev.Kind: a wrong kind yields garbage, never a panic. func NotifyOf(ev *xturbo.Event) NotifyEvent { return NotifyEvent{raw: &ev.Raw} } func (e NotifyEvent) Raw() *[32]byte { return e.raw } func (e NotifyEvent) ShapeKind() Sk { return Sk(e.raw[1:][0]) } func (e NotifyEvent) AffectedWindow() xproto.Window { return xproto.Window(binary.LittleEndian.Uint32(e.raw[4:])) } func (e NotifyEvent) ExtentsX() int16 { return int16(binary.LittleEndian.Uint16(e.raw[8:])) } func (e NotifyEvent) ExtentsY() int16 { return int16(binary.LittleEndian.Uint16(e.raw[10:])) } func (e NotifyEvent) ExtentsWidth() uint16 { return uint16(binary.LittleEndian.Uint16(e.raw[12:])) } func (e NotifyEvent) ExtentsHeight() uint16 { return uint16(binary.LittleEndian.Uint16(e.raw[14:])) } func (e NotifyEvent) ServerTime() xproto.Timestamp { return xproto.Timestamp(binary.LittleEndian.Uint32(e.raw[16:])) } func (e NotifyEvent) Shaped() bool { return (e.raw[20:][0] != 0) }