detached 1e70f64

feat(protocol): add game and desktop server bindings

Vendor and generate presentation-time, linux-drm-syncobj, pointer-gestures, keyboard-shortcuts-inhibit, idle-inhibit, ext-session-lock, ext-idle-notify, ext-foreign-toplevel-list, xdg-dialog, xdg-toplevel-icon, xdg-toplevel-tag, xdg-system-bell and xdg-foreign-v2.
commit
1e70f6419e81850a5ec7f3c683f4e75345e9590a
author
brice · · 2026-09-26 09:05 UTC
committer
brice · · 2026-09-26 09:09 UTC
parent
4d4de81
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
27 files · +4685 -0
A protocol/extforeigntoplevellist/extforeigntoplevellist.go +187 -0
@@ -0,0 +1,187 @@
1+// Code generated by wlgen; DO NOT EDIT.
2+package extforeigntoplevellist
3+
4+import (
5+ "fmt"
6+ "github.com/bnema/purego-libwayland/server"
7+ "runtime"
8+)
9+
10+var ExtForeignToplevelListV1Interface *server.Interface
11+var ExtForeignToplevelHandleV1Interface *server.Interface
12+
13+func init() {
14+ ExtForeignToplevelListV1Interface = &server.Interface{Name: "ext_foreign_toplevel_list_v1", Version: 1}
15+ ExtForeignToplevelHandleV1Interface = &server.Interface{Name: "ext_foreign_toplevel_handle_v1", Version: 1}
16+ ExtForeignToplevelListV1Interface.Requests = []server.Message{
17+ {Name: "stop", Signature: "", Types: []*server.Interface{}},
18+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
19+ }
20+ ExtForeignToplevelListV1Interface.Events = []server.Message{
21+ {Name: "toplevel", Signature: "n", Types: []*server.Interface{ExtForeignToplevelHandleV1Interface}},
22+ {Name: "finished", Signature: "", Types: []*server.Interface{}},
23+ }
24+ ExtForeignToplevelHandleV1Interface.Requests = []server.Message{
25+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
26+ }
27+ ExtForeignToplevelHandleV1Interface.Events = []server.Message{
28+ {Name: "closed", Signature: "", Types: []*server.Interface{}},
29+ {Name: "done", Signature: "", Types: []*server.Interface{}},
30+ {Name: "title", Signature: "s", Types: []*server.Interface{nil}},
31+ {Name: "app_id", Signature: "s", Types: []*server.Interface{nil}},
32+ {Name: "identifier", Signature: "s", Types: []*server.Interface{nil}},
33+ }
34+ if err := server.NewInterfaces(ExtForeignToplevelListV1Interface, ExtForeignToplevelHandleV1Interface); err != nil {
35+ panic(err)
36+ }
37+}
38+
39+// ExtForeignToplevelListV1 list toplevels.
40+type ExtForeignToplevelListV1 struct{ *server.Resource }
41+
42+func WrapExtForeignToplevelListV1(r *server.Resource) *ExtForeignToplevelListV1 {
43+ if r == nil {
44+ return nil
45+ }
46+ return &ExtForeignToplevelListV1{r}
47+}
48+
49+const ExtForeignToplevelListV1RequestStop uint32 = 0
50+const ExtForeignToplevelListV1RequestDestroy uint32 = 1
51+const ExtForeignToplevelListV1EventToplevel uint32 = 0
52+const ExtForeignToplevelListV1EventFinished uint32 = 1
53+
54+// ExtForeignToplevelListV1Handler handles ext_foreign_toplevel_list_v1 requests.
55+type ExtForeignToplevelListV1Handler interface {
56+ Stop(self *ExtForeignToplevelListV1)
57+ Destroy(self *ExtForeignToplevelListV1)
58+}
59+
60+func NewExtForeignToplevelListV1(c server.Client, version int32, id uint32, h ExtForeignToplevelListV1Handler) (*ExtForeignToplevelListV1, error) {
61+ if h == nil {
62+ return nil, fmt.Errorf("purego-libwayland: nil handler for ext_foreign_toplevel_list_v1")
63+ }
64+ var self *ExtForeignToplevelListV1
65+ r, err := c.CreateResource(ExtForeignToplevelListV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
66+ switch opcode {
67+ case 0:
68+ h.Stop(self)
69+ case 1:
70+ h.Destroy(self)
71+ self.Destroy()
72+ }
73+ })
74+ if err != nil {
75+ return nil, err
76+ }
77+ self = WrapExtForeignToplevelListV1(r)
78+ r.Data = self
79+ return self, nil
80+}
81+
82+// SendToplevel a toplevel has been created.
83+func (self *ExtForeignToplevelListV1) SendToplevel(toplevel *ExtForeignToplevelHandleV1) {
84+ self.PostEvent(ExtForeignToplevelListV1EventToplevel, server.NewID(resourceOf(toplevel)))
85+}
86+
87+// SendFinished the compositor has finished with the toplevel manager.
88+func (self *ExtForeignToplevelListV1) SendFinished() {
89+ self.PostEvent(ExtForeignToplevelListV1EventFinished)
90+}
91+func NewExtForeignToplevelListV1Global(d *server.Display, version int32, bind server.BindFunc) error {
92+ return d.CreateGlobal(ExtForeignToplevelListV1Interface, version, bind)
93+}
94+
95+// ExtForeignToplevelHandleV1 a mapped toplevel.
96+type ExtForeignToplevelHandleV1 struct{ *server.Resource }
97+
98+func WrapExtForeignToplevelHandleV1(r *server.Resource) *ExtForeignToplevelHandleV1 {
99+ if r == nil {
100+ return nil
101+ }
102+ return &ExtForeignToplevelHandleV1{r}
103+}
104+
105+const ExtForeignToplevelHandleV1RequestDestroy uint32 = 0
106+const ExtForeignToplevelHandleV1EventClosed uint32 = 0
107+const ExtForeignToplevelHandleV1EventDone uint32 = 1
108+const ExtForeignToplevelHandleV1EventTitle uint32 = 2
109+const ExtForeignToplevelHandleV1EventAppId uint32 = 3
110+const ExtForeignToplevelHandleV1EventIdentifier uint32 = 4
111+
112+// ExtForeignToplevelHandleV1Handler handles ext_foreign_toplevel_handle_v1 requests.
113+type ExtForeignToplevelHandleV1Handler interface {
114+ Destroy(self *ExtForeignToplevelHandleV1)
115+}
116+
117+func NewExtForeignToplevelHandleV1(c server.Client, version int32, id uint32, h ExtForeignToplevelHandleV1Handler) (*ExtForeignToplevelHandleV1, error) {
118+ if h == nil {
119+ return nil, fmt.Errorf("purego-libwayland: nil handler for ext_foreign_toplevel_handle_v1")
120+ }
121+ var self *ExtForeignToplevelHandleV1
122+ r, err := c.CreateResource(ExtForeignToplevelHandleV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
123+ switch opcode {
124+ case 0:
125+ h.Destroy(self)
126+ self.Destroy()
127+ }
128+ })
129+ if err != nil {
130+ return nil, err
131+ }
132+ self = WrapExtForeignToplevelHandleV1(r)
133+ r.Data = self
134+ return self, nil
135+}
136+
137+// SendClosed the toplevel has been closed.
138+func (self *ExtForeignToplevelHandleV1) SendClosed() {
139+ self.PostEvent(ExtForeignToplevelHandleV1EventClosed)
140+}
141+
142+// SendDone all information about the toplevel has been sent.
143+func (self *ExtForeignToplevelHandleV1) SendDone() {
144+ self.PostEvent(ExtForeignToplevelHandleV1EventDone)
145+}
146+
147+// SendTitle title change.
148+func (self *ExtForeignToplevelHandleV1) SendTitle(title string) {
149+ var p runtime.Pinner
150+ defer p.Unpin()
151+ self.PostEvent(ExtForeignToplevelHandleV1EventTitle, server.String(&p, title, false))
152+}
153+
154+// SendAppId app_id change.
155+func (self *ExtForeignToplevelHandleV1) SendAppId(appId string) {
156+ var p runtime.Pinner
157+ defer p.Unpin()
158+ self.PostEvent(ExtForeignToplevelHandleV1EventAppId, server.String(&p, appId, false))
159+}
160+
161+// SendIdentifier a stable identifier for a toplevel.
162+func (self *ExtForeignToplevelHandleV1) SendIdentifier(identifier string) {
163+ var p runtime.Pinner
164+ defer p.Unpin()
165+ self.PostEvent(ExtForeignToplevelHandleV1EventIdentifier, server.String(&p, identifier, false))
166+}
167+func NewExtForeignToplevelHandleV1Global(d *server.Display, version int32, bind server.BindFunc) error {
168+ return d.CreateGlobal(ExtForeignToplevelHandleV1Interface, version, bind)
169+}
170+func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
171+ if v == nil {
172+ return nil
173+ }
174+ return v.GetResource()
175+}
176+func (self *ExtForeignToplevelListV1) GetResource() *server.Resource {
177+ if self == nil {
178+ return nil
179+ }
180+ return self.Resource
181+}
182+func (self *ExtForeignToplevelHandleV1) GetResource() *server.Resource {
183+ if self == nil {
184+ return nil
185+ }
186+ return self.Resource
187+}
A protocol/extidlenotify/extidlenotify.go +150 -0
@@ -0,0 +1,150 @@
1+// Code generated by wlgen; DO NOT EDIT.
2+package extidlenotify
3+
4+import (
5+ "fmt"
6+ wayland "github.com/bnema/purego-libwayland/protocol/wayland"
7+ "github.com/bnema/purego-libwayland/server"
8+)
9+
10+var ExtIdleNotifierV1Interface *server.Interface
11+var ExtIdleNotificationV1Interface *server.Interface
12+
13+func init() {
14+ ExtIdleNotifierV1Interface = &server.Interface{Name: "ext_idle_notifier_v1", Version: 2}
15+ ExtIdleNotificationV1Interface = &server.Interface{Name: "ext_idle_notification_v1", Version: 2}
16+ ExtIdleNotifierV1Interface.Requests = []server.Message{
17+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
18+ {Name: "get_idle_notification", Signature: "nuo", Types: []*server.Interface{ExtIdleNotificationV1Interface, nil, wayland.SeatInterface}},
19+ {Name: "get_input_idle_notification", Signature: "2nuo", Types: []*server.Interface{ExtIdleNotificationV1Interface, nil, wayland.SeatInterface}},
20+ }
21+ ExtIdleNotifierV1Interface.Events = []server.Message{}
22+ ExtIdleNotificationV1Interface.Requests = []server.Message{
23+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
24+ }
25+ ExtIdleNotificationV1Interface.Events = []server.Message{
26+ {Name: "idled", Signature: "", Types: []*server.Interface{}},
27+ {Name: "resumed", Signature: "", Types: []*server.Interface{}},
28+ }
29+ if err := server.NewInterfaces(ExtIdleNotifierV1Interface, ExtIdleNotificationV1Interface); err != nil {
30+ panic(err)
31+ }
32+}
33+
34+// ExtIdleNotifierV1 idle notification manager.
35+type ExtIdleNotifierV1 struct{ *server.Resource }
36+
37+func WrapExtIdleNotifierV1(r *server.Resource) *ExtIdleNotifierV1 {
38+ if r == nil {
39+ return nil
40+ }
41+ return &ExtIdleNotifierV1{r}
42+}
43+
44+const ExtIdleNotifierV1RequestDestroy uint32 = 0
45+const ExtIdleNotifierV1RequestGetIdleNotification uint32 = 1
46+const ExtIdleNotifierV1RequestGetInputIdleNotification uint32 = 2
47+
48+// ExtIdleNotifierV1Handler handles ext_idle_notifier_v1 requests.
49+type ExtIdleNotifierV1Handler interface {
50+ Destroy(self *ExtIdleNotifierV1)
51+ GetIdleNotification(self *ExtIdleNotifierV1, id uint32, timeout uint32, seat *wayland.Seat)
52+ GetInputIdleNotification(self *ExtIdleNotifierV1, id uint32, timeout uint32, seat *wayland.Seat)
53+}
54+
55+func NewExtIdleNotifierV1(c server.Client, version int32, id uint32, h ExtIdleNotifierV1Handler) (*ExtIdleNotifierV1, error) {
56+ if h == nil {
57+ return nil, fmt.Errorf("purego-libwayland: nil handler for ext_idle_notifier_v1")
58+ }
59+ var self *ExtIdleNotifierV1
60+ r, err := c.CreateResource(ExtIdleNotifierV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
61+ switch opcode {
62+ case 0:
63+ h.Destroy(self)
64+ self.Destroy()
65+ case 1:
66+ h.GetIdleNotification(self, args[0].NewID(), args[1].Uint(), wayland.WrapSeat(args[2].Resource()))
67+ case 2:
68+ h.GetInputIdleNotification(self, args[0].NewID(), args[1].Uint(), wayland.WrapSeat(args[2].Resource()))
69+ }
70+ })
71+ if err != nil {
72+ return nil, err
73+ }
74+ self = WrapExtIdleNotifierV1(r)
75+ r.Data = self
76+ return self, nil
77+}
78+func NewExtIdleNotifierV1Global(d *server.Display, version int32, bind server.BindFunc) error {
79+ return d.CreateGlobal(ExtIdleNotifierV1Interface, version, bind)
80+}
81+
82+// ExtIdleNotificationV1 idle notification.
83+type ExtIdleNotificationV1 struct{ *server.Resource }
84+
85+func WrapExtIdleNotificationV1(r *server.Resource) *ExtIdleNotificationV1 {
86+ if r == nil {
87+ return nil
88+ }
89+ return &ExtIdleNotificationV1{r}
90+}
91+
92+const ExtIdleNotificationV1RequestDestroy uint32 = 0
93+const ExtIdleNotificationV1EventIdled uint32 = 0
94+const ExtIdleNotificationV1EventResumed uint32 = 1
95+
96+// ExtIdleNotificationV1Handler handles ext_idle_notification_v1 requests.
97+type ExtIdleNotificationV1Handler interface {
98+ Destroy(self *ExtIdleNotificationV1)
99+}
100+
101+func NewExtIdleNotificationV1(c server.Client, version int32, id uint32, h ExtIdleNotificationV1Handler) (*ExtIdleNotificationV1, error) {
102+ if h == nil {
103+ return nil, fmt.Errorf("purego-libwayland: nil handler for ext_idle_notification_v1")
104+ }
105+ var self *ExtIdleNotificationV1
106+ r, err := c.CreateResource(ExtIdleNotificationV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
107+ switch opcode {
108+ case 0:
109+ h.Destroy(self)
110+ self.Destroy()
111+ }
112+ })
113+ if err != nil {
114+ return nil, err
115+ }
116+ self = WrapExtIdleNotificationV1(r)
117+ r.Data = self
118+ return self, nil
119+}
120+
121+// SendIdled notification object is idle.
122+func (self *ExtIdleNotificationV1) SendIdled() {
123+ self.PostEvent(ExtIdleNotificationV1EventIdled)
124+}
125+
126+// SendResumed notification object is no longer idle.
127+func (self *ExtIdleNotificationV1) SendResumed() {
128+ self.PostEvent(ExtIdleNotificationV1EventResumed)
129+}
130+func NewExtIdleNotificationV1Global(d *server.Display, version int32, bind server.BindFunc) error {
131+ return d.CreateGlobal(ExtIdleNotificationV1Interface, version, bind)
132+}
133+func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
134+ if v == nil {
135+ return nil
136+ }
137+ return v.GetResource()
138+}
139+func (self *ExtIdleNotifierV1) GetResource() *server.Resource {
140+ if self == nil {
141+ return nil
142+ }
143+ return self.Resource
144+}
145+func (self *ExtIdleNotificationV1) GetResource() *server.Resource {
146+ if self == nil {
147+ return nil
148+ }
149+ return self.Resource
150+}
A protocol/extsessionlock/extsessionlock.go +242 -0
@@ -0,0 +1,242 @@
1+// Code generated by wlgen; DO NOT EDIT.
2+package extsessionlock
3+
4+import (
5+ "fmt"
6+ wayland "github.com/bnema/purego-libwayland/protocol/wayland"
7+ "github.com/bnema/purego-libwayland/server"
8+)
9+
10+var ExtSessionLockManagerV1Interface *server.Interface
11+var ExtSessionLockV1Interface *server.Interface
12+var ExtSessionLockSurfaceV1Interface *server.Interface
13+
14+func init() {
15+ ExtSessionLockManagerV1Interface = &server.Interface{Name: "ext_session_lock_manager_v1", Version: 1}
16+ ExtSessionLockV1Interface = &server.Interface{Name: "ext_session_lock_v1", Version: 1}
17+ ExtSessionLockSurfaceV1Interface = &server.Interface{Name: "ext_session_lock_surface_v1", Version: 1}
18+ ExtSessionLockManagerV1Interface.Requests = []server.Message{
19+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
20+ {Name: "lock", Signature: "n", Types: []*server.Interface{ExtSessionLockV1Interface}},
21+ }
22+ ExtSessionLockManagerV1Interface.Events = []server.Message{}
23+ ExtSessionLockV1Interface.Requests = []server.Message{
24+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
25+ {Name: "get_lock_surface", Signature: "noo", Types: []*server.Interface{ExtSessionLockSurfaceV1Interface, wayland.SurfaceInterface, wayland.OutputInterface}},
26+ {Name: "unlock_and_destroy", Signature: "", Types: []*server.Interface{}},
27+ }
28+ ExtSessionLockV1Interface.Events = []server.Message{
29+ {Name: "locked", Signature: "", Types: []*server.Interface{}},
30+ {Name: "finished", Signature: "", Types: []*server.Interface{}},
31+ }
32+ ExtSessionLockSurfaceV1Interface.Requests = []server.Message{
33+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
34+ {Name: "ack_configure", Signature: "u", Types: []*server.Interface{nil}},
35+ }
36+ ExtSessionLockSurfaceV1Interface.Events = []server.Message{
37+ {Name: "configure", Signature: "uuu", Types: []*server.Interface{nil, nil, nil}},
38+ }
39+ if err := server.NewInterfaces(ExtSessionLockManagerV1Interface, ExtSessionLockV1Interface, ExtSessionLockSurfaceV1Interface); err != nil {
40+ panic(err)
41+ }
42+}
43+
44+// ExtSessionLockManagerV1 used to lock the session.
45+type ExtSessionLockManagerV1 struct{ *server.Resource }
46+
47+func WrapExtSessionLockManagerV1(r *server.Resource) *ExtSessionLockManagerV1 {
48+ if r == nil {
49+ return nil
50+ }
51+ return &ExtSessionLockManagerV1{r}
52+}
53+
54+const ExtSessionLockManagerV1RequestDestroy uint32 = 0
55+const ExtSessionLockManagerV1RequestLock uint32 = 1
56+
57+// ExtSessionLockManagerV1Handler handles ext_session_lock_manager_v1 requests.
58+type ExtSessionLockManagerV1Handler interface {
59+ Destroy(self *ExtSessionLockManagerV1)
60+ Lock(self *ExtSessionLockManagerV1, id uint32)
61+}
62+
63+func NewExtSessionLockManagerV1(c server.Client, version int32, id uint32, h ExtSessionLockManagerV1Handler) (*ExtSessionLockManagerV1, error) {
64+ if h == nil {
65+ return nil, fmt.Errorf("purego-libwayland: nil handler for ext_session_lock_manager_v1")
66+ }
67+ var self *ExtSessionLockManagerV1
68+ r, err := c.CreateResource(ExtSessionLockManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
69+ switch opcode {
70+ case 0:
71+ h.Destroy(self)
72+ self.Destroy()
73+ case 1:
74+ h.Lock(self, args[0].NewID())
75+ }
76+ })
77+ if err != nil {
78+ return nil, err
79+ }
80+ self = WrapExtSessionLockManagerV1(r)
81+ r.Data = self
82+ return self, nil
83+}
84+func NewExtSessionLockManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
85+ return d.CreateGlobal(ExtSessionLockManagerV1Interface, version, bind)
86+}
87+
88+// ExtSessionLockV1 manage lock state and create lock surfaces.
89+type ExtSessionLockV1 struct{ *server.Resource }
90+
91+func WrapExtSessionLockV1(r *server.Resource) *ExtSessionLockV1 {
92+ if r == nil {
93+ return nil
94+ }
95+ return &ExtSessionLockV1{r}
96+}
97+
98+const ExtSessionLockV1RequestDestroy uint32 = 0
99+const ExtSessionLockV1RequestGetLockSurface uint32 = 1
100+const ExtSessionLockV1RequestUnlockAndDestroy uint32 = 2
101+const ExtSessionLockV1EventLocked uint32 = 0
102+const ExtSessionLockV1EventFinished uint32 = 1
103+
104+// ExtSessionLockV1Error .
105+type ExtSessionLockV1Error uint32
106+
107+const (
108+ ExtSessionLockV1ErrorInvalidDestroy ExtSessionLockV1Error = 0
109+ ExtSessionLockV1ErrorInvalidUnlock ExtSessionLockV1Error = 1
110+ ExtSessionLockV1ErrorRole ExtSessionLockV1Error = 2
111+ ExtSessionLockV1ErrorDuplicateOutput ExtSessionLockV1Error = 3
112+ ExtSessionLockV1ErrorAlreadyConstructed ExtSessionLockV1Error = 4
113+)
114+
115+// ExtSessionLockV1Handler handles ext_session_lock_v1 requests.
116+type ExtSessionLockV1Handler interface {
117+ Destroy(self *ExtSessionLockV1)
118+ GetLockSurface(self *ExtSessionLockV1, id uint32, surface *wayland.Surface, output *wayland.Output)
119+ UnlockAndDestroy(self *ExtSessionLockV1)
120+}
121+
122+func NewExtSessionLockV1(c server.Client, version int32, id uint32, h ExtSessionLockV1Handler) (*ExtSessionLockV1, error) {
123+ if h == nil {
124+ return nil, fmt.Errorf("purego-libwayland: nil handler for ext_session_lock_v1")
125+ }
126+ var self *ExtSessionLockV1
127+ r, err := c.CreateResource(ExtSessionLockV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
128+ switch opcode {
129+ case 0:
130+ h.Destroy(self)
131+ self.Destroy()
132+ case 1:
133+ h.GetLockSurface(self, args[0].NewID(), wayland.WrapSurface(args[1].Resource()), wayland.WrapOutput(args[2].Resource()))
134+ case 2:
135+ h.UnlockAndDestroy(self)
136+ self.Destroy()
137+ }
138+ })
139+ if err != nil {
140+ return nil, err
141+ }
142+ self = WrapExtSessionLockV1(r)
143+ r.Data = self
144+ return self, nil
145+}
146+
147+// SendLocked session successfully locked.
148+func (self *ExtSessionLockV1) SendLocked() {
149+ self.PostEvent(ExtSessionLockV1EventLocked)
150+}
151+
152+// SendFinished the session lock object should be destroyed.
153+func (self *ExtSessionLockV1) SendFinished() {
154+ self.PostEvent(ExtSessionLockV1EventFinished)
155+}
156+func NewExtSessionLockV1Global(d *server.Display, version int32, bind server.BindFunc) error {
157+ return d.CreateGlobal(ExtSessionLockV1Interface, version, bind)
158+}
159+
160+// ExtSessionLockSurfaceV1 a surface displayed while the session is locked.
161+type ExtSessionLockSurfaceV1 struct{ *server.Resource }
162+
163+func WrapExtSessionLockSurfaceV1(r *server.Resource) *ExtSessionLockSurfaceV1 {
164+ if r == nil {
165+ return nil
166+ }
167+ return &ExtSessionLockSurfaceV1{r}
168+}
169+
170+const ExtSessionLockSurfaceV1RequestDestroy uint32 = 0
171+const ExtSessionLockSurfaceV1RequestAckConfigure uint32 = 1
172+const ExtSessionLockSurfaceV1EventConfigure uint32 = 0
173+
174+// ExtSessionLockSurfaceV1Error .
175+type ExtSessionLockSurfaceV1Error uint32
176+
177+const (
178+ ExtSessionLockSurfaceV1ErrorCommitBeforeFirstAck ExtSessionLockSurfaceV1Error = 0
179+ ExtSessionLockSurfaceV1ErrorNullBuffer ExtSessionLockSurfaceV1Error = 1
180+ ExtSessionLockSurfaceV1ErrorDimensionsMismatch ExtSessionLockSurfaceV1Error = 2
181+ ExtSessionLockSurfaceV1ErrorInvalidSerial ExtSessionLockSurfaceV1Error = 3
182+)
183+
184+// ExtSessionLockSurfaceV1Handler handles ext_session_lock_surface_v1 requests.
185+type ExtSessionLockSurfaceV1Handler interface {
186+ Destroy(self *ExtSessionLockSurfaceV1)
187+ AckConfigure(self *ExtSessionLockSurfaceV1, serial uint32)
188+}
189+
190+func NewExtSessionLockSurfaceV1(c server.Client, version int32, id uint32, h ExtSessionLockSurfaceV1Handler) (*ExtSessionLockSurfaceV1, error) {
191+ if h == nil {
192+ return nil, fmt.Errorf("purego-libwayland: nil handler for ext_session_lock_surface_v1")
193+ }
194+ var self *ExtSessionLockSurfaceV1
195+ r, err := c.CreateResource(ExtSessionLockSurfaceV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
196+ switch opcode {
197+ case 0:
198+ h.Destroy(self)
199+ self.Destroy()
200+ case 1:
201+ h.AckConfigure(self, args[0].Uint())
202+ }
203+ })
204+ if err != nil {
205+ return nil, err
206+ }
207+ self = WrapExtSessionLockSurfaceV1(r)
208+ r.Data = self
209+ return self, nil
210+}
211+
212+// SendConfigure the client should resize its surface.
213+func (self *ExtSessionLockSurfaceV1) SendConfigure(serial uint32, width uint32, height uint32) {
214+ self.PostEvent(ExtSessionLockSurfaceV1EventConfigure, server.Uint(serial), server.Uint(width), server.Uint(height))
215+}
216+func NewExtSessionLockSurfaceV1Global(d *server.Display, version int32, bind server.BindFunc) error {
217+ return d.CreateGlobal(ExtSessionLockSurfaceV1Interface, version, bind)
218+}
219+func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
220+ if v == nil {
221+ return nil
222+ }
223+ return v.GetResource()
224+}
225+func (self *ExtSessionLockManagerV1) GetResource() *server.Resource {
226+ if self == nil {
227+ return nil
228+ }
229+ return self.Resource
230+}
231+func (self *ExtSessionLockV1) GetResource() *server.Resource {
232+ if self == nil {
233+ return nil
234+ }
235+ return self.Resource
236+}
237+func (self *ExtSessionLockSurfaceV1) GetResource() *server.Resource {
238+ if self == nil {
239+ return nil
240+ }
241+ return self.Resource
242+}
M protocol/gen.go +13 -0
@@ -22,3 +22,16 @@ package protocol
2222 //go:generate go run ../cmd/wlgen -package contenttype -out contenttype/contenttype.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/content-type-v1.xml
2323 //go:generate go run ../cmd/wlgen -package xdgactivation -out xdgactivation/xdgactivation.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/xdg-activation-v1.xml
2424 //go:generate go run ../cmd/wlgen -package virtualkeyboard -out virtualkeyboard/virtualkeyboard.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/virtual-keyboard-unstable-v1.xml
25+//go:generate go run ../cmd/wlgen -package presentationtime -out presentationtime/presentationtime.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/presentation-time.xml
26+//go:generate go run ../cmd/wlgen -package linuxdrmsyncobj -out linuxdrmsyncobj/linuxdrmsyncobj.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/linux-drm-syncobj-v1.xml
27+//go:generate go run ../cmd/wlgen -package pointergestures -out pointergestures/pointergestures.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/pointer-gestures-unstable-v1.xml
28+//go:generate go run ../cmd/wlgen -package keyboardshortcutsinhibit -out keyboardshortcutsinhibit/keyboardshortcutsinhibit.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/keyboard-shortcuts-inhibit-unstable-v1.xml
29+//go:generate go run ../cmd/wlgen -package idleinhibit -out idleinhibit/idleinhibit.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/idle-inhibit-unstable-v1.xml
30+//go:generate go run ../cmd/wlgen -package extsessionlock -out extsessionlock/extsessionlock.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/ext-session-lock-v1.xml
31+//go:generate go run ../cmd/wlgen -package extidlenotify -out extidlenotify/extidlenotify.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/ext-idle-notify-v1.xml
32+//go:generate go run ../cmd/wlgen -package extforeigntoplevellist -out extforeigntoplevellist/extforeigntoplevellist.go ../protocols/ext-foreign-toplevel-list-v1.xml
33+//go:generate go run ../cmd/wlgen -package xdgdialog -out xdgdialog/xdgdialog.go -import xdgshell=github.com/bnema/purego-libwayland/protocol/xdgshell -import-xml xdgshell=../protocols/xdg-shell.xml ../protocols/xdg-dialog-v1.xml
34+//go:generate go run ../cmd/wlgen -package xdgtoplevelicon -out xdgtoplevelicon/xdgtoplevelicon.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml -import xdgshell=github.com/bnema/purego-libwayland/protocol/xdgshell -import-xml xdgshell=../protocols/xdg-shell.xml ../protocols/xdg-toplevel-icon-v1.xml
35+//go:generate go run ../cmd/wlgen -package xdgtopleveltag -out xdgtopleveltag/xdgtopleveltag.go -import xdgshell=github.com/bnema/purego-libwayland/protocol/xdgshell -import-xml xdgshell=../protocols/xdg-shell.xml ../protocols/xdg-toplevel-tag-v1.xml
36+//go:generate go run ../cmd/wlgen -package xdgsystembell -out xdgsystembell/xdgsystembell.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/xdg-system-bell-v1.xml
37+//go:generate go run ../cmd/wlgen -package xdgforeign -out xdgforeign/xdgforeign.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/xdg-foreign-unstable-v2.xml
A protocol/idleinhibit/idleinhibit.go +130 -0
@@ -0,0 +1,130 @@
1+// Code generated by wlgen; DO NOT EDIT.
2+package idleinhibit
3+
4+import (
5+ "fmt"
6+ wayland "github.com/bnema/purego-libwayland/protocol/wayland"
7+ "github.com/bnema/purego-libwayland/server"
8+)
9+
10+var ZwpIdleInhibitManagerV1Interface *server.Interface
11+var ZwpIdleInhibitorV1Interface *server.Interface
12+
13+func init() {
14+ ZwpIdleInhibitManagerV1Interface = &server.Interface{Name: "zwp_idle_inhibit_manager_v1", Version: 1}
15+ ZwpIdleInhibitorV1Interface = &server.Interface{Name: "zwp_idle_inhibitor_v1", Version: 1}
16+ ZwpIdleInhibitManagerV1Interface.Requests = []server.Message{
17+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
18+ {Name: "create_inhibitor", Signature: "no", Types: []*server.Interface{ZwpIdleInhibitorV1Interface, wayland.SurfaceInterface}},
19+ }
20+ ZwpIdleInhibitManagerV1Interface.Events = []server.Message{}
21+ ZwpIdleInhibitorV1Interface.Requests = []server.Message{
22+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
23+ }
24+ ZwpIdleInhibitorV1Interface.Events = []server.Message{}
25+ if err := server.NewInterfaces(ZwpIdleInhibitManagerV1Interface, ZwpIdleInhibitorV1Interface); err != nil {
26+ panic(err)
27+ }
28+}
29+
30+// ZwpIdleInhibitManagerV1 control behavior when display idles.
31+type ZwpIdleInhibitManagerV1 struct{ *server.Resource }
32+
33+func WrapZwpIdleInhibitManagerV1(r *server.Resource) *ZwpIdleInhibitManagerV1 {
34+ if r == nil {
35+ return nil
36+ }
37+ return &ZwpIdleInhibitManagerV1{r}
38+}
39+
40+const ZwpIdleInhibitManagerV1RequestDestroy uint32 = 0
41+const ZwpIdleInhibitManagerV1RequestCreateInhibitor uint32 = 1
42+
43+// ZwpIdleInhibitManagerV1Handler handles zwp_idle_inhibit_manager_v1 requests.
44+type ZwpIdleInhibitManagerV1Handler interface {
45+ Destroy(self *ZwpIdleInhibitManagerV1)
46+ CreateInhibitor(self *ZwpIdleInhibitManagerV1, id uint32, surface *wayland.Surface)
47+}
48+
49+func NewZwpIdleInhibitManagerV1(c server.Client, version int32, id uint32, h ZwpIdleInhibitManagerV1Handler) (*ZwpIdleInhibitManagerV1, error) {
50+ if h == nil {
51+ return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_idle_inhibit_manager_v1")
52+ }
53+ var self *ZwpIdleInhibitManagerV1
54+ r, err := c.CreateResource(ZwpIdleInhibitManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
55+ switch opcode {
56+ case 0:
57+ h.Destroy(self)
58+ self.Destroy()
59+ case 1:
60+ h.CreateInhibitor(self, args[0].NewID(), wayland.WrapSurface(args[1].Resource()))
61+ }
62+ })
63+ if err != nil {
64+ return nil, err
65+ }
66+ self = WrapZwpIdleInhibitManagerV1(r)
67+ r.Data = self
68+ return self, nil
69+}
70+func NewZwpIdleInhibitManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
71+ return d.CreateGlobal(ZwpIdleInhibitManagerV1Interface, version, bind)
72+}
73+
74+// ZwpIdleInhibitorV1 context object for inhibiting idle behavior.
75+type ZwpIdleInhibitorV1 struct{ *server.Resource }
76+
77+func WrapZwpIdleInhibitorV1(r *server.Resource) *ZwpIdleInhibitorV1 {
78+ if r == nil {
79+ return nil
80+ }
81+ return &ZwpIdleInhibitorV1{r}
82+}
83+
84+const ZwpIdleInhibitorV1RequestDestroy uint32 = 0
85+
86+// ZwpIdleInhibitorV1Handler handles zwp_idle_inhibitor_v1 requests.
87+type ZwpIdleInhibitorV1Handler interface {
88+ Destroy(self *ZwpIdleInhibitorV1)
89+}
90+
91+func NewZwpIdleInhibitorV1(c server.Client, version int32, id uint32, h ZwpIdleInhibitorV1Handler) (*ZwpIdleInhibitorV1, error) {
92+ if h == nil {
93+ return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_idle_inhibitor_v1")
94+ }
95+ var self *ZwpIdleInhibitorV1
96+ r, err := c.CreateResource(ZwpIdleInhibitorV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
97+ switch opcode {
98+ case 0:
99+ h.Destroy(self)
100+ self.Destroy()
101+ }
102+ })
103+ if err != nil {
104+ return nil, err
105+ }
106+ self = WrapZwpIdleInhibitorV1(r)
107+ r.Data = self
108+ return self, nil
109+}
110+func NewZwpIdleInhibitorV1Global(d *server.Display, version int32, bind server.BindFunc) error {
111+ return d.CreateGlobal(ZwpIdleInhibitorV1Interface, version, bind)
112+}
113+func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
114+ if v == nil {
115+ return nil
116+ }
117+ return v.GetResource()
118+}
119+func (self *ZwpIdleInhibitManagerV1) GetResource() *server.Resource {
120+ if self == nil {
121+ return nil
122+ }
123+ return self.Resource
124+}
125+func (self *ZwpIdleInhibitorV1) GetResource() *server.Resource {
126+ if self == nil {
127+ return nil
128+ }
129+ return self.Resource
130+}
A protocol/keyboardshortcutsinhibit/keyboardshortcutsinhibit.go +152 -0
@@ -0,0 +1,152 @@
1+// Code generated by wlgen; DO NOT EDIT.
2+package keyboardshortcutsinhibit
3+
4+import (
5+ "fmt"
6+ wayland "github.com/bnema/purego-libwayland/protocol/wayland"
7+ "github.com/bnema/purego-libwayland/server"
8+)
9+
10+var ZwpKeyboardShortcutsInhibitManagerV1Interface *server.Interface
11+var ZwpKeyboardShortcutsInhibitorV1Interface *server.Interface
12+
13+func init() {
14+ ZwpKeyboardShortcutsInhibitManagerV1Interface = &server.Interface{Name: "zwp_keyboard_shortcuts_inhibit_manager_v1", Version: 1}
15+ ZwpKeyboardShortcutsInhibitorV1Interface = &server.Interface{Name: "zwp_keyboard_shortcuts_inhibitor_v1", Version: 1}
16+ ZwpKeyboardShortcutsInhibitManagerV1Interface.Requests = []server.Message{
17+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
18+ {Name: "inhibit_shortcuts", Signature: "noo", Types: []*server.Interface{ZwpKeyboardShortcutsInhibitorV1Interface, wayland.SurfaceInterface, wayland.SeatInterface}},
19+ }
20+ ZwpKeyboardShortcutsInhibitManagerV1Interface.Events = []server.Message{}
21+ ZwpKeyboardShortcutsInhibitorV1Interface.Requests = []server.Message{
22+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
23+ }
24+ ZwpKeyboardShortcutsInhibitorV1Interface.Events = []server.Message{
25+ {Name: "active", Signature: "", Types: []*server.Interface{}},
26+ {Name: "inactive", Signature: "", Types: []*server.Interface{}},
27+ }
28+ if err := server.NewInterfaces(ZwpKeyboardShortcutsInhibitManagerV1Interface, ZwpKeyboardShortcutsInhibitorV1Interface); err != nil {
29+ panic(err)
30+ }
31+}
32+
33+// ZwpKeyboardShortcutsInhibitManagerV1 context object for keyboard grab_manager.
34+type ZwpKeyboardShortcutsInhibitManagerV1 struct{ *server.Resource }
35+
36+func WrapZwpKeyboardShortcutsInhibitManagerV1(r *server.Resource) *ZwpKeyboardShortcutsInhibitManagerV1 {
37+ if r == nil {
38+ return nil
39+ }
40+ return &ZwpKeyboardShortcutsInhibitManagerV1{r}
41+}
42+
43+const ZwpKeyboardShortcutsInhibitManagerV1RequestDestroy uint32 = 0
44+const ZwpKeyboardShortcutsInhibitManagerV1RequestInhibitShortcuts uint32 = 1
45+
46+// ZwpKeyboardShortcutsInhibitManagerV1Error .
47+type ZwpKeyboardShortcutsInhibitManagerV1Error uint32
48+
49+const (
50+ ZwpKeyboardShortcutsInhibitManagerV1ErrorAlreadyInhibited ZwpKeyboardShortcutsInhibitManagerV1Error = 0
51+)
52+
53+// ZwpKeyboardShortcutsInhibitManagerV1Handler handles zwp_keyboard_shortcuts_inhibit_manager_v1 requests.
54+type ZwpKeyboardShortcutsInhibitManagerV1Handler interface {
55+ Destroy(self *ZwpKeyboardShortcutsInhibitManagerV1)
56+ InhibitShortcuts(self *ZwpKeyboardShortcutsInhibitManagerV1, id uint32, surface *wayland.Surface, seat *wayland.Seat)
57+}
58+
59+func NewZwpKeyboardShortcutsInhibitManagerV1(c server.Client, version int32, id uint32, h ZwpKeyboardShortcutsInhibitManagerV1Handler) (*ZwpKeyboardShortcutsInhibitManagerV1, error) {
60+ if h == nil {
61+ return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_keyboard_shortcuts_inhibit_manager_v1")
62+ }
63+ var self *ZwpKeyboardShortcutsInhibitManagerV1
64+ r, err := c.CreateResource(ZwpKeyboardShortcutsInhibitManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
65+ switch opcode {
66+ case 0:
67+ h.Destroy(self)
68+ self.Destroy()
69+ case 1:
70+ h.InhibitShortcuts(self, args[0].NewID(), wayland.WrapSurface(args[1].Resource()), wayland.WrapSeat(args[2].Resource()))
71+ }
72+ })
73+ if err != nil {
74+ return nil, err
75+ }
76+ self = WrapZwpKeyboardShortcutsInhibitManagerV1(r)
77+ r.Data = self
78+ return self, nil
79+}
80+func NewZwpKeyboardShortcutsInhibitManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
81+ return d.CreateGlobal(ZwpKeyboardShortcutsInhibitManagerV1Interface, version, bind)
82+}
83+
84+// ZwpKeyboardShortcutsInhibitorV1 context object for keyboard shortcuts inhibitor.
85+type ZwpKeyboardShortcutsInhibitorV1 struct{ *server.Resource }
86+
87+func WrapZwpKeyboardShortcutsInhibitorV1(r *server.Resource) *ZwpKeyboardShortcutsInhibitorV1 {
88+ if r == nil {
89+ return nil
90+ }
91+ return &ZwpKeyboardShortcutsInhibitorV1{r}
92+}
93+
94+const ZwpKeyboardShortcutsInhibitorV1RequestDestroy uint32 = 0
95+const ZwpKeyboardShortcutsInhibitorV1EventActive uint32 = 0
96+const ZwpKeyboardShortcutsInhibitorV1EventInactive uint32 = 1
97+
98+// ZwpKeyboardShortcutsInhibitorV1Handler handles zwp_keyboard_shortcuts_inhibitor_v1 requests.
99+type ZwpKeyboardShortcutsInhibitorV1Handler interface {
100+ Destroy(self *ZwpKeyboardShortcutsInhibitorV1)
101+}
102+
103+func NewZwpKeyboardShortcutsInhibitorV1(c server.Client, version int32, id uint32, h ZwpKeyboardShortcutsInhibitorV1Handler) (*ZwpKeyboardShortcutsInhibitorV1, error) {
104+ if h == nil {
105+ return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_keyboard_shortcuts_inhibitor_v1")
106+ }
107+ var self *ZwpKeyboardShortcutsInhibitorV1
108+ r, err := c.CreateResource(ZwpKeyboardShortcutsInhibitorV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
109+ switch opcode {
110+ case 0:
111+ h.Destroy(self)
112+ self.Destroy()
113+ }
114+ })
115+ if err != nil {
116+ return nil, err
117+ }
118+ self = WrapZwpKeyboardShortcutsInhibitorV1(r)
119+ r.Data = self
120+ return self, nil
121+}
122+
123+// SendActive shortcuts are inhibited.
124+func (self *ZwpKeyboardShortcutsInhibitorV1) SendActive() {
125+ self.PostEvent(ZwpKeyboardShortcutsInhibitorV1EventActive)
126+}
127+
128+// SendInactive shortcuts are restored.
129+func (self *ZwpKeyboardShortcutsInhibitorV1) SendInactive() {
130+ self.PostEvent(ZwpKeyboardShortcutsInhibitorV1EventInactive)
131+}
132+func NewZwpKeyboardShortcutsInhibitorV1Global(d *server.Display, version int32, bind server.BindFunc) error {
133+ return d.CreateGlobal(ZwpKeyboardShortcutsInhibitorV1Interface, version, bind)
134+}
135+func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
136+ if v == nil {
137+ return nil
138+ }
139+ return v.GetResource()
140+}
141+func (self *ZwpKeyboardShortcutsInhibitManagerV1) GetResource() *server.Resource {
142+ if self == nil {
143+ return nil
144+ }
145+ return self.Resource
146+}
147+func (self *ZwpKeyboardShortcutsInhibitorV1) GetResource() *server.Resource {
148+ if self == nil {
149+ return nil
150+ }
151+ return self.Resource
152+}
A protocol/linuxdrmsyncobj/linuxdrmsyncobj.go +217 -0
@@ -0,0 +1,217 @@
1+// Code generated by wlgen; DO NOT EDIT.
2+package linuxdrmsyncobj
3+
4+import (
5+ "fmt"
6+ wayland "github.com/bnema/purego-libwayland/protocol/wayland"
7+ "github.com/bnema/purego-libwayland/server"
8+)
9+
10+var WpLinuxDrmSyncobjManagerV1Interface *server.Interface
11+var WpLinuxDrmSyncobjTimelineV1Interface *server.Interface
12+var WpLinuxDrmSyncobjSurfaceV1Interface *server.Interface
13+
14+func init() {
15+ WpLinuxDrmSyncobjManagerV1Interface = &server.Interface{Name: "wp_linux_drm_syncobj_manager_v1", Version: 1}
16+ WpLinuxDrmSyncobjTimelineV1Interface = &server.Interface{Name: "wp_linux_drm_syncobj_timeline_v1", Version: 1}
17+ WpLinuxDrmSyncobjSurfaceV1Interface = &server.Interface{Name: "wp_linux_drm_syncobj_surface_v1", Version: 1}
18+ WpLinuxDrmSyncobjManagerV1Interface.Requests = []server.Message{
19+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
20+ {Name: "get_surface", Signature: "no", Types: []*server.Interface{WpLinuxDrmSyncobjSurfaceV1Interface, wayland.SurfaceInterface}},
21+ {Name: "import_timeline", Signature: "nh", Types: []*server.Interface{WpLinuxDrmSyncobjTimelineV1Interface, nil}},
22+ }
23+ WpLinuxDrmSyncobjManagerV1Interface.Events = []server.Message{}
24+ WpLinuxDrmSyncobjTimelineV1Interface.Requests = []server.Message{
25+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
26+ }
27+ WpLinuxDrmSyncobjTimelineV1Interface.Events = []server.Message{}
28+ WpLinuxDrmSyncobjSurfaceV1Interface.Requests = []server.Message{
29+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
30+ {Name: "set_acquire_point", Signature: "ouu", Types: []*server.Interface{WpLinuxDrmSyncobjTimelineV1Interface, nil, nil}},
31+ {Name: "set_release_point", Signature: "ouu", Types: []*server.Interface{WpLinuxDrmSyncobjTimelineV1Interface, nil, nil}},
32+ }
33+ WpLinuxDrmSyncobjSurfaceV1Interface.Events = []server.Message{}
34+ if err := server.NewInterfaces(WpLinuxDrmSyncobjManagerV1Interface, WpLinuxDrmSyncobjTimelineV1Interface, WpLinuxDrmSyncobjSurfaceV1Interface); err != nil {
35+ panic(err)
36+ }
37+}
38+
39+// WpLinuxDrmSyncobjManagerV1 global for providing explicit synchronization.
40+type WpLinuxDrmSyncobjManagerV1 struct{ *server.Resource }
41+
42+func WrapWpLinuxDrmSyncobjManagerV1(r *server.Resource) *WpLinuxDrmSyncobjManagerV1 {
43+ if r == nil {
44+ return nil
45+ }
46+ return &WpLinuxDrmSyncobjManagerV1{r}
47+}
48+
49+const WpLinuxDrmSyncobjManagerV1RequestDestroy uint32 = 0
50+const WpLinuxDrmSyncobjManagerV1RequestGetSurface uint32 = 1
51+const WpLinuxDrmSyncobjManagerV1RequestImportTimeline uint32 = 2
52+
53+// WpLinuxDrmSyncobjManagerV1Error .
54+type WpLinuxDrmSyncobjManagerV1Error uint32
55+
56+const (
57+ WpLinuxDrmSyncobjManagerV1ErrorSurfaceExists WpLinuxDrmSyncobjManagerV1Error = 0
58+ WpLinuxDrmSyncobjManagerV1ErrorInvalidTimeline WpLinuxDrmSyncobjManagerV1Error = 1
59+)
60+
61+// WpLinuxDrmSyncobjManagerV1Handler handles wp_linux_drm_syncobj_manager_v1 requests.
62+type WpLinuxDrmSyncobjManagerV1Handler interface {
63+ Destroy(self *WpLinuxDrmSyncobjManagerV1)
64+ GetSurface(self *WpLinuxDrmSyncobjManagerV1, id uint32, surface *wayland.Surface)
65+ ImportTimeline(self *WpLinuxDrmSyncobjManagerV1, id uint32, fd int)
66+}
67+
68+func NewWpLinuxDrmSyncobjManagerV1(c server.Client, version int32, id uint32, h WpLinuxDrmSyncobjManagerV1Handler) (*WpLinuxDrmSyncobjManagerV1, error) {
69+ if h == nil {
70+ return nil, fmt.Errorf("purego-libwayland: nil handler for wp_linux_drm_syncobj_manager_v1")
71+ }
72+ var self *WpLinuxDrmSyncobjManagerV1
73+ r, err := c.CreateResource(WpLinuxDrmSyncobjManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
74+ switch opcode {
75+ case 0:
76+ h.Destroy(self)
77+ self.Destroy()
78+ case 1:
79+ h.GetSurface(self, args[0].NewID(), wayland.WrapSurface(args[1].Resource()))
80+ case 2:
81+ h.ImportTimeline(self, args[0].NewID(), args[1].Fd())
82+ }
83+ })
84+ if err != nil {
85+ return nil, err
86+ }
87+ self = WrapWpLinuxDrmSyncobjManagerV1(r)
88+ r.Data = self
89+ return self, nil
90+}
91+func NewWpLinuxDrmSyncobjManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
92+ return d.CreateGlobal(WpLinuxDrmSyncobjManagerV1Interface, version, bind)
93+}
94+
95+// WpLinuxDrmSyncobjTimelineV1 synchronization object timeline.
96+type WpLinuxDrmSyncobjTimelineV1 struct{ *server.Resource }
97+
98+func WrapWpLinuxDrmSyncobjTimelineV1(r *server.Resource) *WpLinuxDrmSyncobjTimelineV1 {
99+ if r == nil {
100+ return nil
101+ }
102+ return &WpLinuxDrmSyncobjTimelineV1{r}
103+}
104+
105+const WpLinuxDrmSyncobjTimelineV1RequestDestroy uint32 = 0
106+
107+// WpLinuxDrmSyncobjTimelineV1Handler handles wp_linux_drm_syncobj_timeline_v1 requests.
108+type WpLinuxDrmSyncobjTimelineV1Handler interface {
109+ Destroy(self *WpLinuxDrmSyncobjTimelineV1)
110+}
111+
112+func NewWpLinuxDrmSyncobjTimelineV1(c server.Client, version int32, id uint32, h WpLinuxDrmSyncobjTimelineV1Handler) (*WpLinuxDrmSyncobjTimelineV1, error) {
113+ if h == nil {
114+ return nil, fmt.Errorf("purego-libwayland: nil handler for wp_linux_drm_syncobj_timeline_v1")
115+ }
116+ var self *WpLinuxDrmSyncobjTimelineV1
117+ r, err := c.CreateResource(WpLinuxDrmSyncobjTimelineV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
118+ switch opcode {
119+ case 0:
120+ h.Destroy(self)
121+ self.Destroy()
122+ }
123+ })
124+ if err != nil {
125+ return nil, err
126+ }
127+ self = WrapWpLinuxDrmSyncobjTimelineV1(r)
128+ r.Data = self
129+ return self, nil
130+}
131+func NewWpLinuxDrmSyncobjTimelineV1Global(d *server.Display, version int32, bind server.BindFunc) error {
132+ return d.CreateGlobal(WpLinuxDrmSyncobjTimelineV1Interface, version, bind)
133+}
134+
135+// WpLinuxDrmSyncobjSurfaceV1 per-surface explicit synchronization.
136+type WpLinuxDrmSyncobjSurfaceV1 struct{ *server.Resource }
137+
138+func WrapWpLinuxDrmSyncobjSurfaceV1(r *server.Resource) *WpLinuxDrmSyncobjSurfaceV1 {
139+ if r == nil {
140+ return nil
141+ }
142+ return &WpLinuxDrmSyncobjSurfaceV1{r}
143+}
144+
145+const WpLinuxDrmSyncobjSurfaceV1RequestDestroy uint32 = 0
146+const WpLinuxDrmSyncobjSurfaceV1RequestSetAcquirePoint uint32 = 1
147+const WpLinuxDrmSyncobjSurfaceV1RequestSetReleasePoint uint32 = 2
148+
149+// WpLinuxDrmSyncobjSurfaceV1Error .
150+type WpLinuxDrmSyncobjSurfaceV1Error uint32
151+
152+const (
153+ WpLinuxDrmSyncobjSurfaceV1ErrorNoSurface WpLinuxDrmSyncobjSurfaceV1Error = 1
154+ WpLinuxDrmSyncobjSurfaceV1ErrorUnsupportedBuffer WpLinuxDrmSyncobjSurfaceV1Error = 2
155+ WpLinuxDrmSyncobjSurfaceV1ErrorNoBuffer WpLinuxDrmSyncobjSurfaceV1Error = 3
156+ WpLinuxDrmSyncobjSurfaceV1ErrorNoAcquirePoint WpLinuxDrmSyncobjSurfaceV1Error = 4
157+ WpLinuxDrmSyncobjSurfaceV1ErrorNoReleasePoint WpLinuxDrmSyncobjSurfaceV1Error = 5
158+ WpLinuxDrmSyncobjSurfaceV1ErrorConflictingPoints WpLinuxDrmSyncobjSurfaceV1Error = 6
159+)
160+
161+// WpLinuxDrmSyncobjSurfaceV1Handler handles wp_linux_drm_syncobj_surface_v1 requests.
162+type WpLinuxDrmSyncobjSurfaceV1Handler interface {
163+ Destroy(self *WpLinuxDrmSyncobjSurfaceV1)
164+ SetAcquirePoint(self *WpLinuxDrmSyncobjSurfaceV1, timeline *WpLinuxDrmSyncobjTimelineV1, pointHi uint32, pointLo uint32)
165+ SetReleasePoint(self *WpLinuxDrmSyncobjSurfaceV1, timeline *WpLinuxDrmSyncobjTimelineV1, pointHi uint32, pointLo uint32)
166+}
167+
168+func NewWpLinuxDrmSyncobjSurfaceV1(c server.Client, version int32, id uint32, h WpLinuxDrmSyncobjSurfaceV1Handler) (*WpLinuxDrmSyncobjSurfaceV1, error) {
169+ if h == nil {
170+ return nil, fmt.Errorf("purego-libwayland: nil handler for wp_linux_drm_syncobj_surface_v1")
171+ }
172+ var self *WpLinuxDrmSyncobjSurfaceV1
173+ r, err := c.CreateResource(WpLinuxDrmSyncobjSurfaceV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
174+ switch opcode {
175+ case 0:
176+ h.Destroy(self)
177+ self.Destroy()
178+ case 1:
179+ h.SetAcquirePoint(self, WrapWpLinuxDrmSyncobjTimelineV1(args[0].Resource()), args[1].Uint(), args[2].Uint())
180+ case 2:
181+ h.SetReleasePoint(self, WrapWpLinuxDrmSyncobjTimelineV1(args[0].Resource()), args[1].Uint(), args[2].Uint())
182+ }
183+ })
184+ if err != nil {
185+ return nil, err
186+ }
187+ self = WrapWpLinuxDrmSyncobjSurfaceV1(r)
188+ r.Data = self
189+ return self, nil
190+}
191+func NewWpLinuxDrmSyncobjSurfaceV1Global(d *server.Display, version int32, bind server.BindFunc) error {
192+ return d.CreateGlobal(WpLinuxDrmSyncobjSurfaceV1Interface, version, bind)
193+}
194+func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
195+ if v == nil {
196+ return nil
197+ }
198+ return v.GetResource()
199+}
200+func (self *WpLinuxDrmSyncobjManagerV1) GetResource() *server.Resource {
201+ if self == nil {
202+ return nil
203+ }
204+ return self.Resource
205+}
206+func (self *WpLinuxDrmSyncobjTimelineV1) GetResource() *server.Resource {
207+ if self == nil {
208+ return nil
209+ }
210+ return self.Resource
211+}
212+func (self *WpLinuxDrmSyncobjSurfaceV1) GetResource() *server.Resource {
213+ if self == nil {
214+ return nil
215+ }
216+ return self.Resource
217+}
A protocol/pointergestures/pointergestures.go +303 -0
@@ -0,0 +1,303 @@
1+// Code generated by wlgen; DO NOT EDIT.
2+package pointergestures
3+
4+import (
5+ "fmt"
6+ wayland "github.com/bnema/purego-libwayland/protocol/wayland"
7+ "github.com/bnema/purego-libwayland/server"
8+)
9+
10+var ZwpPointerGesturesV1Interface *server.Interface
11+var ZwpPointerGestureSwipeV1Interface *server.Interface
12+var ZwpPointerGesturePinchV1Interface *server.Interface
13+var ZwpPointerGestureHoldV1Interface *server.Interface
14+
15+func init() {
16+ ZwpPointerGesturesV1Interface = &server.Interface{Name: "zwp_pointer_gestures_v1", Version: 3}
17+ ZwpPointerGestureSwipeV1Interface = &server.Interface{Name: "zwp_pointer_gesture_swipe_v1", Version: 3}
18+ ZwpPointerGesturePinchV1Interface = &server.Interface{Name: "zwp_pointer_gesture_pinch_v1", Version: 3}
19+ ZwpPointerGestureHoldV1Interface = &server.Interface{Name: "zwp_pointer_gesture_hold_v1", Version: 3}
20+ ZwpPointerGesturesV1Interface.Requests = []server.Message{
21+ {Name: "get_swipe_gesture", Signature: "no", Types: []*server.Interface{ZwpPointerGestureSwipeV1Interface, wayland.PointerInterface}},
22+ {Name: "get_pinch_gesture", Signature: "no", Types: []*server.Interface{ZwpPointerGesturePinchV1Interface, wayland.PointerInterface}},
23+ {Name: "release", Signature: "2", Types: []*server.Interface{}},
24+ {Name: "get_hold_gesture", Signature: "3no", Types: []*server.Interface{ZwpPointerGestureHoldV1Interface, wayland.PointerInterface}},
25+ }
26+ ZwpPointerGesturesV1Interface.Events = []server.Message{}
27+ ZwpPointerGestureSwipeV1Interface.Requests = []server.Message{
28+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
29+ }
30+ ZwpPointerGestureSwipeV1Interface.Events = []server.Message{
31+ {Name: "begin", Signature: "uuou", Types: []*server.Interface{nil, nil, wayland.SurfaceInterface, nil}},
32+ {Name: "update", Signature: "uff", Types: []*server.Interface{nil, nil, nil}},
33+ {Name: "end", Signature: "uui", Types: []*server.Interface{nil, nil, nil}},
34+ }
35+ ZwpPointerGesturePinchV1Interface.Requests = []server.Message{
36+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
37+ }
38+ ZwpPointerGesturePinchV1Interface.Events = []server.Message{
39+ {Name: "begin", Signature: "uuou", Types: []*server.Interface{nil, nil, wayland.SurfaceInterface, nil}},
40+ {Name: "update", Signature: "uffff", Types: []*server.Interface{nil, nil, nil, nil, nil}},
41+ {Name: "end", Signature: "uui", Types: []*server.Interface{nil, nil, nil}},
42+ }
43+ ZwpPointerGestureHoldV1Interface.Requests = []server.Message{
44+ {Name: "destroy", Signature: "3", Types: []*server.Interface{}},
45+ }
46+ ZwpPointerGestureHoldV1Interface.Events = []server.Message{
47+ {Name: "begin", Signature: "3uuou", Types: []*server.Interface{nil, nil, wayland.SurfaceInterface, nil}},
48+ {Name: "end", Signature: "3uui", Types: []*server.Interface{nil, nil, nil}},
49+ }
50+ if err := server.NewInterfaces(ZwpPointerGesturesV1Interface, ZwpPointerGestureSwipeV1Interface, ZwpPointerGesturePinchV1Interface, ZwpPointerGestureHoldV1Interface); err != nil {
51+ panic(err)
52+ }
53+}
54+
55+// ZwpPointerGesturesV1 touchpad gestures.
56+type ZwpPointerGesturesV1 struct{ *server.Resource }
57+
58+func WrapZwpPointerGesturesV1(r *server.Resource) *ZwpPointerGesturesV1 {
59+ if r == nil {
60+ return nil
61+ }
62+ return &ZwpPointerGesturesV1{r}
63+}
64+
65+const ZwpPointerGesturesV1RequestGetSwipeGesture uint32 = 0
66+const ZwpPointerGesturesV1RequestGetPinchGesture uint32 = 1
67+const ZwpPointerGesturesV1RequestRelease uint32 = 2
68+const ZwpPointerGesturesV1RequestGetHoldGesture uint32 = 3
69+
70+// ZwpPointerGesturesV1Handler handles zwp_pointer_gestures_v1 requests.
71+type ZwpPointerGesturesV1Handler interface {
72+ GetSwipeGesture(self *ZwpPointerGesturesV1, id uint32, pointer *wayland.Pointer)
73+ GetPinchGesture(self *ZwpPointerGesturesV1, id uint32, pointer *wayland.Pointer)
74+ Release(self *ZwpPointerGesturesV1)
75+ GetHoldGesture(self *ZwpPointerGesturesV1, id uint32, pointer *wayland.Pointer)
76+}
77+
78+func NewZwpPointerGesturesV1(c server.Client, version int32, id uint32, h ZwpPointerGesturesV1Handler) (*ZwpPointerGesturesV1, error) {
79+ if h == nil {
80+ return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_pointer_gestures_v1")
81+ }
82+ var self *ZwpPointerGesturesV1
83+ r, err := c.CreateResource(ZwpPointerGesturesV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
84+ switch opcode {
85+ case 0:
86+ h.GetSwipeGesture(self, args[0].NewID(), wayland.WrapPointer(args[1].Resource()))
87+ case 1:
88+ h.GetPinchGesture(self, args[0].NewID(), wayland.WrapPointer(args[1].Resource()))
89+ case 2:
90+ h.Release(self)
91+ self.Destroy()
92+ case 3:
93+ h.GetHoldGesture(self, args[0].NewID(), wayland.WrapPointer(args[1].Resource()))
94+ }
95+ })
96+ if err != nil {
97+ return nil, err
98+ }
99+ self = WrapZwpPointerGesturesV1(r)
100+ r.Data = self
101+ return self, nil
102+}
103+func NewZwpPointerGesturesV1Global(d *server.Display, version int32, bind server.BindFunc) error {
104+ return d.CreateGlobal(ZwpPointerGesturesV1Interface, version, bind)
105+}
106+
107+// ZwpPointerGestureSwipeV1 a swipe gesture object.
108+type ZwpPointerGestureSwipeV1 struct{ *server.Resource }
109+
110+func WrapZwpPointerGestureSwipeV1(r *server.Resource) *ZwpPointerGestureSwipeV1 {
111+ if r == nil {
112+ return nil
113+ }
114+ return &ZwpPointerGestureSwipeV1{r}
115+}
116+
117+const ZwpPointerGestureSwipeV1RequestDestroy uint32 = 0
118+const ZwpPointerGestureSwipeV1EventBegin uint32 = 0
119+const ZwpPointerGestureSwipeV1EventUpdate uint32 = 1
120+const ZwpPointerGestureSwipeV1EventEnd uint32 = 2
121+
122+// ZwpPointerGestureSwipeV1Handler handles zwp_pointer_gesture_swipe_v1 requests.
123+type ZwpPointerGestureSwipeV1Handler interface {
124+ Destroy(self *ZwpPointerGestureSwipeV1)
125+}
126+
127+func NewZwpPointerGestureSwipeV1(c server.Client, version int32, id uint32, h ZwpPointerGestureSwipeV1Handler) (*ZwpPointerGestureSwipeV1, error) {
128+ if h == nil {
129+ return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_pointer_gesture_swipe_v1")
130+ }
131+ var self *ZwpPointerGestureSwipeV1
132+ r, err := c.CreateResource(ZwpPointerGestureSwipeV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
133+ switch opcode {
134+ case 0:
135+ h.Destroy(self)
136+ self.Destroy()
137+ }
138+ })
139+ if err != nil {
140+ return nil, err
141+ }
142+ self = WrapZwpPointerGestureSwipeV1(r)
143+ r.Data = self
144+ return self, nil
145+}
146+
147+// SendBegin multi-finger swipe begin.
148+func (self *ZwpPointerGestureSwipeV1) SendBegin(serial uint32, time uint32, surface *wayland.Surface, fingers uint32) {
149+ self.PostEvent(ZwpPointerGestureSwipeV1EventBegin, server.Uint(serial), server.Uint(time), server.Object(resourceOf(surface)), server.Uint(fingers))
150+}
151+
152+// SendUpdate multi-finger swipe motion.
153+func (self *ZwpPointerGestureSwipeV1) SendUpdate(time uint32, dx server.Fixed, dy server.Fixed) {
154+ self.PostEvent(ZwpPointerGestureSwipeV1EventUpdate, server.Uint(time), server.FixedArg(dx), server.FixedArg(dy))
155+}
156+
157+// SendEnd multi-finger swipe end.
158+func (self *ZwpPointerGestureSwipeV1) SendEnd(serial uint32, time uint32, cancelled int32) {
159+ self.PostEvent(ZwpPointerGestureSwipeV1EventEnd, server.Uint(serial), server.Uint(time), server.Int(cancelled))
160+}
161+func NewZwpPointerGestureSwipeV1Global(d *server.Display, version int32, bind server.BindFunc) error {
162+ return d.CreateGlobal(ZwpPointerGestureSwipeV1Interface, version, bind)
163+}
164+
165+// ZwpPointerGesturePinchV1 a pinch gesture object.
166+type ZwpPointerGesturePinchV1 struct{ *server.Resource }
167+
168+func WrapZwpPointerGesturePinchV1(r *server.Resource) *ZwpPointerGesturePinchV1 {
169+ if r == nil {
170+ return nil
171+ }
172+ return &ZwpPointerGesturePinchV1{r}
173+}
174+
175+const ZwpPointerGesturePinchV1RequestDestroy uint32 = 0
176+const ZwpPointerGesturePinchV1EventBegin uint32 = 0
177+const ZwpPointerGesturePinchV1EventUpdate uint32 = 1
178+const ZwpPointerGesturePinchV1EventEnd uint32 = 2
179+
180+// ZwpPointerGesturePinchV1Handler handles zwp_pointer_gesture_pinch_v1 requests.
181+type ZwpPointerGesturePinchV1Handler interface {
182+ Destroy(self *ZwpPointerGesturePinchV1)
183+}
184+
185+func NewZwpPointerGesturePinchV1(c server.Client, version int32, id uint32, h ZwpPointerGesturePinchV1Handler) (*ZwpPointerGesturePinchV1, error) {
186+ if h == nil {
187+ return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_pointer_gesture_pinch_v1")
188+ }
189+ var self *ZwpPointerGesturePinchV1
190+ r, err := c.CreateResource(ZwpPointerGesturePinchV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
191+ switch opcode {
192+ case 0:
193+ h.Destroy(self)
194+ self.Destroy()
195+ }
196+ })
197+ if err != nil {
198+ return nil, err
199+ }
200+ self = WrapZwpPointerGesturePinchV1(r)
201+ r.Data = self
202+ return self, nil
203+}
204+
205+// SendBegin multi-finger pinch begin.
206+func (self *ZwpPointerGesturePinchV1) SendBegin(serial uint32, time uint32, surface *wayland.Surface, fingers uint32) {
207+ self.PostEvent(ZwpPointerGesturePinchV1EventBegin, server.Uint(serial), server.Uint(time), server.Object(resourceOf(surface)), server.Uint(fingers))
208+}
209+
210+// SendUpdate multi-finger pinch motion.
211+func (self *ZwpPointerGesturePinchV1) SendUpdate(time uint32, dx server.Fixed, dy server.Fixed, scale server.Fixed, rotation server.Fixed) {
212+ self.PostEvent(ZwpPointerGesturePinchV1EventUpdate, server.Uint(time), server.FixedArg(dx), server.FixedArg(dy), server.FixedArg(scale), server.FixedArg(rotation))
213+}
214+
215+// SendEnd multi-finger pinch end.
216+func (self *ZwpPointerGesturePinchV1) SendEnd(serial uint32, time uint32, cancelled int32) {
217+ self.PostEvent(ZwpPointerGesturePinchV1EventEnd, server.Uint(serial), server.Uint(time), server.Int(cancelled))
218+}
219+func NewZwpPointerGesturePinchV1Global(d *server.Display, version int32, bind server.BindFunc) error {
220+ return d.CreateGlobal(ZwpPointerGesturePinchV1Interface, version, bind)
221+}
222+
223+// ZwpPointerGestureHoldV1 a hold gesture object.
224+type ZwpPointerGestureHoldV1 struct{ *server.Resource }
225+
226+func WrapZwpPointerGestureHoldV1(r *server.Resource) *ZwpPointerGestureHoldV1 {
227+ if r == nil {
228+ return nil
229+ }
230+ return &ZwpPointerGestureHoldV1{r}
231+}
232+
233+const ZwpPointerGestureHoldV1RequestDestroy uint32 = 0
234+const ZwpPointerGestureHoldV1EventBegin uint32 = 0
235+const ZwpPointerGestureHoldV1EventEnd uint32 = 1
236+
237+// ZwpPointerGestureHoldV1Handler handles zwp_pointer_gesture_hold_v1 requests.
238+type ZwpPointerGestureHoldV1Handler interface {
239+ Destroy(self *ZwpPointerGestureHoldV1)
240+}
241+
242+func NewZwpPointerGestureHoldV1(c server.Client, version int32, id uint32, h ZwpPointerGestureHoldV1Handler) (*ZwpPointerGestureHoldV1, error) {
243+ if h == nil {
244+ return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_pointer_gesture_hold_v1")
245+ }
246+ var self *ZwpPointerGestureHoldV1
247+ r, err := c.CreateResource(ZwpPointerGestureHoldV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
248+ switch opcode {
249+ case 0:
250+ h.Destroy(self)
251+ self.Destroy()
252+ }
253+ })
254+ if err != nil {
255+ return nil, err
256+ }
257+ self = WrapZwpPointerGestureHoldV1(r)
258+ r.Data = self
259+ return self, nil
260+}
261+
262+// SendBegin multi-finger hold begin (since version 3).
263+func (self *ZwpPointerGestureHoldV1) SendBegin(serial uint32, time uint32, surface *wayland.Surface, fingers uint32) {
264+ self.PostEvent(ZwpPointerGestureHoldV1EventBegin, server.Uint(serial), server.Uint(time), server.Object(resourceOf(surface)), server.Uint(fingers))
265+}
266+
267+// SendEnd multi-finger hold end (since version 3).
268+func (self *ZwpPointerGestureHoldV1) SendEnd(serial uint32, time uint32, cancelled int32) {
269+ self.PostEvent(ZwpPointerGestureHoldV1EventEnd, server.Uint(serial), server.Uint(time), server.Int(cancelled))
270+}
271+func NewZwpPointerGestureHoldV1Global(d *server.Display, version int32, bind server.BindFunc) error {
272+ return d.CreateGlobal(ZwpPointerGestureHoldV1Interface, version, bind)
273+}
274+func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
275+ if v == nil {
276+ return nil
277+ }
278+ return v.GetResource()
279+}
280+func (self *ZwpPointerGesturesV1) GetResource() *server.Resource {
281+ if self == nil {
282+ return nil
283+ }
284+ return self.Resource
285+}
286+func (self *ZwpPointerGestureSwipeV1) GetResource() *server.Resource {
287+ if self == nil {
288+ return nil
289+ }
290+ return self.Resource
291+}
292+func (self *ZwpPointerGesturePinchV1) GetResource() *server.Resource {
293+ if self == nil {
294+ return nil
295+ }
296+ return self.Resource
297+}
298+func (self *ZwpPointerGestureHoldV1) GetResource() *server.Resource {
299+ if self == nil {
300+ return nil
301+ }
302+ return self.Resource
303+}
A protocol/presentationtime/presentationtime.go +168 -0
@@ -0,0 +1,168 @@
1+// Code generated by wlgen; DO NOT EDIT.
2+package presentationtime
3+
4+import (
5+ "fmt"
6+ wayland "github.com/bnema/purego-libwayland/protocol/wayland"
7+ "github.com/bnema/purego-libwayland/server"
8+)
9+
10+var WpPresentationInterface *server.Interface
11+var WpPresentationFeedbackInterface *server.Interface
12+
13+func init() {
14+ WpPresentationInterface = &server.Interface{Name: "wp_presentation", Version: 2}
15+ WpPresentationFeedbackInterface = &server.Interface{Name: "wp_presentation_feedback", Version: 2}
16+ WpPresentationInterface.Requests = []server.Message{
17+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
18+ {Name: "feedback", Signature: "on", Types: []*server.Interface{wayland.SurfaceInterface, WpPresentationFeedbackInterface}},
19+ }
20+ WpPresentationInterface.Events = []server.Message{
21+ {Name: "clock_id", Signature: "u", Types: []*server.Interface{nil}},
22+ }
23+ WpPresentationFeedbackInterface.Requests = []server.Message{}
24+ WpPresentationFeedbackInterface.Events = []server.Message{
25+ {Name: "sync_output", Signature: "o", Types: []*server.Interface{wayland.OutputInterface}},
26+ {Name: "presented", Signature: "uuuuuuu", Types: []*server.Interface{nil, nil, nil, nil, nil, nil, nil}},
27+ {Name: "discarded", Signature: "", Types: []*server.Interface{}},
28+ }
29+ if err := server.NewInterfaces(WpPresentationInterface, WpPresentationFeedbackInterface); err != nil {
30+ panic(err)
31+ }
32+}
33+
34+// WpPresentation timed presentation related wl_surface requests.
35+type WpPresentation struct{ *server.Resource }
36+
37+func WrapWpPresentation(r *server.Resource) *WpPresentation {
38+ if r == nil {
39+ return nil
40+ }
41+ return &WpPresentation{r}
42+}
43+
44+const WpPresentationRequestDestroy uint32 = 0
45+const WpPresentationRequestFeedback uint32 = 1
46+const WpPresentationEventClockId uint32 = 0
47+
48+// WpPresentationError fatal presentation errors.
49+type WpPresentationError uint32
50+
51+const (
52+ WpPresentationErrorInvalidTimestamp WpPresentationError = 0
53+ WpPresentationErrorInvalidFlag WpPresentationError = 1
54+)
55+
56+// WpPresentationHandler handles wp_presentation requests.
57+type WpPresentationHandler interface {
58+ Destroy(self *WpPresentation)
59+ Feedback(self *WpPresentation, surface *wayland.Surface, callback uint32)
60+}
61+
62+func NewWpPresentation(c server.Client, version int32, id uint32, h WpPresentationHandler) (*WpPresentation, error) {
63+ if h == nil {
64+ return nil, fmt.Errorf("purego-libwayland: nil handler for wp_presentation")
65+ }
66+ var self *WpPresentation
67+ r, err := c.CreateResource(WpPresentationInterface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
68+ switch opcode {
69+ case 0:
70+ h.Destroy(self)
71+ self.Destroy()
72+ case 1:
73+ h.Feedback(self, wayland.WrapSurface(args[0].Resource()), args[1].NewID())
74+ }
75+ })
76+ if err != nil {
77+ return nil, err
78+ }
79+ self = WrapWpPresentation(r)
80+ r.Data = self
81+ return self, nil
82+}
83+
84+// SendClockId clock ID for timestamps.
85+func (self *WpPresentation) SendClockId(clkId uint32) {
86+ self.PostEvent(WpPresentationEventClockId, server.Uint(clkId))
87+}
88+func NewWpPresentationGlobal(d *server.Display, version int32, bind server.BindFunc) error {
89+ return d.CreateGlobal(WpPresentationInterface, version, bind)
90+}
91+
92+// WpPresentationFeedback presentation time feedback event.
93+type WpPresentationFeedback struct{ *server.Resource }
94+
95+func WrapWpPresentationFeedback(r *server.Resource) *WpPresentationFeedback {
96+ if r == nil {
97+ return nil
98+ }
99+ return &WpPresentationFeedback{r}
100+}
101+
102+const WpPresentationFeedbackEventSyncOutput uint32 = 0
103+const WpPresentationFeedbackEventPresented uint32 = 1
104+const WpPresentationFeedbackEventDiscarded uint32 = 2
105+
106+// WpPresentationFeedbackKind bitmask of flags in presented event (bitfield).
107+type WpPresentationFeedbackKind uint32
108+
109+const (
110+ WpPresentationFeedbackKindVsync WpPresentationFeedbackKind = 0x1
111+ WpPresentationFeedbackKindHwClock WpPresentationFeedbackKind = 0x2
112+ WpPresentationFeedbackKindHwCompletion WpPresentationFeedbackKind = 0x4
113+ WpPresentationFeedbackKindZeroCopy WpPresentationFeedbackKind = 0x8
114+)
115+
116+// WpPresentationFeedbackHandler handles wp_presentation_feedback requests.
117+type WpPresentationFeedbackHandler interface {
118+}
119+
120+func NewWpPresentationFeedback(c server.Client, version int32, id uint32, h WpPresentationFeedbackHandler) (*WpPresentationFeedback, error) {
121+ var self *WpPresentationFeedback
122+ r, err := c.CreateResource(WpPresentationFeedbackInterface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
123+ switch opcode {
124+ }
125+ })
126+ if err != nil {
127+ return nil, err
128+ }
129+ self = WrapWpPresentationFeedback(r)
130+ r.Data = self
131+ return self, nil
132+}
133+
134+// SendSyncOutput presentation synchronized to this output.
135+func (self *WpPresentationFeedback) SendSyncOutput(output *wayland.Output) {
136+ self.PostEvent(WpPresentationFeedbackEventSyncOutput, server.Object(resourceOf(output)))
137+}
138+
139+// SendPresented the content update was displayed.
140+func (self *WpPresentationFeedback) SendPresented(tvSecHi uint32, tvSecLo uint32, tvNsec uint32, refresh uint32, seqHi uint32, seqLo uint32, flags uint32) {
141+ self.PostEvent(WpPresentationFeedbackEventPresented, server.Uint(tvSecHi), server.Uint(tvSecLo), server.Uint(tvNsec), server.Uint(refresh), server.Uint(seqHi), server.Uint(seqLo), server.Uint(flags))
142+}
143+
144+// SendDiscarded the content update was not displayed.
145+func (self *WpPresentationFeedback) SendDiscarded() {
146+ self.PostEvent(WpPresentationFeedbackEventDiscarded)
147+}
148+func NewWpPresentationFeedbackGlobal(d *server.Display, version int32, bind server.BindFunc) error {
149+ return d.CreateGlobal(WpPresentationFeedbackInterface, version, bind)
150+}
151+func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
152+ if v == nil {
153+ return nil
154+ }
155+ return v.GetResource()
156+}
157+func (self *WpPresentation) GetResource() *server.Resource {
158+ if self == nil {
159+ return nil
160+ }
161+ return self.Resource
162+}
163+func (self *WpPresentationFeedback) GetResource() *server.Resource {
164+ if self == nil {
165+ return nil
166+ }
167+ return self.Resource
168+}
A protocol/xdgdialog/xdgdialog.go +147 -0
@@ -0,0 +1,147 @@
1+// Code generated by wlgen; DO NOT EDIT.
2+package xdgdialog
3+
4+import (
5+ "fmt"
6+ xdgshell "github.com/bnema/purego-libwayland/protocol/xdgshell"
7+ "github.com/bnema/purego-libwayland/server"
8+)
9+
10+var WmDialogV1Interface *server.Interface
11+var DialogV1Interface *server.Interface
12+
13+func init() {
14+ WmDialogV1Interface = &server.Interface{Name: "xdg_wm_dialog_v1", Version: 1}
15+ DialogV1Interface = &server.Interface{Name: "xdg_dialog_v1", Version: 1}
16+ WmDialogV1Interface.Requests = []server.Message{
17+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
18+ {Name: "get_xdg_dialog", Signature: "no", Types: []*server.Interface{DialogV1Interface, xdgshell.ToplevelInterface}},
19+ }
20+ WmDialogV1Interface.Events = []server.Message{}
21+ DialogV1Interface.Requests = []server.Message{
22+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
23+ {Name: "set_modal", Signature: "", Types: []*server.Interface{}},
24+ {Name: "unset_modal", Signature: "", Types: []*server.Interface{}},
25+ }
26+ DialogV1Interface.Events = []server.Message{}
27+ if err := server.NewInterfaces(WmDialogV1Interface, DialogV1Interface); err != nil {
28+ panic(err)
29+ }
30+}
31+
32+// WmDialogV1 create dialogs related to other toplevels.
33+type WmDialogV1 struct{ *server.Resource }
34+
35+func WrapWmDialogV1(r *server.Resource) *WmDialogV1 {
36+ if r == nil {
37+ return nil
38+ }
39+ return &WmDialogV1{r}
40+}
41+
42+const WmDialogV1RequestDestroy uint32 = 0
43+const WmDialogV1RequestGetXdgDialog uint32 = 1
44+
45+// WmDialogV1Error .
46+type WmDialogV1Error uint32
47+
48+const (
49+ WmDialogV1ErrorAlreadyUsed WmDialogV1Error = 0
50+)
51+
52+// WmDialogV1Handler handles xdg_wm_dialog_v1 requests.
53+type WmDialogV1Handler interface {
54+ Destroy(self *WmDialogV1)
55+ GetXdgDialog(self *WmDialogV1, id uint32, toplevel *xdgshell.Toplevel)
56+}
57+
58+func NewWmDialogV1(c server.Client, version int32, id uint32, h WmDialogV1Handler) (*WmDialogV1, error) {
59+ if h == nil {
60+ return nil, fmt.Errorf("purego-libwayland: nil handler for xdg_wm_dialog_v1")
61+ }
62+ var self *WmDialogV1
63+ r, err := c.CreateResource(WmDialogV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
64+ switch opcode {
65+ case 0:
66+ h.Destroy(self)
67+ self.Destroy()
68+ case 1:
69+ h.GetXdgDialog(self, args[0].NewID(), xdgshell.WrapToplevel(args[1].Resource()))
70+ }
71+ })
72+ if err != nil {
73+ return nil, err
74+ }
75+ self = WrapWmDialogV1(r)
76+ r.Data = self
77+ return self, nil
78+}
79+func NewWmDialogV1Global(d *server.Display, version int32, bind server.BindFunc) error {
80+ return d.CreateGlobal(WmDialogV1Interface, version, bind)
81+}
82+
83+// DialogV1 dialog object.
84+type DialogV1 struct{ *server.Resource }
85+
86+func WrapDialogV1(r *server.Resource) *DialogV1 {
87+ if r == nil {
88+ return nil
89+ }
90+ return &DialogV1{r}
91+}
92+
93+const DialogV1RequestDestroy uint32 = 0
94+const DialogV1RequestSetModal uint32 = 1
95+const DialogV1RequestUnsetModal uint32 = 2
96+
97+// DialogV1Handler handles xdg_dialog_v1 requests.
98+type DialogV1Handler interface {
99+ Destroy(self *DialogV1)
100+ SetModal(self *DialogV1)
101+ UnsetModal(self *DialogV1)
102+}
103+
104+func NewDialogV1(c server.Client, version int32, id uint32, h DialogV1Handler) (*DialogV1, error) {
105+ if h == nil {
106+ return nil, fmt.Errorf("purego-libwayland: nil handler for xdg_dialog_v1")
107+ }
108+ var self *DialogV1
109+ r, err := c.CreateResource(DialogV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
110+ switch opcode {
111+ case 0:
112+ h.Destroy(self)
113+ self.Destroy()
114+ case 1:
115+ h.SetModal(self)
116+ case 2:
117+ h.UnsetModal(self)
118+ }
119+ })
120+ if err != nil {
121+ return nil, err
122+ }
123+ self = WrapDialogV1(r)
124+ r.Data = self
125+ return self, nil
126+}
127+func NewDialogV1Global(d *server.Display, version int32, bind server.BindFunc) error {
128+ return d.CreateGlobal(DialogV1Interface, version, bind)
129+}
130+func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
131+ if v == nil {
132+ return nil
133+ }
134+ return v.GetResource()
135+}
136+func (self *WmDialogV1) GetResource() *server.Resource {
137+ if self == nil {
138+ return nil
139+ }
140+ return self.Resource
141+}
142+func (self *DialogV1) GetResource() *server.Resource {
143+ if self == nil {
144+ return nil
145+ }
146+ return self.Resource
147+}
A protocol/xdgforeign/xdgforeign.go +277 -0
@@ -0,0 +1,277 @@
1+// Code generated by wlgen; DO NOT EDIT.
2+package xdgforeign
3+
4+import (
5+ "fmt"
6+ wayland "github.com/bnema/purego-libwayland/protocol/wayland"
7+ "github.com/bnema/purego-libwayland/server"
8+ "runtime"
9+)
10+
11+var ZxdgExporterV2Interface *server.Interface
12+var ZxdgImporterV2Interface *server.Interface
13+var ZxdgExportedV2Interface *server.Interface
14+var ZxdgImportedV2Interface *server.Interface
15+
16+func init() {
17+ ZxdgExporterV2Interface = &server.Interface{Name: "zxdg_exporter_v2", Version: 1}
18+ ZxdgImporterV2Interface = &server.Interface{Name: "zxdg_importer_v2", Version: 1}
19+ ZxdgExportedV2Interface = &server.Interface{Name: "zxdg_exported_v2", Version: 1}
20+ ZxdgImportedV2Interface = &server.Interface{Name: "zxdg_imported_v2", Version: 1}
21+ ZxdgExporterV2Interface.Requests = []server.Message{
22+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
23+ {Name: "export_toplevel", Signature: "no", Types: []*server.Interface{ZxdgExportedV2Interface, wayland.SurfaceInterface}},
24+ }
25+ ZxdgExporterV2Interface.Events = []server.Message{}
26+ ZxdgImporterV2Interface.Requests = []server.Message{
27+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
28+ {Name: "import_toplevel", Signature: "ns", Types: []*server.Interface{ZxdgImportedV2Interface, nil}},
29+ }
30+ ZxdgImporterV2Interface.Events = []server.Message{}
31+ ZxdgExportedV2Interface.Requests = []server.Message{
32+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
33+ }
34+ ZxdgExportedV2Interface.Events = []server.Message{
35+ {Name: "handle", Signature: "s", Types: []*server.Interface{nil}},
36+ }
37+ ZxdgImportedV2Interface.Requests = []server.Message{
38+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
39+ {Name: "set_parent_of", Signature: "o", Types: []*server.Interface{wayland.SurfaceInterface}},
40+ }
41+ ZxdgImportedV2Interface.Events = []server.Message{
42+ {Name: "destroyed", Signature: "", Types: []*server.Interface{}},
43+ }
44+ if err := server.NewInterfaces(ZxdgExporterV2Interface, ZxdgImporterV2Interface, ZxdgExportedV2Interface, ZxdgImportedV2Interface); err != nil {
45+ panic(err)
46+ }
47+}
48+
49+// ZxdgExporterV2 interface for exporting surfaces.
50+type ZxdgExporterV2 struct{ *server.Resource }
51+
52+func WrapZxdgExporterV2(r *server.Resource) *ZxdgExporterV2 {
53+ if r == nil {
54+ return nil
55+ }
56+ return &ZxdgExporterV2{r}
57+}
58+
59+const ZxdgExporterV2RequestDestroy uint32 = 0
60+const ZxdgExporterV2RequestExportToplevel uint32 = 1
61+
62+// ZxdgExporterV2Error error values.
63+type ZxdgExporterV2Error uint32
64+
65+const (
66+ ZxdgExporterV2ErrorInvalidSurface ZxdgExporterV2Error = 0
67+)
68+
69+// ZxdgExporterV2Handler handles zxdg_exporter_v2 requests.
70+type ZxdgExporterV2Handler interface {
71+ Destroy(self *ZxdgExporterV2)
72+ ExportToplevel(self *ZxdgExporterV2, id uint32, surface *wayland.Surface)
73+}
74+
75+func NewZxdgExporterV2(c server.Client, version int32, id uint32, h ZxdgExporterV2Handler) (*ZxdgExporterV2, error) {
76+ if h == nil {
77+ return nil, fmt.Errorf("purego-libwayland: nil handler for zxdg_exporter_v2")
78+ }
79+ var self *ZxdgExporterV2
80+ r, err := c.CreateResource(ZxdgExporterV2Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
81+ switch opcode {
82+ case 0:
83+ h.Destroy(self)
84+ self.Destroy()
85+ case 1:
86+ h.ExportToplevel(self, args[0].NewID(), wayland.WrapSurface(args[1].Resource()))
87+ }
88+ })
89+ if err != nil {
90+ return nil, err
91+ }
92+ self = WrapZxdgExporterV2(r)
93+ r.Data = self
94+ return self, nil
95+}
96+func NewZxdgExporterV2Global(d *server.Display, version int32, bind server.BindFunc) error {
97+ return d.CreateGlobal(ZxdgExporterV2Interface, version, bind)
98+}
99+
100+// ZxdgImporterV2 interface for importing surfaces.
101+type ZxdgImporterV2 struct{ *server.Resource }
102+
103+func WrapZxdgImporterV2(r *server.Resource) *ZxdgImporterV2 {
104+ if r == nil {
105+ return nil
106+ }
107+ return &ZxdgImporterV2{r}
108+}
109+
110+const ZxdgImporterV2RequestDestroy uint32 = 0
111+const ZxdgImporterV2RequestImportToplevel uint32 = 1
112+
113+// ZxdgImporterV2Handler handles zxdg_importer_v2 requests.
114+type ZxdgImporterV2Handler interface {
115+ Destroy(self *ZxdgImporterV2)
116+ ImportToplevel(self *ZxdgImporterV2, id uint32, handle string)
117+}
118+
119+func NewZxdgImporterV2(c server.Client, version int32, id uint32, h ZxdgImporterV2Handler) (*ZxdgImporterV2, error) {
120+ if h == nil {
121+ return nil, fmt.Errorf("purego-libwayland: nil handler for zxdg_importer_v2")
122+ }
123+ var self *ZxdgImporterV2
124+ r, err := c.CreateResource(ZxdgImporterV2Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
125+ switch opcode {
126+ case 0:
127+ h.Destroy(self)
128+ self.Destroy()
129+ case 1:
130+ h.ImportToplevel(self, args[0].NewID(), args[1].String())
131+ }
132+ })
133+ if err != nil {
134+ return nil, err
135+ }
136+ self = WrapZxdgImporterV2(r)
137+ r.Data = self
138+ return self, nil
139+}
140+func NewZxdgImporterV2Global(d *server.Display, version int32, bind server.BindFunc) error {
141+ return d.CreateGlobal(ZxdgImporterV2Interface, version, bind)
142+}
143+
144+// ZxdgExportedV2 an exported surface handle.
145+type ZxdgExportedV2 struct{ *server.Resource }
146+
147+func WrapZxdgExportedV2(r *server.Resource) *ZxdgExportedV2 {
148+ if r == nil {
149+ return nil
150+ }
151+ return &ZxdgExportedV2{r}
152+}
153+
154+const ZxdgExportedV2RequestDestroy uint32 = 0
155+const ZxdgExportedV2EventHandle uint32 = 0
156+
157+// ZxdgExportedV2Handler handles zxdg_exported_v2 requests.
158+type ZxdgExportedV2Handler interface {
159+ Destroy(self *ZxdgExportedV2)
160+}
161+
162+func NewZxdgExportedV2(c server.Client, version int32, id uint32, h ZxdgExportedV2Handler) (*ZxdgExportedV2, error) {
163+ if h == nil {
164+ return nil, fmt.Errorf("purego-libwayland: nil handler for zxdg_exported_v2")
165+ }
166+ var self *ZxdgExportedV2
167+ r, err := c.CreateResource(ZxdgExportedV2Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
168+ switch opcode {
169+ case 0:
170+ h.Destroy(self)
171+ self.Destroy()
172+ }
173+ })
174+ if err != nil {
175+ return nil, err
176+ }
177+ self = WrapZxdgExportedV2(r)
178+ r.Data = self
179+ return self, nil
180+}
181+
182+// SendHandle the exported surface handle.
183+func (self *ZxdgExportedV2) SendHandle(handle string) {
184+ var p runtime.Pinner
185+ defer p.Unpin()
186+ self.PostEvent(ZxdgExportedV2EventHandle, server.String(&p, handle, false))
187+}
188+func NewZxdgExportedV2Global(d *server.Display, version int32, bind server.BindFunc) error {
189+ return d.CreateGlobal(ZxdgExportedV2Interface, version, bind)
190+}
191+
192+// ZxdgImportedV2 an imported surface handle.
193+type ZxdgImportedV2 struct{ *server.Resource }
194+
195+func WrapZxdgImportedV2(r *server.Resource) *ZxdgImportedV2 {
196+ if r == nil {
197+ return nil
198+ }
199+ return &ZxdgImportedV2{r}
200+}
201+
202+const ZxdgImportedV2RequestDestroy uint32 = 0
203+const ZxdgImportedV2RequestSetParentOf uint32 = 1
204+const ZxdgImportedV2EventDestroyed uint32 = 0
205+
206+// ZxdgImportedV2Error error values.
207+type ZxdgImportedV2Error uint32
208+
209+const (
210+ ZxdgImportedV2ErrorInvalidSurface ZxdgImportedV2Error = 0
211+)
212+
213+// ZxdgImportedV2Handler handles zxdg_imported_v2 requests.
214+type ZxdgImportedV2Handler interface {
215+ Destroy(self *ZxdgImportedV2)
216+ SetParentOf(self *ZxdgImportedV2, surface *wayland.Surface)
217+}
218+
219+func NewZxdgImportedV2(c server.Client, version int32, id uint32, h ZxdgImportedV2Handler) (*ZxdgImportedV2, error) {
220+ if h == nil {
221+ return nil, fmt.Errorf("purego-libwayland: nil handler for zxdg_imported_v2")
222+ }
223+ var self *ZxdgImportedV2
224+ r, err := c.CreateResource(ZxdgImportedV2Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
225+ switch opcode {
226+ case 0:
227+ h.Destroy(self)
228+ self.Destroy()
229+ case 1:
230+ h.SetParentOf(self, wayland.WrapSurface(args[0].Resource()))
231+ }
232+ })
233+ if err != nil {
234+ return nil, err
235+ }
236+ self = WrapZxdgImportedV2(r)
237+ r.Data = self
238+ return self, nil
239+}
240+
241+// SendDestroyed the imported surface handle has been destroyed.
242+func (self *ZxdgImportedV2) SendDestroyed() {
243+ self.PostEvent(ZxdgImportedV2EventDestroyed)
244+}
245+func NewZxdgImportedV2Global(d *server.Display, version int32, bind server.BindFunc) error {
246+ return d.CreateGlobal(ZxdgImportedV2Interface, version, bind)
247+}
248+func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
249+ if v == nil {
250+ return nil
251+ }
252+ return v.GetResource()
253+}
254+func (self *ZxdgExporterV2) GetResource() *server.Resource {
255+ if self == nil {
256+ return nil
257+ }
258+ return self.Resource
259+}
260+func (self *ZxdgImporterV2) GetResource() *server.Resource {
261+ if self == nil {
262+ return nil
263+ }
264+ return self.Resource
265+}
266+func (self *ZxdgExportedV2) GetResource() *server.Resource {
267+ if self == nil {
268+ return nil
269+ }
270+ return self.Resource
271+}
272+func (self *ZxdgImportedV2) GetResource() *server.Resource {
273+ if self == nil {
274+ return nil
275+ }
276+ return self.Resource
277+}
A protocol/xdgsystembell/xdgsystembell.go +78 -0
@@ -0,0 +1,78 @@
1+// Code generated by wlgen; DO NOT EDIT.
2+package xdgsystembell
3+
4+import (
5+ "fmt"
6+ wayland "github.com/bnema/purego-libwayland/protocol/wayland"
7+ "github.com/bnema/purego-libwayland/server"
8+)
9+
10+var SystemBellV1Interface *server.Interface
11+
12+func init() {
13+ SystemBellV1Interface = &server.Interface{Name: "xdg_system_bell_v1", Version: 1}
14+ SystemBellV1Interface.Requests = []server.Message{
15+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
16+ {Name: "ring", Signature: "?o", Types: []*server.Interface{wayland.SurfaceInterface}},
17+ }
18+ SystemBellV1Interface.Events = []server.Message{}
19+ if err := server.NewInterfaces(SystemBellV1Interface); err != nil {
20+ panic(err)
21+ }
22+}
23+
24+// SystemBellV1 system bell.
25+type SystemBellV1 struct{ *server.Resource }
26+
27+func WrapSystemBellV1(r *server.Resource) *SystemBellV1 {
28+ if r == nil {
29+ return nil
30+ }
31+ return &SystemBellV1{r}
32+}
33+
34+const SystemBellV1RequestDestroy uint32 = 0
35+const SystemBellV1RequestRing uint32 = 1
36+
37+// SystemBellV1Handler handles xdg_system_bell_v1 requests.
38+type SystemBellV1Handler interface {
39+ Destroy(self *SystemBellV1)
40+ Ring(self *SystemBellV1, surface *wayland.Surface)
41+}
42+
43+func NewSystemBellV1(c server.Client, version int32, id uint32, h SystemBellV1Handler) (*SystemBellV1, error) {
44+ if h == nil {
45+ return nil, fmt.Errorf("purego-libwayland: nil handler for xdg_system_bell_v1")
46+ }
47+ var self *SystemBellV1
48+ r, err := c.CreateResource(SystemBellV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
49+ switch opcode {
50+ case 0:
51+ h.Destroy(self)
52+ self.Destroy()
53+ case 1:
54+ h.Ring(self, wayland.WrapSurface(args[0].Resource()))
55+ }
56+ })
57+ if err != nil {
58+ return nil, err
59+ }
60+ self = WrapSystemBellV1(r)
61+ r.Data = self
62+ return self, nil
63+}
64+func NewSystemBellV1Global(d *server.Display, version int32, bind server.BindFunc) error {
65+ return d.CreateGlobal(SystemBellV1Interface, version, bind)
66+}
67+func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
68+ if v == nil {
69+ return nil
70+ }
71+ return v.GetResource()
72+}
73+func (self *SystemBellV1) GetResource() *server.Resource {
74+ if self == nil {
75+ return nil
76+ }
77+ return self.Resource
78+}
A protocol/xdgtoplevelicon/xdgtoplevelicon.go +170 -0
@@ -0,0 +1,170 @@
1+// Code generated by wlgen; DO NOT EDIT.
2+package xdgtoplevelicon
3+
4+import (
5+ "fmt"
6+ wayland "github.com/bnema/purego-libwayland/protocol/wayland"
7+ xdgshell "github.com/bnema/purego-libwayland/protocol/xdgshell"
8+ "github.com/bnema/purego-libwayland/server"
9+)
10+
11+var ToplevelIconManagerV1Interface *server.Interface
12+var ToplevelIconV1Interface *server.Interface
13+
14+func init() {
15+ ToplevelIconManagerV1Interface = &server.Interface{Name: "xdg_toplevel_icon_manager_v1", Version: 1}
16+ ToplevelIconV1Interface = &server.Interface{Name: "xdg_toplevel_icon_v1", Version: 1}
17+ ToplevelIconManagerV1Interface.Requests = []server.Message{
18+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
19+ {Name: "create_icon", Signature: "n", Types: []*server.Interface{ToplevelIconV1Interface}},
20+ {Name: "set_icon", Signature: "o?o", Types: []*server.Interface{xdgshell.ToplevelInterface, ToplevelIconV1Interface}},
21+ }
22+ ToplevelIconManagerV1Interface.Events = []server.Message{
23+ {Name: "icon_size", Signature: "i", Types: []*server.Interface{nil}},
24+ {Name: "done", Signature: "", Types: []*server.Interface{}},
25+ }
26+ ToplevelIconV1Interface.Requests = []server.Message{
27+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
28+ {Name: "set_name", Signature: "s", Types: []*server.Interface{nil}},
29+ {Name: "add_buffer", Signature: "oi", Types: []*server.Interface{wayland.BufferInterface, nil}},
30+ }
31+ ToplevelIconV1Interface.Events = []server.Message{}
32+ if err := server.NewInterfaces(ToplevelIconManagerV1Interface, ToplevelIconV1Interface); err != nil {
33+ panic(err)
34+ }
35+}
36+
37+// ToplevelIconManagerV1 interface to manage toplevel icons.
38+type ToplevelIconManagerV1 struct{ *server.Resource }
39+
40+func WrapToplevelIconManagerV1(r *server.Resource) *ToplevelIconManagerV1 {
41+ if r == nil {
42+ return nil
43+ }
44+ return &ToplevelIconManagerV1{r}
45+}
46+
47+const ToplevelIconManagerV1RequestDestroy uint32 = 0
48+const ToplevelIconManagerV1RequestCreateIcon uint32 = 1
49+const ToplevelIconManagerV1RequestSetIcon uint32 = 2
50+const ToplevelIconManagerV1EventIconSize uint32 = 0
51+const ToplevelIconManagerV1EventDone uint32 = 1
52+
53+// ToplevelIconManagerV1Handler handles xdg_toplevel_icon_manager_v1 requests.
54+type ToplevelIconManagerV1Handler interface {
55+ Destroy(self *ToplevelIconManagerV1)
56+ CreateIcon(self *ToplevelIconManagerV1, id uint32)
57+ SetIcon(self *ToplevelIconManagerV1, toplevel *xdgshell.Toplevel, icon *ToplevelIconV1)
58+}
59+
60+func NewToplevelIconManagerV1(c server.Client, version int32, id uint32, h ToplevelIconManagerV1Handler) (*ToplevelIconManagerV1, error) {
61+ if h == nil {
62+ return nil, fmt.Errorf("purego-libwayland: nil handler for xdg_toplevel_icon_manager_v1")
63+ }
64+ var self *ToplevelIconManagerV1
65+ r, err := c.CreateResource(ToplevelIconManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
66+ switch opcode {
67+ case 0:
68+ h.Destroy(self)
69+ self.Destroy()
70+ case 1:
71+ h.CreateIcon(self, args[0].NewID())
72+ case 2:
73+ h.SetIcon(self, xdgshell.WrapToplevel(args[0].Resource()), WrapToplevelIconV1(args[1].Resource()))
74+ }
75+ })
76+ if err != nil {
77+ return nil, err
78+ }
79+ self = WrapToplevelIconManagerV1(r)
80+ r.Data = self
81+ return self, nil
82+}
83+
84+// SendIconSize describes a supported & preferred icon size.
85+func (self *ToplevelIconManagerV1) SendIconSize(size int32) {
86+ self.PostEvent(ToplevelIconManagerV1EventIconSize, server.Int(size))
87+}
88+
89+// SendDone all information has been sent.
90+func (self *ToplevelIconManagerV1) SendDone() {
91+ self.PostEvent(ToplevelIconManagerV1EventDone)
92+}
93+func NewToplevelIconManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
94+ return d.CreateGlobal(ToplevelIconManagerV1Interface, version, bind)
95+}
96+
97+// ToplevelIconV1 a toplevel window icon.
98+type ToplevelIconV1 struct{ *server.Resource }
99+
100+func WrapToplevelIconV1(r *server.Resource) *ToplevelIconV1 {
101+ if r == nil {
102+ return nil
103+ }
104+ return &ToplevelIconV1{r}
105+}
106+
107+const ToplevelIconV1RequestDestroy uint32 = 0
108+const ToplevelIconV1RequestSetName uint32 = 1
109+const ToplevelIconV1RequestAddBuffer uint32 = 2
110+
111+// ToplevelIconV1Error .
112+type ToplevelIconV1Error uint32
113+
114+const (
115+ ToplevelIconV1ErrorInvalidBuffer ToplevelIconV1Error = 1
116+ ToplevelIconV1ErrorImmutable ToplevelIconV1Error = 2
117+ ToplevelIconV1ErrorNoBuffer ToplevelIconV1Error = 3
118+)
119+
120+// ToplevelIconV1Handler handles xdg_toplevel_icon_v1 requests.
121+type ToplevelIconV1Handler interface {
122+ Destroy(self *ToplevelIconV1)
123+ SetName(self *ToplevelIconV1, iconName string)
124+ AddBuffer(self *ToplevelIconV1, buffer *wayland.Buffer, scale int32)
125+}
126+
127+func NewToplevelIconV1(c server.Client, version int32, id uint32, h ToplevelIconV1Handler) (*ToplevelIconV1, error) {
128+ if h == nil {
129+ return nil, fmt.Errorf("purego-libwayland: nil handler for xdg_toplevel_icon_v1")
130+ }
131+ var self *ToplevelIconV1
132+ r, err := c.CreateResource(ToplevelIconV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
133+ switch opcode {
134+ case 0:
135+ h.Destroy(self)
136+ self.Destroy()
137+ case 1:
138+ h.SetName(self, args[0].String())
139+ case 2:
140+ h.AddBuffer(self, wayland.WrapBuffer(args[0].Resource()), args[1].Int())
141+ }
142+ })
143+ if err != nil {
144+ return nil, err
145+ }
146+ self = WrapToplevelIconV1(r)
147+ r.Data = self
148+ return self, nil
149+}
150+func NewToplevelIconV1Global(d *server.Display, version int32, bind server.BindFunc) error {
151+ return d.CreateGlobal(ToplevelIconV1Interface, version, bind)
152+}
153+func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
154+ if v == nil {
155+ return nil
156+ }
157+ return v.GetResource()
158+}
159+func (self *ToplevelIconManagerV1) GetResource() *server.Resource {
160+ if self == nil {
161+ return nil
162+ }
163+ return self.Resource
164+}
165+func (self *ToplevelIconV1) GetResource() *server.Resource {
166+ if self == nil {
167+ return nil
168+ }
169+ return self.Resource
170+}
A protocol/xdgtopleveltag/xdgtopleveltag.go +83 -0
@@ -0,0 +1,83 @@
1+// Code generated by wlgen; DO NOT EDIT.
2+package xdgtopleveltag
3+
4+import (
5+ "fmt"
6+ xdgshell "github.com/bnema/purego-libwayland/protocol/xdgshell"
7+ "github.com/bnema/purego-libwayland/server"
8+)
9+
10+var ToplevelTagManagerV1Interface *server.Interface
11+
12+func init() {
13+ ToplevelTagManagerV1Interface = &server.Interface{Name: "xdg_toplevel_tag_manager_v1", Version: 1}
14+ ToplevelTagManagerV1Interface.Requests = []server.Message{
15+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
16+ {Name: "set_toplevel_tag", Signature: "os", Types: []*server.Interface{xdgshell.ToplevelInterface, nil}},
17+ {Name: "set_toplevel_description", Signature: "os", Types: []*server.Interface{xdgshell.ToplevelInterface, nil}},
18+ }
19+ ToplevelTagManagerV1Interface.Events = []server.Message{}
20+ if err := server.NewInterfaces(ToplevelTagManagerV1Interface); err != nil {
21+ panic(err)
22+ }
23+}
24+
25+// ToplevelTagManagerV1 protocol for setting toplevel tags.
26+type ToplevelTagManagerV1 struct{ *server.Resource }
27+
28+func WrapToplevelTagManagerV1(r *server.Resource) *ToplevelTagManagerV1 {
29+ if r == nil {
30+ return nil
31+ }
32+ return &ToplevelTagManagerV1{r}
33+}
34+
35+const ToplevelTagManagerV1RequestDestroy uint32 = 0
36+const ToplevelTagManagerV1RequestSetToplevelTag uint32 = 1
37+const ToplevelTagManagerV1RequestSetToplevelDescription uint32 = 2
38+
39+// ToplevelTagManagerV1Handler handles xdg_toplevel_tag_manager_v1 requests.
40+type ToplevelTagManagerV1Handler interface {
41+ Destroy(self *ToplevelTagManagerV1)
42+ SetToplevelTag(self *ToplevelTagManagerV1, toplevel *xdgshell.Toplevel, tag string)
43+ SetToplevelDescription(self *ToplevelTagManagerV1, toplevel *xdgshell.Toplevel, description string)
44+}
45+
46+func NewToplevelTagManagerV1(c server.Client, version int32, id uint32, h ToplevelTagManagerV1Handler) (*ToplevelTagManagerV1, error) {
47+ if h == nil {
48+ return nil, fmt.Errorf("purego-libwayland: nil handler for xdg_toplevel_tag_manager_v1")
49+ }
50+ var self *ToplevelTagManagerV1
51+ r, err := c.CreateResource(ToplevelTagManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
52+ switch opcode {
53+ case 0:
54+ h.Destroy(self)
55+ self.Destroy()
56+ case 1:
57+ h.SetToplevelTag(self, xdgshell.WrapToplevel(args[0].Resource()), args[1].String())
58+ case 2:
59+ h.SetToplevelDescription(self, xdgshell.WrapToplevel(args[0].Resource()), args[1].String())
60+ }
61+ })
62+ if err != nil {
63+ return nil, err
64+ }
65+ self = WrapToplevelTagManagerV1(r)
66+ r.Data = self
67+ return self, nil
68+}
69+func NewToplevelTagManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
70+ return d.CreateGlobal(ToplevelTagManagerV1Interface, version, bind)
71+}
72+func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
73+ if v == nil {
74+ return nil
75+ }
76+ return v.GetResource()
77+}
78+func (self *ToplevelTagManagerV1) GetResource() *server.Resource {
79+ if self == nil {
80+ return nil
81+ }
82+ return self.Resource
83+}
A protocols/ext-foreign-toplevel-list-v1.xml +219 -0
@@ -0,0 +1,219 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<protocol name="ext_foreign_toplevel_list_v1">
3+ <copyright>
4+ Copyright © 2018 Ilia Bozhinov
5+ Copyright © 2020 Isaac Freund
6+ Copyright © 2022 wb9688
7+ Copyright © 2023 i509VCB
8+
9+ Permission to use, copy, modify, distribute, and sell this
10+ software and its documentation for any purpose is hereby granted
11+ without fee, provided that the above copyright notice appear in
12+ all copies and that both that copyright notice and this permission
13+ notice appear in supporting documentation, and that the name of
14+ the copyright holders not be used in advertising or publicity
15+ pertaining to distribution of the software without specific,
16+ written prior permission. The copyright holders make no
17+ representations about the suitability of this software for any
18+ purpose. It is provided "as is" without express or implied
19+ warranty.
20+
21+ THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
22+ SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
23+ FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
24+ SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
25+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
26+ AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
27+ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
28+ THIS SOFTWARE.
29+ </copyright>
30+
31+ <description summary="list toplevels">
32+ The purpose of this protocol is to provide protocol object handles for
33+ toplevels, possibly originating from another client.
34+
35+ This protocol is intentionally minimalistic and expects additional
36+ functionality (e.g. creating a screencopy source from a toplevel handle,
37+ getting information about the state of the toplevel) to be implemented
38+ in extension protocols.
39+
40+ The compositor may choose to restrict this protocol to a special client
41+ launched by the compositor itself or expose it to all clients,
42+ this is compositor policy.
43+
44+ The key words "must", "must not", "required", "shall", "shall not",
45+ "should", "should not", "recommended", "may", and "optional" in this
46+ document are to be interpreted as described in IETF RFC 2119.
47+
48+ Warning! The protocol described in this file is currently in the testing
49+ phase. Backward compatible changes may be added together with the
50+ corresponding interface version bump. Backward incompatible changes can
51+ only be done by creating a new major version of the extension.
52+ </description>
53+
54+ <interface name="ext_foreign_toplevel_list_v1" version="1">
55+ <description summary="list toplevels">
56+ A toplevel is defined as a surface with a role similar to xdg_toplevel.
57+ XWayland surfaces may be treated like toplevels in this protocol.
58+
59+ After a client binds the ext_foreign_toplevel_list_v1, each mapped
60+ toplevel window will be sent using the ext_foreign_toplevel_list_v1.toplevel
61+ event.
62+
63+ Clients which only care about the current state can perform a roundtrip after
64+ binding this global.
65+
66+ For each instance of ext_foreign_toplevel_list_v1, the compositor must
67+ create a new ext_foreign_toplevel_handle_v1 object for each mapped toplevel.
68+
69+ If a compositor implementation sends the ext_foreign_toplevel_list_v1.finished
70+ event after the global is bound, the compositor must not send any
71+ ext_foreign_toplevel_list_v1.toplevel events.
72+ </description>
73+
74+ <event name="toplevel">
75+ <description summary="a toplevel has been created">
76+ This event is emitted whenever a new toplevel window is created. It is
77+ emitted for all toplevels, regardless of the app that has created them.
78+
79+ All initial properties of the toplevel (identifier, title, app_id) will be sent
80+ immediately after this event using the corresponding events for
81+ ext_foreign_toplevel_handle_v1. The compositor will use the
82+ ext_foreign_toplevel_handle_v1.done event to indicate when all data has
83+ been sent.
84+ </description>
85+ <arg name="toplevel" type="new_id" interface="ext_foreign_toplevel_handle_v1"/>
86+ </event>
87+
88+ <event name="finished">
89+ <description summary="the compositor has finished with the toplevel manager">
90+ This event indicates that the compositor is done sending events
91+ to this object. The client should destroy the object.
92+ See ext_foreign_toplevel_list_v1.destroy for more information.
93+
94+ The compositor must not send any more toplevel events after this event.
95+ </description>
96+ </event>
97+
98+ <request name="stop">
99+ <description summary="stop sending events">
100+ This request indicates that the client no longer wishes to receive
101+ events for new toplevels.
102+
103+ The Wayland protocol is asynchronous, meaning the compositor may send
104+ further toplevel events until the stop request is processed.
105+ The client should wait for a ext_foreign_toplevel_list_v1.finished
106+ event before destroying this object.
107+ </description>
108+ </request>
109+
110+ <request name="destroy" type="destructor">
111+ <description summary="destroy the ext_foreign_toplevel_list_v1 object">
112+ This request should be called either when the client will no longer
113+ use the ext_foreign_toplevel_list_v1 or after the finished event
114+ has been received to allow destruction of the object.
115+
116+ If a client wishes to destroy this object it should send a
117+ ext_foreign_toplevel_list_v1.stop request and wait for a ext_foreign_toplevel_list_v1.finished
118+ event, then destroy the handles and then this object.
119+ </description>
120+ </request>
121+ </interface>
122+
123+ <interface name="ext_foreign_toplevel_handle_v1" version="1">
124+ <description summary="a mapped toplevel">
125+ A ext_foreign_toplevel_handle_v1 object represents a mapped toplevel
126+ window. A single app may have multiple mapped toplevels.
127+ </description>
128+
129+ <request name="destroy" type="destructor">
130+ <description summary="destroy the ext_foreign_toplevel_handle_v1 object">
131+ This request should be used when the client will no longer use the handle
132+ or after the closed event has been received to allow destruction of the
133+ object.
134+
135+ When a handle is destroyed, a new handle may not be created by the server
136+ until the toplevel is unmapped and then remapped. Destroying a toplevel handle
137+ is not recommended unless the client is cleaning up child objects
138+ before destroying the ext_foreign_toplevel_list_v1 object, the toplevel
139+ was closed or the toplevel handle will not be used in the future.
140+
141+ Other protocols which extend the ext_foreign_toplevel_handle_v1
142+ interface should require destructors for extension interfaces be
143+ called before allowing the toplevel handle to be destroyed.
144+ </description>
145+ </request>
146+
147+ <event name="closed">
148+ <description summary="the toplevel has been closed">
149+ The server will emit no further events on the ext_foreign_toplevel_handle_v1
150+ after this event. Any requests received aside from the destroy request must
151+ be ignored. Upon receiving this event, the client should destroy the handle.
152+
153+ Other protocols which extend the ext_foreign_toplevel_handle_v1
154+ interface must also ignore requests other than destructors.
155+ </description>
156+ </event>
157+
158+ <event name="done">
159+ <description summary="all information about the toplevel has been sent">
160+ This event is sent after all changes in the toplevel state have
161+ been sent.
162+
163+ This allows changes to the ext_foreign_toplevel_handle_v1 properties
164+ to be atomically applied. Other protocols which extend the
165+ ext_foreign_toplevel_handle_v1 interface may use this event to also
166+ atomically apply any pending state.
167+
168+ This event must not be sent after the ext_foreign_toplevel_handle_v1.closed
169+ event.
170+ </description>
171+ </event>
172+
173+ <event name="title">
174+ <description summary="title change">
175+ The title of the toplevel has changed.
176+
177+ The configured state must not be applied immediately. See
178+ ext_foreign_toplevel_handle_v1.done for details.
179+ </description>
180+ <arg name="title" type="string"/>
181+ </event>
182+
183+ <event name="app_id">
184+ <description summary="app_id change">
185+ The app id of the toplevel has changed.
186+
187+ The configured state must not be applied immediately. See
188+ ext_foreign_toplevel_handle_v1.done for details.
189+ </description>
190+ <arg name="app_id" type="string"/>
191+ </event>
192+
193+ <event name="identifier">
194+ <description summary="a stable identifier for a toplevel">
195+ This identifier is used to check if two or more toplevel handles belong
196+ to the same toplevel.
197+
198+ The identifier is useful for command line tools or privileged clients
199+ which may need to reference an exact toplevel across processes or
200+ instances of the ext_foreign_toplevel_list_v1 global.
201+
202+ The compositor must only send this event when the handle is created.
203+
204+ The identifier must be unique per toplevel and its handles. Two different
205+ toplevels must not have the same identifier. The identifier is only valid
206+ as long as the toplevel is mapped. If the toplevel is unmapped the identifier
207+ must not be reused. An identifier must not be reused by the compositor to
208+ ensure there are no races when sharing identifiers between processes.
209+
210+ An identifier is a string that contains up to 32 printable ASCII bytes.
211+ An identifier must not be an empty string. It is recommended that a
212+ compositor includes an opaque generation value in identifiers. How the
213+ generation value is used when generating the identifier is implementation
214+ dependent.
215+ </description>
216+ <arg name="identifier" type="string"/>
217+ </event>
218+ </interface>
219+</protocol>
A protocols/ext-idle-notify-v1.xml +131 -0
@@ -0,0 +1,131 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<protocol name="ext_idle_notify_v1">
3+ <copyright>
4+ Copyright © 2015 Martin Gräßlin
5+ Copyright © 2022 Simon Ser
6+
7+ Permission is hereby granted, free of charge, to any person obtaining a
8+ copy of this software and associated documentation files (the "Software"),
9+ to deal in the Software without restriction, including without limitation
10+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
11+ and/or sell copies of the Software, and to permit persons to whom the
12+ Software is furnished to do so, subject to the following conditions:
13+
14+ The above copyright notice and this permission notice (including the next
15+ paragraph) shall be included in all copies or substantial portions of the
16+ Software.
17+
18+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
21+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
24+ DEALINGS IN THE SOFTWARE.
25+ </copyright>
26+
27+ <interface name="ext_idle_notifier_v1" version="2">
28+ <description summary="idle notification manager">
29+ This interface allows clients to monitor user idle status.
30+
31+ After binding to this global, clients can create ext_idle_notification_v1
32+ objects to get notified when the user is idle for a given amount of time.
33+ </description>
34+
35+ <request name="destroy" type="destructor">
36+ <description summary="destroy the manager">
37+ Destroy the manager object. All objects created via this interface
38+ remain valid.
39+ </description>
40+ </request>
41+
42+ <request name="get_idle_notification">
43+ <description summary="create a notification object">
44+ Create a new idle notification object.
45+
46+ The notification object has a minimum timeout duration and is tied to a
47+ seat. The client will be notified if the seat is inactive for at least
48+ the provided timeout. See ext_idle_notification_v1 for more details.
49+
50+ A zero timeout is valid and means the client wants to be notified as
51+ soon as possible when the seat is inactive.
52+ </description>
53+ <arg name="id" type="new_id" interface="ext_idle_notification_v1"/>
54+ <arg name="timeout" type="uint" summary="minimum idle timeout in msec"/>
55+ <arg name="seat" type="object" interface="wl_seat"/>
56+ </request>
57+
58+ <!-- Version 2 additions -->
59+
60+ <request name="get_input_idle_notification" since="2">
61+ <description summary="create a notification object">
62+ Create a new idle notification object to track input from the
63+ user, such as keyboard and mouse movement. Because this object is
64+ meant to track user input alone, it ignores idle inhibitors.
65+
66+ The notification object has a minimum timeout duration and is tied to a
67+ seat. The client will be notified if the seat is inactive for at least
68+ the provided timeout. See ext_idle_notification_v1 for more details.
69+
70+ A zero timeout is valid and means the client wants to be notified as
71+ soon as possible when the seat is inactive.
72+ </description>
73+ <arg name="id" type="new_id" interface="ext_idle_notification_v1"/>
74+ <arg name="timeout" type="uint" summary="minimum idle timeout in msec"/>
75+ <arg name="seat" type="object" interface="wl_seat"/>
76+ </request>
77+
78+ </interface>
79+
80+ <interface name="ext_idle_notification_v1" version="2">
81+ <description summary="idle notification">
82+ This interface is used by the compositor to send idle notification events
83+ to clients.
84+
85+ Initially the notification object is not idle. The notification object
86+ becomes idle when no user activity has happened for at least the timeout
87+ duration, starting from the creation of the notification object. User
88+ activity may include input events or a presence sensor, but is
89+ compositor-specific.
90+
91+ How this notification responds to idle inhibitors depends on how
92+ it was constructed. If constructed from the
93+ get_idle_notification request, then if an idle inhibitor is
94+ active (e.g. another client has created a zwp_idle_inhibitor_v1
95+ on a visible surface), the compositor must not make the
96+ notification object idle. However, if constructed from the
97+ get_input_idle_notification request, then idle inhibitors are
98+ ignored, and only input from the user, e.g. from a keyboard or
99+ mouse, counts as activity.
100+
101+ When the notification object becomes idle, an idled event is sent. When
102+ user activity starts again, the notification object stops being idle,
103+ a resumed event is sent and the timeout is restarted.
104+ </description>
105+
106+ <request name="destroy" type="destructor">
107+ <description summary="destroy the notification object">
108+ Destroy the notification object.
109+ </description>
110+ </request>
111+
112+ <event name="idled">
113+ <description summary="notification object is idle">
114+ This event is sent when the notification object becomes idle.
115+
116+ It's a compositor protocol error to send this event twice without a
117+ resumed event in-between.
118+ </description>
119+ </event>
120+
121+ <event name="resumed">
122+ <description summary="notification object is no longer idle">
123+ This event is sent when the notification object stops being idle.
124+
125+ It's a compositor protocol error to send this event twice without an
126+ idled event in-between. It's a compositor protocol error to send this
127+ event prior to any idled event.
128+ </description>
129+ </event>
130+ </interface>
131+</protocol>
A protocols/ext-session-lock-v1.xml +328 -0
@@ -0,0 +1,328 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<protocol name="ext_session_lock_v1">
3+ <copyright>
4+ Copyright 2021 Isaac Freund
5+
6+ Permission is hereby granted, free of charge, to any person obtaining a
7+ copy of this software and associated documentation files (the "Software"),
8+ to deal in the Software without restriction, including without limitation
9+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
10+ and/or sell copies of the Software, and to permit persons to whom the
11+ Software is furnished to do so, subject to the following conditions:
12+
13+ The above copyright notice and this permission notice shall be included in
14+ all copies or substantial portions of the Software.
15+
16+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+ THE SOFTWARE.
23+ </copyright>
24+
25+ <description summary="secure session locking with arbitrary graphics">
26+ This protocol allows for a privileged Wayland client to lock the session
27+ and display arbitrary graphics while the session is locked.
28+
29+ The compositor may choose to restrict this protocol to a special client
30+ launched by the compositor itself or expose it to all privileged clients,
31+ this is compositor policy.
32+
33+ The client is responsible for performing authentication and informing the
34+ compositor when the session should be unlocked. If the client dies while
35+ the session is locked the session remains locked, possibly permanently
36+ depending on compositor policy.
37+
38+ The key words "must", "must not", "required", "shall", "shall not",
39+ "should", "should not", "recommended", "may", and "optional" in this
40+ document are to be interpreted as described in IETF RFC 2119.
41+
42+ Warning! The protocol described in this file is currently in the
43+ testing phase. Backward compatible changes may be added together with
44+ the corresponding interface version bump. Backward incompatible changes
45+ can only be done by creating a new major version of the extension.
46+ </description>
47+
48+ <interface name="ext_session_lock_manager_v1" version="1">
49+ <description summary="used to lock the session">
50+ This interface is used to request that the session be locked.
51+ </description>
52+
53+ <request name="destroy" type="destructor">
54+ <description summary="destroy the session lock manager object">
55+ This informs the compositor that the session lock manager object will
56+ no longer be used. Existing objects created through this interface
57+ remain valid.
58+ </description>
59+ </request>
60+
61+ <request name="lock">
62+ <description summary="attempt to lock the session">
63+ This request creates a session lock and asks the compositor to lock the
64+ session. The compositor will send either the ext_session_lock_v1.locked
65+ or ext_session_lock_v1.finished event on the created object in
66+ response to this request.
67+ </description>
68+ <arg name="id" type="new_id" interface="ext_session_lock_v1"/>
69+ </request>
70+ </interface>
71+
72+ <interface name="ext_session_lock_v1" version="1">
73+ <description summary="manage lock state and create lock surfaces">
74+ In response to the creation of this object the compositor must send
75+ either the locked or finished event.
76+
77+ The locked event indicates that the session is locked. This means
78+ that the compositor must stop rendering and providing input to normal
79+ clients. Instead the compositor must blank all outputs with an opaque
80+ color such that their normal content is fully hidden.
81+
82+ The only surfaces that should be rendered while the session is locked
83+ are the lock surfaces created through this interface and optionally,
84+ at the compositor's discretion, special privileged surfaces such as
85+ input methods or portions of desktop shell UIs.
86+
87+ The locked event must not be sent until a new "locked" frame (either
88+ from a session lock surface or the compositor blanking the output) has
89+ been presented on all outputs and no security sensitive normal/unlocked
90+ content is possibly visible.
91+
92+ The finished event should be sent immediately on creation of this
93+ object if the compositor decides that the locked event will not be sent.
94+
95+ The compositor may wait for the client to create and render session lock
96+ surfaces before sending the locked event to avoid displaying intermediate
97+ blank frames. However, it must impose a reasonable time limit if
98+ waiting and send the locked event as soon as the hard requirements
99+ described above can be met if the time limit expires. Clients should
100+ immediately create lock surfaces for all outputs on creation of this
101+ object to make this possible.
102+
103+ This behavior of the locked event is required in order to prevent
104+ possible race conditions with clients that wish to suspend the system
105+ or similar after locking the session. Without these semantics, clients
106+ triggering a suspend after receiving the locked event would race with
107+ the first "locked" frame being presented and normal/unlocked frames
108+ might be briefly visible as the system is resumed if the suspend
109+ operation wins the race.
110+
111+ If the client dies while the session is locked, the compositor must not
112+ unlock the session in response. It is acceptable for the session to be
113+ permanently locked if this happens. The compositor may choose to continue
114+ to display the lock surfaces the client had mapped before it died or
115+ alternatively fall back to a solid color, this is compositor policy.
116+
117+ Compositors may also allow a secure way to recover the session, the
118+ details of this are compositor policy. Compositors may allow a new
119+ client to create a ext_session_lock_v1 object and take responsibility
120+ for unlocking the session, they may even start a new lock client
121+ instance automatically.
122+ </description>
123+
124+ <enum name="error">
125+ <entry name="invalid_destroy" value="0"
126+ summary="attempted to destroy session lock while locked"/>
127+ <entry name="invalid_unlock" value="1"
128+ summary="unlock requested but locked event was never sent"/>
129+ <entry name="role" value="2"
130+ summary="given wl_surface already has a role"/>
131+ <entry name="duplicate_output" value="3"
132+ summary="given output already has a lock surface"/>
133+ <entry name="already_constructed" value="4"
134+ summary="given wl_surface has a buffer attached or committed"/>
135+ </enum>
136+
137+ <request name="destroy" type="destructor">
138+ <description summary="destroy the session lock">
139+ This informs the compositor that the lock object will no longer be
140+ used. Existing objects created through this interface remain valid.
141+
142+ After this request is made, lock surfaces created through this object
143+ should be destroyed by the client as they will no longer be used by
144+ the compositor.
145+
146+ It is a protocol error to make this request if the locked event was
147+ sent, the unlock_and_destroy request must be used instead.
148+ </description>
149+ </request>
150+
151+ <event name="locked">
152+ <description summary="session successfully locked">
153+ This client is now responsible for displaying graphics while the
154+ session is locked and deciding when to unlock the session.
155+
156+ The locked event must not be sent until a new "locked" frame has been
157+ presented on all outputs and no security sensitive normal/unlocked
158+ content is possibly visible.
159+
160+ If this event is sent, making the destroy request is a protocol error,
161+ the lock object must be destroyed using the unlock_and_destroy request.
162+ </description>
163+ </event>
164+
165+ <event name="finished">
166+ <description summary="the session lock object should be destroyed">
167+ The compositor has decided that the session lock should be destroyed
168+ as it will no longer be used by the compositor. Exactly when this
169+ event is sent is compositor policy, but it must never be sent more
170+ than once for a given session lock object.
171+
172+ This might be sent because there is already another ext_session_lock_v1
173+ object held by a client, or the compositor has decided to deny the
174+ request to lock the session for some other reason. This might also
175+ be sent because the compositor implements some alternative, secure
176+ way to authenticate and unlock the session.
177+
178+ The finished event should be sent immediately on creation of this
179+ object if the compositor decides that the locked event will not
180+ be sent.
181+
182+ If the locked event is sent on creation of this object the finished
183+ event may still be sent at some later time in this object's
184+ lifetime. This is compositor policy.
185+
186+ Upon receiving this event, the client should make either the destroy
187+ request or the unlock_and_destroy request, depending on whether or
188+ not the locked event was received on this object.
189+ </description>
190+ </event>
191+
192+ <request name="get_lock_surface">
193+ <description summary="create a lock surface for a given output">
194+ The client is expected to create lock surfaces for all outputs
195+ currently present and any new outputs as they are advertised. These
196+ won't be displayed by the compositor unless the lock is successful
197+ and the locked event is sent.
198+
199+ Providing a wl_surface which already has a role or already has a buffer
200+ attached or committed is a protocol error, as is attaching/committing
201+ a buffer before the first ext_session_lock_surface_v1.configure event.
202+
203+ Attempting to create more than one lock surface for a given output
204+ is a duplicate_output protocol error.
205+ </description>
206+ <arg name="id" type="new_id" interface="ext_session_lock_surface_v1"/>
207+ <arg name="surface" type="object" interface="wl_surface"/>
208+ <arg name="output" type="object" interface="wl_output"/>
209+ </request>
210+
211+ <request name="unlock_and_destroy" type="destructor">
212+ <description summary="unlock the session, destroying the object">
213+ This request indicates that the session should be unlocked, for
214+ example because the user has entered their password and it has been
215+ verified by the client.
216+
217+ This request also informs the compositor that the lock object will
218+ no longer be used and should be destroyed. Existing objects created
219+ through this interface remain valid.
220+
221+ After this request is made, lock surfaces created through this object
222+ should be destroyed by the client as they will no longer be used by
223+ the compositor.
224+
225+ It is a protocol error to make this request if the locked event has
226+ not been sent. In that case, the lock object must be destroyed using
227+ the destroy request.
228+
229+ Note that a correct client that wishes to exit directly after unlocking
230+ the session must use the wl_display.sync request to ensure the server
231+ receives and processes the unlock_and_destroy request. Otherwise
232+ there is no guarantee that the server has unlocked the session due
233+ to the asynchronous nature of the Wayland protocol. For example,
234+ the server might terminate the client with a protocol error before
235+ it processes the unlock_and_destroy request.
236+ </description>
237+ </request>
238+ </interface>
239+
240+ <interface name="ext_session_lock_surface_v1" version="1">
241+ <description summary="a surface displayed while the session is locked">
242+ The client may use lock surfaces to display a screensaver, render a
243+ dialog to enter a password and unlock the session, or however else it
244+ sees fit.
245+
246+ On binding this interface the compositor will immediately send the
247+ first configure event. After making the ack_configure request in
248+ response to this event the client should attach and commit the first
249+ buffer. Committing the surface before acking the first configure is a
250+ protocol error. Committing the surface with a null buffer at any time
251+ is a protocol error.
252+
253+ The compositor is free to handle keyboard/pointer focus for lock
254+ surfaces however it chooses. A reasonable way to do this would be to
255+ give the first lock surface created keyboard focus and change keyboard
256+ focus if the user clicks on other surfaces.
257+ </description>
258+
259+ <enum name="error">
260+ <entry name="commit_before_first_ack" value="0"
261+ summary="surface committed before first ack_configure request"/>
262+ <entry name="null_buffer" value="1"
263+ summary="surface committed with a null buffer"/>
264+ <entry name="dimensions_mismatch" value="2"
265+ summary="failed to match ack'd width/height"/>
266+ <entry name="invalid_serial" value="3"
267+ summary="serial provided in ack_configure is invalid"/>
268+ </enum>
269+
270+ <request name="destroy" type="destructor">
271+ <description summary="destroy the lock surface object">
272+ This informs the compositor that the lock surface object will no
273+ longer be used.
274+
275+ It is recommended for a lock client to destroy lock surfaces if
276+ their corresponding wl_output global is removed.
277+
278+ If a lock surface on an active output is destroyed before the
279+ ext_session_lock_v1.unlock_and_destroy event is sent, the compositor
280+ must fall back to rendering a solid color.
281+ </description>
282+ </request>
283+
284+ <request name="ack_configure">
285+ <description summary="ack a configure event">
286+ When a configure event is received, if a client commits the surface
287+ in response to the configure event, then the client must make an
288+ ack_configure request sometime before the commit request, passing
289+ along the serial of the configure event.
290+
291+ If the client receives multiple configure events before it can
292+ respond to one, it only has to ack the last configure event.
293+
294+ A client is not required to commit immediately after sending an
295+ ack_configure request - it may even ack_configure several times
296+ before its next surface commit.
297+
298+ A client may send multiple ack_configure requests before committing,
299+ but only the last request sent before a commit indicates which
300+ configure event the client really is responding to.
301+
302+ Sending an ack_configure request consumes the configure event
303+ referenced by the given serial, as well as all older configure events
304+ sent on this object.
305+
306+ It is a protocol error to issue multiple ack_configure requests
307+ referencing the same configure event or to issue an ack_configure
308+ request referencing a configure event older than the last configure
309+ event acked for a given lock surface.
310+ </description>
311+ <arg name="serial" type="uint" summary="serial from the configure event"/>
312+ </request>
313+
314+ <event name="configure">
315+ <description summary="the client should resize its surface">
316+ This event is sent once on binding the interface and may be sent again
317+ at the compositor's discretion, for example if output geometry changes.
318+
319+ The width and height are in surface-local coordinates and are exact
320+ requirements. Failing to match these surface dimensions in the next
321+ commit after acking a configure is a protocol error.
322+ </description>
323+ <arg name="serial" type="uint" summary="serial for use in ack_configure"/>
324+ <arg name="width" type="uint"/>
325+ <arg name="height" type="uint"/>
326+ </event>
327+ </interface>
328+</protocol>
A protocols/idle-inhibit-unstable-v1.xml +83 -0
@@ -0,0 +1,83 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<protocol name="idle_inhibit_unstable_v1">
3+
4+ <copyright>
5+ Copyright © 2015 Samsung Electronics Co., Ltd
6+
7+ Permission is hereby granted, free of charge, to any person obtaining a
8+ copy of this software and associated documentation files (the "Software"),
9+ to deal in the Software without restriction, including without limitation
10+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
11+ and/or sell copies of the Software, and to permit persons to whom the
12+ Software is furnished to do so, subject to the following conditions:
13+
14+ The above copyright notice and this permission notice (including the next
15+ paragraph) shall be included in all copies or substantial portions of the
16+ Software.
17+
18+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
21+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
24+ DEALINGS IN THE SOFTWARE.
25+ </copyright>
26+
27+ <interface name="zwp_idle_inhibit_manager_v1" version="1">
28+ <description summary="control behavior when display idles">
29+ This interface permits inhibiting the idle behavior such as screen
30+ blanking, locking, and screensaving. The client binds the idle manager
31+ globally, then creates idle-inhibitor objects for each surface.
32+
33+ Warning! The protocol described in this file is experimental and
34+ backward incompatible changes may be made. Backward compatible changes
35+ may be added together with the corresponding interface version bump.
36+ Backward incompatible changes are done by bumping the version number in
37+ the protocol and interface names and resetting the interface version.
38+ Once the protocol is to be declared stable, the 'z' prefix and the
39+ version number in the protocol and interface names are removed and the
40+ interface version number is reset.
41+ </description>
42+
43+ <request name="destroy" type="destructor">
44+ <description summary="destroy the idle inhibitor object">
45+ Destroy the inhibit manager.
46+ </description>
47+ </request>
48+
49+ <request name="create_inhibitor">
50+ <description summary="create a new inhibitor object">
51+ Create a new inhibitor object associated with the given surface.
52+ </description>
53+ <arg name="id" type="new_id" interface="zwp_idle_inhibitor_v1"/>
54+ <arg name="surface" type="object" interface="wl_surface"
55+ summary="the surface that inhibits the idle behavior"/>
56+ </request>
57+
58+ </interface>
59+
60+ <interface name="zwp_idle_inhibitor_v1" version="1">
61+ <description summary="context object for inhibiting idle behavior">
62+ An idle inhibitor prevents the output that the associated surface is
63+ visible on from being set to a state where it is not visually usable due
64+ to lack of user interaction (e.g. blanked, dimmed, locked, set to power
65+ save, etc.) Any screensaver processes are also blocked from displaying.
66+
67+ If the surface is destroyed, unmapped, becomes occluded, loses
68+ visibility, or otherwise becomes not visually relevant for the user, the
69+ idle inhibitor will not be honored by the compositor; if the surface
70+ subsequently regains visibility the inhibitor takes effect once again.
71+ Likewise, the inhibitor isn't honored if the system was already idled at
72+ the time the inhibitor was established, although if the system later
73+ de-idles and re-idles the inhibitor will take effect.
74+ </description>
75+
76+ <request name="destroy" type="destructor">
77+ <description summary="destroy the idle inhibitor object">
78+ Remove the inhibitor effect from the associated wl_surface.
79+ </description>
80+ </request>
81+
82+ </interface>
83+</protocol>
A protocols/keyboard-shortcuts-inhibit-unstable-v1.xml +143 -0
@@ -0,0 +1,143 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<protocol name="keyboard_shortcuts_inhibit_unstable_v1">
3+
4+ <copyright>
5+ Copyright © 2017 Red Hat Inc.
6+
7+ Permission is hereby granted, free of charge, to any person obtaining a
8+ copy of this software and associated documentation files (the "Software"),
9+ to deal in the Software without restriction, including without limitation
10+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
11+ and/or sell copies of the Software, and to permit persons to whom the
12+ Software is furnished to do so, subject to the following conditions:
13+
14+ The above copyright notice and this permission notice (including the next
15+ paragraph) shall be included in all copies or substantial portions of the
16+ Software.
17+
18+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
21+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
24+ DEALINGS IN THE SOFTWARE.
25+ </copyright>
26+
27+ <description summary="Protocol for inhibiting the compositor keyboard shortcuts">
28+ This protocol specifies a way for a client to request the compositor
29+ to ignore its own keyboard shortcuts for a given seat, so that all
30+ key events from that seat get forwarded to a surface.
31+
32+ Warning! The protocol described in this file is experimental and
33+ backward incompatible changes may be made. Backward compatible
34+ changes may be added together with the corresponding interface
35+ version bump.
36+ Backward incompatible changes are done by bumping the version
37+ number in the protocol and interface names and resetting the
38+ interface version. Once the protocol is to be declared stable,
39+ the 'z' prefix and the version number in the protocol and
40+ interface names are removed and the interface version number is
41+ reset.
42+ </description>
43+
44+ <interface name="zwp_keyboard_shortcuts_inhibit_manager_v1" version="1">
45+ <description summary="context object for keyboard grab_manager">
46+ A global interface used for inhibiting the compositor keyboard shortcuts.
47+ </description>
48+
49+ <request name="destroy" type="destructor">
50+ <description summary="destroy the keyboard shortcuts inhibitor object">
51+ Destroy the keyboard shortcuts inhibitor manager.
52+ </description>
53+ </request>
54+
55+ <request name="inhibit_shortcuts">
56+ <description summary="create a new keyboard shortcuts inhibitor object">
57+ Create a new keyboard shortcuts inhibitor object associated with
58+ the given surface for the given seat.
59+
60+ If shortcuts are already inhibited for the specified seat and surface,
61+ a protocol error "already_inhibited" is raised by the compositor.
62+ </description>
63+ <arg name="id" type="new_id" interface="zwp_keyboard_shortcuts_inhibitor_v1"/>
64+ <arg name="surface" type="object" interface="wl_surface"
65+ summary="the surface that inhibits the keyboard shortcuts behavior"/>
66+ <arg name="seat" type="object" interface="wl_seat"
67+ summary="the wl_seat for which keyboard shortcuts should be disabled"/>
68+ </request>
69+
70+ <enum name="error">
71+ <entry name="already_inhibited"
72+ value="0"
73+ summary="the shortcuts are already inhibited for this surface"/>
74+ </enum>
75+ </interface>
76+
77+ <interface name="zwp_keyboard_shortcuts_inhibitor_v1" version="1">
78+ <description summary="context object for keyboard shortcuts inhibitor">
79+ A keyboard shortcuts inhibitor instructs the compositor to ignore
80+ its own keyboard shortcuts when the associated surface has keyboard
81+ focus. As a result, when the surface has keyboard focus on the given
82+ seat, it will receive all key events originating from the specified
83+ seat, even those which would normally be caught by the compositor for
84+ its own shortcuts.
85+
86+ The Wayland compositor is however under no obligation to disable
87+ all of its shortcuts, and may keep some special key combo for its own
88+ use, including but not limited to one allowing the user to forcibly
89+ restore normal keyboard events routing in the case of an unwilling
90+ client. The compositor may also use the same key combo to reactivate
91+ an existing shortcut inhibitor that was previously deactivated on
92+ user request.
93+
94+ When the compositor restores its own keyboard shortcuts, an
95+ "inactive" event is emitted to notify the client that the keyboard
96+ shortcuts inhibitor is not effectively active for the surface and
97+ seat any more, and the client should not expect to receive all
98+ keyboard events.
99+
100+ When the keyboard shortcuts inhibitor is inactive, the client has
101+ no way to forcibly reactivate the keyboard shortcuts inhibitor.
102+
103+ The user can chose to re-enable a previously deactivated keyboard
104+ shortcuts inhibitor using any mechanism the compositor may offer,
105+ in which case the compositor will send an "active" event to notify
106+ the client.
107+
108+ If the surface is destroyed, unmapped, or loses the seat's keyboard
109+ focus, the keyboard shortcuts inhibitor becomes irrelevant and the
110+ compositor will restore its own keyboard shortcuts but no "inactive"
111+ event is emitted in this case.
112+ </description>
113+
114+ <request name="destroy" type="destructor">
115+ <description summary="destroy the keyboard shortcuts inhibitor object">
116+ Remove the keyboard shortcuts inhibitor from the associated wl_surface.
117+ </description>
118+ </request>
119+
120+ <event name="active">
121+ <description summary="shortcuts are inhibited">
122+ This event indicates that the shortcut inhibitor is active.
123+
124+ The compositor sends this event every time compositor shortcuts
125+ are inhibited on behalf of the surface. When active, the client
126+ may receive input events normally reserved by the compositor
127+ (see zwp_keyboard_shortcuts_inhibitor_v1).
128+
129+ This occurs typically when the initial request "inhibit_shortcuts"
130+ first becomes active or when the user instructs the compositor to
131+ re-enable and existing shortcuts inhibitor using any mechanism
132+ offered by the compositor.
133+ </description>
134+ </event>
135+
136+ <event name="inactive">
137+ <description summary="shortcuts are restored">
138+ This event indicates that the shortcuts inhibitor is inactive,
139+ normal shortcuts processing is restored by the compositor.
140+ </description>
141+ </event>
142+ </interface>
143+</protocol>
A protocols/linux-drm-syncobj-v1.xml +261 -0
@@ -0,0 +1,261 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<protocol name="linux_drm_syncobj_v1">
3+ <copyright>
4+ Copyright 2016 The Chromium Authors.
5+ Copyright 2017 Intel Corporation
6+ Copyright 2018 Collabora, Ltd
7+ Copyright 2021 Simon Ser
8+
9+ Permission is hereby granted, free of charge, to any person obtaining a
10+ copy of this software and associated documentation files (the "Software"),
11+ to deal in the Software without restriction, including without limitation
12+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
13+ and/or sell copies of the Software, and to permit persons to whom the
14+ Software is furnished to do so, subject to the following conditions:
15+
16+ The above copyright notice and this permission notice (including the next
17+ paragraph) shall be included in all copies or substantial portions of the
18+ Software.
19+
20+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26+ DEALINGS IN THE SOFTWARE.
27+ </copyright>
28+
29+ <description summary="protocol for providing explicit synchronization">
30+ This protocol allows clients to request explicit synchronization for
31+ buffers. It is tied to the Linux DRM synchronization object framework.
32+
33+ Synchronization refers to co-ordination of pipelined operations performed
34+ on buffers. Most GPU clients will schedule an asynchronous operation to
35+ render to the buffer, then immediately send the buffer to the compositor
36+ to be attached to a surface.
37+
38+ With implicit synchronization, ensuring that the rendering operation is
39+ complete before the compositor displays the buffer is an implementation
40+ detail handled by either the kernel or userspace graphics driver.
41+
42+ By contrast, with explicit synchronization, DRM synchronization object
43+ timeline points mark when the asynchronous operations are complete. When
44+ submitting a buffer, the client provides a timeline point which will be
45+ waited on before the compositor accesses the buffer, and another timeline
46+ point that the compositor will signal when it no longer needs to access the
47+ buffer contents for the purposes of the surface commit.
48+
49+ Linux DRM synchronization objects are documented at:
50+ https://dri.freedesktop.org/docs/drm/gpu/drm-mm.html#drm-sync-objects
51+
52+ Warning! The protocol described in this file is currently in the testing
53+ phase. Backward compatible changes may be added together with the
54+ corresponding interface version bump. Backward incompatible changes can
55+ only be done by creating a new major version of the extension.
56+ </description>
57+
58+ <interface name="wp_linux_drm_syncobj_manager_v1" version="1">
59+ <description summary="global for providing explicit synchronization">
60+ This global is a factory interface, allowing clients to request
61+ explicit synchronization for buffers on a per-surface basis.
62+
63+ See wp_linux_drm_syncobj_surface_v1 for more information.
64+ </description>
65+
66+ <request name="destroy" type="destructor">
67+ <description summary="destroy explicit synchronization factory object">
68+ Destroy this explicit synchronization factory object. Other objects
69+ shall not be affected by this request.
70+ </description>
71+ </request>
72+
73+ <enum name="error">
74+ <entry name="surface_exists" value="0"
75+ summary="the surface already has a synchronization object associated"/>
76+ <entry name="invalid_timeline" value="1"
77+ summary="the timeline object could not be imported"/>
78+ </enum>
79+
80+ <request name="get_surface">
81+ <description summary="extend surface interface for explicit synchronization">
82+ Instantiate an interface extension for the given wl_surface to provide
83+ explicit synchronization.
84+
85+ If the given wl_surface already has an explicit synchronization object
86+ associated, the surface_exists protocol error is raised.
87+
88+ Graphics APIs, like EGL or Vulkan, that manage the buffer queue and
89+ commits of a wl_surface themselves, are likely to be using this
90+ extension internally. If a client is using such an API for a
91+ wl_surface, it should not directly use this extension on that surface,
92+ to avoid raising a surface_exists protocol error.
93+ </description>
94+ <arg name="id" type="new_id" interface="wp_linux_drm_syncobj_surface_v1"
95+ summary="the new synchronization surface object id"/>
96+ <arg name="surface" type="object" interface="wl_surface"
97+ summary="the surface"/>
98+ </request>
99+
100+ <request name="import_timeline">
101+ <description summary="import a DRM syncobj timeline">
102+ Import a DRM synchronization object timeline.
103+
104+ If the FD cannot be imported, the invalid_timeline error is raised.
105+ </description>
106+ <arg name="id" type="new_id" interface="wp_linux_drm_syncobj_timeline_v1"/>
107+ <arg name="fd" type="fd" summary="drm_syncobj file descriptor"/>
108+ </request>
109+ </interface>
110+
111+ <interface name="wp_linux_drm_syncobj_timeline_v1" version="1">
112+ <description summary="synchronization object timeline">
113+ This object represents an explicit synchronization object timeline
114+ imported by the client to the compositor.
115+ </description>
116+
117+ <request name="destroy" type="destructor">
118+ <description summary="destroy the timeline">
119+ Destroy the synchronization object timeline. Other objects are not
120+ affected by this request, in particular timeline points set by
121+ set_acquire_point and set_release_point are not unset.
122+ </description>
123+ </request>
124+ </interface>
125+
126+ <interface name="wp_linux_drm_syncobj_surface_v1" version="1">
127+ <description summary="per-surface explicit synchronization">
128+ This object is an add-on interface for wl_surface to enable explicit
129+ synchronization.
130+
131+ Each surface can be associated with only one object of this interface at
132+ any time.
133+
134+ Explicit synchronization is guaranteed to be supported for buffers
135+ created with any version of the linux-dmabuf protocol. Compositors are
136+ free to support explicit synchronization for additional buffer types.
137+ If at surface commit time the attached buffer does not support explicit
138+ synchronization, an unsupported_buffer error is raised.
139+
140+ As long as the wp_linux_drm_syncobj_surface_v1 object is alive, the
141+ compositor may ignore implicit synchronization for buffers attached and
142+ committed to the wl_surface. The delivery of wl_buffer.release events
143+ for buffers attached to the surface becomes undefined.
144+
145+ Clients must set both acquire and release points if and only if a
146+ non-null buffer is attached in the same surface commit. See the
147+ no_buffer, no_acquire_point and no_release_point protocol errors.
148+
149+ If at surface commit time the acquire and release DRM syncobj timelines
150+ are identical, the acquire point value must be strictly less than the
151+ release point value, or else the conflicting_points protocol error is
152+ raised.
153+ </description>
154+
155+ <request name="destroy" type="destructor">
156+ <description summary="destroy the surface synchronization object">
157+ Destroy this surface synchronization object.
158+
159+ Any timeline point set by this object with set_acquire_point or
160+ set_release_point since the last commit may be discarded by the
161+ compositor. Any timeline point set by this object before the last
162+ commit will not be affected.
163+ </description>
164+ </request>
165+
166+ <enum name="error">
167+ <entry name="no_surface" value="1"
168+ summary="the associated wl_surface was destroyed"/>
169+ <entry name="unsupported_buffer" value="2"
170+ summary="the buffer does not support explicit synchronization"/>
171+ <entry name="no_buffer" value="3" summary="no buffer was attached"/>
172+ <entry name="no_acquire_point" value="4"
173+ summary="no acquire timeline point was set"/>
174+ <entry name="no_release_point" value="5"
175+ summary="no release timeline point was set"/>
176+ <entry name="conflicting_points" value="6"
177+ summary="acquire and release timeline points are in conflict"/>
178+ </enum>
179+
180+ <request name="set_acquire_point">
181+ <description summary="set the acquire timeline point">
182+ Set the timeline point that must be signalled before the compositor may
183+ sample from the buffer attached with wl_surface.attach.
184+
185+ The 64-bit unsigned value combined from point_hi and point_lo is the
186+ point value.
187+
188+ The acquire point is double-buffered state, and will be applied on the
189+ next wl_surface.commit request for the associated surface. Thus, it
190+ applies only to the buffer that is attached to the surface at commit
191+ time.
192+
193+ If an acquire point has already been attached during the same commit
194+ cycle, the new point replaces the old one.
195+
196+ If the associated wl_surface was destroyed, a no_surface error is
197+ raised.
198+
199+ If at surface commit time there is a pending acquire timeline point set
200+ but no pending buffer attached, a no_buffer error is raised. If at
201+ surface commit time there is a pending buffer attached but no pending
202+ acquire timeline point set, the no_acquire_point protocol error is
203+ raised.
204+ </description>
205+ <arg name="timeline" type="object" interface="wp_linux_drm_syncobj_timeline_v1"/>
206+ <arg name="point_hi" type="uint" summary="high 32 bits of the point value"/>
207+ <arg name="point_lo" type="uint" summary="low 32 bits of the point value"/>
208+ </request>
209+
210+ <request name="set_release_point">
211+ <description summary="set the release timeline point">
212+ Set the timeline point that must be signalled by the compositor when it
213+ has finished its usage of the buffer attached with wl_surface.attach
214+ for the relevant commit.
215+
216+ Once the timeline point is signaled, and assuming the associated buffer
217+ is not pending release from other wl_surface.commit requests, no
218+ additional explicit or implicit synchronization with the compositor is
219+ required to safely re-use the buffer.
220+
221+ Note that clients cannot rely on the release point being always
222+ signaled after the acquire point: compositors may release buffers
223+ without ever reading from them. In addition, the compositor may use
224+ different presentation paths for different commits, which may have
225+ different release behavior. As a result, the compositor may signal the
226+ release points in a different order than the client committed them.
227+
228+ Because signaling a timeline point also signals every previous point,
229+ it is generally not safe to use the same timeline object for the
230+ release points of multiple buffers. The out-of-order signaling
231+ described above may lead to a release point being signaled before the
232+ compositor has finished reading. To avoid this, it is strongly
233+ recommended that each buffer should use a separate timeline for its
234+ release points.
235+
236+ The 64-bit unsigned value combined from point_hi and point_lo is the
237+ point value.
238+
239+ The release point is double-buffered state, and will be applied on the
240+ next wl_surface.commit request for the associated surface. Thus, it
241+ applies only to the buffer that is attached to the surface at commit
242+ time.
243+
244+ If a release point has already been attached during the same commit
245+ cycle, the new point replaces the old one.
246+
247+ If the associated wl_surface was destroyed, a no_surface error is
248+ raised.
249+
250+ If at surface commit time there is a pending release timeline point set
251+ but no pending buffer attached, a no_buffer error is raised. If at
252+ surface commit time there is a pending buffer attached but no pending
253+ release timeline point set, the no_release_point protocol error is
254+ raised.
255+ </description>
256+ <arg name="timeline" type="object" interface="wp_linux_drm_syncobj_timeline_v1"/>
257+ <arg name="point_hi" type="uint" summary="high 32 bits of the point value"/>
258+ <arg name="point_lo" type="uint" summary="low 32 bits of the point value"/>
259+ </request>
260+ </interface>
261+</protocol>
A protocols/pointer-gestures-unstable-v1.xml +277 -0
@@ -0,0 +1,277 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<protocol name="pointer_gestures_unstable_v1">
3+ <copyright>
4+ Copyright © 2015, 2021 Red Hat Inc.
5+
6+ Permission to use, copy, modify, distribute, and sell this
7+ software and its documentation for any purpose is hereby granted
8+ without fee, provided that the above copyright notice appear in
9+ all copies and that both that copyright notice and this permission
10+ notice appear in supporting documentation, and that the name of
11+ the copyright holders not be used in advertising or publicity
12+ pertaining to distribution of the software without specific,
13+ written prior permission. The copyright holders make no
14+ representations about the suitability of this software for any
15+ purpose. It is provided "as is" without express or implied
16+ warranty.
17+
18+ THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
19+ SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
20+ FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
21+ SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
22+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
23+ AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
24+ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
25+ THIS SOFTWARE.
26+ </copyright>
27+
28+ <interface name="zwp_pointer_gestures_v1" version="3">
29+ <description summary="touchpad gestures">
30+ A global interface to provide semantic touchpad gestures for a given
31+ pointer.
32+
33+ Three gestures are currently supported: swipe, pinch, and hold.
34+ Pinch and swipe gestures follow a three-stage cycle: begin, update,
35+ end. Hold gestures follow a two-stage cycle: begin and end. All
36+ gestures are identified by a unique id.
37+
38+ Warning! The protocol described in this file is experimental and
39+ backward incompatible changes may be made. Backward compatible changes
40+ may be added together with the corresponding interface version bump.
41+ Backward incompatible changes are done by bumping the version number in
42+ the protocol and interface names and resetting the interface version.
43+ Once the protocol is to be declared stable, the 'z' prefix and the
44+ version number in the protocol and interface names are removed and the
45+ interface version number is reset.
46+ </description>
47+
48+ <request name="get_swipe_gesture">
49+ <description summary="get swipe gesture">
50+ Create a swipe gesture object. See the
51+ wl_pointer_gesture_swipe interface for details.
52+ </description>
53+ <arg name="id" type="new_id" interface="zwp_pointer_gesture_swipe_v1"/>
54+ <arg name="pointer" type="object" interface="wl_pointer"/>
55+ </request>
56+
57+ <request name="get_pinch_gesture">
58+ <description summary="get pinch gesture">
59+ Create a pinch gesture object. See the
60+ wl_pointer_gesture_pinch interface for details.
61+ </description>
62+ <arg name="id" type="new_id" interface="zwp_pointer_gesture_pinch_v1"/>
63+ <arg name="pointer" type="object" interface="wl_pointer"/>
64+ </request>
65+
66+ <!-- Version 2 additions -->
67+
68+ <request name="release" type="destructor" since="2">
69+ <description summary="destroy the pointer gesture object">
70+ Destroy the pointer gesture object. Swipe, pinch and hold objects
71+ created via this gesture object remain valid.
72+ </description>
73+ </request>
74+
75+ <!-- Version 3 additions -->
76+
77+ <request name="get_hold_gesture" since="3">
78+ <description summary="get hold gesture">
79+ Create a hold gesture object. See the
80+ wl_pointer_gesture_hold interface for details.
81+ </description>
82+ <arg name="id" type="new_id" interface="zwp_pointer_gesture_hold_v1"/>
83+ <arg name="pointer" type="object" interface="wl_pointer"/>
84+ </request>
85+
86+ </interface>
87+
88+ <interface name="zwp_pointer_gesture_swipe_v1" version="3">
89+ <description summary="a swipe gesture object">
90+ A swipe gesture object notifies a client about a multi-finger swipe
91+ gesture detected on an indirect input device such as a touchpad.
92+ The gesture is usually initiated by multiple fingers moving in the
93+ same direction but once initiated the direction may change.
94+ The precise conditions of when such a gesture is detected are
95+ implementation-dependent.
96+
97+ A gesture consists of three stages: begin, update (optional) and end.
98+ There cannot be multiple simultaneous hold, pinch or swipe gestures on a
99+ same pointer/seat, how compositors prevent these situations is
100+ implementation-dependent.
101+
102+ A gesture may be cancelled by the compositor or the hardware.
103+ Clients should not consider performing permanent or irreversible
104+ actions until the end of a gesture has been received.
105+ </description>
106+
107+ <request name="destroy" type="destructor">
108+ <description summary="destroy the pointer swipe gesture object"/>
109+ </request>
110+
111+ <event name="begin">
112+ <description summary="multi-finger swipe begin">
113+ This event is sent when a multi-finger swipe gesture is detected
114+ on the device.
115+ </description>
116+ <arg name="serial" type="uint"/>
117+ <arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
118+ <arg name="surface" type="object" interface="wl_surface"/>
119+ <arg name="fingers" type="uint" summary="number of fingers"/>
120+ </event>
121+
122+ <event name="update">
123+ <description summary="multi-finger swipe motion">
124+ This event is sent when a multi-finger swipe gesture changes the
125+ position of the logical center.
126+
127+ The dx and dy coordinates are relative coordinates of the logical
128+ center of the gesture compared to the previous event.
129+ </description>
130+ <arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
131+ <arg name="dx" type="fixed" summary="delta x coordinate in surface coordinate space"/>
132+ <arg name="dy" type="fixed" summary="delta y coordinate in surface coordinate space"/>
133+ </event>
134+
135+ <event name="end">
136+ <description summary="multi-finger swipe end">
137+ This event is sent when a multi-finger swipe gesture ceases to
138+ be valid. This may happen when one or more fingers are lifted or
139+ the gesture is cancelled.
140+
141+ When a gesture is cancelled, the client should undo state changes
142+ caused by this gesture. What causes a gesture to be cancelled is
143+ implementation-dependent.
144+ </description>
145+ <arg name="serial" type="uint"/>
146+ <arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
147+ <arg name="cancelled" type="int" summary="1 if the gesture was cancelled, 0 otherwise"/>
148+ </event>
149+ </interface>
150+
151+ <interface name="zwp_pointer_gesture_pinch_v1" version="3">
152+ <description summary="a pinch gesture object">
153+ A pinch gesture object notifies a client about a multi-finger pinch
154+ gesture detected on an indirect input device such as a touchpad.
155+ The gesture is usually initiated by multiple fingers moving towards
156+ each other or away from each other, or by two or more fingers rotating
157+ around a logical center of gravity. The precise conditions of when
158+ such a gesture is detected are implementation-dependent.
159+
160+ A gesture consists of three stages: begin, update (optional) and end.
161+ There cannot be multiple simultaneous hold, pinch or swipe gestures on a
162+ same pointer/seat, how compositors prevent these situations is
163+ implementation-dependent.
164+
165+ A gesture may be cancelled by the compositor or the hardware.
166+ Clients should not consider performing permanent or irreversible
167+ actions until the end of a gesture has been received.
168+ </description>
169+
170+ <request name="destroy" type="destructor">
171+ <description summary="destroy the pinch gesture object"/>
172+ </request>
173+
174+ <event name="begin">
175+ <description summary="multi-finger pinch begin">
176+ This event is sent when a multi-finger pinch gesture is detected
177+ on the device.
178+ </description>
179+ <arg name="serial" type="uint"/>
180+ <arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
181+ <arg name="surface" type="object" interface="wl_surface"/>
182+ <arg name="fingers" type="uint" summary="number of fingers"/>
183+ </event>
184+
185+ <event name="update">
186+ <description summary="multi-finger pinch motion">
187+ This event is sent when a multi-finger pinch gesture changes the
188+ position of the logical center, the rotation or the relative scale.
189+
190+ The dx and dy coordinates are relative coordinates in the
191+ surface coordinate space of the logical center of the gesture.
192+
193+ The scale factor is an absolute scale compared to the
194+ pointer_gesture_pinch.begin event, e.g. a scale of 2 means the fingers
195+ are now twice as far apart as on pointer_gesture_pinch.begin.
196+
197+ The rotation is the relative angle in degrees clockwise compared to the previous
198+ pointer_gesture_pinch.begin or pointer_gesture_pinch.update event.
199+ </description>
200+ <arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
201+ <arg name="dx" type="fixed" summary="delta x coordinate in surface coordinate space"/>
202+ <arg name="dy" type="fixed" summary="delta y coordinate in surface coordinate space"/>
203+ <arg name="scale" type="fixed" summary="scale relative to the initial finger position"/>
204+ <arg name="rotation" type="fixed" summary="angle in degrees cw relative to the previous event"/>
205+ </event>
206+
207+ <event name="end">
208+ <description summary="multi-finger pinch end">
209+ This event is sent when a multi-finger pinch gesture ceases to
210+ be valid. This may happen when one or more fingers are lifted or
211+ the gesture is cancelled.
212+
213+ When a gesture is cancelled, the client should undo state changes
214+ caused by this gesture. What causes a gesture to be cancelled is
215+ implementation-dependent.
216+ </description>
217+ <arg name="serial" type="uint"/>
218+ <arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
219+ <arg name="cancelled" type="int" summary="1 if the gesture was cancelled, 0 otherwise"/>
220+ </event>
221+
222+ </interface>
223+
224+ <interface name="zwp_pointer_gesture_hold_v1" version="3">
225+ <description summary="a hold gesture object">
226+ A hold gesture object notifies a client about a single- or
227+ multi-finger hold gesture detected on an indirect input device such as
228+ a touchpad. The gesture is usually initiated by one or more fingers
229+ being held down without significant movement. The precise conditions
230+ of when such a gesture is detected are implementation-dependent.
231+
232+ In particular, this gesture may be used to cancel kinetic scrolling.
233+
234+ A hold gesture consists of two stages: begin and end. Unlike pinch and
235+ swipe there is no update stage.
236+ There cannot be multiple simultaneous hold, pinch or swipe gestures on a
237+ same pointer/seat, how compositors prevent these situations is
238+ implementation-dependent.
239+
240+ A gesture may be cancelled by the compositor or the hardware.
241+ Clients should not consider performing permanent or irreversible
242+ actions until the end of a gesture has been received.
243+ </description>
244+
245+ <request name="destroy" type="destructor" since="3">
246+ <description summary="destroy the hold gesture object"/>
247+ </request>
248+
249+ <event name="begin" since="3">
250+ <description summary="multi-finger hold begin">
251+ This event is sent when a hold gesture is detected on the device.
252+ </description>
253+ <arg name="serial" type="uint"/>
254+ <arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
255+ <arg name="surface" type="object" interface="wl_surface"/>
256+ <arg name="fingers" type="uint" summary="number of fingers"/>
257+ </event>
258+
259+ <event name="end" since="3">
260+ <description summary="multi-finger hold end">
261+ This event is sent when a hold gesture ceases to
262+ be valid. This may happen when the holding fingers are lifted or
263+ the gesture is cancelled, for example if the fingers move past an
264+ implementation-defined threshold, the finger count changes or the hold
265+ gesture changes into a different type of gesture.
266+
267+ When a gesture is cancelled, the client may need to undo state changes
268+ caused by this gesture. What causes a gesture to be cancelled is
269+ implementation-dependent.
270+ </description>
271+ <arg name="serial" type="uint"/>
272+ <arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
273+ <arg name="cancelled" type="int" summary="1 if the gesture was cancelled, 0 otherwise"/>
274+ </event>
275+
276+ </interface>
277+</protocol>
A protocols/presentation-time.xml +268 -0
@@ -0,0 +1,268 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<protocol name="presentation_time">
3+<!-- wrap:70 -->
4+
5+ <copyright>
6+ Copyright © 2013-2014 Collabora, Ltd.
7+
8+ Permission is hereby granted, free of charge, to any person obtaining a
9+ copy of this software and associated documentation files (the "Software"),
10+ to deal in the Software without restriction, including without limitation
11+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
12+ and/or sell copies of the Software, and to permit persons to whom the
13+ Software is furnished to do so, subject to the following conditions:
14+
15+ The above copyright notice and this permission notice (including the next
16+ paragraph) shall be included in all copies or substantial portions of the
17+ Software.
18+
19+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25+ DEALINGS IN THE SOFTWARE.
26+ </copyright>
27+
28+ <interface name="wp_presentation" version="2">
29+ <description summary="timed presentation related wl_surface requests">
30+
31+<!-- Introduction -->
32+
33+ The main feature of this interface is accurate presentation
34+ timing feedback to ensure smooth video playback while maintaining
35+ audio/video synchronization. Some features use the concept of a
36+ presentation clock, which is defined in the
37+ presentation.clock_id event.
38+
39+ A content update for a wl_surface is submitted by a
40+ wl_surface.commit request. Request 'feedback' associates with
41+ the wl_surface.commit and provides feedback on the content
42+ update, particularly the final realized presentation time.
43+
44+<!-- Completing presentation -->
45+
46+ When the final realized presentation time is available, e.g.
47+ after a framebuffer flip completes, the requested
48+ presentation_feedback.presented events are sent. The final
49+ presentation time can differ from the compositor's predicted
50+ display update time and the update's target time, especially
51+ when the compositor misses its target vertical blanking period.
52+ </description>
53+
54+ <enum name="error">
55+ <description summary="fatal presentation errors">
56+ These fatal protocol errors may be emitted in response to
57+ illegal presentation requests.
58+ </description>
59+ <entry name="invalid_timestamp" value="0"
60+ summary="invalid value in tv_nsec"/>
61+ <entry name="invalid_flag" value="1"
62+ summary="invalid flag"/>
63+ </enum>
64+
65+ <request name="destroy" type="destructor">
66+ <description summary="unbind from the presentation interface">
67+ Informs the server that the client will no longer be using
68+ this protocol object. Existing objects created by this object
69+ are not affected.
70+ </description>
71+ </request>
72+
73+ <request name="feedback">
74+ <description summary="request presentation feedback information">
75+ Request presentation feedback for the current content submission
76+ on the given surface. This creates a new presentation_feedback
77+ object, which will deliver the feedback information once. If
78+ multiple presentation_feedback objects are created for the same
79+ submission, they will all deliver the same information.
80+
81+ For details on what information is returned, see the
82+ presentation_feedback interface.
83+ </description>
84+ <arg name="surface" type="object" interface="wl_surface"
85+ summary="target surface"/>
86+ <arg name="callback" type="new_id" interface="wp_presentation_feedback"
87+ summary="new feedback object"/>
88+ </request>
89+
90+ <event name="clock_id">
91+ <description summary="clock ID for timestamps">
92+ This event tells the client in which clock domain the
93+ compositor interprets the timestamps used by the presentation
94+ extension. This clock is called the presentation clock.
95+
96+ The compositor sends this event when the client binds to the
97+ presentation interface. The presentation clock does not change
98+ during the lifetime of the client connection.
99+
100+ The clock identifier is platform dependent. On POSIX platforms, the
101+ identifier value is one of the clockid_t values accepted by
102+ clock_gettime(). clock_gettime() is defined by POSIX.1-2001.
103+
104+ Timestamps in this clock domain are expressed as tv_sec_hi,
105+ tv_sec_lo, tv_nsec triples, each component being an unsigned
106+ 32-bit value. Whole seconds are in tv_sec which is a 64-bit
107+ value combined from tv_sec_hi and tv_sec_lo, and the
108+ additional fractional part in tv_nsec as nanoseconds. Hence,
109+ for valid timestamps tv_nsec must be in [0, 999999999].
110+
111+ Note that clock_id applies only to the presentation clock,
112+ and implies nothing about e.g. the timestamps used in the
113+ Wayland core protocol input events.
114+
115+ Compositors should prefer a clock which does not jump and is
116+ not slewed e.g. by NTP. The absolute value of the clock is
117+ irrelevant. Precision of one millisecond or better is
118+ recommended. Clients must be able to query the current clock
119+ value directly, not by asking the compositor.
120+ </description>
121+ <arg name="clk_id" type="uint" summary="platform clock identifier"/>
122+ </event>
123+
124+ </interface>
125+
126+ <interface name="wp_presentation_feedback" version="2">
127+ <description summary="presentation time feedback event">
128+ A presentation_feedback object returns an indication that a
129+ wl_surface content update has become visible to the user.
130+ One object corresponds to one content update submission
131+ (wl_surface.commit). There are two possible outcomes: the
132+ content update is presented to the user, and a presentation
133+ timestamp delivered; or, the user did not see the content
134+ update because it was superseded or its surface destroyed,
135+ and the content update is discarded.
136+
137+ Once a presentation_feedback object has delivered a 'presented'
138+ or 'discarded' event it is automatically destroyed.
139+ </description>
140+
141+ <event name="sync_output">
142+ <description summary="presentation synchronized to this output">
143+ As presentation can be synchronized to only one output at a
144+ time, this event tells which output it was. This event is only
145+ sent prior to the presented event.
146+
147+ As clients may bind to the same global wl_output multiple
148+ times, this event is sent for each bound instance that matches
149+ the synchronized output. If a client has not bound to the
150+ right wl_output global at all, this event is not sent.
151+ </description>
152+ <arg name="output" type="object" interface="wl_output"
153+ summary="presentation output"/>
154+ </event>
155+
156+ <enum name="kind" bitfield="true">
157+ <description summary="bitmask of flags in presented event">
158+ These flags provide information about how the presentation of
159+ the related content update was done. The intent is to help
160+ clients assess the reliability of the feedback and the visual
161+ quality with respect to possible tearing and timings.
162+ </description>
163+ <entry name="vsync" value="0x1">
164+ <description summary="presentation was vsync'd">
165+ The presentation was synchronized to the "vertical retrace" by
166+ the display hardware such that tearing does not happen.
167+ Relying on software scheduling is not acceptable for this
168+ flag. If presentation is done by a copy to the active
169+ frontbuffer, then it must guarantee that tearing cannot
170+ happen.
171+ </description>
172+ </entry>
173+ <entry name="hw_clock" value="0x2">
174+ <description summary="hardware provided the presentation timestamp">
175+ The display hardware provided measurements that the hardware
176+ driver converted into a presentation timestamp. Sampling a
177+ clock in software is not acceptable for this flag.
178+ </description>
179+ </entry>
180+ <entry name="hw_completion" value="0x4">
181+ <description summary="hardware signalled the start of the presentation">
182+ The display hardware signalled that it started using the new
183+ image content. The opposite of this is e.g. a timer being used
184+ to guess when the display hardware has switched to the new
185+ image content.
186+ </description>
187+ </entry>
188+ <entry name="zero_copy" value="0x8">
189+ <description summary="presentation was done zero-copy">
190+ The presentation of this update was done zero-copy. This means
191+ the buffer from the client was given to display hardware as
192+ is, without copying it. Compositing with OpenGL counts as
193+ copying, even if textured directly from the client buffer.
194+ Possible zero-copy cases include direct scanout of a
195+ fullscreen surface and a surface on a hardware overlay.
196+ </description>
197+ </entry>
198+ </enum>
199+
200+ <event name="presented" type="destructor">
201+ <description summary="the content update was displayed">
202+ The associated content update was displayed to the user at the
203+ indicated time (tv_sec_hi/lo, tv_nsec). For the interpretation of
204+ the timestamp, see presentation.clock_id event.
205+
206+ The timestamp corresponds to the time when the content update
207+ turned into light the first time on the surface's main output.
208+ Compositors may approximate this from the framebuffer flip
209+ completion events from the system, and the latency of the
210+ physical display path if known.
211+
212+ This event is preceded by all related sync_output events
213+ telling which output's refresh cycle the feedback corresponds
214+ to, i.e. the main output for the surface. Compositors are
215+ recommended to choose the output containing the largest part
216+ of the wl_surface, or keeping the output they previously
217+ chose. Having a stable presentation output association helps
218+ clients predict future output refreshes (vblank).
219+
220+ The 'refresh' argument gives the compositor's prediction of how
221+ many nanoseconds after tv_sec, tv_nsec the very next output
222+ refresh may occur. This is to further aid clients in
223+ predicting future refreshes, i.e., estimating the timestamps
224+ targeting the next few vblanks. If such prediction cannot
225+ usefully be done, the argument is zero.
226+
227+ For version 2 and later, if the output does not have a constant
228+ refresh rate, explicit video mode switches excluded, then the
229+ refresh argument must be either an appropriate rate picked by the
230+ compositor (e.g. fastest rate), or 0 if no such rate exists.
231+ For version 1, if the output does not have a constant refresh rate,
232+ the refresh argument must be zero.
233+
234+ The 64-bit value combined from seq_hi and seq_lo is the value
235+ of the output's vertical retrace counter when the content
236+ update was first scanned out to the display. This value must
237+ be compatible with the definition of MSC in
238+ GLX_OML_sync_control specification. Note, that if the display
239+ path has a non-zero latency, the time instant specified by
240+ this counter may differ from the timestamp's.
241+
242+ If the output does not have a concept of vertical retrace or a
243+ refresh cycle, or the output device is self-refreshing without
244+ a way to query the refresh count, then the arguments seq_hi
245+ and seq_lo must be zero.
246+ </description>
247+ <arg name="tv_sec_hi" type="uint"
248+ summary="high 32 bits of the seconds part of the presentation timestamp"/>
249+ <arg name="tv_sec_lo" type="uint"
250+ summary="low 32 bits of the seconds part of the presentation timestamp"/>
251+ <arg name="tv_nsec" type="uint"
252+ summary="nanoseconds part of the presentation timestamp"/>
253+ <arg name="refresh" type="uint" summary="nanoseconds till next refresh"/>
254+ <arg name="seq_hi" type="uint"
255+ summary="high 32 bits of refresh counter"/>
256+ <arg name="seq_lo" type="uint"
257+ summary="low 32 bits of refresh counter"/>
258+ <arg name="flags" type="uint" enum="kind" summary="combination of 'kind' values"/>
259+ </event>
260+
261+ <event name="discarded" type="destructor">
262+ <description summary="the content update was not displayed">
263+ The content update was never displayed to the user.
264+ </description>
265+ </event>
266+ </interface>
267+
268+</protocol>
A protocols/xdg-dialog-v1.xml +110 -0
@@ -0,0 +1,110 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<protocol name="xdg_dialog_v1">
3+ <copyright>
4+ Copyright © 2023 Carlos Garnacho
5+
6+ Permission is hereby granted, free of charge, to any person obtaining a
7+ copy of this software and associated documentation files (the "Software"),
8+ to deal in the Software without restriction, including without limitation
9+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
10+ and/or sell copies of the Software, and to permit persons to whom the
11+ Software is furnished to do so, subject to the following conditions:
12+
13+ The above copyright notice and this permission notice (including the next
14+ paragraph) shall be included in all copies or substantial portions of the
15+ Software.
16+
17+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23+ DEALINGS IN THE SOFTWARE.
24+ </copyright>
25+
26+ <interface name="xdg_wm_dialog_v1" version="1">
27+ <description summary="create dialogs related to other toplevels">
28+ The xdg_wm_dialog_v1 interface is exposed as a global object allowing
29+ to register surfaces with a xdg_toplevel role as "dialogs" relative to
30+ another toplevel.
31+
32+ The compositor may let this relation influence how the surface is
33+ placed, displayed or interacted with.
34+
35+ Warning! The protocol described in this file is currently in the testing
36+ phase. Backward compatible changes may be added together with the
37+ corresponding interface version bump. Backward incompatible changes can
38+ only be done by creating a new major version of the extension.
39+ </description>
40+
41+ <enum name="error">
42+ <entry name="already_used" value="0"
43+ summary="the xdg_toplevel object has already been used to create a xdg_dialog_v1"/>
44+ </enum>
45+
46+ <request name="destroy" type="destructor">
47+ <description summary="destroy the dialog manager object">
48+ Destroys the xdg_wm_dialog_v1 object. This does not affect
49+ the xdg_dialog_v1 objects generated through it.
50+ </description>
51+ </request>
52+
53+ <request name="get_xdg_dialog">
54+ <description summary="create a dialog object">
55+ Creates a xdg_dialog_v1 object for the given toplevel. See the interface
56+ description for more details.
57+
58+ Compositors must raise an already_used error if clients attempt to
59+ create multiple xdg_dialog_v1 objects for the same xdg_toplevel.
60+ </description>
61+ <arg name="id" type="new_id" interface="xdg_dialog_v1"/>
62+ <arg name="toplevel" type="object" interface="xdg_toplevel"/>
63+ </request>
64+ </interface>
65+
66+ <interface name="xdg_dialog_v1" version="1">
67+ <description summary="dialog object">
68+ A xdg_dialog_v1 object is an ancillary object tied to a xdg_toplevel. Its
69+ purpose is hinting the compositor that the toplevel is a "dialog" (e.g. a
70+ temporary window) relative to another toplevel (see
71+ xdg_toplevel.set_parent). If the xdg_toplevel is destroyed, the xdg_dialog_v1
72+ becomes inert.
73+
74+ Through this object, the client may provide additional hints about
75+ the purpose of the secondary toplevel. This interface has no effect
76+ on toplevels that are not attached to a parent toplevel.
77+ </description>
78+
79+ <request name="destroy" type="destructor">
80+ <description summary="destroy the dialog object">
81+ Destroys the xdg_dialog_v1 object. If this object is destroyed
82+ before the related xdg_toplevel, the compositor should unapply its
83+ effects.
84+ </description>
85+ </request>
86+
87+ <request name="set_modal">
88+ <description summary="mark dialog as modal">
89+ Hints that the dialog has "modal" behavior. Modal dialogs typically
90+ require to be fully addressed by the user (i.e. closed) before resuming
91+ interaction with the parent toplevel, and may require a distinct
92+ presentation.
93+
94+ Clients must implement the logic to filter events in the parent
95+ toplevel on their own.
96+
97+ Compositors may choose any policy in event delivery to the parent
98+ toplevel, from delivering all events unfiltered to using them for
99+ internal consumption.
100+ </description>
101+ </request>
102+
103+ <request name="unset_modal">
104+ <description summary="mark dialog as not modal">
105+ Drops the hint that this dialog has "modal" behavior. See
106+ xdg_dialog_v1.set_modal for more details.
107+ </description>
108+ </request>
109+ </interface>
110+</protocol>
A protocols/xdg-foreign-unstable-v2.xml +200 -0
@@ -0,0 +1,200 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<protocol name="xdg_foreign_unstable_v2">
3+
4+ <copyright>
5+ Copyright © 2015-2016 Red Hat Inc.
6+
7+ Permission is hereby granted, free of charge, to any person obtaining a
8+ copy of this software and associated documentation files (the "Software"),
9+ to deal in the Software without restriction, including without limitation
10+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
11+ and/or sell copies of the Software, and to permit persons to whom the
12+ Software is furnished to do so, subject to the following conditions:
13+
14+ The above copyright notice and this permission notice (including the next
15+ paragraph) shall be included in all copies or substantial portions of the
16+ Software.
17+
18+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
21+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
24+ DEALINGS IN THE SOFTWARE.
25+ </copyright>
26+
27+ <description summary="Protocol for exporting xdg surface handles">
28+ This protocol specifies a way for making it possible to reference a surface
29+ of a different client. With such a reference, a client can, by using the
30+ interfaces provided by this protocol, manipulate the relationship between
31+ its own surfaces and the surface of some other client. For example, stack
32+ some of its own surface above the other clients surface.
33+
34+ In order for a client A to get a reference of a surface of client B, client
35+ B must first export its surface using xdg_exporter.export_toplevel. Upon
36+ doing this, client B will receive a handle (a unique string) that it may
37+ share with client A in some way (for example D-Bus). After client A has
38+ received the handle from client B, it may use xdg_importer.import_toplevel
39+ to create a reference to the surface client B just exported. See the
40+ corresponding requests for details.
41+
42+ A possible use case for this is out-of-process dialogs. For example when a
43+ sandboxed client without file system access needs the user to select a file
44+ on the file system, given sandbox environment support, it can export its
45+ surface, passing the exported surface handle to an unsandboxed process that
46+ can show a file browser dialog and stack it above the sandboxed client's
47+ surface.
48+
49+ Warning! The protocol described in this file is experimental and backward
50+ incompatible changes may be made. Backward compatible changes may be added
51+ together with the corresponding interface version bump. Backward
52+ incompatible changes are done by bumping the version number in the protocol
53+ and interface names and resetting the interface version. Once the protocol
54+ is to be declared stable, the 'z' prefix and the version number in the
55+ protocol and interface names are removed and the interface version number is
56+ reset.
57+ </description>
58+
59+ <interface name="zxdg_exporter_v2" version="1">
60+ <description summary="interface for exporting surfaces">
61+ A global interface used for exporting surfaces that can later be imported
62+ using xdg_importer.
63+ </description>
64+
65+ <request name="destroy" type="destructor">
66+ <description summary="destroy the xdg_exporter object">
67+ Notify the compositor that the xdg_exporter object will no longer be
68+ used.
69+ </description>
70+ </request>
71+
72+ <enum name="error">
73+ <description summary="error values">
74+ These errors can be emitted in response to invalid xdg_exporter
75+ requests.
76+ </description>
77+ <entry name="invalid_surface" value="0" summary="surface is not an xdg_toplevel"/>
78+ </enum>
79+
80+ <request name="export_toplevel">
81+ <description summary="export a toplevel surface">
82+ The export_toplevel request exports the passed surface so that it can later be
83+ imported via xdg_importer. When called, a new xdg_exported object will
84+ be created and xdg_exported.handle will be sent immediately. See the
85+ corresponding interface and event for details.
86+
87+ A surface may be exported multiple times, and each exported handle may
88+ be used to create an xdg_imported multiple times. Only xdg_toplevel
89+ equivalent surfaces may be exported, otherwise an invalid_surface
90+ protocol error is sent.
91+ </description>
92+ <arg name="id" type="new_id" interface="zxdg_exported_v2"
93+ summary="the new xdg_exported object"/>
94+ <arg name="surface" type="object" interface="wl_surface"
95+ summary="the surface to export"/>
96+ </request>
97+ </interface>
98+
99+ <interface name="zxdg_importer_v2" version="1">
100+ <description summary="interface for importing surfaces">
101+ A global interface used for importing surfaces exported by xdg_exporter.
102+ With this interface, a client can create a reference to a surface of
103+ another client.
104+ </description>
105+
106+ <request name="destroy" type="destructor">
107+ <description summary="destroy the xdg_importer object">
108+ Notify the compositor that the xdg_importer object will no longer be
109+ used.
110+ </description>
111+ </request>
112+
113+ <request name="import_toplevel">
114+ <description summary="import a toplevel surface">
115+ The import_toplevel request imports a surface from any client given a handle
116+ retrieved by exporting said surface using xdg_exporter.export_toplevel.
117+ When called, a new xdg_imported object will be created. This new object
118+ represents the imported surface, and the importing client can
119+ manipulate its relationship using it. See xdg_imported for details.
120+ </description>
121+ <arg name="id" type="new_id" interface="zxdg_imported_v2"
122+ summary="the new xdg_imported object"/>
123+ <arg name="handle" type="string"
124+ summary="the exported surface handle"/>
125+ </request>
126+ </interface>
127+
128+ <interface name="zxdg_exported_v2" version="1">
129+ <description summary="an exported surface handle">
130+ An xdg_exported object represents an exported reference to a surface. The
131+ exported surface may be referenced as long as the xdg_exported object not
132+ destroyed. Destroying the xdg_exported invalidates any relationship the
133+ importer may have established using xdg_imported.
134+ </description>
135+
136+ <request name="destroy" type="destructor">
137+ <description summary="unexport the exported surface">
138+ Revoke the previously exported surface. This invalidates any
139+ relationship the importer may have set up using the xdg_imported created
140+ given the handle sent via xdg_exported.handle.
141+ </description>
142+ </request>
143+
144+ <event name="handle">
145+ <description summary="the exported surface handle">
146+ The handle event contains the unique handle of this exported surface
147+ reference. It may be shared with any client, which then can use it to
148+ import the surface by calling xdg_importer.import_toplevel. A handle
149+ may be used to import the surface multiple times.
150+ </description>
151+ <arg name="handle" type="string" summary="the exported surface handle"/>
152+ </event>
153+ </interface>
154+
155+ <interface name="zxdg_imported_v2" version="1">
156+ <description summary="an imported surface handle">
157+ An xdg_imported object represents an imported reference to surface exported
158+ by some client. A client can use this interface to manipulate
159+ relationships between its own surfaces and the imported surface.
160+ </description>
161+
162+ <enum name="error">
163+ <description summary="error values">
164+ These errors can be emitted in response to invalid xdg_imported
165+ requests.
166+ </description>
167+ <entry name="invalid_surface" value="0" summary="surface is not an xdg_toplevel"/>
168+ </enum>
169+
170+ <request name="destroy" type="destructor">
171+ <description summary="destroy the xdg_imported object">
172+ Notify the compositor that it will no longer use the xdg_imported
173+ object. Any relationship that may have been set up will at this point
174+ be invalidated.
175+ </description>
176+ </request>
177+
178+ <request name="set_parent_of">
179+ <description summary="set as the parent of some surface">
180+ Set the imported surface as the parent of some surface of the client.
181+ The passed surface must be an xdg_toplevel equivalent, otherwise an
182+ invalid_surface protocol error is sent. Calling this function sets up
183+ a surface to surface relation with the same stacking and positioning
184+ semantics as xdg_toplevel.set_parent.
185+ </description>
186+ <arg name="surface" type="object" interface="wl_surface"
187+ summary="the child surface"/>
188+ </request>
189+
190+ <event name="destroyed">
191+ <description summary="the imported surface handle has been destroyed">
192+ The imported surface handle has been destroyed and any relationship set
193+ up has been invalidated. This may happen for various reasons, for
194+ example if the exported surface or the exported surface handle has been
195+ destroyed, if the handle used for importing was invalid.
196+ </description>
197+ </event>
198+ </interface>
199+
200+</protocol>
A protocols/xdg-system-bell-v1.xml +58 -0
@@ -0,0 +1,58 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<protocol name="xdg_system_bell_v1">
3+ <copyright>
4+ Copyright © 2016, 2023 Red Hat
5+
6+ Permission is hereby granted, free of charge, to any person obtaining a
7+ copy of this software and associated documentation files (the "Software"),
8+ to deal in the Software without restriction, including without limitation
9+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
10+ and/or sell copies of the Software, and to permit persons to whom the
11+ Software is furnished to do so, subject to the following conditions:
12+
13+ The above copyright notice and this permission notice (including the next
14+ paragraph) shall be included in all copies or substantial portions of the
15+ Software.
16+
17+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23+ DEALINGS IN THE SOFTWARE.
24+ </copyright>
25+
26+ <interface name="xdg_system_bell_v1" version="1">
27+ <description summary="system bell">
28+ This global interface enables clients to ring the system bell.
29+
30+ Warning! The protocol described in this file is currently in the testing
31+ phase. Backward compatible changes may be added together with the
32+ corresponding interface version bump. Backward incompatible changes can
33+ only be done by creating a new major version of the extension.
34+ </description>
35+
36+ <request name="destroy" type="destructor">
37+ <description summary="destroy the system bell object">
38+ Notify that the object will no longer be used.
39+ </description>
40+ </request>
41+
42+ <request name="ring">
43+ <description summary="ring the system bell">
44+ This requests rings the system bell on behalf of a client. How ringing
45+ the bell is implemented is up to the compositor. It may be an audible
46+ sound, a visual feedback of some kind, or any other thing including
47+ nothing.
48+
49+ The passed surface should correspond to a toplevel like surface role,
50+ or be null, meaning the client doesn't have a particular toplevel it
51+ wants to associate the bell ringing with. See the xdg-shell protocol
52+ extension for a toplevel like surface role.
53+ </description>
54+ <arg name="surface" type="object" interface="wl_surface"
55+ allow-null="true" summary="associated surface"/>
56+ </request>
57+ </interface>
58+</protocol>
A protocols/xdg-toplevel-icon-v1.xml +205 -0
@@ -0,0 +1,205 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<protocol name="xdg_toplevel_icon_v1">
3+
4+ <copyright>
5+ Copyright © 2023-2024 Matthias Klumpp
6+ Copyright © 2024 David Edmundson
7+
8+ Permission is hereby granted, free of charge, to any person obtaining a
9+ copy of this software and associated documentation files (the "Software"),
10+ to deal in the Software without restriction, including without limitation
11+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
12+ and/or sell copies of the Software, and to permit persons to whom the
13+ Software is furnished to do so, subject to the following conditions:
14+
15+ The above copyright notice and this permission notice (including the next
16+ paragraph) shall be included in all copies or substantial portions of the
17+ Software.
18+
19+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25+ DEALINGS IN THE SOFTWARE.
26+ </copyright>
27+
28+ <description summary="protocol to assign icons to toplevels">
29+ This protocol allows clients to set icons for their toplevel surfaces
30+ either via the XDG icon stock (using an icon name), or from pixel data.
31+
32+ A toplevel icon represents the individual toplevel (unlike the application
33+ or launcher icon, which represents the application as a whole), and may be
34+ shown in window switchers, window overviews and taskbars that list
35+ individual windows.
36+
37+ This document adheres to RFC 2119 when using words like "must",
38+ "should", "may", etc.
39+
40+ Warning! The protocol described in this file is currently in the testing
41+ phase. Backward compatible changes may be added together with the
42+ corresponding interface version bump. Backward incompatible changes can
43+ only be done by creating a new major version of the extension.
44+ </description>
45+
46+ <interface name="xdg_toplevel_icon_manager_v1" version="1">
47+ <description summary="interface to manage toplevel icons">
48+ This interface allows clients to create toplevel window icons and set
49+ them on toplevel windows to be displayed to the user.
50+ </description>
51+
52+ <request name="destroy" type="destructor">
53+ <description summary="destroy the toplevel icon manager">
54+ Destroy the toplevel icon manager.
55+ This does not destroy objects created with the manager.
56+ </description>
57+ </request>
58+
59+ <request name="create_icon">
60+ <description summary="create a new icon instance">
61+ Creates a new icon object. This icon can then be attached to a
62+ xdg_toplevel via the 'set_icon' request.
63+ </description>
64+ <arg name="id" type="new_id" interface="xdg_toplevel_icon_v1"/>
65+ </request>
66+
67+ <request name="set_icon">
68+ <description summary="set an icon on a toplevel window">
69+ This request assigns the icon 'icon' to 'toplevel', or clears the
70+ toplevel icon if 'icon' was null.
71+ This state is double-buffered and is applied on the next
72+ wl_surface.commit of the toplevel.
73+
74+ After making this call, the xdg_toplevel_icon_v1 provided as 'icon'
75+ can be destroyed by the client without 'toplevel' losing its icon.
76+ The xdg_toplevel_icon_v1 is immutable from this point, and any
77+ future attempts to change it must raise the
78+ 'xdg_toplevel_icon_v1.immutable' protocol error.
79+
80+ The compositor must set the toplevel icon from either the pixel data
81+ the icon provides, or by loading a stock icon using the icon name.
82+ See the description of 'xdg_toplevel_icon_v1' for details.
83+
84+ If 'icon' is set to null, the icon of the respective toplevel is reset
85+ to its default icon (usually the icon of the application, derived from
86+ its desktop-entry file, or a placeholder icon).
87+ If this request is passed an icon with no pixel buffers or icon name
88+ assigned, the icon must be reset just like if 'icon' was null.
89+ </description>
90+ <arg name="toplevel" type="object" interface="xdg_toplevel" summary="the toplevel to act on"/>
91+ <arg name="icon" type="object" interface="xdg_toplevel_icon_v1" allow-null="true"/>
92+ </request>
93+
94+ <event name="icon_size">
95+ <description summary="describes a supported &amp; preferred icon size">
96+ This event indicates an icon size the compositor prefers to be
97+ available if the client has scalable icons and can render to any size.
98+
99+ When the 'xdg_toplevel_icon_manager_v1' object is created, the
100+ compositor may send one or more 'icon_size' events to describe the list
101+ of preferred icon sizes. If the compositor has no size preference, it
102+ may not send any 'icon_size' event, and it is up to the client to
103+ decide a suitable icon size.
104+
105+ A sequence of 'icon_size' events must be finished with a 'done' event.
106+ If the compositor has no size preferences, it must still send the
107+ 'done' event, without any preceding 'icon_size' events.
108+ </description>
109+ <arg name="size" type="int"
110+ summary="the edge size of the square icon in surface-local coordinates, e.g. 64"/>
111+ </event>
112+
113+ <event name="done">
114+ <description summary="all information has been sent">
115+ This event is sent after all 'icon_size' events have been sent.
116+ </description>
117+ </event>
118+ </interface>
119+
120+ <interface name="xdg_toplevel_icon_v1" version="1">
121+ <description summary="a toplevel window icon">
122+ This interface defines a toplevel icon.
123+ An icon can have a name, and multiple buffers.
124+ In order to be applied, the icon must have either a name, or at least
125+ one buffer assigned. Applying an empty icon (with no buffer or name) to
126+ a toplevel should reset its icon to the default icon.
127+
128+ It is up to compositor policy whether to prefer using a buffer or loading
129+ an icon via its name. See 'set_name' and 'add_buffer' for details.
130+ </description>
131+
132+ <enum name="error">
133+ <entry name="invalid_buffer"
134+ summary="the provided buffer does not satisfy requirements"
135+ value="1"/>
136+ <entry name="immutable"
137+ summary="the icon has already been assigned to a toplevel and must not be changed"
138+ value="2"/>
139+ <entry name="no_buffer"
140+ summary="the provided buffer has been destroyed before the toplevel icon"
141+ value="3"/>
142+ </enum>
143+
144+ <request name="destroy" type="destructor">
145+ <description summary="destroy the icon object">
146+ Destroys the 'xdg_toplevel_icon_v1' object.
147+ The icon must still remain set on every toplevel it was assigned to,
148+ until the toplevel icon is reset explicitly.
149+ </description>
150+ </request>
151+
152+ <request name="set_name">
153+ <description summary="set an icon name">
154+ This request assigns an icon name to this icon.
155+ Any previously set name is overridden.
156+
157+ The compositor must resolve 'icon_name' according to the lookup rules
158+ described in the XDG icon theme specification[1] using the
159+ environment's current icon theme.
160+
161+ If the compositor does not support icon names or cannot resolve
162+ 'icon_name' according to the XDG icon theme specification it must
163+ fall back to using pixel buffer data instead.
164+
165+ If this request is made after the icon has been assigned to a toplevel
166+ via 'set_icon', an 'immutable' error must be raised.
167+
168+ [1]: https://specifications.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html
169+ </description>
170+ <arg name="icon_name" type="string"/>
171+ </request>
172+
173+ <request name="add_buffer">
174+ <description summary="add icon data from a pixel buffer">
175+ This request adds pixel data supplied as wl_buffer to the icon.
176+
177+ The client should add pixel data for all icon sizes and scales that
178+ it can provide, or which are explicitly requested by the compositor
179+ via 'icon_size' events on xdg_toplevel_icon_manager_v1.
180+
181+ The wl_buffer supplying pixel data as 'buffer' must be backed by wl_shm
182+ and must be a square (width and height being equal).
183+ If any of these buffer requirements are not fulfilled, a 'invalid_buffer'
184+ error must be raised.
185+
186+ If this icon instance already has a buffer of the same size and scale
187+ from a previous 'add_buffer' request, data from the last request
188+ overrides the preexisting pixel data.
189+
190+ The wl_buffer must be kept alive for as long as the xdg_toplevel_icon
191+ it is associated with is not destroyed, otherwise a 'no_buffer' error
192+ is raised. The buffer contents must not be modified after it was
193+ assigned to the icon. As a result, the region of the wl_shm_pool's
194+ backing storage used for the wl_buffer must not be modified after this
195+ request is sent. The wl_buffer.release event is unused.
196+
197+ If this request is made after the icon has been assigned to a toplevel
198+ via 'set_icon', an 'immutable' error must be raised.
199+ </description>
200+ <arg name="buffer" type="object" interface="wl_buffer"/>
201+ <arg name="scale" type="int"
202+ summary="the scaling factor of the icon, e.g. 1"/>
203+ </request>
204+ </interface>
205+</protocol>
A protocols/xdg-toplevel-tag-v1.xml +85 -0
@@ -0,0 +1,85 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<protocol name="xdg_toplevel_tag_v1">
3+ <copyright>
4+ Copyright © 2024 Xaver Hugl
5+
6+ Permission is hereby granted, free of charge, to any person obtaining a
7+ copy of this software and associated documentation files (the "Software"),
8+ to deal in the Software without restriction, including without limitation
9+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
10+ and/or sell copies of the Software, and to permit persons to whom the
11+ Software is furnished to do so, subject to the following conditions:
12+
13+ The above copyright notice and this permission notice (including the next
14+ paragraph) shall be included in all copies or substantial portions of the
15+ Software.
16+
17+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23+ DEALINGS IN THE SOFTWARE.
24+ </copyright>
25+
26+ <interface name="xdg_toplevel_tag_manager_v1" version="1">
27+ <description summary="protocol for setting toplevel tags">
28+ In order to make some window properties like position, size,
29+ "always on top" or user defined rules for window behavior persistent, the
30+ compositor needs some way to identify windows even after the application
31+ has been restarted.
32+ This protocol allows clients to make this possible by setting a tag for
33+ toplevels.
34+
35+ Warning! The protocol described in this file is currently in the testing
36+ phase. Backward compatible changes may be added together with the
37+ corresponding interface version bump. Backward incompatible changes can
38+ only be done by creating a new major version of the extension.
39+ </description>
40+
41+ <request name="destroy" type="destructor">
42+ <description summary="destroy toplevel tag object">
43+ Destroy this toplevel tag manager object. This request has no other
44+ effects.
45+ </description>
46+ </request>
47+
48+ <request name="set_toplevel_tag">
49+ <description summary="set tag">
50+ Set a tag for a toplevel. The tag may be shown to the user in UI, so
51+ it's preferable for it to be human readable, but it must be suitable
52+ for configuration files and should not be translated.
53+ Suitable tags would for example be "main window", "settings",
54+ "e-mail composer" or similar.
55+
56+ The tag does not need to be unique across applications, and the client
57+ may set the same tag for multiple windows, for example if the user has
58+ opened the same UI twice. How the potentially resulting conflicts are
59+ handled is compositor policy.
60+
61+ The client should set the tag as part of the initial commit on the
62+ associated toplevel, but it may set it at any time afterwards as well,
63+ for example if the purpose of the toplevel changes.
64+ </description>
65+ <arg name="toplevel" type="object" interface="xdg_toplevel"/>
66+ <arg name="tag" type="string" summary="untranslated tag"/>
67+ </request>
68+
69+ <request name="set_toplevel_description">
70+ <description summary="set description">
71+ Set a description for a toplevel. This description may be shown to the
72+ user in UI or read by a screen reader for accessibility purposes, and
73+ should be translated.
74+ It is recommended to make the description the translation of the tag.
75+
76+ The client should set the description as part of the initial commit on
77+ the associated toplevel, but it may set it at any time afterwards as
78+ well, for example if the purpose of the toplevel changes.
79+ </description>
80+ <arg name="toplevel" type="object" interface="xdg_toplevel"/>
81+ <arg name="description" type="string" summary="translated description"/>
82+ </request>
83+ </interface>
84+
85+</protocol>

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 14

↑↓ moveenter openesc close