events_generated.go RawHistoryFolder
1// Code generated by xtgen; DO NOT EDIT.
2package xfixes
3
4import "bnema.dev/xturbo/xproto"
5import "encoding/binary"
6import "bnema.dev/xturbo"
7
8// KindSelectionNotify identifies SelectionNotify events in xturbo.Event.Kind.
9const KindSelectionNotify = xturbo.EventKind(xturbo.ExtXFixes) << 8
10
11// 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.
12type SelectionNotifyEvent struct{ raw *[32]byte }
13
14// SelectionNotifyOf views ev as SelectionNotify without checking ev.Kind: a wrong kind yields garbage, never a panic.
15func SelectionNotifyOf(ev *xturbo.Event) SelectionNotifyEvent {
16 return SelectionNotifyEvent{raw: &ev.Raw}
17}
18func (e SelectionNotifyEvent) Raw() *[32]byte { return e.raw }
19func (e SelectionNotifyEvent) Subtype() SelectionEvent { return SelectionEvent(e.raw[1:][0]) }
20func (e SelectionNotifyEvent) Window() xproto.Window {
21 return xproto.Window(binary.LittleEndian.Uint32(e.raw[4:]))
22}
23func (e SelectionNotifyEvent) Owner() xproto.Window {
24 return xproto.Window(binary.LittleEndian.Uint32(e.raw[8:]))
25}
26func (e SelectionNotifyEvent) Selection() xproto.Atom {
27 return xproto.Atom(binary.LittleEndian.Uint32(e.raw[12:]))
28}
29func (e SelectionNotifyEvent) Timestamp() xproto.Timestamp {
30 return xproto.Timestamp(binary.LittleEndian.Uint32(e.raw[16:]))
31}
32func (e SelectionNotifyEvent) SelectionTimestamp() xproto.Timestamp {
33 return xproto.Timestamp(binary.LittleEndian.Uint32(e.raw[20:]))
34}
35
36// KindCursorNotify identifies CursorNotify events in xturbo.Event.Kind.
37const KindCursorNotify = xturbo.EventKind(xturbo.ExtXFixes)<<8 | 1
38
39// 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.
40type CursorNotifyEvent struct{ raw *[32]byte }
41
42// CursorNotifyOf views ev as CursorNotify without checking ev.Kind: a wrong kind yields garbage, never a panic.
43func CursorNotifyOf(ev *xturbo.Event) CursorNotifyEvent { return CursorNotifyEvent{raw: &ev.Raw} }
44func (e CursorNotifyEvent) Raw() *[32]byte { return e.raw }
45func (e CursorNotifyEvent) Subtype() CursorNotify { return CursorNotify(e.raw[1:][0]) }
46func (e CursorNotifyEvent) Window() xproto.Window {
47 return xproto.Window(binary.LittleEndian.Uint32(e.raw[4:]))
48}
49func (e CursorNotifyEvent) CursorSerial() uint32 {
50 return uint32(binary.LittleEndian.Uint32(e.raw[8:]))
51}
52func (e CursorNotifyEvent) Timestamp() xproto.Timestamp {
53 return xproto.Timestamp(binary.LittleEndian.Uint32(e.raw[12:]))
54}
55func (e CursorNotifyEvent) Name() xproto.Atom {
56 return xproto.Atom(binary.LittleEndian.Uint32(e.raw[16:]))
57}