// Code generated by xtgen; DO NOT EDIT. package xfixes import "bnema.dev/xturbo/xproto" import "encoding/binary" import "bnema.dev/xturbo" // KindSelectionNotify identifies SelectionNotify events in xturbo.Event.Kind. const KindSelectionNotify = xturbo.EventKind(xturbo.ExtXFixes) << 8 // SelectionNotifyEvent is a view over a SelectionNotify 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 SelectionNotifyEvent struct{ raw *[32]byte } // SelectionNotifyOf views ev as SelectionNotify without checking ev.Kind: a wrong kind yields garbage, never a panic. func SelectionNotifyOf(ev *xturbo.Event) SelectionNotifyEvent { return SelectionNotifyEvent{raw: &ev.Raw} } func (e SelectionNotifyEvent) Raw() *[32]byte { return e.raw } func (e SelectionNotifyEvent) Subtype() SelectionEvent { return SelectionEvent(e.raw[1:][0]) } func (e SelectionNotifyEvent) Window() xproto.Window { return xproto.Window(binary.LittleEndian.Uint32(e.raw[4:])) } func (e SelectionNotifyEvent) Owner() xproto.Window { return xproto.Window(binary.LittleEndian.Uint32(e.raw[8:])) } func (e SelectionNotifyEvent) Selection() xproto.Atom { return xproto.Atom(binary.LittleEndian.Uint32(e.raw[12:])) } func (e SelectionNotifyEvent) Timestamp() xproto.Timestamp { return xproto.Timestamp(binary.LittleEndian.Uint32(e.raw[16:])) } func (e SelectionNotifyEvent) SelectionTimestamp() xproto.Timestamp { return xproto.Timestamp(binary.LittleEndian.Uint32(e.raw[20:])) } // KindCursorNotify identifies CursorNotify events in xturbo.Event.Kind. const KindCursorNotify = xturbo.EventKind(xturbo.ExtXFixes)<<8 | 1 // CursorNotifyEvent is a view over a CursorNotify 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 CursorNotifyEvent struct{ raw *[32]byte } // CursorNotifyOf views ev as CursorNotify without checking ev.Kind: a wrong kind yields garbage, never a panic. func CursorNotifyOf(ev *xturbo.Event) CursorNotifyEvent { return CursorNotifyEvent{raw: &ev.Raw} } func (e CursorNotifyEvent) Raw() *[32]byte { return e.raw } func (e CursorNotifyEvent) Subtype() CursorNotify { return CursorNotify(e.raw[1:][0]) } func (e CursorNotifyEvent) Window() xproto.Window { return xproto.Window(binary.LittleEndian.Uint32(e.raw[4:])) } func (e CursorNotifyEvent) CursorSerial() uint32 { return uint32(binary.LittleEndian.Uint32(e.raw[8:])) } func (e CursorNotifyEvent) Timestamp() xproto.Timestamp { return xproto.Timestamp(binary.LittleEndian.Uint32(e.raw[12:])) } func (e CursorNotifyEvent) Name() xproto.Atom { return xproto.Atom(binary.LittleEndian.Uint32(e.raw[16:])) }