detached 7942c6b

Merge pull request #4 from bnema/feat/more-protocols

feat(protocol): add capture, input method, color and wlr bindings
commit
7942c6b73073cba7973d7430a3c2b21521abb694
author
bnema · · 2026-09-27 03:53 UTC
committer
GitHub · · 2026-09-27 03:53 UTC
merge of
107c393 + 6a363ec · diff against the first parent
signature
GPG UnverifiedB5690EEEBB952194 The key is unknown
refs
tag: v0.3.0
48 files · +13394 -0
A protocol/alphamodifier/alphamodifier.go +149 -0
@@ -0,0 +1,149 @@
1+// Code generated by wlgen; DO NOT EDIT.
2+package alphamodifier
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 WpAlphaModifierV1Interface *server.Interface
11+var WpAlphaModifierSurfaceV1Interface *server.Interface
12+
13+func init() {
14+ WpAlphaModifierV1Interface = &server.Interface{Name: "wp_alpha_modifier_v1", Version: 1}
15+ WpAlphaModifierSurfaceV1Interface = &server.Interface{Name: "wp_alpha_modifier_surface_v1", Version: 1}
16+ WpAlphaModifierV1Interface.Requests = []server.Message{
17+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
18+ {Name: "get_surface", Signature: "no", Types: []*server.Interface{WpAlphaModifierSurfaceV1Interface, wayland.SurfaceInterface}},
19+ }
20+ WpAlphaModifierV1Interface.Events = []server.Message{}
21+ WpAlphaModifierSurfaceV1Interface.Requests = []server.Message{
22+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
23+ {Name: "set_multiplier", Signature: "u", Types: []*server.Interface{nil}},
24+ }
25+ WpAlphaModifierSurfaceV1Interface.Events = []server.Message{}
26+ if err := server.NewInterfaces(WpAlphaModifierV1Interface, WpAlphaModifierSurfaceV1Interface); err != nil {
27+ panic(err)
28+ }
29+}
30+
31+// WpAlphaModifierV1 surface alpha modifier manager.
32+type WpAlphaModifierV1 struct{ *server.Resource }
33+
34+func WrapWpAlphaModifierV1(r *server.Resource) *WpAlphaModifierV1 {
35+ if r == nil {
36+ return nil
37+ }
38+ return &WpAlphaModifierV1{r}
39+}
40+
41+const WpAlphaModifierV1RequestDestroy uint32 = 0
42+const WpAlphaModifierV1RequestGetSurface uint32 = 1
43+
44+// WpAlphaModifierV1Error .
45+type WpAlphaModifierV1Error uint32
46+
47+const (
48+ WpAlphaModifierV1ErrorAlreadyConstructed WpAlphaModifierV1Error = 0
49+)
50+
51+// WpAlphaModifierV1Handler handles wp_alpha_modifier_v1 requests.
52+type WpAlphaModifierV1Handler interface {
53+ Destroy(self *WpAlphaModifierV1)
54+ GetSurface(self *WpAlphaModifierV1, id uint32, surface *wayland.Surface)
55+}
56+
57+func NewWpAlphaModifierV1(c server.Client, version int32, id uint32, h WpAlphaModifierV1Handler) (*WpAlphaModifierV1, error) {
58+ if h == nil {
59+ return nil, fmt.Errorf("purego-libwayland: nil handler for wp_alpha_modifier_v1")
60+ }
61+ var self *WpAlphaModifierV1
62+ r, err := c.CreateResource(WpAlphaModifierV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
63+ switch opcode {
64+ case 0:
65+ h.Destroy(self)
66+ self.Destroy()
67+ case 1:
68+ h.GetSurface(self, args[0].NewID(), wayland.WrapSurface(args[1].Resource()))
69+ }
70+ })
71+ if err != nil {
72+ return nil, err
73+ }
74+ self = WrapWpAlphaModifierV1(r)
75+ r.Data = self
76+ return self, nil
77+}
78+func NewWpAlphaModifierV1Global(d *server.Display, version int32, bind server.BindFunc) error {
79+ return d.CreateGlobal(WpAlphaModifierV1Interface, version, bind)
80+}
81+
82+// WpAlphaModifierSurfaceV1 alpha modifier object for a surface.
83+type WpAlphaModifierSurfaceV1 struct{ *server.Resource }
84+
85+func WrapWpAlphaModifierSurfaceV1(r *server.Resource) *WpAlphaModifierSurfaceV1 {
86+ if r == nil {
87+ return nil
88+ }
89+ return &WpAlphaModifierSurfaceV1{r}
90+}
91+
92+const WpAlphaModifierSurfaceV1RequestDestroy uint32 = 0
93+const WpAlphaModifierSurfaceV1RequestSetMultiplier uint32 = 1
94+
95+// WpAlphaModifierSurfaceV1Error .
96+type WpAlphaModifierSurfaceV1Error uint32
97+
98+const (
99+ WpAlphaModifierSurfaceV1ErrorNoSurface WpAlphaModifierSurfaceV1Error = 0
100+)
101+
102+// WpAlphaModifierSurfaceV1Handler handles wp_alpha_modifier_surface_v1 requests.
103+type WpAlphaModifierSurfaceV1Handler interface {
104+ Destroy(self *WpAlphaModifierSurfaceV1)
105+ SetMultiplier(self *WpAlphaModifierSurfaceV1, factor uint32)
106+}
107+
108+func NewWpAlphaModifierSurfaceV1(c server.Client, version int32, id uint32, h WpAlphaModifierSurfaceV1Handler) (*WpAlphaModifierSurfaceV1, error) {
109+ if h == nil {
110+ return nil, fmt.Errorf("purego-libwayland: nil handler for wp_alpha_modifier_surface_v1")
111+ }
112+ var self *WpAlphaModifierSurfaceV1
113+ r, err := c.CreateResource(WpAlphaModifierSurfaceV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
114+ switch opcode {
115+ case 0:
116+ h.Destroy(self)
117+ self.Destroy()
118+ case 1:
119+ h.SetMultiplier(self, args[0].Uint())
120+ }
121+ })
122+ if err != nil {
123+ return nil, err
124+ }
125+ self = WrapWpAlphaModifierSurfaceV1(r)
126+ r.Data = self
127+ return self, nil
128+}
129+func NewWpAlphaModifierSurfaceV1Global(d *server.Display, version int32, bind server.BindFunc) error {
130+ return d.CreateGlobal(WpAlphaModifierSurfaceV1Interface, version, bind)
131+}
132+func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
133+ if v == nil {
134+ return nil
135+ }
136+ return v.GetResource()
137+}
138+func (self *WpAlphaModifierV1) GetResource() *server.Resource {
139+ if self == nil {
140+ return nil
141+ }
142+ return self.Resource
143+}
144+func (self *WpAlphaModifierSurfaceV1) GetResource() *server.Resource {
145+ if self == nil {
146+ return nil
147+ }
148+ return self.Resource
149+}
A protocol/colormanagement/colormanagement.go +890 -0
@@ -0,0 +1,890 @@
1+// Code generated by wlgen; DO NOT EDIT.
2+package colormanagement
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 WpColorManagerV1Interface *server.Interface
12+var WpColorManagementOutputV1Interface *server.Interface
13+var WpColorManagementSurfaceV1Interface *server.Interface
14+var WpColorManagementSurfaceFeedbackV1Interface *server.Interface
15+var WpImageDescriptionCreatorIccV1Interface *server.Interface
16+var WpImageDescriptionCreatorParamsV1Interface *server.Interface
17+var WpImageDescriptionV1Interface *server.Interface
18+var WpImageDescriptionInfoV1Interface *server.Interface
19+var WpImageDescriptionReferenceV1Interface *server.Interface
20+
21+func init() {
22+ WpColorManagerV1Interface = &server.Interface{Name: "wp_color_manager_v1", Version: 3}
23+ WpColorManagementOutputV1Interface = &server.Interface{Name: "wp_color_management_output_v1", Version: 3}
24+ WpColorManagementSurfaceV1Interface = &server.Interface{Name: "wp_color_management_surface_v1", Version: 3}
25+ WpColorManagementSurfaceFeedbackV1Interface = &server.Interface{Name: "wp_color_management_surface_feedback_v1", Version: 3}
26+ WpImageDescriptionCreatorIccV1Interface = &server.Interface{Name: "wp_image_description_creator_icc_v1", Version: 3}
27+ WpImageDescriptionCreatorParamsV1Interface = &server.Interface{Name: "wp_image_description_creator_params_v1", Version: 3}
28+ WpImageDescriptionV1Interface = &server.Interface{Name: "wp_image_description_v1", Version: 3}
29+ WpImageDescriptionInfoV1Interface = &server.Interface{Name: "wp_image_description_info_v1", Version: 3}
30+ WpImageDescriptionReferenceV1Interface = &server.Interface{Name: "wp_image_description_reference_v1", Version: 1}
31+ WpColorManagerV1Interface.Requests = []server.Message{
32+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
33+ {Name: "get_output", Signature: "no", Types: []*server.Interface{WpColorManagementOutputV1Interface, wayland.OutputInterface}},
34+ {Name: "get_surface", Signature: "no", Types: []*server.Interface{WpColorManagementSurfaceV1Interface, wayland.SurfaceInterface}},
35+ {Name: "get_surface_feedback", Signature: "no", Types: []*server.Interface{WpColorManagementSurfaceFeedbackV1Interface, wayland.SurfaceInterface}},
36+ {Name: "create_icc_creator", Signature: "n", Types: []*server.Interface{WpImageDescriptionCreatorIccV1Interface}},
37+ {Name: "create_parametric_creator", Signature: "n", Types: []*server.Interface{WpImageDescriptionCreatorParamsV1Interface}},
38+ {Name: "create_windows_scrgb", Signature: "n", Types: []*server.Interface{WpImageDescriptionV1Interface}},
39+ {Name: "get_image_description", Signature: "2no", Types: []*server.Interface{WpImageDescriptionV1Interface, WpImageDescriptionReferenceV1Interface}},
40+ {Name: "create_windows_bt2100", Signature: "3n", Types: []*server.Interface{WpImageDescriptionV1Interface}},
41+ }
42+ WpColorManagerV1Interface.Events = []server.Message{
43+ {Name: "supported_intent", Signature: "u", Types: []*server.Interface{nil}},
44+ {Name: "supported_feature", Signature: "u", Types: []*server.Interface{nil}},
45+ {Name: "supported_tf_named", Signature: "u", Types: []*server.Interface{nil}},
46+ {Name: "supported_primaries_named", Signature: "u", Types: []*server.Interface{nil}},
47+ {Name: "done", Signature: "", Types: []*server.Interface{}},
48+ }
49+ WpColorManagementOutputV1Interface.Requests = []server.Message{
50+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
51+ {Name: "get_image_description", Signature: "n", Types: []*server.Interface{WpImageDescriptionV1Interface}},
52+ }
53+ WpColorManagementOutputV1Interface.Events = []server.Message{
54+ {Name: "image_description_changed", Signature: "", Types: []*server.Interface{}},
55+ }
56+ WpColorManagementSurfaceV1Interface.Requests = []server.Message{
57+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
58+ {Name: "set_image_description", Signature: "ou", Types: []*server.Interface{WpImageDescriptionV1Interface, nil}},
59+ {Name: "unset_image_description", Signature: "", Types: []*server.Interface{}},
60+ }
61+ WpColorManagementSurfaceV1Interface.Events = []server.Message{}
62+ WpColorManagementSurfaceFeedbackV1Interface.Requests = []server.Message{
63+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
64+ {Name: "get_preferred", Signature: "n", Types: []*server.Interface{WpImageDescriptionV1Interface}},
65+ {Name: "get_preferred_parametric", Signature: "n", Types: []*server.Interface{WpImageDescriptionV1Interface}},
66+ }
67+ WpColorManagementSurfaceFeedbackV1Interface.Events = []server.Message{
68+ {Name: "preferred_changed", Signature: "u", Types: []*server.Interface{nil}},
69+ {Name: "preferred_changed2", Signature: "2uu", Types: []*server.Interface{nil, nil}},
70+ }
71+ WpImageDescriptionCreatorIccV1Interface.Requests = []server.Message{
72+ {Name: "create", Signature: "n", Types: []*server.Interface{WpImageDescriptionV1Interface}},
73+ {Name: "set_icc_file", Signature: "huu", Types: []*server.Interface{nil, nil, nil}},
74+ }
75+ WpImageDescriptionCreatorIccV1Interface.Events = []server.Message{}
76+ WpImageDescriptionCreatorParamsV1Interface.Requests = []server.Message{
77+ {Name: "create", Signature: "n", Types: []*server.Interface{WpImageDescriptionV1Interface}},
78+ {Name: "set_tf_named", Signature: "u", Types: []*server.Interface{nil}},
79+ {Name: "set_tf_power", Signature: "u", Types: []*server.Interface{nil}},
80+ {Name: "set_primaries_named", Signature: "u", Types: []*server.Interface{nil}},
81+ {Name: "set_primaries", Signature: "iiiiiiii", Types: []*server.Interface{nil, nil, nil, nil, nil, nil, nil, nil}},
82+ {Name: "set_luminances", Signature: "uuu", Types: []*server.Interface{nil, nil, nil}},
83+ {Name: "set_mastering_display_primaries", Signature: "iiiiiiii", Types: []*server.Interface{nil, nil, nil, nil, nil, nil, nil, nil}},
84+ {Name: "set_mastering_luminance", Signature: "uu", Types: []*server.Interface{nil, nil}},
85+ {Name: "set_max_cll", Signature: "u", Types: []*server.Interface{nil}},
86+ {Name: "set_max_fall", Signature: "u", Types: []*server.Interface{nil}},
87+ }
88+ WpImageDescriptionCreatorParamsV1Interface.Events = []server.Message{}
89+ WpImageDescriptionV1Interface.Requests = []server.Message{
90+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
91+ {Name: "get_information", Signature: "n", Types: []*server.Interface{WpImageDescriptionInfoV1Interface}},
92+ }
93+ WpImageDescriptionV1Interface.Events = []server.Message{
94+ {Name: "failed", Signature: "us", Types: []*server.Interface{nil, nil}},
95+ {Name: "ready", Signature: "u", Types: []*server.Interface{nil}},
96+ {Name: "ready2", Signature: "2uu", Types: []*server.Interface{nil, nil}},
97+ }
98+ WpImageDescriptionInfoV1Interface.Requests = []server.Message{}
99+ WpImageDescriptionInfoV1Interface.Events = []server.Message{
100+ {Name: "done", Signature: "", Types: []*server.Interface{}},
101+ {Name: "icc_file", Signature: "hu", Types: []*server.Interface{nil, nil}},
102+ {Name: "primaries", Signature: "iiiiiiii", Types: []*server.Interface{nil, nil, nil, nil, nil, nil, nil, nil}},
103+ {Name: "primaries_named", Signature: "u", Types: []*server.Interface{nil}},
104+ {Name: "tf_power", Signature: "u", Types: []*server.Interface{nil}},
105+ {Name: "tf_named", Signature: "u", Types: []*server.Interface{nil}},
106+ {Name: "luminances", Signature: "uuu", Types: []*server.Interface{nil, nil, nil}},
107+ {Name: "target_primaries", Signature: "iiiiiiii", Types: []*server.Interface{nil, nil, nil, nil, nil, nil, nil, nil}},
108+ {Name: "target_luminance", Signature: "uu", Types: []*server.Interface{nil, nil}},
109+ {Name: "target_max_cll", Signature: "u", Types: []*server.Interface{nil}},
110+ {Name: "target_max_fall", Signature: "u", Types: []*server.Interface{nil}},
111+ }
112+ WpImageDescriptionReferenceV1Interface.Requests = []server.Message{
113+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
114+ }
115+ WpImageDescriptionReferenceV1Interface.Events = []server.Message{}
116+ if err := server.NewInterfaces(WpColorManagerV1Interface, WpColorManagementOutputV1Interface, WpColorManagementSurfaceV1Interface, WpColorManagementSurfaceFeedbackV1Interface, WpImageDescriptionCreatorIccV1Interface, WpImageDescriptionCreatorParamsV1Interface, WpImageDescriptionV1Interface, WpImageDescriptionInfoV1Interface, WpImageDescriptionReferenceV1Interface); err != nil {
117+ panic(err)
118+ }
119+}
120+
121+// WpColorManagerV1 color manager singleton.
122+type WpColorManagerV1 struct{ *server.Resource }
123+
124+func WrapWpColorManagerV1(r *server.Resource) *WpColorManagerV1 {
125+ if r == nil {
126+ return nil
127+ }
128+ return &WpColorManagerV1{r}
129+}
130+
131+const WpColorManagerV1RequestDestroy uint32 = 0
132+const WpColorManagerV1RequestGetOutput uint32 = 1
133+const WpColorManagerV1RequestGetSurface uint32 = 2
134+const WpColorManagerV1RequestGetSurfaceFeedback uint32 = 3
135+const WpColorManagerV1RequestCreateIccCreator uint32 = 4
136+const WpColorManagerV1RequestCreateParametricCreator uint32 = 5
137+const WpColorManagerV1RequestCreateWindowsScrgb uint32 = 6
138+const WpColorManagerV1RequestGetImageDescription uint32 = 7
139+const WpColorManagerV1RequestCreateWindowsBt2100 uint32 = 8
140+const WpColorManagerV1EventSupportedIntent uint32 = 0
141+const WpColorManagerV1EventSupportedFeature uint32 = 1
142+const WpColorManagerV1EventSupportedTfNamed uint32 = 2
143+const WpColorManagerV1EventSupportedPrimariesNamed uint32 = 3
144+const WpColorManagerV1EventDone uint32 = 4
145+
146+// WpColorManagerV1Error .
147+type WpColorManagerV1Error uint32
148+
149+const (
150+ WpColorManagerV1ErrorUnsupportedFeature WpColorManagerV1Error = 0
151+ WpColorManagerV1ErrorSurfaceExists WpColorManagerV1Error = 1
152+)
153+
154+// WpColorManagerV1RenderIntent rendering intents.
155+type WpColorManagerV1RenderIntent uint32
156+
157+const (
158+ WpColorManagerV1RenderIntentPerceptual WpColorManagerV1RenderIntent = 0
159+ WpColorManagerV1RenderIntentRelative WpColorManagerV1RenderIntent = 1
160+ WpColorManagerV1RenderIntentSaturation WpColorManagerV1RenderIntent = 2
161+ WpColorManagerV1RenderIntentAbsolute WpColorManagerV1RenderIntent = 3
162+ WpColorManagerV1RenderIntentRelativeBpc WpColorManagerV1RenderIntent = 4
163+ WpColorManagerV1RenderIntentAbsoluteNoAdaptation WpColorManagerV1RenderIntent = 5
164+)
165+
166+// WpColorManagerV1Feature compositor supported features.
167+type WpColorManagerV1Feature uint32
168+
169+const (
170+ WpColorManagerV1FeatureIccV2V4 WpColorManagerV1Feature = 0
171+ WpColorManagerV1FeatureParametric WpColorManagerV1Feature = 1
172+ WpColorManagerV1FeatureSetPrimaries WpColorManagerV1Feature = 2
173+ WpColorManagerV1FeatureSetTfPower WpColorManagerV1Feature = 3
174+ WpColorManagerV1FeatureSetLuminances WpColorManagerV1Feature = 4
175+ WpColorManagerV1FeatureSetMasteringDisplayPrimaries WpColorManagerV1Feature = 5
176+ WpColorManagerV1FeatureExtendedTargetVolume WpColorManagerV1Feature = 6
177+ WpColorManagerV1FeatureWindowsScrgb WpColorManagerV1Feature = 7
178+ WpColorManagerV1FeatureWindowsBt2100 WpColorManagerV1Feature = 8
179+)
180+
181+// WpColorManagerV1Primaries named color primaries.
182+type WpColorManagerV1Primaries uint32
183+
184+const (
185+ WpColorManagerV1PrimariesSrgb WpColorManagerV1Primaries = 1
186+ WpColorManagerV1PrimariesPalM WpColorManagerV1Primaries = 2
187+ WpColorManagerV1PrimariesPal WpColorManagerV1Primaries = 3
188+ WpColorManagerV1PrimariesNtsc WpColorManagerV1Primaries = 4
189+ WpColorManagerV1PrimariesGenericFilm WpColorManagerV1Primaries = 5
190+ WpColorManagerV1PrimariesBt2020 WpColorManagerV1Primaries = 6
191+ WpColorManagerV1PrimariesCie1931Xyz WpColorManagerV1Primaries = 7
192+ WpColorManagerV1PrimariesDciP3 WpColorManagerV1Primaries = 8
193+ WpColorManagerV1PrimariesDisplayP3 WpColorManagerV1Primaries = 9
194+ WpColorManagerV1PrimariesAdobeRgb WpColorManagerV1Primaries = 10
195+)
196+
197+// WpColorManagerV1TransferFunction named transfer functions.
198+type WpColorManagerV1TransferFunction uint32
199+
200+const (
201+ WpColorManagerV1TransferFunctionBt1886 WpColorManagerV1TransferFunction = 1
202+ WpColorManagerV1TransferFunctionGamma22 WpColorManagerV1TransferFunction = 2
203+ WpColorManagerV1TransferFunctionGamma28 WpColorManagerV1TransferFunction = 3
204+ WpColorManagerV1TransferFunctionSt240 WpColorManagerV1TransferFunction = 4
205+ WpColorManagerV1TransferFunctionExtLinear WpColorManagerV1TransferFunction = 5
206+ WpColorManagerV1TransferFunctionLog100 WpColorManagerV1TransferFunction = 6
207+ WpColorManagerV1TransferFunctionLog316 WpColorManagerV1TransferFunction = 7
208+ WpColorManagerV1TransferFunctionXvycc WpColorManagerV1TransferFunction = 8
209+ WpColorManagerV1TransferFunctionSrgb WpColorManagerV1TransferFunction = 9
210+ WpColorManagerV1TransferFunctionExtSrgb WpColorManagerV1TransferFunction = 10
211+ WpColorManagerV1TransferFunctionSt2084Pq WpColorManagerV1TransferFunction = 11
212+ WpColorManagerV1TransferFunctionSt428 WpColorManagerV1TransferFunction = 12
213+ WpColorManagerV1TransferFunctionHlg WpColorManagerV1TransferFunction = 13
214+ WpColorManagerV1TransferFunctionCompoundPower24 WpColorManagerV1TransferFunction = 14
215+)
216+
217+// WpColorManagerV1Handler handles wp_color_manager_v1 requests.
218+type WpColorManagerV1Handler interface {
219+ Destroy(self *WpColorManagerV1)
220+ GetOutput(self *WpColorManagerV1, id uint32, output *wayland.Output)
221+ GetSurface(self *WpColorManagerV1, id uint32, surface *wayland.Surface)
222+ GetSurfaceFeedback(self *WpColorManagerV1, id uint32, surface *wayland.Surface)
223+ CreateIccCreator(self *WpColorManagerV1, obj uint32)
224+ CreateParametricCreator(self *WpColorManagerV1, obj uint32)
225+ CreateWindowsScrgb(self *WpColorManagerV1, imageDescription uint32)
226+ GetImageDescription(self *WpColorManagerV1, imageDescription uint32, reference *WpImageDescriptionReferenceV1)
227+ CreateWindowsBt2100(self *WpColorManagerV1, imageDescription uint32)
228+}
229+
230+func NewWpColorManagerV1(c server.Client, version int32, id uint32, h WpColorManagerV1Handler) (*WpColorManagerV1, error) {
231+ if h == nil {
232+ return nil, fmt.Errorf("purego-libwayland: nil handler for wp_color_manager_v1")
233+ }
234+ var self *WpColorManagerV1
235+ r, err := c.CreateResource(WpColorManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
236+ switch opcode {
237+ case 0:
238+ h.Destroy(self)
239+ self.Destroy()
240+ case 1:
241+ h.GetOutput(self, args[0].NewID(), wayland.WrapOutput(args[1].Resource()))
242+ case 2:
243+ h.GetSurface(self, args[0].NewID(), wayland.WrapSurface(args[1].Resource()))
244+ case 3:
245+ h.GetSurfaceFeedback(self, args[0].NewID(), wayland.WrapSurface(args[1].Resource()))
246+ case 4:
247+ h.CreateIccCreator(self, args[0].NewID())
248+ case 5:
249+ h.CreateParametricCreator(self, args[0].NewID())
250+ case 6:
251+ h.CreateWindowsScrgb(self, args[0].NewID())
252+ case 7:
253+ h.GetImageDescription(self, args[0].NewID(), WrapWpImageDescriptionReferenceV1(args[1].Resource()))
254+ case 8:
255+ h.CreateWindowsBt2100(self, args[0].NewID())
256+ }
257+ })
258+ if err != nil {
259+ return nil, err
260+ }
261+ self = WrapWpColorManagerV1(r)
262+ r.Data = self
263+ return self, nil
264+}
265+
266+// SendSupportedIntent supported rendering intent.
267+func (self *WpColorManagerV1) SendSupportedIntent(renderIntent uint32) {
268+ self.PostEvent(WpColorManagerV1EventSupportedIntent, server.Uint(renderIntent))
269+}
270+
271+// SendSupportedFeature supported features.
272+func (self *WpColorManagerV1) SendSupportedFeature(feature uint32) {
273+ self.PostEvent(WpColorManagerV1EventSupportedFeature, server.Uint(feature))
274+}
275+
276+// SendSupportedTfNamed supported named transfer characteristic.
277+func (self *WpColorManagerV1) SendSupportedTfNamed(tf uint32) {
278+ self.PostEvent(WpColorManagerV1EventSupportedTfNamed, server.Uint(tf))
279+}
280+
281+// SendSupportedPrimariesNamed supported named primaries.
282+func (self *WpColorManagerV1) SendSupportedPrimariesNamed(primaries uint32) {
283+ self.PostEvent(WpColorManagerV1EventSupportedPrimariesNamed, server.Uint(primaries))
284+}
285+
286+// SendDone all features have been sent.
287+func (self *WpColorManagerV1) SendDone() {
288+ self.PostEvent(WpColorManagerV1EventDone)
289+}
290+func NewWpColorManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
291+ return d.CreateGlobal(WpColorManagerV1Interface, version, bind)
292+}
293+
294+// WpColorManagementOutputV1 output color properties.
295+type WpColorManagementOutputV1 struct{ *server.Resource }
296+
297+func WrapWpColorManagementOutputV1(r *server.Resource) *WpColorManagementOutputV1 {
298+ if r == nil {
299+ return nil
300+ }
301+ return &WpColorManagementOutputV1{r}
302+}
303+
304+const WpColorManagementOutputV1RequestDestroy uint32 = 0
305+const WpColorManagementOutputV1RequestGetImageDescription uint32 = 1
306+const WpColorManagementOutputV1EventImageDescriptionChanged uint32 = 0
307+
308+// WpColorManagementOutputV1Handler handles wp_color_management_output_v1 requests.
309+type WpColorManagementOutputV1Handler interface {
310+ Destroy(self *WpColorManagementOutputV1)
311+ GetImageDescription(self *WpColorManagementOutputV1, imageDescription uint32)
312+}
313+
314+func NewWpColorManagementOutputV1(c server.Client, version int32, id uint32, h WpColorManagementOutputV1Handler) (*WpColorManagementOutputV1, error) {
315+ if h == nil {
316+ return nil, fmt.Errorf("purego-libwayland: nil handler for wp_color_management_output_v1")
317+ }
318+ var self *WpColorManagementOutputV1
319+ r, err := c.CreateResource(WpColorManagementOutputV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
320+ switch opcode {
321+ case 0:
322+ h.Destroy(self)
323+ self.Destroy()
324+ case 1:
325+ h.GetImageDescription(self, args[0].NewID())
326+ }
327+ })
328+ if err != nil {
329+ return nil, err
330+ }
331+ self = WrapWpColorManagementOutputV1(r)
332+ r.Data = self
333+ return self, nil
334+}
335+
336+// SendImageDescriptionChanged image description changed.
337+func (self *WpColorManagementOutputV1) SendImageDescriptionChanged() {
338+ self.PostEvent(WpColorManagementOutputV1EventImageDescriptionChanged)
339+}
340+func NewWpColorManagementOutputV1Global(d *server.Display, version int32, bind server.BindFunc) error {
341+ return d.CreateGlobal(WpColorManagementOutputV1Interface, version, bind)
342+}
343+
344+// WpColorManagementSurfaceV1 color management extension to a surface.
345+type WpColorManagementSurfaceV1 struct{ *server.Resource }
346+
347+func WrapWpColorManagementSurfaceV1(r *server.Resource) *WpColorManagementSurfaceV1 {
348+ if r == nil {
349+ return nil
350+ }
351+ return &WpColorManagementSurfaceV1{r}
352+}
353+
354+const WpColorManagementSurfaceV1RequestDestroy uint32 = 0
355+const WpColorManagementSurfaceV1RequestSetImageDescription uint32 = 1
356+const WpColorManagementSurfaceV1RequestUnsetImageDescription uint32 = 2
357+
358+// WpColorManagementSurfaceV1Error protocol errors.
359+type WpColorManagementSurfaceV1Error uint32
360+
361+const (
362+ WpColorManagementSurfaceV1ErrorRenderIntent WpColorManagementSurfaceV1Error = 0
363+ WpColorManagementSurfaceV1ErrorImageDescription WpColorManagementSurfaceV1Error = 1
364+ WpColorManagementSurfaceV1ErrorInert WpColorManagementSurfaceV1Error = 2
365+)
366+
367+// WpColorManagementSurfaceV1Handler handles wp_color_management_surface_v1 requests.
368+type WpColorManagementSurfaceV1Handler interface {
369+ Destroy(self *WpColorManagementSurfaceV1)
370+ SetImageDescription(self *WpColorManagementSurfaceV1, imageDescription *WpImageDescriptionV1, renderIntent uint32)
371+ UnsetImageDescription(self *WpColorManagementSurfaceV1)
372+}
373+
374+func NewWpColorManagementSurfaceV1(c server.Client, version int32, id uint32, h WpColorManagementSurfaceV1Handler) (*WpColorManagementSurfaceV1, error) {
375+ if h == nil {
376+ return nil, fmt.Errorf("purego-libwayland: nil handler for wp_color_management_surface_v1")
377+ }
378+ var self *WpColorManagementSurfaceV1
379+ r, err := c.CreateResource(WpColorManagementSurfaceV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
380+ switch opcode {
381+ case 0:
382+ h.Destroy(self)
383+ self.Destroy()
384+ case 1:
385+ h.SetImageDescription(self, WrapWpImageDescriptionV1(args[0].Resource()), args[1].Uint())
386+ case 2:
387+ h.UnsetImageDescription(self)
388+ }
389+ })
390+ if err != nil {
391+ return nil, err
392+ }
393+ self = WrapWpColorManagementSurfaceV1(r)
394+ r.Data = self
395+ return self, nil
396+}
397+func NewWpColorManagementSurfaceV1Global(d *server.Display, version int32, bind server.BindFunc) error {
398+ return d.CreateGlobal(WpColorManagementSurfaceV1Interface, version, bind)
399+}
400+
401+// WpColorManagementSurfaceFeedbackV1 color management extension to a surface.
402+type WpColorManagementSurfaceFeedbackV1 struct{ *server.Resource }
403+
404+func WrapWpColorManagementSurfaceFeedbackV1(r *server.Resource) *WpColorManagementSurfaceFeedbackV1 {
405+ if r == nil {
406+ return nil
407+ }
408+ return &WpColorManagementSurfaceFeedbackV1{r}
409+}
410+
411+const WpColorManagementSurfaceFeedbackV1RequestDestroy uint32 = 0
412+const WpColorManagementSurfaceFeedbackV1RequestGetPreferred uint32 = 1
413+const WpColorManagementSurfaceFeedbackV1RequestGetPreferredParametric uint32 = 2
414+const WpColorManagementSurfaceFeedbackV1EventPreferredChanged uint32 = 0
415+const WpColorManagementSurfaceFeedbackV1EventPreferredChanged2 uint32 = 1
416+
417+// WpColorManagementSurfaceFeedbackV1Error protocol errors.
418+type WpColorManagementSurfaceFeedbackV1Error uint32
419+
420+const (
421+ WpColorManagementSurfaceFeedbackV1ErrorInert WpColorManagementSurfaceFeedbackV1Error = 0
422+ WpColorManagementSurfaceFeedbackV1ErrorUnsupportedFeature WpColorManagementSurfaceFeedbackV1Error = 1
423+)
424+
425+// WpColorManagementSurfaceFeedbackV1Handler handles wp_color_management_surface_feedback_v1 requests.
426+type WpColorManagementSurfaceFeedbackV1Handler interface {
427+ Destroy(self *WpColorManagementSurfaceFeedbackV1)
428+ GetPreferred(self *WpColorManagementSurfaceFeedbackV1, imageDescription uint32)
429+ GetPreferredParametric(self *WpColorManagementSurfaceFeedbackV1, imageDescription uint32)
430+}
431+
432+func NewWpColorManagementSurfaceFeedbackV1(c server.Client, version int32, id uint32, h WpColorManagementSurfaceFeedbackV1Handler) (*WpColorManagementSurfaceFeedbackV1, error) {
433+ if h == nil {
434+ return nil, fmt.Errorf("purego-libwayland: nil handler for wp_color_management_surface_feedback_v1")
435+ }
436+ var self *WpColorManagementSurfaceFeedbackV1
437+ r, err := c.CreateResource(WpColorManagementSurfaceFeedbackV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
438+ switch opcode {
439+ case 0:
440+ h.Destroy(self)
441+ self.Destroy()
442+ case 1:
443+ h.GetPreferred(self, args[0].NewID())
444+ case 2:
445+ h.GetPreferredParametric(self, args[0].NewID())
446+ }
447+ })
448+ if err != nil {
449+ return nil, err
450+ }
451+ self = WrapWpColorManagementSurfaceFeedbackV1(r)
452+ r.Data = self
453+ return self, nil
454+}
455+
456+// SendPreferredChanged the preferred image description changed (32-bit).
457+func (self *WpColorManagementSurfaceFeedbackV1) SendPreferredChanged(identity uint32) {
458+ self.PostEvent(WpColorManagementSurfaceFeedbackV1EventPreferredChanged, server.Uint(identity))
459+}
460+
461+// SendPreferredChanged2 the preferred image description changed (since version 2).
462+func (self *WpColorManagementSurfaceFeedbackV1) SendPreferredChanged2(identityHi uint32, identityLo uint32) {
463+ self.PostEvent(WpColorManagementSurfaceFeedbackV1EventPreferredChanged2, server.Uint(identityHi), server.Uint(identityLo))
464+}
465+func NewWpColorManagementSurfaceFeedbackV1Global(d *server.Display, version int32, bind server.BindFunc) error {
466+ return d.CreateGlobal(WpColorManagementSurfaceFeedbackV1Interface, version, bind)
467+}
468+
469+// WpImageDescriptionCreatorIccV1 holder of image description ICC information.
470+type WpImageDescriptionCreatorIccV1 struct{ *server.Resource }
471+
472+func WrapWpImageDescriptionCreatorIccV1(r *server.Resource) *WpImageDescriptionCreatorIccV1 {
473+ if r == nil {
474+ return nil
475+ }
476+ return &WpImageDescriptionCreatorIccV1{r}
477+}
478+
479+const WpImageDescriptionCreatorIccV1RequestCreate uint32 = 0
480+const WpImageDescriptionCreatorIccV1RequestSetIccFile uint32 = 1
481+
482+// WpImageDescriptionCreatorIccV1Error protocol errors.
483+type WpImageDescriptionCreatorIccV1Error uint32
484+
485+const (
486+ WpImageDescriptionCreatorIccV1ErrorIncompleteSet WpImageDescriptionCreatorIccV1Error = 0
487+ WpImageDescriptionCreatorIccV1ErrorAlreadySet WpImageDescriptionCreatorIccV1Error = 1
488+ WpImageDescriptionCreatorIccV1ErrorBadFd WpImageDescriptionCreatorIccV1Error = 2
489+ WpImageDescriptionCreatorIccV1ErrorBadSize WpImageDescriptionCreatorIccV1Error = 3
490+ WpImageDescriptionCreatorIccV1ErrorOutOfFile WpImageDescriptionCreatorIccV1Error = 4
491+)
492+
493+// WpImageDescriptionCreatorIccV1Handler handles wp_image_description_creator_icc_v1 requests.
494+type WpImageDescriptionCreatorIccV1Handler interface {
495+ Create(self *WpImageDescriptionCreatorIccV1, imageDescription uint32)
496+ SetIccFile(self *WpImageDescriptionCreatorIccV1, iccProfile int, offset uint32, length uint32)
497+}
498+
499+func NewWpImageDescriptionCreatorIccV1(c server.Client, version int32, id uint32, h WpImageDescriptionCreatorIccV1Handler) (*WpImageDescriptionCreatorIccV1, error) {
500+ if h == nil {
501+ return nil, fmt.Errorf("purego-libwayland: nil handler for wp_image_description_creator_icc_v1")
502+ }
503+ var self *WpImageDescriptionCreatorIccV1
504+ r, err := c.CreateResource(WpImageDescriptionCreatorIccV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
505+ switch opcode {
506+ case 0:
507+ h.Create(self, args[0].NewID())
508+ self.Destroy()
509+ case 1:
510+ h.SetIccFile(self, args[0].Fd(), args[1].Uint(), args[2].Uint())
511+ }
512+ })
513+ if err != nil {
514+ return nil, err
515+ }
516+ self = WrapWpImageDescriptionCreatorIccV1(r)
517+ r.Data = self
518+ return self, nil
519+}
520+func NewWpImageDescriptionCreatorIccV1Global(d *server.Display, version int32, bind server.BindFunc) error {
521+ return d.CreateGlobal(WpImageDescriptionCreatorIccV1Interface, version, bind)
522+}
523+
524+// WpImageDescriptionCreatorParamsV1 holder of image description parameters.
525+type WpImageDescriptionCreatorParamsV1 struct{ *server.Resource }
526+
527+func WrapWpImageDescriptionCreatorParamsV1(r *server.Resource) *WpImageDescriptionCreatorParamsV1 {
528+ if r == nil {
529+ return nil
530+ }
531+ return &WpImageDescriptionCreatorParamsV1{r}
532+}
533+
534+const WpImageDescriptionCreatorParamsV1RequestCreate uint32 = 0
535+const WpImageDescriptionCreatorParamsV1RequestSetTfNamed uint32 = 1
536+const WpImageDescriptionCreatorParamsV1RequestSetTfPower uint32 = 2
537+const WpImageDescriptionCreatorParamsV1RequestSetPrimariesNamed uint32 = 3
538+const WpImageDescriptionCreatorParamsV1RequestSetPrimaries uint32 = 4
539+const WpImageDescriptionCreatorParamsV1RequestSetLuminances uint32 = 5
540+const WpImageDescriptionCreatorParamsV1RequestSetMasteringDisplayPrimaries uint32 = 6
541+const WpImageDescriptionCreatorParamsV1RequestSetMasteringLuminance uint32 = 7
542+const WpImageDescriptionCreatorParamsV1RequestSetMaxCll uint32 = 8
543+const WpImageDescriptionCreatorParamsV1RequestSetMaxFall uint32 = 9
544+
545+// WpImageDescriptionCreatorParamsV1Error protocol errors.
546+type WpImageDescriptionCreatorParamsV1Error uint32
547+
548+const (
549+ WpImageDescriptionCreatorParamsV1ErrorIncompleteSet WpImageDescriptionCreatorParamsV1Error = 0
550+ WpImageDescriptionCreatorParamsV1ErrorAlreadySet WpImageDescriptionCreatorParamsV1Error = 1
551+ WpImageDescriptionCreatorParamsV1ErrorUnsupportedFeature WpImageDescriptionCreatorParamsV1Error = 2
552+ WpImageDescriptionCreatorParamsV1ErrorInvalidTf WpImageDescriptionCreatorParamsV1Error = 3
553+ WpImageDescriptionCreatorParamsV1ErrorInvalidPrimariesNamed WpImageDescriptionCreatorParamsV1Error = 4
554+ WpImageDescriptionCreatorParamsV1ErrorInvalidLuminance WpImageDescriptionCreatorParamsV1Error = 5
555+)
556+
557+// WpImageDescriptionCreatorParamsV1Handler handles wp_image_description_creator_params_v1 requests.
558+type WpImageDescriptionCreatorParamsV1Handler interface {
559+ Create(self *WpImageDescriptionCreatorParamsV1, imageDescription uint32)
560+ SetTfNamed(self *WpImageDescriptionCreatorParamsV1, tf uint32)
561+ SetTfPower(self *WpImageDescriptionCreatorParamsV1, eexp uint32)
562+ SetPrimariesNamed(self *WpImageDescriptionCreatorParamsV1, primaries uint32)
563+ SetPrimaries(self *WpImageDescriptionCreatorParamsV1, rX int32, rY int32, gX int32, gY int32, bX int32, bY int32, wX int32, wY int32)
564+ SetLuminances(self *WpImageDescriptionCreatorParamsV1, minLum uint32, maxLum uint32, referenceLum uint32)
565+ SetMasteringDisplayPrimaries(self *WpImageDescriptionCreatorParamsV1, rX int32, rY int32, gX int32, gY int32, bX int32, bY int32, wX int32, wY int32)
566+ SetMasteringLuminance(self *WpImageDescriptionCreatorParamsV1, minLum uint32, maxLum uint32)
567+ SetMaxCll(self *WpImageDescriptionCreatorParamsV1, maxCll uint32)
568+ SetMaxFall(self *WpImageDescriptionCreatorParamsV1, maxFall uint32)
569+}
570+
571+func NewWpImageDescriptionCreatorParamsV1(c server.Client, version int32, id uint32, h WpImageDescriptionCreatorParamsV1Handler) (*WpImageDescriptionCreatorParamsV1, error) {
572+ if h == nil {
573+ return nil, fmt.Errorf("purego-libwayland: nil handler for wp_image_description_creator_params_v1")
574+ }
575+ var self *WpImageDescriptionCreatorParamsV1
576+ r, err := c.CreateResource(WpImageDescriptionCreatorParamsV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
577+ switch opcode {
578+ case 0:
579+ h.Create(self, args[0].NewID())
580+ self.Destroy()
581+ case 1:
582+ h.SetTfNamed(self, args[0].Uint())
583+ case 2:
584+ h.SetTfPower(self, args[0].Uint())
585+ case 3:
586+ h.SetPrimariesNamed(self, args[0].Uint())
587+ case 4:
588+ h.SetPrimaries(self, args[0].Int(), args[1].Int(), args[2].Int(), args[3].Int(), args[4].Int(), args[5].Int(), args[6].Int(), args[7].Int())
589+ case 5:
590+ h.SetLuminances(self, args[0].Uint(), args[1].Uint(), args[2].Uint())
591+ case 6:
592+ h.SetMasteringDisplayPrimaries(self, args[0].Int(), args[1].Int(), args[2].Int(), args[3].Int(), args[4].Int(), args[5].Int(), args[6].Int(), args[7].Int())
593+ case 7:
594+ h.SetMasteringLuminance(self, args[0].Uint(), args[1].Uint())
595+ case 8:
596+ h.SetMaxCll(self, args[0].Uint())
597+ case 9:
598+ h.SetMaxFall(self, args[0].Uint())
599+ }
600+ })
601+ if err != nil {
602+ return nil, err
603+ }
604+ self = WrapWpImageDescriptionCreatorParamsV1(r)
605+ r.Data = self
606+ return self, nil
607+}
608+func NewWpImageDescriptionCreatorParamsV1Global(d *server.Display, version int32, bind server.BindFunc) error {
609+ return d.CreateGlobal(WpImageDescriptionCreatorParamsV1Interface, version, bind)
610+}
611+
612+// WpImageDescriptionV1 Colorimetric image description.
613+type WpImageDescriptionV1 struct{ *server.Resource }
614+
615+func WrapWpImageDescriptionV1(r *server.Resource) *WpImageDescriptionV1 {
616+ if r == nil {
617+ return nil
618+ }
619+ return &WpImageDescriptionV1{r}
620+}
621+
622+const WpImageDescriptionV1RequestDestroy uint32 = 0
623+const WpImageDescriptionV1RequestGetInformation uint32 = 1
624+const WpImageDescriptionV1EventFailed uint32 = 0
625+const WpImageDescriptionV1EventReady uint32 = 1
626+const WpImageDescriptionV1EventReady2 uint32 = 2
627+
628+// WpImageDescriptionV1Error protocol errors.
629+type WpImageDescriptionV1Error uint32
630+
631+const (
632+ WpImageDescriptionV1ErrorNotReady WpImageDescriptionV1Error = 0
633+ WpImageDescriptionV1ErrorNoInformation WpImageDescriptionV1Error = 1
634+)
635+
636+// WpImageDescriptionV1Cause generic reason for failure.
637+type WpImageDescriptionV1Cause uint32
638+
639+const (
640+ WpImageDescriptionV1CauseLowVersion WpImageDescriptionV1Cause = 0
641+ WpImageDescriptionV1CauseUnsupported WpImageDescriptionV1Cause = 1
642+ WpImageDescriptionV1CauseOperatingSystem WpImageDescriptionV1Cause = 2
643+ WpImageDescriptionV1CauseNoOutput WpImageDescriptionV1Cause = 3
644+)
645+
646+// WpImageDescriptionV1Handler handles wp_image_description_v1 requests.
647+type WpImageDescriptionV1Handler interface {
648+ Destroy(self *WpImageDescriptionV1)
649+ GetInformation(self *WpImageDescriptionV1, information uint32)
650+}
651+
652+func NewWpImageDescriptionV1(c server.Client, version int32, id uint32, h WpImageDescriptionV1Handler) (*WpImageDescriptionV1, error) {
653+ if h == nil {
654+ return nil, fmt.Errorf("purego-libwayland: nil handler for wp_image_description_v1")
655+ }
656+ var self *WpImageDescriptionV1
657+ r, err := c.CreateResource(WpImageDescriptionV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
658+ switch opcode {
659+ case 0:
660+ h.Destroy(self)
661+ self.Destroy()
662+ case 1:
663+ h.GetInformation(self, args[0].NewID())
664+ }
665+ })
666+ if err != nil {
667+ return nil, err
668+ }
669+ self = WrapWpImageDescriptionV1(r)
670+ r.Data = self
671+ return self, nil
672+}
673+
674+// SendFailed graceful error on creating the image description.
675+func (self *WpImageDescriptionV1) SendFailed(cause uint32, msg string) {
676+ var p runtime.Pinner
677+ defer p.Unpin()
678+ self.PostEvent(WpImageDescriptionV1EventFailed, server.Uint(cause), server.String(&p, msg, false))
679+}
680+
681+// SendReady the object is ready to be used (32-bit).
682+func (self *WpImageDescriptionV1) SendReady(identity uint32) {
683+ self.PostEvent(WpImageDescriptionV1EventReady, server.Uint(identity))
684+}
685+
686+// SendReady2 the object is ready to be used (since version 2).
687+func (self *WpImageDescriptionV1) SendReady2(identityHi uint32, identityLo uint32) {
688+ self.PostEvent(WpImageDescriptionV1EventReady2, server.Uint(identityHi), server.Uint(identityLo))
689+}
690+func NewWpImageDescriptionV1Global(d *server.Display, version int32, bind server.BindFunc) error {
691+ return d.CreateGlobal(WpImageDescriptionV1Interface, version, bind)
692+}
693+
694+// WpImageDescriptionInfoV1 Colorimetric image description information.
695+type WpImageDescriptionInfoV1 struct{ *server.Resource }
696+
697+func WrapWpImageDescriptionInfoV1(r *server.Resource) *WpImageDescriptionInfoV1 {
698+ if r == nil {
699+ return nil
700+ }
701+ return &WpImageDescriptionInfoV1{r}
702+}
703+
704+const WpImageDescriptionInfoV1EventDone uint32 = 0
705+const WpImageDescriptionInfoV1EventIccFile uint32 = 1
706+const WpImageDescriptionInfoV1EventPrimaries uint32 = 2
707+const WpImageDescriptionInfoV1EventPrimariesNamed uint32 = 3
708+const WpImageDescriptionInfoV1EventTfPower uint32 = 4
709+const WpImageDescriptionInfoV1EventTfNamed uint32 = 5
710+const WpImageDescriptionInfoV1EventLuminances uint32 = 6
711+const WpImageDescriptionInfoV1EventTargetPrimaries uint32 = 7
712+const WpImageDescriptionInfoV1EventTargetLuminance uint32 = 8
713+const WpImageDescriptionInfoV1EventTargetMaxCll uint32 = 9
714+const WpImageDescriptionInfoV1EventTargetMaxFall uint32 = 10
715+
716+// WpImageDescriptionInfoV1Handler handles wp_image_description_info_v1 requests.
717+type WpImageDescriptionInfoV1Handler interface {
718+}
719+
720+func NewWpImageDescriptionInfoV1(c server.Client, version int32, id uint32, h WpImageDescriptionInfoV1Handler) (*WpImageDescriptionInfoV1, error) {
721+ var self *WpImageDescriptionInfoV1
722+ r, err := c.CreateResource(WpImageDescriptionInfoV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
723+ switch opcode {
724+ }
725+ })
726+ if err != nil {
727+ return nil, err
728+ }
729+ self = WrapWpImageDescriptionInfoV1(r)
730+ r.Data = self
731+ return self, nil
732+}
733+
734+// SendDone end of information.
735+func (self *WpImageDescriptionInfoV1) SendDone() {
736+ self.PostEvent(WpImageDescriptionInfoV1EventDone)
737+}
738+
739+// SendIccFile ICC profile matching the image description.
740+func (self *WpImageDescriptionInfoV1) SendIccFile(icc int, iccSize uint32) {
741+ self.PostEvent(WpImageDescriptionInfoV1EventIccFile, server.Fd(icc), server.Uint(iccSize))
742+}
743+
744+// SendPrimaries primaries as chromaticity coordinates.
745+func (self *WpImageDescriptionInfoV1) SendPrimaries(rX int32, rY int32, gX int32, gY int32, bX int32, bY int32, wX int32, wY int32) {
746+ self.PostEvent(WpImageDescriptionInfoV1EventPrimaries, server.Int(rX), server.Int(rY), server.Int(gX), server.Int(gY), server.Int(bX), server.Int(bY), server.Int(wX), server.Int(wY))
747+}
748+
749+// SendPrimariesNamed named primaries.
750+func (self *WpImageDescriptionInfoV1) SendPrimariesNamed(primaries uint32) {
751+ self.PostEvent(WpImageDescriptionInfoV1EventPrimariesNamed, server.Uint(primaries))
752+}
753+
754+// SendTfPower transfer characteristic as a power curve.
755+func (self *WpImageDescriptionInfoV1) SendTfPower(eexp uint32) {
756+ self.PostEvent(WpImageDescriptionInfoV1EventTfPower, server.Uint(eexp))
757+}
758+
759+// SendTfNamed named transfer characteristic.
760+func (self *WpImageDescriptionInfoV1) SendTfNamed(tf uint32) {
761+ self.PostEvent(WpImageDescriptionInfoV1EventTfNamed, server.Uint(tf))
762+}
763+
764+// SendLuminances primary color volume luminance range and reference white.
765+func (self *WpImageDescriptionInfoV1) SendLuminances(minLum uint32, maxLum uint32, referenceLum uint32) {
766+ self.PostEvent(WpImageDescriptionInfoV1EventLuminances, server.Uint(minLum), server.Uint(maxLum), server.Uint(referenceLum))
767+}
768+
769+// SendTargetPrimaries target primaries as chromaticity coordinates.
770+func (self *WpImageDescriptionInfoV1) SendTargetPrimaries(rX int32, rY int32, gX int32, gY int32, bX int32, bY int32, wX int32, wY int32) {
771+ self.PostEvent(WpImageDescriptionInfoV1EventTargetPrimaries, server.Int(rX), server.Int(rY), server.Int(gX), server.Int(gY), server.Int(bX), server.Int(bY), server.Int(wX), server.Int(wY))
772+}
773+
774+// SendTargetLuminance target luminance range.
775+func (self *WpImageDescriptionInfoV1) SendTargetLuminance(minLum uint32, maxLum uint32) {
776+ self.PostEvent(WpImageDescriptionInfoV1EventTargetLuminance, server.Uint(minLum), server.Uint(maxLum))
777+}
778+
779+// SendTargetMaxCll target maximum content light level.
780+func (self *WpImageDescriptionInfoV1) SendTargetMaxCll(maxCll uint32) {
781+ self.PostEvent(WpImageDescriptionInfoV1EventTargetMaxCll, server.Uint(maxCll))
782+}
783+
784+// SendTargetMaxFall target maximum frame-average light level.
785+func (self *WpImageDescriptionInfoV1) SendTargetMaxFall(maxFall uint32) {
786+ self.PostEvent(WpImageDescriptionInfoV1EventTargetMaxFall, server.Uint(maxFall))
787+}
788+func NewWpImageDescriptionInfoV1Global(d *server.Display, version int32, bind server.BindFunc) error {
789+ return d.CreateGlobal(WpImageDescriptionInfoV1Interface, version, bind)
790+}
791+
792+// WpImageDescriptionReferenceV1 Reference to an image description.
793+type WpImageDescriptionReferenceV1 struct{ *server.Resource }
794+
795+func WrapWpImageDescriptionReferenceV1(r *server.Resource) *WpImageDescriptionReferenceV1 {
796+ if r == nil {
797+ return nil
798+ }
799+ return &WpImageDescriptionReferenceV1{r}
800+}
801+
802+const WpImageDescriptionReferenceV1RequestDestroy uint32 = 0
803+
804+// WpImageDescriptionReferenceV1Handler handles wp_image_description_reference_v1 requests.
805+type WpImageDescriptionReferenceV1Handler interface {
806+ Destroy(self *WpImageDescriptionReferenceV1)
807+}
808+
809+func NewWpImageDescriptionReferenceV1(c server.Client, version int32, id uint32, h WpImageDescriptionReferenceV1Handler) (*WpImageDescriptionReferenceV1, error) {
810+ if h == nil {
811+ return nil, fmt.Errorf("purego-libwayland: nil handler for wp_image_description_reference_v1")
812+ }
813+ var self *WpImageDescriptionReferenceV1
814+ r, err := c.CreateResource(WpImageDescriptionReferenceV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
815+ switch opcode {
816+ case 0:
817+ h.Destroy(self)
818+ self.Destroy()
819+ }
820+ })
821+ if err != nil {
822+ return nil, err
823+ }
824+ self = WrapWpImageDescriptionReferenceV1(r)
825+ r.Data = self
826+ return self, nil
827+}
828+func NewWpImageDescriptionReferenceV1Global(d *server.Display, version int32, bind server.BindFunc) error {
829+ return d.CreateGlobal(WpImageDescriptionReferenceV1Interface, version, bind)
830+}
831+func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
832+ if v == nil {
833+ return nil
834+ }
835+ return v.GetResource()
836+}
837+func (self *WpColorManagerV1) GetResource() *server.Resource {
838+ if self == nil {
839+ return nil
840+ }
841+ return self.Resource
842+}
843+func (self *WpColorManagementOutputV1) GetResource() *server.Resource {
844+ if self == nil {
845+ return nil
846+ }
847+ return self.Resource
848+}
849+func (self *WpColorManagementSurfaceV1) GetResource() *server.Resource {
850+ if self == nil {
851+ return nil
852+ }
853+ return self.Resource
854+}
855+func (self *WpColorManagementSurfaceFeedbackV1) GetResource() *server.Resource {
856+ if self == nil {
857+ return nil
858+ }
859+ return self.Resource
860+}
861+func (self *WpImageDescriptionCreatorIccV1) GetResource() *server.Resource {
862+ if self == nil {
863+ return nil
864+ }
865+ return self.Resource
866+}
867+func (self *WpImageDescriptionCreatorParamsV1) GetResource() *server.Resource {
868+ if self == nil {
869+ return nil
870+ }
871+ return self.Resource
872+}
873+func (self *WpImageDescriptionV1) GetResource() *server.Resource {
874+ if self == nil {
875+ return nil
876+ }
877+ return self.Resource
878+}
879+func (self *WpImageDescriptionInfoV1) GetResource() *server.Resource {
880+ if self == nil {
881+ return nil
882+ }
883+ return self.Resource
884+}
885+func (self *WpImageDescriptionReferenceV1) GetResource() *server.Resource {
886+ if self == nil {
887+ return nil
888+ }
889+ return self.Resource
890+}
A protocol/colorrepresentation/colorrepresentation.go +228 -0
@@ -0,0 +1,228 @@
1+// Code generated by wlgen; DO NOT EDIT.
2+package colorrepresentation
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 WpColorRepresentationManagerV1Interface *server.Interface
11+var WpColorRepresentationSurfaceV1Interface *server.Interface
12+
13+func init() {
14+ WpColorRepresentationManagerV1Interface = &server.Interface{Name: "wp_color_representation_manager_v1", Version: 1}
15+ WpColorRepresentationSurfaceV1Interface = &server.Interface{Name: "wp_color_representation_surface_v1", Version: 1}
16+ WpColorRepresentationManagerV1Interface.Requests = []server.Message{
17+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
18+ {Name: "get_surface", Signature: "no", Types: []*server.Interface{WpColorRepresentationSurfaceV1Interface, wayland.SurfaceInterface}},
19+ }
20+ WpColorRepresentationManagerV1Interface.Events = []server.Message{
21+ {Name: "supported_alpha_mode", Signature: "u", Types: []*server.Interface{nil}},
22+ {Name: "supported_coefficients_and_ranges", Signature: "uu", Types: []*server.Interface{nil, nil}},
23+ {Name: "done", Signature: "", Types: []*server.Interface{}},
24+ }
25+ WpColorRepresentationSurfaceV1Interface.Requests = []server.Message{
26+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
27+ {Name: "set_alpha_mode", Signature: "u", Types: []*server.Interface{nil}},
28+ {Name: "set_coefficients_and_range", Signature: "uu", Types: []*server.Interface{nil, nil}},
29+ {Name: "set_chroma_location", Signature: "u", Types: []*server.Interface{nil}},
30+ }
31+ WpColorRepresentationSurfaceV1Interface.Events = []server.Message{}
32+ if err := server.NewInterfaces(WpColorRepresentationManagerV1Interface, WpColorRepresentationSurfaceV1Interface); err != nil {
33+ panic(err)
34+ }
35+}
36+
37+// WpColorRepresentationManagerV1 color representation manager singleton.
38+type WpColorRepresentationManagerV1 struct{ *server.Resource }
39+
40+func WrapWpColorRepresentationManagerV1(r *server.Resource) *WpColorRepresentationManagerV1 {
41+ if r == nil {
42+ return nil
43+ }
44+ return &WpColorRepresentationManagerV1{r}
45+}
46+
47+const WpColorRepresentationManagerV1RequestDestroy uint32 = 0
48+const WpColorRepresentationManagerV1RequestGetSurface uint32 = 1
49+const WpColorRepresentationManagerV1EventSupportedAlphaMode uint32 = 0
50+const WpColorRepresentationManagerV1EventSupportedCoefficientsAndRanges uint32 = 1
51+const WpColorRepresentationManagerV1EventDone uint32 = 2
52+
53+// WpColorRepresentationManagerV1Error protocol errors.
54+type WpColorRepresentationManagerV1Error uint32
55+
56+const (
57+ WpColorRepresentationManagerV1ErrorSurfaceExists WpColorRepresentationManagerV1Error = 1
58+)
59+
60+// WpColorRepresentationManagerV1Handler handles wp_color_representation_manager_v1 requests.
61+type WpColorRepresentationManagerV1Handler interface {
62+ Destroy(self *WpColorRepresentationManagerV1)
63+ GetSurface(self *WpColorRepresentationManagerV1, id uint32, surface *wayland.Surface)
64+}
65+
66+func NewWpColorRepresentationManagerV1(c server.Client, version int32, id uint32, h WpColorRepresentationManagerV1Handler) (*WpColorRepresentationManagerV1, error) {
67+ if h == nil {
68+ return nil, fmt.Errorf("purego-libwayland: nil handler for wp_color_representation_manager_v1")
69+ }
70+ var self *WpColorRepresentationManagerV1
71+ r, err := c.CreateResource(WpColorRepresentationManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
72+ switch opcode {
73+ case 0:
74+ h.Destroy(self)
75+ self.Destroy()
76+ case 1:
77+ h.GetSurface(self, args[0].NewID(), wayland.WrapSurface(args[1].Resource()))
78+ }
79+ })
80+ if err != nil {
81+ return nil, err
82+ }
83+ self = WrapWpColorRepresentationManagerV1(r)
84+ r.Data = self
85+ return self, nil
86+}
87+
88+// SendSupportedAlphaMode supported alpha modes.
89+func (self *WpColorRepresentationManagerV1) SendSupportedAlphaMode(alphaMode uint32) {
90+ self.PostEvent(WpColorRepresentationManagerV1EventSupportedAlphaMode, server.Uint(alphaMode))
91+}
92+
93+// SendSupportedCoefficientsAndRanges supported matrix coefficients and ranges.
94+func (self *WpColorRepresentationManagerV1) SendSupportedCoefficientsAndRanges(coefficients uint32, rangeArg uint32) {
95+ self.PostEvent(WpColorRepresentationManagerV1EventSupportedCoefficientsAndRanges, server.Uint(coefficients), server.Uint(rangeArg))
96+}
97+
98+// SendDone all features have been sent.
99+func (self *WpColorRepresentationManagerV1) SendDone() {
100+ self.PostEvent(WpColorRepresentationManagerV1EventDone)
101+}
102+func NewWpColorRepresentationManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
103+ return d.CreateGlobal(WpColorRepresentationManagerV1Interface, version, bind)
104+}
105+
106+// WpColorRepresentationSurfaceV1 color representation extension to a surface.
107+type WpColorRepresentationSurfaceV1 struct{ *server.Resource }
108+
109+func WrapWpColorRepresentationSurfaceV1(r *server.Resource) *WpColorRepresentationSurfaceV1 {
110+ if r == nil {
111+ return nil
112+ }
113+ return &WpColorRepresentationSurfaceV1{r}
114+}
115+
116+const WpColorRepresentationSurfaceV1RequestDestroy uint32 = 0
117+const WpColorRepresentationSurfaceV1RequestSetAlphaMode uint32 = 1
118+const WpColorRepresentationSurfaceV1RequestSetCoefficientsAndRange uint32 = 2
119+const WpColorRepresentationSurfaceV1RequestSetChromaLocation uint32 = 3
120+
121+// WpColorRepresentationSurfaceV1Error protocol errors.
122+type WpColorRepresentationSurfaceV1Error uint32
123+
124+const (
125+ WpColorRepresentationSurfaceV1ErrorAlphaMode WpColorRepresentationSurfaceV1Error = 1
126+ WpColorRepresentationSurfaceV1ErrorCoefficients WpColorRepresentationSurfaceV1Error = 2
127+ WpColorRepresentationSurfaceV1ErrorPixelFormat WpColorRepresentationSurfaceV1Error = 3
128+ WpColorRepresentationSurfaceV1ErrorInert WpColorRepresentationSurfaceV1Error = 4
129+ WpColorRepresentationSurfaceV1ErrorChromaLocation WpColorRepresentationSurfaceV1Error = 5
130+)
131+
132+// WpColorRepresentationSurfaceV1AlphaMode alpha mode.
133+type WpColorRepresentationSurfaceV1AlphaMode uint32
134+
135+const (
136+ WpColorRepresentationSurfaceV1AlphaModePremultipliedElectrical WpColorRepresentationSurfaceV1AlphaMode = 0
137+ WpColorRepresentationSurfaceV1AlphaModePremultipliedOptical WpColorRepresentationSurfaceV1AlphaMode = 1
138+ WpColorRepresentationSurfaceV1AlphaModeStraight WpColorRepresentationSurfaceV1AlphaMode = 2
139+)
140+
141+// WpColorRepresentationSurfaceV1Coefficients named coefficients.
142+type WpColorRepresentationSurfaceV1Coefficients uint32
143+
144+const (
145+ WpColorRepresentationSurfaceV1CoefficientsIdentity WpColorRepresentationSurfaceV1Coefficients = 1
146+ WpColorRepresentationSurfaceV1CoefficientsBt709 WpColorRepresentationSurfaceV1Coefficients = 2
147+ WpColorRepresentationSurfaceV1CoefficientsFcc WpColorRepresentationSurfaceV1Coefficients = 3
148+ WpColorRepresentationSurfaceV1CoefficientsBt601 WpColorRepresentationSurfaceV1Coefficients = 4
149+ WpColorRepresentationSurfaceV1CoefficientsSmpte240 WpColorRepresentationSurfaceV1Coefficients = 5
150+ WpColorRepresentationSurfaceV1CoefficientsBt2020 WpColorRepresentationSurfaceV1Coefficients = 6
151+ WpColorRepresentationSurfaceV1CoefficientsBt2020Cl WpColorRepresentationSurfaceV1Coefficients = 7
152+ WpColorRepresentationSurfaceV1CoefficientsIctcp WpColorRepresentationSurfaceV1Coefficients = 8
153+)
154+
155+// WpColorRepresentationSurfaceV1Range Color range values.
156+type WpColorRepresentationSurfaceV1Range uint32
157+
158+const (
159+ WpColorRepresentationSurfaceV1RangeFull WpColorRepresentationSurfaceV1Range = 1
160+ WpColorRepresentationSurfaceV1RangeLimited WpColorRepresentationSurfaceV1Range = 2
161+)
162+
163+// WpColorRepresentationSurfaceV1ChromaLocation Chroma sample location for 4:2:0 YCbCr.
164+type WpColorRepresentationSurfaceV1ChromaLocation uint32
165+
166+const (
167+ WpColorRepresentationSurfaceV1ChromaLocationType0 WpColorRepresentationSurfaceV1ChromaLocation = 1
168+ WpColorRepresentationSurfaceV1ChromaLocationType1 WpColorRepresentationSurfaceV1ChromaLocation = 2
169+ WpColorRepresentationSurfaceV1ChromaLocationType2 WpColorRepresentationSurfaceV1ChromaLocation = 3
170+ WpColorRepresentationSurfaceV1ChromaLocationType3 WpColorRepresentationSurfaceV1ChromaLocation = 4
171+ WpColorRepresentationSurfaceV1ChromaLocationType4 WpColorRepresentationSurfaceV1ChromaLocation = 5
172+ WpColorRepresentationSurfaceV1ChromaLocationType5 WpColorRepresentationSurfaceV1ChromaLocation = 6
173+)
174+
175+// WpColorRepresentationSurfaceV1Handler handles wp_color_representation_surface_v1 requests.
176+type WpColorRepresentationSurfaceV1Handler interface {
177+ Destroy(self *WpColorRepresentationSurfaceV1)
178+ SetAlphaMode(self *WpColorRepresentationSurfaceV1, alphaMode uint32)
179+ SetCoefficientsAndRange(self *WpColorRepresentationSurfaceV1, coefficients uint32, rangeArg uint32)
180+ SetChromaLocation(self *WpColorRepresentationSurfaceV1, chromaLocation uint32)
181+}
182+
183+func NewWpColorRepresentationSurfaceV1(c server.Client, version int32, id uint32, h WpColorRepresentationSurfaceV1Handler) (*WpColorRepresentationSurfaceV1, error) {
184+ if h == nil {
185+ return nil, fmt.Errorf("purego-libwayland: nil handler for wp_color_representation_surface_v1")
186+ }
187+ var self *WpColorRepresentationSurfaceV1
188+ r, err := c.CreateResource(WpColorRepresentationSurfaceV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
189+ switch opcode {
190+ case 0:
191+ h.Destroy(self)
192+ self.Destroy()
193+ case 1:
194+ h.SetAlphaMode(self, args[0].Uint())
195+ case 2:
196+ h.SetCoefficientsAndRange(self, args[0].Uint(), args[1].Uint())
197+ case 3:
198+ h.SetChromaLocation(self, args[0].Uint())
199+ }
200+ })
201+ if err != nil {
202+ return nil, err
203+ }
204+ self = WrapWpColorRepresentationSurfaceV1(r)
205+ r.Data = self
206+ return self, nil
207+}
208+func NewWpColorRepresentationSurfaceV1Global(d *server.Display, version int32, bind server.BindFunc) error {
209+ return d.CreateGlobal(WpColorRepresentationSurfaceV1Interface, version, bind)
210+}
211+func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
212+ if v == nil {
213+ return nil
214+ }
215+ return v.GetResource()
216+}
217+func (self *WpColorRepresentationManagerV1) GetResource() *server.Resource {
218+ if self == nil {
219+ return nil
220+ }
221+ return self.Resource
222+}
223+func (self *WpColorRepresentationSurfaceV1) GetResource() *server.Resource {
224+ if self == nil {
225+ return nil
226+ }
227+ return self.Resource
228+}
A protocol/drmlease/drmlease.go +331 -0
@@ -0,0 +1,331 @@
1+// Code generated by wlgen; DO NOT EDIT.
2+package drmlease
3+
4+import (
5+ "fmt"
6+ "github.com/bnema/purego-libwayland/server"
7+ "runtime"
8+)
9+
10+var WpDrmLeaseDeviceV1Interface *server.Interface
11+var WpDrmLeaseConnectorV1Interface *server.Interface
12+var WpDrmLeaseRequestV1Interface *server.Interface
13+var WpDrmLeaseV1Interface *server.Interface
14+
15+func init() {
16+ WpDrmLeaseDeviceV1Interface = &server.Interface{Name: "wp_drm_lease_device_v1", Version: 1}
17+ WpDrmLeaseConnectorV1Interface = &server.Interface{Name: "wp_drm_lease_connector_v1", Version: 1}
18+ WpDrmLeaseRequestV1Interface = &server.Interface{Name: "wp_drm_lease_request_v1", Version: 1}
19+ WpDrmLeaseV1Interface = &server.Interface{Name: "wp_drm_lease_v1", Version: 1}
20+ WpDrmLeaseDeviceV1Interface.Requests = []server.Message{
21+ {Name: "create_lease_request", Signature: "n", Types: []*server.Interface{WpDrmLeaseRequestV1Interface}},
22+ {Name: "release", Signature: "", Types: []*server.Interface{}},
23+ }
24+ WpDrmLeaseDeviceV1Interface.Events = []server.Message{
25+ {Name: "drm_fd", Signature: "h", Types: []*server.Interface{nil}},
26+ {Name: "connector", Signature: "n", Types: []*server.Interface{WpDrmLeaseConnectorV1Interface}},
27+ {Name: "done", Signature: "", Types: []*server.Interface{}},
28+ {Name: "released", Signature: "", Types: []*server.Interface{}},
29+ }
30+ WpDrmLeaseConnectorV1Interface.Requests = []server.Message{
31+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
32+ }
33+ WpDrmLeaseConnectorV1Interface.Events = []server.Message{
34+ {Name: "name", Signature: "s", Types: []*server.Interface{nil}},
35+ {Name: "description", Signature: "s", Types: []*server.Interface{nil}},
36+ {Name: "connector_id", Signature: "u", Types: []*server.Interface{nil}},
37+ {Name: "done", Signature: "", Types: []*server.Interface{}},
38+ {Name: "withdrawn", Signature: "", Types: []*server.Interface{}},
39+ }
40+ WpDrmLeaseRequestV1Interface.Requests = []server.Message{
41+ {Name: "request_connector", Signature: "o", Types: []*server.Interface{WpDrmLeaseConnectorV1Interface}},
42+ {Name: "submit", Signature: "n", Types: []*server.Interface{WpDrmLeaseV1Interface}},
43+ }
44+ WpDrmLeaseRequestV1Interface.Events = []server.Message{}
45+ WpDrmLeaseV1Interface.Requests = []server.Message{
46+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
47+ }
48+ WpDrmLeaseV1Interface.Events = []server.Message{
49+ {Name: "lease_fd", Signature: "h", Types: []*server.Interface{nil}},
50+ {Name: "finished", Signature: "", Types: []*server.Interface{}},
51+ }
52+ if err := server.NewInterfaces(WpDrmLeaseDeviceV1Interface, WpDrmLeaseConnectorV1Interface, WpDrmLeaseRequestV1Interface, WpDrmLeaseV1Interface); err != nil {
53+ panic(err)
54+ }
55+}
56+
57+// WpDrmLeaseDeviceV1 lease device.
58+type WpDrmLeaseDeviceV1 struct{ *server.Resource }
59+
60+func WrapWpDrmLeaseDeviceV1(r *server.Resource) *WpDrmLeaseDeviceV1 {
61+ if r == nil {
62+ return nil
63+ }
64+ return &WpDrmLeaseDeviceV1{r}
65+}
66+
67+const WpDrmLeaseDeviceV1RequestCreateLeaseRequest uint32 = 0
68+const WpDrmLeaseDeviceV1RequestRelease uint32 = 1
69+const WpDrmLeaseDeviceV1EventDrmFd uint32 = 0
70+const WpDrmLeaseDeviceV1EventConnector uint32 = 1
71+const WpDrmLeaseDeviceV1EventDone uint32 = 2
72+const WpDrmLeaseDeviceV1EventReleased uint32 = 3
73+
74+// WpDrmLeaseDeviceV1Handler handles wp_drm_lease_device_v1 requests.
75+type WpDrmLeaseDeviceV1Handler interface {
76+ CreateLeaseRequest(self *WpDrmLeaseDeviceV1, id uint32)
77+ Release(self *WpDrmLeaseDeviceV1)
78+}
79+
80+func NewWpDrmLeaseDeviceV1(c server.Client, version int32, id uint32, h WpDrmLeaseDeviceV1Handler) (*WpDrmLeaseDeviceV1, error) {
81+ if h == nil {
82+ return nil, fmt.Errorf("purego-libwayland: nil handler for wp_drm_lease_device_v1")
83+ }
84+ var self *WpDrmLeaseDeviceV1
85+ r, err := c.CreateResource(WpDrmLeaseDeviceV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
86+ switch opcode {
87+ case 0:
88+ h.CreateLeaseRequest(self, args[0].NewID())
89+ case 1:
90+ h.Release(self)
91+ }
92+ })
93+ if err != nil {
94+ return nil, err
95+ }
96+ self = WrapWpDrmLeaseDeviceV1(r)
97+ r.Data = self
98+ return self, nil
99+}
100+
101+// SendDrmFd open a non-master fd for this DRM node.
102+func (self *WpDrmLeaseDeviceV1) SendDrmFd(fd int) {
103+ self.PostEvent(WpDrmLeaseDeviceV1EventDrmFd, server.Fd(fd))
104+}
105+
106+// SendConnector advertise connectors available for leases.
107+func (self *WpDrmLeaseDeviceV1) SendConnector(id *WpDrmLeaseConnectorV1) {
108+ self.PostEvent(WpDrmLeaseDeviceV1EventConnector, server.NewID(resourceOf(id)))
109+}
110+
111+// SendDone signals grouping of connectors.
112+func (self *WpDrmLeaseDeviceV1) SendDone() {
113+ self.PostEvent(WpDrmLeaseDeviceV1EventDone)
114+}
115+
116+// SendReleased the compositor has finished using the device.
117+func (self *WpDrmLeaseDeviceV1) SendReleased() {
118+ self.PostEvent(WpDrmLeaseDeviceV1EventReleased)
119+}
120+func NewWpDrmLeaseDeviceV1Global(d *server.Display, version int32, bind server.BindFunc) error {
121+ return d.CreateGlobal(WpDrmLeaseDeviceV1Interface, version, bind)
122+}
123+
124+// WpDrmLeaseConnectorV1 a leasable DRM connector.
125+type WpDrmLeaseConnectorV1 struct{ *server.Resource }
126+
127+func WrapWpDrmLeaseConnectorV1(r *server.Resource) *WpDrmLeaseConnectorV1 {
128+ if r == nil {
129+ return nil
130+ }
131+ return &WpDrmLeaseConnectorV1{r}
132+}
133+
134+const WpDrmLeaseConnectorV1RequestDestroy uint32 = 0
135+const WpDrmLeaseConnectorV1EventName uint32 = 0
136+const WpDrmLeaseConnectorV1EventDescription uint32 = 1
137+const WpDrmLeaseConnectorV1EventConnectorId uint32 = 2
138+const WpDrmLeaseConnectorV1EventDone uint32 = 3
139+const WpDrmLeaseConnectorV1EventWithdrawn uint32 = 4
140+
141+// WpDrmLeaseConnectorV1Handler handles wp_drm_lease_connector_v1 requests.
142+type WpDrmLeaseConnectorV1Handler interface {
143+ Destroy(self *WpDrmLeaseConnectorV1)
144+}
145+
146+func NewWpDrmLeaseConnectorV1(c server.Client, version int32, id uint32, h WpDrmLeaseConnectorV1Handler) (*WpDrmLeaseConnectorV1, error) {
147+ if h == nil {
148+ return nil, fmt.Errorf("purego-libwayland: nil handler for wp_drm_lease_connector_v1")
149+ }
150+ var self *WpDrmLeaseConnectorV1
151+ r, err := c.CreateResource(WpDrmLeaseConnectorV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
152+ switch opcode {
153+ case 0:
154+ h.Destroy(self)
155+ self.Destroy()
156+ }
157+ })
158+ if err != nil {
159+ return nil, err
160+ }
161+ self = WrapWpDrmLeaseConnectorV1(r)
162+ r.Data = self
163+ return self, nil
164+}
165+
166+// SendName name.
167+func (self *WpDrmLeaseConnectorV1) SendName(name string) {
168+ var p runtime.Pinner
169+ defer p.Unpin()
170+ self.PostEvent(WpDrmLeaseConnectorV1EventName, server.String(&p, name, false))
171+}
172+
173+// SendDescription description.
174+func (self *WpDrmLeaseConnectorV1) SendDescription(description string) {
175+ var p runtime.Pinner
176+ defer p.Unpin()
177+ self.PostEvent(WpDrmLeaseConnectorV1EventDescription, server.String(&p, description, false))
178+}
179+
180+// SendConnectorId connector_id.
181+func (self *WpDrmLeaseConnectorV1) SendConnectorId(connectorId uint32) {
182+ self.PostEvent(WpDrmLeaseConnectorV1EventConnectorId, server.Uint(connectorId))
183+}
184+
185+// SendDone all properties have been sent.
186+func (self *WpDrmLeaseConnectorV1) SendDone() {
187+ self.PostEvent(WpDrmLeaseConnectorV1EventDone)
188+}
189+
190+// SendWithdrawn lease offer withdrawn.
191+func (self *WpDrmLeaseConnectorV1) SendWithdrawn() {
192+ self.PostEvent(WpDrmLeaseConnectorV1EventWithdrawn)
193+}
194+func NewWpDrmLeaseConnectorV1Global(d *server.Display, version int32, bind server.BindFunc) error {
195+ return d.CreateGlobal(WpDrmLeaseConnectorV1Interface, version, bind)
196+}
197+
198+// WpDrmLeaseRequestV1 DRM lease request.
199+type WpDrmLeaseRequestV1 struct{ *server.Resource }
200+
201+func WrapWpDrmLeaseRequestV1(r *server.Resource) *WpDrmLeaseRequestV1 {
202+ if r == nil {
203+ return nil
204+ }
205+ return &WpDrmLeaseRequestV1{r}
206+}
207+
208+const WpDrmLeaseRequestV1RequestRequestConnector uint32 = 0
209+const WpDrmLeaseRequestV1RequestSubmit uint32 = 1
210+
211+// WpDrmLeaseRequestV1Error .
212+type WpDrmLeaseRequestV1Error uint32
213+
214+const (
215+ WpDrmLeaseRequestV1ErrorWrongDevice WpDrmLeaseRequestV1Error = 0
216+ WpDrmLeaseRequestV1ErrorDuplicateConnector WpDrmLeaseRequestV1Error = 1
217+ WpDrmLeaseRequestV1ErrorEmptyLease WpDrmLeaseRequestV1Error = 2
218+)
219+
220+// WpDrmLeaseRequestV1Handler handles wp_drm_lease_request_v1 requests.
221+type WpDrmLeaseRequestV1Handler interface {
222+ RequestConnector(self *WpDrmLeaseRequestV1, connector *WpDrmLeaseConnectorV1)
223+ Submit(self *WpDrmLeaseRequestV1, id uint32)
224+}
225+
226+func NewWpDrmLeaseRequestV1(c server.Client, version int32, id uint32, h WpDrmLeaseRequestV1Handler) (*WpDrmLeaseRequestV1, error) {
227+ if h == nil {
228+ return nil, fmt.Errorf("purego-libwayland: nil handler for wp_drm_lease_request_v1")
229+ }
230+ var self *WpDrmLeaseRequestV1
231+ r, err := c.CreateResource(WpDrmLeaseRequestV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
232+ switch opcode {
233+ case 0:
234+ h.RequestConnector(self, WrapWpDrmLeaseConnectorV1(args[0].Resource()))
235+ case 1:
236+ h.Submit(self, args[0].NewID())
237+ self.Destroy()
238+ }
239+ })
240+ if err != nil {
241+ return nil, err
242+ }
243+ self = WrapWpDrmLeaseRequestV1(r)
244+ r.Data = self
245+ return self, nil
246+}
247+func NewWpDrmLeaseRequestV1Global(d *server.Display, version int32, bind server.BindFunc) error {
248+ return d.CreateGlobal(WpDrmLeaseRequestV1Interface, version, bind)
249+}
250+
251+// WpDrmLeaseV1 a DRM lease.
252+type WpDrmLeaseV1 struct{ *server.Resource }
253+
254+func WrapWpDrmLeaseV1(r *server.Resource) *WpDrmLeaseV1 {
255+ if r == nil {
256+ return nil
257+ }
258+ return &WpDrmLeaseV1{r}
259+}
260+
261+const WpDrmLeaseV1RequestDestroy uint32 = 0
262+const WpDrmLeaseV1EventLeaseFd uint32 = 0
263+const WpDrmLeaseV1EventFinished uint32 = 1
264+
265+// WpDrmLeaseV1Handler handles wp_drm_lease_v1 requests.
266+type WpDrmLeaseV1Handler interface {
267+ Destroy(self *WpDrmLeaseV1)
268+}
269+
270+func NewWpDrmLeaseV1(c server.Client, version int32, id uint32, h WpDrmLeaseV1Handler) (*WpDrmLeaseV1, error) {
271+ if h == nil {
272+ return nil, fmt.Errorf("purego-libwayland: nil handler for wp_drm_lease_v1")
273+ }
274+ var self *WpDrmLeaseV1
275+ r, err := c.CreateResource(WpDrmLeaseV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
276+ switch opcode {
277+ case 0:
278+ h.Destroy(self)
279+ self.Destroy()
280+ }
281+ })
282+ if err != nil {
283+ return nil, err
284+ }
285+ self = WrapWpDrmLeaseV1(r)
286+ r.Data = self
287+ return self, nil
288+}
289+
290+// SendLeaseFd shares the DRM file descriptor.
291+func (self *WpDrmLeaseV1) SendLeaseFd(leasedFd int) {
292+ self.PostEvent(WpDrmLeaseV1EventLeaseFd, server.Fd(leasedFd))
293+}
294+
295+// SendFinished sent when the lease has been revoked.
296+func (self *WpDrmLeaseV1) SendFinished() {
297+ self.PostEvent(WpDrmLeaseV1EventFinished)
298+}
299+func NewWpDrmLeaseV1Global(d *server.Display, version int32, bind server.BindFunc) error {
300+ return d.CreateGlobal(WpDrmLeaseV1Interface, version, bind)
301+}
302+func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
303+ if v == nil {
304+ return nil
305+ }
306+ return v.GetResource()
307+}
308+func (self *WpDrmLeaseDeviceV1) GetResource() *server.Resource {
309+ if self == nil {
310+ return nil
311+ }
312+ return self.Resource
313+}
314+func (self *WpDrmLeaseConnectorV1) GetResource() *server.Resource {
315+ if self == nil {
316+ return nil
317+ }
318+ return self.Resource
319+}
320+func (self *WpDrmLeaseRequestV1) GetResource() *server.Resource {
321+ if self == nil {
322+ return nil
323+ }
324+ return self.Resource
325+}
326+func (self *WpDrmLeaseV1) GetResource() *server.Resource {
327+ if self == nil {
328+ return nil
329+ }
330+ return self.Resource
331+}
A protocol/extbackgroundeffect/extbackgroundeffect.go +164 -0
@@ -0,0 +1,164 @@
1+// Code generated by wlgen; DO NOT EDIT.
2+package extbackgroundeffect
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 ExtBackgroundEffectManagerV1Interface *server.Interface
11+var ExtBackgroundEffectSurfaceV1Interface *server.Interface
12+
13+func init() {
14+ ExtBackgroundEffectManagerV1Interface = &server.Interface{Name: "ext_background_effect_manager_v1", Version: 1}
15+ ExtBackgroundEffectSurfaceV1Interface = &server.Interface{Name: "ext_background_effect_surface_v1", Version: 1}
16+ ExtBackgroundEffectManagerV1Interface.Requests = []server.Message{
17+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
18+ {Name: "get_background_effect", Signature: "no", Types: []*server.Interface{ExtBackgroundEffectSurfaceV1Interface, wayland.SurfaceInterface}},
19+ }
20+ ExtBackgroundEffectManagerV1Interface.Events = []server.Message{
21+ {Name: "capabilities", Signature: "u", Types: []*server.Interface{nil}},
22+ }
23+ ExtBackgroundEffectSurfaceV1Interface.Requests = []server.Message{
24+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
25+ {Name: "set_blur_region", Signature: "?o", Types: []*server.Interface{wayland.RegionInterface}},
26+ }
27+ ExtBackgroundEffectSurfaceV1Interface.Events = []server.Message{}
28+ if err := server.NewInterfaces(ExtBackgroundEffectManagerV1Interface, ExtBackgroundEffectSurfaceV1Interface); err != nil {
29+ panic(err)
30+ }
31+}
32+
33+// ExtBackgroundEffectManagerV1 background effect factory.
34+type ExtBackgroundEffectManagerV1 struct{ *server.Resource }
35+
36+func WrapExtBackgroundEffectManagerV1(r *server.Resource) *ExtBackgroundEffectManagerV1 {
37+ if r == nil {
38+ return nil
39+ }
40+ return &ExtBackgroundEffectManagerV1{r}
41+}
42+
43+const ExtBackgroundEffectManagerV1RequestDestroy uint32 = 0
44+const ExtBackgroundEffectManagerV1RequestGetBackgroundEffect uint32 = 1
45+const ExtBackgroundEffectManagerV1EventCapabilities uint32 = 0
46+
47+// ExtBackgroundEffectManagerV1Error .
48+type ExtBackgroundEffectManagerV1Error uint32
49+
50+const (
51+ ExtBackgroundEffectManagerV1ErrorBackgroundEffectExists ExtBackgroundEffectManagerV1Error = 0
52+)
53+
54+// ExtBackgroundEffectManagerV1Capability (bitfield).
55+type ExtBackgroundEffectManagerV1Capability uint32
56+
57+const (
58+ ExtBackgroundEffectManagerV1CapabilityBlur ExtBackgroundEffectManagerV1Capability = 1
59+)
60+
61+// ExtBackgroundEffectManagerV1Handler handles ext_background_effect_manager_v1 requests.
62+type ExtBackgroundEffectManagerV1Handler interface {
63+ Destroy(self *ExtBackgroundEffectManagerV1)
64+ GetBackgroundEffect(self *ExtBackgroundEffectManagerV1, id uint32, surface *wayland.Surface)
65+}
66+
67+func NewExtBackgroundEffectManagerV1(c server.Client, version int32, id uint32, h ExtBackgroundEffectManagerV1Handler) (*ExtBackgroundEffectManagerV1, error) {
68+ if h == nil {
69+ return nil, fmt.Errorf("purego-libwayland: nil handler for ext_background_effect_manager_v1")
70+ }
71+ var self *ExtBackgroundEffectManagerV1
72+ r, err := c.CreateResource(ExtBackgroundEffectManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
73+ switch opcode {
74+ case 0:
75+ h.Destroy(self)
76+ self.Destroy()
77+ case 1:
78+ h.GetBackgroundEffect(self, args[0].NewID(), wayland.WrapSurface(args[1].Resource()))
79+ }
80+ })
81+ if err != nil {
82+ return nil, err
83+ }
84+ self = WrapExtBackgroundEffectManagerV1(r)
85+ r.Data = self
86+ return self, nil
87+}
88+
89+// SendCapabilities capabilities of the compositor.
90+func (self *ExtBackgroundEffectManagerV1) SendCapabilities(flags uint32) {
91+ self.PostEvent(ExtBackgroundEffectManagerV1EventCapabilities, server.Uint(flags))
92+}
93+func NewExtBackgroundEffectManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
94+ return d.CreateGlobal(ExtBackgroundEffectManagerV1Interface, version, bind)
95+}
96+
97+// ExtBackgroundEffectSurfaceV1 background effects for a surface.
98+type ExtBackgroundEffectSurfaceV1 struct{ *server.Resource }
99+
100+func WrapExtBackgroundEffectSurfaceV1(r *server.Resource) *ExtBackgroundEffectSurfaceV1 {
101+ if r == nil {
102+ return nil
103+ }
104+ return &ExtBackgroundEffectSurfaceV1{r}
105+}
106+
107+const ExtBackgroundEffectSurfaceV1RequestDestroy uint32 = 0
108+const ExtBackgroundEffectSurfaceV1RequestSetBlurRegion uint32 = 1
109+
110+// ExtBackgroundEffectSurfaceV1Error .
111+type ExtBackgroundEffectSurfaceV1Error uint32
112+
113+const (
114+ ExtBackgroundEffectSurfaceV1ErrorSurfaceDestroyed ExtBackgroundEffectSurfaceV1Error = 0
115+)
116+
117+// ExtBackgroundEffectSurfaceV1Handler handles ext_background_effect_surface_v1 requests.
118+type ExtBackgroundEffectSurfaceV1Handler interface {
119+ Destroy(self *ExtBackgroundEffectSurfaceV1)
120+ SetBlurRegion(self *ExtBackgroundEffectSurfaceV1, region *wayland.Region)
121+}
122+
123+func NewExtBackgroundEffectSurfaceV1(c server.Client, version int32, id uint32, h ExtBackgroundEffectSurfaceV1Handler) (*ExtBackgroundEffectSurfaceV1, error) {
124+ if h == nil {
125+ return nil, fmt.Errorf("purego-libwayland: nil handler for ext_background_effect_surface_v1")
126+ }
127+ var self *ExtBackgroundEffectSurfaceV1
128+ r, err := c.CreateResource(ExtBackgroundEffectSurfaceV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
129+ switch opcode {
130+ case 0:
131+ h.Destroy(self)
132+ self.Destroy()
133+ case 1:
134+ h.SetBlurRegion(self, wayland.WrapRegion(args[0].Resource()))
135+ }
136+ })
137+ if err != nil {
138+ return nil, err
139+ }
140+ self = WrapExtBackgroundEffectSurfaceV1(r)
141+ r.Data = self
142+ return self, nil
143+}
144+func NewExtBackgroundEffectSurfaceV1Global(d *server.Display, version int32, bind server.BindFunc) error {
145+ return d.CreateGlobal(ExtBackgroundEffectSurfaceV1Interface, version, bind)
146+}
147+func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
148+ if v == nil {
149+ return nil
150+ }
151+ return v.GetResource()
152+}
153+func (self *ExtBackgroundEffectManagerV1) GetResource() *server.Resource {
154+ if self == nil {
155+ return nil
156+ }
157+ return self.Resource
158+}
159+func (self *ExtBackgroundEffectSurfaceV1) GetResource() *server.Resource {
160+ if self == nil {
161+ return nil
162+ }
163+ return self.Resource
164+}
A protocol/extimagecapturesource/extimagecapturesource.go +188 -0
@@ -0,0 +1,188 @@
1+// Code generated by wlgen; DO NOT EDIT.
2+package extimagecapturesource
3+
4+import (
5+ "fmt"
6+ extforeigntoplevellist "github.com/bnema/purego-libwayland/protocol/extforeigntoplevellist"
7+ wayland "github.com/bnema/purego-libwayland/protocol/wayland"
8+ "github.com/bnema/purego-libwayland/server"
9+)
10+
11+var ExtImageCaptureSourceV1Interface *server.Interface
12+var ExtOutputImageCaptureSourceManagerV1Interface *server.Interface
13+var ExtForeignToplevelImageCaptureSourceManagerV1Interface *server.Interface
14+
15+func init() {
16+ ExtImageCaptureSourceV1Interface = &server.Interface{Name: "ext_image_capture_source_v1", Version: 1}
17+ ExtOutputImageCaptureSourceManagerV1Interface = &server.Interface{Name: "ext_output_image_capture_source_manager_v1", Version: 1}
18+ ExtForeignToplevelImageCaptureSourceManagerV1Interface = &server.Interface{Name: "ext_foreign_toplevel_image_capture_source_manager_v1", Version: 1}
19+ ExtImageCaptureSourceV1Interface.Requests = []server.Message{
20+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
21+ }
22+ ExtImageCaptureSourceV1Interface.Events = []server.Message{}
23+ ExtOutputImageCaptureSourceManagerV1Interface.Requests = []server.Message{
24+ {Name: "create_source", Signature: "no", Types: []*server.Interface{ExtImageCaptureSourceV1Interface, wayland.OutputInterface}},
25+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
26+ }
27+ ExtOutputImageCaptureSourceManagerV1Interface.Events = []server.Message{}
28+ ExtForeignToplevelImageCaptureSourceManagerV1Interface.Requests = []server.Message{
29+ {Name: "create_source", Signature: "no", Types: []*server.Interface{ExtImageCaptureSourceV1Interface, extforeigntoplevellist.ExtForeignToplevelHandleV1Interface}},
30+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
31+ }
32+ ExtForeignToplevelImageCaptureSourceManagerV1Interface.Events = []server.Message{}
33+ if err := server.NewInterfaces(ExtImageCaptureSourceV1Interface, ExtOutputImageCaptureSourceManagerV1Interface, ExtForeignToplevelImageCaptureSourceManagerV1Interface); err != nil {
34+ panic(err)
35+ }
36+}
37+
38+// ExtImageCaptureSourceV1 opaque image capture source object.
39+type ExtImageCaptureSourceV1 struct{ *server.Resource }
40+
41+func WrapExtImageCaptureSourceV1(r *server.Resource) *ExtImageCaptureSourceV1 {
42+ if r == nil {
43+ return nil
44+ }
45+ return &ExtImageCaptureSourceV1{r}
46+}
47+
48+const ExtImageCaptureSourceV1RequestDestroy uint32 = 0
49+
50+// ExtImageCaptureSourceV1Handler handles ext_image_capture_source_v1 requests.
51+type ExtImageCaptureSourceV1Handler interface {
52+ Destroy(self *ExtImageCaptureSourceV1)
53+}
54+
55+func NewExtImageCaptureSourceV1(c server.Client, version int32, id uint32, h ExtImageCaptureSourceV1Handler) (*ExtImageCaptureSourceV1, error) {
56+ if h == nil {
57+ return nil, fmt.Errorf("purego-libwayland: nil handler for ext_image_capture_source_v1")
58+ }
59+ var self *ExtImageCaptureSourceV1
60+ r, err := c.CreateResource(ExtImageCaptureSourceV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
61+ switch opcode {
62+ case 0:
63+ h.Destroy(self)
64+ self.Destroy()
65+ }
66+ })
67+ if err != nil {
68+ return nil, err
69+ }
70+ self = WrapExtImageCaptureSourceV1(r)
71+ r.Data = self
72+ return self, nil
73+}
74+func NewExtImageCaptureSourceV1Global(d *server.Display, version int32, bind server.BindFunc) error {
75+ return d.CreateGlobal(ExtImageCaptureSourceV1Interface, version, bind)
76+}
77+
78+// ExtOutputImageCaptureSourceManagerV1 image capture source manager for outputs.
79+type ExtOutputImageCaptureSourceManagerV1 struct{ *server.Resource }
80+
81+func WrapExtOutputImageCaptureSourceManagerV1(r *server.Resource) *ExtOutputImageCaptureSourceManagerV1 {
82+ if r == nil {
83+ return nil
84+ }
85+ return &ExtOutputImageCaptureSourceManagerV1{r}
86+}
87+
88+const ExtOutputImageCaptureSourceManagerV1RequestCreateSource uint32 = 0
89+const ExtOutputImageCaptureSourceManagerV1RequestDestroy uint32 = 1
90+
91+// ExtOutputImageCaptureSourceManagerV1Handler handles ext_output_image_capture_source_manager_v1 requests.
92+type ExtOutputImageCaptureSourceManagerV1Handler interface {
93+ CreateSource(self *ExtOutputImageCaptureSourceManagerV1, source uint32, output *wayland.Output)
94+ Destroy(self *ExtOutputImageCaptureSourceManagerV1)
95+}
96+
97+func NewExtOutputImageCaptureSourceManagerV1(c server.Client, version int32, id uint32, h ExtOutputImageCaptureSourceManagerV1Handler) (*ExtOutputImageCaptureSourceManagerV1, error) {
98+ if h == nil {
99+ return nil, fmt.Errorf("purego-libwayland: nil handler for ext_output_image_capture_source_manager_v1")
100+ }
101+ var self *ExtOutputImageCaptureSourceManagerV1
102+ r, err := c.CreateResource(ExtOutputImageCaptureSourceManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
103+ switch opcode {
104+ case 0:
105+ h.CreateSource(self, args[0].NewID(), wayland.WrapOutput(args[1].Resource()))
106+ case 1:
107+ h.Destroy(self)
108+ self.Destroy()
109+ }
110+ })
111+ if err != nil {
112+ return nil, err
113+ }
114+ self = WrapExtOutputImageCaptureSourceManagerV1(r)
115+ r.Data = self
116+ return self, nil
117+}
118+func NewExtOutputImageCaptureSourceManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
119+ return d.CreateGlobal(ExtOutputImageCaptureSourceManagerV1Interface, version, bind)
120+}
121+
122+// ExtForeignToplevelImageCaptureSourceManagerV1 image capture source manager for foreign toplevels.
123+type ExtForeignToplevelImageCaptureSourceManagerV1 struct{ *server.Resource }
124+
125+func WrapExtForeignToplevelImageCaptureSourceManagerV1(r *server.Resource) *ExtForeignToplevelImageCaptureSourceManagerV1 {
126+ if r == nil {
127+ return nil
128+ }
129+ return &ExtForeignToplevelImageCaptureSourceManagerV1{r}
130+}
131+
132+const ExtForeignToplevelImageCaptureSourceManagerV1RequestCreateSource uint32 = 0
133+const ExtForeignToplevelImageCaptureSourceManagerV1RequestDestroy uint32 = 1
134+
135+// ExtForeignToplevelImageCaptureSourceManagerV1Handler handles ext_foreign_toplevel_image_capture_source_manager_v1 requests.
136+type ExtForeignToplevelImageCaptureSourceManagerV1Handler interface {
137+ CreateSource(self *ExtForeignToplevelImageCaptureSourceManagerV1, source uint32, toplevelHandle *extforeigntoplevellist.ExtForeignToplevelHandleV1)
138+ Destroy(self *ExtForeignToplevelImageCaptureSourceManagerV1)
139+}
140+
141+func NewExtForeignToplevelImageCaptureSourceManagerV1(c server.Client, version int32, id uint32, h ExtForeignToplevelImageCaptureSourceManagerV1Handler) (*ExtForeignToplevelImageCaptureSourceManagerV1, error) {
142+ if h == nil {
143+ return nil, fmt.Errorf("purego-libwayland: nil handler for ext_foreign_toplevel_image_capture_source_manager_v1")
144+ }
145+ var self *ExtForeignToplevelImageCaptureSourceManagerV1
146+ r, err := c.CreateResource(ExtForeignToplevelImageCaptureSourceManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
147+ switch opcode {
148+ case 0:
149+ h.CreateSource(self, args[0].NewID(), extforeigntoplevellist.WrapExtForeignToplevelHandleV1(args[1].Resource()))
150+ case 1:
151+ h.Destroy(self)
152+ self.Destroy()
153+ }
154+ })
155+ if err != nil {
156+ return nil, err
157+ }
158+ self = WrapExtForeignToplevelImageCaptureSourceManagerV1(r)
159+ r.Data = self
160+ return self, nil
161+}
162+func NewExtForeignToplevelImageCaptureSourceManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
163+ return d.CreateGlobal(ExtForeignToplevelImageCaptureSourceManagerV1Interface, version, bind)
164+}
165+func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
166+ if v == nil {
167+ return nil
168+ }
169+ return v.GetResource()
170+}
171+func (self *ExtImageCaptureSourceV1) GetResource() *server.Resource {
172+ if self == nil {
173+ return nil
174+ }
175+ return self.Resource
176+}
177+func (self *ExtOutputImageCaptureSourceManagerV1) GetResource() *server.Resource {
178+ if self == nil {
179+ return nil
180+ }
181+ return self.Resource
182+}
183+func (self *ExtForeignToplevelImageCaptureSourceManagerV1) GetResource() *server.Resource {
184+ if self == nil {
185+ return nil
186+ }
187+ return self.Resource
188+}
A protocol/extimagecopycapture/extimagecopycapture.go +424 -0
@@ -0,0 +1,424 @@
1+// Code generated by wlgen; DO NOT EDIT.
2+package extimagecopycapture
3+
4+import (
5+ "fmt"
6+ extimagecapturesource "github.com/bnema/purego-libwayland/protocol/extimagecapturesource"
7+ wayland "github.com/bnema/purego-libwayland/protocol/wayland"
8+ "github.com/bnema/purego-libwayland/server"
9+ "runtime"
10+)
11+
12+var ExtImageCopyCaptureManagerV1Interface *server.Interface
13+var ExtImageCopyCaptureSessionV1Interface *server.Interface
14+var ExtImageCopyCaptureFrameV1Interface *server.Interface
15+var ExtImageCopyCaptureCursorSessionV1Interface *server.Interface
16+
17+func init() {
18+ ExtImageCopyCaptureManagerV1Interface = &server.Interface{Name: "ext_image_copy_capture_manager_v1", Version: 1}
19+ ExtImageCopyCaptureSessionV1Interface = &server.Interface{Name: "ext_image_copy_capture_session_v1", Version: 1}
20+ ExtImageCopyCaptureFrameV1Interface = &server.Interface{Name: "ext_image_copy_capture_frame_v1", Version: 1}
21+ ExtImageCopyCaptureCursorSessionV1Interface = &server.Interface{Name: "ext_image_copy_capture_cursor_session_v1", Version: 1}
22+ ExtImageCopyCaptureManagerV1Interface.Requests = []server.Message{
23+ {Name: "create_session", Signature: "nou", Types: []*server.Interface{ExtImageCopyCaptureSessionV1Interface, extimagecapturesource.ExtImageCaptureSourceV1Interface, nil}},
24+ {Name: "create_pointer_cursor_session", Signature: "noo", Types: []*server.Interface{ExtImageCopyCaptureCursorSessionV1Interface, extimagecapturesource.ExtImageCaptureSourceV1Interface, wayland.PointerInterface}},
25+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
26+ }
27+ ExtImageCopyCaptureManagerV1Interface.Events = []server.Message{}
28+ ExtImageCopyCaptureSessionV1Interface.Requests = []server.Message{
29+ {Name: "create_frame", Signature: "n", Types: []*server.Interface{ExtImageCopyCaptureFrameV1Interface}},
30+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
31+ }
32+ ExtImageCopyCaptureSessionV1Interface.Events = []server.Message{
33+ {Name: "buffer_size", Signature: "uu", Types: []*server.Interface{nil, nil}},
34+ {Name: "shm_format", Signature: "u", Types: []*server.Interface{nil}},
35+ {Name: "dmabuf_device", Signature: "a", Types: []*server.Interface{nil}},
36+ {Name: "dmabuf_format", Signature: "ua", Types: []*server.Interface{nil, nil}},
37+ {Name: "done", Signature: "", Types: []*server.Interface{}},
38+ {Name: "stopped", Signature: "", Types: []*server.Interface{}},
39+ }
40+ ExtImageCopyCaptureFrameV1Interface.Requests = []server.Message{
41+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
42+ {Name: "attach_buffer", Signature: "o", Types: []*server.Interface{wayland.BufferInterface}},
43+ {Name: "damage_buffer", Signature: "iiii", Types: []*server.Interface{nil, nil, nil, nil}},
44+ {Name: "capture", Signature: "", Types: []*server.Interface{}},
45+ }
46+ ExtImageCopyCaptureFrameV1Interface.Events = []server.Message{
47+ {Name: "transform", Signature: "u", Types: []*server.Interface{nil}},
48+ {Name: "damage", Signature: "iiii", Types: []*server.Interface{nil, nil, nil, nil}},
49+ {Name: "presentation_time", Signature: "uuu", Types: []*server.Interface{nil, nil, nil}},
50+ {Name: "ready", Signature: "", Types: []*server.Interface{}},
51+ {Name: "failed", Signature: "u", Types: []*server.Interface{nil}},
52+ }
53+ ExtImageCopyCaptureCursorSessionV1Interface.Requests = []server.Message{
54+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
55+ {Name: "get_capture_session", Signature: "n", Types: []*server.Interface{ExtImageCopyCaptureSessionV1Interface}},
56+ }
57+ ExtImageCopyCaptureCursorSessionV1Interface.Events = []server.Message{
58+ {Name: "enter", Signature: "", Types: []*server.Interface{}},
59+ {Name: "leave", Signature: "", Types: []*server.Interface{}},
60+ {Name: "position", Signature: "ii", Types: []*server.Interface{nil, nil}},
61+ {Name: "hotspot", Signature: "ii", Types: []*server.Interface{nil, nil}},
62+ }
63+ if err := server.NewInterfaces(ExtImageCopyCaptureManagerV1Interface, ExtImageCopyCaptureSessionV1Interface, ExtImageCopyCaptureFrameV1Interface, ExtImageCopyCaptureCursorSessionV1Interface); err != nil {
64+ panic(err)
65+ }
66+}
67+
68+// ExtImageCopyCaptureManagerV1 manager to inform clients and begin capturing.
69+type ExtImageCopyCaptureManagerV1 struct{ *server.Resource }
70+
71+func WrapExtImageCopyCaptureManagerV1(r *server.Resource) *ExtImageCopyCaptureManagerV1 {
72+ if r == nil {
73+ return nil
74+ }
75+ return &ExtImageCopyCaptureManagerV1{r}
76+}
77+
78+const ExtImageCopyCaptureManagerV1RequestCreateSession uint32 = 0
79+const ExtImageCopyCaptureManagerV1RequestCreatePointerCursorSession uint32 = 1
80+const ExtImageCopyCaptureManagerV1RequestDestroy uint32 = 2
81+
82+// ExtImageCopyCaptureManagerV1Error .
83+type ExtImageCopyCaptureManagerV1Error uint32
84+
85+const (
86+ ExtImageCopyCaptureManagerV1ErrorInvalidOption ExtImageCopyCaptureManagerV1Error = 1
87+)
88+
89+// ExtImageCopyCaptureManagerV1Options (bitfield).
90+type ExtImageCopyCaptureManagerV1Options uint32
91+
92+const (
93+ ExtImageCopyCaptureManagerV1OptionsPaintCursors ExtImageCopyCaptureManagerV1Options = 1
94+)
95+
96+// ExtImageCopyCaptureManagerV1Handler handles ext_image_copy_capture_manager_v1 requests.
97+type ExtImageCopyCaptureManagerV1Handler interface {
98+ CreateSession(self *ExtImageCopyCaptureManagerV1, session uint32, source *extimagecapturesource.ExtImageCaptureSourceV1, options uint32)
99+ CreatePointerCursorSession(self *ExtImageCopyCaptureManagerV1, session uint32, source *extimagecapturesource.ExtImageCaptureSourceV1, pointer *wayland.Pointer)
100+ Destroy(self *ExtImageCopyCaptureManagerV1)
101+}
102+
103+func NewExtImageCopyCaptureManagerV1(c server.Client, version int32, id uint32, h ExtImageCopyCaptureManagerV1Handler) (*ExtImageCopyCaptureManagerV1, error) {
104+ if h == nil {
105+ return nil, fmt.Errorf("purego-libwayland: nil handler for ext_image_copy_capture_manager_v1")
106+ }
107+ var self *ExtImageCopyCaptureManagerV1
108+ r, err := c.CreateResource(ExtImageCopyCaptureManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
109+ switch opcode {
110+ case 0:
111+ h.CreateSession(self, args[0].NewID(), extimagecapturesource.WrapExtImageCaptureSourceV1(args[1].Resource()), args[2].Uint())
112+ case 1:
113+ h.CreatePointerCursorSession(self, args[0].NewID(), extimagecapturesource.WrapExtImageCaptureSourceV1(args[1].Resource()), wayland.WrapPointer(args[2].Resource()))
114+ case 2:
115+ h.Destroy(self)
116+ self.Destroy()
117+ }
118+ })
119+ if err != nil {
120+ return nil, err
121+ }
122+ self = WrapExtImageCopyCaptureManagerV1(r)
123+ r.Data = self
124+ return self, nil
125+}
126+func NewExtImageCopyCaptureManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
127+ return d.CreateGlobal(ExtImageCopyCaptureManagerV1Interface, version, bind)
128+}
129+
130+// ExtImageCopyCaptureSessionV1 image copy capture session.
131+type ExtImageCopyCaptureSessionV1 struct{ *server.Resource }
132+
133+func WrapExtImageCopyCaptureSessionV1(r *server.Resource) *ExtImageCopyCaptureSessionV1 {
134+ if r == nil {
135+ return nil
136+ }
137+ return &ExtImageCopyCaptureSessionV1{r}
138+}
139+
140+const ExtImageCopyCaptureSessionV1RequestCreateFrame uint32 = 0
141+const ExtImageCopyCaptureSessionV1RequestDestroy uint32 = 1
142+const ExtImageCopyCaptureSessionV1EventBufferSize uint32 = 0
143+const ExtImageCopyCaptureSessionV1EventShmFormat uint32 = 1
144+const ExtImageCopyCaptureSessionV1EventDmabufDevice uint32 = 2
145+const ExtImageCopyCaptureSessionV1EventDmabufFormat uint32 = 3
146+const ExtImageCopyCaptureSessionV1EventDone uint32 = 4
147+const ExtImageCopyCaptureSessionV1EventStopped uint32 = 5
148+
149+// ExtImageCopyCaptureSessionV1Error .
150+type ExtImageCopyCaptureSessionV1Error uint32
151+
152+const (
153+ ExtImageCopyCaptureSessionV1ErrorDuplicateFrame ExtImageCopyCaptureSessionV1Error = 1
154+)
155+
156+// ExtImageCopyCaptureSessionV1Handler handles ext_image_copy_capture_session_v1 requests.
157+type ExtImageCopyCaptureSessionV1Handler interface {
158+ CreateFrame(self *ExtImageCopyCaptureSessionV1, frame uint32)
159+ Destroy(self *ExtImageCopyCaptureSessionV1)
160+}
161+
162+func NewExtImageCopyCaptureSessionV1(c server.Client, version int32, id uint32, h ExtImageCopyCaptureSessionV1Handler) (*ExtImageCopyCaptureSessionV1, error) {
163+ if h == nil {
164+ return nil, fmt.Errorf("purego-libwayland: nil handler for ext_image_copy_capture_session_v1")
165+ }
166+ var self *ExtImageCopyCaptureSessionV1
167+ r, err := c.CreateResource(ExtImageCopyCaptureSessionV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
168+ switch opcode {
169+ case 0:
170+ h.CreateFrame(self, args[0].NewID())
171+ case 1:
172+ h.Destroy(self)
173+ self.Destroy()
174+ }
175+ })
176+ if err != nil {
177+ return nil, err
178+ }
179+ self = WrapExtImageCopyCaptureSessionV1(r)
180+ r.Data = self
181+ return self, nil
182+}
183+
184+// SendBufferSize image capture source dimensions.
185+func (self *ExtImageCopyCaptureSessionV1) SendBufferSize(width uint32, height uint32) {
186+ self.PostEvent(ExtImageCopyCaptureSessionV1EventBufferSize, server.Uint(width), server.Uint(height))
187+}
188+
189+// SendShmFormat shm buffer format.
190+func (self *ExtImageCopyCaptureSessionV1) SendShmFormat(format uint32) {
191+ self.PostEvent(ExtImageCopyCaptureSessionV1EventShmFormat, server.Uint(format))
192+}
193+
194+// SendDmabufDevice dma-buf device.
195+func (self *ExtImageCopyCaptureSessionV1) SendDmabufDevice(device []byte) {
196+ var p runtime.Pinner
197+ defer p.Unpin()
198+ self.PostEvent(ExtImageCopyCaptureSessionV1EventDmabufDevice, server.Array(&p, device))
199+}
200+
201+// SendDmabufFormat dma-buf format.
202+func (self *ExtImageCopyCaptureSessionV1) SendDmabufFormat(format uint32, modifiers []byte) {
203+ var p runtime.Pinner
204+ defer p.Unpin()
205+ self.PostEvent(ExtImageCopyCaptureSessionV1EventDmabufFormat, server.Uint(format), server.Array(&p, modifiers))
206+}
207+
208+// SendDone all constraints have been sent.
209+func (self *ExtImageCopyCaptureSessionV1) SendDone() {
210+ self.PostEvent(ExtImageCopyCaptureSessionV1EventDone)
211+}
212+
213+// SendStopped session is no longer available.
214+func (self *ExtImageCopyCaptureSessionV1) SendStopped() {
215+ self.PostEvent(ExtImageCopyCaptureSessionV1EventStopped)
216+}
217+func NewExtImageCopyCaptureSessionV1Global(d *server.Display, version int32, bind server.BindFunc) error {
218+ return d.CreateGlobal(ExtImageCopyCaptureSessionV1Interface, version, bind)
219+}
220+
221+// ExtImageCopyCaptureFrameV1 image capture frame.
222+type ExtImageCopyCaptureFrameV1 struct{ *server.Resource }
223+
224+func WrapExtImageCopyCaptureFrameV1(r *server.Resource) *ExtImageCopyCaptureFrameV1 {
225+ if r == nil {
226+ return nil
227+ }
228+ return &ExtImageCopyCaptureFrameV1{r}
229+}
230+
231+const ExtImageCopyCaptureFrameV1RequestDestroy uint32 = 0
232+const ExtImageCopyCaptureFrameV1RequestAttachBuffer uint32 = 1
233+const ExtImageCopyCaptureFrameV1RequestDamageBuffer uint32 = 2
234+const ExtImageCopyCaptureFrameV1RequestCapture uint32 = 3
235+const ExtImageCopyCaptureFrameV1EventTransform uint32 = 0
236+const ExtImageCopyCaptureFrameV1EventDamage uint32 = 1
237+const ExtImageCopyCaptureFrameV1EventPresentationTime uint32 = 2
238+const ExtImageCopyCaptureFrameV1EventReady uint32 = 3
239+const ExtImageCopyCaptureFrameV1EventFailed uint32 = 4
240+
241+// ExtImageCopyCaptureFrameV1Error .
242+type ExtImageCopyCaptureFrameV1Error uint32
243+
244+const (
245+ ExtImageCopyCaptureFrameV1ErrorNoBuffer ExtImageCopyCaptureFrameV1Error = 1
246+ ExtImageCopyCaptureFrameV1ErrorInvalidBufferDamage ExtImageCopyCaptureFrameV1Error = 2
247+ ExtImageCopyCaptureFrameV1ErrorAlreadyCaptured ExtImageCopyCaptureFrameV1Error = 3
248+)
249+
250+// ExtImageCopyCaptureFrameV1FailureReason .
251+type ExtImageCopyCaptureFrameV1FailureReason uint32
252+
253+const (
254+ ExtImageCopyCaptureFrameV1FailureReasonUnknown ExtImageCopyCaptureFrameV1FailureReason = 0
255+ ExtImageCopyCaptureFrameV1FailureReasonBufferConstraints ExtImageCopyCaptureFrameV1FailureReason = 1
256+ ExtImageCopyCaptureFrameV1FailureReasonStopped ExtImageCopyCaptureFrameV1FailureReason = 2
257+)
258+
259+// ExtImageCopyCaptureFrameV1Handler handles ext_image_copy_capture_frame_v1 requests.
260+type ExtImageCopyCaptureFrameV1Handler interface {
261+ Destroy(self *ExtImageCopyCaptureFrameV1)
262+ AttachBuffer(self *ExtImageCopyCaptureFrameV1, buffer *wayland.Buffer)
263+ DamageBuffer(self *ExtImageCopyCaptureFrameV1, x int32, y int32, width int32, height int32)
264+ Capture(self *ExtImageCopyCaptureFrameV1)
265+}
266+
267+func NewExtImageCopyCaptureFrameV1(c server.Client, version int32, id uint32, h ExtImageCopyCaptureFrameV1Handler) (*ExtImageCopyCaptureFrameV1, error) {
268+ if h == nil {
269+ return nil, fmt.Errorf("purego-libwayland: nil handler for ext_image_copy_capture_frame_v1")
270+ }
271+ var self *ExtImageCopyCaptureFrameV1
272+ r, err := c.CreateResource(ExtImageCopyCaptureFrameV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
273+ switch opcode {
274+ case 0:
275+ h.Destroy(self)
276+ self.Destroy()
277+ case 1:
278+ h.AttachBuffer(self, wayland.WrapBuffer(args[0].Resource()))
279+ case 2:
280+ h.DamageBuffer(self, args[0].Int(), args[1].Int(), args[2].Int(), args[3].Int())
281+ case 3:
282+ h.Capture(self)
283+ }
284+ })
285+ if err != nil {
286+ return nil, err
287+ }
288+ self = WrapExtImageCopyCaptureFrameV1(r)
289+ r.Data = self
290+ return self, nil
291+}
292+
293+// SendTransform buffer transform.
294+func (self *ExtImageCopyCaptureFrameV1) SendTransform(transform uint32) {
295+ self.PostEvent(ExtImageCopyCaptureFrameV1EventTransform, server.Uint(transform))
296+}
297+
298+// SendDamage buffer damaged region.
299+func (self *ExtImageCopyCaptureFrameV1) SendDamage(x int32, y int32, width int32, height int32) {
300+ self.PostEvent(ExtImageCopyCaptureFrameV1EventDamage, server.Int(x), server.Int(y), server.Int(width), server.Int(height))
301+}
302+
303+// SendPresentationTime presentation time of the frame.
304+func (self *ExtImageCopyCaptureFrameV1) SendPresentationTime(tvSecHi uint32, tvSecLo uint32, tvNsec uint32) {
305+ self.PostEvent(ExtImageCopyCaptureFrameV1EventPresentationTime, server.Uint(tvSecHi), server.Uint(tvSecLo), server.Uint(tvNsec))
306+}
307+
308+// SendReady frame is available for reading.
309+func (self *ExtImageCopyCaptureFrameV1) SendReady() {
310+ self.PostEvent(ExtImageCopyCaptureFrameV1EventReady)
311+}
312+
313+// SendFailed capture failed.
314+func (self *ExtImageCopyCaptureFrameV1) SendFailed(reason uint32) {
315+ self.PostEvent(ExtImageCopyCaptureFrameV1EventFailed, server.Uint(reason))
316+}
317+func NewExtImageCopyCaptureFrameV1Global(d *server.Display, version int32, bind server.BindFunc) error {
318+ return d.CreateGlobal(ExtImageCopyCaptureFrameV1Interface, version, bind)
319+}
320+
321+// ExtImageCopyCaptureCursorSessionV1 cursor capture session.
322+type ExtImageCopyCaptureCursorSessionV1 struct{ *server.Resource }
323+
324+func WrapExtImageCopyCaptureCursorSessionV1(r *server.Resource) *ExtImageCopyCaptureCursorSessionV1 {
325+ if r == nil {
326+ return nil
327+ }
328+ return &ExtImageCopyCaptureCursorSessionV1{r}
329+}
330+
331+const ExtImageCopyCaptureCursorSessionV1RequestDestroy uint32 = 0
332+const ExtImageCopyCaptureCursorSessionV1RequestGetCaptureSession uint32 = 1
333+const ExtImageCopyCaptureCursorSessionV1EventEnter uint32 = 0
334+const ExtImageCopyCaptureCursorSessionV1EventLeave uint32 = 1
335+const ExtImageCopyCaptureCursorSessionV1EventPosition uint32 = 2
336+const ExtImageCopyCaptureCursorSessionV1EventHotspot uint32 = 3
337+
338+// ExtImageCopyCaptureCursorSessionV1Error .
339+type ExtImageCopyCaptureCursorSessionV1Error uint32
340+
341+const (
342+ ExtImageCopyCaptureCursorSessionV1ErrorDuplicateSession ExtImageCopyCaptureCursorSessionV1Error = 1
343+)
344+
345+// ExtImageCopyCaptureCursorSessionV1Handler handles ext_image_copy_capture_cursor_session_v1 requests.
346+type ExtImageCopyCaptureCursorSessionV1Handler interface {
347+ Destroy(self *ExtImageCopyCaptureCursorSessionV1)
348+ GetCaptureSession(self *ExtImageCopyCaptureCursorSessionV1, session uint32)
349+}
350+
351+func NewExtImageCopyCaptureCursorSessionV1(c server.Client, version int32, id uint32, h ExtImageCopyCaptureCursorSessionV1Handler) (*ExtImageCopyCaptureCursorSessionV1, error) {
352+ if h == nil {
353+ return nil, fmt.Errorf("purego-libwayland: nil handler for ext_image_copy_capture_cursor_session_v1")
354+ }
355+ var self *ExtImageCopyCaptureCursorSessionV1
356+ r, err := c.CreateResource(ExtImageCopyCaptureCursorSessionV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
357+ switch opcode {
358+ case 0:
359+ h.Destroy(self)
360+ self.Destroy()
361+ case 1:
362+ h.GetCaptureSession(self, args[0].NewID())
363+ }
364+ })
365+ if err != nil {
366+ return nil, err
367+ }
368+ self = WrapExtImageCopyCaptureCursorSessionV1(r)
369+ r.Data = self
370+ return self, nil
371+}
372+
373+// SendEnter cursor entered captured area.
374+func (self *ExtImageCopyCaptureCursorSessionV1) SendEnter() {
375+ self.PostEvent(ExtImageCopyCaptureCursorSessionV1EventEnter)
376+}
377+
378+// SendLeave cursor left captured area.
379+func (self *ExtImageCopyCaptureCursorSessionV1) SendLeave() {
380+ self.PostEvent(ExtImageCopyCaptureCursorSessionV1EventLeave)
381+}
382+
383+// SendPosition position changed.
384+func (self *ExtImageCopyCaptureCursorSessionV1) SendPosition(x int32, y int32) {
385+ self.PostEvent(ExtImageCopyCaptureCursorSessionV1EventPosition, server.Int(x), server.Int(y))
386+}
387+
388+// SendHotspot hotspot changed.
389+func (self *ExtImageCopyCaptureCursorSessionV1) SendHotspot(x int32, y int32) {
390+ self.PostEvent(ExtImageCopyCaptureCursorSessionV1EventHotspot, server.Int(x), server.Int(y))
391+}
392+func NewExtImageCopyCaptureCursorSessionV1Global(d *server.Display, version int32, bind server.BindFunc) error {
393+ return d.CreateGlobal(ExtImageCopyCaptureCursorSessionV1Interface, version, bind)
394+}
395+func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
396+ if v == nil {
397+ return nil
398+ }
399+ return v.GetResource()
400+}
401+func (self *ExtImageCopyCaptureManagerV1) GetResource() *server.Resource {
402+ if self == nil {
403+ return nil
404+ }
405+ return self.Resource
406+}
407+func (self *ExtImageCopyCaptureSessionV1) GetResource() *server.Resource {
408+ if self == nil {
409+ return nil
410+ }
411+ return self.Resource
412+}
413+func (self *ExtImageCopyCaptureFrameV1) GetResource() *server.Resource {
414+ if self == nil {
415+ return nil
416+ }
417+ return self.Resource
418+}
419+func (self *ExtImageCopyCaptureCursorSessionV1) GetResource() *server.Resource {
420+ if self == nil {
421+ return nil
422+ }
423+ return self.Resource
424+}
A protocol/exttransientseat/exttransientseat.go +144 -0
@@ -0,0 +1,144 @@
1+// Code generated by wlgen; DO NOT EDIT.
2+package exttransientseat
3+
4+import (
5+ "fmt"
6+ "github.com/bnema/purego-libwayland/server"
7+)
8+
9+var ExtTransientSeatManagerV1Interface *server.Interface
10+var ExtTransientSeatV1Interface *server.Interface
11+
12+func init() {
13+ ExtTransientSeatManagerV1Interface = &server.Interface{Name: "ext_transient_seat_manager_v1", Version: 1}
14+ ExtTransientSeatV1Interface = &server.Interface{Name: "ext_transient_seat_v1", Version: 1}
15+ ExtTransientSeatManagerV1Interface.Requests = []server.Message{
16+ {Name: "create", Signature: "n", Types: []*server.Interface{ExtTransientSeatV1Interface}},
17+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
18+ }
19+ ExtTransientSeatManagerV1Interface.Events = []server.Message{}
20+ ExtTransientSeatV1Interface.Requests = []server.Message{
21+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
22+ }
23+ ExtTransientSeatV1Interface.Events = []server.Message{
24+ {Name: "ready", Signature: "u", Types: []*server.Interface{nil}},
25+ {Name: "denied", Signature: "", Types: []*server.Interface{}},
26+ }
27+ if err := server.NewInterfaces(ExtTransientSeatManagerV1Interface, ExtTransientSeatV1Interface); err != nil {
28+ panic(err)
29+ }
30+}
31+
32+// ExtTransientSeatManagerV1 transient seat manager.
33+type ExtTransientSeatManagerV1 struct{ *server.Resource }
34+
35+func WrapExtTransientSeatManagerV1(r *server.Resource) *ExtTransientSeatManagerV1 {
36+ if r == nil {
37+ return nil
38+ }
39+ return &ExtTransientSeatManagerV1{r}
40+}
41+
42+const ExtTransientSeatManagerV1RequestCreate uint32 = 0
43+const ExtTransientSeatManagerV1RequestDestroy uint32 = 1
44+
45+// ExtTransientSeatManagerV1Handler handles ext_transient_seat_manager_v1 requests.
46+type ExtTransientSeatManagerV1Handler interface {
47+ Create(self *ExtTransientSeatManagerV1, seat uint32)
48+ Destroy(self *ExtTransientSeatManagerV1)
49+}
50+
51+func NewExtTransientSeatManagerV1(c server.Client, version int32, id uint32, h ExtTransientSeatManagerV1Handler) (*ExtTransientSeatManagerV1, error) {
52+ if h == nil {
53+ return nil, fmt.Errorf("purego-libwayland: nil handler for ext_transient_seat_manager_v1")
54+ }
55+ var self *ExtTransientSeatManagerV1
56+ r, err := c.CreateResource(ExtTransientSeatManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
57+ switch opcode {
58+ case 0:
59+ h.Create(self, args[0].NewID())
60+ case 1:
61+ h.Destroy(self)
62+ self.Destroy()
63+ }
64+ })
65+ if err != nil {
66+ return nil, err
67+ }
68+ self = WrapExtTransientSeatManagerV1(r)
69+ r.Data = self
70+ return self, nil
71+}
72+func NewExtTransientSeatManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
73+ return d.CreateGlobal(ExtTransientSeatManagerV1Interface, version, bind)
74+}
75+
76+// ExtTransientSeatV1 transient seat handle.
77+type ExtTransientSeatV1 struct{ *server.Resource }
78+
79+func WrapExtTransientSeatV1(r *server.Resource) *ExtTransientSeatV1 {
80+ if r == nil {
81+ return nil
82+ }
83+ return &ExtTransientSeatV1{r}
84+}
85+
86+const ExtTransientSeatV1RequestDestroy uint32 = 0
87+const ExtTransientSeatV1EventReady uint32 = 0
88+const ExtTransientSeatV1EventDenied uint32 = 1
89+
90+// ExtTransientSeatV1Handler handles ext_transient_seat_v1 requests.
91+type ExtTransientSeatV1Handler interface {
92+ Destroy(self *ExtTransientSeatV1)
93+}
94+
95+func NewExtTransientSeatV1(c server.Client, version int32, id uint32, h ExtTransientSeatV1Handler) (*ExtTransientSeatV1, error) {
96+ if h == nil {
97+ return nil, fmt.Errorf("purego-libwayland: nil handler for ext_transient_seat_v1")
98+ }
99+ var self *ExtTransientSeatV1
100+ r, err := c.CreateResource(ExtTransientSeatV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
101+ switch opcode {
102+ case 0:
103+ h.Destroy(self)
104+ self.Destroy()
105+ }
106+ })
107+ if err != nil {
108+ return nil, err
109+ }
110+ self = WrapExtTransientSeatV1(r)
111+ r.Data = self
112+ return self, nil
113+}
114+
115+// SendReady transient seat is ready.
116+func (self *ExtTransientSeatV1) SendReady(globalName uint32) {
117+ self.PostEvent(ExtTransientSeatV1EventReady, server.Uint(globalName))
118+}
119+
120+// SendDenied transient seat creation denied.
121+func (self *ExtTransientSeatV1) SendDenied() {
122+ self.PostEvent(ExtTransientSeatV1EventDenied)
123+}
124+func NewExtTransientSeatV1Global(d *server.Display, version int32, bind server.BindFunc) error {
125+ return d.CreateGlobal(ExtTransientSeatV1Interface, version, bind)
126+}
127+func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
128+ if v == nil {
129+ return nil
130+ }
131+ return v.GetResource()
132+}
133+func (self *ExtTransientSeatManagerV1) GetResource() *server.Resource {
134+ if self == nil {
135+ return nil
136+ }
137+ return self.Resource
138+}
139+func (self *ExtTransientSeatV1) GetResource() *server.Resource {
140+ if self == nil {
141+ return nil
142+ }
143+ return self.Resource
144+}
A protocol/extworkspace/extworkspace.go +354 -0
@@ -0,0 +1,354 @@
1+// Code generated by wlgen; DO NOT EDIT.
2+package extworkspace
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 ExtWorkspaceManagerV1Interface *server.Interface
12+var ExtWorkspaceGroupHandleV1Interface *server.Interface
13+var ExtWorkspaceHandleV1Interface *server.Interface
14+
15+func init() {
16+ ExtWorkspaceManagerV1Interface = &server.Interface{Name: "ext_workspace_manager_v1", Version: 1}
17+ ExtWorkspaceGroupHandleV1Interface = &server.Interface{Name: "ext_workspace_group_handle_v1", Version: 1}
18+ ExtWorkspaceHandleV1Interface = &server.Interface{Name: "ext_workspace_handle_v1", Version: 1}
19+ ExtWorkspaceManagerV1Interface.Requests = []server.Message{
20+ {Name: "commit", Signature: "", Types: []*server.Interface{}},
21+ {Name: "stop", Signature: "", Types: []*server.Interface{}},
22+ }
23+ ExtWorkspaceManagerV1Interface.Events = []server.Message{
24+ {Name: "workspace_group", Signature: "n", Types: []*server.Interface{ExtWorkspaceGroupHandleV1Interface}},
25+ {Name: "workspace", Signature: "n", Types: []*server.Interface{ExtWorkspaceHandleV1Interface}},
26+ {Name: "done", Signature: "", Types: []*server.Interface{}},
27+ {Name: "finished", Signature: "", Types: []*server.Interface{}},
28+ }
29+ ExtWorkspaceGroupHandleV1Interface.Requests = []server.Message{
30+ {Name: "create_workspace", Signature: "s", Types: []*server.Interface{nil}},
31+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
32+ }
33+ ExtWorkspaceGroupHandleV1Interface.Events = []server.Message{
34+ {Name: "capabilities", Signature: "u", Types: []*server.Interface{nil}},
35+ {Name: "output_enter", Signature: "o", Types: []*server.Interface{wayland.OutputInterface}},
36+ {Name: "output_leave", Signature: "o", Types: []*server.Interface{wayland.OutputInterface}},
37+ {Name: "workspace_enter", Signature: "o", Types: []*server.Interface{ExtWorkspaceHandleV1Interface}},
38+ {Name: "workspace_leave", Signature: "o", Types: []*server.Interface{ExtWorkspaceHandleV1Interface}},
39+ {Name: "removed", Signature: "", Types: []*server.Interface{}},
40+ }
41+ ExtWorkspaceHandleV1Interface.Requests = []server.Message{
42+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
43+ {Name: "activate", Signature: "", Types: []*server.Interface{}},
44+ {Name: "deactivate", Signature: "", Types: []*server.Interface{}},
45+ {Name: "assign", Signature: "o", Types: []*server.Interface{ExtWorkspaceGroupHandleV1Interface}},
46+ {Name: "remove", Signature: "", Types: []*server.Interface{}},
47+ }
48+ ExtWorkspaceHandleV1Interface.Events = []server.Message{
49+ {Name: "id", Signature: "s", Types: []*server.Interface{nil}},
50+ {Name: "name", Signature: "s", Types: []*server.Interface{nil}},
51+ {Name: "coordinates", Signature: "a", Types: []*server.Interface{nil}},
52+ {Name: "state", Signature: "u", Types: []*server.Interface{nil}},
53+ {Name: "capabilities", Signature: "u", Types: []*server.Interface{nil}},
54+ {Name: "removed", Signature: "", Types: []*server.Interface{}},
55+ }
56+ if err := server.NewInterfaces(ExtWorkspaceManagerV1Interface, ExtWorkspaceGroupHandleV1Interface, ExtWorkspaceHandleV1Interface); err != nil {
57+ panic(err)
58+ }
59+}
60+
61+// ExtWorkspaceManagerV1 list and control workspaces.
62+type ExtWorkspaceManagerV1 struct{ *server.Resource }
63+
64+func WrapExtWorkspaceManagerV1(r *server.Resource) *ExtWorkspaceManagerV1 {
65+ if r == nil {
66+ return nil
67+ }
68+ return &ExtWorkspaceManagerV1{r}
69+}
70+
71+const ExtWorkspaceManagerV1RequestCommit uint32 = 0
72+const ExtWorkspaceManagerV1RequestStop uint32 = 1
73+const ExtWorkspaceManagerV1EventWorkspaceGroup uint32 = 0
74+const ExtWorkspaceManagerV1EventWorkspace uint32 = 1
75+const ExtWorkspaceManagerV1EventDone uint32 = 2
76+const ExtWorkspaceManagerV1EventFinished uint32 = 3
77+
78+// ExtWorkspaceManagerV1Handler handles ext_workspace_manager_v1 requests.
79+type ExtWorkspaceManagerV1Handler interface {
80+ Commit(self *ExtWorkspaceManagerV1)
81+ Stop(self *ExtWorkspaceManagerV1)
82+}
83+
84+func NewExtWorkspaceManagerV1(c server.Client, version int32, id uint32, h ExtWorkspaceManagerV1Handler) (*ExtWorkspaceManagerV1, error) {
85+ if h == nil {
86+ return nil, fmt.Errorf("purego-libwayland: nil handler for ext_workspace_manager_v1")
87+ }
88+ var self *ExtWorkspaceManagerV1
89+ r, err := c.CreateResource(ExtWorkspaceManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
90+ switch opcode {
91+ case 0:
92+ h.Commit(self)
93+ case 1:
94+ h.Stop(self)
95+ }
96+ })
97+ if err != nil {
98+ return nil, err
99+ }
100+ self = WrapExtWorkspaceManagerV1(r)
101+ r.Data = self
102+ return self, nil
103+}
104+
105+// SendWorkspaceGroup a workspace group has been created.
106+func (self *ExtWorkspaceManagerV1) SendWorkspaceGroup(workspaceGroup *ExtWorkspaceGroupHandleV1) {
107+ self.PostEvent(ExtWorkspaceManagerV1EventWorkspaceGroup, server.NewID(resourceOf(workspaceGroup)))
108+}
109+
110+// SendWorkspace workspace has been created.
111+func (self *ExtWorkspaceManagerV1) SendWorkspace(workspace *ExtWorkspaceHandleV1) {
112+ self.PostEvent(ExtWorkspaceManagerV1EventWorkspace, server.NewID(resourceOf(workspace)))
113+}
114+
115+// SendDone all information about the workspaces and workspace groups has been sent.
116+func (self *ExtWorkspaceManagerV1) SendDone() {
117+ self.PostEvent(ExtWorkspaceManagerV1EventDone)
118+}
119+
120+// SendFinished the compositor has finished with the workspace_manager.
121+func (self *ExtWorkspaceManagerV1) SendFinished() {
122+ self.PostEvent(ExtWorkspaceManagerV1EventFinished)
123+}
124+func NewExtWorkspaceManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
125+ return d.CreateGlobal(ExtWorkspaceManagerV1Interface, version, bind)
126+}
127+
128+// ExtWorkspaceGroupHandleV1 a workspace group assigned to a set of outputs.
129+type ExtWorkspaceGroupHandleV1 struct{ *server.Resource }
130+
131+func WrapExtWorkspaceGroupHandleV1(r *server.Resource) *ExtWorkspaceGroupHandleV1 {
132+ if r == nil {
133+ return nil
134+ }
135+ return &ExtWorkspaceGroupHandleV1{r}
136+}
137+
138+const ExtWorkspaceGroupHandleV1RequestCreateWorkspace uint32 = 0
139+const ExtWorkspaceGroupHandleV1RequestDestroy uint32 = 1
140+const ExtWorkspaceGroupHandleV1EventCapabilities uint32 = 0
141+const ExtWorkspaceGroupHandleV1EventOutputEnter uint32 = 1
142+const ExtWorkspaceGroupHandleV1EventOutputLeave uint32 = 2
143+const ExtWorkspaceGroupHandleV1EventWorkspaceEnter uint32 = 3
144+const ExtWorkspaceGroupHandleV1EventWorkspaceLeave uint32 = 4
145+const ExtWorkspaceGroupHandleV1EventRemoved uint32 = 5
146+
147+// ExtWorkspaceGroupHandleV1GroupCapabilities (bitfield).
148+type ExtWorkspaceGroupHandleV1GroupCapabilities uint32
149+
150+const (
151+ ExtWorkspaceGroupHandleV1GroupCapabilitiesCreateWorkspace ExtWorkspaceGroupHandleV1GroupCapabilities = 1
152+)
153+
154+// ExtWorkspaceGroupHandleV1Handler handles ext_workspace_group_handle_v1 requests.
155+type ExtWorkspaceGroupHandleV1Handler interface {
156+ CreateWorkspace(self *ExtWorkspaceGroupHandleV1, workspace string)
157+ Destroy(self *ExtWorkspaceGroupHandleV1)
158+}
159+
160+func NewExtWorkspaceGroupHandleV1(c server.Client, version int32, id uint32, h ExtWorkspaceGroupHandleV1Handler) (*ExtWorkspaceGroupHandleV1, error) {
161+ if h == nil {
162+ return nil, fmt.Errorf("purego-libwayland: nil handler for ext_workspace_group_handle_v1")
163+ }
164+ var self *ExtWorkspaceGroupHandleV1
165+ r, err := c.CreateResource(ExtWorkspaceGroupHandleV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
166+ switch opcode {
167+ case 0:
168+ h.CreateWorkspace(self, args[0].String())
169+ case 1:
170+ h.Destroy(self)
171+ self.Destroy()
172+ }
173+ })
174+ if err != nil {
175+ return nil, err
176+ }
177+ self = WrapExtWorkspaceGroupHandleV1(r)
178+ r.Data = self
179+ return self, nil
180+}
181+
182+// SendCapabilities compositor capabilities.
183+func (self *ExtWorkspaceGroupHandleV1) SendCapabilities(capabilities uint32) {
184+ self.PostEvent(ExtWorkspaceGroupHandleV1EventCapabilities, server.Uint(capabilities))
185+}
186+
187+// SendOutputEnter output assigned to workspace group.
188+func (self *ExtWorkspaceGroupHandleV1) SendOutputEnter(output *wayland.Output) {
189+ self.PostEvent(ExtWorkspaceGroupHandleV1EventOutputEnter, server.Object(resourceOf(output)))
190+}
191+
192+// SendOutputLeave output removed from workspace group.
193+func (self *ExtWorkspaceGroupHandleV1) SendOutputLeave(output *wayland.Output) {
194+ self.PostEvent(ExtWorkspaceGroupHandleV1EventOutputLeave, server.Object(resourceOf(output)))
195+}
196+
197+// SendWorkspaceEnter workspace added to workspace group.
198+func (self *ExtWorkspaceGroupHandleV1) SendWorkspaceEnter(workspace *ExtWorkspaceHandleV1) {
199+ self.PostEvent(ExtWorkspaceGroupHandleV1EventWorkspaceEnter, server.Object(resourceOf(workspace)))
200+}
201+
202+// SendWorkspaceLeave workspace removed from workspace group.
203+func (self *ExtWorkspaceGroupHandleV1) SendWorkspaceLeave(workspace *ExtWorkspaceHandleV1) {
204+ self.PostEvent(ExtWorkspaceGroupHandleV1EventWorkspaceLeave, server.Object(resourceOf(workspace)))
205+}
206+
207+// SendRemoved this workspace group has been removed.
208+func (self *ExtWorkspaceGroupHandleV1) SendRemoved() {
209+ self.PostEvent(ExtWorkspaceGroupHandleV1EventRemoved)
210+}
211+func NewExtWorkspaceGroupHandleV1Global(d *server.Display, version int32, bind server.BindFunc) error {
212+ return d.CreateGlobal(ExtWorkspaceGroupHandleV1Interface, version, bind)
213+}
214+
215+// ExtWorkspaceHandleV1 a workspace handing a group of surfaces.
216+type ExtWorkspaceHandleV1 struct{ *server.Resource }
217+
218+func WrapExtWorkspaceHandleV1(r *server.Resource) *ExtWorkspaceHandleV1 {
219+ if r == nil {
220+ return nil
221+ }
222+ return &ExtWorkspaceHandleV1{r}
223+}
224+
225+const ExtWorkspaceHandleV1RequestDestroy uint32 = 0
226+const ExtWorkspaceHandleV1RequestActivate uint32 = 1
227+const ExtWorkspaceHandleV1RequestDeactivate uint32 = 2
228+const ExtWorkspaceHandleV1RequestAssign uint32 = 3
229+const ExtWorkspaceHandleV1RequestRemove uint32 = 4
230+const ExtWorkspaceHandleV1EventId uint32 = 0
231+const ExtWorkspaceHandleV1EventName uint32 = 1
232+const ExtWorkspaceHandleV1EventCoordinates uint32 = 2
233+const ExtWorkspaceHandleV1EventState uint32 = 3
234+const ExtWorkspaceHandleV1EventCapabilities uint32 = 4
235+const ExtWorkspaceHandleV1EventRemoved uint32 = 5
236+
237+// ExtWorkspaceHandleV1State types of states on the workspace (bitfield).
238+type ExtWorkspaceHandleV1State uint32
239+
240+const (
241+ ExtWorkspaceHandleV1StateActive ExtWorkspaceHandleV1State = 1
242+ ExtWorkspaceHandleV1StateUrgent ExtWorkspaceHandleV1State = 2
243+ ExtWorkspaceHandleV1StateHidden ExtWorkspaceHandleV1State = 4
244+)
245+
246+// ExtWorkspaceHandleV1WorkspaceCapabilities (bitfield).
247+type ExtWorkspaceHandleV1WorkspaceCapabilities uint32
248+
249+const (
250+ ExtWorkspaceHandleV1WorkspaceCapabilitiesActivate ExtWorkspaceHandleV1WorkspaceCapabilities = 1
251+ ExtWorkspaceHandleV1WorkspaceCapabilitiesDeactivate ExtWorkspaceHandleV1WorkspaceCapabilities = 2
252+ ExtWorkspaceHandleV1WorkspaceCapabilitiesRemove ExtWorkspaceHandleV1WorkspaceCapabilities = 4
253+ ExtWorkspaceHandleV1WorkspaceCapabilitiesAssign ExtWorkspaceHandleV1WorkspaceCapabilities = 8
254+)
255+
256+// ExtWorkspaceHandleV1Handler handles ext_workspace_handle_v1 requests.
257+type ExtWorkspaceHandleV1Handler interface {
258+ Destroy(self *ExtWorkspaceHandleV1)
259+ Activate(self *ExtWorkspaceHandleV1)
260+ Deactivate(self *ExtWorkspaceHandleV1)
261+ Assign(self *ExtWorkspaceHandleV1, workspaceGroup *ExtWorkspaceGroupHandleV1)
262+ Remove(self *ExtWorkspaceHandleV1)
263+}
264+
265+func NewExtWorkspaceHandleV1(c server.Client, version int32, id uint32, h ExtWorkspaceHandleV1Handler) (*ExtWorkspaceHandleV1, error) {
266+ if h == nil {
267+ return nil, fmt.Errorf("purego-libwayland: nil handler for ext_workspace_handle_v1")
268+ }
269+ var self *ExtWorkspaceHandleV1
270+ r, err := c.CreateResource(ExtWorkspaceHandleV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
271+ switch opcode {
272+ case 0:
273+ h.Destroy(self)
274+ self.Destroy()
275+ case 1:
276+ h.Activate(self)
277+ case 2:
278+ h.Deactivate(self)
279+ case 3:
280+ h.Assign(self, WrapExtWorkspaceGroupHandleV1(args[0].Resource()))
281+ case 4:
282+ h.Remove(self)
283+ }
284+ })
285+ if err != nil {
286+ return nil, err
287+ }
288+ self = WrapExtWorkspaceHandleV1(r)
289+ r.Data = self
290+ return self, nil
291+}
292+
293+// SendId workspace id.
294+func (self *ExtWorkspaceHandleV1) SendId(id string) {
295+ var p runtime.Pinner
296+ defer p.Unpin()
297+ self.PostEvent(ExtWorkspaceHandleV1EventId, server.String(&p, id, false))
298+}
299+
300+// SendName workspace name changed.
301+func (self *ExtWorkspaceHandleV1) SendName(name string) {
302+ var p runtime.Pinner
303+ defer p.Unpin()
304+ self.PostEvent(ExtWorkspaceHandleV1EventName, server.String(&p, name, false))
305+}
306+
307+// SendCoordinates workspace coordinates changed.
308+func (self *ExtWorkspaceHandleV1) SendCoordinates(coordinates []byte) {
309+ var p runtime.Pinner
310+ defer p.Unpin()
311+ self.PostEvent(ExtWorkspaceHandleV1EventCoordinates, server.Array(&p, coordinates))
312+}
313+
314+// SendState the state of the workspace changed.
315+func (self *ExtWorkspaceHandleV1) SendState(state uint32) {
316+ self.PostEvent(ExtWorkspaceHandleV1EventState, server.Uint(state))
317+}
318+
319+// SendCapabilities compositor capabilities.
320+func (self *ExtWorkspaceHandleV1) SendCapabilities(capabilities uint32) {
321+ self.PostEvent(ExtWorkspaceHandleV1EventCapabilities, server.Uint(capabilities))
322+}
323+
324+// SendRemoved this workspace has been removed.
325+func (self *ExtWorkspaceHandleV1) SendRemoved() {
326+ self.PostEvent(ExtWorkspaceHandleV1EventRemoved)
327+}
328+func NewExtWorkspaceHandleV1Global(d *server.Display, version int32, bind server.BindFunc) error {
329+ return d.CreateGlobal(ExtWorkspaceHandleV1Interface, version, bind)
330+}
331+func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
332+ if v == nil {
333+ return nil
334+ }
335+ return v.GetResource()
336+}
337+func (self *ExtWorkspaceManagerV1) GetResource() *server.Resource {
338+ if self == nil {
339+ return nil
340+ }
341+ return self.Resource
342+}
343+func (self *ExtWorkspaceGroupHandleV1) GetResource() *server.Resource {
344+ if self == nil {
345+ return nil
346+ }
347+ return self.Resource
348+}
349+func (self *ExtWorkspaceHandleV1) GetResource() *server.Resource {
350+ if self == nil {
351+ return nil
352+ }
353+ return self.Resource
354+}
M protocol/gen.go +23 -0
@@ -35,3 +35,26 @@ package protocol
3535 //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
3636 //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
3737 //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
38+//go:generate go run ../cmd/wlgen -package alphamodifier -out alphamodifier/alphamodifier.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/alpha-modifier-v1.xml
39+//go:generate go run ../cmd/wlgen -package colormanagement -out colormanagement/colormanagement.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/color-management-v1.xml
40+//go:generate go run ../cmd/wlgen -package colorrepresentation -out colorrepresentation/colorrepresentation.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/color-representation-v1.xml
41+//go:generate go run ../cmd/wlgen -package drmlease -out drmlease/drmlease.go ../protocols/drm-lease-v1.xml
42+//go:generate go run ../cmd/wlgen -package extbackgroundeffect -out extbackgroundeffect/extbackgroundeffect.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/ext-background-effect-v1.xml
43+//go:generate go run ../cmd/wlgen -package extimagecapturesource -out extimagecapturesource/extimagecapturesource.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml -import extforeigntoplevellist=github.com/bnema/purego-libwayland/protocol/extforeigntoplevellist -import-xml extforeigntoplevellist=../protocols/ext-foreign-toplevel-list-v1.xml ../protocols/ext-image-capture-source-v1.xml
44+//go:generate go run ../cmd/wlgen -package extimagecopycapture -out extimagecopycapture/extimagecopycapture.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml -import extimagecapturesource=github.com/bnema/purego-libwayland/protocol/extimagecapturesource -import-xml extimagecapturesource=../protocols/ext-image-capture-source-v1.xml ../protocols/ext-image-copy-capture-v1.xml
45+//go:generate go run ../cmd/wlgen -package exttransientseat -out exttransientseat/exttransientseat.go ../protocols/ext-transient-seat-v1.xml
46+//go:generate go run ../cmd/wlgen -package extworkspace -out extworkspace/extworkspace.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/ext-workspace-v1.xml
47+//go:generate go run ../cmd/wlgen -package inputmethod -out inputmethod/inputmethod.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/input-method-unstable-v2.xml
48+//go:generate go run ../cmd/wlgen -package pointerwarp -out pointerwarp/pointerwarp.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/pointer-warp-v1.xml
49+//go:generate go run ../cmd/wlgen -package securitycontext -out securitycontext/securitycontext.go ../protocols/security-context-v1.xml
50+//go:generate go run ../cmd/wlgen -package singlepixelbuffer -out singlepixelbuffer/singlepixelbuffer.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/single-pixel-buffer-v1.xml
51+//go:generate go run ../cmd/wlgen -package textinput -out textinput/textinput.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/text-input-unstable-v3.xml
52+//go:generate go run ../cmd/wlgen -package wlrforeigntoplevel -out wlrforeigntoplevel/wlrforeigntoplevel.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/wlr-foreign-toplevel-management-unstable-v1.xml
53+//go:generate go run ../cmd/wlgen -package wlrgammacontrol -out wlrgammacontrol/wlrgammacontrol.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/wlr-gamma-control-unstable-v1.xml
54+//go:generate go run ../cmd/wlgen -package wlroutputmanagement -out wlroutputmanagement/wlroutputmanagement.go ../protocols/wlr-output-management-unstable-v1.xml
55+//go:generate go run ../cmd/wlgen -package wlrscreencopy -out wlrscreencopy/wlrscreencopy.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/wlr-screencopy-unstable-v1.xml
56+//go:generate go run ../cmd/wlgen -package wlrvirtualpointer -out wlrvirtualpointer/wlrvirtualpointer.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/wlr-virtual-pointer-unstable-v1.xml
57+//go:generate go run ../cmd/wlgen -package xdgsessionmanagement -out xdgsessionmanagement/xdgsessionmanagement.go -import xdgshell=github.com/bnema/purego-libwayland/protocol/xdgshell -import-xml xdgshell=../protocols/xdg-shell.xml ../protocols/xdg-session-management-v1.xml
58+//go:generate go run ../cmd/wlgen -package xdgtopleveldrag -out xdgtopleveldrag/xdgtopleveldrag.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-drag-v1.xml
59+//go:generate go run ../cmd/wlgen -package xwaylandkeyboardgrab -out xwaylandkeyboardgrab/xwaylandkeyboardgrab.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/xwayland-keyboard-grab-unstable-v1.xml
60+//go:generate go run ../cmd/wlgen -package xwaylandshell -out xwaylandshell/xwaylandshell.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/xwayland-shell-v1.xml
A protocol/inputmethod/inputmethod.go +361 -0
@@ -0,0 +1,361 @@
1+// Code generated by wlgen; DO NOT EDIT.
2+package inputmethod
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 ZwpInputMethodV2Interface *server.Interface
12+var ZwpInputPopupSurfaceV2Interface *server.Interface
13+var ZwpInputMethodKeyboardGrabV2Interface *server.Interface
14+var ZwpInputMethodManagerV2Interface *server.Interface
15+
16+func init() {
17+ ZwpInputMethodV2Interface = &server.Interface{Name: "zwp_input_method_v2", Version: 1}
18+ ZwpInputPopupSurfaceV2Interface = &server.Interface{Name: "zwp_input_popup_surface_v2", Version: 1}
19+ ZwpInputMethodKeyboardGrabV2Interface = &server.Interface{Name: "zwp_input_method_keyboard_grab_v2", Version: 1}
20+ ZwpInputMethodManagerV2Interface = &server.Interface{Name: "zwp_input_method_manager_v2", Version: 1}
21+ ZwpInputMethodV2Interface.Requests = []server.Message{
22+ {Name: "commit_string", Signature: "s", Types: []*server.Interface{nil}},
23+ {Name: "set_preedit_string", Signature: "sii", Types: []*server.Interface{nil, nil, nil}},
24+ {Name: "delete_surrounding_text", Signature: "uu", Types: []*server.Interface{nil, nil}},
25+ {Name: "commit", Signature: "u", Types: []*server.Interface{nil}},
26+ {Name: "get_input_popup_surface", Signature: "no", Types: []*server.Interface{ZwpInputPopupSurfaceV2Interface, wayland.SurfaceInterface}},
27+ {Name: "grab_keyboard", Signature: "n", Types: []*server.Interface{ZwpInputMethodKeyboardGrabV2Interface}},
28+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
29+ }
30+ ZwpInputMethodV2Interface.Events = []server.Message{
31+ {Name: "activate", Signature: "", Types: []*server.Interface{}},
32+ {Name: "deactivate", Signature: "", Types: []*server.Interface{}},
33+ {Name: "surrounding_text", Signature: "suu", Types: []*server.Interface{nil, nil, nil}},
34+ {Name: "text_change_cause", Signature: "u", Types: []*server.Interface{nil}},
35+ {Name: "content_type", Signature: "uu", Types: []*server.Interface{nil, nil}},
36+ {Name: "done", Signature: "", Types: []*server.Interface{}},
37+ {Name: "unavailable", Signature: "", Types: []*server.Interface{}},
38+ }
39+ ZwpInputPopupSurfaceV2Interface.Requests = []server.Message{
40+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
41+ }
42+ ZwpInputPopupSurfaceV2Interface.Events = []server.Message{
43+ {Name: "text_input_rectangle", Signature: "iiii", Types: []*server.Interface{nil, nil, nil, nil}},
44+ }
45+ ZwpInputMethodKeyboardGrabV2Interface.Requests = []server.Message{
46+ {Name: "release", Signature: "", Types: []*server.Interface{}},
47+ }
48+ ZwpInputMethodKeyboardGrabV2Interface.Events = []server.Message{
49+ {Name: "keymap", Signature: "uhu", Types: []*server.Interface{nil, nil, nil}},
50+ {Name: "key", Signature: "uuuu", Types: []*server.Interface{nil, nil, nil, nil}},
51+ {Name: "modifiers", Signature: "uuuuu", Types: []*server.Interface{nil, nil, nil, nil, nil}},
52+ {Name: "repeat_info", Signature: "ii", Types: []*server.Interface{nil, nil}},
53+ }
54+ ZwpInputMethodManagerV2Interface.Requests = []server.Message{
55+ {Name: "get_input_method", Signature: "on", Types: []*server.Interface{wayland.SeatInterface, ZwpInputMethodV2Interface}},
56+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
57+ }
58+ ZwpInputMethodManagerV2Interface.Events = []server.Message{}
59+ if err := server.NewInterfaces(ZwpInputMethodV2Interface, ZwpInputPopupSurfaceV2Interface, ZwpInputMethodKeyboardGrabV2Interface, ZwpInputMethodManagerV2Interface); err != nil {
60+ panic(err)
61+ }
62+}
63+
64+// ZwpInputMethodV2 input method.
65+type ZwpInputMethodV2 struct{ *server.Resource }
66+
67+func WrapZwpInputMethodV2(r *server.Resource) *ZwpInputMethodV2 {
68+ if r == nil {
69+ return nil
70+ }
71+ return &ZwpInputMethodV2{r}
72+}
73+
74+const ZwpInputMethodV2RequestCommitString uint32 = 0
75+const ZwpInputMethodV2RequestSetPreeditString uint32 = 1
76+const ZwpInputMethodV2RequestDeleteSurroundingText uint32 = 2
77+const ZwpInputMethodV2RequestCommit uint32 = 3
78+const ZwpInputMethodV2RequestGetInputPopupSurface uint32 = 4
79+const ZwpInputMethodV2RequestGrabKeyboard uint32 = 5
80+const ZwpInputMethodV2RequestDestroy uint32 = 6
81+const ZwpInputMethodV2EventActivate uint32 = 0
82+const ZwpInputMethodV2EventDeactivate uint32 = 1
83+const ZwpInputMethodV2EventSurroundingText uint32 = 2
84+const ZwpInputMethodV2EventTextChangeCause uint32 = 3
85+const ZwpInputMethodV2EventContentType uint32 = 4
86+const ZwpInputMethodV2EventDone uint32 = 5
87+const ZwpInputMethodV2EventUnavailable uint32 = 6
88+
89+// ZwpInputMethodV2Error .
90+type ZwpInputMethodV2Error uint32
91+
92+const (
93+ ZwpInputMethodV2ErrorRole ZwpInputMethodV2Error = 0
94+)
95+
96+// ZwpInputMethodV2Handler handles zwp_input_method_v2 requests.
97+type ZwpInputMethodV2Handler interface {
98+ CommitString(self *ZwpInputMethodV2, text string)
99+ SetPreeditString(self *ZwpInputMethodV2, text string, cursorBegin int32, cursorEnd int32)
100+ DeleteSurroundingText(self *ZwpInputMethodV2, beforeLength uint32, afterLength uint32)
101+ Commit(self *ZwpInputMethodV2, serial uint32)
102+ GetInputPopupSurface(self *ZwpInputMethodV2, id uint32, surface *wayland.Surface)
103+ GrabKeyboard(self *ZwpInputMethodV2, keyboard uint32)
104+ Destroy(self *ZwpInputMethodV2)
105+}
106+
107+func NewZwpInputMethodV2(c server.Client, version int32, id uint32, h ZwpInputMethodV2Handler) (*ZwpInputMethodV2, error) {
108+ if h == nil {
109+ return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_input_method_v2")
110+ }
111+ var self *ZwpInputMethodV2
112+ r, err := c.CreateResource(ZwpInputMethodV2Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
113+ switch opcode {
114+ case 0:
115+ h.CommitString(self, args[0].String())
116+ case 1:
117+ h.SetPreeditString(self, args[0].String(), args[1].Int(), args[2].Int())
118+ case 2:
119+ h.DeleteSurroundingText(self, args[0].Uint(), args[1].Uint())
120+ case 3:
121+ h.Commit(self, args[0].Uint())
122+ case 4:
123+ h.GetInputPopupSurface(self, args[0].NewID(), wayland.WrapSurface(args[1].Resource()))
124+ case 5:
125+ h.GrabKeyboard(self, args[0].NewID())
126+ case 6:
127+ h.Destroy(self)
128+ self.Destroy()
129+ }
130+ })
131+ if err != nil {
132+ return nil, err
133+ }
134+ self = WrapZwpInputMethodV2(r)
135+ r.Data = self
136+ return self, nil
137+}
138+
139+// SendActivate input method has been requested.
140+func (self *ZwpInputMethodV2) SendActivate() {
141+ self.PostEvent(ZwpInputMethodV2EventActivate)
142+}
143+
144+// SendDeactivate deactivate event.
145+func (self *ZwpInputMethodV2) SendDeactivate() {
146+ self.PostEvent(ZwpInputMethodV2EventDeactivate)
147+}
148+
149+// SendSurroundingText surrounding text event.
150+func (self *ZwpInputMethodV2) SendSurroundingText(text string, cursor uint32, anchor uint32) {
151+ var p runtime.Pinner
152+ defer p.Unpin()
153+ self.PostEvent(ZwpInputMethodV2EventSurroundingText, server.String(&p, text, false), server.Uint(cursor), server.Uint(anchor))
154+}
155+
156+// SendTextChangeCause indicates the cause of surrounding text change.
157+func (self *ZwpInputMethodV2) SendTextChangeCause(cause uint32) {
158+ self.PostEvent(ZwpInputMethodV2EventTextChangeCause, server.Uint(cause))
159+}
160+
161+// SendContentType content purpose and hint.
162+func (self *ZwpInputMethodV2) SendContentType(hint uint32, purpose uint32) {
163+ self.PostEvent(ZwpInputMethodV2EventContentType, server.Uint(hint), server.Uint(purpose))
164+}
165+
166+// SendDone apply state.
167+func (self *ZwpInputMethodV2) SendDone() {
168+ self.PostEvent(ZwpInputMethodV2EventDone)
169+}
170+
171+// SendUnavailable input method unavailable.
172+func (self *ZwpInputMethodV2) SendUnavailable() {
173+ self.PostEvent(ZwpInputMethodV2EventUnavailable)
174+}
175+func NewZwpInputMethodV2Global(d *server.Display, version int32, bind server.BindFunc) error {
176+ return d.CreateGlobal(ZwpInputMethodV2Interface, version, bind)
177+}
178+
179+// ZwpInputPopupSurfaceV2 popup surface.
180+type ZwpInputPopupSurfaceV2 struct{ *server.Resource }
181+
182+func WrapZwpInputPopupSurfaceV2(r *server.Resource) *ZwpInputPopupSurfaceV2 {
183+ if r == nil {
184+ return nil
185+ }
186+ return &ZwpInputPopupSurfaceV2{r}
187+}
188+
189+const ZwpInputPopupSurfaceV2RequestDestroy uint32 = 0
190+const ZwpInputPopupSurfaceV2EventTextInputRectangle uint32 = 0
191+
192+// ZwpInputPopupSurfaceV2Handler handles zwp_input_popup_surface_v2 requests.
193+type ZwpInputPopupSurfaceV2Handler interface {
194+ Destroy(self *ZwpInputPopupSurfaceV2)
195+}
196+
197+func NewZwpInputPopupSurfaceV2(c server.Client, version int32, id uint32, h ZwpInputPopupSurfaceV2Handler) (*ZwpInputPopupSurfaceV2, error) {
198+ if h == nil {
199+ return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_input_popup_surface_v2")
200+ }
201+ var self *ZwpInputPopupSurfaceV2
202+ r, err := c.CreateResource(ZwpInputPopupSurfaceV2Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
203+ switch opcode {
204+ case 0:
205+ h.Destroy(self)
206+ self.Destroy()
207+ }
208+ })
209+ if err != nil {
210+ return nil, err
211+ }
212+ self = WrapZwpInputPopupSurfaceV2(r)
213+ r.Data = self
214+ return self, nil
215+}
216+
217+// SendTextInputRectangle set text input area position.
218+func (self *ZwpInputPopupSurfaceV2) SendTextInputRectangle(x int32, y int32, width int32, height int32) {
219+ self.PostEvent(ZwpInputPopupSurfaceV2EventTextInputRectangle, server.Int(x), server.Int(y), server.Int(width), server.Int(height))
220+}
221+func NewZwpInputPopupSurfaceV2Global(d *server.Display, version int32, bind server.BindFunc) error {
222+ return d.CreateGlobal(ZwpInputPopupSurfaceV2Interface, version, bind)
223+}
224+
225+// ZwpInputMethodKeyboardGrabV2 keyboard grab.
226+type ZwpInputMethodKeyboardGrabV2 struct{ *server.Resource }
227+
228+func WrapZwpInputMethodKeyboardGrabV2(r *server.Resource) *ZwpInputMethodKeyboardGrabV2 {
229+ if r == nil {
230+ return nil
231+ }
232+ return &ZwpInputMethodKeyboardGrabV2{r}
233+}
234+
235+const ZwpInputMethodKeyboardGrabV2RequestRelease uint32 = 0
236+const ZwpInputMethodKeyboardGrabV2EventKeymap uint32 = 0
237+const ZwpInputMethodKeyboardGrabV2EventKey uint32 = 1
238+const ZwpInputMethodKeyboardGrabV2EventModifiers uint32 = 2
239+const ZwpInputMethodKeyboardGrabV2EventRepeatInfo uint32 = 3
240+
241+// ZwpInputMethodKeyboardGrabV2Handler handles zwp_input_method_keyboard_grab_v2 requests.
242+type ZwpInputMethodKeyboardGrabV2Handler interface {
243+ Release(self *ZwpInputMethodKeyboardGrabV2)
244+}
245+
246+func NewZwpInputMethodKeyboardGrabV2(c server.Client, version int32, id uint32, h ZwpInputMethodKeyboardGrabV2Handler) (*ZwpInputMethodKeyboardGrabV2, error) {
247+ if h == nil {
248+ return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_input_method_keyboard_grab_v2")
249+ }
250+ var self *ZwpInputMethodKeyboardGrabV2
251+ r, err := c.CreateResource(ZwpInputMethodKeyboardGrabV2Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
252+ switch opcode {
253+ case 0:
254+ h.Release(self)
255+ self.Destroy()
256+ }
257+ })
258+ if err != nil {
259+ return nil, err
260+ }
261+ self = WrapZwpInputMethodKeyboardGrabV2(r)
262+ r.Data = self
263+ return self, nil
264+}
265+
266+// SendKeymap keyboard mapping.
267+func (self *ZwpInputMethodKeyboardGrabV2) SendKeymap(format uint32, fd int, size uint32) {
268+ self.PostEvent(ZwpInputMethodKeyboardGrabV2EventKeymap, server.Uint(format), server.Fd(fd), server.Uint(size))
269+}
270+
271+// SendKey key event.
272+func (self *ZwpInputMethodKeyboardGrabV2) SendKey(serial uint32, time uint32, key uint32, state uint32) {
273+ self.PostEvent(ZwpInputMethodKeyboardGrabV2EventKey, server.Uint(serial), server.Uint(time), server.Uint(key), server.Uint(state))
274+}
275+
276+// SendModifiers modifier and group state.
277+func (self *ZwpInputMethodKeyboardGrabV2) SendModifiers(serial uint32, modsDepressed uint32, modsLatched uint32, modsLocked uint32, group uint32) {
278+ self.PostEvent(ZwpInputMethodKeyboardGrabV2EventModifiers, server.Uint(serial), server.Uint(modsDepressed), server.Uint(modsLatched), server.Uint(modsLocked), server.Uint(group))
279+}
280+
281+// SendRepeatInfo repeat rate and delay.
282+func (self *ZwpInputMethodKeyboardGrabV2) SendRepeatInfo(rate int32, delay int32) {
283+ self.PostEvent(ZwpInputMethodKeyboardGrabV2EventRepeatInfo, server.Int(rate), server.Int(delay))
284+}
285+func NewZwpInputMethodKeyboardGrabV2Global(d *server.Display, version int32, bind server.BindFunc) error {
286+ return d.CreateGlobal(ZwpInputMethodKeyboardGrabV2Interface, version, bind)
287+}
288+
289+// ZwpInputMethodManagerV2 input method manager.
290+type ZwpInputMethodManagerV2 struct{ *server.Resource }
291+
292+func WrapZwpInputMethodManagerV2(r *server.Resource) *ZwpInputMethodManagerV2 {
293+ if r == nil {
294+ return nil
295+ }
296+ return &ZwpInputMethodManagerV2{r}
297+}
298+
299+const ZwpInputMethodManagerV2RequestGetInputMethod uint32 = 0
300+const ZwpInputMethodManagerV2RequestDestroy uint32 = 1
301+
302+// ZwpInputMethodManagerV2Handler handles zwp_input_method_manager_v2 requests.
303+type ZwpInputMethodManagerV2Handler interface {
304+ GetInputMethod(self *ZwpInputMethodManagerV2, seat *wayland.Seat, inputMethod uint32)
305+ Destroy(self *ZwpInputMethodManagerV2)
306+}
307+
308+func NewZwpInputMethodManagerV2(c server.Client, version int32, id uint32, h ZwpInputMethodManagerV2Handler) (*ZwpInputMethodManagerV2, error) {
309+ if h == nil {
310+ return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_input_method_manager_v2")
311+ }
312+ var self *ZwpInputMethodManagerV2
313+ r, err := c.CreateResource(ZwpInputMethodManagerV2Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
314+ switch opcode {
315+ case 0:
316+ h.GetInputMethod(self, wayland.WrapSeat(args[0].Resource()), args[1].NewID())
317+ case 1:
318+ h.Destroy(self)
319+ self.Destroy()
320+ }
321+ })
322+ if err != nil {
323+ return nil, err
324+ }
325+ self = WrapZwpInputMethodManagerV2(r)
326+ r.Data = self
327+ return self, nil
328+}
329+func NewZwpInputMethodManagerV2Global(d *server.Display, version int32, bind server.BindFunc) error {
330+ return d.CreateGlobal(ZwpInputMethodManagerV2Interface, version, bind)
331+}
332+func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
333+ if v == nil {
334+ return nil
335+ }
336+ return v.GetResource()
337+}
338+func (self *ZwpInputMethodV2) GetResource() *server.Resource {
339+ if self == nil {
340+ return nil
341+ }
342+ return self.Resource
343+}
344+func (self *ZwpInputPopupSurfaceV2) GetResource() *server.Resource {
345+ if self == nil {
346+ return nil
347+ }
348+ return self.Resource
349+}
350+func (self *ZwpInputMethodKeyboardGrabV2) GetResource() *server.Resource {
351+ if self == nil {
352+ return nil
353+ }
354+ return self.Resource
355+}
356+func (self *ZwpInputMethodManagerV2) GetResource() *server.Resource {
357+ if self == nil {
358+ return nil
359+ }
360+ return self.Resource
361+}
A protocol/pointerwarp/pointerwarp.go +78 -0
@@ -0,0 +1,78 @@
1+// Code generated by wlgen; DO NOT EDIT.
2+package pointerwarp
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 WpPointerWarpV1Interface *server.Interface
11+
12+func init() {
13+ WpPointerWarpV1Interface = &server.Interface{Name: "wp_pointer_warp_v1", Version: 1}
14+ WpPointerWarpV1Interface.Requests = []server.Message{
15+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
16+ {Name: "warp_pointer", Signature: "ooffu", Types: []*server.Interface{wayland.SurfaceInterface, wayland.PointerInterface, nil, nil, nil}},
17+ }
18+ WpPointerWarpV1Interface.Events = []server.Message{}
19+ if err := server.NewInterfaces(WpPointerWarpV1Interface); err != nil {
20+ panic(err)
21+ }
22+}
23+
24+// WpPointerWarpV1 reposition the pointer to a location on a surface.
25+type WpPointerWarpV1 struct{ *server.Resource }
26+
27+func WrapWpPointerWarpV1(r *server.Resource) *WpPointerWarpV1 {
28+ if r == nil {
29+ return nil
30+ }
31+ return &WpPointerWarpV1{r}
32+}
33+
34+const WpPointerWarpV1RequestDestroy uint32 = 0
35+const WpPointerWarpV1RequestWarpPointer uint32 = 1
36+
37+// WpPointerWarpV1Handler handles wp_pointer_warp_v1 requests.
38+type WpPointerWarpV1Handler interface {
39+ Destroy(self *WpPointerWarpV1)
40+ WarpPointer(self *WpPointerWarpV1, surface *wayland.Surface, pointer *wayland.Pointer, x server.Fixed, y server.Fixed, serial uint32)
41+}
42+
43+func NewWpPointerWarpV1(c server.Client, version int32, id uint32, h WpPointerWarpV1Handler) (*WpPointerWarpV1, error) {
44+ if h == nil {
45+ return nil, fmt.Errorf("purego-libwayland: nil handler for wp_pointer_warp_v1")
46+ }
47+ var self *WpPointerWarpV1
48+ r, err := c.CreateResource(WpPointerWarpV1Interface, 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.WarpPointer(self, wayland.WrapSurface(args[0].Resource()), wayland.WrapPointer(args[1].Resource()), args[2].Fixed(), args[3].Fixed(), args[4].Uint())
55+ }
56+ })
57+ if err != nil {
58+ return nil, err
59+ }
60+ self = WrapWpPointerWarpV1(r)
61+ r.Data = self
62+ return self, nil
63+}
64+func NewWpPointerWarpV1Global(d *server.Display, version int32, bind server.BindFunc) error {
65+ return d.CreateGlobal(WpPointerWarpV1Interface, 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 *WpPointerWarpV1) GetResource() *server.Resource {
74+ if self == nil {
75+ return nil
76+ }
77+ return self.Resource
78+}
M protocol/protocol_test.go +23 -0
@@ -5,40 +5,63 @@ package protocol_test
55 import (
66 "testing"
77
8+ _ "github.com/bnema/purego-libwayland/protocol/alphamodifier"
9+ _ "github.com/bnema/purego-libwayland/protocol/colormanagement"
10+ _ "github.com/bnema/purego-libwayland/protocol/colorrepresentation"
811 _ "github.com/bnema/purego-libwayland/protocol/committiming"
912 _ "github.com/bnema/purego-libwayland/protocol/contenttype"
1013 _ "github.com/bnema/purego-libwayland/protocol/cursorshape"
14+ _ "github.com/bnema/purego-libwayland/protocol/drmlease"
15+ _ "github.com/bnema/purego-libwayland/protocol/extbackgroundeffect"
1116 _ "github.com/bnema/purego-libwayland/protocol/extdatacontrol"
1217 _ "github.com/bnema/purego-libwayland/protocol/extforeigntoplevellist"
1318 _ "github.com/bnema/purego-libwayland/protocol/extidlenotify"
19+ _ "github.com/bnema/purego-libwayland/protocol/extimagecapturesource"
20+ _ "github.com/bnema/purego-libwayland/protocol/extimagecopycapture"
1421 _ "github.com/bnema/purego-libwayland/protocol/extsessionlock"
22+ _ "github.com/bnema/purego-libwayland/protocol/exttransientseat"
23+ _ "github.com/bnema/purego-libwayland/protocol/extworkspace"
1524 _ "github.com/bnema/purego-libwayland/protocol/fifo"
1625 _ "github.com/bnema/purego-libwayland/protocol/fractionalscale"
1726 _ "github.com/bnema/purego-libwayland/protocol/idleinhibit"
27+ _ "github.com/bnema/purego-libwayland/protocol/inputmethod"
1828 _ "github.com/bnema/purego-libwayland/protocol/kdedecoration"
1929 _ "github.com/bnema/purego-libwayland/protocol/keyboardshortcutsinhibit"
2030 _ "github.com/bnema/purego-libwayland/protocol/linuxdmabuf"
2131 _ "github.com/bnema/purego-libwayland/protocol/linuxdrmsyncobj"
2232 _ "github.com/bnema/purego-libwayland/protocol/pointerconstraints"
2333 _ "github.com/bnema/purego-libwayland/protocol/pointergestures"
34+ _ "github.com/bnema/purego-libwayland/protocol/pointerwarp"
2435 _ "github.com/bnema/purego-libwayland/protocol/presentationtime"
2536 _ "github.com/bnema/purego-libwayland/protocol/primaryselection"
2637 _ "github.com/bnema/purego-libwayland/protocol/relativepointer"
38+ _ "github.com/bnema/purego-libwayland/protocol/securitycontext"
39+ _ "github.com/bnema/purego-libwayland/protocol/singlepixelbuffer"
2740 _ "github.com/bnema/purego-libwayland/protocol/tabletv2"
2841 _ "github.com/bnema/purego-libwayland/protocol/tearingcontrol"
42+ _ "github.com/bnema/purego-libwayland/protocol/textinput"
2943 _ "github.com/bnema/purego-libwayland/protocol/viewporter"
3044 _ "github.com/bnema/purego-libwayland/protocol/virtualkeyboard"
3145 _ "github.com/bnema/purego-libwayland/protocol/wayland"
46+ _ "github.com/bnema/purego-libwayland/protocol/wlrforeigntoplevel"
47+ _ "github.com/bnema/purego-libwayland/protocol/wlrgammacontrol"
3248 _ "github.com/bnema/purego-libwayland/protocol/wlrlayershell"
49+ _ "github.com/bnema/purego-libwayland/protocol/wlroutputmanagement"
50+ _ "github.com/bnema/purego-libwayland/protocol/wlrscreencopy"
51+ _ "github.com/bnema/purego-libwayland/protocol/wlrvirtualpointer"
3352 _ "github.com/bnema/purego-libwayland/protocol/xdgactivation"
3453 _ "github.com/bnema/purego-libwayland/protocol/xdgdecoration"
3554 _ "github.com/bnema/purego-libwayland/protocol/xdgdialog"
3655 _ "github.com/bnema/purego-libwayland/protocol/xdgforeign"
3756 _ "github.com/bnema/purego-libwayland/protocol/xdgoutput"
57+ _ "github.com/bnema/purego-libwayland/protocol/xdgsessionmanagement"
3858 _ "github.com/bnema/purego-libwayland/protocol/xdgshell"
3959 _ "github.com/bnema/purego-libwayland/protocol/xdgsystembell"
60+ _ "github.com/bnema/purego-libwayland/protocol/xdgtopleveldrag"
4061 _ "github.com/bnema/purego-libwayland/protocol/xdgtoplevelicon"
4162 _ "github.com/bnema/purego-libwayland/protocol/xdgtopleveltag"
63+ _ "github.com/bnema/purego-libwayland/protocol/xwaylandkeyboardgrab"
64+ _ "github.com/bnema/purego-libwayland/protocol/xwaylandshell"
4265 )
4366
4467 func TestGeneratedPackagesInit(t *testing.T) {}
A protocol/securitycontext/securitycontext.go +166 -0
@@ -0,0 +1,166 @@
1+// Code generated by wlgen; DO NOT EDIT.
2+package securitycontext
3+
4+import (
5+ "fmt"
6+ "github.com/bnema/purego-libwayland/server"
7+)
8+
9+var WpSecurityContextManagerV1Interface *server.Interface
10+var WpSecurityContextV1Interface *server.Interface
11+
12+func init() {
13+ WpSecurityContextManagerV1Interface = &server.Interface{Name: "wp_security_context_manager_v1", Version: 1}
14+ WpSecurityContextV1Interface = &server.Interface{Name: "wp_security_context_v1", Version: 1}
15+ WpSecurityContextManagerV1Interface.Requests = []server.Message{
16+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
17+ {Name: "create_listener", Signature: "nhh", Types: []*server.Interface{WpSecurityContextV1Interface, nil, nil}},
18+ }
19+ WpSecurityContextManagerV1Interface.Events = []server.Message{}
20+ WpSecurityContextV1Interface.Requests = []server.Message{
21+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
22+ {Name: "set_sandbox_engine", Signature: "s", Types: []*server.Interface{nil}},
23+ {Name: "set_app_id", Signature: "s", Types: []*server.Interface{nil}},
24+ {Name: "set_instance_id", Signature: "s", Types: []*server.Interface{nil}},
25+ {Name: "commit", Signature: "", Types: []*server.Interface{}},
26+ }
27+ WpSecurityContextV1Interface.Events = []server.Message{}
28+ if err := server.NewInterfaces(WpSecurityContextManagerV1Interface, WpSecurityContextV1Interface); err != nil {
29+ panic(err)
30+ }
31+}
32+
33+// WpSecurityContextManagerV1 client security context manager.
34+type WpSecurityContextManagerV1 struct{ *server.Resource }
35+
36+func WrapWpSecurityContextManagerV1(r *server.Resource) *WpSecurityContextManagerV1 {
37+ if r == nil {
38+ return nil
39+ }
40+ return &WpSecurityContextManagerV1{r}
41+}
42+
43+const WpSecurityContextManagerV1RequestDestroy uint32 = 0
44+const WpSecurityContextManagerV1RequestCreateListener uint32 = 1
45+
46+// WpSecurityContextManagerV1Error .
47+type WpSecurityContextManagerV1Error uint32
48+
49+const (
50+ WpSecurityContextManagerV1ErrorInvalidListenFd WpSecurityContextManagerV1Error = 1
51+ WpSecurityContextManagerV1ErrorNested WpSecurityContextManagerV1Error = 2
52+)
53+
54+// WpSecurityContextManagerV1Handler handles wp_security_context_manager_v1 requests.
55+type WpSecurityContextManagerV1Handler interface {
56+ Destroy(self *WpSecurityContextManagerV1)
57+ CreateListener(self *WpSecurityContextManagerV1, id uint32, listenFd int, closeFd int)
58+}
59+
60+func NewWpSecurityContextManagerV1(c server.Client, version int32, id uint32, h WpSecurityContextManagerV1Handler) (*WpSecurityContextManagerV1, error) {
61+ if h == nil {
62+ return nil, fmt.Errorf("purego-libwayland: nil handler for wp_security_context_manager_v1")
63+ }
64+ var self *WpSecurityContextManagerV1
65+ r, err := c.CreateResource(WpSecurityContextManagerV1Interface, 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.CreateListener(self, args[0].NewID(), args[1].Fd(), args[2].Fd())
72+ }
73+ })
74+ if err != nil {
75+ return nil, err
76+ }
77+ self = WrapWpSecurityContextManagerV1(r)
78+ r.Data = self
79+ return self, nil
80+}
81+func NewWpSecurityContextManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
82+ return d.CreateGlobal(WpSecurityContextManagerV1Interface, version, bind)
83+}
84+
85+// WpSecurityContextV1 client security context.
86+type WpSecurityContextV1 struct{ *server.Resource }
87+
88+func WrapWpSecurityContextV1(r *server.Resource) *WpSecurityContextV1 {
89+ if r == nil {
90+ return nil
91+ }
92+ return &WpSecurityContextV1{r}
93+}
94+
95+const WpSecurityContextV1RequestDestroy uint32 = 0
96+const WpSecurityContextV1RequestSetSandboxEngine uint32 = 1
97+const WpSecurityContextV1RequestSetAppId uint32 = 2
98+const WpSecurityContextV1RequestSetInstanceId uint32 = 3
99+const WpSecurityContextV1RequestCommit uint32 = 4
100+
101+// WpSecurityContextV1Error .
102+type WpSecurityContextV1Error uint32
103+
104+const (
105+ WpSecurityContextV1ErrorAlreadyUsed WpSecurityContextV1Error = 1
106+ WpSecurityContextV1ErrorAlreadySet WpSecurityContextV1Error = 2
107+ WpSecurityContextV1ErrorInvalidMetadata WpSecurityContextV1Error = 3
108+)
109+
110+// WpSecurityContextV1Handler handles wp_security_context_v1 requests.
111+type WpSecurityContextV1Handler interface {
112+ Destroy(self *WpSecurityContextV1)
113+ SetSandboxEngine(self *WpSecurityContextV1, name string)
114+ SetAppId(self *WpSecurityContextV1, appId string)
115+ SetInstanceId(self *WpSecurityContextV1, instanceId string)
116+ Commit(self *WpSecurityContextV1)
117+}
118+
119+func NewWpSecurityContextV1(c server.Client, version int32, id uint32, h WpSecurityContextV1Handler) (*WpSecurityContextV1, error) {
120+ if h == nil {
121+ return nil, fmt.Errorf("purego-libwayland: nil handler for wp_security_context_v1")
122+ }
123+ var self *WpSecurityContextV1
124+ r, err := c.CreateResource(WpSecurityContextV1Interface, 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.SetSandboxEngine(self, args[0].String())
131+ case 2:
132+ h.SetAppId(self, args[0].String())
133+ case 3:
134+ h.SetInstanceId(self, args[0].String())
135+ case 4:
136+ h.Commit(self)
137+ }
138+ })
139+ if err != nil {
140+ return nil, err
141+ }
142+ self = WrapWpSecurityContextV1(r)
143+ r.Data = self
144+ return self, nil
145+}
146+func NewWpSecurityContextV1Global(d *server.Display, version int32, bind server.BindFunc) error {
147+ return d.CreateGlobal(WpSecurityContextV1Interface, version, bind)
148+}
149+func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
150+ if v == nil {
151+ return nil
152+ }
153+ return v.GetResource()
154+}
155+func (self *WpSecurityContextManagerV1) GetResource() *server.Resource {
156+ if self == nil {
157+ return nil
158+ }
159+ return self.Resource
160+}
161+func (self *WpSecurityContextV1) GetResource() *server.Resource {
162+ if self == nil {
163+ return nil
164+ }
165+ return self.Resource
166+}
A protocol/singlepixelbuffer/singlepixelbuffer.go +78 -0
@@ -0,0 +1,78 @@
1+// Code generated by wlgen; DO NOT EDIT.
2+package singlepixelbuffer
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 WpSinglePixelBufferManagerV1Interface *server.Interface
11+
12+func init() {
13+ WpSinglePixelBufferManagerV1Interface = &server.Interface{Name: "wp_single_pixel_buffer_manager_v1", Version: 1}
14+ WpSinglePixelBufferManagerV1Interface.Requests = []server.Message{
15+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
16+ {Name: "create_u32_rgba_buffer", Signature: "nuuuu", Types: []*server.Interface{wayland.BufferInterface, nil, nil, nil, nil}},
17+ }
18+ WpSinglePixelBufferManagerV1Interface.Events = []server.Message{}
19+ if err := server.NewInterfaces(WpSinglePixelBufferManagerV1Interface); err != nil {
20+ panic(err)
21+ }
22+}
23+
24+// WpSinglePixelBufferManagerV1 global factory for single-pixel buffers.
25+type WpSinglePixelBufferManagerV1 struct{ *server.Resource }
26+
27+func WrapWpSinglePixelBufferManagerV1(r *server.Resource) *WpSinglePixelBufferManagerV1 {
28+ if r == nil {
29+ return nil
30+ }
31+ return &WpSinglePixelBufferManagerV1{r}
32+}
33+
34+const WpSinglePixelBufferManagerV1RequestDestroy uint32 = 0
35+const WpSinglePixelBufferManagerV1RequestCreateU32RgbaBuffer uint32 = 1
36+
37+// WpSinglePixelBufferManagerV1Handler handles wp_single_pixel_buffer_manager_v1 requests.
38+type WpSinglePixelBufferManagerV1Handler interface {
39+ Destroy(self *WpSinglePixelBufferManagerV1)
40+ CreateU32RgbaBuffer(self *WpSinglePixelBufferManagerV1, id uint32, r uint32, g uint32, b uint32, a uint32)
41+}
42+
43+func NewWpSinglePixelBufferManagerV1(c server.Client, version int32, id uint32, h WpSinglePixelBufferManagerV1Handler) (*WpSinglePixelBufferManagerV1, error) {
44+ if h == nil {
45+ return nil, fmt.Errorf("purego-libwayland: nil handler for wp_single_pixel_buffer_manager_v1")
46+ }
47+ var self *WpSinglePixelBufferManagerV1
48+ r, err := c.CreateResource(WpSinglePixelBufferManagerV1Interface, 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.CreateU32RgbaBuffer(self, args[0].NewID(), args[1].Uint(), args[2].Uint(), args[3].Uint(), args[4].Uint())
55+ }
56+ })
57+ if err != nil {
58+ return nil, err
59+ }
60+ self = WrapWpSinglePixelBufferManagerV1(r)
61+ r.Data = self
62+ return self, nil
63+}
64+func NewWpSinglePixelBufferManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
65+ return d.CreateGlobal(WpSinglePixelBufferManagerV1Interface, 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 *WpSinglePixelBufferManagerV1) GetResource() *server.Resource {
74+ if self == nil {
75+ return nil
76+ }
77+ return self.Resource
78+}
A protocol/textinput/textinput.go +327 -0
@@ -0,0 +1,327 @@
1+// Code generated by wlgen; DO NOT EDIT.
2+package textinput
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 ZwpTextInputV3Interface *server.Interface
12+var ZwpTextInputManagerV3Interface *server.Interface
13+
14+func init() {
15+ ZwpTextInputV3Interface = &server.Interface{Name: "zwp_text_input_v3", Version: 2}
16+ ZwpTextInputManagerV3Interface = &server.Interface{Name: "zwp_text_input_manager_v3", Version: 2}
17+ ZwpTextInputV3Interface.Requests = []server.Message{
18+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
19+ {Name: "enable", Signature: "", Types: []*server.Interface{}},
20+ {Name: "disable", Signature: "", Types: []*server.Interface{}},
21+ {Name: "set_surrounding_text", Signature: "sii", Types: []*server.Interface{nil, nil, nil}},
22+ {Name: "set_text_change_cause", Signature: "u", Types: []*server.Interface{nil}},
23+ {Name: "set_content_type", Signature: "uu", Types: []*server.Interface{nil, nil}},
24+ {Name: "set_cursor_rectangle", Signature: "iiii", Types: []*server.Interface{nil, nil, nil, nil}},
25+ {Name: "commit", Signature: "", Types: []*server.Interface{}},
26+ {Name: "set_available_actions", Signature: "2a", Types: []*server.Interface{nil}},
27+ {Name: "show_input_panel", Signature: "2", Types: []*server.Interface{}},
28+ {Name: "hide_input_panel", Signature: "2", Types: []*server.Interface{}},
29+ }
30+ ZwpTextInputV3Interface.Events = []server.Message{
31+ {Name: "enter", Signature: "o", Types: []*server.Interface{wayland.SurfaceInterface}},
32+ {Name: "leave", Signature: "o", Types: []*server.Interface{wayland.SurfaceInterface}},
33+ {Name: "preedit_string", Signature: "?sii", Types: []*server.Interface{nil, nil, nil}},
34+ {Name: "commit_string", Signature: "?s", Types: []*server.Interface{nil}},
35+ {Name: "delete_surrounding_text", Signature: "uu", Types: []*server.Interface{nil, nil}},
36+ {Name: "done", Signature: "u", Types: []*server.Interface{nil}},
37+ {Name: "action", Signature: "2uu", Types: []*server.Interface{nil, nil}},
38+ {Name: "language", Signature: "2s", Types: []*server.Interface{nil}},
39+ {Name: "preedit_hint", Signature: "2uuu", Types: []*server.Interface{nil, nil, nil}},
40+ }
41+ ZwpTextInputManagerV3Interface.Requests = []server.Message{
42+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
43+ {Name: "get_text_input", Signature: "no", Types: []*server.Interface{ZwpTextInputV3Interface, wayland.SeatInterface}},
44+ }
45+ ZwpTextInputManagerV3Interface.Events = []server.Message{}
46+ if err := server.NewInterfaces(ZwpTextInputV3Interface, ZwpTextInputManagerV3Interface); err != nil {
47+ panic(err)
48+ }
49+}
50+
51+// ZwpTextInputV3 text input.
52+type ZwpTextInputV3 struct{ *server.Resource }
53+
54+func WrapZwpTextInputV3(r *server.Resource) *ZwpTextInputV3 {
55+ if r == nil {
56+ return nil
57+ }
58+ return &ZwpTextInputV3{r}
59+}
60+
61+const ZwpTextInputV3RequestDestroy uint32 = 0
62+const ZwpTextInputV3RequestEnable uint32 = 1
63+const ZwpTextInputV3RequestDisable uint32 = 2
64+const ZwpTextInputV3RequestSetSurroundingText uint32 = 3
65+const ZwpTextInputV3RequestSetTextChangeCause uint32 = 4
66+const ZwpTextInputV3RequestSetContentType uint32 = 5
67+const ZwpTextInputV3RequestSetCursorRectangle uint32 = 6
68+const ZwpTextInputV3RequestCommit uint32 = 7
69+const ZwpTextInputV3RequestSetAvailableActions uint32 = 8
70+const ZwpTextInputV3RequestShowInputPanel uint32 = 9
71+const ZwpTextInputV3RequestHideInputPanel uint32 = 10
72+const ZwpTextInputV3EventEnter uint32 = 0
73+const ZwpTextInputV3EventLeave uint32 = 1
74+const ZwpTextInputV3EventPreeditString uint32 = 2
75+const ZwpTextInputV3EventCommitString uint32 = 3
76+const ZwpTextInputV3EventDeleteSurroundingText uint32 = 4
77+const ZwpTextInputV3EventDone uint32 = 5
78+const ZwpTextInputV3EventAction uint32 = 6
79+const ZwpTextInputV3EventLanguage uint32 = 7
80+const ZwpTextInputV3EventPreeditHint uint32 = 8
81+
82+// ZwpTextInputV3ChangeCause text change reason.
83+type ZwpTextInputV3ChangeCause uint32
84+
85+const (
86+ ZwpTextInputV3ChangeCauseInputMethod ZwpTextInputV3ChangeCause = 0
87+ ZwpTextInputV3ChangeCauseOther ZwpTextInputV3ChangeCause = 1
88+)
89+
90+// ZwpTextInputV3ContentHint content hint (bitfield).
91+type ZwpTextInputV3ContentHint uint32
92+
93+const (
94+ ZwpTextInputV3ContentHintNone ZwpTextInputV3ContentHint = 0x0
95+ ZwpTextInputV3ContentHintCompletion ZwpTextInputV3ContentHint = 0x1
96+ ZwpTextInputV3ContentHintSpellcheck ZwpTextInputV3ContentHint = 0x2
97+ ZwpTextInputV3ContentHintAutoCapitalization ZwpTextInputV3ContentHint = 0x4
98+ ZwpTextInputV3ContentHintLowercase ZwpTextInputV3ContentHint = 0x8
99+ ZwpTextInputV3ContentHintUppercase ZwpTextInputV3ContentHint = 0x10
100+ ZwpTextInputV3ContentHintTitlecase ZwpTextInputV3ContentHint = 0x20
101+ ZwpTextInputV3ContentHintHiddenText ZwpTextInputV3ContentHint = 0x40
102+ ZwpTextInputV3ContentHintSensitiveData ZwpTextInputV3ContentHint = 0x80
103+ ZwpTextInputV3ContentHintLatin ZwpTextInputV3ContentHint = 0x100
104+ ZwpTextInputV3ContentHintMultiline ZwpTextInputV3ContentHint = 0x200
105+ ZwpTextInputV3ContentHintOnScreenInputProvided ZwpTextInputV3ContentHint = 0x400
106+ ZwpTextInputV3ContentHintNoEmoji ZwpTextInputV3ContentHint = 0x800
107+ ZwpTextInputV3ContentHintPreeditShown ZwpTextInputV3ContentHint = 0x1000
108+)
109+
110+// ZwpTextInputV3ContentPurpose content purpose.
111+type ZwpTextInputV3ContentPurpose uint32
112+
113+const (
114+ ZwpTextInputV3ContentPurposeNormal ZwpTextInputV3ContentPurpose = 0
115+ ZwpTextInputV3ContentPurposeAlpha ZwpTextInputV3ContentPurpose = 1
116+ ZwpTextInputV3ContentPurposeDigits ZwpTextInputV3ContentPurpose = 2
117+ ZwpTextInputV3ContentPurposeNumber ZwpTextInputV3ContentPurpose = 3
118+ ZwpTextInputV3ContentPurposePhone ZwpTextInputV3ContentPurpose = 4
119+ ZwpTextInputV3ContentPurposeUrl ZwpTextInputV3ContentPurpose = 5
120+ ZwpTextInputV3ContentPurposeEmail ZwpTextInputV3ContentPurpose = 6
121+ ZwpTextInputV3ContentPurposeName ZwpTextInputV3ContentPurpose = 7
122+ ZwpTextInputV3ContentPurposePassword ZwpTextInputV3ContentPurpose = 8
123+ ZwpTextInputV3ContentPurposePin ZwpTextInputV3ContentPurpose = 9
124+ ZwpTextInputV3ContentPurposeDate ZwpTextInputV3ContentPurpose = 10
125+ ZwpTextInputV3ContentPurposeTime ZwpTextInputV3ContentPurpose = 11
126+ ZwpTextInputV3ContentPurposeDatetime ZwpTextInputV3ContentPurpose = 12
127+ ZwpTextInputV3ContentPurposeTerminal ZwpTextInputV3ContentPurpose = 13
128+)
129+
130+// ZwpTextInputV3Error .
131+type ZwpTextInputV3Error uint32
132+
133+const (
134+ ZwpTextInputV3ErrorInvalidAction ZwpTextInputV3Error = 0
135+)
136+
137+// ZwpTextInputV3Action action.
138+type ZwpTextInputV3Action uint32
139+
140+const (
141+ ZwpTextInputV3ActionNone ZwpTextInputV3Action = 0
142+ ZwpTextInputV3ActionSubmit ZwpTextInputV3Action = 1
143+)
144+
145+// ZwpTextInputV3PreeditHint preedit style hint.
146+type ZwpTextInputV3PreeditHint uint32
147+
148+const (
149+ ZwpTextInputV3PreeditHintWhole ZwpTextInputV3PreeditHint = 1
150+ ZwpTextInputV3PreeditHintSelection ZwpTextInputV3PreeditHint = 2
151+ ZwpTextInputV3PreeditHintPrediction ZwpTextInputV3PreeditHint = 3
152+ ZwpTextInputV3PreeditHintPrefix ZwpTextInputV3PreeditHint = 4
153+ ZwpTextInputV3PreeditHintSuffix ZwpTextInputV3PreeditHint = 5
154+ ZwpTextInputV3PreeditHintSpellingError ZwpTextInputV3PreeditHint = 6
155+ ZwpTextInputV3PreeditHintComposeError ZwpTextInputV3PreeditHint = 7
156+)
157+
158+// ZwpTextInputV3Handler handles zwp_text_input_v3 requests.
159+type ZwpTextInputV3Handler interface {
160+ Destroy(self *ZwpTextInputV3)
161+ Enable(self *ZwpTextInputV3)
162+ Disable(self *ZwpTextInputV3)
163+ SetSurroundingText(self *ZwpTextInputV3, text string, cursor int32, anchor int32)
164+ SetTextChangeCause(self *ZwpTextInputV3, cause uint32)
165+ SetContentType(self *ZwpTextInputV3, hint uint32, purpose uint32)
166+ SetCursorRectangle(self *ZwpTextInputV3, x int32, y int32, width int32, height int32)
167+ Commit(self *ZwpTextInputV3)
168+ SetAvailableActions(self *ZwpTextInputV3, availableActions []byte)
169+ ShowInputPanel(self *ZwpTextInputV3)
170+ HideInputPanel(self *ZwpTextInputV3)
171+}
172+
173+func NewZwpTextInputV3(c server.Client, version int32, id uint32, h ZwpTextInputV3Handler) (*ZwpTextInputV3, error) {
174+ if h == nil {
175+ return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_text_input_v3")
176+ }
177+ var self *ZwpTextInputV3
178+ r, err := c.CreateResource(ZwpTextInputV3Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
179+ switch opcode {
180+ case 0:
181+ h.Destroy(self)
182+ self.Destroy()
183+ case 1:
184+ h.Enable(self)
185+ case 2:
186+ h.Disable(self)
187+ case 3:
188+ h.SetSurroundingText(self, args[0].String(), args[1].Int(), args[2].Int())
189+ case 4:
190+ h.SetTextChangeCause(self, args[0].Uint())
191+ case 5:
192+ h.SetContentType(self, args[0].Uint(), args[1].Uint())
193+ case 6:
194+ h.SetCursorRectangle(self, args[0].Int(), args[1].Int(), args[2].Int(), args[3].Int())
195+ case 7:
196+ h.Commit(self)
197+ case 8:
198+ h.SetAvailableActions(self, args[0].Array())
199+ case 9:
200+ h.ShowInputPanel(self)
201+ case 10:
202+ h.HideInputPanel(self)
203+ }
204+ })
205+ if err != nil {
206+ return nil, err
207+ }
208+ self = WrapZwpTextInputV3(r)
209+ r.Data = self
210+ return self, nil
211+}
212+
213+// SendEnter enter event.
214+func (self *ZwpTextInputV3) SendEnter(surface *wayland.Surface) {
215+ self.PostEvent(ZwpTextInputV3EventEnter, server.Object(resourceOf(surface)))
216+}
217+
218+// SendLeave leave event.
219+func (self *ZwpTextInputV3) SendLeave(surface *wayland.Surface) {
220+ self.PostEvent(ZwpTextInputV3EventLeave, server.Object(resourceOf(surface)))
221+}
222+
223+// SendPreeditString pre-edit.
224+func (self *ZwpTextInputV3) SendPreeditString(text string, cursorBegin int32, cursorEnd int32) {
225+ var p runtime.Pinner
226+ defer p.Unpin()
227+ self.PostEvent(ZwpTextInputV3EventPreeditString, server.String(&p, text, true), server.Int(cursorBegin), server.Int(cursorEnd))
228+}
229+
230+// SendCommitString text commit.
231+func (self *ZwpTextInputV3) SendCommitString(text string) {
232+ var p runtime.Pinner
233+ defer p.Unpin()
234+ self.PostEvent(ZwpTextInputV3EventCommitString, server.String(&p, text, true))
235+}
236+
237+// SendDeleteSurroundingText delete surrounding text.
238+func (self *ZwpTextInputV3) SendDeleteSurroundingText(beforeLength uint32, afterLength uint32) {
239+ self.PostEvent(ZwpTextInputV3EventDeleteSurroundingText, server.Uint(beforeLength), server.Uint(afterLength))
240+}
241+
242+// SendDone apply changes.
243+func (self *ZwpTextInputV3) SendDone(serial uint32) {
244+ self.PostEvent(ZwpTextInputV3EventDone, server.Uint(serial))
245+}
246+
247+// SendAction action performed (since version 2).
248+func (self *ZwpTextInputV3) SendAction(action uint32, serial uint32) {
249+ self.PostEvent(ZwpTextInputV3EventAction, server.Uint(action), server.Uint(serial))
250+}
251+
252+// SendLanguage notify of language selection (since version 2).
253+func (self *ZwpTextInputV3) SendLanguage(language string) {
254+ var p runtime.Pinner
255+ defer p.Unpin()
256+ self.PostEvent(ZwpTextInputV3EventLanguage, server.String(&p, language, false))
257+}
258+
259+// SendPreeditHint pre-edit (since version 2).
260+func (self *ZwpTextInputV3) SendPreeditHint(start uint32, end uint32, hint uint32) {
261+ self.PostEvent(ZwpTextInputV3EventPreeditHint, server.Uint(start), server.Uint(end), server.Uint(hint))
262+}
263+func NewZwpTextInputV3Global(d *server.Display, version int32, bind server.BindFunc) error {
264+ return d.CreateGlobal(ZwpTextInputV3Interface, version, bind)
265+}
266+
267+// ZwpTextInputManagerV3 text input manager.
268+type ZwpTextInputManagerV3 struct{ *server.Resource }
269+
270+func WrapZwpTextInputManagerV3(r *server.Resource) *ZwpTextInputManagerV3 {
271+ if r == nil {
272+ return nil
273+ }
274+ return &ZwpTextInputManagerV3{r}
275+}
276+
277+const ZwpTextInputManagerV3RequestDestroy uint32 = 0
278+const ZwpTextInputManagerV3RequestGetTextInput uint32 = 1
279+
280+// ZwpTextInputManagerV3Handler handles zwp_text_input_manager_v3 requests.
281+type ZwpTextInputManagerV3Handler interface {
282+ Destroy(self *ZwpTextInputManagerV3)
283+ GetTextInput(self *ZwpTextInputManagerV3, id uint32, seat *wayland.Seat)
284+}
285+
286+func NewZwpTextInputManagerV3(c server.Client, version int32, id uint32, h ZwpTextInputManagerV3Handler) (*ZwpTextInputManagerV3, error) {
287+ if h == nil {
288+ return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_text_input_manager_v3")
289+ }
290+ var self *ZwpTextInputManagerV3
291+ r, err := c.CreateResource(ZwpTextInputManagerV3Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
292+ switch opcode {
293+ case 0:
294+ h.Destroy(self)
295+ self.Destroy()
296+ case 1:
297+ h.GetTextInput(self, args[0].NewID(), wayland.WrapSeat(args[1].Resource()))
298+ }
299+ })
300+ if err != nil {
301+ return nil, err
302+ }
303+ self = WrapZwpTextInputManagerV3(r)
304+ r.Data = self
305+ return self, nil
306+}
307+func NewZwpTextInputManagerV3Global(d *server.Display, version int32, bind server.BindFunc) error {
308+ return d.CreateGlobal(ZwpTextInputManagerV3Interface, version, bind)
309+}
310+func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
311+ if v == nil {
312+ return nil
313+ }
314+ return v.GetResource()
315+}
316+func (self *ZwpTextInputV3) GetResource() *server.Resource {
317+ if self == nil {
318+ return nil
319+ }
320+ return self.Resource
321+}
322+func (self *ZwpTextInputManagerV3) GetResource() *server.Resource {
323+ if self == nil {
324+ return nil
325+ }
326+ return self.Resource
327+}
A protocol/wlrforeigntoplevel/wlrforeigntoplevel.go +265 -0
@@ -0,0 +1,265 @@
1+// Code generated by wlgen; DO NOT EDIT.
2+package wlrforeigntoplevel
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 ZwlrForeignToplevelManagerV1Interface *server.Interface
12+var ZwlrForeignToplevelHandleV1Interface *server.Interface
13+
14+func init() {
15+ ZwlrForeignToplevelManagerV1Interface = &server.Interface{Name: "zwlr_foreign_toplevel_manager_v1", Version: 3}
16+ ZwlrForeignToplevelHandleV1Interface = &server.Interface{Name: "zwlr_foreign_toplevel_handle_v1", Version: 3}
17+ ZwlrForeignToplevelManagerV1Interface.Requests = []server.Message{
18+ {Name: "stop", Signature: "", Types: []*server.Interface{}},
19+ }
20+ ZwlrForeignToplevelManagerV1Interface.Events = []server.Message{
21+ {Name: "toplevel", Signature: "n", Types: []*server.Interface{ZwlrForeignToplevelHandleV1Interface}},
22+ {Name: "finished", Signature: "", Types: []*server.Interface{}},
23+ }
24+ ZwlrForeignToplevelHandleV1Interface.Requests = []server.Message{
25+ {Name: "set_maximized", Signature: "", Types: []*server.Interface{}},
26+ {Name: "unset_maximized", Signature: "", Types: []*server.Interface{}},
27+ {Name: "set_minimized", Signature: "", Types: []*server.Interface{}},
28+ {Name: "unset_minimized", Signature: "", Types: []*server.Interface{}},
29+ {Name: "activate", Signature: "o", Types: []*server.Interface{wayland.SeatInterface}},
30+ {Name: "close", Signature: "", Types: []*server.Interface{}},
31+ {Name: "set_rectangle", Signature: "oiiii", Types: []*server.Interface{wayland.SurfaceInterface, nil, nil, nil, nil}},
32+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
33+ {Name: "set_fullscreen", Signature: "2?o", Types: []*server.Interface{wayland.OutputInterface}},
34+ {Name: "unset_fullscreen", Signature: "2", Types: []*server.Interface{}},
35+ }
36+ ZwlrForeignToplevelHandleV1Interface.Events = []server.Message{
37+ {Name: "title", Signature: "s", Types: []*server.Interface{nil}},
38+ {Name: "app_id", Signature: "s", Types: []*server.Interface{nil}},
39+ {Name: "output_enter", Signature: "o", Types: []*server.Interface{wayland.OutputInterface}},
40+ {Name: "output_leave", Signature: "o", Types: []*server.Interface{wayland.OutputInterface}},
41+ {Name: "state", Signature: "a", Types: []*server.Interface{nil}},
42+ {Name: "done", Signature: "", Types: []*server.Interface{}},
43+ {Name: "closed", Signature: "", Types: []*server.Interface{}},
44+ {Name: "parent", Signature: "3?o", Types: []*server.Interface{ZwlrForeignToplevelHandleV1Interface}},
45+ }
46+ if err := server.NewInterfaces(ZwlrForeignToplevelManagerV1Interface, ZwlrForeignToplevelHandleV1Interface); err != nil {
47+ panic(err)
48+ }
49+}
50+
51+// ZwlrForeignToplevelManagerV1 list and control opened apps.
52+type ZwlrForeignToplevelManagerV1 struct{ *server.Resource }
53+
54+func WrapZwlrForeignToplevelManagerV1(r *server.Resource) *ZwlrForeignToplevelManagerV1 {
55+ if r == nil {
56+ return nil
57+ }
58+ return &ZwlrForeignToplevelManagerV1{r}
59+}
60+
61+const ZwlrForeignToplevelManagerV1RequestStop uint32 = 0
62+const ZwlrForeignToplevelManagerV1EventToplevel uint32 = 0
63+const ZwlrForeignToplevelManagerV1EventFinished uint32 = 1
64+
65+// ZwlrForeignToplevelManagerV1Handler handles zwlr_foreign_toplevel_manager_v1 requests.
66+type ZwlrForeignToplevelManagerV1Handler interface {
67+ Stop(self *ZwlrForeignToplevelManagerV1)
68+}
69+
70+func NewZwlrForeignToplevelManagerV1(c server.Client, version int32, id uint32, h ZwlrForeignToplevelManagerV1Handler) (*ZwlrForeignToplevelManagerV1, error) {
71+ if h == nil {
72+ return nil, fmt.Errorf("purego-libwayland: nil handler for zwlr_foreign_toplevel_manager_v1")
73+ }
74+ var self *ZwlrForeignToplevelManagerV1
75+ r, err := c.CreateResource(ZwlrForeignToplevelManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
76+ switch opcode {
77+ case 0:
78+ h.Stop(self)
79+ }
80+ })
81+ if err != nil {
82+ return nil, err
83+ }
84+ self = WrapZwlrForeignToplevelManagerV1(r)
85+ r.Data = self
86+ return self, nil
87+}
88+
89+// SendToplevel a toplevel has been created.
90+func (self *ZwlrForeignToplevelManagerV1) SendToplevel(toplevel *ZwlrForeignToplevelHandleV1) {
91+ self.PostEvent(ZwlrForeignToplevelManagerV1EventToplevel, server.NewID(resourceOf(toplevel)))
92+}
93+
94+// SendFinished the compositor has finished with the toplevel manager.
95+func (self *ZwlrForeignToplevelManagerV1) SendFinished() {
96+ self.PostEvent(ZwlrForeignToplevelManagerV1EventFinished)
97+}
98+func NewZwlrForeignToplevelManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
99+ return d.CreateGlobal(ZwlrForeignToplevelManagerV1Interface, version, bind)
100+}
101+
102+// ZwlrForeignToplevelHandleV1 an opened toplevel.
103+type ZwlrForeignToplevelHandleV1 struct{ *server.Resource }
104+
105+func WrapZwlrForeignToplevelHandleV1(r *server.Resource) *ZwlrForeignToplevelHandleV1 {
106+ if r == nil {
107+ return nil
108+ }
109+ return &ZwlrForeignToplevelHandleV1{r}
110+}
111+
112+const ZwlrForeignToplevelHandleV1RequestSetMaximized uint32 = 0
113+const ZwlrForeignToplevelHandleV1RequestUnsetMaximized uint32 = 1
114+const ZwlrForeignToplevelHandleV1RequestSetMinimized uint32 = 2
115+const ZwlrForeignToplevelHandleV1RequestUnsetMinimized uint32 = 3
116+const ZwlrForeignToplevelHandleV1RequestActivate uint32 = 4
117+const ZwlrForeignToplevelHandleV1RequestClose uint32 = 5
118+const ZwlrForeignToplevelHandleV1RequestSetRectangle uint32 = 6
119+const ZwlrForeignToplevelHandleV1RequestDestroy uint32 = 7
120+const ZwlrForeignToplevelHandleV1RequestSetFullscreen uint32 = 8
121+const ZwlrForeignToplevelHandleV1RequestUnsetFullscreen uint32 = 9
122+const ZwlrForeignToplevelHandleV1EventTitle uint32 = 0
123+const ZwlrForeignToplevelHandleV1EventAppId uint32 = 1
124+const ZwlrForeignToplevelHandleV1EventOutputEnter uint32 = 2
125+const ZwlrForeignToplevelHandleV1EventOutputLeave uint32 = 3
126+const ZwlrForeignToplevelHandleV1EventState uint32 = 4
127+const ZwlrForeignToplevelHandleV1EventDone uint32 = 5
128+const ZwlrForeignToplevelHandleV1EventClosed uint32 = 6
129+const ZwlrForeignToplevelHandleV1EventParent uint32 = 7
130+
131+// ZwlrForeignToplevelHandleV1State types of states on the toplevel.
132+type ZwlrForeignToplevelHandleV1State uint32
133+
134+const (
135+ ZwlrForeignToplevelHandleV1StateMaximized ZwlrForeignToplevelHandleV1State = 0
136+ ZwlrForeignToplevelHandleV1StateMinimized ZwlrForeignToplevelHandleV1State = 1
137+ ZwlrForeignToplevelHandleV1StateActivated ZwlrForeignToplevelHandleV1State = 2
138+ ZwlrForeignToplevelHandleV1StateFullscreen ZwlrForeignToplevelHandleV1State = 3
139+)
140+
141+// ZwlrForeignToplevelHandleV1Error .
142+type ZwlrForeignToplevelHandleV1Error uint32
143+
144+const (
145+ ZwlrForeignToplevelHandleV1ErrorInvalidRectangle ZwlrForeignToplevelHandleV1Error = 0
146+)
147+
148+// ZwlrForeignToplevelHandleV1Handler handles zwlr_foreign_toplevel_handle_v1 requests.
149+type ZwlrForeignToplevelHandleV1Handler interface {
150+ SetMaximized(self *ZwlrForeignToplevelHandleV1)
151+ UnsetMaximized(self *ZwlrForeignToplevelHandleV1)
152+ SetMinimized(self *ZwlrForeignToplevelHandleV1)
153+ UnsetMinimized(self *ZwlrForeignToplevelHandleV1)
154+ Activate(self *ZwlrForeignToplevelHandleV1, seat *wayland.Seat)
155+ Close(self *ZwlrForeignToplevelHandleV1)
156+ SetRectangle(self *ZwlrForeignToplevelHandleV1, surface *wayland.Surface, x int32, y int32, width int32, height int32)
157+ Destroy(self *ZwlrForeignToplevelHandleV1)
158+ SetFullscreen(self *ZwlrForeignToplevelHandleV1, output *wayland.Output)
159+ UnsetFullscreen(self *ZwlrForeignToplevelHandleV1)
160+}
161+
162+func NewZwlrForeignToplevelHandleV1(c server.Client, version int32, id uint32, h ZwlrForeignToplevelHandleV1Handler) (*ZwlrForeignToplevelHandleV1, error) {
163+ if h == nil {
164+ return nil, fmt.Errorf("purego-libwayland: nil handler for zwlr_foreign_toplevel_handle_v1")
165+ }
166+ var self *ZwlrForeignToplevelHandleV1
167+ r, err := c.CreateResource(ZwlrForeignToplevelHandleV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
168+ switch opcode {
169+ case 0:
170+ h.SetMaximized(self)
171+ case 1:
172+ h.UnsetMaximized(self)
173+ case 2:
174+ h.SetMinimized(self)
175+ case 3:
176+ h.UnsetMinimized(self)
177+ case 4:
178+ h.Activate(self, wayland.WrapSeat(args[0].Resource()))
179+ case 5:
180+ h.Close(self)
181+ case 6:
182+ h.SetRectangle(self, wayland.WrapSurface(args[0].Resource()), args[1].Int(), args[2].Int(), args[3].Int(), args[4].Int())
183+ case 7:
184+ h.Destroy(self)
185+ self.Destroy()
186+ case 8:
187+ h.SetFullscreen(self, wayland.WrapOutput(args[0].Resource()))
188+ case 9:
189+ h.UnsetFullscreen(self)
190+ }
191+ })
192+ if err != nil {
193+ return nil, err
194+ }
195+ self = WrapZwlrForeignToplevelHandleV1(r)
196+ r.Data = self
197+ return self, nil
198+}
199+
200+// SendTitle title change.
201+func (self *ZwlrForeignToplevelHandleV1) SendTitle(title string) {
202+ var p runtime.Pinner
203+ defer p.Unpin()
204+ self.PostEvent(ZwlrForeignToplevelHandleV1EventTitle, server.String(&p, title, false))
205+}
206+
207+// SendAppId app-id change.
208+func (self *ZwlrForeignToplevelHandleV1) SendAppId(appId string) {
209+ var p runtime.Pinner
210+ defer p.Unpin()
211+ self.PostEvent(ZwlrForeignToplevelHandleV1EventAppId, server.String(&p, appId, false))
212+}
213+
214+// SendOutputEnter toplevel entered an output.
215+func (self *ZwlrForeignToplevelHandleV1) SendOutputEnter(output *wayland.Output) {
216+ self.PostEvent(ZwlrForeignToplevelHandleV1EventOutputEnter, server.Object(resourceOf(output)))
217+}
218+
219+// SendOutputLeave toplevel left an output.
220+func (self *ZwlrForeignToplevelHandleV1) SendOutputLeave(output *wayland.Output) {
221+ self.PostEvent(ZwlrForeignToplevelHandleV1EventOutputLeave, server.Object(resourceOf(output)))
222+}
223+
224+// SendState the toplevel state changed.
225+func (self *ZwlrForeignToplevelHandleV1) SendState(state []byte) {
226+ var p runtime.Pinner
227+ defer p.Unpin()
228+ self.PostEvent(ZwlrForeignToplevelHandleV1EventState, server.Array(&p, state))
229+}
230+
231+// SendDone all information about the toplevel has been sent.
232+func (self *ZwlrForeignToplevelHandleV1) SendDone() {
233+ self.PostEvent(ZwlrForeignToplevelHandleV1EventDone)
234+}
235+
236+// SendClosed this toplevel has been destroyed.
237+func (self *ZwlrForeignToplevelHandleV1) SendClosed() {
238+ self.PostEvent(ZwlrForeignToplevelHandleV1EventClosed)
239+}
240+
241+// SendParent parent change (since version 3).
242+func (self *ZwlrForeignToplevelHandleV1) SendParent(parent *ZwlrForeignToplevelHandleV1) {
243+ self.PostEvent(ZwlrForeignToplevelHandleV1EventParent, server.Object(resourceOf(parent)))
244+}
245+func NewZwlrForeignToplevelHandleV1Global(d *server.Display, version int32, bind server.BindFunc) error {
246+ return d.CreateGlobal(ZwlrForeignToplevelHandleV1Interface, 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 *ZwlrForeignToplevelManagerV1) GetResource() *server.Resource {
255+ if self == nil {
256+ return nil
257+ }
258+ return self.Resource
259+}
260+func (self *ZwlrForeignToplevelHandleV1) GetResource() *server.Resource {
261+ if self == nil {
262+ return nil
263+ }
264+ return self.Resource
265+}
A protocol/wlrgammacontrol/wlrgammacontrol.go +157 -0
@@ -0,0 +1,157 @@
1+// Code generated by wlgen; DO NOT EDIT.
2+package wlrgammacontrol
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 ZwlrGammaControlManagerV1Interface *server.Interface
11+var ZwlrGammaControlV1Interface *server.Interface
12+
13+func init() {
14+ ZwlrGammaControlManagerV1Interface = &server.Interface{Name: "zwlr_gamma_control_manager_v1", Version: 1}
15+ ZwlrGammaControlV1Interface = &server.Interface{Name: "zwlr_gamma_control_v1", Version: 1}
16+ ZwlrGammaControlManagerV1Interface.Requests = []server.Message{
17+ {Name: "get_gamma_control", Signature: "no", Types: []*server.Interface{ZwlrGammaControlV1Interface, wayland.OutputInterface}},
18+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
19+ }
20+ ZwlrGammaControlManagerV1Interface.Events = []server.Message{}
21+ ZwlrGammaControlV1Interface.Requests = []server.Message{
22+ {Name: "set_gamma", Signature: "h", Types: []*server.Interface{nil}},
23+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
24+ }
25+ ZwlrGammaControlV1Interface.Events = []server.Message{
26+ {Name: "gamma_size", Signature: "u", Types: []*server.Interface{nil}},
27+ {Name: "failed", Signature: "", Types: []*server.Interface{}},
28+ }
29+ if err := server.NewInterfaces(ZwlrGammaControlManagerV1Interface, ZwlrGammaControlV1Interface); err != nil {
30+ panic(err)
31+ }
32+}
33+
34+// ZwlrGammaControlManagerV1 manager to create per-output gamma controls.
35+type ZwlrGammaControlManagerV1 struct{ *server.Resource }
36+
37+func WrapZwlrGammaControlManagerV1(r *server.Resource) *ZwlrGammaControlManagerV1 {
38+ if r == nil {
39+ return nil
40+ }
41+ return &ZwlrGammaControlManagerV1{r}
42+}
43+
44+const ZwlrGammaControlManagerV1RequestGetGammaControl uint32 = 0
45+const ZwlrGammaControlManagerV1RequestDestroy uint32 = 1
46+
47+// ZwlrGammaControlManagerV1Handler handles zwlr_gamma_control_manager_v1 requests.
48+type ZwlrGammaControlManagerV1Handler interface {
49+ GetGammaControl(self *ZwlrGammaControlManagerV1, id uint32, output *wayland.Output)
50+ Destroy(self *ZwlrGammaControlManagerV1)
51+}
52+
53+func NewZwlrGammaControlManagerV1(c server.Client, version int32, id uint32, h ZwlrGammaControlManagerV1Handler) (*ZwlrGammaControlManagerV1, error) {
54+ if h == nil {
55+ return nil, fmt.Errorf("purego-libwayland: nil handler for zwlr_gamma_control_manager_v1")
56+ }
57+ var self *ZwlrGammaControlManagerV1
58+ r, err := c.CreateResource(ZwlrGammaControlManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
59+ switch opcode {
60+ case 0:
61+ h.GetGammaControl(self, args[0].NewID(), wayland.WrapOutput(args[1].Resource()))
62+ case 1:
63+ h.Destroy(self)
64+ self.Destroy()
65+ }
66+ })
67+ if err != nil {
68+ return nil, err
69+ }
70+ self = WrapZwlrGammaControlManagerV1(r)
71+ r.Data = self
72+ return self, nil
73+}
74+func NewZwlrGammaControlManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
75+ return d.CreateGlobal(ZwlrGammaControlManagerV1Interface, version, bind)
76+}
77+
78+// ZwlrGammaControlV1 adjust gamma tables for an output.
79+type ZwlrGammaControlV1 struct{ *server.Resource }
80+
81+func WrapZwlrGammaControlV1(r *server.Resource) *ZwlrGammaControlV1 {
82+ if r == nil {
83+ return nil
84+ }
85+ return &ZwlrGammaControlV1{r}
86+}
87+
88+const ZwlrGammaControlV1RequestSetGamma uint32 = 0
89+const ZwlrGammaControlV1RequestDestroy uint32 = 1
90+const ZwlrGammaControlV1EventGammaSize uint32 = 0
91+const ZwlrGammaControlV1EventFailed uint32 = 1
92+
93+// ZwlrGammaControlV1Error .
94+type ZwlrGammaControlV1Error uint32
95+
96+const (
97+ ZwlrGammaControlV1ErrorInvalidGamma ZwlrGammaControlV1Error = 1
98+)
99+
100+// ZwlrGammaControlV1Handler handles zwlr_gamma_control_v1 requests.
101+type ZwlrGammaControlV1Handler interface {
102+ SetGamma(self *ZwlrGammaControlV1, fd int)
103+ Destroy(self *ZwlrGammaControlV1)
104+}
105+
106+func NewZwlrGammaControlV1(c server.Client, version int32, id uint32, h ZwlrGammaControlV1Handler) (*ZwlrGammaControlV1, error) {
107+ if h == nil {
108+ return nil, fmt.Errorf("purego-libwayland: nil handler for zwlr_gamma_control_v1")
109+ }
110+ var self *ZwlrGammaControlV1
111+ r, err := c.CreateResource(ZwlrGammaControlV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
112+ switch opcode {
113+ case 0:
114+ h.SetGamma(self, args[0].Fd())
115+ case 1:
116+ h.Destroy(self)
117+ self.Destroy()
118+ }
119+ })
120+ if err != nil {
121+ return nil, err
122+ }
123+ self = WrapZwlrGammaControlV1(r)
124+ r.Data = self
125+ return self, nil
126+}
127+
128+// SendGammaSize size of gamma ramps.
129+func (self *ZwlrGammaControlV1) SendGammaSize(size uint32) {
130+ self.PostEvent(ZwlrGammaControlV1EventGammaSize, server.Uint(size))
131+}
132+
133+// SendFailed object no longer valid.
134+func (self *ZwlrGammaControlV1) SendFailed() {
135+ self.PostEvent(ZwlrGammaControlV1EventFailed)
136+}
137+func NewZwlrGammaControlV1Global(d *server.Display, version int32, bind server.BindFunc) error {
138+ return d.CreateGlobal(ZwlrGammaControlV1Interface, version, bind)
139+}
140+func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
141+ if v == nil {
142+ return nil
143+ }
144+ return v.GetResource()
145+}
146+func (self *ZwlrGammaControlManagerV1) GetResource() *server.Resource {
147+ if self == nil {
148+ return nil
149+ }
150+ return self.Resource
151+}
152+func (self *ZwlrGammaControlV1) GetResource() *server.Resource {
153+ if self == nil {
154+ return nil
155+ }
156+ return self.Resource
157+}
A protocol/wlroutputmanagement/wlroutputmanagement.go +540 -0
@@ -0,0 +1,540 @@
1+// Code generated by wlgen; DO NOT EDIT.
2+package wlroutputmanagement
3+
4+import (
5+ "fmt"
6+ "github.com/bnema/purego-libwayland/server"
7+ "runtime"
8+)
9+
10+var ZwlrOutputManagerV1Interface *server.Interface
11+var ZwlrOutputHeadV1Interface *server.Interface
12+var ZwlrOutputModeV1Interface *server.Interface
13+var ZwlrOutputConfigurationV1Interface *server.Interface
14+var ZwlrOutputConfigurationHeadV1Interface *server.Interface
15+
16+func init() {
17+ ZwlrOutputManagerV1Interface = &server.Interface{Name: "zwlr_output_manager_v1", Version: 4}
18+ ZwlrOutputHeadV1Interface = &server.Interface{Name: "zwlr_output_head_v1", Version: 4}
19+ ZwlrOutputModeV1Interface = &server.Interface{Name: "zwlr_output_mode_v1", Version: 3}
20+ ZwlrOutputConfigurationV1Interface = &server.Interface{Name: "zwlr_output_configuration_v1", Version: 4}
21+ ZwlrOutputConfigurationHeadV1Interface = &server.Interface{Name: "zwlr_output_configuration_head_v1", Version: 4}
22+ ZwlrOutputManagerV1Interface.Requests = []server.Message{
23+ {Name: "create_configuration", Signature: "nu", Types: []*server.Interface{ZwlrOutputConfigurationV1Interface, nil}},
24+ {Name: "stop", Signature: "", Types: []*server.Interface{}},
25+ }
26+ ZwlrOutputManagerV1Interface.Events = []server.Message{
27+ {Name: "head", Signature: "n", Types: []*server.Interface{ZwlrOutputHeadV1Interface}},
28+ {Name: "done", Signature: "u", Types: []*server.Interface{nil}},
29+ {Name: "finished", Signature: "", Types: []*server.Interface{}},
30+ }
31+ ZwlrOutputHeadV1Interface.Requests = []server.Message{
32+ {Name: "release", Signature: "3", Types: []*server.Interface{}},
33+ }
34+ ZwlrOutputHeadV1Interface.Events = []server.Message{
35+ {Name: "name", Signature: "s", Types: []*server.Interface{nil}},
36+ {Name: "description", Signature: "s", Types: []*server.Interface{nil}},
37+ {Name: "physical_size", Signature: "ii", Types: []*server.Interface{nil, nil}},
38+ {Name: "mode", Signature: "n", Types: []*server.Interface{ZwlrOutputModeV1Interface}},
39+ {Name: "enabled", Signature: "i", Types: []*server.Interface{nil}},
40+ {Name: "current_mode", Signature: "o", Types: []*server.Interface{ZwlrOutputModeV1Interface}},
41+ {Name: "position", Signature: "ii", Types: []*server.Interface{nil, nil}},
42+ {Name: "transform", Signature: "i", Types: []*server.Interface{nil}},
43+ {Name: "scale", Signature: "f", Types: []*server.Interface{nil}},
44+ {Name: "finished", Signature: "", Types: []*server.Interface{}},
45+ {Name: "make", Signature: "2s", Types: []*server.Interface{nil}},
46+ {Name: "model", Signature: "2s", Types: []*server.Interface{nil}},
47+ {Name: "serial_number", Signature: "2s", Types: []*server.Interface{nil}},
48+ {Name: "adaptive_sync", Signature: "4u", Types: []*server.Interface{nil}},
49+ }
50+ ZwlrOutputModeV1Interface.Requests = []server.Message{
51+ {Name: "release", Signature: "3", Types: []*server.Interface{}},
52+ }
53+ ZwlrOutputModeV1Interface.Events = []server.Message{
54+ {Name: "size", Signature: "ii", Types: []*server.Interface{nil, nil}},
55+ {Name: "refresh", Signature: "i", Types: []*server.Interface{nil}},
56+ {Name: "preferred", Signature: "", Types: []*server.Interface{}},
57+ {Name: "finished", Signature: "", Types: []*server.Interface{}},
58+ }
59+ ZwlrOutputConfigurationV1Interface.Requests = []server.Message{
60+ {Name: "enable_head", Signature: "no", Types: []*server.Interface{ZwlrOutputConfigurationHeadV1Interface, ZwlrOutputHeadV1Interface}},
61+ {Name: "disable_head", Signature: "o", Types: []*server.Interface{ZwlrOutputHeadV1Interface}},
62+ {Name: "apply", Signature: "", Types: []*server.Interface{}},
63+ {Name: "test", Signature: "", Types: []*server.Interface{}},
64+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
65+ }
66+ ZwlrOutputConfigurationV1Interface.Events = []server.Message{
67+ {Name: "succeeded", Signature: "", Types: []*server.Interface{}},
68+ {Name: "failed", Signature: "", Types: []*server.Interface{}},
69+ {Name: "cancelled", Signature: "", Types: []*server.Interface{}},
70+ }
71+ ZwlrOutputConfigurationHeadV1Interface.Requests = []server.Message{
72+ {Name: "set_mode", Signature: "o", Types: []*server.Interface{ZwlrOutputModeV1Interface}},
73+ {Name: "set_custom_mode", Signature: "iii", Types: []*server.Interface{nil, nil, nil}},
74+ {Name: "set_position", Signature: "ii", Types: []*server.Interface{nil, nil}},
75+ {Name: "set_transform", Signature: "i", Types: []*server.Interface{nil}},
76+ {Name: "set_scale", Signature: "f", Types: []*server.Interface{nil}},
77+ {Name: "set_adaptive_sync", Signature: "4u", Types: []*server.Interface{nil}},
78+ }
79+ ZwlrOutputConfigurationHeadV1Interface.Events = []server.Message{}
80+ if err := server.NewInterfaces(ZwlrOutputManagerV1Interface, ZwlrOutputHeadV1Interface, ZwlrOutputModeV1Interface, ZwlrOutputConfigurationV1Interface, ZwlrOutputConfigurationHeadV1Interface); err != nil {
81+ panic(err)
82+ }
83+}
84+
85+// ZwlrOutputManagerV1 output device configuration manager.
86+type ZwlrOutputManagerV1 struct{ *server.Resource }
87+
88+func WrapZwlrOutputManagerV1(r *server.Resource) *ZwlrOutputManagerV1 {
89+ if r == nil {
90+ return nil
91+ }
92+ return &ZwlrOutputManagerV1{r}
93+}
94+
95+const ZwlrOutputManagerV1RequestCreateConfiguration uint32 = 0
96+const ZwlrOutputManagerV1RequestStop uint32 = 1
97+const ZwlrOutputManagerV1EventHead uint32 = 0
98+const ZwlrOutputManagerV1EventDone uint32 = 1
99+const ZwlrOutputManagerV1EventFinished uint32 = 2
100+
101+// ZwlrOutputManagerV1Handler handles zwlr_output_manager_v1 requests.
102+type ZwlrOutputManagerV1Handler interface {
103+ CreateConfiguration(self *ZwlrOutputManagerV1, id uint32, serial uint32)
104+ Stop(self *ZwlrOutputManagerV1)
105+}
106+
107+func NewZwlrOutputManagerV1(c server.Client, version int32, id uint32, h ZwlrOutputManagerV1Handler) (*ZwlrOutputManagerV1, error) {
108+ if h == nil {
109+ return nil, fmt.Errorf("purego-libwayland: nil handler for zwlr_output_manager_v1")
110+ }
111+ var self *ZwlrOutputManagerV1
112+ r, err := c.CreateResource(ZwlrOutputManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
113+ switch opcode {
114+ case 0:
115+ h.CreateConfiguration(self, args[0].NewID(), args[1].Uint())
116+ case 1:
117+ h.Stop(self)
118+ }
119+ })
120+ if err != nil {
121+ return nil, err
122+ }
123+ self = WrapZwlrOutputManagerV1(r)
124+ r.Data = self
125+ return self, nil
126+}
127+
128+// SendHead introduce a new head.
129+func (self *ZwlrOutputManagerV1) SendHead(head *ZwlrOutputHeadV1) {
130+ self.PostEvent(ZwlrOutputManagerV1EventHead, server.NewID(resourceOf(head)))
131+}
132+
133+// SendDone sent all information about current configuration.
134+func (self *ZwlrOutputManagerV1) SendDone(serial uint32) {
135+ self.PostEvent(ZwlrOutputManagerV1EventDone, server.Uint(serial))
136+}
137+
138+// SendFinished the compositor has finished with the manager.
139+func (self *ZwlrOutputManagerV1) SendFinished() {
140+ self.PostEvent(ZwlrOutputManagerV1EventFinished)
141+}
142+func NewZwlrOutputManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
143+ return d.CreateGlobal(ZwlrOutputManagerV1Interface, version, bind)
144+}
145+
146+// ZwlrOutputHeadV1 output device.
147+type ZwlrOutputHeadV1 struct{ *server.Resource }
148+
149+func WrapZwlrOutputHeadV1(r *server.Resource) *ZwlrOutputHeadV1 {
150+ if r == nil {
151+ return nil
152+ }
153+ return &ZwlrOutputHeadV1{r}
154+}
155+
156+const ZwlrOutputHeadV1RequestRelease uint32 = 0
157+const ZwlrOutputHeadV1EventName uint32 = 0
158+const ZwlrOutputHeadV1EventDescription uint32 = 1
159+const ZwlrOutputHeadV1EventPhysicalSize uint32 = 2
160+const ZwlrOutputHeadV1EventMode uint32 = 3
161+const ZwlrOutputHeadV1EventEnabled uint32 = 4
162+const ZwlrOutputHeadV1EventCurrentMode uint32 = 5
163+const ZwlrOutputHeadV1EventPosition uint32 = 6
164+const ZwlrOutputHeadV1EventTransform uint32 = 7
165+const ZwlrOutputHeadV1EventScale uint32 = 8
166+const ZwlrOutputHeadV1EventFinished uint32 = 9
167+const ZwlrOutputHeadV1EventMake uint32 = 10
168+const ZwlrOutputHeadV1EventModel uint32 = 11
169+const ZwlrOutputHeadV1EventSerialNumber uint32 = 12
170+const ZwlrOutputHeadV1EventAdaptiveSync uint32 = 13
171+
172+// ZwlrOutputHeadV1AdaptiveSyncState .
173+type ZwlrOutputHeadV1AdaptiveSyncState uint32
174+
175+const (
176+ ZwlrOutputHeadV1AdaptiveSyncStateDisabled ZwlrOutputHeadV1AdaptiveSyncState = 0
177+ ZwlrOutputHeadV1AdaptiveSyncStateEnabled ZwlrOutputHeadV1AdaptiveSyncState = 1
178+)
179+
180+// ZwlrOutputHeadV1Handler handles zwlr_output_head_v1 requests.
181+type ZwlrOutputHeadV1Handler interface {
182+ Release(self *ZwlrOutputHeadV1)
183+}
184+
185+func NewZwlrOutputHeadV1(c server.Client, version int32, id uint32, h ZwlrOutputHeadV1Handler) (*ZwlrOutputHeadV1, error) {
186+ if h == nil {
187+ return nil, fmt.Errorf("purego-libwayland: nil handler for zwlr_output_head_v1")
188+ }
189+ var self *ZwlrOutputHeadV1
190+ r, err := c.CreateResource(ZwlrOutputHeadV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
191+ switch opcode {
192+ case 0:
193+ h.Release(self)
194+ self.Destroy()
195+ }
196+ })
197+ if err != nil {
198+ return nil, err
199+ }
200+ self = WrapZwlrOutputHeadV1(r)
201+ r.Data = self
202+ return self, nil
203+}
204+
205+// SendName head name.
206+func (self *ZwlrOutputHeadV1) SendName(name string) {
207+ var p runtime.Pinner
208+ defer p.Unpin()
209+ self.PostEvent(ZwlrOutputHeadV1EventName, server.String(&p, name, false))
210+}
211+
212+// SendDescription head description.
213+func (self *ZwlrOutputHeadV1) SendDescription(description string) {
214+ var p runtime.Pinner
215+ defer p.Unpin()
216+ self.PostEvent(ZwlrOutputHeadV1EventDescription, server.String(&p, description, false))
217+}
218+
219+// SendPhysicalSize head physical size.
220+func (self *ZwlrOutputHeadV1) SendPhysicalSize(width int32, height int32) {
221+ self.PostEvent(ZwlrOutputHeadV1EventPhysicalSize, server.Int(width), server.Int(height))
222+}
223+
224+// SendMode introduce a mode.
225+func (self *ZwlrOutputHeadV1) SendMode(mode *ZwlrOutputModeV1) {
226+ self.PostEvent(ZwlrOutputHeadV1EventMode, server.NewID(resourceOf(mode)))
227+}
228+
229+// SendEnabled head is enabled or disabled.
230+func (self *ZwlrOutputHeadV1) SendEnabled(enabled int32) {
231+ self.PostEvent(ZwlrOutputHeadV1EventEnabled, server.Int(enabled))
232+}
233+
234+// SendCurrentMode current mode.
235+func (self *ZwlrOutputHeadV1) SendCurrentMode(mode *ZwlrOutputModeV1) {
236+ self.PostEvent(ZwlrOutputHeadV1EventCurrentMode, server.Object(resourceOf(mode)))
237+}
238+
239+// SendPosition current position.
240+func (self *ZwlrOutputHeadV1) SendPosition(x int32, y int32) {
241+ self.PostEvent(ZwlrOutputHeadV1EventPosition, server.Int(x), server.Int(y))
242+}
243+
244+// SendTransform current transformation.
245+func (self *ZwlrOutputHeadV1) SendTransform(transform int32) {
246+ self.PostEvent(ZwlrOutputHeadV1EventTransform, server.Int(transform))
247+}
248+
249+// SendScale current scale.
250+func (self *ZwlrOutputHeadV1) SendScale(scale server.Fixed) {
251+ self.PostEvent(ZwlrOutputHeadV1EventScale, server.FixedArg(scale))
252+}
253+
254+// SendFinished the head has disappeared.
255+func (self *ZwlrOutputHeadV1) SendFinished() {
256+ self.PostEvent(ZwlrOutputHeadV1EventFinished)
257+}
258+
259+// SendMake head manufacturer (since version 2).
260+func (self *ZwlrOutputHeadV1) SendMake(make string) {
261+ var p runtime.Pinner
262+ defer p.Unpin()
263+ self.PostEvent(ZwlrOutputHeadV1EventMake, server.String(&p, make, false))
264+}
265+
266+// SendModel head model (since version 2).
267+func (self *ZwlrOutputHeadV1) SendModel(model string) {
268+ var p runtime.Pinner
269+ defer p.Unpin()
270+ self.PostEvent(ZwlrOutputHeadV1EventModel, server.String(&p, model, false))
271+}
272+
273+// SendSerialNumber head serial number (since version 2).
274+func (self *ZwlrOutputHeadV1) SendSerialNumber(serialNumber string) {
275+ var p runtime.Pinner
276+ defer p.Unpin()
277+ self.PostEvent(ZwlrOutputHeadV1EventSerialNumber, server.String(&p, serialNumber, false))
278+}
279+
280+// SendAdaptiveSync current adaptive sync state (since version 4).
281+func (self *ZwlrOutputHeadV1) SendAdaptiveSync(state uint32) {
282+ self.PostEvent(ZwlrOutputHeadV1EventAdaptiveSync, server.Uint(state))
283+}
284+func NewZwlrOutputHeadV1Global(d *server.Display, version int32, bind server.BindFunc) error {
285+ return d.CreateGlobal(ZwlrOutputHeadV1Interface, version, bind)
286+}
287+
288+// ZwlrOutputModeV1 output mode.
289+type ZwlrOutputModeV1 struct{ *server.Resource }
290+
291+func WrapZwlrOutputModeV1(r *server.Resource) *ZwlrOutputModeV1 {
292+ if r == nil {
293+ return nil
294+ }
295+ return &ZwlrOutputModeV1{r}
296+}
297+
298+const ZwlrOutputModeV1RequestRelease uint32 = 0
299+const ZwlrOutputModeV1EventSize uint32 = 0
300+const ZwlrOutputModeV1EventRefresh uint32 = 1
301+const ZwlrOutputModeV1EventPreferred uint32 = 2
302+const ZwlrOutputModeV1EventFinished uint32 = 3
303+
304+// ZwlrOutputModeV1Handler handles zwlr_output_mode_v1 requests.
305+type ZwlrOutputModeV1Handler interface {
306+ Release(self *ZwlrOutputModeV1)
307+}
308+
309+func NewZwlrOutputModeV1(c server.Client, version int32, id uint32, h ZwlrOutputModeV1Handler) (*ZwlrOutputModeV1, error) {
310+ if h == nil {
311+ return nil, fmt.Errorf("purego-libwayland: nil handler for zwlr_output_mode_v1")
312+ }
313+ var self *ZwlrOutputModeV1
314+ r, err := c.CreateResource(ZwlrOutputModeV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
315+ switch opcode {
316+ case 0:
317+ h.Release(self)
318+ self.Destroy()
319+ }
320+ })
321+ if err != nil {
322+ return nil, err
323+ }
324+ self = WrapZwlrOutputModeV1(r)
325+ r.Data = self
326+ return self, nil
327+}
328+
329+// SendSize mode size.
330+func (self *ZwlrOutputModeV1) SendSize(width int32, height int32) {
331+ self.PostEvent(ZwlrOutputModeV1EventSize, server.Int(width), server.Int(height))
332+}
333+
334+// SendRefresh mode refresh rate.
335+func (self *ZwlrOutputModeV1) SendRefresh(refresh int32) {
336+ self.PostEvent(ZwlrOutputModeV1EventRefresh, server.Int(refresh))
337+}
338+
339+// SendPreferred mode is preferred.
340+func (self *ZwlrOutputModeV1) SendPreferred() {
341+ self.PostEvent(ZwlrOutputModeV1EventPreferred)
342+}
343+
344+// SendFinished the mode has disappeared.
345+func (self *ZwlrOutputModeV1) SendFinished() {
346+ self.PostEvent(ZwlrOutputModeV1EventFinished)
347+}
348+func NewZwlrOutputModeV1Global(d *server.Display, version int32, bind server.BindFunc) error {
349+ return d.CreateGlobal(ZwlrOutputModeV1Interface, version, bind)
350+}
351+
352+// ZwlrOutputConfigurationV1 output configuration.
353+type ZwlrOutputConfigurationV1 struct{ *server.Resource }
354+
355+func WrapZwlrOutputConfigurationV1(r *server.Resource) *ZwlrOutputConfigurationV1 {
356+ if r == nil {
357+ return nil
358+ }
359+ return &ZwlrOutputConfigurationV1{r}
360+}
361+
362+const ZwlrOutputConfigurationV1RequestEnableHead uint32 = 0
363+const ZwlrOutputConfigurationV1RequestDisableHead uint32 = 1
364+const ZwlrOutputConfigurationV1RequestApply uint32 = 2
365+const ZwlrOutputConfigurationV1RequestTest uint32 = 3
366+const ZwlrOutputConfigurationV1RequestDestroy uint32 = 4
367+const ZwlrOutputConfigurationV1EventSucceeded uint32 = 0
368+const ZwlrOutputConfigurationV1EventFailed uint32 = 1
369+const ZwlrOutputConfigurationV1EventCancelled uint32 = 2
370+
371+// ZwlrOutputConfigurationV1Error .
372+type ZwlrOutputConfigurationV1Error uint32
373+
374+const (
375+ ZwlrOutputConfigurationV1ErrorAlreadyConfiguredHead ZwlrOutputConfigurationV1Error = 1
376+ ZwlrOutputConfigurationV1ErrorUnconfiguredHead ZwlrOutputConfigurationV1Error = 2
377+ ZwlrOutputConfigurationV1ErrorAlreadyUsed ZwlrOutputConfigurationV1Error = 3
378+)
379+
380+// ZwlrOutputConfigurationV1Handler handles zwlr_output_configuration_v1 requests.
381+type ZwlrOutputConfigurationV1Handler interface {
382+ EnableHead(self *ZwlrOutputConfigurationV1, id uint32, head *ZwlrOutputHeadV1)
383+ DisableHead(self *ZwlrOutputConfigurationV1, head *ZwlrOutputHeadV1)
384+ Apply(self *ZwlrOutputConfigurationV1)
385+ Test(self *ZwlrOutputConfigurationV1)
386+ Destroy(self *ZwlrOutputConfigurationV1)
387+}
388+
389+func NewZwlrOutputConfigurationV1(c server.Client, version int32, id uint32, h ZwlrOutputConfigurationV1Handler) (*ZwlrOutputConfigurationV1, error) {
390+ if h == nil {
391+ return nil, fmt.Errorf("purego-libwayland: nil handler for zwlr_output_configuration_v1")
392+ }
393+ var self *ZwlrOutputConfigurationV1
394+ r, err := c.CreateResource(ZwlrOutputConfigurationV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
395+ switch opcode {
396+ case 0:
397+ h.EnableHead(self, args[0].NewID(), WrapZwlrOutputHeadV1(args[1].Resource()))
398+ case 1:
399+ h.DisableHead(self, WrapZwlrOutputHeadV1(args[0].Resource()))
400+ case 2:
401+ h.Apply(self)
402+ case 3:
403+ h.Test(self)
404+ case 4:
405+ h.Destroy(self)
406+ self.Destroy()
407+ }
408+ })
409+ if err != nil {
410+ return nil, err
411+ }
412+ self = WrapZwlrOutputConfigurationV1(r)
413+ r.Data = self
414+ return self, nil
415+}
416+
417+// SendSucceeded configuration changes succeeded.
418+func (self *ZwlrOutputConfigurationV1) SendSucceeded() {
419+ self.PostEvent(ZwlrOutputConfigurationV1EventSucceeded)
420+}
421+
422+// SendFailed configuration changes failed.
423+func (self *ZwlrOutputConfigurationV1) SendFailed() {
424+ self.PostEvent(ZwlrOutputConfigurationV1EventFailed)
425+}
426+
427+// SendCancelled configuration has been cancelled.
428+func (self *ZwlrOutputConfigurationV1) SendCancelled() {
429+ self.PostEvent(ZwlrOutputConfigurationV1EventCancelled)
430+}
431+func NewZwlrOutputConfigurationV1Global(d *server.Display, version int32, bind server.BindFunc) error {
432+ return d.CreateGlobal(ZwlrOutputConfigurationV1Interface, version, bind)
433+}
434+
435+// ZwlrOutputConfigurationHeadV1 head configuration.
436+type ZwlrOutputConfigurationHeadV1 struct{ *server.Resource }
437+
438+func WrapZwlrOutputConfigurationHeadV1(r *server.Resource) *ZwlrOutputConfigurationHeadV1 {
439+ if r == nil {
440+ return nil
441+ }
442+ return &ZwlrOutputConfigurationHeadV1{r}
443+}
444+
445+const ZwlrOutputConfigurationHeadV1RequestSetMode uint32 = 0
446+const ZwlrOutputConfigurationHeadV1RequestSetCustomMode uint32 = 1
447+const ZwlrOutputConfigurationHeadV1RequestSetPosition uint32 = 2
448+const ZwlrOutputConfigurationHeadV1RequestSetTransform uint32 = 3
449+const ZwlrOutputConfigurationHeadV1RequestSetScale uint32 = 4
450+const ZwlrOutputConfigurationHeadV1RequestSetAdaptiveSync uint32 = 5
451+
452+// ZwlrOutputConfigurationHeadV1Error .
453+type ZwlrOutputConfigurationHeadV1Error uint32
454+
455+const (
456+ ZwlrOutputConfigurationHeadV1ErrorAlreadySet ZwlrOutputConfigurationHeadV1Error = 1
457+ ZwlrOutputConfigurationHeadV1ErrorInvalidMode ZwlrOutputConfigurationHeadV1Error = 2
458+ ZwlrOutputConfigurationHeadV1ErrorInvalidCustomMode ZwlrOutputConfigurationHeadV1Error = 3
459+ ZwlrOutputConfigurationHeadV1ErrorInvalidTransform ZwlrOutputConfigurationHeadV1Error = 4
460+ ZwlrOutputConfigurationHeadV1ErrorInvalidScale ZwlrOutputConfigurationHeadV1Error = 5
461+ ZwlrOutputConfigurationHeadV1ErrorInvalidAdaptiveSyncState ZwlrOutputConfigurationHeadV1Error = 6
462+)
463+
464+// ZwlrOutputConfigurationHeadV1Handler handles zwlr_output_configuration_head_v1 requests.
465+type ZwlrOutputConfigurationHeadV1Handler interface {
466+ SetMode(self *ZwlrOutputConfigurationHeadV1, mode *ZwlrOutputModeV1)
467+ SetCustomMode(self *ZwlrOutputConfigurationHeadV1, width int32, height int32, refresh int32)
468+ SetPosition(self *ZwlrOutputConfigurationHeadV1, x int32, y int32)
469+ SetTransform(self *ZwlrOutputConfigurationHeadV1, transform int32)
470+ SetScale(self *ZwlrOutputConfigurationHeadV1, scale server.Fixed)
471+ SetAdaptiveSync(self *ZwlrOutputConfigurationHeadV1, state uint32)
472+}
473+
474+func NewZwlrOutputConfigurationHeadV1(c server.Client, version int32, id uint32, h ZwlrOutputConfigurationHeadV1Handler) (*ZwlrOutputConfigurationHeadV1, error) {
475+ if h == nil {
476+ return nil, fmt.Errorf("purego-libwayland: nil handler for zwlr_output_configuration_head_v1")
477+ }
478+ var self *ZwlrOutputConfigurationHeadV1
479+ r, err := c.CreateResource(ZwlrOutputConfigurationHeadV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
480+ switch opcode {
481+ case 0:
482+ h.SetMode(self, WrapZwlrOutputModeV1(args[0].Resource()))
483+ case 1:
484+ h.SetCustomMode(self, args[0].Int(), args[1].Int(), args[2].Int())
485+ case 2:
486+ h.SetPosition(self, args[0].Int(), args[1].Int())
487+ case 3:
488+ h.SetTransform(self, args[0].Int())
489+ case 4:
490+ h.SetScale(self, args[0].Fixed())
491+ case 5:
492+ h.SetAdaptiveSync(self, args[0].Uint())
493+ }
494+ })
495+ if err != nil {
496+ return nil, err
497+ }
498+ self = WrapZwlrOutputConfigurationHeadV1(r)
499+ r.Data = self
500+ return self, nil
501+}
502+func NewZwlrOutputConfigurationHeadV1Global(d *server.Display, version int32, bind server.BindFunc) error {
503+ return d.CreateGlobal(ZwlrOutputConfigurationHeadV1Interface, version, bind)
504+}
505+func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
506+ if v == nil {
507+ return nil
508+ }
509+ return v.GetResource()
510+}
511+func (self *ZwlrOutputManagerV1) GetResource() *server.Resource {
512+ if self == nil {
513+ return nil
514+ }
515+ return self.Resource
516+}
517+func (self *ZwlrOutputHeadV1) GetResource() *server.Resource {
518+ if self == nil {
519+ return nil
520+ }
521+ return self.Resource
522+}
523+func (self *ZwlrOutputModeV1) GetResource() *server.Resource {
524+ if self == nil {
525+ return nil
526+ }
527+ return self.Resource
528+}
529+func (self *ZwlrOutputConfigurationV1) GetResource() *server.Resource {
530+ if self == nil {
531+ return nil
532+ }
533+ return self.Resource
534+}
535+func (self *ZwlrOutputConfigurationHeadV1) GetResource() *server.Resource {
536+ if self == nil {
537+ return nil
538+ }
539+ return self.Resource
540+}
A protocol/wlrscreencopy/wlrscreencopy.go +210 -0
@@ -0,0 +1,210 @@
1+// Code generated by wlgen; DO NOT EDIT.
2+package wlrscreencopy
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 ZwlrScreencopyManagerV1Interface *server.Interface
11+var ZwlrScreencopyFrameV1Interface *server.Interface
12+
13+func init() {
14+ ZwlrScreencopyManagerV1Interface = &server.Interface{Name: "zwlr_screencopy_manager_v1", Version: 3}
15+ ZwlrScreencopyFrameV1Interface = &server.Interface{Name: "zwlr_screencopy_frame_v1", Version: 3}
16+ ZwlrScreencopyManagerV1Interface.Requests = []server.Message{
17+ {Name: "capture_output", Signature: "nio", Types: []*server.Interface{ZwlrScreencopyFrameV1Interface, nil, wayland.OutputInterface}},
18+ {Name: "capture_output_region", Signature: "nioiiii", Types: []*server.Interface{ZwlrScreencopyFrameV1Interface, nil, wayland.OutputInterface, nil, nil, nil, nil}},
19+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
20+ }
21+ ZwlrScreencopyManagerV1Interface.Events = []server.Message{}
22+ ZwlrScreencopyFrameV1Interface.Requests = []server.Message{
23+ {Name: "copy", Signature: "o", Types: []*server.Interface{wayland.BufferInterface}},
24+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
25+ {Name: "copy_with_damage", Signature: "2o", Types: []*server.Interface{wayland.BufferInterface}},
26+ }
27+ ZwlrScreencopyFrameV1Interface.Events = []server.Message{
28+ {Name: "buffer", Signature: "uuuu", Types: []*server.Interface{nil, nil, nil, nil}},
29+ {Name: "flags", Signature: "u", Types: []*server.Interface{nil}},
30+ {Name: "ready", Signature: "uuu", Types: []*server.Interface{nil, nil, nil}},
31+ {Name: "failed", Signature: "", Types: []*server.Interface{}},
32+ {Name: "damage", Signature: "2uuuu", Types: []*server.Interface{nil, nil, nil, nil}},
33+ {Name: "linux_dmabuf", Signature: "3uuu", Types: []*server.Interface{nil, nil, nil}},
34+ {Name: "buffer_done", Signature: "3", Types: []*server.Interface{}},
35+ }
36+ if err := server.NewInterfaces(ZwlrScreencopyManagerV1Interface, ZwlrScreencopyFrameV1Interface); err != nil {
37+ panic(err)
38+ }
39+}
40+
41+// ZwlrScreencopyManagerV1 manager to inform clients and begin capturing.
42+type ZwlrScreencopyManagerV1 struct{ *server.Resource }
43+
44+func WrapZwlrScreencopyManagerV1(r *server.Resource) *ZwlrScreencopyManagerV1 {
45+ if r == nil {
46+ return nil
47+ }
48+ return &ZwlrScreencopyManagerV1{r}
49+}
50+
51+const ZwlrScreencopyManagerV1RequestCaptureOutput uint32 = 0
52+const ZwlrScreencopyManagerV1RequestCaptureOutputRegion uint32 = 1
53+const ZwlrScreencopyManagerV1RequestDestroy uint32 = 2
54+
55+// ZwlrScreencopyManagerV1Handler handles zwlr_screencopy_manager_v1 requests.
56+type ZwlrScreencopyManagerV1Handler interface {
57+ CaptureOutput(self *ZwlrScreencopyManagerV1, frame uint32, overlayCursor int32, output *wayland.Output)
58+ CaptureOutputRegion(self *ZwlrScreencopyManagerV1, frame uint32, overlayCursor int32, output *wayland.Output, x int32, y int32, width int32, height int32)
59+ Destroy(self *ZwlrScreencopyManagerV1)
60+}
61+
62+func NewZwlrScreencopyManagerV1(c server.Client, version int32, id uint32, h ZwlrScreencopyManagerV1Handler) (*ZwlrScreencopyManagerV1, error) {
63+ if h == nil {
64+ return nil, fmt.Errorf("purego-libwayland: nil handler for zwlr_screencopy_manager_v1")
65+ }
66+ var self *ZwlrScreencopyManagerV1
67+ r, err := c.CreateResource(ZwlrScreencopyManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
68+ switch opcode {
69+ case 0:
70+ h.CaptureOutput(self, args[0].NewID(), args[1].Int(), wayland.WrapOutput(args[2].Resource()))
71+ case 1:
72+ h.CaptureOutputRegion(self, args[0].NewID(), args[1].Int(), wayland.WrapOutput(args[2].Resource()), args[3].Int(), args[4].Int(), args[5].Int(), args[6].Int())
73+ case 2:
74+ h.Destroy(self)
75+ self.Destroy()
76+ }
77+ })
78+ if err != nil {
79+ return nil, err
80+ }
81+ self = WrapZwlrScreencopyManagerV1(r)
82+ r.Data = self
83+ return self, nil
84+}
85+func NewZwlrScreencopyManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
86+ return d.CreateGlobal(ZwlrScreencopyManagerV1Interface, version, bind)
87+}
88+
89+// ZwlrScreencopyFrameV1 a frame ready for copy.
90+type ZwlrScreencopyFrameV1 struct{ *server.Resource }
91+
92+func WrapZwlrScreencopyFrameV1(r *server.Resource) *ZwlrScreencopyFrameV1 {
93+ if r == nil {
94+ return nil
95+ }
96+ return &ZwlrScreencopyFrameV1{r}
97+}
98+
99+const ZwlrScreencopyFrameV1RequestCopy uint32 = 0
100+const ZwlrScreencopyFrameV1RequestDestroy uint32 = 1
101+const ZwlrScreencopyFrameV1RequestCopyWithDamage uint32 = 2
102+const ZwlrScreencopyFrameV1EventBuffer uint32 = 0
103+const ZwlrScreencopyFrameV1EventFlags uint32 = 1
104+const ZwlrScreencopyFrameV1EventReady uint32 = 2
105+const ZwlrScreencopyFrameV1EventFailed uint32 = 3
106+const ZwlrScreencopyFrameV1EventDamage uint32 = 4
107+const ZwlrScreencopyFrameV1EventLinuxDmabuf uint32 = 5
108+const ZwlrScreencopyFrameV1EventBufferDone uint32 = 6
109+
110+// ZwlrScreencopyFrameV1Error .
111+type ZwlrScreencopyFrameV1Error uint32
112+
113+const (
114+ ZwlrScreencopyFrameV1ErrorAlreadyUsed ZwlrScreencopyFrameV1Error = 0
115+ ZwlrScreencopyFrameV1ErrorInvalidBuffer ZwlrScreencopyFrameV1Error = 1
116+)
117+
118+// ZwlrScreencopyFrameV1Flags (bitfield).
119+type ZwlrScreencopyFrameV1Flags uint32
120+
121+const (
122+ ZwlrScreencopyFrameV1FlagsYInvert ZwlrScreencopyFrameV1Flags = 1
123+)
124+
125+// ZwlrScreencopyFrameV1Handler handles zwlr_screencopy_frame_v1 requests.
126+type ZwlrScreencopyFrameV1Handler interface {
127+ Copy(self *ZwlrScreencopyFrameV1, buffer *wayland.Buffer)
128+ Destroy(self *ZwlrScreencopyFrameV1)
129+ CopyWithDamage(self *ZwlrScreencopyFrameV1, buffer *wayland.Buffer)
130+}
131+
132+func NewZwlrScreencopyFrameV1(c server.Client, version int32, id uint32, h ZwlrScreencopyFrameV1Handler) (*ZwlrScreencopyFrameV1, error) {
133+ if h == nil {
134+ return nil, fmt.Errorf("purego-libwayland: nil handler for zwlr_screencopy_frame_v1")
135+ }
136+ var self *ZwlrScreencopyFrameV1
137+ r, err := c.CreateResource(ZwlrScreencopyFrameV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
138+ switch opcode {
139+ case 0:
140+ h.Copy(self, wayland.WrapBuffer(args[0].Resource()))
141+ case 1:
142+ h.Destroy(self)
143+ self.Destroy()
144+ case 2:
145+ h.CopyWithDamage(self, wayland.WrapBuffer(args[0].Resource()))
146+ }
147+ })
148+ if err != nil {
149+ return nil, err
150+ }
151+ self = WrapZwlrScreencopyFrameV1(r)
152+ r.Data = self
153+ return self, nil
154+}
155+
156+// SendBuffer wl_shm buffer information.
157+func (self *ZwlrScreencopyFrameV1) SendBuffer(format uint32, width uint32, height uint32, stride uint32) {
158+ self.PostEvent(ZwlrScreencopyFrameV1EventBuffer, server.Uint(format), server.Uint(width), server.Uint(height), server.Uint(stride))
159+}
160+
161+// SendFlags frame flags.
162+func (self *ZwlrScreencopyFrameV1) SendFlags(flags uint32) {
163+ self.PostEvent(ZwlrScreencopyFrameV1EventFlags, server.Uint(flags))
164+}
165+
166+// SendReady indicates frame is available for reading.
167+func (self *ZwlrScreencopyFrameV1) SendReady(tvSecHi uint32, tvSecLo uint32, tvNsec uint32) {
168+ self.PostEvent(ZwlrScreencopyFrameV1EventReady, server.Uint(tvSecHi), server.Uint(tvSecLo), server.Uint(tvNsec))
169+}
170+
171+// SendFailed frame copy failed.
172+func (self *ZwlrScreencopyFrameV1) SendFailed() {
173+ self.PostEvent(ZwlrScreencopyFrameV1EventFailed)
174+}
175+
176+// SendDamage carries the coordinates of the damaged region (since version 2).
177+func (self *ZwlrScreencopyFrameV1) SendDamage(x uint32, y uint32, width uint32, height uint32) {
178+ self.PostEvent(ZwlrScreencopyFrameV1EventDamage, server.Uint(x), server.Uint(y), server.Uint(width), server.Uint(height))
179+}
180+
181+// SendLinuxDmabuf linux-dmabuf buffer information (since version 3).
182+func (self *ZwlrScreencopyFrameV1) SendLinuxDmabuf(format uint32, width uint32, height uint32) {
183+ self.PostEvent(ZwlrScreencopyFrameV1EventLinuxDmabuf, server.Uint(format), server.Uint(width), server.Uint(height))
184+}
185+
186+// SendBufferDone all buffer types reported (since version 3).
187+func (self *ZwlrScreencopyFrameV1) SendBufferDone() {
188+ self.PostEvent(ZwlrScreencopyFrameV1EventBufferDone)
189+}
190+func NewZwlrScreencopyFrameV1Global(d *server.Display, version int32, bind server.BindFunc) error {
191+ return d.CreateGlobal(ZwlrScreencopyFrameV1Interface, version, bind)
192+}
193+func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
194+ if v == nil {
195+ return nil
196+ }
197+ return v.GetResource()
198+}
199+func (self *ZwlrScreencopyManagerV1) GetResource() *server.Resource {
200+ if self == nil {
201+ return nil
202+ }
203+ return self.Resource
204+}
205+func (self *ZwlrScreencopyFrameV1) GetResource() *server.Resource {
206+ if self == nil {
207+ return nil
208+ }
209+ return self.Resource
210+}
A protocol/wlrvirtualpointer/wlrvirtualpointer.go +183 -0
@@ -0,0 +1,183 @@
1+// Code generated by wlgen; DO NOT EDIT.
2+package wlrvirtualpointer
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 ZwlrVirtualPointerV1Interface *server.Interface
11+var ZwlrVirtualPointerManagerV1Interface *server.Interface
12+
13+func init() {
14+ ZwlrVirtualPointerV1Interface = &server.Interface{Name: "zwlr_virtual_pointer_v1", Version: 2}
15+ ZwlrVirtualPointerManagerV1Interface = &server.Interface{Name: "zwlr_virtual_pointer_manager_v1", Version: 2}
16+ ZwlrVirtualPointerV1Interface.Requests = []server.Message{
17+ {Name: "motion", Signature: "uff", Types: []*server.Interface{nil, nil, nil}},
18+ {Name: "motion_absolute", Signature: "uuuuu", Types: []*server.Interface{nil, nil, nil, nil, nil}},
19+ {Name: "button", Signature: "uuu", Types: []*server.Interface{nil, nil, nil}},
20+ {Name: "axis", Signature: "uuf", Types: []*server.Interface{nil, nil, nil}},
21+ {Name: "frame", Signature: "", Types: []*server.Interface{}},
22+ {Name: "axis_source", Signature: "u", Types: []*server.Interface{nil}},
23+ {Name: "axis_stop", Signature: "uu", Types: []*server.Interface{nil, nil}},
24+ {Name: "axis_discrete", Signature: "uufi", Types: []*server.Interface{nil, nil, nil, nil}},
25+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
26+ }
27+ ZwlrVirtualPointerV1Interface.Events = []server.Message{}
28+ ZwlrVirtualPointerManagerV1Interface.Requests = []server.Message{
29+ {Name: "create_virtual_pointer", Signature: "?on", Types: []*server.Interface{wayland.SeatInterface, ZwlrVirtualPointerV1Interface}},
30+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
31+ {Name: "create_virtual_pointer_with_output", Signature: "2?o?on", Types: []*server.Interface{wayland.SeatInterface, wayland.OutputInterface, ZwlrVirtualPointerV1Interface}},
32+ }
33+ ZwlrVirtualPointerManagerV1Interface.Events = []server.Message{}
34+ if err := server.NewInterfaces(ZwlrVirtualPointerV1Interface, ZwlrVirtualPointerManagerV1Interface); err != nil {
35+ panic(err)
36+ }
37+}
38+
39+// ZwlrVirtualPointerV1 virtual pointer.
40+type ZwlrVirtualPointerV1 struct{ *server.Resource }
41+
42+func WrapZwlrVirtualPointerV1(r *server.Resource) *ZwlrVirtualPointerV1 {
43+ if r == nil {
44+ return nil
45+ }
46+ return &ZwlrVirtualPointerV1{r}
47+}
48+
49+const ZwlrVirtualPointerV1RequestMotion uint32 = 0
50+const ZwlrVirtualPointerV1RequestMotionAbsolute uint32 = 1
51+const ZwlrVirtualPointerV1RequestButton uint32 = 2
52+const ZwlrVirtualPointerV1RequestAxis uint32 = 3
53+const ZwlrVirtualPointerV1RequestFrame uint32 = 4
54+const ZwlrVirtualPointerV1RequestAxisSource uint32 = 5
55+const ZwlrVirtualPointerV1RequestAxisStop uint32 = 6
56+const ZwlrVirtualPointerV1RequestAxisDiscrete uint32 = 7
57+const ZwlrVirtualPointerV1RequestDestroy uint32 = 8
58+
59+// ZwlrVirtualPointerV1Error .
60+type ZwlrVirtualPointerV1Error uint32
61+
62+const (
63+ ZwlrVirtualPointerV1ErrorInvalidAxis ZwlrVirtualPointerV1Error = 0
64+ ZwlrVirtualPointerV1ErrorInvalidAxisSource ZwlrVirtualPointerV1Error = 1
65+)
66+
67+// ZwlrVirtualPointerV1Handler handles zwlr_virtual_pointer_v1 requests.
68+type ZwlrVirtualPointerV1Handler interface {
69+ Motion(self *ZwlrVirtualPointerV1, time uint32, dx server.Fixed, dy server.Fixed)
70+ MotionAbsolute(self *ZwlrVirtualPointerV1, time uint32, x uint32, y uint32, xExtent uint32, yExtent uint32)
71+ Button(self *ZwlrVirtualPointerV1, time uint32, button uint32, state uint32)
72+ Axis(self *ZwlrVirtualPointerV1, time uint32, axis uint32, value server.Fixed)
73+ Frame(self *ZwlrVirtualPointerV1)
74+ AxisSource(self *ZwlrVirtualPointerV1, axisSource uint32)
75+ AxisStop(self *ZwlrVirtualPointerV1, time uint32, axis uint32)
76+ AxisDiscrete(self *ZwlrVirtualPointerV1, time uint32, axis uint32, value server.Fixed, discrete int32)
77+ Destroy(self *ZwlrVirtualPointerV1)
78+}
79+
80+func NewZwlrVirtualPointerV1(c server.Client, version int32, id uint32, h ZwlrVirtualPointerV1Handler) (*ZwlrVirtualPointerV1, error) {
81+ if h == nil {
82+ return nil, fmt.Errorf("purego-libwayland: nil handler for zwlr_virtual_pointer_v1")
83+ }
84+ var self *ZwlrVirtualPointerV1
85+ r, err := c.CreateResource(ZwlrVirtualPointerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
86+ switch opcode {
87+ case 0:
88+ h.Motion(self, args[0].Uint(), args[1].Fixed(), args[2].Fixed())
89+ case 1:
90+ h.MotionAbsolute(self, args[0].Uint(), args[1].Uint(), args[2].Uint(), args[3].Uint(), args[4].Uint())
91+ case 2:
92+ h.Button(self, args[0].Uint(), args[1].Uint(), args[2].Uint())
93+ case 3:
94+ h.Axis(self, args[0].Uint(), args[1].Uint(), args[2].Fixed())
95+ case 4:
96+ h.Frame(self)
97+ case 5:
98+ h.AxisSource(self, args[0].Uint())
99+ case 6:
100+ h.AxisStop(self, args[0].Uint(), args[1].Uint())
101+ case 7:
102+ h.AxisDiscrete(self, args[0].Uint(), args[1].Uint(), args[2].Fixed(), args[3].Int())
103+ case 8:
104+ h.Destroy(self)
105+ self.Destroy()
106+ }
107+ })
108+ if err != nil {
109+ return nil, err
110+ }
111+ self = WrapZwlrVirtualPointerV1(r)
112+ r.Data = self
113+ return self, nil
114+}
115+func NewZwlrVirtualPointerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
116+ return d.CreateGlobal(ZwlrVirtualPointerV1Interface, version, bind)
117+}
118+
119+// ZwlrVirtualPointerManagerV1 virtual pointer manager.
120+type ZwlrVirtualPointerManagerV1 struct{ *server.Resource }
121+
122+func WrapZwlrVirtualPointerManagerV1(r *server.Resource) *ZwlrVirtualPointerManagerV1 {
123+ if r == nil {
124+ return nil
125+ }
126+ return &ZwlrVirtualPointerManagerV1{r}
127+}
128+
129+const ZwlrVirtualPointerManagerV1RequestCreateVirtualPointer uint32 = 0
130+const ZwlrVirtualPointerManagerV1RequestDestroy uint32 = 1
131+const ZwlrVirtualPointerManagerV1RequestCreateVirtualPointerWithOutput uint32 = 2
132+
133+// ZwlrVirtualPointerManagerV1Handler handles zwlr_virtual_pointer_manager_v1 requests.
134+type ZwlrVirtualPointerManagerV1Handler interface {
135+ CreateVirtualPointer(self *ZwlrVirtualPointerManagerV1, seat *wayland.Seat, id uint32)
136+ Destroy(self *ZwlrVirtualPointerManagerV1)
137+ CreateVirtualPointerWithOutput(self *ZwlrVirtualPointerManagerV1, seat *wayland.Seat, output *wayland.Output, id uint32)
138+}
139+
140+func NewZwlrVirtualPointerManagerV1(c server.Client, version int32, id uint32, h ZwlrVirtualPointerManagerV1Handler) (*ZwlrVirtualPointerManagerV1, error) {
141+ if h == nil {
142+ return nil, fmt.Errorf("purego-libwayland: nil handler for zwlr_virtual_pointer_manager_v1")
143+ }
144+ var self *ZwlrVirtualPointerManagerV1
145+ r, err := c.CreateResource(ZwlrVirtualPointerManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
146+ switch opcode {
147+ case 0:
148+ h.CreateVirtualPointer(self, wayland.WrapSeat(args[0].Resource()), args[1].NewID())
149+ case 1:
150+ h.Destroy(self)
151+ self.Destroy()
152+ case 2:
153+ h.CreateVirtualPointerWithOutput(self, wayland.WrapSeat(args[0].Resource()), wayland.WrapOutput(args[1].Resource()), args[2].NewID())
154+ }
155+ })
156+ if err != nil {
157+ return nil, err
158+ }
159+ self = WrapZwlrVirtualPointerManagerV1(r)
160+ r.Data = self
161+ return self, nil
162+}
163+func NewZwlrVirtualPointerManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
164+ return d.CreateGlobal(ZwlrVirtualPointerManagerV1Interface, version, bind)
165+}
166+func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
167+ if v == nil {
168+ return nil
169+ }
170+ return v.GetResource()
171+}
172+func (self *ZwlrVirtualPointerV1) GetResource() *server.Resource {
173+ if self == nil {
174+ return nil
175+ }
176+ return self.Resource
177+}
178+func (self *ZwlrVirtualPointerManagerV1) GetResource() *server.Resource {
179+ if self == nil {
180+ return nil
181+ }
182+ return self.Resource
183+}
A protocol/xdgsessionmanagement/xdgsessionmanagement.go +269 -0
@@ -0,0 +1,269 @@
1+// Code generated by wlgen; DO NOT EDIT.
2+package xdgsessionmanagement
3+
4+import (
5+ "fmt"
6+ xdgshell "github.com/bnema/purego-libwayland/protocol/xdgshell"
7+ "github.com/bnema/purego-libwayland/server"
8+ "runtime"
9+)
10+
11+var SessionManagerV1Interface *server.Interface
12+var SessionV1Interface *server.Interface
13+var ToplevelSessionV1Interface *server.Interface
14+
15+func init() {
16+ SessionManagerV1Interface = &server.Interface{Name: "xdg_session_manager_v1", Version: 1}
17+ SessionV1Interface = &server.Interface{Name: "xdg_session_v1", Version: 1}
18+ ToplevelSessionV1Interface = &server.Interface{Name: "xdg_toplevel_session_v1", Version: 1}
19+ SessionManagerV1Interface.Requests = []server.Message{
20+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
21+ {Name: "get_session", Signature: "nu?s", Types: []*server.Interface{SessionV1Interface, nil, nil}},
22+ }
23+ SessionManagerV1Interface.Events = []server.Message{}
24+ SessionV1Interface.Requests = []server.Message{
25+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
26+ {Name: "remove", Signature: "", Types: []*server.Interface{}},
27+ {Name: "add_toplevel", Signature: "nos", Types: []*server.Interface{ToplevelSessionV1Interface, xdgshell.ToplevelInterface, nil}},
28+ {Name: "restore_toplevel", Signature: "nos", Types: []*server.Interface{ToplevelSessionV1Interface, xdgshell.ToplevelInterface, nil}},
29+ {Name: "remove_toplevel", Signature: "s", Types: []*server.Interface{nil}},
30+ }
31+ SessionV1Interface.Events = []server.Message{
32+ {Name: "created", Signature: "s", Types: []*server.Interface{nil}},
33+ {Name: "restored", Signature: "", Types: []*server.Interface{}},
34+ {Name: "replaced", Signature: "", Types: []*server.Interface{}},
35+ }
36+ ToplevelSessionV1Interface.Requests = []server.Message{
37+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
38+ {Name: "rename", Signature: "s", Types: []*server.Interface{nil}},
39+ }
40+ ToplevelSessionV1Interface.Events = []server.Message{
41+ {Name: "restored", Signature: "", Types: []*server.Interface{}},
42+ }
43+ if err := server.NewInterfaces(SessionManagerV1Interface, SessionV1Interface, ToplevelSessionV1Interface); err != nil {
44+ panic(err)
45+ }
46+}
47+
48+// SessionManagerV1 manage sessions for applications.
49+type SessionManagerV1 struct{ *server.Resource }
50+
51+func WrapSessionManagerV1(r *server.Resource) *SessionManagerV1 {
52+ if r == nil {
53+ return nil
54+ }
55+ return &SessionManagerV1{r}
56+}
57+
58+const SessionManagerV1RequestDestroy uint32 = 0
59+const SessionManagerV1RequestGetSession uint32 = 1
60+
61+// SessionManagerV1Error .
62+type SessionManagerV1Error uint32
63+
64+const (
65+ SessionManagerV1ErrorInUse SessionManagerV1Error = 1
66+ SessionManagerV1ErrorInvalidSessionId SessionManagerV1Error = 2
67+ SessionManagerV1ErrorInvalidReason SessionManagerV1Error = 3
68+)
69+
70+// SessionManagerV1Reason reason for getting a session.
71+type SessionManagerV1Reason uint32
72+
73+const (
74+ SessionManagerV1ReasonLaunch SessionManagerV1Reason = 1
75+ SessionManagerV1ReasonRecover SessionManagerV1Reason = 2
76+ SessionManagerV1ReasonSessionRestore SessionManagerV1Reason = 3
77+)
78+
79+// SessionManagerV1Handler handles xdg_session_manager_v1 requests.
80+type SessionManagerV1Handler interface {
81+ Destroy(self *SessionManagerV1)
82+ GetSession(self *SessionManagerV1, id uint32, reason uint32, sessionId string)
83+}
84+
85+func NewSessionManagerV1(c server.Client, version int32, id uint32, h SessionManagerV1Handler) (*SessionManagerV1, error) {
86+ if h == nil {
87+ return nil, fmt.Errorf("purego-libwayland: nil handler for xdg_session_manager_v1")
88+ }
89+ var self *SessionManagerV1
90+ r, err := c.CreateResource(SessionManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
91+ switch opcode {
92+ case 0:
93+ h.Destroy(self)
94+ self.Destroy()
95+ case 1:
96+ h.GetSession(self, args[0].NewID(), args[1].Uint(), args[2].String())
97+ }
98+ })
99+ if err != nil {
100+ return nil, err
101+ }
102+ self = WrapSessionManagerV1(r)
103+ r.Data = self
104+ return self, nil
105+}
106+func NewSessionManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
107+ return d.CreateGlobal(SessionManagerV1Interface, version, bind)
108+}
109+
110+// SessionV1 A session for an application.
111+type SessionV1 struct{ *server.Resource }
112+
113+func WrapSessionV1(r *server.Resource) *SessionV1 {
114+ if r == nil {
115+ return nil
116+ }
117+ return &SessionV1{r}
118+}
119+
120+const SessionV1RequestDestroy uint32 = 0
121+const SessionV1RequestRemove uint32 = 1
122+const SessionV1RequestAddToplevel uint32 = 2
123+const SessionV1RequestRestoreToplevel uint32 = 3
124+const SessionV1RequestRemoveToplevel uint32 = 4
125+const SessionV1EventCreated uint32 = 0
126+const SessionV1EventRestored uint32 = 1
127+const SessionV1EventReplaced uint32 = 2
128+
129+// SessionV1Error .
130+type SessionV1Error uint32
131+
132+const (
133+ SessionV1ErrorNameInUse SessionV1Error = 1
134+ SessionV1ErrorAlreadyMapped SessionV1Error = 2
135+ SessionV1ErrorInvalidName SessionV1Error = 3
136+ SessionV1ErrorAlreadyAdded SessionV1Error = 4
137+)
138+
139+// SessionV1Handler handles xdg_session_v1 requests.
140+type SessionV1Handler interface {
141+ Destroy(self *SessionV1)
142+ Remove(self *SessionV1)
143+ AddToplevel(self *SessionV1, id uint32, toplevel *xdgshell.Toplevel, name string)
144+ RestoreToplevel(self *SessionV1, id uint32, toplevel *xdgshell.Toplevel, name string)
145+ RemoveToplevel(self *SessionV1, name string)
146+}
147+
148+func NewSessionV1(c server.Client, version int32, id uint32, h SessionV1Handler) (*SessionV1, error) {
149+ if h == nil {
150+ return nil, fmt.Errorf("purego-libwayland: nil handler for xdg_session_v1")
151+ }
152+ var self *SessionV1
153+ r, err := c.CreateResource(SessionV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
154+ switch opcode {
155+ case 0:
156+ h.Destroy(self)
157+ self.Destroy()
158+ case 1:
159+ h.Remove(self)
160+ self.Destroy()
161+ case 2:
162+ h.AddToplevel(self, args[0].NewID(), xdgshell.WrapToplevel(args[1].Resource()), args[2].String())
163+ case 3:
164+ h.RestoreToplevel(self, args[0].NewID(), xdgshell.WrapToplevel(args[1].Resource()), args[2].String())
165+ case 4:
166+ h.RemoveToplevel(self, args[0].String())
167+ }
168+ })
169+ if err != nil {
170+ return nil, err
171+ }
172+ self = WrapSessionV1(r)
173+ r.Data = self
174+ return self, nil
175+}
176+
177+// SendCreated newly-created session id.
178+func (self *SessionV1) SendCreated(sessionId string) {
179+ var p runtime.Pinner
180+ defer p.Unpin()
181+ self.PostEvent(SessionV1EventCreated, server.String(&p, sessionId, false))
182+}
183+
184+// SendRestored the session has been restored.
185+func (self *SessionV1) SendRestored() {
186+ self.PostEvent(SessionV1EventRestored)
187+}
188+
189+// SendReplaced the session has been replaced.
190+func (self *SessionV1) SendReplaced() {
191+ self.PostEvent(SessionV1EventReplaced)
192+}
193+func NewSessionV1Global(d *server.Display, version int32, bind server.BindFunc) error {
194+ return d.CreateGlobal(SessionV1Interface, version, bind)
195+}
196+
197+// ToplevelSessionV1 A session for an application.
198+type ToplevelSessionV1 struct{ *server.Resource }
199+
200+func WrapToplevelSessionV1(r *server.Resource) *ToplevelSessionV1 {
201+ if r == nil {
202+ return nil
203+ }
204+ return &ToplevelSessionV1{r}
205+}
206+
207+const ToplevelSessionV1RequestDestroy uint32 = 0
208+const ToplevelSessionV1RequestRename uint32 = 1
209+const ToplevelSessionV1EventRestored uint32 = 0
210+
211+// ToplevelSessionV1Handler handles xdg_toplevel_session_v1 requests.
212+type ToplevelSessionV1Handler interface {
213+ Destroy(self *ToplevelSessionV1)
214+ Rename(self *ToplevelSessionV1, name string)
215+}
216+
217+func NewToplevelSessionV1(c server.Client, version int32, id uint32, h ToplevelSessionV1Handler) (*ToplevelSessionV1, error) {
218+ if h == nil {
219+ return nil, fmt.Errorf("purego-libwayland: nil handler for xdg_toplevel_session_v1")
220+ }
221+ var self *ToplevelSessionV1
222+ r, err := c.CreateResource(ToplevelSessionV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
223+ switch opcode {
224+ case 0:
225+ h.Destroy(self)
226+ self.Destroy()
227+ case 1:
228+ h.Rename(self, args[0].String())
229+ }
230+ })
231+ if err != nil {
232+ return nil, err
233+ }
234+ self = WrapToplevelSessionV1(r)
235+ r.Data = self
236+ return self, nil
237+}
238+
239+// SendRestored a toplevel's session has been restored.
240+func (self *ToplevelSessionV1) SendRestored() {
241+ self.PostEvent(ToplevelSessionV1EventRestored)
242+}
243+func NewToplevelSessionV1Global(d *server.Display, version int32, bind server.BindFunc) error {
244+ return d.CreateGlobal(ToplevelSessionV1Interface, version, bind)
245+}
246+func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
247+ if v == nil {
248+ return nil
249+ }
250+ return v.GetResource()
251+}
252+func (self *SessionManagerV1) GetResource() *server.Resource {
253+ if self == nil {
254+ return nil
255+ }
256+ return self.Resource
257+}
258+func (self *SessionV1) GetResource() *server.Resource {
259+ if self == nil {
260+ return nil
261+ }
262+ return self.Resource
263+}
264+func (self *ToplevelSessionV1) GetResource() *server.Resource {
265+ if self == nil {
266+ return nil
267+ }
268+ return self.Resource
269+}
A protocol/xdgtopleveldrag/xdgtopleveldrag.go +151 -0
@@ -0,0 +1,151 @@
1+// Code generated by wlgen; DO NOT EDIT.
2+package xdgtopleveldrag
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 ToplevelDragManagerV1Interface *server.Interface
12+var ToplevelDragV1Interface *server.Interface
13+
14+func init() {
15+ ToplevelDragManagerV1Interface = &server.Interface{Name: "xdg_toplevel_drag_manager_v1", Version: 1}
16+ ToplevelDragV1Interface = &server.Interface{Name: "xdg_toplevel_drag_v1", Version: 1}
17+ ToplevelDragManagerV1Interface.Requests = []server.Message{
18+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
19+ {Name: "get_xdg_toplevel_drag", Signature: "no", Types: []*server.Interface{ToplevelDragV1Interface, wayland.DataSourceInterface}},
20+ }
21+ ToplevelDragManagerV1Interface.Events = []server.Message{}
22+ ToplevelDragV1Interface.Requests = []server.Message{
23+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
24+ {Name: "attach", Signature: "oii", Types: []*server.Interface{xdgshell.ToplevelInterface, nil, nil}},
25+ }
26+ ToplevelDragV1Interface.Events = []server.Message{}
27+ if err := server.NewInterfaces(ToplevelDragManagerV1Interface, ToplevelDragV1Interface); err != nil {
28+ panic(err)
29+ }
30+}
31+
32+// ToplevelDragManagerV1 Move a window during a drag.
33+type ToplevelDragManagerV1 struct{ *server.Resource }
34+
35+func WrapToplevelDragManagerV1(r *server.Resource) *ToplevelDragManagerV1 {
36+ if r == nil {
37+ return nil
38+ }
39+ return &ToplevelDragManagerV1{r}
40+}
41+
42+const ToplevelDragManagerV1RequestDestroy uint32 = 0
43+const ToplevelDragManagerV1RequestGetXdgToplevelDrag uint32 = 1
44+
45+// ToplevelDragManagerV1Error .
46+type ToplevelDragManagerV1Error uint32
47+
48+const (
49+ ToplevelDragManagerV1ErrorInvalidSource ToplevelDragManagerV1Error = 0
50+)
51+
52+// ToplevelDragManagerV1Handler handles xdg_toplevel_drag_manager_v1 requests.
53+type ToplevelDragManagerV1Handler interface {
54+ Destroy(self *ToplevelDragManagerV1)
55+ GetXdgToplevelDrag(self *ToplevelDragManagerV1, id uint32, dataSource *wayland.DataSource)
56+}
57+
58+func NewToplevelDragManagerV1(c server.Client, version int32, id uint32, h ToplevelDragManagerV1Handler) (*ToplevelDragManagerV1, error) {
59+ if h == nil {
60+ return nil, fmt.Errorf("purego-libwayland: nil handler for xdg_toplevel_drag_manager_v1")
61+ }
62+ var self *ToplevelDragManagerV1
63+ r, err := c.CreateResource(ToplevelDragManagerV1Interface, 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.GetXdgToplevelDrag(self, args[0].NewID(), wayland.WrapDataSource(args[1].Resource()))
70+ }
71+ })
72+ if err != nil {
73+ return nil, err
74+ }
75+ self = WrapToplevelDragManagerV1(r)
76+ r.Data = self
77+ return self, nil
78+}
79+func NewToplevelDragManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
80+ return d.CreateGlobal(ToplevelDragManagerV1Interface, version, bind)
81+}
82+
83+// ToplevelDragV1 Object representing a toplevel move during a drag.
84+type ToplevelDragV1 struct{ *server.Resource }
85+
86+func WrapToplevelDragV1(r *server.Resource) *ToplevelDragV1 {
87+ if r == nil {
88+ return nil
89+ }
90+ return &ToplevelDragV1{r}
91+}
92+
93+const ToplevelDragV1RequestDestroy uint32 = 0
94+const ToplevelDragV1RequestAttach uint32 = 1
95+
96+// ToplevelDragV1Error .
97+type ToplevelDragV1Error uint32
98+
99+const (
100+ ToplevelDragV1ErrorToplevelAttached ToplevelDragV1Error = 0
101+ ToplevelDragV1ErrorOngoingDrag ToplevelDragV1Error = 1
102+)
103+
104+// ToplevelDragV1Handler handles xdg_toplevel_drag_v1 requests.
105+type ToplevelDragV1Handler interface {
106+ Destroy(self *ToplevelDragV1)
107+ Attach(self *ToplevelDragV1, toplevel *xdgshell.Toplevel, xOffset int32, yOffset int32)
108+}
109+
110+func NewToplevelDragV1(c server.Client, version int32, id uint32, h ToplevelDragV1Handler) (*ToplevelDragV1, error) {
111+ if h == nil {
112+ return nil, fmt.Errorf("purego-libwayland: nil handler for xdg_toplevel_drag_v1")
113+ }
114+ var self *ToplevelDragV1
115+ r, err := c.CreateResource(ToplevelDragV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
116+ switch opcode {
117+ case 0:
118+ h.Destroy(self)
119+ self.Destroy()
120+ case 1:
121+ h.Attach(self, xdgshell.WrapToplevel(args[0].Resource()), args[1].Int(), args[2].Int())
122+ }
123+ })
124+ if err != nil {
125+ return nil, err
126+ }
127+ self = WrapToplevelDragV1(r)
128+ r.Data = self
129+ return self, nil
130+}
131+func NewToplevelDragV1Global(d *server.Display, version int32, bind server.BindFunc) error {
132+ return d.CreateGlobal(ToplevelDragV1Interface, version, bind)
133+}
134+func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
135+ if v == nil {
136+ return nil
137+ }
138+ return v.GetResource()
139+}
140+func (self *ToplevelDragManagerV1) GetResource() *server.Resource {
141+ if self == nil {
142+ return nil
143+ }
144+ return self.Resource
145+}
146+func (self *ToplevelDragV1) GetResource() *server.Resource {
147+ if self == nil {
148+ return nil
149+ }
150+ return self.Resource
151+}
A protocol/xwaylandkeyboardgrab/xwaylandkeyboardgrab.go +130 -0
@@ -0,0 +1,130 @@
1+// Code generated by wlgen; DO NOT EDIT.
2+package xwaylandkeyboardgrab
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 ZwpXwaylandKeyboardGrabManagerV1Interface *server.Interface
11+var ZwpXwaylandKeyboardGrabV1Interface *server.Interface
12+
13+func init() {
14+ ZwpXwaylandKeyboardGrabManagerV1Interface = &server.Interface{Name: "zwp_xwayland_keyboard_grab_manager_v1", Version: 1}
15+ ZwpXwaylandKeyboardGrabV1Interface = &server.Interface{Name: "zwp_xwayland_keyboard_grab_v1", Version: 1}
16+ ZwpXwaylandKeyboardGrabManagerV1Interface.Requests = []server.Message{
17+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
18+ {Name: "grab_keyboard", Signature: "noo", Types: []*server.Interface{ZwpXwaylandKeyboardGrabV1Interface, wayland.SurfaceInterface, wayland.SeatInterface}},
19+ }
20+ ZwpXwaylandKeyboardGrabManagerV1Interface.Events = []server.Message{}
21+ ZwpXwaylandKeyboardGrabV1Interface.Requests = []server.Message{
22+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
23+ }
24+ ZwpXwaylandKeyboardGrabV1Interface.Events = []server.Message{}
25+ if err := server.NewInterfaces(ZwpXwaylandKeyboardGrabManagerV1Interface, ZwpXwaylandKeyboardGrabV1Interface); err != nil {
26+ panic(err)
27+ }
28+}
29+
30+// ZwpXwaylandKeyboardGrabManagerV1 context object for keyboard grab manager.
31+type ZwpXwaylandKeyboardGrabManagerV1 struct{ *server.Resource }
32+
33+func WrapZwpXwaylandKeyboardGrabManagerV1(r *server.Resource) *ZwpXwaylandKeyboardGrabManagerV1 {
34+ if r == nil {
35+ return nil
36+ }
37+ return &ZwpXwaylandKeyboardGrabManagerV1{r}
38+}
39+
40+const ZwpXwaylandKeyboardGrabManagerV1RequestDestroy uint32 = 0
41+const ZwpXwaylandKeyboardGrabManagerV1RequestGrabKeyboard uint32 = 1
42+
43+// ZwpXwaylandKeyboardGrabManagerV1Handler handles zwp_xwayland_keyboard_grab_manager_v1 requests.
44+type ZwpXwaylandKeyboardGrabManagerV1Handler interface {
45+ Destroy(self *ZwpXwaylandKeyboardGrabManagerV1)
46+ GrabKeyboard(self *ZwpXwaylandKeyboardGrabManagerV1, id uint32, surface *wayland.Surface, seat *wayland.Seat)
47+}
48+
49+func NewZwpXwaylandKeyboardGrabManagerV1(c server.Client, version int32, id uint32, h ZwpXwaylandKeyboardGrabManagerV1Handler) (*ZwpXwaylandKeyboardGrabManagerV1, error) {
50+ if h == nil {
51+ return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_xwayland_keyboard_grab_manager_v1")
52+ }
53+ var self *ZwpXwaylandKeyboardGrabManagerV1
54+ r, err := c.CreateResource(ZwpXwaylandKeyboardGrabManagerV1Interface, 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.GrabKeyboard(self, args[0].NewID(), wayland.WrapSurface(args[1].Resource()), wayland.WrapSeat(args[2].Resource()))
61+ }
62+ })
63+ if err != nil {
64+ return nil, err
65+ }
66+ self = WrapZwpXwaylandKeyboardGrabManagerV1(r)
67+ r.Data = self
68+ return self, nil
69+}
70+func NewZwpXwaylandKeyboardGrabManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
71+ return d.CreateGlobal(ZwpXwaylandKeyboardGrabManagerV1Interface, version, bind)
72+}
73+
74+// ZwpXwaylandKeyboardGrabV1 interface for grabbing the keyboard.
75+type ZwpXwaylandKeyboardGrabV1 struct{ *server.Resource }
76+
77+func WrapZwpXwaylandKeyboardGrabV1(r *server.Resource) *ZwpXwaylandKeyboardGrabV1 {
78+ if r == nil {
79+ return nil
80+ }
81+ return &ZwpXwaylandKeyboardGrabV1{r}
82+}
83+
84+const ZwpXwaylandKeyboardGrabV1RequestDestroy uint32 = 0
85+
86+// ZwpXwaylandKeyboardGrabV1Handler handles zwp_xwayland_keyboard_grab_v1 requests.
87+type ZwpXwaylandKeyboardGrabV1Handler interface {
88+ Destroy(self *ZwpXwaylandKeyboardGrabV1)
89+}
90+
91+func NewZwpXwaylandKeyboardGrabV1(c server.Client, version int32, id uint32, h ZwpXwaylandKeyboardGrabV1Handler) (*ZwpXwaylandKeyboardGrabV1, error) {
92+ if h == nil {
93+ return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_xwayland_keyboard_grab_v1")
94+ }
95+ var self *ZwpXwaylandKeyboardGrabV1
96+ r, err := c.CreateResource(ZwpXwaylandKeyboardGrabV1Interface, 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 = WrapZwpXwaylandKeyboardGrabV1(r)
107+ r.Data = self
108+ return self, nil
109+}
110+func NewZwpXwaylandKeyboardGrabV1Global(d *server.Display, version int32, bind server.BindFunc) error {
111+ return d.CreateGlobal(ZwpXwaylandKeyboardGrabV1Interface, 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 *ZwpXwaylandKeyboardGrabManagerV1) GetResource() *server.Resource {
120+ if self == nil {
121+ return nil
122+ }
123+ return self.Resource
124+}
125+func (self *ZwpXwaylandKeyboardGrabV1) GetResource() *server.Resource {
126+ if self == nil {
127+ return nil
128+ }
129+ return self.Resource
130+}
A protocol/xwaylandshell/xwaylandshell.go +150 -0
@@ -0,0 +1,150 @@
1+// Code generated by wlgen; DO NOT EDIT.
2+package xwaylandshell
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 XwaylandShellV1Interface *server.Interface
11+var XwaylandSurfaceV1Interface *server.Interface
12+
13+func init() {
14+ XwaylandShellV1Interface = &server.Interface{Name: "xwayland_shell_v1", Version: 1}
15+ XwaylandSurfaceV1Interface = &server.Interface{Name: "xwayland_surface_v1", Version: 1}
16+ XwaylandShellV1Interface.Requests = []server.Message{
17+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
18+ {Name: "get_xwayland_surface", Signature: "no", Types: []*server.Interface{XwaylandSurfaceV1Interface, wayland.SurfaceInterface}},
19+ }
20+ XwaylandShellV1Interface.Events = []server.Message{}
21+ XwaylandSurfaceV1Interface.Requests = []server.Message{
22+ {Name: "set_serial", Signature: "uu", Types: []*server.Interface{nil, nil}},
23+ {Name: "destroy", Signature: "", Types: []*server.Interface{}},
24+ }
25+ XwaylandSurfaceV1Interface.Events = []server.Message{}
26+ if err := server.NewInterfaces(XwaylandShellV1Interface, XwaylandSurfaceV1Interface); err != nil {
27+ panic(err)
28+ }
29+}
30+
31+// XwaylandShellV1 context object for Xwayland shell.
32+type XwaylandShellV1 struct{ *server.Resource }
33+
34+func WrapXwaylandShellV1(r *server.Resource) *XwaylandShellV1 {
35+ if r == nil {
36+ return nil
37+ }
38+ return &XwaylandShellV1{r}
39+}
40+
41+const XwaylandShellV1RequestDestroy uint32 = 0
42+const XwaylandShellV1RequestGetXwaylandSurface uint32 = 1
43+
44+// XwaylandShellV1Error .
45+type XwaylandShellV1Error uint32
46+
47+const (
48+ XwaylandShellV1ErrorRole XwaylandShellV1Error = 0
49+)
50+
51+// XwaylandShellV1Handler handles xwayland_shell_v1 requests.
52+type XwaylandShellV1Handler interface {
53+ Destroy(self *XwaylandShellV1)
54+ GetXwaylandSurface(self *XwaylandShellV1, id uint32, surface *wayland.Surface)
55+}
56+
57+func NewXwaylandShellV1(c server.Client, version int32, id uint32, h XwaylandShellV1Handler) (*XwaylandShellV1, error) {
58+ if h == nil {
59+ return nil, fmt.Errorf("purego-libwayland: nil handler for xwayland_shell_v1")
60+ }
61+ var self *XwaylandShellV1
62+ r, err := c.CreateResource(XwaylandShellV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
63+ switch opcode {
64+ case 0:
65+ h.Destroy(self)
66+ self.Destroy()
67+ case 1:
68+ h.GetXwaylandSurface(self, args[0].NewID(), wayland.WrapSurface(args[1].Resource()))
69+ }
70+ })
71+ if err != nil {
72+ return nil, err
73+ }
74+ self = WrapXwaylandShellV1(r)
75+ r.Data = self
76+ return self, nil
77+}
78+func NewXwaylandShellV1Global(d *server.Display, version int32, bind server.BindFunc) error {
79+ return d.CreateGlobal(XwaylandShellV1Interface, version, bind)
80+}
81+
82+// XwaylandSurfaceV1 interface for associating Xwayland windows to wl_surfaces.
83+type XwaylandSurfaceV1 struct{ *server.Resource }
84+
85+func WrapXwaylandSurfaceV1(r *server.Resource) *XwaylandSurfaceV1 {
86+ if r == nil {
87+ return nil
88+ }
89+ return &XwaylandSurfaceV1{r}
90+}
91+
92+const XwaylandSurfaceV1RequestSetSerial uint32 = 0
93+const XwaylandSurfaceV1RequestDestroy uint32 = 1
94+
95+// XwaylandSurfaceV1Error .
96+type XwaylandSurfaceV1Error uint32
97+
98+const (
99+ XwaylandSurfaceV1ErrorAlreadyAssociated XwaylandSurfaceV1Error = 0
100+ XwaylandSurfaceV1ErrorInvalidSerial XwaylandSurfaceV1Error = 1
101+)
102+
103+// XwaylandSurfaceV1Handler handles xwayland_surface_v1 requests.
104+type XwaylandSurfaceV1Handler interface {
105+ SetSerial(self *XwaylandSurfaceV1, serialLo uint32, serialHi uint32)
106+ Destroy(self *XwaylandSurfaceV1)
107+}
108+
109+func NewXwaylandSurfaceV1(c server.Client, version int32, id uint32, h XwaylandSurfaceV1Handler) (*XwaylandSurfaceV1, error) {
110+ if h == nil {
111+ return nil, fmt.Errorf("purego-libwayland: nil handler for xwayland_surface_v1")
112+ }
113+ var self *XwaylandSurfaceV1
114+ r, err := c.CreateResource(XwaylandSurfaceV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
115+ switch opcode {
116+ case 0:
117+ h.SetSerial(self, args[0].Uint(), args[1].Uint())
118+ case 1:
119+ h.Destroy(self)
120+ self.Destroy()
121+ }
122+ })
123+ if err != nil {
124+ return nil, err
125+ }
126+ self = WrapXwaylandSurfaceV1(r)
127+ r.Data = self
128+ return self, nil
129+}
130+func NewXwaylandSurfaceV1Global(d *server.Display, version int32, bind server.BindFunc) error {
131+ return d.CreateGlobal(XwaylandSurfaceV1Interface, 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 *XwaylandShellV1) GetResource() *server.Resource {
140+ if self == nil {
141+ return nil
142+ }
143+ return self.Resource
144+}
145+func (self *XwaylandSurfaceV1) GetResource() *server.Resource {
146+ if self == nil {
147+ return nil
148+ }
149+ return self.Resource
150+}
A protocols/alpha-modifier-v1.xml +103 -0
@@ -0,0 +1,103 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<protocol name="alpha_modifier_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="wp_alpha_modifier_v1" version="1">
27+ <description summary="surface alpha modifier manager">
28+ This interface allows a client to set a factor for the alpha values on a
29+ surface, which can be used to offload such operations to the compositor,
30+ which can in turn for example offload them to KMS.
31+
32+ Warning! The protocol described in this file is currently in the testing
33+ phase. Backward compatible changes may be added together with the
34+ corresponding interface version bump. Backward incompatible changes can
35+ only be done by creating a new major version of the extension.
36+ </description>
37+
38+ <request name="destroy" type="destructor">
39+ <description summary="destroy the alpha modifier manager object">
40+ Destroy the alpha modifier manager. This doesn't destroy objects
41+ created with the manager.
42+ </description>
43+ </request>
44+
45+ <enum name="error">
46+ <entry name="already_constructed" value="0"
47+ summary="wl_surface already has a alpha modifier object"/>
48+ </enum>
49+
50+ <request name="get_surface">
51+ <description summary="create a new alpha modifier surface object">
52+ Create a new alpha modifier surface object associated with the
53+ given wl_surface. If there is already such an object associated with
54+ the wl_surface, the already_constructed error will be raised.
55+ </description>
56+ <arg name="id" type="new_id" interface="wp_alpha_modifier_surface_v1"/>
57+ <arg name="surface" type="object" interface="wl_surface"/>
58+ </request>
59+ </interface>
60+
61+ <interface name="wp_alpha_modifier_surface_v1" version="1">
62+ <description summary="alpha modifier object for a surface">
63+ This interface allows the client to set a factor for the alpha values on
64+ a surface, which can be used to offload such operations to the compositor.
65+ The default factor is UINT32_MAX.
66+
67+ This object has to be destroyed before the associated wl_surface. Once the
68+ wl_surface is destroyed, all request on this object will raise the
69+ no_surface error.
70+ </description>
71+
72+ <enum name="error">
73+ <entry name="no_surface" value="0" summary="wl_surface was destroyed"/>
74+ </enum>
75+
76+ <request name="destroy" type="destructor">
77+ <description summary="destroy the alpha modifier object">
78+ This destroys the object, and is equivalent to set_multiplier with
79+ a value of UINT32_MAX, with the same double-buffered semantics as
80+ set_multiplier.
81+ </description>
82+ </request>
83+
84+ <request name="set_multiplier">
85+ <description summary="specify the alpha multiplier">
86+ Sets the alpha multiplier for the surface. The alpha multiplier is
87+ double-buffered state, see wl_surface.commit for details.
88+
89+ This factor is applied in the compositor's blending space, as an
90+ additional step after the processing of per-pixel alpha values for the
91+ wl_surface. The exact meaning of the factor is thus undefined, unless
92+ the blending space is specified in a different extension.
93+
94+ This multiplier is applied even if the buffer attached to the
95+ wl_surface doesn't have an alpha channel; in that case an alpha value
96+ of one is used instead.
97+
98+ Zero means completely transparent, UINT32_MAX means completely opaque.
99+ </description>
100+ <arg name="factor" type="uint"/>
101+ </request>
102+ </interface>
103+</protocol>
A protocols/color-management-v1.xml +1756 -0
@@ -0,0 +1,1756 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<protocol name="color_management_v1">
3+ <copyright>
4+ Copyright 2019 Sebastian Wick
5+ Copyright 2019 Erwin Burema
6+ Copyright 2020 AMD
7+ Copyright 2020-2024 Collabora, Ltd.
8+ Copyright 2024 Xaver Hugl
9+ Copyright 2022-2025 Red Hat, Inc.
10+
11+ Permission is hereby granted, free of charge, to any person obtaining a
12+ copy of this software and associated documentation files (the "Software"),
13+ to deal in the Software without restriction, including without limitation
14+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
15+ and/or sell copies of the Software, and to permit persons to whom the
16+ Software is furnished to do so, subject to the following conditions:
17+
18+ The above copyright notice and this permission notice (including the next
19+ paragraph) shall be included in all copies or substantial portions of the
20+ Software.
21+
22+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
25+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
27+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
28+ DEALINGS IN THE SOFTWARE.
29+ </copyright>
30+
31+ <description summary="color management protocol">
32+ The aim of the color management extension is to allow clients to know
33+ the color properties of outputs, and to tell the compositor about the color
34+ properties of their content on surfaces. All surface contents must be
35+ readily intended for some display, but not necessarily for the display at
36+ hand. Doing this enables a compositor to perform automatic color management
37+ of content for different outputs according to how content is intended to
38+ look like.
39+
40+ For an introduction, see the section "Color management" in the Wayland
41+ documentation at https://wayland.freedesktop.org/docs/html/ .
42+
43+ The color properties are represented as an image description object which
44+ is immutable after it has been created. A wl_output always has an
45+ associated image description that clients can observe. A wl_surface
46+ always has an associated preferred image description as a hint chosen by
47+ the compositor that clients can also observe. Clients can set an image
48+ description on a wl_surface to denote the color characteristics of the
49+ surface contents.
50+
51+ An image description essentially defines a display and (indirectly) its
52+ viewing environment. An image description includes SDR and HDR colorimetry
53+ and encoding, HDR metadata, and some parameters related to the viewing
54+ environment. An image description does not include the properties set
55+ through color-representation extension. It is expected that the
56+ color-representation extension is used in conjunction with the
57+ color-management extension when necessary, particularly with the YUV family
58+ of pixel formats.
59+
60+ The normative appendix for this protocol is in the appendix.md file beside
61+ this XML file.
62+
63+ The color-and-hdr repository
64+ (https://gitlab.freedesktop.org/pq/color-and-hdr) contains
65+ background information on the protocol design and legacy color management.
66+ It also contains a glossary, learning resources for digital color, tools,
67+ samples and more.
68+
69+ The terminology used in this protocol is based on common color science and
70+ color encoding terminology where possible. The glossary in the color-and-hdr
71+ repository shall be the authority on the definition of terms in this
72+ protocol.
73+
74+ Warning! The protocol described in this file is currently in the testing
75+ phase. Backward compatible changes may be added together with the
76+ corresponding interface version bump. Backward incompatible changes can
77+ only be done by creating a new major version of the extension.
78+ </description>
79+
80+ <interface name="wp_color_manager_v1" version="3">
81+ <description summary="color manager singleton">
82+ A singleton global interface used for getting color management extensions
83+ for wl_surface and wl_output objects, and for creating client defined
84+ image description objects. The extension interfaces allow
85+ getting the image description of outputs and setting the image
86+ description of surfaces.
87+
88+ Compositors should never remove this global.
89+ </description>
90+
91+ <request name="destroy" type="destructor">
92+ <description summary="destroy the color manager">
93+ Destroy the wp_color_manager_v1 object. This does not affect any other
94+ objects in any way.
95+ </description>
96+ </request>
97+
98+ <enum name="error">
99+ <entry name="unsupported_feature" value="0"
100+ summary="request not supported"/>
101+ <entry name="surface_exists" value="1"
102+ summary="color management surface exists already"/>
103+ </enum>
104+
105+ <enum name="render_intent">
106+ <description summary="rendering intents">
107+ See the ICC.1:2022 specification from the International Color Consortium
108+ for more details about rendering intents.
109+
110+ The principles of ICC defined rendering intents apply with all types of
111+ image descriptions, not only those with ICC file profiles.
112+
113+ Compositors must support the perceptual rendering intent. Other
114+ rendering intents are optional.
115+ </description>
116+
117+ <entry name="perceptual" value="0"
118+ summary="perceptual"/>
119+ <entry name="relative" value="1"
120+ summary="media-relative colorimetric"/>
121+ <entry name="saturation" value="2"
122+ summary="saturation"/>
123+ <entry name="absolute" value="3"
124+ summary="ICC-absolute colorimetric"/>
125+ <entry name="relative_bpc" value="4"
126+ summary="media-relative colorimetric + black point compensation"/>
127+ <entry name="absolute_no_adaptation" value="5" since="2">
128+ <description summary="ICC-absolute colorimetric without adaptation">
129+ This rendering intent is a modified absolute rendering intent that
130+ assumes the viewer is not adapted to the display white point, so no
131+ chromatic adaptation between surface and display is done.
132+ This can be useful for color proofing applications.
133+ </description>
134+ </entry>
135+ </enum>
136+
137+ <enum name="feature">
138+ <description summary="compositor supported features"/>
139+
140+ <entry name="icc_v2_v4" value="0"
141+ summary="create_icc_creator request"/>
142+ <entry name="parametric" value="1"
143+ summary="create_parametric_creator request"/>
144+ <entry name="set_primaries" value="2"
145+ summary="parametric set_primaries request"/>
146+ <entry name="set_tf_power" value="3"
147+ summary="parametric set_tf_power request"/>
148+ <entry name="set_luminances" value="4"
149+ summary="parametric set_luminances request"/>
150+ <entry name="set_mastering_display_primaries" value="5">
151+ <description summary="parametric set_mastering_display_primaries request">
152+ The compositor supports set_mastering_display_primaries request with a
153+ target color volume fully contained inside the primary color volume.
154+ </description>
155+ </entry>
156+ <entry name="extended_target_volume" value="6">
157+ <description summary="parametric target exceeds primary color volume">
158+ The compositor additionally supports target color volumes that
159+ extend outside of the primary color volume.
160+
161+ This can only be advertised if feature set_mastering_display_primaries
162+ is supported as well.
163+ </description>
164+ </entry>
165+ <entry name="windows_scrgb" value="7"
166+ summary="create_windows_scrgb request"/>
167+ <entry name="windows_bt2100" value="8"
168+ summary="create_windows_bt2100 request"/>
169+ </enum>
170+
171+ <enum name="primaries">
172+ <description summary="named color primaries">
173+ Named color primaries used to encode well-known sets of primaries.
174+
175+ A value of 0 is invalid and will never be present in the list of enums.
176+ </description>
177+
178+ <entry name="srgb" value="1">
179+ <description summary="Color primaries for the sRGB color space as defined by the BT.709 standard">
180+ Color primaries as defined by
181+ - Rec. ITU-R BT.709-6
182+ - Rec. ITU-R BT.1361-0 conventional colour gamut system and extended
183+ colour gamut system (historical)
184+ - IEC 61966-2-1 sRGB or sYCC
185+ - IEC 61966-2-4
186+ - Society of Motion Picture and Television Engineers (SMPTE) RP 177
187+ (1993) Annex B
188+ </description>
189+ </entry>
190+ <entry name="pal_m" value="2">
191+ <description summary="Color primaries for PAL-M as defined by the BT.470 standard">
192+ Color primaries as defined by
193+ - Rec. ITU-R BT.470-6 System M (historical)
194+ - United States National Television System Committee 1953
195+ Recommendation for transmission standards for color television
196+ - United States Federal Communications Commission (2003) Title 47 Code
197+ of Federal Regulations 73.682 (a)(20)
198+ </description>
199+ </entry>
200+ <entry name="pal" value="3">
201+ <description summary="Color primaries for PAL as defined by the BT.601 standard">
202+ Color primaries as defined by
203+ - Rec. ITU-R BT.470-6 System B, G (historical)
204+ - Rec. ITU-R BT.601-7 625
205+ - Rec. ITU-R BT.1358-0 625 (historical)
206+ - Rec. ITU-R BT.1700-0 625 PAL and 625 SECAM
207+ </description>
208+ </entry>
209+ <entry name="ntsc" value="4">
210+ <description summary="Color primaries for NTSC as defined by the BT.601 standard">
211+ Color primaries as defined by
212+ - Rec. ITU-R BT.601-7 525
213+ - Rec. ITU-R BT.1358-1 525 or 625 (historical)
214+ - Rec. ITU-R BT.1700-0 NTSC
215+ - SMPTE 170M (2004)
216+ - SMPTE 240M (1999) (historical)
217+ </description>
218+ </entry>
219+ <entry name="generic_film" value="5">
220+ <description summary="Generic film with colour filters using Illuminant C">
221+ Color primaries as defined by Recommendation ITU-T H.273
222+ "Coding-independent code points for video signal type identification"
223+ for "generic film".
224+ </description>
225+ </entry>
226+ <entry name="bt2020" value="6">
227+ <description summary="Color primaries as defined by the BT.2020 and BT.2100 standard">
228+ Color primaries as defined by
229+ - Rec. ITU-R BT.2020-2
230+ - Rec. ITU-R BT.2100-0
231+ </description>
232+ </entry>
233+ <entry name="cie1931_xyz" value="7">
234+ <description summary="Color primaries of the full CIE 1931 XYZ color space">
235+ Color primaries as defined as the maximum of the CIE 1931 XYZ color
236+ space by
237+ - SMPTE ST 428-1
238+ - (CIE 1931 XYZ as in ISO 11664-1)
239+ </description>
240+ </entry>
241+ <entry name="dci_p3" value="8">
242+ <description summary="Color primaries of the DCI P3 color space as defined by the SMPTE RP 431 standard">
243+ Color primaries as defined by Digital Cinema System and published in
244+ SMPTE RP 431-2 (2011).
245+ </description>
246+ </entry>
247+ <entry name="display_p3" value="9">
248+ <description summary="Color primaries of Display P3 variant of the DCI-P3 color space as defined by the SMPTE EG 432 standard">
249+ Color primaries as defined by Digital Cinema System and published in
250+ SMPTE EG 432-1 (2010).
251+ </description>
252+ </entry>
253+ <entry name="adobe_rgb" value="10">
254+ <description summary="Color primaries of the Adobe RGB color space as defined by the ISO 12640 standard">
255+ Color primaries as defined by Adobe as "Adobe RGB" and later published
256+ by ISO 12640-4 (2011).
257+ </description>
258+ </entry>
259+ </enum>
260+
261+ <enum name="transfer_function">
262+ <description summary="named transfer functions">
263+ Named transfer functions used to represent well-known transfer
264+ characteristics of displays.
265+
266+ A value of 0 is invalid and will never be present in the list of enums.
267+
268+ See appendix.md for the formulae.
269+ </description>
270+
271+ <entry name="bt1886" value="1">
272+ <description summary="BT.1886 display transfer characteristic">
273+ Rec. ITU-R BT.1886 is the display transfer characteristic assumed by
274+ - Rec. ITU-R BT.601-7 525 and 625
275+ - Rec. ITU-R BT.709-6
276+ - Rec. ITU-R BT.2020-2
277+
278+ This TF implies these default luminances from Rec. ITU-R BT.2035:
279+ - primary color volume minimum: 0.01 cd/m²
280+ - primary color volume maximum: 100 cd/m²
281+ - reference white: 100 cd/m²
282+ </description>
283+ </entry>
284+ <entry name="gamma22" value="2">
285+ <description summary="Assumed display gamma 2.2 transfer function">
286+ Transfer characteristics as defined by
287+ - Rec. ITU-R BT.470-6 System M (historical)
288+ - United States National Television System Committee 1953
289+ Recommendation for transmission standards for color television
290+ - United States Federal Communications Commission (2003) Title 47 Code
291+ of Federal Regulations 73.682 (a) (20)
292+ - Rec. ITU-R BT.1700-0 625 PAL and 625 SECAM
293+ - IEC 61966-2-1 (reference display)
294+ </description>
295+ </entry>
296+ <entry name="gamma28" value="3">
297+ <description summary="Assumed display gamma 2.8 transfer function">
298+ Transfer characteristics as defined by
299+ - Rec. ITU-R BT.470-6 System B, G (historical)
300+ </description>
301+ </entry>
302+ <entry name="st240" value="4">
303+ <description summary="SMPTE ST 240 transfer function">
304+ Transfer characteristics as defined by
305+ - SMPTE ST 240 (1999)
306+ </description>
307+ </entry>
308+ <entry name="ext_linear" value="5">
309+ <description summary="extended linear transfer function">
310+ Linear transfer function defined over all real numbers.
311+ Normalised electrical values are equal the normalised optical values.
312+ </description>
313+ </entry>
314+ <entry name="log_100" value="6">
315+ <description summary="logarithmic 100:1 transfer function">
316+ Logarithmic transfer characteristic (100:1 range).
317+ </description>
318+ </entry>
319+ <entry name="log_316" value="7">
320+ <description summary="logarithmic (100*Sqrt(10) : 1) transfer function">
321+ Logarithmic transfer characteristic (100 * Sqrt(10) : 1 range).
322+ </description>
323+ </entry>
324+ <entry name="xvycc" value="8">
325+ <description summary="IEC 61966-2-4 transfer function">
326+ Transfer characteristics as defined by
327+ - IEC 61966-2-4
328+ </description>
329+ </entry>
330+ <entry name="srgb" value="9" deprecated-since="2">
331+ <description summary="Deprecated (ambiguous sRGB transfer function)">
332+ Transfer characteristics as defined by
333+ - IEC 61966-2-1 sRGB
334+
335+ As a rule of thumb, use gamma22 for video, motion picture and
336+ computer graphics, or compound_power_2_4 for ICC calibrated print
337+ workflows.
338+ </description>
339+ </entry>
340+ <entry name="ext_srgb" value="10" deprecated-since="2">
341+ <description summary="Deprecated (Extended sRGB piece-wise transfer function)">
342+ Transfer characteristics as defined by
343+ - IEC 61966-2-1 sYCC
344+ </description>
345+ </entry>
346+ <entry name="st2084_pq" value="11">
347+ <description summary="perceptual quantizer transfer function">
348+ Transfer characteristics as defined by
349+ - SMPTE ST 2084 (2014) for 10-, 12-, 14- and 16-bit systems
350+ - Rec. ITU-R BT.2100-2 perceptual quantization (PQ) system
351+
352+ This TF implies these default luminances
353+ - primary color volume minimum: 0.005 cd/m²
354+ - primary color volume maximum: 10000 cd/m²
355+ - reference white: 203 cd/m²
356+
357+ The difference between the primary color volume minimum and maximum
358+ must be approximately 10000 cd/m² as that is the swing of the EOTF
359+ defined by ST 2084 and BT.2100. The default value for the
360+ reference white is a protocol addition: it is suggested by
361+ Report ITU-R BT.2408-7 and is not part of ST 2084 or BT.2100.
362+ </description>
363+ </entry>
364+ <entry name="st428" value="12">
365+ <description summary="SMPTE ST 428 transfer function">
366+ Transfer characteristics as defined by
367+ - SMPTE ST 428-1 (2019)
368+ </description>
369+ </entry>
370+ <entry name="hlg" value="13">
371+ <description summary="hybrid log-gamma transfer function">
372+ Transfer characteristics as defined by
373+ - ARIB STD-B67 (2015)
374+ - Rec. ITU-R BT.2100-2 hybrid log-gamma (HLG) system
375+
376+ This TF implies these default luminances
377+ - primary color volume minimum: 0.005 cd/m²
378+ - primary color volume maximum: 1000 cd/m²
379+ - reference white: 203 cd/m²
380+
381+ HLG is a relative display-referred signal with a specified
382+ non-linear mapping to the display peak luminance (the HLG OOTF).
383+ All absolute luminance values used here for HLG assume a 1000 cd/m²
384+ peak display.
385+
386+ The default value for the reference white is a protocol addition:
387+ it is suggested by Report ITU-R BT.2408-7 and is not part of
388+ ARIB STD-B67 or BT.2100.
389+ </description>
390+ </entry>
391+ <entry name="compound_power_2_4" value="14" since="2">
392+ <description summary="IEC 61966-2-1 encoding function">
393+ Encoding characteristics as defined by IEC 61966-2-1, for displays
394+ that invert the encoding function.
395+ </description>
396+ </entry>
397+ </enum>
398+
399+ <request name="get_output">
400+ <description summary="create a color management interface for a wl_output">
401+ This creates a new wp_color_management_output_v1 object for the
402+ given wl_output.
403+
404+ See the wp_color_management_output_v1 interface for more details.
405+ </description>
406+
407+ <arg name="id" type="new_id" interface="wp_color_management_output_v1"/>
408+ <arg name="output" type="object" interface="wl_output"/>
409+ </request>
410+
411+ <request name="get_surface">
412+ <description summary="create a color management interface for a wl_surface">
413+ If a wp_color_management_surface_v1 object already exists for the given
414+ wl_surface, the protocol error surface_exists is raised.
415+
416+ This creates a new color wp_color_management_surface_v1 object for the
417+ given wl_surface.
418+
419+ See the wp_color_management_surface_v1 interface for more details.
420+ </description>
421+
422+ <arg name="id" type="new_id" interface="wp_color_management_surface_v1"/>
423+ <arg name="surface" type="object" interface="wl_surface"/>
424+ </request>
425+
426+ <request name="get_surface_feedback">
427+ <description summary="create a color management feedback interface">
428+ This creates a new color wp_color_management_surface_feedback_v1 object
429+ for the given wl_surface.
430+
431+ See the wp_color_management_surface_feedback_v1 interface for more
432+ details.
433+ </description>
434+
435+ <arg name="id" type="new_id"
436+ interface="wp_color_management_surface_feedback_v1"/>
437+ <arg name="surface" type="object" interface="wl_surface"/>
438+ </request>
439+
440+ <request name="create_icc_creator">
441+ <description summary="make a new ICC-based image description creator object">
442+ Makes a new ICC-based image description creator object with all
443+ properties initially unset. The client can then use the object's
444+ interface to define all the required properties for an image description
445+ and finally create a wp_image_description_v1 object.
446+
447+ This request can be used when the compositor advertises
448+ wp_color_manager_v1.feature.icc_v2_v4.
449+ Otherwise this request raises the protocol error unsupported_feature.
450+ </description>
451+
452+ <arg name="obj"
453+ type="new_id" interface="wp_image_description_creator_icc_v1"
454+ summary="the new creator object"/>
455+ </request>
456+
457+ <request name="create_parametric_creator">
458+ <description summary="make a new parametric image description creator object">
459+ Makes a new parametric image description creator object with all
460+ properties initially unset. The client can then use the object's
461+ interface to define all the required properties for an image description
462+ and finally create a wp_image_description_v1 object.
463+
464+ This request can be used when the compositor advertises
465+ wp_color_manager_v1.feature.parametric.
466+ Otherwise this request raises the protocol error unsupported_feature.
467+ </description>
468+
469+ <arg name="obj"
470+ type="new_id" interface="wp_image_description_creator_params_v1"
471+ summary="the new creator object"/>
472+ </request>
473+
474+ <request name="create_windows_scrgb">
475+ <description summary="create Windows-scRGB image description object">
476+ This creates a pre-defined image description for the so-called
477+ Windows-scRGB stimulus encoding. This comes from the Windows 10 handling
478+ of its own definition of an scRGB color space for an HDR screen
479+ driven in BT.2100/PQ signalling mode.
480+
481+ Windows-scRGB uses sRGB (BT.709) color primaries and white point.
482+ The transfer characteristic is extended linear.
483+
484+ The nominal color channel value range is extended, meaning it includes
485+ negative and greater than 1.0 values. Negative values are used to
486+ escape the sRGB color gamut boundaries. To make use of the extended
487+ range, the client needs to use a pixel format that can represent those
488+ values, e.g. floating-point 16 bits per channel.
489+
490+ Nominal color value R=G=B=0.0 corresponds to BT.2100/PQ system
491+ 0 cd/m², and R=G=B=1.0 corresponds to BT.2100/PQ system 80 cd/m².
492+ The maximum is R=G=B=125.0 corresponding to 10k cd/m².
493+
494+ Windows-scRGB is displayed by Windows 10 by converting it to
495+ BT.2100/PQ, maintaining the CIE 1931 chromaticity and mapping the
496+ luminance as above. No adjustment is made to the signal to account
497+ for the viewing conditions.
498+
499+ The reference white level of Windows-scRGB is unknown. If a
500+ reference white level must be assumed for compositor processing, it
501+ should be R=G=B=2.5375 corresponding to 203 cd/m² of Report ITU-R
502+ BT.2408-7.
503+
504+ The target color volume of Windows-scRGB is unknown. The color gamut
505+ may be anything between sRGB and BT.2100.
506+
507+ Note: EGL_EXT_gl_colorspace_scrgb_linear definition differs from
508+ Windows-scRGB by using R=G=B=1.0 as the reference white level, while
509+ Windows-scRGB reference white level is unknown or varies. However,
510+ it seems probable that Windows implements both
511+ EGL_EXT_gl_colorspace_scrgb_linear and Vulkan
512+ VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT as Windows-scRGB.
513+
514+ This request can be used when the compositor advertises
515+ wp_color_manager_v1.feature.windows_scrgb.
516+ Otherwise this request raises the protocol error unsupported_feature.
517+
518+ The resulting image description object does not allow get_information
519+ request. The wp_image_description_v1.ready event shall be sent.
520+ </description>
521+
522+ <arg name="image_description"
523+ type="new_id" interface="wp_image_description_v1"/>
524+ </request>
525+
526+ <event name="supported_intent">
527+ <description summary="supported rendering intent">
528+ When this object is created, it shall immediately send this event once
529+ for each rendering intent the compositor supports.
530+
531+ A compositor must not advertise intents that are deprecated in the
532+ bound version of the interface.
533+ </description>
534+
535+ <arg name="render_intent" type="uint" enum="render_intent"
536+ summary="rendering intent"/>
537+ </event>
538+
539+ <event name="supported_feature">
540+ <description summary="supported features">
541+ When this object is created, it shall immediately send this event once
542+ for each compositor supported feature listed in the enumeration.
543+
544+ A compositor must not advertise features that are deprecated in the
545+ bound version of the interface.
546+ </description>
547+
548+ <arg name="feature" type="uint" enum="feature"
549+ summary="supported feature"/>
550+ </event>
551+
552+ <event name="supported_tf_named">
553+ <description summary="supported named transfer characteristic">
554+ When this object is created, it shall immediately send this event once
555+ for each named transfer function the compositor supports with the
556+ parametric image description creator.
557+
558+ A compositor must not advertise transfer functions that are deprecated
559+ in the bound version of the interface.
560+ </description>
561+
562+ <arg name="tf" type="uint" enum="transfer_function"
563+ summary="Named transfer function"/>
564+ </event>
565+
566+ <event name="supported_primaries_named">
567+ <description summary="supported named primaries">
568+ When this object is created, it shall immediately send this event once
569+ for each named set of primaries the compositor supports with the
570+ parametric image description creator.
571+
572+ A compositor must not advertise names that are deprecated in the
573+ bound version of the interface.
574+ </description>
575+
576+ <arg name="primaries" type="uint" enum="primaries"
577+ summary="Named color primaries"/>
578+ </event>
579+
580+ <event name="done">
581+ <description summary="all features have been sent">
582+ This event is sent when all supported rendering intents, features,
583+ transfer functions and named primaries have been sent.
584+ </description>
585+ </event>
586+
587+ <request name="get_image_description" since="2">
588+ <description summary="create an image description from a reference">
589+ This request retrieves the image description backing a reference.
590+
591+ The get_information request can be used if and only if the request that
592+ creates the reference allows it.
593+ </description>
594+
595+ <arg name="image_description"
596+ type="new_id" interface="wp_image_description_v1"/>
597+ <arg name="reference"
598+ type="object" interface="wp_image_description_reference_v1"/>
599+ </request>
600+
601+ <request name="create_windows_bt2100" since="3">
602+ <description summary="create Windows-BT.2100 image description object">
603+ This creates a pre-defined image description for the so-called
604+ Windows-BT.2100 stimulus encoding. This comes from the Windows 10
605+ handling of its own definition of a BT.2100 color space for an HDR
606+ screen driven in BT.2100/PQ signalling mode.
607+
608+ Windows-BT.2100 uses BT.2020 color primaries and white point.
609+ The transfer characteristic is st2084_pq.
610+
611+ Windows-BT.2100 is generally displayed by Windows 10 without any
612+ adjustments to the signal to account for viewing conditions.
613+
614+ The reference white level of Windows-BT.2100 is unknown. If a
615+ reference white level must be assumed for compositor processing, it
616+ should be 203 cd/m² of Report ITU-R BT.2408-7.
617+
618+ The target color volume of Windows-BT.2100 is unknown. The color gamut
619+ may be anything up to BT.2100.
620+
621+ This request can be used when the compositor advertises
622+ wp_color_manager_v1.feature.windows_bt2100.
623+ Otherwise this request raises the protocol error unsupported_feature.
624+
625+ The resulting image description object does not allow get_information
626+ request. The wp_image_description_v1.ready event shall be sent.
627+ </description>
628+
629+ <arg name="image_description"
630+ type="new_id" interface="wp_image_description_v1"/>
631+ </request>
632+ </interface>
633+
634+ <interface name="wp_color_management_output_v1" version="3">
635+ <description summary="output color properties">
636+ A wp_color_management_output_v1 describes the color properties of an
637+ output.
638+
639+ The wp_color_management_output_v1 is associated with the wl_output global
640+ underlying the wl_output object. Therefore the client destroying the
641+ wl_output object has no impact, but the compositor removing the output
642+ global makes the wp_color_management_output_v1 object inert.
643+ </description>
644+
645+ <request name="destroy" type="destructor">
646+ <description summary="destroy the color management output">
647+ Destroy the color wp_color_management_output_v1 object. This does not
648+ affect any remaining protocol objects.
649+ </description>
650+ </request>
651+
652+ <event name="image_description_changed">
653+ <description summary="image description changed">
654+ This event is sent whenever the image description of the output changed,
655+ followed by one wl_output.done event common to output events across all
656+ extensions.
657+
658+ If the client wants to use the updated image description, it needs to do
659+ get_image_description again, because image description objects are
660+ immutable.
661+ </description>
662+ </event>
663+
664+ <request name="get_image_description">
665+ <description summary="get the image description of the output">
666+ This creates a new wp_image_description_v1 object for the current image
667+ description of the output. There always is exactly one image description
668+ active for an output so the client should destroy the image description
669+ created by earlier invocations of this request. This request is usually
670+ sent as a reaction to the image_description_changed event or when
671+ creating a wp_color_management_output_v1 object.
672+
673+ The image description of an output represents the color encoding the
674+ output expects. There might be performance and power advantages, as well
675+ as improved color reproduction, if a content update matches the image
676+ description of the output it is being shown on. If a content update is
677+ shown on any other output than the one it matches the image description
678+ of, then the color reproduction on those outputs might be considerably
679+ worse.
680+
681+ The created wp_image_description_v1 object preserves the image
682+ description of the output from the time the object was created.
683+
684+ The resulting image description object allows get_information request.
685+
686+ If this protocol object is inert, the resulting image description object
687+ shall immediately deliver the wp_image_description_v1.failed event with
688+ the no_output cause.
689+
690+ If the interface version is inadequate for the output's image
691+ description, meaning that the client does not support all the events
692+ needed to deliver the crucial information, the resulting image
693+ description object shall immediately deliver the
694+ wp_image_description_v1.failed event with the low_version cause.
695+
696+ Otherwise the object shall immediately deliver the ready event.
697+ </description>
698+
699+ <arg name="image_description"
700+ type="new_id" interface="wp_image_description_v1"/>
701+ </request>
702+ </interface>
703+
704+ <interface name="wp_color_management_surface_v1" version="3">
705+ <description summary="color management extension to a surface">
706+ A wp_color_management_surface_v1 allows the client to set the color
707+ space and HDR properties of a surface.
708+
709+ If the wl_surface associated with the wp_color_management_surface_v1 is
710+ destroyed, the wp_color_management_surface_v1 object becomes inert.
711+ </description>
712+
713+ <request name="destroy" type="destructor">
714+ <description summary="destroy the color management interface for a surface">
715+ Destroy the wp_color_management_surface_v1 object and do the same as
716+ unset_image_description.
717+ </description>
718+ </request>
719+
720+ <enum name="error">
721+ <description summary="protocol errors"/>
722+ <entry name="render_intent" value="0"
723+ summary="unsupported rendering intent"/>
724+ <entry name="image_description" value="1"
725+ summary="invalid image description"/>
726+ <entry name="inert" value="2"
727+ summary="forbidden request on inert object"/>
728+ </enum>
729+
730+ <request name="set_image_description">
731+ <description summary="set the surface image description">
732+ If this protocol object is inert, the protocol error inert is raised.
733+
734+ Set the image description of the underlying surface. The image
735+ description and rendering intent are double-buffered state, see
736+ wl_surface.commit.
737+
738+ It is the client's responsibility to understand the image description
739+ it sets on a surface, and to provide content that matches that image
740+ description. Compositors might convert images to match their own or any
741+ other image descriptions.
742+
743+ Image descriptions which are not ready (see wp_image_description_v1)
744+ are forbidden in this request, and in such case the protocol error
745+ image_description is raised.
746+
747+ All image descriptions which are ready (see wp_image_description_v1)
748+ are allowed and must always be accepted by the compositor.
749+
750+ When an image description is set on a surface, it establishes an
751+ explicit link between surface pixel values and surface colorimetry.
752+ This link may be undefined for some pixel values, see the image
753+ description creator interfaces for the conditions. Non-finite
754+ floating-point values (NaN, Inf) always have an undefined colorimetry.
755+
756+ A rendering intent provides the client's preference on how surface
757+ colorimetry should be mapped to each output. The render_intent value
758+ must be one advertised by the compositor with
759+ wp_color_manager_v1.render_intent event, otherwise the protocol error
760+ render_intent is raised.
761+
762+ By default, a surface does not have an associated image description
763+ nor a rendering intent. The handling of color on such surfaces is
764+ compositor implementation defined. Compositors should handle such
765+ surfaces as sRGB, but may handle them differently if they have specific
766+ requirements.
767+
768+ Setting the image description has copy semantics; after this request,
769+ the image description can be immediately destroyed without affecting
770+ the pending state of the surface.
771+ </description>
772+
773+ <arg name="image_description"
774+ type="object" interface="wp_image_description_v1"/>
775+ <arg name="render_intent"
776+ type="uint" enum="wp_color_manager_v1.render_intent"
777+ summary="rendering intent"/>
778+ </request>
779+
780+ <request name="unset_image_description">
781+ <description summary="remove the surface image description">
782+ If this protocol object is inert, the protocol error inert is raised.
783+
784+ This request removes any image description from the surface. See
785+ set_image_description for how a compositor handles a surface without
786+ an image description. This is double-buffered state, see
787+ wl_surface.commit.
788+ </description>
789+ </request>
790+ </interface>
791+
792+ <interface name="wp_color_management_surface_feedback_v1" version="3">
793+ <description summary="color management extension to a surface">
794+ A wp_color_management_surface_feedback_v1 allows the client to get the
795+ preferred image description of a surface.
796+
797+ If the wl_surface associated with this object is destroyed, the
798+ wp_color_management_surface_feedback_v1 object becomes inert.
799+ </description>
800+
801+ <request name="destroy" type="destructor">
802+ <description summary="destroy the color management interface for a surface">
803+ Destroy the wp_color_management_surface_feedback_v1 object.
804+ </description>
805+ </request>
806+
807+ <enum name="error">
808+ <description summary="protocol errors"/>
809+ <entry name="inert" value="0"
810+ summary="forbidden request on inert object"/>
811+ <entry name="unsupported_feature" value="1"
812+ summary="attempted to use an unsupported feature"/>
813+ </enum>
814+
815+ <event name="preferred_changed" deprecated-since="2">
816+ <description summary="the preferred image description changed (32-bit)">
817+ Starting from interface version 2, 'preferred_changed2' is sent instead
818+ of this event. See the 'preferred_changed2' event for the definition.
819+ </description>
820+
821+ <arg name="identity" type="uint"
822+ summary="the 32-bit image description id number"/>
823+ </event>
824+
825+ <request name="get_preferred">
826+ <description summary="get the preferred image description">
827+ If this protocol object is inert, the protocol error inert is raised.
828+
829+ The preferred image description represents the compositor's preferred
830+ color encoding for this wl_surface at the current time. There might be
831+ performance and power advantages, as well as improved color
832+ reproduction, if the image description of a content update matches the
833+ preferred image description.
834+
835+ This creates a new wp_image_description_v1 object for the currently
836+ preferred image description for the wl_surface. The client should
837+ stop using and destroy the image descriptions created by earlier
838+ invocations of this request for the associated wl_surface.
839+ This request is usually sent as a reaction to the preferred_changed
840+ event or when creating a wp_color_management_surface_feedback_v1 object
841+ if the client is capable of adapting to image descriptions.
842+
843+ The created wp_image_description_v1 object preserves the preferred image
844+ description of the wl_surface from the time the object was created.
845+
846+ The resulting image description object allows get_information request.
847+
848+ If the image description is parametric, the client should set it on its
849+ wl_surface only if the image description is an exact match with the
850+ client content. Particularly if everything else matches, but the target
851+ color volume is greater than what the client needs, the client should
852+ create its own parameric image description with its exact parameters.
853+
854+ If the interface version is inadequate for the preferred image
855+ description, meaning that the client does not support all the
856+ events needed to deliver the crucial information, the resulting image
857+ description object shall immediately deliver the
858+ wp_image_description_v1.failed event with the low_version cause,
859+ otherwise the object shall immediately deliver the ready event.
860+ </description>
861+
862+ <arg name="image_description"
863+ type="new_id" interface="wp_image_description_v1"/>
864+ </request>
865+
866+ <request name="get_preferred_parametric">
867+ <description summary="get the preferred image description">
868+ The same description as for get_preferred applies, except the returned
869+ image description is guaranteed to be parametric. This is meant for
870+ clients that can only deal with parametric image descriptions.
871+
872+ If the compositor doesn't support parametric image descriptions, the
873+ unsupported_feature error is emitted.
874+ </description>
875+
876+ <arg name="image_description"
877+ type="new_id" interface="wp_image_description_v1"/>
878+ </request>
879+
880+ <!-- Version 2 additions -->
881+
882+ <event name="preferred_changed2" since="2">
883+ <description summary="the preferred image description changed">
884+ The preferred image description is the one which likely has the most
885+ performance and/or quality benefits for the compositor if used by the
886+ client for its wl_surface contents. This event is sent whenever the
887+ compositor changes the wl_surface's preferred image description.
888+
889+ This event sends the identity of the new preferred state as the argument,
890+ so clients who are aware of the image description already can reuse it.
891+ Otherwise, if the client client wants to know what the preferred image
892+ description is, it shall use the get_preferred request.
893+
894+ The preferred image description is not automatically used for anything.
895+ It is only a hint, and clients may set any valid image description with
896+ set_image_description, but there might be performance and color accuracy
897+ improvements by providing the wl_surface contents in the preferred
898+ image description. Therefore clients that can, should render according
899+ to the preferred image description
900+ </description>
901+
902+ <arg name="identity_hi" type="uint"
903+ summary="high 32 bits of the 64-bit image description id number"/>
904+ <arg name="identity_lo" type="uint"
905+ summary="low 32 bits of the 64-bit image description id number"/>
906+ </event>
907+
908+ </interface>
909+
910+ <interface name="wp_image_description_creator_icc_v1" version="3">
911+ <description summary="holder of image description ICC information">
912+ This type of object is used for collecting all the information required
913+ to create a wp_image_description_v1 object from an ICC file. A complete
914+ set of required parameters consists of these properties:
915+ - ICC file
916+
917+ Each required property must be set exactly once if the client is to create
918+ an image description. The set requests verify that a property was not
919+ already set. The create request verifies that all required properties are
920+ set. There may be several alternative requests for setting each property,
921+ and in that case the client must choose one of them.
922+
923+ Once all properties have been set, the create request must be used to
924+ create the image description object, destroying the creator in the
925+ process.
926+
927+ The link between a pixel value (a device value in ICC) and its respective
928+ colorimetry is defined by the details of the particular ICC profile.
929+ Those details also determine when colorimetry becomes undefined.
930+ </description>
931+
932+ <enum name="error">
933+ <description summary="protocol errors"/>
934+
935+ <entry name="incomplete_set" value="0"
936+ summary="incomplete parameter set"/>
937+ <entry name="already_set" value="1"
938+ summary="property already set"/>
939+ <entry name="bad_fd" value="2"
940+ summary="fd not seekable and readable"/>
941+ <entry name="bad_size" value="3"
942+ summary="no or too much data"/>
943+ <entry name="out_of_file" value="4"
944+ summary="offset + length exceeds file size"/>
945+ </enum>
946+
947+ <request name="create" type="destructor">
948+ <description summary="Create the image description object from ICC data">
949+ Create an image description object based on the ICC information
950+ previously set on this object. A compositor must parse the ICC data in
951+ some undefined but finite amount of time.
952+
953+ The completeness of the parameter set is verified. If the set is not
954+ complete, the protocol error incomplete_set is raised. For the
955+ definition of a complete set, see the description of this interface.
956+
957+ If the particular combination of the information is not supported
958+ by the compositor, the resulting image description object shall
959+ immediately deliver the wp_image_description_v1.failed event with the
960+ 'unsupported' cause. If a valid image description was created from the
961+ information, the wp_image_description_v1.ready event will eventually
962+ be sent instead.
963+
964+ This request destroys the wp_image_description_creator_icc_v1 object.
965+
966+ The resulting image description object does not allow get_information
967+ request.
968+ </description>
969+
970+ <arg name="image_description"
971+ type="new_id" interface="wp_image_description_v1"/>
972+ </request>
973+
974+ <request name="set_icc_file">
975+ <description summary="set the ICC profile file">
976+ Sets the ICC profile file to be used as the basis of the image
977+ description.
978+
979+ The data shall be found through the given fd at the given offset, having
980+ the given length. The fd must be seekable and readable. Violating these
981+ requirements raises the bad_fd protocol error.
982+
983+ If reading the data fails due to an error independent of the client, the
984+ compositor shall send the wp_image_description_v1.failed event on the
985+ created wp_image_description_v1 with the 'operating_system' cause.
986+
987+ The maximum size of the ICC profile is 32 MB. If length is greater than
988+ that or zero, the protocol error bad_size is raised. If offset + length
989+ exceeds the file size, the protocol error out_of_file is raised.
990+
991+ A compositor may read the file at any time starting from this request
992+ and only until whichever happens first:
993+ - If create request was issued, the wp_image_description_v1 object
994+ delivers either failed or ready event; or
995+ - if create request was not issued, this
996+ wp_image_description_creator_icc_v1 object is destroyed.
997+
998+ A compositor shall not modify the contents of the file, and the fd may
999+ be sealed for writes and size changes. The client must ensure to its
1000+ best ability that the data does not change while the compositor is
1001+ reading it.
1002+
1003+ The data must represent a valid ICC profile. The ICC profile version
1004+ must be 2 or 4, it must be a 3 channel profile and the class must be
1005+ Display or ColorSpace. Violating these requirements will not result in a
1006+ protocol error, but will eventually send the
1007+ wp_image_description_v1.failed event on the created
1008+ wp_image_description_v1 with the 'unsupported' cause.
1009+
1010+ See the International Color Consortium specification ICC.1:2022 for more
1011+ details about ICC profiles.
1012+
1013+ If ICC file has already been set on this object, the protocol error
1014+ already_set is raised.
1015+ </description>
1016+
1017+ <arg name="icc_profile" type="fd"
1018+ summary="ICC profile"/>
1019+ <arg name="offset" type="uint"
1020+ summary="byte offset in fd to start of ICC data"/>
1021+ <arg name="length" type="uint"
1022+ summary="length of ICC data in bytes"/>
1023+ </request>
1024+ </interface>
1025+
1026+ <interface name="wp_image_description_creator_params_v1" version="3">
1027+ <description summary="holder of image description parameters">
1028+ This type of object is used for collecting all the parameters required
1029+ to create a wp_image_description_v1 object. A complete set of required
1030+ parameters consists of these properties:
1031+ - transfer characteristic function (tf)
1032+ - chromaticities of primaries and white point (primary color volume)
1033+
1034+ The following properties are optional and have a well-defined default
1035+ if not explicitly set:
1036+ - primary color volume luminance range
1037+ - reference white luminance level
1038+ - mastering display primaries and white point (target color volume)
1039+ - mastering luminance range
1040+
1041+ The following properties are optional and will be ignored
1042+ if not explicitly set:
1043+ - maximum content light level
1044+ - maximum frame-average light level
1045+
1046+ Each required property must be set exactly once if the client is to create
1047+ an image description. The set requests verify that a property was not
1048+ already set. The create request verifies that all required properties are
1049+ set. There may be several alternative requests for setting each property,
1050+ and in that case the client must choose one of them.
1051+
1052+ Once all properties have been set, the create request must be used to
1053+ create the image description object, destroying the creator in the
1054+ process.
1055+
1056+ A viewer, who is viewing the display defined by the resulting image
1057+ description (the viewing environment included), is assumed to be fully
1058+ adapted to the primary color volume's white point.
1059+
1060+ Any of the following conditions will cause the colorimetry of a pixel
1061+ to become undefined:
1062+ - Values outside of the defined range of the transfer characteristic.
1063+ - Tristimulus that exceeds the target color volume.
1064+ - If extended_target_volume is not supported: tristimulus that exceeds
1065+ the primary color volume.
1066+
1067+ The closest correspondence to an image description created through this
1068+ interface is the Display class of profiles in ICC.
1069+ </description>
1070+
1071+ <enum name="error">
1072+ <description summary="protocol errors"/>
1073+
1074+ <entry name="incomplete_set" value="0"
1075+ summary="incomplete parameter set"/>
1076+ <entry name="already_set" value="1"
1077+ summary="property already set"/>
1078+ <entry name="unsupported_feature" value="2"
1079+ summary="request not supported"/>
1080+ <entry name="invalid_tf" value="3"
1081+ summary="invalid transfer characteristic"/>
1082+ <entry name="invalid_primaries_named" value="4"
1083+ summary="invalid primaries named"/>
1084+ <entry name="invalid_luminance" value="5"
1085+ summary="invalid luminance value or range"/>
1086+ </enum>
1087+
1088+ <request name="create" type="destructor">
1089+ <description summary="Create the image description object using params">
1090+ Create an image description object based on the parameters previously
1091+ set on this object.
1092+
1093+ The completeness of the parameter set is verified. If the set is not
1094+ complete, the protocol error incomplete_set is raised. For the
1095+ definition of a complete set, see the description of this interface.
1096+
1097+ When both max_cll and max_fall are set, max_fall must be less or equal
1098+ to max_cll otherwise the invalid_luminance protocol error is raised.
1099+
1100+ In version 1, these following conditions also result in the
1101+ invalid_luminance protocol error. Version 2 and later do not have this
1102+ requirement.
1103+ - When max_cll is set, it must be greater than min L and less or equal
1104+ to max L of the mastering luminance range.
1105+ - When max_fall is set, it must be greater than min L and less or equal
1106+ to max L of the mastering luminance range.
1107+
1108+ If the particular combination of the parameter set is not supported
1109+ by the compositor, the resulting image description object shall
1110+ immediately deliver the wp_image_description_v1.failed event with the
1111+ 'unsupported' cause. If a valid image description was created from the
1112+ parameter set, the wp_image_description_v1.ready event will eventually
1113+ be sent instead.
1114+
1115+ This request destroys the wp_image_description_creator_params_v1
1116+ object.
1117+
1118+ The resulting image description object does not allow get_information
1119+ request.
1120+ </description>
1121+
1122+ <arg name="image_description"
1123+ type="new_id" interface="wp_image_description_v1"/>
1124+ </request>
1125+
1126+ <request name="set_tf_named">
1127+ <description summary="named transfer characteristic">
1128+ Sets the transfer characteristic using explicitly enumerated named
1129+ functions.
1130+
1131+ When the resulting image description is attached to an image, the
1132+ content should be decoded according to the industry standard
1133+ practices for the transfer characteristic.
1134+
1135+ Only names advertised with wp_color_manager_v1 event supported_tf_named
1136+ are allowed. Other values shall raise the protocol error invalid_tf.
1137+
1138+ If transfer characteristic has already been set on this object, the
1139+ protocol error already_set is raised.
1140+ </description>
1141+
1142+ <arg name="tf" type="uint" enum="wp_color_manager_v1.transfer_function"
1143+ summary="named transfer function"/>
1144+ </request>
1145+
1146+ <request name="set_tf_power">
1147+ <description summary="transfer characteristic as a power curve">
1148+ Sets the color component transfer characteristic to a power curve with
1149+ the given exponent. Negative values are handled by mirroring the
1150+ positive half of the curve through the origin. The valid domain and
1151+ range of the curve are all finite real numbers. This curve represents
1152+ the conversion from electrical to optical color channel values.
1153+
1154+ The curve exponent shall be multiplied by 10000 to get the argument eexp
1155+ value to carry the precision of 4 decimals.
1156+
1157+ The curve exponent must be at least 1.0 and at most 10.0. Otherwise the
1158+ protocol error invalid_tf is raised.
1159+
1160+ If transfer characteristic has already been set on this object, the
1161+ protocol error already_set is raised.
1162+
1163+ This request can be used when the compositor advertises
1164+ wp_color_manager_v1.feature.set_tf_power. Otherwise this request raises
1165+ the protocol error unsupported_feature.
1166+ </description>
1167+
1168+ <arg name="eexp" type="uint" summary="the exponent * 10000"/>
1169+ </request>
1170+
1171+ <request name="set_primaries_named">
1172+ <description summary="named primaries">
1173+ Sets the color primaries and white point using explicitly named sets.
1174+ This describes the primary color volume which is the basis for color
1175+ value encoding.
1176+
1177+ Only names advertised with wp_color_manager_v1 event
1178+ supported_primaries_named are allowed. Other values shall raise the
1179+ protocol error invalid_primaries_named.
1180+
1181+ If primaries have already been set on this object, the protocol error
1182+ already_set is raised.
1183+ </description>
1184+
1185+ <arg name="primaries" type="uint" enum="wp_color_manager_v1.primaries"
1186+ summary="named primaries"/>
1187+ </request>
1188+
1189+ <request name="set_primaries">
1190+ <description summary="primaries as chromaticity coordinates">
1191+ Sets the color primaries and white point using CIE 1931 xy chromaticity
1192+ coordinates. This describes the primary color volume which is the basis
1193+ for color value encoding.
1194+
1195+ Each coordinate value is multiplied by 1 million to get the argument
1196+ value to carry precision of 6 decimals.
1197+
1198+ If primaries have already been set on this object, the protocol error
1199+ already_set is raised.
1200+
1201+ This request can be used if the compositor advertises
1202+ wp_color_manager_v1.feature.set_primaries. Otherwise this request raises
1203+ the protocol error unsupported_feature.
1204+ </description>
1205+
1206+ <arg name="r_x" type="int" summary="Red x * 1M"/>
1207+ <arg name="r_y" type="int" summary="Red y * 1M"/>
1208+ <arg name="g_x" type="int" summary="Green x * 1M"/>
1209+ <arg name="g_y" type="int" summary="Green y * 1M"/>
1210+ <arg name="b_x" type="int" summary="Blue x * 1M"/>
1211+ <arg name="b_y" type="int" summary="Blue y * 1M"/>
1212+ <arg name="w_x" type="int" summary="White x * 1M"/>
1213+ <arg name="w_y" type="int" summary="White y * 1M"/>
1214+ </request>
1215+
1216+ <request name="set_luminances">
1217+ <description summary="primary color volume luminance range and reference white">
1218+ Sets the primary color volume luminance range and the reference white
1219+ luminance level. These values include the minimum display emission, but
1220+ not external flare. The minimum display emission is assumed to have
1221+ the chromaticity of the primary color volume white point.
1222+
1223+ The default luminances from
1224+ https://www.color.org/chardata/rgb/srgb.xalter are
1225+ - primary color volume minimum: 0.2 cd/m²
1226+ - primary color volume maximum: 80 cd/m²
1227+ - reference white: 80 cd/m²
1228+
1229+ Setting a named transfer characteristic can imply other default
1230+ luminances.
1231+
1232+ The default luminances get overwritten when this request is used.
1233+ With transfer_function.st2084_pq the given 'max_lum' value is ignored,
1234+ and 'max_lum' is taken as 'min_lum' + 10000 cd/m².
1235+
1236+ 'min_lum' and 'max_lum' specify the minimum and maximum luminances of
1237+ the primary color volume as reproduced by the targeted display.
1238+
1239+ 'reference_lum' specifies the luminance of the reference white as
1240+ reproduced by the targeted display, and reflects the targeted viewing
1241+ environment.
1242+
1243+ Compositors should make sure that all content is anchored, meaning that
1244+ an input signal level of 'reference_lum' on one image description and
1245+ another input signal level of 'reference_lum' on another image
1246+ description should produce the same output level, even though the
1247+ 'reference_lum' on both image representations can be different.
1248+
1249+ 'reference_lum' may be higher than 'max_lum'. In that case reaching
1250+ the reference white output level in image content requires the
1251+ 'extended_target_volume' feature support.
1252+
1253+ If 'max_lum' or 'reference_lum' are less than or equal to 'min_lum',
1254+ the protocol error invalid_luminance is raised.
1255+
1256+ The minimum luminance is multiplied by 10000 to get the argument
1257+ 'min_lum' value and carries precision of 4 decimals. The maximum
1258+ luminance and reference white luminance values are unscaled.
1259+
1260+ If the primary color volume luminance range and the reference white
1261+ luminance level have already been set on this object, the protocol error
1262+ already_set is raised.
1263+
1264+ This request can be used if the compositor advertises
1265+ wp_color_manager_v1.feature.set_luminances. Otherwise this request
1266+ raises the protocol error unsupported_feature.
1267+ </description>
1268+
1269+ <arg name="min_lum" type="uint"
1270+ summary="minimum luminance (cd/m²) * 10000"/>
1271+ <arg name="max_lum" type="uint"
1272+ summary="maximum luminance (cd/m²)"/>
1273+ <arg name="reference_lum" type="uint"
1274+ summary="reference white luminance (cd/m²)"/>
1275+ </request>
1276+
1277+ <request name="set_mastering_display_primaries">
1278+ <description summary="mastering display primaries as chromaticity coordinates">
1279+ Provides the color primaries and white point of the mastering display
1280+ using CIE 1931 xy chromaticity coordinates. This is compatible with the
1281+ SMPTE ST 2086 definition of HDR static metadata.
1282+
1283+ The mastering display primaries and mastering display luminances define
1284+ the target color volume.
1285+
1286+ If mastering display primaries are not explicitly set, the target color
1287+ volume is assumed to have the same primaries as the primary color volume.
1288+
1289+ The target color volume is defined by all tristimulus values between 0.0
1290+ and 1.0 (inclusive) of the color space defined by the given mastering
1291+ display primaries and white point. The colorimetry is identical between
1292+ the container color space and the mastering display color space,
1293+ including that no chromatic adaptation is applied even if the white
1294+ points differ.
1295+
1296+ The target color volume can exceed the primary color volume to allow for
1297+ a greater color volume with an existing color space definition (for
1298+ example scRGB). It can be smaller than the primary color volume to
1299+ minimize gamut and tone mapping distances for big color spaces (HDR
1300+ metadata).
1301+
1302+ To make use of the entire target color volume a suitable pixel format
1303+ has to be chosen (e.g. floating point to exceed the primary color
1304+ volume, or abusing limited quantization range as with xvYCC).
1305+
1306+ Each coordinate value is multiplied by 1 million to get the argument
1307+ value to carry precision of 6 decimals.
1308+
1309+ If mastering display primaries have already been set on this object, the
1310+ protocol error already_set is raised.
1311+
1312+ This request can be used if the compositor advertises
1313+ wp_color_manager_v1.feature.set_mastering_display_primaries. Otherwise
1314+ this request raises the protocol error unsupported_feature. The
1315+ advertisement implies support only for target color volumes fully
1316+ contained within the primary color volume.
1317+
1318+ If a compositor additionally supports target color volume exceeding the
1319+ primary color volume, it must advertise
1320+ wp_color_manager_v1.feature.extended_target_volume. If a client uses
1321+ target color volume exceeding the primary color volume and the
1322+ compositor does not support it, the result is implementation defined.
1323+ Compositors are recommended to detect this case and fail the image
1324+ description gracefully, but it may as well result in color artifacts.
1325+ </description>
1326+
1327+ <arg name="r_x" type="int" summary="Red x * 1M"/>
1328+ <arg name="r_y" type="int" summary="Red y * 1M"/>
1329+ <arg name="g_x" type="int" summary="Green x * 1M"/>
1330+ <arg name="g_y" type="int" summary="Green y * 1M"/>
1331+ <arg name="b_x" type="int" summary="Blue x * 1M"/>
1332+ <arg name="b_y" type="int" summary="Blue y * 1M"/>
1333+ <arg name="w_x" type="int" summary="White x * 1M"/>
1334+ <arg name="w_y" type="int" summary="White y * 1M"/>
1335+ </request>
1336+
1337+ <request name="set_mastering_luminance">
1338+ <description summary="display mastering luminance range">
1339+ Sets the luminance range that was used during the content mastering
1340+ process as the minimum and maximum absolute luminance L. These values
1341+ include the minimum display emission and ambient flare luminances,
1342+ assumed to be optically additive and have the chromaticity of the
1343+ primary color volume white point. This should be
1344+ compatible with the SMPTE ST 2086 definition of HDR static metadata.
1345+
1346+ The mastering display primaries and mastering display luminances define
1347+ the target color volume.
1348+
1349+ If mastering luminances are not explicitly set, the target color volume
1350+ is assumed to have the same min and max luminances as the primary color
1351+ volume.
1352+
1353+ If max L is less than or equal to min L, the protocol error
1354+ invalid_luminance is raised.
1355+
1356+ Min L value is multiplied by 10000 to get the argument min_lum value
1357+ and carry precision of 4 decimals. Max L value is unscaled for max_lum.
1358+
1359+ This request can be used if the compositor advertises
1360+ wp_color_manager_v1.feature.set_mastering_display_primaries. Otherwise
1361+ this request raises the protocol error unsupported_feature. The
1362+ advertisement implies support only for target color volumes fully
1363+ contained within the primary color volume.
1364+
1365+ If a compositor additionally supports target color volume exceeding the
1366+ primary color volume, it must advertise
1367+ wp_color_manager_v1.feature.extended_target_volume. If a client uses
1368+ target color volume exceeding the primary color volume and the
1369+ compositor does not support it, the result is implementation defined.
1370+ Compositors are recommended to detect this case and fail the image
1371+ description gracefully, but it may as well result in color artifacts.
1372+ </description>
1373+
1374+ <arg name="min_lum" type="uint" summary="min L (cd/m²) * 10000"/>
1375+ <arg name="max_lum" type="uint" summary="max L (cd/m²)"/>
1376+ </request>
1377+
1378+ <request name="set_max_cll">
1379+ <description summary="maximum content light level">
1380+ Sets the maximum content light level (max_cll) as defined by CTA-861-H.
1381+
1382+ max_cll is undefined by default.
1383+ </description>
1384+
1385+ <arg name="max_cll" type="uint" summary="Maximum content light level (cd/m²)"/>
1386+ </request>
1387+
1388+ <request name="set_max_fall">
1389+ <description summary="maximum frame-average light level">
1390+ Sets the maximum frame-average light level (max_fall) as defined by
1391+ CTA-861-H.
1392+
1393+ max_fall is undefined by default.
1394+ </description>
1395+
1396+ <arg name="max_fall" type="uint" summary="Maximum frame-average light level (cd/m²)"/>
1397+ </request>
1398+ </interface>
1399+
1400+ <interface name="wp_image_description_v1" version="3">
1401+ <description summary="Colorimetric image description">
1402+ An image description carries information about the pixel color encoding
1403+ and its intended display and viewing environment. The image description is
1404+ attached to a wl_surface via
1405+ wp_color_management_surface_v1.set_image_description. A compositor can use
1406+ this information to decode pixel values into colorimetrically meaningful
1407+ quantities, which allows the compositor to transform the surface contents
1408+ to become suitable for various displays and viewing environments.
1409+
1410+ Note, that the wp_image_description_v1 object is not ready to be used
1411+ immediately after creation. The object eventually delivers either the
1412+ 'ready' or the 'failed' event, specified in all requests creating it. The
1413+ object is deemed "ready" after receiving the 'ready' event.
1414+
1415+ An object which is not ready is illegal to use, it can only be destroyed.
1416+ Any other request in this interface shall result in the 'not_ready'
1417+ protocol error. Attempts to use an object which is not ready through other
1418+ interfaces shall raise protocol errors defined there.
1419+
1420+ Once created and regardless of how it was created, a
1421+ wp_image_description_v1 object always refers to one fixed image
1422+ description. It cannot change after creation.
1423+ </description>
1424+
1425+ <request name="destroy" type="destructor">
1426+ <description summary="destroy the image description">
1427+ Destroy this object. It is safe to destroy an object which is not ready.
1428+
1429+ Destroying a wp_image_description_v1 object has no side-effects, not
1430+ even if a wp_color_management_surface_v1.set_image_description has not
1431+ yet been followed by a wl_surface.commit.
1432+ </description>
1433+ </request>
1434+
1435+ <enum name="error">
1436+ <description summary="protocol errors"/>
1437+
1438+ <entry name="not_ready" value="0"
1439+ summary="attempted to use an object which is not ready"/>
1440+ <entry name="no_information" value="1"
1441+ summary="get_information not allowed"/>
1442+ </enum>
1443+
1444+ <enum name="cause">
1445+ <description summary="generic reason for failure"/>
1446+
1447+ <entry name="low_version" value="0"
1448+ summary="interface version too low"/>
1449+ <entry name="unsupported" value="1"
1450+ summary="unsupported image description data"/>
1451+ <entry name="operating_system" value="2"
1452+ summary="error independent of the client"/>
1453+ <entry name="no_output" value="3"
1454+ summary="the relevant output no longer exists"/>
1455+ </enum>
1456+
1457+ <event name="failed">
1458+ <description summary="graceful error on creating the image description">
1459+ If creating a wp_image_description_v1 object fails for a reason that is
1460+ not defined as a protocol error, this event is sent.
1461+
1462+ The requests that create image description objects define whether and
1463+ when this can occur. Only such creation requests can trigger this event.
1464+ This event cannot be triggered after the image description was
1465+ successfully formed.
1466+
1467+ Once this event has been sent, the wp_image_description_v1 object will
1468+ never become ready and it can only be destroyed.
1469+ </description>
1470+
1471+ <arg name="cause" type="uint" enum="cause"
1472+ summary="generic reason"/>
1473+ <arg name="msg" type="string"
1474+ summary="ad hoc human-readable explanation"/>
1475+ </event>
1476+
1477+ <event name="ready" deprecated-since="2">
1478+ <description summary="the object is ready to be used (32-bit)">
1479+ Starting from interface version 2, the 'ready2' event is sent instead
1480+ of this event.
1481+
1482+ For the definition of this event, see the 'ready2' event. The
1483+ difference to this event is as follows.
1484+
1485+ The id number is valid only as long as the protocol object is alive. If
1486+ all protocol objects referring to the same image description record are
1487+ destroyed, the id number may be recycled for a different image
1488+ description record.
1489+ </description>
1490+
1491+ <arg name="identity" type="uint"
1492+ summary="the 32-bit image description id number"/>
1493+ </event>
1494+
1495+ <request name="get_information">
1496+ <description summary="get information about the image description">
1497+ Creates a wp_image_description_info_v1 object which delivers the
1498+ information that makes up the image description.
1499+
1500+ Not all image description protocol objects allow get_information
1501+ request. Whether it is allowed or not is defined by the request that
1502+ created the object. If get_information is not allowed, the protocol
1503+ error no_information is raised.
1504+ </description>
1505+
1506+ <arg name="information"
1507+ type="new_id" interface="wp_image_description_info_v1"/>
1508+ </request>
1509+
1510+ <!-- Version 2 additions -->
1511+
1512+ <event name="ready2" since="2">
1513+ <description summary="the object is ready to be used">
1514+ Once this event has been sent, the wp_image_description_v1 object is
1515+ deemed "ready". Ready objects can be used to send requests and can be
1516+ used through other interfaces.
1517+
1518+ Every ready wp_image_description_v1 protocol object refers to an
1519+ underlying image description record in the compositor. Multiple protocol
1520+ objects may end up referring to the same record. Clients may identify
1521+ these "copies" by comparing their id numbers: if the numbers from two
1522+ protocol objects are identical, the protocol objects refer to the same
1523+ image description record. Two different image description records
1524+ cannot have the same id number simultaneously. The id number does not
1525+ change during the lifetime of the image description record.
1526+
1527+ Image description id number is not a protocol object id. Zero is
1528+ reserved as an invalid id number. It shall not be possible for a client
1529+ to refer to an image description by its id number in protocol. The id
1530+ numbers might not be portable between Wayland connections. A compositor
1531+ shall not send an invalid id number.
1532+
1533+ Compositors must not recycle image description id numbers.
1534+
1535+ This identity allows clients to de-duplicate image description records
1536+ and avoid get_information request if they already have the image
1537+ description information.
1538+ </description>
1539+
1540+ <arg name="identity_hi" type="uint"
1541+ summary="high 32 bits of the 64-bit image description id number"/>
1542+ <arg name="identity_lo" type="uint"
1543+ summary="low 32 bits of the 64-bit image description id number"/>
1544+ </event>
1545+ </interface>
1546+
1547+ <interface name="wp_image_description_info_v1" version="3">
1548+ <description summary="Colorimetric image description information">
1549+ Sends all matching events describing an image description object exactly
1550+ once and finally sends the 'done' event.
1551+
1552+ This means
1553+ - if the image description is parametric, it must send
1554+ - primaries
1555+ - named_primaries, if applicable
1556+ - at least one of tf_power and tf_named, as applicable
1557+ - luminances
1558+ - target_primaries
1559+ - target_luminance
1560+ - if the image description is parametric, it may send, if applicable,
1561+ - target_max_cll
1562+ - target_max_fall
1563+ - if the image description contains an ICC profile, it must send the
1564+ icc_file event
1565+
1566+ Once a wp_image_description_info_v1 object has delivered a 'done' event it
1567+ is automatically destroyed.
1568+
1569+ Every wp_image_description_info_v1 created from the same
1570+ wp_image_description_v1 shall always return the exact same data.
1571+ </description>
1572+
1573+ <event name="done" type="destructor">
1574+ <description summary="end of information">
1575+ Signals the end of information events and destroys the object.
1576+ </description>
1577+ </event>
1578+
1579+ <event name="icc_file">
1580+ <description summary="ICC profile matching the image description">
1581+ The icc argument provides a file descriptor to the client which may be
1582+ memory-mapped to provide the ICC profile matching the image description.
1583+ The fd is read-only, and if mapped then it must be mapped with
1584+ MAP_PRIVATE by the client.
1585+
1586+ The ICC profile version and other details are determined by the
1587+ compositor. There is no provision for a client to ask for a specific
1588+ kind of a profile.
1589+ </description>
1590+
1591+ <arg name="icc" type="fd" summary="ICC profile file descriptor"/>
1592+ <arg name="icc_size" type="uint" summary="ICC profile size, in bytes"/>
1593+ <!-- Offset always 0, compositor must not expose unnecessary data. -->
1594+ </event>
1595+
1596+ <event name="primaries">
1597+ <description summary="primaries as chromaticity coordinates">
1598+ Delivers the primary color volume primaries and white point using CIE
1599+ 1931 xy chromaticity coordinates.
1600+
1601+ Each coordinate value is multiplied by 1 million to get the argument
1602+ value to carry precision of 6 decimals.
1603+ </description>
1604+
1605+ <arg name="r_x" type="int" summary="Red x * 1M"/>
1606+ <arg name="r_y" type="int" summary="Red y * 1M"/>
1607+ <arg name="g_x" type="int" summary="Green x * 1M"/>
1608+ <arg name="g_y" type="int" summary="Green y * 1M"/>
1609+ <arg name="b_x" type="int" summary="Blue x * 1M"/>
1610+ <arg name="b_y" type="int" summary="Blue y * 1M"/>
1611+ <arg name="w_x" type="int" summary="White x * 1M"/>
1612+ <arg name="w_y" type="int" summary="White y * 1M"/>
1613+ </event>
1614+
1615+ <event name="primaries_named">
1616+ <description summary="named primaries">
1617+ Delivers the primary color volume primaries and white point using an
1618+ explicitly enumerated named set.
1619+ </description>
1620+
1621+ <arg name="primaries" type="uint" enum="wp_color_manager_v1.primaries"
1622+ summary="named primaries"/>
1623+ </event>
1624+
1625+ <event name="tf_power">
1626+ <description summary="transfer characteristic as a power curve">
1627+ The color component transfer characteristic of this image description is
1628+ a pure power curve. This event provides the exponent of the power
1629+ function. This curve represents the conversion from electrical to
1630+ optical pixel or color values.
1631+
1632+ The curve exponent has been multiplied by 10000 to get the argument eexp
1633+ value to carry the precision of 4 decimals.
1634+ </description>
1635+
1636+ <arg name="eexp" type="uint" summary="the exponent * 10000"/>
1637+ </event>
1638+
1639+ <event name="tf_named">
1640+ <description summary="named transfer characteristic">
1641+ Delivers the transfer characteristic using an explicitly enumerated
1642+ named function.
1643+ </description>
1644+
1645+ <arg name="tf" type="uint" enum="wp_color_manager_v1.transfer_function"
1646+ summary="named transfer function"/>
1647+ </event>
1648+
1649+ <event name="luminances">
1650+ <description summary="primary color volume luminance range and reference white">
1651+ Delivers the primary color volume luminance range and the reference
1652+ white luminance level. These values include the minimum display emission
1653+ and ambient flare luminances, assumed to be optically additive and have
1654+ the chromaticity of the primary color volume white point.
1655+
1656+ The minimum luminance is multiplied by 10000 to get the argument
1657+ 'min_lum' value and carries precision of 4 decimals. The maximum
1658+ luminance and reference white luminance values are unscaled.
1659+ </description>
1660+
1661+ <arg name="min_lum" type="uint"
1662+ summary="minimum luminance (cd/m²) * 10000"/>
1663+ <arg name="max_lum" type="uint"
1664+ summary="maximum luminance (cd/m²)"/>
1665+ <arg name="reference_lum" type="uint"
1666+ summary="reference white luminance (cd/m²)"/>
1667+ </event>
1668+
1669+ <event name="target_primaries">
1670+ <description summary="target primaries as chromaticity coordinates">
1671+ Provides the color primaries and white point of the target color volume
1672+ using CIE 1931 xy chromaticity coordinates. This is compatible with the
1673+ SMPTE ST 2086 definition of HDR static metadata for mastering displays.
1674+
1675+ While primary color volume is about how color is encoded, the target
1676+ color volume is the actually displayable color volume.
1677+
1678+ Each coordinate value is multiplied by 1 million to get the argument
1679+ value to carry precision of 6 decimals.
1680+ </description>
1681+
1682+ <arg name="r_x" type="int" summary="Red x * 1M"/>
1683+ <arg name="r_y" type="int" summary="Red y * 1M"/>
1684+ <arg name="g_x" type="int" summary="Green x * 1M"/>
1685+ <arg name="g_y" type="int" summary="Green y * 1M"/>
1686+ <arg name="b_x" type="int" summary="Blue x * 1M"/>
1687+ <arg name="b_y" type="int" summary="Blue y * 1M"/>
1688+ <arg name="w_x" type="int" summary="White x * 1M"/>
1689+ <arg name="w_y" type="int" summary="White y * 1M"/>
1690+ </event>
1691+
1692+ <event name="target_luminance">
1693+ <description summary="target luminance range">
1694+ Provides the luminance range that the image description is targeting as
1695+ the minimum and maximum absolute luminance L. These values include the
1696+ minimum display emission and ambient flare luminances, assumed to be
1697+ optically additive and have the chromaticity of the primary color
1698+ volume white point. This should be compatible with the SMPTE ST 2086
1699+ definition of HDR static metadata.
1700+
1701+ This luminance range is only theoretical and may not correspond to the
1702+ luminance of light emitted on an actual display.
1703+
1704+ Min L value is multiplied by 10000 to get the argument min_lum value and
1705+ carry precision of 4 decimals. Max L value is unscaled for max_lum.
1706+ </description>
1707+
1708+ <arg name="min_lum" type="uint" summary="min L (cd/m²) * 10000"/>
1709+ <arg name="max_lum" type="uint" summary="max L (cd/m²)"/>
1710+ </event>
1711+
1712+ <event name="target_max_cll">
1713+ <description summary="target maximum content light level">
1714+ Provides the targeted max_cll of the image description. max_cll is
1715+ defined by CTA-861-H.
1716+
1717+ This luminance is only theoretical and may not correspond to the
1718+ luminance of light emitted on an actual display.
1719+ </description>
1720+
1721+ <arg name="max_cll" type="uint"
1722+ summary="Maximum content light-level (cd/m²)"/>
1723+ </event>
1724+
1725+ <event name="target_max_fall">
1726+ <description summary="target maximum frame-average light level">
1727+ Provides the targeted max_fall of the image description. max_fall is
1728+ defined by CTA-861-H.
1729+
1730+ This luminance is only theoretical and may not correspond to the
1731+ luminance of light emitted on an actual display.
1732+ </description>
1733+
1734+ <arg name="max_fall" type="uint"
1735+ summary="Maximum frame-average light level (cd/m²)"/>
1736+ </event>
1737+ </interface>
1738+
1739+ <interface name="wp_image_description_reference_v1" version="1" frozen="true">
1740+ <description summary="Reference to an image description">
1741+ This object is a reference to an image description. This interface is
1742+ frozen at version 1 to allow other protocols to create
1743+ wp_image_description_v1 objects.
1744+
1745+ The wp_color_manager_v1.get_image_description request can be used to
1746+ retrieve the underlying image description.
1747+ </description>
1748+
1749+ <request name="destroy" type="destructor">
1750+ <description summary="destroy the reference">
1751+ Destroy this object. This has no effect on the referenced image
1752+ description.
1753+ </description>
1754+ </request>
1755+ </interface>
1756+</protocol>
A protocols/color-representation-v1.xml +433 -0
@@ -0,0 +1,433 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<protocol name="color_representation_v1">
3+ <copyright>
4+ Copyright 2022 Simon Ser
5+ Copyright 2022 Red Hat, Inc.
6+ Copyright 2022 Collabora, Ltd.
7+ Copyright 2022-2025 Red Hat, Inc.
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="color representation protocol extension">
30+ This protocol extension delivers the metadata required to define alpha mode,
31+ the color model, sub-sampling and quantization range used when interpreting
32+ buffer contents. The main use case is defining how the YCbCr family of pixel
33+ formats convert to RGB.
34+
35+ Note that this protocol does not define the colorimetry of the resulting RGB
36+ channels / tristimulus values. Without the help of other extensions the
37+ resulting colorimetry is therefore implementation defined.
38+
39+ If this extension is not used, the color representation used is compositor
40+ implementation defined.
41+
42+ Recommendation ITU-T H.273
43+ "Coding-independent code points for video signal type identification"
44+ shall be referred to as simply H.273 here.
45+ </description>
46+
47+ <interface name="wp_color_representation_manager_v1" version="1">
48+ <description summary="color representation manager singleton">
49+ A singleton global interface used for getting color representation
50+ extensions for wl_surface. The extension interfaces allow setting the
51+ color representation of surfaces.
52+
53+ Compositors should never remove this global.
54+ </description>
55+
56+ <enum name="error">
57+ <description summary="protocol errors"/>
58+ <entry name="surface_exists" value="1"
59+ summary="color representation surface exists already"/>
60+ </enum>
61+
62+ <request name="destroy" type="destructor">
63+ <description summary="destroy the manager">
64+ Destroy the wp_color_representation_manager_v1 object. This does not
65+ affect any other objects in any way.
66+ </description>
67+
68+ </request>
69+
70+ <request name="get_surface">
71+ <description summary="create a color representation interface for a wl_surface">
72+ If a wp_color_representation_surface_v1 object already exists for the
73+ given wl_surface, the protocol error surface_exists is raised.
74+
75+ This creates a new color wp_color_representation_surface_v1 object for
76+ the given wl_surface.
77+
78+ See the wp_color_representation_surface_v1 interface for more details.
79+ </description>
80+ <arg name="id"
81+ type="new_id" interface="wp_color_representation_surface_v1"/>
82+ <arg name="surface"
83+ type="object" interface="wl_surface"/>
84+ </request>
85+
86+ <event name="supported_alpha_mode">
87+ <description summary="supported alpha modes">
88+ When this object is created, it shall immediately send this event once
89+ for each alpha mode the compositor supports.
90+
91+ For the definition of the supported values, see the
92+ wp_color_representation_surface_v1::alpha_mode enum.
93+ </description>
94+ <arg name="alpha_mode"
95+ type="uint" enum="wp_color_representation_surface_v1.alpha_mode"
96+ summary="supported alpha mode"/>
97+ </event>
98+
99+ <event name="supported_coefficients_and_ranges">
100+ <description summary="supported matrix coefficients and ranges">
101+ When this object is created, it shall immediately send this event once
102+ for each matrix coefficient and color range combination the compositor
103+ supports.
104+
105+ For the definition of the supported values, see the
106+ wp_color_representation_surface_v1::coefficients and
107+ wp_color_representation_surface_v1::range enums.
108+ </description>
109+ <arg name="coefficients"
110+ type="uint" enum="wp_color_representation_surface_v1.coefficients"
111+ summary="supported matrix coefficients"/>
112+ <arg name="range"
113+ type="uint" enum="wp_color_representation_surface_v1.range"
114+ summary="full range flag"/>
115+ </event>
116+
117+ <event name="done">
118+ <description summary="all features have been sent">
119+ This event is sent when all supported features have been sent.
120+ </description>
121+ </event>
122+ </interface>
123+
124+ <interface name="wp_color_representation_surface_v1" version="1">
125+ <description summary="color representation extension to a surface">
126+ A wp_color_representation_surface_v1 allows the client to set the color
127+ representation metadata of a surface.
128+
129+ By default, a surface does not have any color representation metadata set.
130+ The reconstruction of R, G, B signals on such surfaces is compositor
131+ implementation defined. The alpha mode is assumed to be
132+ premultiplied_electrical when the alpha mode is unset.
133+
134+ If the wl_surface associated with the wp_color_representation_surface_v1
135+ is destroyed, the wp_color_representation_surface_v1 object becomes inert.
136+ </description>
137+
138+ <enum name="error">
139+ <description summary="protocol errors"/>
140+ <entry name="alpha_mode" value="1"
141+ summary="unsupported alpha mode"/>
142+ <entry name="coefficients" value="2"
143+ summary="unsupported coefficients"/>
144+ <entry name="pixel_format" value="3"
145+ summary="the pixel format and a set value are incompatible"/>
146+ <entry name="inert" value="4"
147+ summary="forbidden request on inert object"/>
148+ <entry name="chroma_location" value="5"
149+ summary="invalid chroma location"/>
150+ </enum>
151+
152+ <request name="destroy" type="destructor">
153+ <description summary="destroy the color representation">
154+ Destroy the wp_color_representation_surface_v1 object.
155+
156+ Destroying this object unsets all the color representation metadata from
157+ the surface. See the wp_color_representation_surface_v1 interface
158+ description for how a compositor handles a surface without color
159+ representation metadata. Unsetting is double-buffered state, see
160+ wl_surface.commit.
161+ </description>
162+ </request>
163+
164+ <enum name="alpha_mode">
165+ <description summary="alpha mode">
166+ Specifies how the alpha channel affects the color channels.
167+ </description>
168+ <entry name="premultiplied_electrical" value="0">
169+ <description summary="premultiplied alpha in electrical values">
170+ Electrical color channel values (after transfer function encoding)
171+ are already multiplied with the alpha channel value.
172+ </description>
173+ </entry>
174+ <entry name="premultiplied_optical" value="1">
175+ <description summary="premultiplied alpha in optical values">
176+ Optical color channel values (before transfer function encoding)
177+ are already multiplied with the alpha channel value.
178+ </description>
179+ </entry>
180+ <entry name="straight" value="2">
181+ <description summary="straight alpha">
182+ Alpha channel has not been pre-multiplied into color channels.
183+ </description>
184+ </entry>
185+ </enum>
186+
187+ <enum name="coefficients">
188+ <description summary="named coefficients">
189+ Named matrix coefficients used to encode well-known sets of
190+ coefficients. H.273 is the authority, when it comes to the exact values
191+ of coefficients and authoritative specifications, where an equivalent
192+ code point exists.
193+
194+ A value of 0 is invalid and will never be present in the list of enums.
195+
196+ Descriptions do list the specifications for convenience.
197+ </description>
198+ <entry name="identity" value="1">
199+ <description summary="The identity matrix">
200+ Coefficients as defined by
201+ - IEC 61966-2-1 sRGB
202+ - SMPTE ST 428-1 (2019)
203+
204+ Equivalent to H.273 MatrixCoefficients code point 0.
205+ Compatible with pixel formats of the RGB family.
206+ </description>
207+ </entry>
208+ <entry name="bt709" value="2">
209+ <description summary="BT.709 matrix coefficients">
210+ Coefficients as defined by
211+ - Rec. ITU-R BT.709-6
212+ - Rec. ITU-R BT.1361-0 conventional colour gamut system (historical)
213+ - Rec. ITU-R BT.1361-0 conventional colour gamut system and extended
214+ colour gamut system (historical)
215+ - IEC 61966-2-4 xvYCC709
216+ - SMPTE RP 177 (1993) Annex B
217+
218+ Equivalent to H.273 MatrixCoefficients code point 1.
219+ Compatible with pixel formats of the YCbCr family.
220+ </description>
221+ </entry>
222+ <entry name="fcc" value="3">
223+ <description summary="FCC matrix coefficients">
224+ Coefficients as defined by
225+ - United States Federal Communications Commission (2003) Title 47
226+ Code of Federal Regulations 73.682 (a) (20)
227+
228+ Equivalent to H.273 MatrixCoefficients code point 4.
229+ Compatible with pixel formats of the YCbCr family.
230+ </description>
231+ </entry>
232+ <entry name="bt601" value="4">
233+ <description summary="BT.601-7 matrix coefficients">
234+ Coefficients as defined by
235+ - Rec. ITU-R BT.470-6 System B, G (historical)
236+ - Rec. ITU-R BT.601-7 625
237+ - Rec. ITU-R BT.601-7 525
238+ - Rec. ITU-R BT.1358-0 625 (historical)
239+ - Rec. ITU-R BT.1358-1 525 or 625 (historical)
240+ - Rec. ITU-R BT.1700-0 625 PAL and 625 SECAM
241+ - Rec. ITU-R BT.1700-0 NTSC
242+ - IEC 61966-2-1 sYCC
243+ - IEC 61966-2-4 xvYCC601
244+ - SMPTE ST 170 (2004)
245+
246+ Equivalent to H.273 MatrixCoefficients code point 5, 6.
247+ Compatible with pixel formats of the YCbCr family.
248+ </description>
249+ </entry>
250+ <entry name="smpte240" value="5">
251+ <description summary="SMPTE ST 240 matrix coefficients">
252+ Coefficients as defined by
253+ - SMPTE ST 240 (1999)
254+
255+ Equivalent to H.273 MatrixCoefficients code point 7.
256+ Compatible with pixel formats of the YCbCr family.
257+ </description>
258+ </entry>
259+ <entry name="bt2020" value="6">
260+ <description summary="BT.2020 and BT.2100 YCbCr matrix coefficients">
261+ Coefficients as defined by
262+ - Rec. ITU-R BT.2020-2 (non-constant luminance)
263+ - Rec. ITU-R BT.2100-2 Y′CbCr
264+
265+ Equivalent to H.273 MatrixCoefficients code point 9.
266+ Compatible with pixel formats of the YCbCr family.
267+ </description>
268+ </entry>
269+ <entry name="bt2020_cl" value="7">
270+ <description summary="BT.2020 matrix coefficients for constant luminance">
271+ Coefficients as defined by
272+ - Rec. ITU-R BT.2020-2 (constant luminance)
273+
274+ Equivalent to H.273 MatrixCoefficients code point 10.
275+ Compatible with pixel formats of the YCbCr family.
276+ </description>
277+ </entry>
278+ <entry name="ictcp" value="8">
279+ <description summary="BT.2100 ICtCp matrix coefficients">
280+ Coefficients as defined by
281+ - Rec. ITU-R BT.2100-2 ICTCP
282+
283+ Equivalent to H.273 MatrixCoefficients code point 14.
284+ Compatible with pixel formats of the YCbCr family.
285+ </description>
286+ </entry>
287+ </enum>
288+
289+ <enum name="range">
290+ <description summary="Color range values">
291+ Possible color range values.
292+
293+ A value of 0 is invalid and will never be present in the list of enums.
294+ </description>
295+ <entry name="full" value="1" summary="Full color range"/>
296+ <entry name="limited" value="2" summary="Limited color range"/>
297+ </enum>
298+
299+ <enum name="chroma_location">
300+ <description summary="Chroma sample location for 4:2:0 YCbCr">
301+ Chroma sample location as defined by H.273 Chroma420SampleLocType.
302+
303+ A value of 0 is invalid and will never be present in the list of enums.
304+
305+ The descriptions list the matching Vulkan VkChromaLocation combinations
306+ for convenience.
307+ </description>
308+ <entry name="type_0" value="1">
309+ <description summary="Horizontal offset of 0, vertical offset of 0.5">
310+ Corresponding to VkChromaLocations:
311+ - xChromaOffset: VK_CHROMA_LOCATION_COSITED_EVEN
312+ - yChromaOffset: VK_CHROMA_LOCATION_MIDPOINT
313+
314+ Equivalent to H.273 Chroma420SampleLocType 0.
315+ </description>
316+ </entry>
317+ <entry name="type_1" value="2">
318+ <description summary="Horizontal offset of 0.5, vertical offset of 0.5">
319+ Corresponding to VkChromaLocations:
320+ - xChromaOffset: VK_CHROMA_LOCATION_MIDPOINT
321+ - yChromaOffset: VK_CHROMA_LOCATION_MIDPOINT
322+
323+ Equivalent to H.273 Chroma420SampleLocType 1.
324+ </description>
325+ </entry>
326+ <entry name="type_2" value="3">
327+ <description summary="Horizontal offset of 0, vertical offset of 0">
328+ Corresponding to VkChromaLocations:
329+ - xChromaOffset: VK_CHROMA_LOCATION_COSITED_EVEN
330+ - yChromaOffset: VK_CHROMA_LOCATION_COSITED_EVEN
331+
332+ Equivalent to H.273 Chroma420SampleLocType 2.
333+ </description>
334+ </entry>
335+ <entry name="type_3" value="4">
336+ <description summary="Horizontal offset of 0.5, vertical offset of 0">
337+ Corresponding to VkChromaLocations:
338+ - xChromaOffset: VK_CHROMA_LOCATION_MIDPOINT
339+ - yChromaOffset: VK_CHROMA_LOCATION_COSITED_EVEN
340+
341+ Equivalent to H.273 Chroma420SampleLocType 3.
342+ </description>
343+ </entry>
344+ <entry name="type_4" value="5">
345+ <description summary="Horizontal offset of 0, vertical offset of 1">
346+ Equivalent to H.273 Chroma420SampleLocType 4.
347+ </description>
348+ </entry>
349+ <entry name="type_5" value="6">
350+ <description summary="Horizontal offset of 0.5, vertical offset of 1">
351+ Equivalent to H.273 Chroma420SampleLocType 5.
352+ </description>
353+ </entry>
354+ </enum>
355+
356+ <request name="set_alpha_mode">
357+ <description summary="set the surface alpha mode">
358+ If this protocol object is inert, the protocol error inert is raised.
359+
360+ Assuming an alpha channel exists, it is always linear. The alpha mode
361+ determines whether and how the color channels include pre-multiplied
362+ alpha. Using straight alpha might have performance benefits.
363+
364+ Only alpha modes advertised by the compositor are allowed to be used as
365+ argument for this request. The "alpha_mode" protocol error is raised
366+ otherwise.
367+
368+ Alpha mode is double buffered, see wl_surface.commit.
369+ </description>
370+ <arg name="alpha_mode" type="uint" enum="alpha_mode"
371+ summary="alpha mode"/>
372+ </request>
373+
374+ <request name="set_coefficients_and_range">
375+ <description summary="set the matrix coefficients and range">
376+ If this protocol object is inert, the protocol error inert is raised.
377+
378+ Set the matrix coefficients and video range which defines the formula
379+ and the related constants used to derive red, green and blue signals.
380+ Usually coefficients correspond to MatrixCoefficients code points in
381+ H.273.
382+
383+ Only combinations advertised by the compositor are allowed to be used as
384+ argument for this request. The "coefficients" protocol error is raised
385+ otherwise.
386+
387+ A call to wl_surface.commit verifies that the pixel format and the
388+ coefficients-range combination in the committed surface contents are
389+ compatible, if contents exist. The "pixel_format" protocol error is
390+ raised otherwise.
391+
392+ A pixel format is compatible with the coefficients-range combination if
393+ the related equations and conventions as defined in H.273 can produce
394+ the color channels (RGB or YCbCr) of the pixel format.
395+
396+ For the definition of the supported combination, see the
397+ wp_color_representation_surface_v1::coefficients and
398+ wp_color_representation_surface_v1::range enums.
399+
400+ The coefficients-range combination is double-buffered, see
401+ wl_surface.commit.
402+ </description>
403+ <arg name="coefficients" type="uint" enum="coefficients"
404+ summary="matrix coefficients"/>
405+ <arg name="range" type="uint" enum="range"
406+ summary="range"/>
407+ </request>
408+
409+ <request name="set_chroma_location">
410+ <description summary="set the chroma location">
411+ If this protocol object is inert, the protocol error inert is raised.
412+
413+ Set the chroma location type which defines the position of downsampled
414+ chroma samples, corresponding to Chroma420SampleLocType code points in
415+ H.273.
416+
417+ An invalid chroma location enum value raises the "chroma_location"
418+ protocol error.
419+
420+ A call to wl_surface.commit verifies that the pixel format and chroma
421+ location type in the committed surface contents are compatible, if
422+ contents exist. The "pixel_format" protocol error is raised otherwise.
423+
424+ For the definition of the supported chroma location types, see the
425+ wp_color_representation_surface_v1::chroma_location enum.
426+
427+ The chroma location type is double-buffered, see wl_surface.commit.
428+ </description>
429+ <arg name="chroma_location" type="uint" enum="chroma_location"
430+ summary="chroma sample location"/>
431+ </request>
432+ </interface>
433+</protocol>
A protocols/drm-lease-v1.xml +317 -0
@@ -0,0 +1,317 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<protocol name="drm_lease_v1">
3+ <copyright>
4+ Copyright © 2018 NXP
5+ Copyright © 2019 Status Research &amp; Development GmbH.
6+ Copyright © 2021 Xaver Hugl
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_drm_lease_device_v1" version="1">
29+ <description summary="lease device">
30+ This protocol is used by Wayland compositors which act as Direct
31+ Rendering Manager (DRM) masters to lease DRM resources to Wayland
32+ clients.
33+
34+ The compositor will advertise one wp_drm_lease_device_v1 global for each
35+ DRM node. Some time after a client binds to the wp_drm_lease_device_v1
36+ global, the compositor will send a drm_fd event followed by zero, one or
37+ more connector events. After all currently available connectors have been
38+ sent, the compositor will send a wp_drm_lease_device_v1.done event.
39+
40+ When the list of connectors available for lease changes the compositor
41+ will send wp_drm_lease_device_v1.connector events for added connectors and
42+ wp_drm_lease_connector_v1.withdrawn events for removed connectors,
43+ followed by a wp_drm_lease_device_v1.done event.
44+
45+ The compositor will indicate when a device is gone by removing the global
46+ via a wl_registry.global_remove event. Upon receiving this event, the
47+ client should destroy any matching wp_drm_lease_device_v1 object.
48+
49+ To destroy a wp_drm_lease_device_v1 object, the client must first issue
50+ a release request. Upon receiving this request, the compositor will
51+ immediately send a released event and destroy the object. The client must
52+ continue to process and discard drm_fd and connector events until it
53+ receives the released event. Upon receiving the released event, the
54+ client can safely cleanup any client-side resources.
55+
56+ Warning! The protocol described in this file is currently in the testing
57+ phase. Backward compatible changes may be added together with the
58+ corresponding interface version bump. Backward incompatible changes can
59+ only be done by creating a new major version of the extension.
60+ </description>
61+
62+ <request name="create_lease_request">
63+ <description summary="create a lease request object">
64+ Creates a lease request object.
65+
66+ See the documentation for wp_drm_lease_request_v1 for details.
67+ </description>
68+ <arg name="id" type="new_id" interface="wp_drm_lease_request_v1" />
69+ </request>
70+
71+ <request name="release">
72+ <description summary="release this object">
73+ Indicates the client no longer wishes to use this object. In response
74+ the compositor will immediately send the released event and destroy
75+ this object. It can however not guarantee that the client won't receive
76+ connector events before the released event. The client must not send any
77+ requests after this one, doing so will raise a wl_display error.
78+ Existing connectors, lease request and leases will not be affected.
79+ </description>
80+ </request>
81+
82+ <event name="drm_fd">
83+ <description summary="open a non-master fd for this DRM node">
84+ The compositor will send this event when the wp_drm_lease_device_v1
85+ global is bound, although there are no guarantees as to how long this
86+ takes - the compositor might need to wait until regaining DRM master.
87+ The included fd is a non-master DRM file descriptor opened for this
88+ device and the compositor must not authenticate it.
89+ The purpose of this event is to give the client the ability to
90+ query DRM and discover information which may help them pick the
91+ appropriate DRM device or select the appropriate connectors therein.
92+ </description>
93+ <arg name="fd" type="fd" summary="DRM file descriptor" />
94+ </event>
95+
96+ <event name="connector">
97+ <description summary="advertise connectors available for leases">
98+ The compositor will use this event to advertise connectors available for
99+ lease by clients. This object may be passed into a lease request to
100+ indicate the client would like to lease that connector, see
101+ wp_drm_lease_request_v1.request_connector for details. While the
102+ compositor will make a best effort to not send disconnected connectors,
103+ no guarantees can be made.
104+
105+ The compositor must send the drm_fd event before sending connectors.
106+ After the drm_fd event it will send all available connectors but may
107+ send additional connectors at any time.
108+ </description>
109+ <arg name="id" type="new_id" interface="wp_drm_lease_connector_v1" />
110+ </event>
111+
112+ <event name="done">
113+ <description summary="signals grouping of connectors">
114+ The compositor will send this event to indicate that it has sent all
115+ currently available connectors after the client binds to the global or
116+ when it updates the connector list, for example on hotplug, drm master
117+ change or when a leased connector becomes available again. It will
118+ similarly send this event to group wp_drm_lease_connector_v1.withdrawn
119+ events of connectors of this device.
120+ </description>
121+ </event>
122+
123+ <event name="released" type="destructor">
124+ <description summary="the compositor has finished using the device">
125+ This event is sent in response to the release request and indicates
126+ that the compositor is done sending connector events.
127+ The compositor will destroy this object immediately after sending the
128+ event and it will become invalid. The client should release any
129+ resources associated with this device after receiving this event.
130+ </description>
131+ </event>
132+ </interface>
133+
134+ <interface name="wp_drm_lease_connector_v1" version="1">
135+ <description summary="a leasable DRM connector">
136+ Represents a DRM connector which is available for lease. These objects are
137+ created via wp_drm_lease_device_v1.connector events, and should be passed
138+ to lease requests via wp_drm_lease_request_v1.request_connector.
139+ Immediately after the wp_drm_lease_connector_v1 object is created the
140+ compositor will send a name, a description, a connector_id and a done
141+ event. When the description is updated the compositor will send a
142+ description event followed by a done event.
143+ </description>
144+
145+ <event name="name">
146+ <description summary="name">
147+ The compositor sends this event once the connector is created to
148+ indicate the name of this connector. This will not change for the
149+ duration of the Wayland session, but is not guaranteed to be consistent
150+ between sessions.
151+
152+ If the compositor supports wl_output version 4 and this connector
153+ corresponds to a wl_output, the compositor should use the same name as
154+ for the wl_output.
155+ </description>
156+ <arg name="name" type="string" summary="connector name" />
157+ </event>
158+
159+ <event name="description">
160+ <description summary="description">
161+ The compositor sends this event once the connector is created to provide
162+ a human-readable description for this connector, which may be presented
163+ to the user. The compositor may send this event multiple times over the
164+ lifetime of this object to reflect changes in the description.
165+ </description>
166+ <arg name="description" type="string" summary="connector description" />
167+ </event>
168+
169+ <event name="connector_id">
170+ <description summary="connector_id">
171+ The compositor sends this event once the connector is created to
172+ indicate the DRM object ID which represents the underlying connector
173+ that is being offered. Note that the final lease may include additional
174+ object IDs, such as CRTCs and planes.
175+ </description>
176+ <arg name="connector_id" type="uint" summary="DRM connector ID" />
177+ </event>
178+
179+ <event name="done">
180+ <description summary="all properties have been sent">
181+ This event is sent after all properties of a connector have been sent.
182+ This allows changes to the properties to be seen as atomic even if they
183+ happen via multiple events.
184+ </description>
185+ </event>
186+
187+ <event name="withdrawn">
188+ <description summary="lease offer withdrawn">
189+ Sent to indicate that the compositor will no longer honor requests for
190+ DRM leases which include this connector. The client may still issue a
191+ lease request including this connector, but the compositor will send
192+ wp_drm_lease_v1.finished without issuing a lease fd. Compositors are
193+ encouraged to send this event when they lose access to connector, for
194+ example when the connector is hot-unplugged, when the connector gets
195+ leased to a client or when the compositor loses DRM master.
196+
197+ If a client holds a lease for the connector, the status of the lease
198+ remains the same. The client should destroy the object after receiving
199+ this event.
200+ </description>
201+ </event>
202+
203+ <request name="destroy" type="destructor">
204+ <description summary="destroy connector">
205+ The client may send this request to indicate that it will not use this
206+ connector. Clients are encouraged to send this after receiving the
207+ "withdrawn" event so that the server can release the resources
208+ associated with this connector offer. Neither existing lease requests
209+ nor leases will be affected.
210+ </description>
211+ </request>
212+ </interface>
213+
214+ <interface name="wp_drm_lease_request_v1" version="1">
215+ <description summary="DRM lease request">
216+ A client that wishes to lease DRM resources will attach the list of
217+ connectors advertised with wp_drm_lease_device_v1.connector that they
218+ wish to lease, then use wp_drm_lease_request_v1.submit to submit the
219+ request.
220+ </description>
221+
222+ <enum name="error">
223+ <entry name="wrong_device" value="0"
224+ summary="requested a connector from a different lease device"/>
225+ <entry name="duplicate_connector" value="1"
226+ summary="requested a connector twice"/>
227+ <entry name="empty_lease" value="2"
228+ summary="requested a lease without requesting a connector"/>
229+ </enum>
230+
231+ <request name="request_connector">
232+ <description summary="request a connector for this lease">
233+ Indicates that the client would like to lease the given connector.
234+ This is only used as a suggestion, the compositor may choose to
235+ include any resources in the lease it issues, or change the set of
236+ leased resources at any time. Compositors are however encouraged to
237+ include the requested connector and other resources necessary
238+ to drive the connected output in the lease.
239+
240+ Requesting a connector that was created from a different lease device
241+ than this lease request raises the wrong_device error. Requesting a
242+ connector twice will raise the duplicate_connector error.
243+ </description>
244+ <arg name="connector" type="object"
245+ interface="wp_drm_lease_connector_v1" />
246+ </request>
247+
248+ <request name="submit" type="destructor">
249+ <description summary="submit the lease request">
250+ Submits the lease request and creates a new wp_drm_lease_v1 object.
251+ After calling submit the compositor will immediately destroy this
252+ object, issuing any more requests will cause a wl_display error.
253+ The compositor doesn't make any guarantees about the events of the
254+ lease object, clients cannot expect an immediate response.
255+ Not requesting any connectors before submitting the lease request
256+ will raise the empty_lease error.
257+ </description>
258+ <arg name="id" type="new_id" interface="wp_drm_lease_v1" />
259+ </request>
260+ </interface>
261+
262+ <interface name="wp_drm_lease_v1" version="1">
263+ <description summary="a DRM lease">
264+ A DRM lease object is used to transfer the DRM file descriptor to the
265+ client and manage the lifetime of the lease.
266+
267+ Some time after the wp_drm_lease_v1 object is created, the compositor
268+ will reply with the lease request's result. If the lease request is
269+ granted, the compositor will send a lease_fd event. If the lease request
270+ is denied, the compositor will send a finished event without a lease_fd
271+ event.
272+ </description>
273+
274+ <event name="lease_fd">
275+ <description summary="shares the DRM file descriptor">
276+ This event returns a file descriptor suitable for use with DRM-related
277+ ioctls. The client should use drmModeGetLease to enumerate the DRM
278+ objects which have been leased to them. The compositor guarantees it
279+ will not use the leased DRM objects itself until it sends the finished
280+ event. If the compositor cannot or will not grant a lease for the
281+ requested connectors, it will not send this event, instead sending the
282+ finished event.
283+
284+ The compositor will send this event at most once during this objects
285+ lifetime.
286+ </description>
287+ <arg name="leased_fd" type="fd" summary="leased DRM file descriptor" />
288+ </event>
289+
290+ <event name="finished">
291+ <description summary="sent when the lease has been revoked">
292+ The compositor uses this event to either reject a lease request, or if
293+ it previously sent a lease_fd, to notify the client that the lease has
294+ been revoked. If the client requires a new lease, they should destroy
295+ this object and submit a new lease request. The compositor will send
296+ no further events for this object after sending the finish event.
297+ Compositors should revoke the lease when any of the leased resources
298+ become unavailable, namely when a hot-unplug occurs or when the
299+ compositor loses DRM master. Compositors may advertise the connector
300+ for leasing again, if the resource is available, by sending the
301+ connector event through the wp_drm_lease_device_v1 interface.
302+ </description>
303+ </event>
304+
305+ <request name="destroy" type="destructor">
306+ <description summary="destroys the lease object">
307+ The client should send this to indicate that it no longer wishes to use
308+ this lease. The compositor should use drmModeRevokeLease on the
309+ appropriate file descriptor, if necessary.
310+
311+ Upon destruction, the compositor should advertise the connector for
312+ leasing again by sending the connector event through the
313+ wp_drm_lease_device_v1 interface.
314+ </description>
315+ </request>
316+ </interface>
317+</protocol>
A protocols/ext-background-effect-v1.xml +129 -0
@@ -0,0 +1,129 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<protocol name="ext_background_effect_v1">
3+ <copyright>
4+ Copyright (C) 2015 Martin Gräßlin
5+ Copyright (C) 2015 Marco Martin
6+ Copyright (C) 2020 Vlad Zahorodnii
7+ Copyright (C) 2024 Xaver Hugl
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+ <interface name="ext_background_effect_manager_v1" version="1">
30+ <description summary="background effect factory">
31+ This protocol provides a way to improve visuals of translucent surfaces
32+ by applying effects like blur to the background behind them.
33+
34+ The capabilities are send when the global is bound, and every time they
35+ change. Note that when the capability goes away, the corresponding effect
36+ is no longer applied by the compositor, even if it was set before.
37+
38+ Warning! The protocol described in this file is currently in the testing
39+ phase. Backward compatible changes may be added together with the
40+ corresponding interface version bump. Backward incompatible changes can
41+ only be done by creating a new major version of the extension.
42+ </description>
43+
44+ <request name="destroy" type="destructor">
45+ <description summary="destroy the background effect manager">
46+ Informs the server that the client will no longer be using this
47+ protocol object. Existing objects created by this object are not
48+ affected.
49+ </description>
50+ </request>
51+
52+ <enum name="error">
53+ <entry name="background_effect_exists" value="0"
54+ summary="the surface already has a background effect object"/>
55+ </enum>
56+
57+ <enum name="capability" bitfield="true">
58+ <entry name="blur" value="1"
59+ summary="the compositor supports applying blur"/>
60+ </enum>
61+
62+ <event name="capabilities">
63+ <description summary="capabilities of the compositor"/>
64+ <arg name="flags" type="uint" enum="capability"/>
65+ </event>
66+
67+ <request name="get_background_effect">
68+ <description summary="get a background effects object">
69+ Instantiate an interface extension for the given wl_surface to add
70+ effects like blur for the background behind it.
71+
72+ If the given wl_surface already has a ext_background_effect_surface_v1
73+ object associated, the background_effect_exists protocol error will be
74+ raised.
75+ </description>
76+ <arg name="id" type="new_id" interface="ext_background_effect_surface_v1"
77+ summary="the new ext_background_effect_surface_v1 object"/>
78+ <arg name="surface" type="object" interface="wl_surface"
79+ summary="the surface"/>
80+ </request>
81+ </interface>
82+
83+ <interface name="ext_background_effect_surface_v1" version="1">
84+ <description summary="background effects for a surface">
85+ The background effect object provides a way to specify a region behind
86+ a surface that should have background effects like blur applied.
87+
88+ If the wl_surface associated with the ext_background_effect_surface_v1
89+ object has been destroyed, this object becomes inert.
90+ </description>
91+
92+ <request name="destroy" type="destructor">
93+ <description summary="release the blur object">
94+ Informs the server that the client will no longer be using this protocol
95+ object. The effect regions will be removed on the next commit.
96+ </description>
97+ </request>
98+
99+ <enum name="error">
100+ <entry name="surface_destroyed" value="0"
101+ summary="the associated surface has been destroyed"/>
102+ </enum>
103+
104+ <request name="set_blur_region">
105+ <description summary="set blur region">
106+ This request sets the region of the surface that will have its
107+ background blurred.
108+
109+ The blur region is specified in the surface-local coordinates, and
110+ clipped by the compositor to the surface size.
111+
112+ The initial value for the blur region is empty. Setting the pending
113+ blur region has copy semantics, and the wl_region object can be
114+ destroyed immediately. A NULL wl_region removes the effect.
115+
116+ The blur region is double-buffered state, and will be applied on
117+ the next wl_surface.commit.
118+
119+ The blur algorithm is subject to compositor policies.
120+
121+ If the associated surface has been destroyed, the surface_destroyed
122+ error will be raised.
123+ </description>
124+ <arg name="region" type="object" interface="wl_region" allow-null="true"
125+ summary="blur region of the surface"/>
126+ </request>
127+
128+ </interface>
129+</protocol>
A protocols/ext-image-capture-source-v1.xml +109 -0
@@ -0,0 +1,109 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<protocol name="ext_image_capture_source_v1">
3+ <copyright>
4+ Copyright © 2022 Andri Yngvason
5+ Copyright © 2024 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+ <description summary="opaque image capture source objects">
28+ This protocol serves as an intermediary between capturing protocols and
29+ potential image capture sources such as outputs and toplevels.
30+
31+ This protocol may be extended to support more image capture sources in the
32+ future, thereby adding those image capture sources to other protocols that
33+ use the image capture source object without having to modify those
34+ protocols.
35+
36+ Warning! The protocol described in this file is currently in the testing
37+ phase. Backward compatible changes may be added together with the
38+ corresponding interface version bump. Backward incompatible changes can
39+ only be done by creating a new major version of the extension.
40+ </description>
41+
42+ <interface name="ext_image_capture_source_v1" version="1" frozen="true">
43+ <description summary="opaque image capture source object">
44+ The image capture source object is an opaque descriptor for a capturable
45+ resource. This resource may be any sort of entity from which an image
46+ may be derived.
47+
48+ Note, because ext_image_capture_source_v1 objects are created from multiple
49+ independent factory interfaces, the ext_image_capture_source_v1 interface is
50+ frozen at version 1.
51+ </description>
52+
53+ <request name="destroy" type="destructor">
54+ <description summary="delete this object">
55+ Destroys the image capture source. This request may be sent at any time
56+ by the client.
57+ </description>
58+ </request>
59+ </interface>
60+
61+ <interface name="ext_output_image_capture_source_manager_v1" version="1">
62+ <description summary="image capture source manager for outputs">
63+ A manager for creating image capture source objects for wl_output objects.
64+ </description>
65+
66+ <request name="create_source">
67+ <description summary="create source object for output">
68+ Creates a source object for an output. Images captured from this source
69+ will show the same content as the output. Some elements may be omitted,
70+ such as cursors and overlays that have been marked as transparent to
71+ capturing.
72+ </description>
73+ <arg name="source" type="new_id" interface="ext_image_capture_source_v1"/>
74+ <arg name="output" type="object" interface="wl_output"/>
75+ </request>
76+
77+ <request name="destroy" type="destructor">
78+ <description summary="delete this object">
79+ Destroys the manager. This request may be sent at any time by the client
80+ and objects created by the manager will remain valid after its
81+ destruction.
82+ </description>
83+ </request>
84+ </interface>
85+
86+ <interface name="ext_foreign_toplevel_image_capture_source_manager_v1" version="1">
87+ <description summary="image capture source manager for foreign toplevels">
88+ A manager for creating image capture source objects for
89+ ext_foreign_toplevel_handle_v1 objects.
90+ </description>
91+
92+ <request name="create_source">
93+ <description summary="create source object for foreign toplevel">
94+ Creates a source object for a foreign toplevel handle. Images captured
95+ from this source will show the same content as the toplevel.
96+ </description>
97+ <arg name="source" type="new_id" interface="ext_image_capture_source_v1"/>
98+ <arg name="toplevel_handle" type="object" interface="ext_foreign_toplevel_handle_v1"/>
99+ </request>
100+
101+ <request name="destroy" type="destructor">
102+ <description summary="delete this object">
103+ Destroys the manager. This request may be sent at any time by the client
104+ and objects created by the manager will remain valid after its
105+ destruction.
106+ </description>
107+ </request>
108+ </interface>
109+</protocol>
A protocols/ext-image-copy-capture-v1.xml +456 -0
@@ -0,0 +1,456 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<protocol name="ext_image_copy_capture_v1">
3+ <copyright>
4+ Copyright © 2021-2023 Andri Yngvason
5+ Copyright © 2024 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+ <description summary="image capturing into client buffers">
28+ This protocol allows clients to ask the compositor to capture image sources
29+ such as outputs and toplevels into user submitted buffers.
30+
31+ Warning! The protocol described in this file is currently in the testing
32+ phase. Backward compatible changes may be added together with the
33+ corresponding interface version bump. Backward incompatible changes can
34+ only be done by creating a new major version of the extension.
35+ </description>
36+
37+ <interface name="ext_image_copy_capture_manager_v1" version="1">
38+ <description summary="manager to inform clients and begin capturing">
39+ This object is a manager which offers requests to start capturing from a
40+ source.
41+ </description>
42+
43+ <enum name="error">
44+ <entry name="invalid_option" value="1" summary="invalid option flag"/>
45+ </enum>
46+
47+ <enum name="options" bitfield="true">
48+ <entry name="paint_cursors" value="1" summary="paint cursors onto captured frames"/>
49+ </enum>
50+
51+ <request name="create_session">
52+ <description summary="capture an image capture source">
53+ Create a capturing session for an image capture source.
54+
55+ If the paint_cursors option is set, cursors shall be composited onto
56+ the captured frame. The cursor must not be composited onto the frame
57+ if this flag is not set.
58+
59+ If the options bitfield is invalid, the invalid_option protocol error
60+ is sent.
61+ </description>
62+ <arg name="session" type="new_id" interface="ext_image_copy_capture_session_v1"/>
63+ <arg name="source" type="object" interface="ext_image_capture_source_v1"/>
64+ <arg name="options" type="uint" enum="options"/>
65+ </request>
66+
67+ <request name="create_pointer_cursor_session">
68+ <description summary="capture the pointer cursor of an image capture source">
69+ Create a cursor capturing session for the pointer of an image capture
70+ source.
71+ </description>
72+ <arg name="session" type="new_id" interface="ext_image_copy_capture_cursor_session_v1"/>
73+ <arg name="source" type="object" interface="ext_image_capture_source_v1"/>
74+ <arg name="pointer" type="object" interface="wl_pointer"/>
75+ </request>
76+
77+ <request name="destroy" type="destructor">
78+ <description summary="destroy the manager">
79+ Destroy the manager object.
80+
81+ Other objects created via this interface are unaffected.
82+ </description>
83+ </request>
84+ </interface>
85+
86+ <interface name="ext_image_copy_capture_session_v1" version="1">
87+ <description summary="image copy capture session">
88+ This object represents an active image copy capture session.
89+
90+ After a capture session is created, buffer constraint events will be
91+ emitted from the compositor to tell the client which buffer types and
92+ formats are supported for reading from the session. The compositor may
93+ re-send buffer constraint events whenever they change.
94+
95+ To advertise buffer constraints, the compositor must send in no
96+ particular order: zero or more shm_format and dmabuf_format events, zero
97+ or one dmabuf_device event, and exactly one buffer_size event. Then the
98+ compositor must send a done event.
99+
100+ When the client has received all the buffer constraints, it can create a
101+ buffer accordingly, attach it to the capture session using the
102+ attach_buffer request, set the buffer damage using the damage_buffer
103+ request and then send the capture request.
104+ </description>
105+
106+ <enum name="error">
107+ <entry name="duplicate_frame" value="1"
108+ summary="create_frame sent before destroying previous frame"/>
109+ </enum>
110+
111+ <event name="buffer_size">
112+ <description summary="image capture source dimensions">
113+ Provides the dimensions of the source image in buffer pixel coordinates.
114+
115+ The client must attach buffers that match this size.
116+ </description>
117+ <arg name="width" type="uint" summary="buffer width"/>
118+ <arg name="height" type="uint" summary="buffer height"/>
119+ </event>
120+
121+ <event name="shm_format">
122+ <description summary="shm buffer format">
123+ Provides the format that must be used for shared-memory buffers.
124+
125+ This event may be emitted multiple times, in which case the client may
126+ choose any given format.
127+ </description>
128+ <arg name="format" type="uint" enum="wl_shm.format" summary="shm format"/>
129+ </event>
130+
131+ <event name="dmabuf_device">
132+ <description summary="dma-buf device">
133+ This event advertises the device buffers must be allocated on for
134+ dma-buf buffers.
135+
136+ In general the device is a DRM node. The DRM node type (primary vs.
137+ render) is unspecified. Clients must not rely on the compositor sending
138+ a particular node type. Clients cannot check two devices for equality
139+ by comparing the dev_t value.
140+ </description>
141+ <arg name="device" type="array" summary="device dev_t value"/>
142+ </event>
143+
144+ <event name="dmabuf_format">
145+ <description summary="dma-buf format">
146+ Provides the format that must be used for dma-buf buffers.
147+
148+ The client may choose any of the modifiers advertised in the array of
149+ 64-bit unsigned integers.
150+
151+ This event may be emitted multiple times, in which case the client may
152+ choose any given format.
153+ </description>
154+ <arg name="format" type="uint" summary="drm format code"/>
155+ <arg name="modifiers" type="array" summary="drm format modifiers"/>
156+ </event>
157+
158+ <event name="done">
159+ <description summary="all constraints have been sent">
160+ This event is sent once when all buffer constraint events have been
161+ sent.
162+
163+ The compositor must always end a batch of buffer constraint events with
164+ this event, regardless of whether it sends the initial constraints or
165+ an update.
166+ </description>
167+ </event>
168+
169+ <event name="stopped">
170+ <description summary="session is no longer available">
171+ This event indicates that the capture session has stopped and is no
172+ longer available. This can happen in a number of cases, e.g. when the
173+ underlying source is destroyed, if the user decides to end the image
174+ capture, or if an unrecoverable runtime error has occurred.
175+
176+ The client should destroy the session after receiving this event.
177+ </description>
178+ </event>
179+
180+ <request name="create_frame">
181+ <description summary="create a frame">
182+ Create a capture frame for this session.
183+
184+ At most one frame object can exist for a given session at any time. If
185+ a client sends a create_frame request before a previous frame object
186+ has been destroyed, the duplicate_frame protocol error is raised.
187+ </description>
188+ <arg name="frame" type="new_id" interface="ext_image_copy_capture_frame_v1"/>
189+ </request>
190+
191+ <request name="destroy" type="destructor">
192+ <description summary="delete this object">
193+ Destroys the session. This request can be sent at any time by the
194+ client.
195+
196+ This request doesn't affect ext_image_copy_capture_frame_v1 objects created by
197+ this object.
198+ </description>
199+ </request>
200+ </interface>
201+
202+ <interface name="ext_image_copy_capture_frame_v1" version="1">
203+ <description summary="image capture frame">
204+ This object represents an image capture frame.
205+
206+ The client should attach a buffer, damage the buffer, and then send a
207+ capture request.
208+
209+ If the capture is successful, the compositor must send the frame metadata
210+ (transform, damage, presentation_time in any order) followed by the ready
211+ event.
212+
213+ If the capture fails, the compositor must send the failed event.
214+ </description>
215+
216+ <enum name="error">
217+ <entry name="no_buffer" value="1" summary="capture sent without attach_buffer"/>
218+ <entry name="invalid_buffer_damage" value="2" summary="invalid buffer damage"/>
219+ <entry name="already_captured" value="3" summary="capture request has been sent"/>
220+ </enum>
221+
222+ <request name="destroy" type="destructor">
223+ <description summary="destroy this object">
224+ Destroys the frame. This request can be sent at any time by the
225+ client.
226+ </description>
227+ </request>
228+
229+ <request name="attach_buffer">
230+ <description summary="attach buffer to session">
231+ Attach a buffer to the session.
232+
233+ The wl_buffer.release request is unused.
234+
235+ The new buffer replaces any previously attached buffer.
236+
237+ This request must not be sent after capture, or else the
238+ already_captured protocol error is raised.
239+ </description>
240+ <arg name="buffer" type="object" interface="wl_buffer"/>
241+ </request>
242+
243+ <request name="damage_buffer">
244+ <description summary="damage buffer">
245+ Apply damage to the buffer which is to be captured next. This request
246+ may be sent multiple times to describe a region.
247+
248+ The client indicates the accumulated damage since this wl_buffer was
249+ last captured. During capture, the compositor will update the buffer
250+ with at least the union of the region passed by the client and the
251+ region advertised by ext_image_copy_capture_frame_v1.damage.
252+
253+ When a wl_buffer is captured for the first time, or when the client
254+ doesn't track damage, the client must damage the whole buffer.
255+
256+ This is for optimisation purposes. The compositor may use this
257+ information to reduce copying.
258+
259+ These coordinates originate from the upper left corner of the buffer.
260+
261+ If x or y are strictly negative, or if width or height are negative or
262+ zero, the invalid_buffer_damage protocol error is raised.
263+
264+ This request must not be sent after capture, or else the
265+ already_captured protocol error is raised.
266+ </description>
267+ <arg name="x" type="int" summary="region x coordinate"/>
268+ <arg name="y" type="int" summary="region y coordinate"/>
269+ <arg name="width" type="int" summary="region width"/>
270+ <arg name="height" type="int" summary="region height"/>
271+ </request>
272+
273+ <request name="capture">
274+ <description summary="capture a frame">
275+ Capture a frame.
276+
277+ Unless this is the first successful captured frame performed in this
278+ session, the compositor may wait an indefinite amount of time for the
279+ source content to change before performing the copy.
280+
281+ This request may only be sent once, or else the already_captured
282+ protocol error is raised. A buffer must be attached before this request
283+ is sent, or else the no_buffer protocol error is raised.
284+ </description>
285+ </request>
286+
287+ <event name="transform">
288+ <description summary="buffer transform">
289+ This event is sent before the ready event and holds the transform that
290+ the compositor has applied to the buffer contents.
291+ </description>
292+ <arg name="transform" type="uint" enum="wl_output.transform"/>
293+ </event>
294+
295+ <event name="damage">
296+ <description summary="buffer damaged region">
297+ This event is sent before the ready event. It may be generated multiple
298+ times to describe a region.
299+
300+ The first captured frame in a session will always carry full damage.
301+ Subsequent frames' damaged regions describe which parts of the buffer
302+ have changed since the last ready event.
303+
304+ These coordinates originate in the upper left corner of the buffer.
305+ </description>
306+ <arg name="x" type="int" summary="damage x coordinate"/>
307+ <arg name="y" type="int" summary="damage y coordinate"/>
308+ <arg name="width" type="int" summary="damage width"/>
309+ <arg name="height" type="int" summary="damage height"/>
310+ </event>
311+
312+ <event name="presentation_time">
313+ <description summary="presentation time of the frame">
314+ This event indicates the time at which the frame is presented to the
315+ output in system monotonic time. This event is sent before the ready
316+ event.
317+
318+ The timestamp is expressed as tv_sec_hi, tv_sec_lo, tv_nsec triples,
319+ each component being an unsigned 32-bit value. Whole seconds are in
320+ tv_sec which is a 64-bit value combined from tv_sec_hi and tv_sec_lo,
321+ and the additional fractional part in tv_nsec as nanoseconds. Hence,
322+ for valid timestamps tv_nsec must be in [0, 999999999].
323+ </description>
324+ <arg name="tv_sec_hi" type="uint"
325+ summary="high 32 bits of the seconds part of the timestamp"/>
326+ <arg name="tv_sec_lo" type="uint"
327+ summary="low 32 bits of the seconds part of the timestamp"/>
328+ <arg name="tv_nsec" type="uint"
329+ summary="nanoseconds part of the timestamp"/>
330+ </event>
331+
332+ <event name="ready">
333+ <description summary="frame is available for reading">
334+ Called as soon as the frame is copied, indicating it is available
335+ for reading.
336+
337+ The buffer may be re-used by the client after this event.
338+
339+ After receiving this event, the client must destroy the object.
340+ </description>
341+ </event>
342+
343+ <enum name="failure_reason">
344+ <entry name="unknown" value="0">
345+ <description summary="unknown runtime error">
346+ An unspecified runtime error has occurred. The client may retry.
347+ </description>
348+ </entry>
349+ <entry name="buffer_constraints" value="1">
350+ <description summary="buffer constraints mismatch">
351+ The buffer submitted by the client doesn't match the latest session
352+ constraints. The client should re-allocate its buffers and retry.
353+ </description>
354+ </entry>
355+ <entry name="stopped" value="2">
356+ <description summary="session is no longer available">
357+ The session has stopped. See ext_image_copy_capture_session_v1.stopped.
358+ </description>
359+ </entry>
360+ </enum>
361+
362+ <event name="failed">
363+ <description summary="capture failed">
364+ This event indicates that the attempted frame copy has failed.
365+
366+ After receiving this event, the client must destroy the object.
367+ </description>
368+ <arg name="reason" type="uint" enum="failure_reason"/>
369+ </event>
370+ </interface>
371+
372+ <interface name="ext_image_copy_capture_cursor_session_v1" version="1">
373+ <description summary="cursor capture session">
374+ This object represents a cursor capture session. It extends the base
375+ capture session with cursor-specific metadata.
376+ </description>
377+
378+ <enum name="error">
379+ <entry name="duplicate_session" value="1" summary="get_capture_session sent twice"/>
380+ </enum>
381+
382+ <request name="destroy" type="destructor">
383+ <description summary="delete this object">
384+ Destroys the session. This request can be sent at any time by the
385+ client.
386+
387+ This request doesn't affect ext_image_copy_capture_frame_v1 objects created by
388+ this object.
389+ </description>
390+ </request>
391+
392+ <request name="get_capture_session">
393+ <description summary="get image copy capturer session">
394+ Gets the image copy capture session for this cursor session.
395+
396+ The session will produce frames of the cursor image. The compositor may
397+ pause the session when the cursor leaves the captured area.
398+
399+ This request must not be sent more than once, or else the
400+ duplicate_session protocol error is raised.
401+ </description>
402+ <arg name="session" type="new_id" interface="ext_image_copy_capture_session_v1"/>
403+ </request>
404+
405+ <event name="enter">
406+ <description summary="cursor entered captured area">
407+ Sent when a cursor enters the captured area. It shall be generated
408+ before the "position" and "hotspot" events when and only when a cursor
409+ enters the area.
410+
411+ The cursor enters the captured area when the cursor image intersects
412+ with the captured area. Note, this is different from e.g.
413+ wl_pointer.enter.
414+ </description>
415+ </event>
416+
417+ <event name="leave">
418+ <description summary="cursor left captured area">
419+ Sent when a cursor leaves the captured area. No "position" or "hotspot"
420+ event is generated for the cursor until the cursor enters the captured
421+ area again.
422+ </description>
423+ </event>
424+
425+ <event name="position">
426+ <description summary="position changed">
427+ Cursors outside the image capture source do not get captured and no
428+ event will be generated for them.
429+
430+ The given position is the position of the cursor's hotspot and it is
431+ relative to the main buffer's top left corner in transformed buffer
432+ pixel coordinates. The coordinates may be negative or greater than the
433+ main buffer size.
434+ </description>
435+ <arg name="x" type="int" summary="position x coordinates"/>
436+ <arg name="y" type="int" summary="position y coordinates"/>
437+ </event>
438+
439+ <event name="hotspot">
440+ <description summary="hotspot changed">
441+ The hotspot describes the offset between the cursor image and the
442+ position of the input device.
443+
444+ The given coordinates are the hotspot's offset from the origin in
445+ buffer coordinates.
446+
447+ Clients should not apply the hotspot immediately: the hotspot becomes
448+ effective when the next ext_image_copy_capture_frame_v1.ready event is received.
449+
450+ Compositors may delay this event until the client captures a new frame.
451+ </description>
452+ <arg name="x" type="int" summary="hotspot x coordinates"/>
453+ <arg name="y" type="int" summary="hotspot y coordinates"/>
454+ </event>
455+ </interface>
456+</protocol>
A protocols/ext-transient-seat-v1.xml +110 -0
@@ -0,0 +1,110 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<protocol name="ext_transient_seat_v1">
3+ <copyright>
4+ Copyright © 2020 - 2023 Andri Yngvason
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+ <description summary="protocol for creating temporary seats">
27+ The transient seat protocol can be used by privileged clients to create
28+ independent seats that will be removed from the compositor when the client
29+ destroys its transient seat.
30+
31+ This protocol is intended for use with virtual input protocols such as
32+ "virtual_keyboard_unstable_v1" or "wlr_virtual_pointer_unstable_v1", both
33+ of which allow the user to select a seat.
34+
35+ The "wl_seat" global created by this protocol does not generate input events
36+ on its own, or have any capabilities except those assigned to it by other
37+ protocol extensions, such as the ones mentioned above.
38+
39+ For example, a remote desktop server can create a seat with virtual inputs
40+ for each remote user by following these steps for each new connection:
41+ * Create a transient seat
42+ * Wait for the transient seat to be created
43+ * Locate a "wl_seat" global with a matching name
44+ * Create virtual inputs using the resulting "wl_seat" global
45+ </description>
46+
47+ <interface name="ext_transient_seat_manager_v1" version="1">
48+ <description summary="transient seat manager">
49+ The transient seat manager creates short-lived seats.
50+ </description>
51+
52+ <request name="create">
53+ <description summary="create a transient seat">
54+ Create a new seat that is removed when the client side transient seat
55+ object is destroyed.
56+
57+ The actual seat may be removed sooner, in which case the transient seat
58+ object shall become inert.
59+ </description>
60+ <arg name="seat" type="new_id" interface="ext_transient_seat_v1"/>
61+ </request>
62+
63+ <request name="destroy" type="destructor">
64+ <description summary="destroy the manager">
65+ Destroy the manager.
66+
67+ All objects created by the manager will remain valid until they are
68+ destroyed themselves.
69+ </description>
70+ </request>
71+ </interface>
72+
73+ <interface name="ext_transient_seat_v1" version="1">
74+ <description summary="transient seat handle">
75+ When the transient seat handle is destroyed, the seat itself will also be
76+ destroyed.
77+ </description>
78+
79+ <event name="ready">
80+ <description summary="transient seat is ready">
81+ This event advertises the global name for the wl_seat to be used with
82+ wl_registry_bind.
83+
84+ It is sent exactly once, immediately after the transient seat is created
85+ and the new "wl_seat" global is advertised, if and only if the creation
86+ of the transient seat was allowed.
87+ </description>
88+ <arg name="global_name" type="uint"/>
89+ </event>
90+
91+ <event name="denied">
92+ <description summary="transient seat creation denied">
93+ The event informs the client that the compositor denied its request to
94+ create a transient seat.
95+
96+ It is sent exactly once, immediately after the transient seat object is
97+ created, if and only if the creation of the transient seat was denied.
98+
99+ After receiving this event, the client should destroy the object.
100+ </description>
101+ </event>
102+
103+ <request name="destroy" type="destructor">
104+ <description summary="destroy transient seat">
105+ When the transient seat object is destroyed by the client, the
106+ associated seat created by the compositor is also destroyed.
107+ </description>
108+ </request>
109+ </interface>
110+</protocol>
A protocols/ext-workspace-v1.xml +422 -0
@@ -0,0 +1,422 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<protocol name="ext_workspace_v1">
3+ <copyright>
4+ Copyright © 2019 Christopher Billington
5+ Copyright © 2020 Ilia Bozhinov
6+ Copyright © 2022 Victoria Brekenfeld
7+
8+ Permission to use, copy, modify, distribute, and sell this
9+ software and its documentation for any purpose is hereby granted
10+ without fee, provided that the above copyright notice appear in
11+ all copies and that both that copyright notice and this permission
12+ notice appear in supporting documentation, and that the name of
13+ the copyright holders not be used in advertising or publicity
14+ pertaining to distribution of the software without specific,
15+ written prior permission. The copyright holders make no
16+ representations about the suitability of this software for any
17+ purpose. It is provided "as is" without express or implied
18+ warranty.
19+
20+ THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
21+ SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
22+ FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
23+ SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
24+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
25+ AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
26+ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
27+ THIS SOFTWARE.
28+ </copyright>
29+
30+ <interface name="ext_workspace_manager_v1" version="1">
31+ <description summary="list and control workspaces">
32+ Workspaces, also called virtual desktops, are groups of surfaces. A
33+ compositor with a concept of workspaces may only show some such groups of
34+ surfaces (those of 'active' workspaces) at a time. 'Activating' a
35+ workspace is a request for the compositor to display that workspace's
36+ surfaces as normal, whereas the compositor may hide or otherwise
37+ de-emphasise surfaces that are associated only with 'inactive' workspaces.
38+ Workspaces are grouped by which sets of outputs they correspond to, and
39+ may contain surfaces only from those outputs. In this way, it is possible
40+ for each output to have its own set of workspaces, or for all outputs (or
41+ any other arbitrary grouping) to share workspaces. Compositors may
42+ optionally conceptually arrange each group of workspaces in an
43+ N-dimensional grid.
44+
45+ The purpose of this protocol is to enable the creation of taskbars and
46+ docks by providing them with a list of workspaces and their properties,
47+ and allowing them to activate and deactivate workspaces.
48+
49+ After a client binds the ext_workspace_manager_v1, each workspace will be
50+ sent via the workspace event.
51+ </description>
52+
53+ <event name="workspace_group">
54+ <description summary="a workspace group has been created">
55+ This event is emitted whenever a new workspace group has been created.
56+
57+ All initial details of the workspace group (outputs) will be
58+ sent immediately after this event via the corresponding events in
59+ ext_workspace_group_handle_v1 and ext_workspace_handle_v1.
60+ </description>
61+ <arg name="workspace_group" type="new_id" interface="ext_workspace_group_handle_v1"/>
62+ </event>
63+
64+ <event name="workspace">
65+ <description summary="workspace has been created">
66+ This event is emitted whenever a new workspace has been created.
67+
68+ All initial details of the workspace (name, coordinates, state) will
69+ be sent immediately after this event via the corresponding events in
70+ ext_workspace_handle_v1.
71+
72+ Workspaces start off unassigned to any workspace group.
73+ </description>
74+ <arg name="workspace" type="new_id" interface="ext_workspace_handle_v1"/>
75+ </event>
76+
77+ <request name="commit">
78+ <description summary="all requests about the workspaces have been sent">
79+ The client must send this request after it has finished sending other
80+ requests. The compositor must process a series of requests preceding a
81+ commit request atomically.
82+
83+ This allows changes to the workspace properties to be seen as atomic,
84+ even if they happen via multiple events, and even if they involve
85+ multiple ext_workspace_handle_v1 objects, for example, deactivating one
86+ workspace and activating another.
87+ </description>
88+ </request>
89+
90+ <event name="done">
91+ <description summary="all information about the workspaces and workspace groups has been sent">
92+ This event is sent after all changes in all workspaces and workspace groups have been
93+ sent.
94+
95+ This allows changes to one or more ext_workspace_group_handle_v1
96+ properties and ext_workspace_handle_v1 properties
97+ to be seen as atomic, even if they happen via multiple events.
98+ In particular, an output moving from one workspace group to
99+ another sends an output_enter event and an output_leave event to the two
100+ ext_workspace_group_handle_v1 objects in question. The compositor sends
101+ the done event only after updating the output information in both
102+ workspace groups.
103+ </description>
104+ </event>
105+
106+ <event name="finished" type="destructor">
107+ <description summary="the compositor has finished with the workspace_manager">
108+ This event indicates that the compositor is done sending events to the
109+ ext_workspace_manager_v1. The server will destroy the object
110+ immediately after sending this request.
111+ </description>
112+ </event>
113+
114+ <request name="stop">
115+ <description summary="stop sending events">
116+ Indicates the client no longer wishes to receive events for new
117+ workspace groups. However the compositor may emit further workspace
118+ events, until the finished event is emitted. The compositor is expected
119+ to send the finished event eventually once the stop request has been processed.
120+
121+ The client must not send any requests after this one, doing so will raise a wl_display
122+ invalid_object error.
123+ </description>
124+ </request>
125+
126+ </interface>
127+
128+ <interface name="ext_workspace_group_handle_v1" version="1">
129+ <description summary="a workspace group assigned to a set of outputs">
130+ A ext_workspace_group_handle_v1 object represents a workspace group
131+ that is assigned a set of outputs and contains a number of workspaces.
132+
133+ The set of outputs assigned to the workspace group is conveyed to the client via
134+ output_enter and output_leave events, and its workspaces are conveyed with
135+ workspace events.
136+
137+ For example, a compositor which has a set of workspaces for each output may
138+ advertise a workspace group (and its workspaces) per output, whereas a compositor
139+ where a workspace spans all outputs may advertise a single workspace group for all
140+ outputs.
141+ </description>
142+
143+ <enum name="group_capabilities" bitfield="true">
144+ <entry name="create_workspace" value="1" summary="create_workspace request is available"/>
145+ </enum>
146+
147+ <event name="capabilities">
148+ <description summary="compositor capabilities">
149+ This event advertises the capabilities supported by the compositor. If
150+ a capability isn't supported, clients should hide or disable the UI
151+ elements that expose this functionality. For instance, if the
152+ compositor doesn't advertise support for creating workspaces, a button
153+ triggering the create_workspace request should not be displayed.
154+
155+ The compositor will ignore requests it doesn't support. For instance,
156+ a compositor which doesn't advertise support for creating workspaces will ignore
157+ create_workspace requests.
158+
159+ Compositors must send this event once after creation of an
160+ ext_workspace_group_handle_v1. When the capabilities change, compositors
161+ must send this event again.
162+ </description>
163+ <arg name="capabilities" type="uint" summary="capabilities" enum="group_capabilities"/>
164+ </event>
165+
166+ <event name="output_enter">
167+ <description summary="output assigned to workspace group">
168+ This event is emitted whenever an output is assigned to the workspace
169+ group or a new `wl_output` object is bound by the client, which was already
170+ assigned to this workspace_group.
171+ </description>
172+ <arg name="output" type="object" interface="wl_output"/>
173+ </event>
174+
175+ <event name="output_leave">
176+ <description summary="output removed from workspace group">
177+ This event is emitted whenever an output is removed from the workspace
178+ group.
179+ </description>
180+ <arg name="output" type="object" interface="wl_output"/>
181+ </event>
182+
183+ <event name="workspace_enter">
184+ <description summary="workspace added to workspace group">
185+ This event is emitted whenever a workspace is assigned to this group.
186+ A workspace may only ever be assigned to a single group at a single point
187+ in time, but can be re-assigned during its lifetime.
188+ </description>
189+ <arg name="workspace" type="object" interface="ext_workspace_handle_v1"/>
190+ </event>
191+
192+ <event name="workspace_leave">
193+ <description summary="workspace removed from workspace group">
194+ This event is emitted whenever a workspace is removed from this group.
195+ </description>
196+ <arg name="workspace" type="object" interface="ext_workspace_handle_v1"/>
197+ </event>
198+
199+ <event name="removed">
200+ <description summary="this workspace group has been removed">
201+ This event is send when the group associated with the ext_workspace_group_handle_v1
202+ has been removed. After sending this request the compositor will immediately consider
203+ the object inert. Any requests will be ignored except the destroy request.
204+ It is guaranteed there won't be any more events referencing this
205+ ext_workspace_group_handle_v1.
206+
207+ The compositor must remove all workspaces belonging to a workspace group
208+ via a workspace_leave event before removing the workspace group.
209+ </description>
210+ </event>
211+
212+ <request name="create_workspace">
213+ <description summary="create a new workspace">
214+ Request that the compositor create a new workspace with the given name
215+ and assign it to this group.
216+
217+ There is no guarantee that the compositor will create a new workspace,
218+ or that the created workspace will have the provided name.
219+ </description>
220+ <arg name="workspace" type="string"/>
221+ </request>
222+
223+ <request name="destroy" type="destructor">
224+ <description summary="destroy the ext_workspace_group_handle_v1 object">
225+ Destroys the ext_workspace_group_handle_v1 object.
226+
227+ This request should be send either when the client does not want to
228+ use the workspace group object any more or after the removed event to finalize
229+ the destruction of the object.
230+ </description>
231+ </request>
232+ </interface>
233+
234+ <interface name="ext_workspace_handle_v1" version="1">
235+ <description summary="a workspace handing a group of surfaces">
236+ A ext_workspace_handle_v1 object represents a workspace that handles a
237+ group of surfaces.
238+
239+ Each workspace has:
240+ - a name, conveyed to the client with the name event
241+ - potentially an id conveyed with the id event
242+ - a list of states, conveyed to the client with the state event
243+ - and optionally a set of coordinates, conveyed to the client with the
244+ coordinates event
245+
246+ The client may request that the compositor activate or deactivate the workspace.
247+
248+ Each workspace can belong to only a single workspace group.
249+ Depending on the compositor policy, there might be workspaces with
250+ the same name in different workspace groups, but these workspaces are still
251+ separate (e.g. one of them might be active while the other is not).
252+ </description>
253+
254+ <event name="id">
255+ <description summary="workspace id">
256+ If this event is emitted, it will be send immediately after the
257+ ext_workspace_handle_v1 is created or when an id is assigned to
258+ a workspace (at most once during its lifetime).
259+
260+ An id will never change during the lifetime of the `ext_workspace_handle_v1`
261+ and is guaranteed to be unique during its lifetime.
262+
263+ Ids are not human-readable and shouldn't be displayed, use `name` for that purpose.
264+
265+ Compositors are expected to only send ids for workspaces likely stable across multiple
266+ sessions and can be used by clients to store preferences for workspaces. Workspaces without
267+ ids should be considered temporary and any data associated with them should be deleted once
268+ the respective object is lost.
269+ </description>
270+ <arg name="id" type="string"/>
271+ </event>
272+
273+ <event name="name">
274+ <description summary="workspace name changed">
275+ This event is emitted immediately after the ext_workspace_handle_v1 is
276+ created and whenever the name of the workspace changes.
277+
278+ A name is meant to be human-readable and can be displayed to a user.
279+ Unlike the id it is neither stable nor unique.
280+ </description>
281+ <arg name="name" type="string"/>
282+ </event>
283+
284+ <event name="coordinates">
285+ <description summary="workspace coordinates changed">
286+ This event is used to organize workspaces into an N-dimensional grid
287+ within a workspace group, and if supported, is emitted immediately after
288+ the ext_workspace_handle_v1 is created and whenever the coordinates of
289+ the workspace change. Compositors may not send this event if they do not
290+ conceptually arrange workspaces in this way. If compositors simply
291+ number workspaces, without any geometric interpretation, they may send
292+ 1D coordinates, which clients should not interpret as implying any
293+ geometry. Sending an empty array means that the compositor no longer
294+ orders the workspace geometrically.
295+
296+ Coordinates have an arbitrary number of dimensions N with an uint32
297+ position along each dimension. By convention if N > 1, the first
298+ dimension is X, the second Y, the third Z, and so on. The compositor may
299+ chose to utilize these events for a more novel workspace layout
300+ convention, however. No guarantee is made about the grid being filled or
301+ bounded; there may be a workspace at coordinate 1 and another at
302+ coordinate 1000 and none in between. Within a workspace group, however,
303+ workspaces must have unique coordinates of equal dimensionality.
304+ </description>
305+ <arg name="coordinates" type="array"/>
306+ </event>
307+
308+ <enum name="state" bitfield="true">
309+ <description summary="types of states on the workspace">
310+ The different states that a workspace can have.
311+ </description>
312+
313+ <entry name="active" value="1" summary="the workspace is active"/>
314+ <entry name="urgent" value="2" summary="the workspace requests attention"/>
315+ <entry name="hidden" value="4">
316+ <description summary="the workspace is not visible">
317+ The workspace is not visible in its workspace group, and clients
318+ attempting to visualize the compositor workspace state should not
319+ display such workspaces.
320+ </description>
321+ </entry>
322+ </enum>
323+
324+ <event name="state">
325+ <description summary="the state of the workspace changed">
326+ This event is emitted immediately after the ext_workspace_handle_v1 is
327+ created and each time the workspace state changes, either because of a
328+ compositor action or because of a request in this protocol.
329+
330+ Missing states convey the opposite meaning, e.g. an unset active bit
331+ means the workspace is currently inactive.
332+ </description>
333+ <arg name="state" type="uint" enum="state"/>
334+ </event>
335+
336+ <enum name="workspace_capabilities" bitfield="true">
337+ <entry name="activate" value="1" summary="activate request is available"/>
338+ <entry name="deactivate" value="2" summary="deactivate request is available"/>
339+ <entry name="remove" value="4" summary="remove request is available"/>
340+ <entry name="assign" value="8" summary="assign request is available"/>
341+ </enum>
342+
343+ <event name="capabilities">
344+ <description summary="compositor capabilities">
345+ This event advertises the capabilities supported by the compositor. If
346+ a capability isn't supported, clients should hide or disable the UI
347+ elements that expose this functionality. For instance, if the
348+ compositor doesn't advertise support for removing workspaces, a button
349+ triggering the remove request should not be displayed.
350+
351+ The compositor will ignore requests it doesn't support. For instance,
352+ a compositor which doesn't advertise support for remove will ignore
353+ remove requests.
354+
355+ Compositors must send this event once after creation of an
356+ ext_workspace_handle_v1 . When the capabilities change, compositors
357+ must send this event again.
358+ </description>
359+ <arg name="capabilities" type="uint" summary="capabilities" enum="workspace_capabilities"/>
360+ </event>
361+
362+ <event name="removed">
363+ <description summary="this workspace has been removed">
364+ This event is send when the workspace associated with the ext_workspace_handle_v1
365+ has been removed. After sending this request, the compositor will immediately consider
366+ the object inert. Any requests will be ignored except the destroy request.
367+
368+ It is guaranteed there won't be any more events referencing this
369+ ext_workspace_handle_v1.
370+
371+ The compositor must only remove a workspaces not currently belonging to any
372+ workspace_group.
373+ </description>
374+ </event>
375+
376+ <request name="destroy" type="destructor">
377+ <description summary="destroy the ext_workspace_handle_v1 object">
378+ Destroys the ext_workspace_handle_v1 object.
379+
380+ This request should be made either when the client does not want to
381+ use the workspace object any more or after the remove event to finalize
382+ the destruction of the object.
383+ </description>
384+ </request>
385+
386+ <request name="activate">
387+ <description summary="activate the workspace">
388+ Request that this workspace be activated.
389+
390+ There is no guarantee the workspace will be actually activated, and
391+ behaviour may be compositor-dependent. For example, activating a
392+ workspace may or may not deactivate all other workspaces in the same
393+ group.
394+ </description>
395+ </request>
396+
397+ <request name="deactivate">
398+ <description summary="deactivate the workspace">
399+ Request that this workspace be deactivated.
400+
401+ There is no guarantee the workspace will be actually deactivated.
402+ </description>
403+ </request>
404+
405+ <request name="assign">
406+ <description summary="assign workspace to group">
407+ Requests that this workspace is assigned to the given workspace group.
408+
409+ There is no guarantee the workspace will be assigned.
410+ </description>
411+ <arg name="workspace_group" type="object" interface="ext_workspace_group_handle_v1"/>
412+ </request>
413+
414+ <request name="remove">
415+ <description summary="remove the workspace">
416+ Request that this workspace be removed.
417+
418+ There is no guarantee the workspace will be actually removed.
419+ </description>
420+ </request>
421+ </interface>
422+</protocol>
A protocols/input-method-unstable-v2.xml +494 -0
@@ -0,0 +1,494 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<protocol name="input_method_unstable_v2">
3+
4+ <copyright>
5+ Copyright © 2008-2011 Kristian Høgsberg
6+ Copyright © 2010-2011 Intel Corporation
7+ Copyright © 2012-2013 Collabora, Ltd.
8+ Copyright © 2012, 2013 Intel Corporation
9+ Copyright © 2015, 2016 Jan Arne Petersen
10+ Copyright © 2017, 2018 Red Hat, Inc.
11+ Copyright © 2018 Purism SPC
12+
13+ Permission is hereby granted, free of charge, to any person obtaining a
14+ copy of this software and associated documentation files (the "Software"),
15+ to deal in the Software without restriction, including without limitation
16+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
17+ and/or sell copies of the Software, and to permit persons to whom the
18+ Software is furnished to do so, subject to the following conditions:
19+
20+ The above copyright notice and this permission notice (including the next
21+ paragraph) shall be included in all copies or substantial portions of the
22+ Software.
23+
24+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
27+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
30+ DEALINGS IN THE SOFTWARE.
31+ </copyright>
32+
33+ <description summary="Protocol for creating input methods">
34+ This protocol allows applications to act as input methods for compositors.
35+
36+ An input method context is used to manage the state of the input method.
37+
38+ Text strings are UTF-8 encoded, their indices and lengths are in bytes.
39+
40+ This document adheres to the RFC 2119 when using words like "must",
41+ "should", "may", etc.
42+
43+ Warning! The protocol described in this file is experimental and
44+ backward incompatible changes may be made. Backward compatible changes
45+ may be added together with the corresponding interface version bump.
46+ Backward incompatible changes are done by bumping the version number in
47+ the protocol and interface names and resetting the interface version.
48+ Once the protocol is to be declared stable, the 'z' prefix and the
49+ version number in the protocol and interface names are removed and the
50+ interface version number is reset.
51+ </description>
52+
53+ <interface name="zwp_input_method_v2" version="1">
54+ <description summary="input method">
55+ An input method object allows for clients to compose text.
56+
57+ The objects connects the client to a text input in an application, and
58+ lets the client to serve as an input method for a seat.
59+
60+ The zwp_input_method_v2 object can occupy two distinct states: active and
61+ inactive. In the active state, the object is associated to and
62+ communicates with a text input. In the inactive state, there is no
63+ associated text input, and the only communication is with the compositor.
64+ Initially, the input method is in the inactive state.
65+
66+ Requests issued in the inactive state must be accepted by the compositor.
67+ Because of the serial mechanism, and the state reset on activate event,
68+ they will not have any effect on the state of the next text input.
69+
70+ There must be no more than one input method object per seat.
71+ </description>
72+
73+ <enum name="error">
74+ <entry name="role" value="0" summary="wl_surface has another role"/>
75+ </enum>
76+
77+ <event name="activate">
78+ <description summary="input method has been requested">
79+ Notification that a text input focused on this seat requested the input
80+ method to be activated.
81+
82+ This event serves the purpose of providing the compositor with an
83+ active input method.
84+
85+ This event resets all state associated with previous
86+ surrounding_text, text_change_cause, and content_type events, as well
87+ as the state associated with set_preedit_string, commit_string, and
88+ delete_surrounding_text requests. In addition, it marks the
89+ zwp_input_method_v2 object as active, and makes any existing
90+ zwp_input_popup_surface_v2 objects visible.
91+
92+ The surrounding_text, and content_type events must follow before the
93+ next done event if the text input supports the respective
94+ functionality.
95+
96+ State set with this event is double-buffered. It will get applied on
97+ the next zwp_input_method_v2.done event, and stay valid until changed.
98+ </description>
99+ </event>
100+
101+ <event name="deactivate">
102+ <description summary="deactivate event">
103+ Notification that no focused text input currently needs an active
104+ input method on this seat.
105+
106+ This event marks the zwp_input_method_v2 object as inactive. The
107+ compositor must make all existing zwp_input_popup_surface_v2 objects
108+ invisible until the next activate event.
109+
110+ State set with this event is double-buffered. It will get applied on
111+ the next zwp_input_method_v2.done event, and stay valid until changed.
112+ </description>
113+ </event>
114+
115+ <event name="surrounding_text">
116+ <description summary="surrounding text event">
117+ Updates the surrounding plain text around the cursor, excluding the
118+ preedit text.
119+
120+ If any preedit text is present, it is replaced with the cursor for the
121+ purpose of this event.
122+
123+ The argument text is a buffer containing the surrounding text, and must
124+ include the cursor position, and the complete selection. It should
125+ contain additional characters before and after these. There is a
126+ maximum length of wayland messages, so text can not be longer than 4000
127+ bytes.
128+
129+ cursor is the byte offset of the cursor within the text buffer.
130+
131+ anchor is the byte offset of the selection anchor within the text
132+ buffer. If there is no selected text, anchor must be the same as
133+ cursor.
134+
135+ If this event does not arrive before the first done event, the input
136+ method may assume that the text input does not support this
137+ functionality and ignore following surrounding_text events.
138+
139+ Values set with this event are double-buffered. They will get applied
140+ and set to initial values on the next zwp_input_method_v2.done
141+ event.
142+
143+ The initial state for affected fields is empty, meaning that the text
144+ input does not support sending surrounding text. If the empty values
145+ get applied, subsequent attempts to change them may have no effect.
146+ </description>
147+ <arg name="text" type="string"/>
148+ <arg name="cursor" type="uint"/>
149+ <arg name="anchor" type="uint"/>
150+ </event>
151+
152+ <event name="text_change_cause">
153+ <description summary="indicates the cause of surrounding text change">
154+ Tells the input method why the text surrounding the cursor changed.
155+
156+ Whenever the client detects an external change in text, cursor, or
157+ anchor position, it must issue this request to the compositor. This
158+ request is intended to give the input method a chance to update the
159+ preedit text in an appropriate way, e.g. by removing it when the user
160+ starts typing with a keyboard.
161+
162+ cause describes the source of the change.
163+
164+ The value set with this event is double-buffered. It will get applied
165+ and set to its initial value on the next zwp_input_method_v2.done
166+ event.
167+
168+ The initial value of cause is input_method.
169+ </description>
170+ <arg name="cause" type="uint" enum="zwp_text_input_v3.change_cause"/>
171+ </event>
172+
173+ <event name="content_type">
174+ <description summary="content purpose and hint">
175+ Indicates the content type and hint for the current
176+ zwp_input_method_v2 instance.
177+
178+ Values set with this event are double-buffered. They will get applied
179+ on the next zwp_input_method_v2.done event.
180+
181+ The initial value for hint is none, and the initial value for purpose
182+ is normal.
183+ </description>
184+ <arg name="hint" type="uint" enum="zwp_text_input_v3.content_hint"/>
185+ <arg name="purpose" type="uint" enum="zwp_text_input_v3.content_purpose"/>
186+ </event>
187+
188+ <event name="done">
189+ <description summary="apply state">
190+ Atomically applies state changes recently sent to the client.
191+
192+ The done event establishes and updates the state of the client, and
193+ must be issued after any changes to apply them.
194+
195+ Text input state (content purpose, content hint, surrounding text, and
196+ change cause) is conceptually double-buffered within an input method
197+ context.
198+
199+ Events modify the pending state, as opposed to the current state in use
200+ by the input method. A done event atomically applies all pending state,
201+ replacing the current state. After done, the new pending state is as
202+ documented for each related request.
203+
204+ Events must be applied in the order of arrival.
205+
206+ Neither current nor pending state are modified unless noted otherwise.
207+ </description>
208+ </event>
209+
210+ <request name="commit_string">
211+ <description summary="commit string">
212+ Send the commit string text for insertion to the application.
213+
214+ Inserts a string at current cursor position (see commit event
215+ sequence). The string to commit could be either just a single character
216+ after a key press or the result of some composing.
217+
218+ The argument text is a buffer containing the string to insert. There is
219+ a maximum length of wayland messages, so text can not be longer than
220+ 4000 bytes.
221+
222+ Values set with this event are double-buffered. They must be applied
223+ and reset to initial on the next zwp_text_input_v3.commit request.
224+
225+ The initial value of text is an empty string.
226+ </description>
227+ <arg name="text" type="string"/>
228+ </request>
229+
230+ <request name="set_preedit_string">
231+ <description summary="pre-edit string">
232+ Send the pre-edit string text to the application text input.
233+
234+ Place a new composing text (pre-edit) at the current cursor position.
235+ Any previously set composing text must be removed. Any previously
236+ existing selected text must be removed. The cursor is moved to a new
237+ position within the preedit string.
238+
239+ The argument text is a buffer containing the preedit string. There is
240+ a maximum length of wayland messages, so text can not be longer than
241+ 4000 bytes.
242+
243+ The arguments cursor_begin and cursor_end are counted in bytes relative
244+ to the beginning of the submitted string buffer. Cursor should be
245+ hidden by the text input when both are equal to -1.
246+
247+ cursor_begin indicates the beginning of the cursor. cursor_end
248+ indicates the end of the cursor. It may be equal or different than
249+ cursor_begin.
250+
251+ Values set with this event are double-buffered. They must be applied on
252+ the next zwp_input_method_v2.commit event.
253+
254+ The initial value of text is an empty string. The initial value of
255+ cursor_begin, and cursor_end are both 0.
256+ </description>
257+ <arg name="text" type="string"/>
258+ <arg name="cursor_begin" type="int"/>
259+ <arg name="cursor_end" type="int"/>
260+ </request>
261+
262+ <request name="delete_surrounding_text">
263+ <description summary="delete text">
264+ Remove the surrounding text.
265+
266+ before_length and after_length are the number of bytes before and after
267+ the current cursor index (excluding the preedit text) to delete.
268+
269+ If any preedit text is present, it is replaced with the cursor for the
270+ purpose of this event. In effect before_length is counted from the
271+ beginning of preedit text, and after_length from its end (see commit
272+ event sequence).
273+
274+ Values set with this event are double-buffered. They must be applied
275+ and reset to initial on the next zwp_input_method_v2.commit request.
276+
277+ The initial values of both before_length and after_length are 0.
278+ </description>
279+ <arg name="before_length" type="uint"/>
280+ <arg name="after_length" type="uint"/>
281+ </request>
282+
283+ <request name="commit">
284+ <description summary="apply state">
285+ Apply state changes from commit_string, set_preedit_string and
286+ delete_surrounding_text requests.
287+
288+ The state relating to these events is double-buffered, and each one
289+ modifies the pending state. This request replaces the current state
290+ with the pending state.
291+
292+ The connected text input is expected to proceed by evaluating the
293+ changes in the following order:
294+
295+ 1. Replace existing preedit string with the cursor.
296+ 2. Delete requested surrounding text.
297+ 3. Insert commit string with the cursor at its end.
298+ 4. Calculate surrounding text to send.
299+ 5. Insert new preedit text in cursor position.
300+ 6. Place cursor inside preedit text.
301+
302+ The serial number reflects the last state of the zwp_input_method_v2
303+ object known to the client. The value of the serial argument must be
304+ equal to the number of done events already issued by that object. When
305+ the compositor receives a commit request with a serial different than
306+ the number of past done events, it must proceed as normal, except it
307+ should not change the current state of the zwp_input_method_v2 object.
308+ </description>
309+ <arg name="serial" type="uint"/>
310+ </request>
311+
312+ <request name="get_input_popup_surface">
313+ <description summary="create popup surface">
314+ Creates a new zwp_input_popup_surface_v2 object wrapping a given
315+ surface.
316+
317+ The surface gets assigned the "input_popup" role. If the surface
318+ already has an assigned role, the compositor must issue a protocol
319+ error.
320+ </description>
321+ <arg name="id" type="new_id" interface="zwp_input_popup_surface_v2"/>
322+ <arg name="surface" type="object" interface="wl_surface"/>
323+ </request>
324+
325+ <request name="grab_keyboard">
326+ <description summary="grab hardware keyboard">
327+ Allow an input method to receive hardware keyboard input and process
328+ key events to generate text events (with pre-edit) over the wire. This
329+ allows input methods which compose multiple key events for inputting
330+ text like it is done for CJK languages.
331+
332+ The compositor should send all keyboard events on the seat to the grab
333+ holder via the returned wl_keyboard object. Nevertheless, the
334+ compositor may decide not to forward any particular event. The
335+ compositor must not further process any event after it has been
336+ forwarded to the grab holder.
337+
338+ Releasing the resulting wl_keyboard object releases the grab.
339+ </description>
340+ <arg name="keyboard" type="new_id"
341+ interface="zwp_input_method_keyboard_grab_v2"/>
342+ </request>
343+
344+ <event name="unavailable">
345+ <description summary="input method unavailable">
346+ The input method ceased to be available.
347+
348+ The compositor must issue this event as the only event on the object if
349+ there was another input_method object associated with the same seat at
350+ the time of its creation.
351+
352+ The compositor must issue this request when the object is no longer
353+ usable, e.g. due to seat removal.
354+
355+ The input method context becomes inert and should be destroyed after
356+ deactivation is handled. Any further requests and events except for the
357+ destroy request must be ignored.
358+ </description>
359+ </event>
360+
361+ <request name="destroy" type="destructor">
362+ <description summary="destroy the text input">
363+ Destroys the zwp_text_input_v2 object and any associated child
364+ objects, i.e. zwp_input_popup_surface_v2 and
365+ zwp_input_method_keyboard_grab_v2.
366+ </description>
367+ </request>
368+ </interface>
369+
370+ <interface name="zwp_input_popup_surface_v2" version="1">
371+ <description summary="popup surface">
372+ This interface marks a surface as a popup for interacting with an input
373+ method.
374+
375+ The compositor should place it near the active text input area. It must
376+ be visible if and only if the input method is in the active state.
377+
378+ The client must not destroy the underlying wl_surface while the
379+ zwp_input_popup_surface_v2 object exists.
380+ </description>
381+
382+ <event name="text_input_rectangle">
383+ <description summary="set text input area position">
384+ Notify about the position of the area of the text input expressed as a
385+ rectangle in surface local coordinates.
386+
387+ This is a hint to the input method telling it the relative position of
388+ the text being entered.
389+ </description>
390+ <arg name="x" type="int"/>
391+ <arg name="y" type="int"/>
392+ <arg name="width" type="int"/>
393+ <arg name="height" type="int"/>
394+ </event>
395+
396+ <request name="destroy" type="destructor"/>
397+ </interface>
398+
399+ <interface name="zwp_input_method_keyboard_grab_v2" version="1">
400+ <!-- Closely follows wl_keyboard version 6 -->
401+ <description summary="keyboard grab">
402+ The zwp_input_method_keyboard_grab_v2 interface represents an exclusive
403+ grab of the wl_keyboard interface associated with the seat.
404+ </description>
405+
406+ <event name="keymap">
407+ <description summary="keyboard mapping">
408+ This event provides a file descriptor to the client which can be
409+ memory-mapped to provide a keyboard mapping description.
410+ </description>
411+ <arg name="format" type="uint" enum="wl_keyboard.keymap_format"
412+ summary="keymap format"/>
413+ <arg name="fd" type="fd" summary="keymap file descriptor"/>
414+ <arg name="size" type="uint" summary="keymap size, in bytes"/>
415+ </event>
416+
417+ <event name="key">
418+ <description summary="key event">
419+ A key was pressed or released.
420+ The time argument is a timestamp with millisecond granularity, with an
421+ undefined base.
422+ </description>
423+ <arg name="serial" type="uint" summary="serial number of the key event"/>
424+ <arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
425+ <arg name="key" type="uint" summary="key that produced the event"/>
426+ <arg name="state" type="uint" enum="wl_keyboard.key_state"
427+ summary="physical state of the key"/>
428+ </event>
429+
430+ <event name="modifiers">
431+ <description summary="modifier and group state">
432+ Notifies clients that the modifier and/or group state has changed, and
433+ it should update its local state.
434+ </description>
435+ <arg name="serial" type="uint" summary="serial number of the modifiers event"/>
436+ <arg name="mods_depressed" type="uint" summary="depressed modifiers"/>
437+ <arg name="mods_latched" type="uint" summary="latched modifiers"/>
438+ <arg name="mods_locked" type="uint" summary="locked modifiers"/>
439+ <arg name="group" type="uint" summary="keyboard layout"/>
440+ </event>
441+
442+ <request name="release" type="destructor">
443+ <description summary="release the grab object"/>
444+ </request>
445+
446+ <event name="repeat_info">
447+ <description summary="repeat rate and delay">
448+ Informs the client about the keyboard's repeat rate and delay.
449+
450+ This event is sent as soon as the zwp_input_method_keyboard_grab_v2
451+ object has been created, and is guaranteed to be received by the
452+ client before any key press event.
453+
454+ Negative values for either rate or delay are illegal. A rate of zero
455+ will disable any repeating (regardless of the value of delay).
456+
457+ This event can be sent later on as well with a new value if necessary,
458+ so clients should continue listening for the event past the creation
459+ of zwp_input_method_keyboard_grab_v2.
460+ </description>
461+ <arg name="rate" type="int"
462+ summary="the rate of repeating keys in characters per second"/>
463+ <arg name="delay" type="int"
464+ summary="delay in milliseconds since key down until repeating starts"/>
465+ </event>
466+ </interface>
467+
468+ <interface name="zwp_input_method_manager_v2" version="1">
469+ <description summary="input method manager">
470+ The input method manager allows the client to become the input method on
471+ a chosen seat.
472+
473+ No more than one input method must be associated with any seat at any
474+ given time.
475+ </description>
476+
477+ <request name="get_input_method">
478+ <description summary="request an input method object">
479+ Request a new input zwp_input_method_v2 object associated with a given
480+ seat.
481+ </description>
482+ <arg name="seat" type="object" interface="wl_seat"/>
483+ <arg name="input_method" type="new_id" interface="zwp_input_method_v2"/>
484+ </request>
485+
486+ <request name="destroy" type="destructor">
487+ <description summary="destroy the input method manager">
488+ Destroys the zwp_input_method_manager_v2 object.
489+
490+ The zwp_input_method_v2 objects originating from it remain valid.
491+ </description>
492+ </request>
493+ </interface>
494+</protocol>
A protocols/pointer-warp-v1.xml +72 -0
@@ -0,0 +1,72 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<protocol name="pointer_warp_v1">
3+ <copyright>
4+ Copyright © 2024 Neal Gompa
5+ Copyright © 2024 Xaver Hugl
6+ Copyright © 2024 Matthias Klumpp
7+ Copyright © 2024 Vlad Zahorodnii
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+ 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+ 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="wp_pointer_warp_v1" version="1">
28+ <description summary="reposition the pointer to a location on a surface">
29+ This global interface allows applications to request the pointer to be
30+ moved to a position relative to a wl_surface.
31+
32+ Note that if the desired behavior is to constrain the pointer to an area
33+ or lock it to a position, this protocol does not provide a reliable way
34+ to do that. The pointer constraint and pointer lock protocols should be
35+ used for those use cases instead.
36+
37+ Warning! The protocol described in this file is currently in the testing
38+ phase. Backward compatible changes may be added together with the
39+ corresponding interface version bump. Backward incompatible changes can
40+ only be done by creating a new major version of the extension.
41+ </description>
42+
43+ <request name="destroy" type="destructor">
44+ <description summary="destroy the warp manager">
45+ Destroy the pointer warp manager.
46+ </description>
47+ </request>
48+
49+ <request name="warp_pointer">
50+ <description summary="reposition the pointer">
51+ Request the compositor to move the pointer to a surface-local position.
52+ Whether or not the compositor honors the request is implementation defined,
53+ but it should
54+ - honor it if the surface has pointer focus, including
55+ when it has an implicit pointer grab
56+ - reject it if the enter serial is incorrect
57+ - reject it if the requested position is outside of the surface
58+
59+ Note that the enter serial is valid for any surface of the client,
60+ and does not have to be from the surface the pointer is warped to.
61+
62+ </description>
63+ <arg name="surface" type="object" interface="wl_surface"
64+ summary="surface to position the pointer on"/>
65+ <arg name="pointer" type="object" interface="wl_pointer"
66+ summary="the pointer that should be repositioned"/>
67+ <arg name="x" type="fixed"/>
68+ <arg name="y" type="fixed"/>
69+ <arg name="serial" type="uint" summary="serial number of the enter event"/>
70+ </request>
71+ </interface>
72+</protocol>
A protocols/security-context-v1.xml +180 -0
@@ -0,0 +1,180 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<protocol name="security_context_v1">
3+ <copyright>
4+ Copyright © 2021 Simon Ser
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="wp_security_context_manager_v1" version="1">
27+ <description summary="client security context manager">
28+ This interface allows a client to register a new Wayland connection to
29+ the compositor and attach a security context to it.
30+
31+ This is intended to be used by sandboxes. Sandbox engines attach a
32+ security context to all connections coming from inside the sandbox. The
33+ compositor can then restrict the features that the sandboxed connections
34+ can use.
35+
36+ Compositors should forbid nesting multiple security contexts by not
37+ exposing wp_security_context_manager_v1 global to clients with a security
38+ context attached, or by sending the nested protocol error. Nested
39+ security contexts are dangerous because they can potentially allow
40+ privilege escalation of a sandboxed client.
41+
42+ Warning! The protocol described in this file is currently in the testing
43+ phase. Backward compatible changes may be added together with the
44+ corresponding interface version bump. Backward incompatible changes can
45+ only be done by creating a new major version of the extension.
46+ </description>
47+
48+ <enum name="error">
49+ <entry name="invalid_listen_fd" value="1"
50+ summary="listening socket FD is invalid"/>
51+ <entry name="nested" value="2"
52+ summary="nested security contexts are forbidden"/>
53+ </enum>
54+
55+ <request name="destroy" type="destructor">
56+ <description summary="destroy the manager object">
57+ Destroy the manager. This doesn't destroy objects created with the
58+ manager.
59+ </description>
60+ </request>
61+
62+ <request name="create_listener">
63+ <description summary="create a new security context">
64+ Creates a new security context with a socket listening FD.
65+
66+ The compositor will accept new client connections on listen_fd.
67+ listen_fd must be ready to accept new connections when this request is
68+ sent by the client. In other words, the client must call bind(2) and
69+ listen(2) before sending the FD.
70+
71+ close_fd is a FD that will signal hangup when the compositor should stop
72+ accepting new connections on listen_fd.
73+
74+ The compositor must continue to accept connections on listen_fd when
75+ the Wayland client which created the security context disconnects.
76+
77+ After sending this request, closing listen_fd and close_fd remains the
78+ only valid operation on them.
79+ </description>
80+ <arg name="id" type="new_id" interface="wp_security_context_v1"/>
81+ <arg name="listen_fd" type="fd" summary="listening socket FD"/>
82+ <arg name="close_fd" type="fd" summary="FD signaling when done"/>
83+ </request>
84+ </interface>
85+
86+ <interface name="wp_security_context_v1" version="1">
87+ <description summary="client security context">
88+ The security context allows a client to register a new client and attach
89+ security context metadata to the connections.
90+
91+ When both are set, the combination of the application ID and the sandbox
92+ engine must uniquely identify an application. The same application ID
93+ will be used across instances (e.g. if the application is restarted, or
94+ if the application is started multiple times).
95+
96+ When both are set, the combination of the instance ID and the sandbox
97+ engine must uniquely identify a running instance of an application.
98+ </description>
99+
100+ <enum name="error">
101+ <entry name="already_used" value="1"
102+ summary="security context has already been committed"/>
103+ <entry name="already_set" value="2"
104+ summary="metadata has already been set"/>
105+ <entry name="invalid_metadata" value="3"
106+ summary="metadata is invalid"/>
107+ </enum>
108+
109+ <request name="destroy" type="destructor">
110+ <description summary="destroy the security context object">
111+ Destroy the security context object.
112+ </description>
113+ </request>
114+
115+ <request name="set_sandbox_engine">
116+ <description summary="set the sandbox engine">
117+ Attach a unique sandbox engine name to the security context. The name
118+ should follow the reverse-DNS style (e.g. "org.flatpak").
119+
120+ A list of well-known engines is maintained at:
121+ https://gitlab.freedesktop.org/wayland/wayland-protocols/-/blob/main/staging/security-context/engines.md
122+
123+ It is a protocol error to call this request twice. The already_set
124+ error is sent in this case.
125+ </description>
126+ <arg name="name" type="string" summary="the sandbox engine name"/>
127+ </request>
128+
129+ <request name="set_app_id">
130+ <description summary="set the application ID">
131+ Attach an application ID to the security context.
132+
133+ The application ID is an opaque, sandbox-specific identifier for an
134+ application. See the well-known engines document for more details:
135+ https://gitlab.freedesktop.org/wayland/wayland-protocols/-/blob/main/staging/security-context/engines.md
136+
137+ The compositor may use the application ID to group clients belonging to
138+ the same security context application.
139+
140+ Whether this request is optional or not depends on the sandbox engine used.
141+
142+ It is a protocol error to call this request twice. The already_set
143+ error is sent in this case.
144+ </description>
145+ <arg name="app_id" type="string" summary="the application ID"/>
146+ </request>
147+
148+ <request name="set_instance_id">
149+ <description summary="set the instance ID">
150+ Attach an instance ID to the security context.
151+
152+ The instance ID is an opaque, sandbox-specific identifier for a running
153+ instance of an application. See the well-known engines document for
154+ more details:
155+ https://gitlab.freedesktop.org/wayland/wayland-protocols/-/blob/main/staging/security-context/engines.md
156+
157+ Whether this request is optional or not depends on the sandbox engine used.
158+
159+ It is a protocol error to call this request twice. The already_set
160+ error is sent in this case.
161+ </description>
162+ <arg name="instance_id" type="string" summary="the instance ID"/>
163+ </request>
164+
165+ <request name="commit">
166+ <description summary="register the security context">
167+ Atomically register the new client and attach the security context
168+ metadata.
169+
170+ If the provided metadata is inconsistent or does not match with out of
171+ band metadata (see
172+ https://gitlab.freedesktop.org/wayland/wayland-protocols/-/blob/main/staging/security-context/engines.md),
173+ the invalid_metadata error may be sent eventually.
174+
175+ It's a protocol error to send any request other than "destroy" after
176+ this request. In this case, the already_used error is sent.
177+ </description>
178+ </request>
179+ </interface>
180+</protocol>
A protocols/single-pixel-buffer-v1.xml +76 -0
@@ -0,0 +1,76 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<protocol name="single_pixel_buffer_v1">
3+ <copyright>
4+ Copyright © 2022 Simon Ser
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+ <description summary="single pixel buffer factory">
27+ This protocol extension allows clients to create single-pixel buffers.
28+
29+ Compositors supporting this protocol extension should also support the
30+ viewporter protocol extension. Clients may use viewporter to scale a
31+ single-pixel buffer to a desired size.
32+
33+ Warning! The protocol described in this file is currently in the testing
34+ phase. Backward compatible changes may be added together with the
35+ corresponding interface version bump. Backward incompatible changes can
36+ only be done by creating a new major version of the extension.
37+ </description>
38+
39+ <interface name="wp_single_pixel_buffer_manager_v1" version="1">
40+ <description summary="global factory for single-pixel buffers">
41+ The wp_single_pixel_buffer_manager_v1 interface is a factory for
42+ single-pixel buffers.
43+ </description>
44+
45+ <request name="destroy" type="destructor">
46+ <description summary="destroy the manager">
47+ Destroy the wp_single_pixel_buffer_manager_v1 object.
48+
49+ The child objects created via this interface are unaffected.
50+ </description>
51+ </request>
52+
53+ <request name="create_u32_rgba_buffer">
54+ <description summary="create a 1×1 buffer from 32-bit RGBA values">
55+ Create a single-pixel buffer from four 32-bit RGBA values.
56+
57+ Unless specified in another protocol extension, the RGBA values use
58+ pre-multiplied alpha.
59+
60+ The width and height of the buffer are 1.
61+
62+ The r, g, b and a arguments valid range is from UINT32_MIN (0)
63+ to UINT32_MAX (0xffffffff).
64+
65+ These arguments should be interpreted as a percentage, i.e.
66+ - UINT32_MIN = 0% of the given color component
67+ - UINT32_MAX = 100% of the given color component
68+ </description>
69+ <arg name="id" type="new_id" interface="wl_buffer"/>
70+ <arg name="r" type="uint" summary="value of the buffer's red channel"/>
71+ <arg name="g" type="uint" summary="value of the buffer's green channel"/>
72+ <arg name="b" type="uint" summary="value of the buffer's blue channel"/>
73+ <arg name="a" type="uint" summary="value of the buffer's alpha channel"/>
74+ </request>
75+ </interface>
76+</protocol>
A protocols/text-input-unstable-v3.xml +604 -0
@@ -0,0 +1,604 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+
3+<protocol name="text_input_unstable_v3">
4+ <copyright>
5+ Copyright © 2012, 2013 Intel Corporation
6+ Copyright © 2015, 2016 Jan Arne Petersen
7+ Copyright © 2017, 2018 Red Hat, Inc.
8+ Copyright © 2018 Purism SPC
9+
10+ Permission to use, copy, modify, distribute, and sell this
11+ software and its documentation for any purpose is hereby granted
12+ without fee, provided that the above copyright notice appear in
13+ all copies and that both that copyright notice and this permission
14+ notice appear in supporting documentation, and that the name of
15+ the copyright holders not be used in advertising or publicity
16+ pertaining to distribution of the software without specific,
17+ written prior permission. The copyright holders make no
18+ representations about the suitability of this software for any
19+ purpose. It is provided "as is" without express or implied
20+ warranty.
21+
22+ THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
23+ SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
24+ FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
25+ SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
26+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
27+ AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
28+ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
29+ THIS SOFTWARE.
30+ </copyright>
31+
32+ <description summary="Protocol for composing text">
33+ This protocol allows compositors to act as input methods and to send text
34+ to applications. A text input object is used to manage state of what are
35+ typically text entry fields in the application.
36+
37+ This document adheres to the RFC 2119 when using words like "must",
38+ "should", "may", etc.
39+
40+ Warning! The protocol described in this file is experimental and
41+ backward incompatible changes may be made. Backward compatible changes
42+ may be added together with the corresponding interface version bump.
43+ Backward incompatible changes are done by bumping the version number in
44+ the protocol and interface names and resetting the interface version.
45+ Once the protocol is to be declared stable, the 'z' prefix and the
46+ version number in the protocol and interface names are removed and the
47+ interface version number is reset.
48+ </description>
49+
50+ <interface name="zwp_text_input_v3" version="2">
51+ <description summary="text input">
52+ The zwp_text_input_v3 interface represents text input and input methods
53+ associated with a seat. It provides enter/leave events to follow the
54+ text input focus for a seat.
55+
56+ Requests are used to enable/disable the text-input object and set
57+ state information like surrounding and selected text or the content type.
58+ The information about the entered text is sent to the text-input object
59+ via the preedit_string and commit_string events.
60+
61+ Text is valid UTF-8 encoded, indices and lengths are in bytes. Indices
62+ must not point to middle bytes inside a code point: they must either
63+ point to the first byte of a code point or to the end of the buffer.
64+ Lengths must be measured between two valid indices.
65+
66+ Focus moving throughout surfaces will result in the emission of
67+ zwp_text_input_v3.enter and zwp_text_input_v3.leave events. The focused
68+ surface must commit zwp_text_input_v3.enable and
69+ zwp_text_input_v3.disable requests as the keyboard focus moves across
70+ editable and non-editable elements of the UI. Those two requests are not
71+ expected to be paired with each other, the compositor must be able to
72+ handle consecutive series of the same request.
73+
74+ State is sent by the state requests (set_surrounding_text,
75+ set_content_type and set_cursor_rectangle) and a commit request. After an
76+ enter event or disable request all state information is invalidated and
77+ needs to be resent by the client.
78+ </description>
79+
80+ <request name="destroy" type="destructor">
81+ <description summary="Destroy the wp_text_input">
82+ Destroy the wp_text_input object. Also disables all surfaces enabled
83+ through this wp_text_input object.
84+ </description>
85+ </request>
86+
87+ <request name="enable">
88+ <description summary="Request text input to be enabled">
89+ Requests text input on the surface previously obtained from the enter
90+ event.
91+
92+ This request must be issued every time the focused text input changes
93+ to a new one, including within the current surface. Use
94+ zwp_text_input_v3.disable when there is no longer any input focus on
95+ the current surface.
96+
97+ Clients must not enable more than one text input on the single seat
98+ and should disable the current text input before enabling the new one.
99+ Requests to enable a text input when another text input is enabled
100+ on the same seat must be ignored by compositor.
101+
102+ This request resets all state associated with previous enable, disable,
103+ set_surrounding_text, set_text_change_cause, set_content_type, and
104+ set_cursor_rectangle requests, as well as the state associated with
105+ preedit_string, commit_string, and delete_surrounding_text events.
106+
107+ The set_surrounding_text, set_content_type and set_cursor_rectangle
108+ requests must follow if the text input supports the necessary
109+ functionality.
110+
111+ State set with this request is double-buffered. It will get applied on
112+ the next zwp_text_input_v3.commit request, and stay valid until the
113+ next committed enable or disable request.
114+
115+ The changes must be applied by the compositor after issuing a
116+ zwp_text_input_v3.commit request.
117+ </description>
118+ </request>
119+
120+ <request name="disable">
121+ <description summary="Disable text input on a surface">
122+ Explicitly disable text input on the current surface (typically when
123+ there is no focus on any text entry inside the surface).
124+
125+ State set with this request is double-buffered. It will get applied on
126+ the next zwp_text_input_v3.commit request.
127+ </description>
128+ </request>
129+
130+ <request name="set_surrounding_text">
131+ <description summary="sets the surrounding text">
132+ Sets the surrounding plain text around the input, excluding the preedit
133+ text.
134+
135+ The client should notify the compositor of any changes in any of the
136+ values carried with this request, including changes caused by handling
137+ incoming text-input events as well as changes caused by other
138+ mechanisms like keyboard typing.
139+
140+ If the client is unaware of the text around the cursor, it should not
141+ issue this request, to signify lack of support to the compositor.
142+
143+ Text is UTF-8 encoded, and should include the cursor position, the
144+ complete selection and additional characters before and after them.
145+ There is a maximum length of wayland messages, so text can not be
146+ longer than 4000 bytes.
147+
148+ Cursor is the byte offset of the cursor within text buffer.
149+
150+ Anchor is the byte offset of the selection anchor within text buffer.
151+ If there is no selected text, anchor is the same as cursor.
152+
153+ If any preedit text is present, it is replaced with a cursor for the
154+ purpose of this event.
155+
156+ Values set with this request are double-buffered. They will get applied
157+ on the next zwp_text_input_v3.commit request, and stay valid until the
158+ next committed enable or disable request.
159+
160+ The initial state for affected fields is empty, meaning that the text
161+ input does not support sending surrounding text. If the empty values
162+ get applied, subsequent attempts to change them may have no effect.
163+ </description>
164+ <arg name="text" type="string"/>
165+ <arg name="cursor" type="int"/>
166+ <arg name="anchor" type="int"/>
167+ </request>
168+
169+ <enum name="change_cause">
170+ <description summary="text change reason">
171+ Reason for the change of surrounding text or cursor posision.
172+ </description>
173+ <entry name="input_method" value="0" summary="input method caused the change"/>
174+ <entry name="other" value="1" summary="something else than the input method caused the change"/>
175+ </enum>
176+
177+ <request name="set_text_change_cause">
178+ <description summary="indicates the cause of surrounding text change">
179+ Tells the compositor why the text surrounding the cursor changed.
180+
181+ Whenever the client detects an external change in text, cursor, or
182+ anchor posision, it must issue this request to the compositor. This
183+ request is intended to give the input method a chance to update the
184+ preedit text in an appropriate way, e.g. by removing it when the user
185+ starts typing with a keyboard.
186+
187+ cause describes the source of the change.
188+
189+ The value set with this request is double-buffered. It must be applied
190+ and reset to initial at the next zwp_text_input_v3.commit request.
191+
192+ The initial value of cause is input_method.
193+ </description>
194+ <arg name="cause" type="uint" enum="change_cause"/>
195+ </request>
196+
197+ <enum name="content_hint" bitfield="true">
198+ <description summary="content hint">
199+ Content hint is a bitmask to allow to modify the behavior of the text
200+ input.
201+ </description>
202+ <entry name="none" value="0x0" summary="no special behavior"/>
203+ <entry name="completion" value="0x1" summary="suggest word completions"/>
204+ <entry name="spellcheck" value="0x2" summary="suggest word corrections"/>
205+ <entry name="auto_capitalization" value="0x4" summary="switch to uppercase letters at the start of a sentence"/>
206+ <entry name="lowercase" value="0x8" summary="prefer lowercase letters"/>
207+ <entry name="uppercase" value="0x10" summary="prefer uppercase letters"/>
208+ <entry name="titlecase" value="0x20" summary="prefer casing for titles and headings (can be language dependent)"/>
209+ <entry name="hidden_text" value="0x40" summary="characters should be hidden"/>
210+ <entry name="sensitive_data" value="0x80" summary="typed text should not be stored"/>
211+ <entry name="latin" value="0x100" summary="just Latin characters should be entered"/>
212+ <entry name="multiline" value="0x200" summary="the text input is multiline"/>
213+ <entry
214+ name="on_screen_input_provided" value="0x400" since="2"
215+ summary="an on-screen way to fill in the input is already provided by the client"/>
216+ <entry
217+ name="no_emoji" value="0x800" since="2"
218+ summary="prefer not offering emoji support"/>
219+ <entry
220+ name="preedit_shown" value="0x1000" since="2"
221+ summary="the text input will display preedit text in place"/>
222+ </enum>
223+
224+ <enum name="content_purpose">
225+ <description summary="content purpose">
226+ The content purpose allows to specify the primary purpose of a text
227+ input.
228+
229+ This allows an input method to show special purpose input panels with
230+ extra characters or to disallow some characters.
231+ </description>
232+ <entry name="normal" value="0" summary="default input, allowing all characters"/>
233+ <entry name="alpha" value="1" summary="allow only alphabetic characters"/>
234+ <entry name="digits" value="2" summary="allow only digits"/>
235+ <entry name="number" value="3" summary="input a number (including decimal separator and sign)"/>
236+ <entry name="phone" value="4" summary="input a phone number"/>
237+ <entry name="url" value="5" summary="input an URL"/>
238+ <entry name="email" value="6" summary="input an email address"/>
239+ <entry name="name" value="7" summary="input a name of a person"/>
240+ <entry name="password" value="8" summary="input a password (combine with sensitive_data hint)"/>
241+ <entry name="pin" value="9" summary="input is a numeric password (combine with sensitive_data hint)"/>
242+ <entry name="date" value="10" summary="input a date"/>
243+ <entry name="time" value="11" summary="input a time"/>
244+ <entry name="datetime" value="12" summary="input a date and time"/>
245+ <entry name="terminal" value="13" summary="input for a terminal"/>
246+ </enum>
247+
248+ <request name="set_content_type">
249+ <description summary="set content purpose and hint">
250+ Sets the content purpose and content hint. While the purpose is the
251+ basic purpose of an input field, the hint flags allow to modify some of
252+ the behavior.
253+
254+ Values set with this request are double-buffered. They will get applied
255+ on the next zwp_text_input_v3.commit request.
256+ Subsequent attempts to update them may have no effect. The values
257+ remain valid until the next committed enable or disable request.
258+
259+ The initial value for hint is none, and the initial value for purpose
260+ is normal.
261+ </description>
262+ <arg name="hint" type="uint" enum="content_hint"/>
263+ <arg name="purpose" type="uint" enum="content_purpose"/>
264+ </request>
265+
266+ <request name="set_cursor_rectangle">
267+ <description summary="set cursor position">
268+ Marks an area around the cursor as a x, y, width, height rectangle in
269+ surface local coordinates.
270+
271+ Allows the compositor to put a window with word suggestions near the
272+ cursor, without obstructing the text being input.
273+
274+ If the client is unaware of the position of edited text, it should not
275+ issue this request, to signify lack of support to the compositor.
276+
277+ Values set with this request are double-buffered. They will get applied
278+ on the next zwp_text_input_v3.commit request, and stay valid until the
279+ next committed enable or disable request.
280+
281+ The initial values describing a cursor rectangle are empty. That means
282+ the text input does not support describing the cursor area. If the
283+ empty values get applied, subsequent attempts to change them may have
284+ no effect.
285+
286+ As of version 2, the zwp_text_input_v3.commit request does not apply
287+ values sent with this request. Instead, it stores them in a separate
288+ "committed" area. The committed values, if still valid, get applied on
289+ the next wl_surface.commit request on the surface with text-input focus.
290+ Both committed and applied values get invalidated on:
291+
292+ - the next committed enable or disable request, or
293+ - a change of the focused surface of the text-input (leave or enter events).
294+
295+ This double stage application allows the compositor to position
296+ the input method popup in the same frame as the contents
297+ of the text on the surface are updated.
298+ </description>
299+ <arg name="x" type="int"/>
300+ <arg name="y" type="int"/>
301+ <arg name="width" type="int"/>
302+ <arg name="height" type="int"/>
303+ </request>
304+
305+ <request name="commit">
306+ <description summary="commit state">
307+ Atomically applies state changes recently sent to the compositor.
308+
309+ The commit request establishes and updates the state of the client, and
310+ must be issued after any changes to apply them.
311+
312+ Text input state (enabled status, content purpose, content hint,
313+ surrounding text and change cause, cursor rectangle) is conceptually
314+ double-buffered within the context of a text input, i.e. between a
315+ committed enable request and the following committed enable or disable
316+ request.
317+
318+ Protocol requests modify the pending state, as opposed to the current
319+ state in use by the input method. A commit request atomically applies
320+ all pending state, replacing the current state. After commit, the new
321+ pending state is as documented for each related request.
322+
323+ Requests are applied in the order of arrival.
324+
325+ Neither current nor pending state are modified unless noted otherwise.
326+
327+ The compositor must count the number of commit requests coming from
328+ each zwp_text_input_v3 object and use the count as the serial in done
329+ events.
330+ </description>
331+ </request>
332+
333+ <event name="enter">
334+ <description summary="enter event">
335+ Notification that this seat's text-input focus is on a certain surface.
336+
337+ If client has created multiple text input objects, compositor must send
338+ this event to all of them.
339+
340+ When the seat has the keyboard capability the text-input focus follows
341+ the keyboard focus. This event sets the current surface for the
342+ text-input object.
343+ </description>
344+ <arg name="surface" type="object" interface="wl_surface"/>
345+ </event>
346+
347+ <event name="leave">
348+ <description summary="leave event">
349+ Notification that this seat's text-input focus is no longer on a
350+ certain surface. The client should reset any preedit string previously
351+ set.
352+
353+ The leave notification clears the current surface. It is sent before
354+ the enter notification for the new focus. After leave event, compositor
355+ must ignore requests from any text input instances until next enter
356+ event.
357+
358+ When the seat has the keyboard capability the text-input focus follows
359+ the keyboard focus.
360+ </description>
361+ <arg name="surface" type="object" interface="wl_surface"/>
362+ </event>
363+
364+ <event name="preedit_string">
365+ <description summary="pre-edit">
366+ Notify when a new composing text (pre-edit) should be set at the
367+ current cursor position. Any previously set composing text must be
368+ removed. Any previously existing selected text must be removed.
369+
370+ The argument text contains the pre-edit string buffer.
371+
372+ The parameters cursor_begin and cursor_end are counted in bytes
373+ relative to the beginning of the submitted text buffer. Cursor should
374+ be hidden when both are equal to -1.
375+
376+ They could be represented by the client as a line if both values are
377+ the same, or as a text highlight otherwise.
378+
379+ Values set with this event are double-buffered. They must be applied
380+ and reset to initial on the next zwp_text_input_v3.done event.
381+
382+ The initial value of text is an empty string, and cursor_begin,
383+ cursor_end and cursor_hidden are all 0.
384+ </description>
385+ <arg name="text" type="string" allow-null="true"/>
386+ <arg name="cursor_begin" type="int"/>
387+ <arg name="cursor_end" type="int"/>
388+ </event>
389+
390+ <event name="commit_string">
391+ <description summary="text commit">
392+ Notify when text should be inserted into the editor widget. The text to
393+ commit could be either just a single character after a key press or the
394+ result of some composing (pre-edit).
395+
396+ Values set with this event are double-buffered. They must be applied
397+ and reset to initial on the next zwp_text_input_v3.done event.
398+
399+ The initial value of text is an empty string.
400+ </description>
401+ <arg name="text" type="string" allow-null="true"/>
402+ </event>
403+
404+ <event name="delete_surrounding_text">
405+ <description summary="delete surrounding text">
406+ Notify when the text around the current cursor position should be
407+ deleted.
408+
409+ Before_length and after_length are the number of bytes before and after
410+ the current cursor index (excluding the selection) to delete.
411+
412+ If a preedit text is present, in effect before_length is counted from
413+ the beginning of it, and after_length from its end (see done event
414+ sequence).
415+
416+ Values set with this event are double-buffered. They must be applied
417+ and reset to initial on the next zwp_text_input_v3.done event.
418+
419+ The initial values of both before_length and after_length are 0.
420+ </description>
421+ <arg name="before_length" type="uint" summary="length of text before current cursor position"/>
422+ <arg name="after_length" type="uint" summary="length of text after current cursor position"/>
423+ </event>
424+
425+ <event name="done">
426+ <description summary="apply changes">
427+ Instruct the application to apply changes to state requested by the
428+ preedit_string, commit_string delete_surrounding_text, and action
429+ events.
430+
431+ The state relating to these events is double-buffered, and each one
432+ modifies the pending state. This event replaces the current state with
433+ the pending state.
434+
435+ The application must proceed by evaluating the changes in the following
436+ order:
437+
438+ 1. Replace existing preedit string with the cursor.
439+ 2. Delete requested surrounding text.
440+ 3. Insert commit string with the cursor at its end.
441+ 4. Calculate surrounding text to send.
442+ 5. Insert new preedit text in cursor position.
443+ 6. Place cursor inside preedit text.
444+ 7. Perform the requested action.
445+
446+ The serial number reflects the last state of the zwp_text_input_v3
447+ object known to the compositor. The value of the serial argument must
448+ be equal to the number of commit requests already issued on that object.
449+
450+ When the client receives a done event with a serial different than the
451+ number of past commit requests, it must proceed with evaluating and
452+ applying the changes as normal, except it should not change the current
453+ state of the zwp_text_input_v3 object. All pending state requests
454+ (set_surrounding_text, set_content_type and set_cursor_rectangle) on
455+ the zwp_text_input_v3 object should be sent and committed after
456+ receiving a zwp_text_input_v3.done event with a matching serial.
457+ </description>
458+ <arg name="serial" type="uint"/>
459+ </event>
460+
461+ <!-- Version 2 additions -->
462+ <enum name="error" since="2">
463+ <entry name="invalid_action" value="0" summary="an invalid or duplicate action was specified"/>
464+ </enum>
465+
466+ <enum name="action" since="2">
467+ <description summary="action">
468+ A possible action to perform on a text input.
469+
470+ The submit action is intended for input entries that expect some sort of
471+ activation after user interaction, e.g. the URL entry in a browser.
472+ </description>
473+ <entry name="none" value="0" summary="no action"/>
474+ <entry name="submit" value="1" summary="the action is submitted"/>
475+ </enum>
476+
477+ <event name="action" since="2">
478+ <description summary="action performed">
479+ An action was performed on this text input.
480+
481+ Values set with this event are double-buffered. They must be applied
482+ and reset to initial on the next zwp_text_input_v3.done event.
483+
484+ The initial value of action is none.
485+ </description>
486+ <arg name="action" type="uint" enum="action" summary="action performed"/>
487+ <arg name="serial" type="uint" summary="serial number of the action event"/>
488+ </event>
489+
490+ <event name="language" since="2">
491+ <description summary="notify of language selection">
492+ Notify the application of language used by the input method.
493+
494+ This event will be sent on creation if known and for all subsequent changes.
495+
496+ The language should be specified as an IETF BCP 47 tag.
497+ Setting an empty string will reset any known language back to the default unknown state.
498+ </description>
499+ <arg name="language" type="string" summary="new language set by IME"/>
500+ </event>
501+
502+ <request name="set_available_actions" since="2">
503+ <description summary="set the available actions">
504+ Set the actions available for this text input.
505+
506+ Values set with this request are double-buffered. They will get applied
507+ on the next zwp_text_input_v3.commit request.
508+
509+ If the available_actions array contains the none action, or contains the
510+ same action multiple times, the compositor must raise the invalid_action
511+ protocol error.
512+
513+ Initially, no actions are available.
514+ </description>
515+ <arg name="available_actions" type="array" summary="available actions"/>
516+ </request>
517+
518+ <request name="show_input_panel" since="2">
519+ <description summary="show input panel">
520+ Requests an input panel to be shown (e.g. a on-screen keyboard).
521+
522+ This request only hints the desired interaction pattern from the
523+ client side, and its effect may be ignored by compositors given
524+ other environmental factors. Repeated calls will be ignored.
525+ </description>
526+ </request>
527+
528+ <request name="hide_input_panel" since="2">
529+ <description summary="hide input panel">
530+ Requests an input panel to be hidden.
531+
532+ This request only hints the desired interaction pattern from the
533+ client side, and its effect may be ignored by compositors given
534+ other environmental factors. Repeated calls will be ignored.
535+ </description>
536+ </request>
537+
538+ <enum name="preedit_hint">
539+ <description summary="preedit style hint">
540+ Style hints for the preedit string.
541+ </description>
542+ <entry name="whole" value="1" summary="simple pre-edit text style, typically underlined"/>
543+ <entry name="selection" value="2"
544+ summary="hint for a selected piece of text, e.g. per-character navigation and composition"/>
545+ <entry name="prediction" value="3" summary="predicted text, not typed by the user"/>
546+ <entry name="prefix" value="4"
547+ summary="prefixed text not being currently edited, e.g. prior to a 'selection' section"/>
548+ <entry name="suffix" value="5"
549+ summary="suffixed text not being currently edited, e.g. after a 'selection' section"/>
550+ <entry name="spelling_error" value="6" summary="spelling error"/>
551+ <entry name="compose_error" value="7"
552+ summary="wrong composition, e.g. user input that can not be transliterated"/>
553+ </enum>
554+
555+ <event name="preedit_hint" since="2">
556+ <description summary="pre-edit">
557+ Notify of contextual hints for the pre-edit string. This
558+ event is always sent together with a zwp_text_input_v3.preedit_string
559+ event.
560+
561+ The parameters start and end are counted in bytes relative to the
562+ beginning of the text buffer submitted through
563+ zwp_text_input_v3.preedit_string, and represent the substring in the
564+ pre-edit text affected by the hint.
565+
566+ Multiple events may be submitted if the preedit string has different
567+ sections. The extent of hints may overlap. The parts of the preedit
568+ string that are not covered by any zwp_text_input_v3.preedit_hint event,
569+ the text will be considered unhinted. This is also the case if no
570+ preedit_hint event is sent.
571+
572+ Clients should provide recognizable visuals to these hints. if they are
573+ unable to comply with this requisition, it may be preferable for them
574+ keep the preedit_shown content hint disabled.
575+
576+ Values set with this event are double-buffered. They must be applied
577+ and reset on the next zwp_text_input_v3.done event.
578+ </description>
579+ <arg name="start" type="uint" summary="starting point of the affected substring"/>
580+ <arg name="end" type="uint" summary="end point of the affected substring"/>
581+ <arg name="hint" type="uint" enum="preedit_hint" summary="hint to apply"/>
582+ </event>
583+ </interface>
584+
585+ <interface name="zwp_text_input_manager_v3" version="2">
586+ <description summary="text input manager">
587+ A factory for text-input objects. This object is a global singleton.
588+ </description>
589+
590+ <request name="destroy" type="destructor">
591+ <description summary="Destroy the wp_text_input_manager">
592+ Destroy the wp_text_input_manager object.
593+ </description>
594+ </request>
595+
596+ <request name="get_text_input">
597+ <description summary="create a new text input object">
598+ Creates a new text-input object for a given seat.
599+ </description>
600+ <arg name="id" type="new_id" interface="zwp_text_input_v3"/>
601+ <arg name="seat" type="object" interface="wl_seat"/>
602+ </request>
603+ </interface>
604+</protocol>
A protocols/wlr-foreign-toplevel-management-unstable-v1.xml +270 -0
@@ -0,0 +1,270 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<protocol name="wlr_foreign_toplevel_management_unstable_v1">
3+ <copyright>
4+ Copyright © 2018 Ilia Bozhinov
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="zwlr_foreign_toplevel_manager_v1" version="3">
29+ <description summary="list and control opened apps">
30+ The purpose of this protocol is to enable the creation of taskbars
31+ and docks by providing them with a list of opened applications and
32+ letting them request certain actions on them, like maximizing, etc.
33+
34+ After a client binds the zwlr_foreign_toplevel_manager_v1, each opened
35+ toplevel window will be sent via the toplevel event
36+ </description>
37+
38+ <event name="toplevel">
39+ <description summary="a toplevel has been created">
40+ This event is emitted whenever a new toplevel window is created. It
41+ is emitted for all toplevels, regardless of the app that has created
42+ them.
43+
44+ All initial details of the toplevel(title, app_id, states, etc.) will
45+ be sent immediately after this event via the corresponding events in
46+ zwlr_foreign_toplevel_handle_v1.
47+ </description>
48+ <arg name="toplevel" type="new_id" interface="zwlr_foreign_toplevel_handle_v1"/>
49+ </event>
50+
51+ <request name="stop">
52+ <description summary="stop sending events">
53+ Indicates the client no longer wishes to receive events for new toplevels.
54+ However the compositor may emit further toplevel_created events, until
55+ the finished event is emitted.
56+
57+ The client must not send any more requests after this one.
58+ </description>
59+ </request>
60+
61+ <event name="finished" type="destructor">
62+ <description summary="the compositor has finished with the toplevel manager">
63+ This event indicates that the compositor is done sending events to the
64+ zwlr_foreign_toplevel_manager_v1. The server will destroy the object
65+ immediately after sending this request, so it will become invalid and
66+ the client should free any resources associated with it.
67+ </description>
68+ </event>
69+ </interface>
70+
71+ <interface name="zwlr_foreign_toplevel_handle_v1" version="3">
72+ <description summary="an opened toplevel">
73+ A zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel
74+ window. Each app may have multiple opened toplevels.
75+
76+ Each toplevel has a list of outputs it is visible on, conveyed to the
77+ client with the output_enter and output_leave events.
78+ </description>
79+
80+ <event name="title">
81+ <description summary="title change">
82+ This event is emitted whenever the title of the toplevel changes.
83+ </description>
84+ <arg name="title" type="string"/>
85+ </event>
86+
87+ <event name="app_id">
88+ <description summary="app-id change">
89+ This event is emitted whenever the app-id of the toplevel changes.
90+ </description>
91+ <arg name="app_id" type="string"/>
92+ </event>
93+
94+ <event name="output_enter">
95+ <description summary="toplevel entered an output">
96+ This event is emitted whenever the toplevel becomes visible on
97+ the given output. A toplevel may be visible on multiple outputs.
98+ </description>
99+ <arg name="output" type="object" interface="wl_output"/>
100+ </event>
101+
102+ <event name="output_leave">
103+ <description summary="toplevel left an output">
104+ This event is emitted whenever the toplevel stops being visible on
105+ the given output. It is guaranteed that an entered-output event
106+ with the same output has been emitted before this event.
107+ </description>
108+ <arg name="output" type="object" interface="wl_output"/>
109+ </event>
110+
111+ <request name="set_maximized">
112+ <description summary="requests that the toplevel be maximized">
113+ Requests that the toplevel be maximized. If the maximized state actually
114+ changes, this will be indicated by the state event.
115+ </description>
116+ </request>
117+
118+ <request name="unset_maximized">
119+ <description summary="requests that the toplevel be unmaximized">
120+ Requests that the toplevel be unmaximized. If the maximized state actually
121+ changes, this will be indicated by the state event.
122+ </description>
123+ </request>
124+
125+ <request name="set_minimized">
126+ <description summary="requests that the toplevel be minimized">
127+ Requests that the toplevel be minimized. If the minimized state actually
128+ changes, this will be indicated by the state event.
129+ </description>
130+ </request>
131+
132+ <request name="unset_minimized">
133+ <description summary="requests that the toplevel be unminimized">
134+ Requests that the toplevel be unminimized. If the minimized state actually
135+ changes, this will be indicated by the state event.
136+ </description>
137+ </request>
138+
139+ <request name="activate">
140+ <description summary="activate the toplevel">
141+ Request that this toplevel be activated on the given seat.
142+ There is no guarantee the toplevel will be actually activated.
143+ </description>
144+ <arg name="seat" type="object" interface="wl_seat"/>
145+ </request>
146+
147+ <enum name="state">
148+ <description summary="types of states on the toplevel">
149+ The different states that a toplevel can have. These have the same meaning
150+ as the states with the same names defined in xdg-toplevel
151+ </description>
152+
153+ <entry name="maximized" value="0" summary="the toplevel is maximized"/>
154+ <entry name="minimized" value="1" summary="the toplevel is minimized"/>
155+ <entry name="activated" value="2" summary="the toplevel is active"/>
156+ <entry name="fullscreen" value="3" summary="the toplevel is fullscreen" since="2"/>
157+ </enum>
158+
159+ <event name="state">
160+ <description summary="the toplevel state changed">
161+ This event is emitted immediately after the zlw_foreign_toplevel_handle_v1
162+ is created and each time the toplevel state changes, either because of a
163+ compositor action or because of a request in this protocol.
164+ </description>
165+
166+ <arg name="state" type="array"/>
167+ </event>
168+
169+ <event name="done">
170+ <description summary="all information about the toplevel has been sent">
171+ This event is sent after all changes in the toplevel state have been
172+ sent.
173+
174+ This allows changes to the zwlr_foreign_toplevel_handle_v1 properties
175+ to be seen as atomic, even if they happen via multiple events.
176+ </description>
177+ </event>
178+
179+ <request name="close">
180+ <description summary="request that the toplevel be closed">
181+ Send a request to the toplevel to close itself. The compositor would
182+ typically use a shell-specific method to carry out this request, for
183+ example by sending the xdg_toplevel.close event. However, this gives
184+ no guarantees the toplevel will actually be destroyed. If and when
185+ this happens, the zwlr_foreign_toplevel_handle_v1.closed event will
186+ be emitted.
187+ </description>
188+ </request>
189+
190+ <request name="set_rectangle">
191+ <description summary="the rectangle which represents the toplevel">
192+ The rectangle of the surface specified in this request corresponds to
193+ the place where the app using this protocol represents the given toplevel.
194+ It can be used by the compositor as a hint for some operations, e.g
195+ minimizing. The client is however not required to set this, in which
196+ case the compositor is free to decide some default value.
197+
198+ If the client specifies more than one rectangle, only the last one is
199+ considered.
200+
201+ The dimensions are given in surface-local coordinates.
202+ Setting width=height=0 removes the already-set rectangle.
203+ </description>
204+
205+ <arg name="surface" type="object" interface="wl_surface"/>
206+ <arg name="x" type="int"/>
207+ <arg name="y" type="int"/>
208+ <arg name="width" type="int"/>
209+ <arg name="height" type="int"/>
210+ </request>
211+
212+ <enum name="error">
213+ <entry name="invalid_rectangle" value="0"
214+ summary="the provided rectangle is invalid"/>
215+ </enum>
216+
217+ <event name="closed">
218+ <description summary="this toplevel has been destroyed">
219+ This event means the toplevel has been destroyed. It is guaranteed there
220+ won't be any more events for this zwlr_foreign_toplevel_handle_v1. The
221+ toplevel itself becomes inert so any requests will be ignored except the
222+ destroy request.
223+ </description>
224+ </event>
225+
226+ <request name="destroy" type="destructor">
227+ <description summary="destroy the zwlr_foreign_toplevel_handle_v1 object">
228+ Destroys the zwlr_foreign_toplevel_handle_v1 object.
229+
230+ This request should be called either when the client does not want to
231+ use the toplevel anymore or after the closed event to finalize the
232+ destruction of the object.
233+ </description>
234+ </request>
235+
236+ <!-- Version 2 additions -->
237+
238+ <request name="set_fullscreen" since="2">
239+ <description summary="request that the toplevel be fullscreened">
240+ Requests that the toplevel be fullscreened on the given output. If the
241+ fullscreen state and/or the outputs the toplevel is visible on actually
242+ change, this will be indicated by the state and output_enter/leave
243+ events.
244+
245+ The output parameter is only a hint to the compositor. Also, if output
246+ is NULL, the compositor should decide which output the toplevel will be
247+ fullscreened on, if at all.
248+ </description>
249+ <arg name="output" type="object" interface="wl_output" allow-null="true"/>
250+ </request>
251+
252+ <request name="unset_fullscreen" since="2">
253+ <description summary="request that the toplevel be unfullscreened">
254+ Requests that the toplevel be unfullscreened. If the fullscreen state
255+ actually changes, this will be indicated by the state event.
256+ </description>
257+ </request>
258+
259+ <!-- Version 3 additions -->
260+
261+ <event name="parent" since="3">
262+ <description summary="parent change">
263+ This event is emitted whenever the parent of the toplevel changes.
264+
265+ No event is emitted when the parent handle is destroyed by the client.
266+ </description>
267+ <arg name="parent" type="object" interface="zwlr_foreign_toplevel_handle_v1" allow-null="true"/>
268+ </event>
269+ </interface>
270+</protocol>
A protocols/wlr-gamma-control-unstable-v1.xml +126 -0
@@ -0,0 +1,126 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<protocol name="wlr_gamma_control_unstable_v1">
3+ <copyright>
4+ Copyright © 2015 Giulio camuffo
5+ Copyright © 2018 Simon Ser
6+
7+ Permission to use, copy, modify, distribute, and sell this
8+ software and its documentation for any purpose is hereby granted
9+ without fee, provided that the above copyright notice appear in
10+ all copies and that both that copyright notice and this permission
11+ notice appear in supporting documentation, and that the name of
12+ the copyright holders not be used in advertising or publicity
13+ pertaining to distribution of the software without specific,
14+ written prior permission. The copyright holders make no
15+ representations about the suitability of this software for any
16+ purpose. It is provided "as is" without express or implied
17+ warranty.
18+
19+ THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
20+ SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
21+ FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
22+ SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
23+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
24+ AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
25+ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
26+ THIS SOFTWARE.
27+ </copyright>
28+
29+ <description summary="manage gamma tables of outputs">
30+ This protocol allows a privileged client to set the gamma tables for
31+ outputs.
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+ <interface name="zwlr_gamma_control_manager_v1" version="1">
44+ <description summary="manager to create per-output gamma controls">
45+ This interface is a manager that allows creating per-output gamma
46+ controls.
47+ </description>
48+
49+ <request name="get_gamma_control">
50+ <description summary="get a gamma control for an output">
51+ Create a gamma control that can be used to adjust gamma tables for the
52+ provided output.
53+ </description>
54+ <arg name="id" type="new_id" interface="zwlr_gamma_control_v1"/>
55+ <arg name="output" type="object" interface="wl_output"/>
56+ </request>
57+
58+ <request name="destroy" type="destructor">
59+ <description summary="destroy the manager">
60+ All objects created by the manager will still remain valid, until their
61+ appropriate destroy request has been called.
62+ </description>
63+ </request>
64+ </interface>
65+
66+ <interface name="zwlr_gamma_control_v1" version="1">
67+ <description summary="adjust gamma tables for an output">
68+ This interface allows a client to adjust gamma tables for a particular
69+ output.
70+
71+ The client will receive the gamma size, and will then be able to set gamma
72+ tables. At any time the compositor can send a failed event indicating that
73+ this object is no longer valid.
74+
75+ There can only be at most one gamma control object per output, which
76+ has exclusive access to this particular output. When the gamma control
77+ object is destroyed, the gamma table is restored to its original value.
78+ </description>
79+
80+ <event name="gamma_size">
81+ <description summary="size of gamma ramps">
82+ Advertise the size of each gamma ramp.
83+
84+ This event is sent immediately when the gamma control object is created.
85+ </description>
86+ <arg name="size" type="uint" summary="number of elements in a ramp"/>
87+ </event>
88+
89+ <enum name="error">
90+ <entry name="invalid_gamma" value="1" summary="invalid gamma tables"/>
91+ </enum>
92+
93+ <request name="set_gamma">
94+ <description summary="set the gamma table">
95+ Set the gamma table. The file descriptor can be memory-mapped to provide
96+ the raw gamma table, which contains successive gamma ramps for the red,
97+ green and blue channels. Each gamma ramp is an array of 16-byte unsigned
98+ integers which has the same length as the gamma size.
99+
100+ The file descriptor data must have the same length as three times the
101+ gamma size.
102+ </description>
103+ <arg name="fd" type="fd" summary="gamma table file descriptor"/>
104+ </request>
105+
106+ <event name="failed">
107+ <description summary="object no longer valid">
108+ This event indicates that the gamma control is no longer valid. This
109+ can happen for a number of reasons, including:
110+ - The output doesn't support gamma tables
111+ - Setting the gamma tables failed
112+ - Another client already has exclusive gamma control for this output
113+ - The compositor has transferred gamma control to another client
114+
115+ Upon receiving this event, the client should destroy this object.
116+ </description>
117+ </event>
118+
119+ <request name="destroy" type="destructor">
120+ <description summary="destroy this control">
121+ Destroys the gamma control object. If the object is still valid, this
122+ restores the original gamma tables.
123+ </description>
124+ </request>
125+ </interface>
126+</protocol>
A protocols/wlr-output-management-unstable-v1.xml +611 -0
@@ -0,0 +1,611 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<protocol name="wlr_output_management_unstable_v1">
3+ <copyright>
4+ Copyright © 2019 Purism SPC
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+ <description summary="protocol to configure output devices">
29+ This protocol exposes interfaces to obtain and modify output device
30+ configuration.
31+
32+ Warning! The protocol described in this file is experimental and
33+ backward incompatible changes may be made. Backward compatible changes
34+ may be added together with the corresponding interface version bump.
35+ Backward incompatible changes are done by bumping the version number in
36+ the protocol and interface names and resetting the interface version.
37+ Once the protocol is to be declared stable, the 'z' prefix and the
38+ version number in the protocol and interface names are removed and the
39+ interface version number is reset.
40+ </description>
41+
42+ <interface name="zwlr_output_manager_v1" version="4">
43+ <description summary="output device configuration manager">
44+ This interface is a manager that allows reading and writing the current
45+ output device configuration.
46+
47+ Output devices that display pixels (e.g. a physical monitor or a virtual
48+ output in a window) are represented as heads. Heads cannot be created nor
49+ destroyed by the client, but they can be enabled or disabled and their
50+ properties can be changed. Each head may have one or more available modes.
51+
52+ Whenever a head appears (e.g. a monitor is plugged in), it will be
53+ advertised via the head event. Immediately after the output manager is
54+ bound, all current heads are advertised.
55+
56+ Whenever a head's properties change, the relevant wlr_output_head events
57+ will be sent. Not all head properties will be sent: only properties that
58+ have changed need to.
59+
60+ Whenever a head disappears (e.g. a monitor is unplugged), a
61+ wlr_output_head.finished event will be sent.
62+
63+ After one or more heads appear, change or disappear, the done event will
64+ be sent. It carries a serial which can be used in a create_configuration
65+ request to update heads properties.
66+
67+ The information obtained from this protocol should only be used for output
68+ configuration purposes. This protocol is not designed to be a generic
69+ output property advertisement protocol for regular clients. Instead,
70+ protocols such as xdg-output should be used.
71+ </description>
72+
73+ <event name="head">
74+ <description summary="introduce a new head">
75+ This event introduces a new head. This happens whenever a new head
76+ appears (e.g. a monitor is plugged in) or after the output manager is
77+ bound.
78+ </description>
79+ <arg name="head" type="new_id" interface="zwlr_output_head_v1"/>
80+ </event>
81+
82+ <event name="done">
83+ <description summary="sent all information about current configuration">
84+ This event is sent after all information has been sent after binding to
85+ the output manager object and after any subsequent changes. This applies
86+ to child head and mode objects as well. In other words, this event is
87+ sent whenever a head or mode is created or destroyed and whenever one of
88+ their properties has been changed. Not all state is re-sent each time
89+ the current configuration changes: only the actual changes are sent.
90+
91+ This allows changes to the output configuration to be seen as atomic,
92+ even if they happen via multiple events.
93+
94+ A serial is sent to be used in a future create_configuration request.
95+ </description>
96+ <arg name="serial" type="uint" summary="current configuration serial"/>
97+ </event>
98+
99+ <request name="create_configuration">
100+ <description summary="create a new output configuration object">
101+ Create a new output configuration object. This allows to update head
102+ properties.
103+ </description>
104+ <arg name="id" type="new_id" interface="zwlr_output_configuration_v1"/>
105+ <arg name="serial" type="uint"/>
106+ </request>
107+
108+ <request name="stop">
109+ <description summary="stop sending events">
110+ Indicates the client no longer wishes to receive events for output
111+ configuration changes. However the compositor may emit further events,
112+ until the finished event is emitted.
113+
114+ The client must not send any more requests after this one.
115+ </description>
116+ </request>
117+
118+ <event name="finished" type="destructor">
119+ <description summary="the compositor has finished with the manager">
120+ This event indicates that the compositor is done sending manager events.
121+ The compositor will destroy the object immediately after sending this
122+ event, so it will become invalid and the client should release any
123+ resources associated with it.
124+ </description>
125+ </event>
126+ </interface>
127+
128+ <interface name="zwlr_output_head_v1" version="4">
129+ <description summary="output device">
130+ A head is an output device. The difference between a wl_output object and
131+ a head is that heads are advertised even if they are turned off. A head
132+ object only advertises properties and cannot be used directly to change
133+ them.
134+
135+ A head has some read-only properties: modes, name, description and
136+ physical_size. These cannot be changed by clients.
137+
138+ Other properties can be updated via a wlr_output_configuration object.
139+
140+ Properties sent via this interface are applied atomically via the
141+ wlr_output_manager.done event. No guarantees are made regarding the order
142+ in which properties are sent.
143+ </description>
144+
145+ <event name="name">
146+ <description summary="head name">
147+ This event describes the head name.
148+
149+ The naming convention is compositor defined, but limited to alphanumeric
150+ characters and dashes (-). Each name is unique among all wlr_output_head
151+ objects, but if a wlr_output_head object is destroyed the same name may
152+ be reused later. The names will also remain consistent across sessions
153+ with the same hardware and software configuration.
154+
155+ Examples of names include 'HDMI-A-1', 'WL-1', 'X11-1', etc. However, do
156+ not assume that the name is a reflection of an underlying DRM
157+ connector, X11 connection, etc.
158+
159+ If this head matches a wl_output, the wl_output.name event must report
160+ the same name.
161+
162+ The name event is sent after a wlr_output_head object is created. This
163+ event is only sent once per object, and the name does not change over
164+ the lifetime of the wlr_output_head object.
165+ </description>
166+ <arg name="name" type="string"/>
167+ </event>
168+
169+ <event name="description">
170+ <description summary="head description">
171+ This event describes a human-readable description of the head.
172+
173+ The description is a UTF-8 string with no convention defined for its
174+ contents. Examples might include 'Foocorp 11" Display' or 'Virtual X11
175+ output via :1'. However, do not assume that the name is a reflection of
176+ the make, model, serial of the underlying DRM connector or the display
177+ name of the underlying X11 connection, etc.
178+
179+ If this head matches a wl_output, the wl_output.description event must
180+ report the same name.
181+
182+ The description event is sent after a wlr_output_head object is created.
183+ This event is only sent once per object, and the description does not
184+ change over the lifetime of the wlr_output_head object.
185+ </description>
186+ <arg name="description" type="string"/>
187+ </event>
188+
189+ <event name="physical_size">
190+ <description summary="head physical size">
191+ This event describes the physical size of the head. This event is only
192+ sent if the head has a physical size (e.g. is not a projector or a
193+ virtual device).
194+
195+ The physical size event is sent after a wlr_output_head object is created. This
196+ event is only sent once per object, and the physical size does not change over
197+ the lifetime of the wlr_output_head object.
198+ </description>
199+ <arg name="width" type="int" summary="width in millimeters of the output"/>
200+ <arg name="height" type="int" summary="height in millimeters of the output"/>
201+ </event>
202+
203+ <event name="mode">
204+ <description summary="introduce a mode">
205+ This event introduces a mode for this head. It is sent once per
206+ supported mode.
207+ </description>
208+ <arg name="mode" type="new_id" interface="zwlr_output_mode_v1"/>
209+ </event>
210+
211+ <event name="enabled">
212+ <description summary="head is enabled or disabled">
213+ This event describes whether the head is enabled. A disabled head is not
214+ mapped to a region of the global compositor space.
215+
216+ When a head is disabled, some properties (current_mode, position,
217+ transform and scale) are irrelevant.
218+ </description>
219+ <arg name="enabled" type="int" summary="zero if disabled, non-zero if enabled"/>
220+ </event>
221+
222+ <event name="current_mode">
223+ <description summary="current mode">
224+ This event describes the mode currently in use for this head. It is only
225+ sent if the output is enabled.
226+ </description>
227+ <arg name="mode" type="object" interface="zwlr_output_mode_v1"/>
228+ </event>
229+
230+ <event name="position">
231+ <description summary="current position">
232+ This events describes the position of the head in the global compositor
233+ space. It is only sent if the output is enabled.
234+ </description>
235+ <arg name="x" type="int"
236+ summary="x position within the global compositor space"/>
237+ <arg name="y" type="int"
238+ summary="y position within the global compositor space"/>
239+ </event>
240+
241+ <event name="transform">
242+ <description summary="current transformation">
243+ This event describes the transformation currently applied to the head.
244+ It is only sent if the output is enabled.
245+ </description>
246+ <arg name="transform" type="int" enum="wl_output.transform"/>
247+ </event>
248+
249+ <event name="scale">
250+ <description summary="current scale">
251+ This events describes the scale of the head in the global compositor
252+ space. It is only sent if the output is enabled.
253+ </description>
254+ <arg name="scale" type="fixed"/>
255+ </event>
256+
257+ <event name="finished">
258+ <description summary="the head has disappeared">
259+ This event indicates that the head is no longer available. The head
260+ object becomes inert. Clients should send a destroy request and release
261+ any resources associated with it.
262+ </description>
263+ </event>
264+
265+ <!-- Version 2 additions -->
266+
267+ <event name="make" since="2">
268+ <description summary="head manufacturer">
269+ This event describes the manufacturer of the head.
270+
271+ Together with the model and serial_number events the purpose is to
272+ allow clients to recognize heads from previous sessions and for example
273+ load head-specific configurations back.
274+
275+ It is not guaranteed this event will be ever sent. A reason for that
276+ can be that the compositor does not have information about the make of
277+ the head or the definition of a make is not sensible in the current
278+ setup, for example in a virtual session. Clients can still try to
279+ identify the head by available information from other events but should
280+ be aware that there is an increased risk of false positives.
281+
282+ If sent, the make event is sent after a wlr_output_head object is
283+ created and only sent once per object. The make does not change over
284+ the lifetime of the wlr_output_head object.
285+
286+ It is not recommended to display the make string in UI to users. For
287+ that the string provided by the description event should be preferred.
288+ </description>
289+ <arg name="make" type="string"/>
290+ </event>
291+
292+ <event name="model" since="2">
293+ <description summary="head model">
294+ This event describes the model of the head.
295+
296+ Together with the make and serial_number events the purpose is to
297+ allow clients to recognize heads from previous sessions and for example
298+ load head-specific configurations back.
299+
300+ It is not guaranteed this event will be ever sent. A reason for that
301+ can be that the compositor does not have information about the model of
302+ the head or the definition of a model is not sensible in the current
303+ setup, for example in a virtual session. Clients can still try to
304+ identify the head by available information from other events but should
305+ be aware that there is an increased risk of false positives.
306+
307+ If sent, the model event is sent after a wlr_output_head object is
308+ created and only sent once per object. The model does not change over
309+ the lifetime of the wlr_output_head object.
310+
311+ It is not recommended to display the model string in UI to users. For
312+ that the string provided by the description event should be preferred.
313+ </description>
314+ <arg name="model" type="string"/>
315+ </event>
316+
317+ <event name="serial_number" since="2">
318+ <description summary="head serial number">
319+ This event describes the serial number of the head.
320+
321+ Together with the make and model events the purpose is to allow clients
322+ to recognize heads from previous sessions and for example load head-
323+ specific configurations back.
324+
325+ It is not guaranteed this event will be ever sent. A reason for that
326+ can be that the compositor does not have information about the serial
327+ number of the head or the definition of a serial number is not sensible
328+ in the current setup. Clients can still try to identify the head by
329+ available information from other events but should be aware that there
330+ is an increased risk of false positives.
331+
332+ If sent, the serial number event is sent after a wlr_output_head object
333+ is created and only sent once per object. The serial number does not
334+ change over the lifetime of the wlr_output_head object.
335+
336+ It is not recommended to display the serial_number string in UI to
337+ users. For that the string provided by the description event should be
338+ preferred.
339+ </description>
340+ <arg name="serial_number" type="string"/>
341+ </event>
342+
343+ <!-- Version 3 additions -->
344+
345+ <request name="release" type="destructor" since="3">
346+ <description summary="destroy the head object">
347+ This request indicates that the client will no longer use this head
348+ object.
349+ </description>
350+ </request>
351+
352+ <!-- Version 4 additions -->
353+
354+ <enum name="adaptive_sync_state" since="4">
355+ <entry name="disabled" value="0" summary="adaptive sync is disabled"/>
356+ <entry name="enabled" value="1" summary="adaptive sync is enabled"/>
357+ </enum>
358+
359+ <event name="adaptive_sync" since="4">
360+ <description summary="current adaptive sync state">
361+ This event describes whether adaptive sync is currently enabled for
362+ the head or not. Adaptive sync is also known as Variable Refresh
363+ Rate or VRR.
364+ </description>
365+ <arg name="state" type="uint" enum="adaptive_sync_state"/>
366+ </event>
367+ </interface>
368+
369+ <interface name="zwlr_output_mode_v1" version="3">
370+ <description summary="output mode">
371+ This object describes an output mode.
372+
373+ Some heads don't support output modes, in which case modes won't be
374+ advertised.
375+
376+ Properties sent via this interface are applied atomically via the
377+ wlr_output_manager.done event. No guarantees are made regarding the order
378+ in which properties are sent.
379+ </description>
380+
381+ <event name="size">
382+ <description summary="mode size">
383+ This event describes the mode size. The size is given in physical
384+ hardware units of the output device. This is not necessarily the same as
385+ the output size in the global compositor space. For instance, the output
386+ may be scaled or transformed.
387+ </description>
388+ <arg name="width" type="int" summary="width of the mode in hardware units"/>
389+ <arg name="height" type="int" summary="height of the mode in hardware units"/>
390+ </event>
391+
392+ <event name="refresh">
393+ <description summary="mode refresh rate">
394+ This event describes the mode's fixed vertical refresh rate. It is only
395+ sent if the mode has a fixed refresh rate.
396+ </description>
397+ <arg name="refresh" type="int" summary="vertical refresh rate in mHz"/>
398+ </event>
399+
400+ <event name="preferred">
401+ <description summary="mode is preferred">
402+ This event advertises this mode as preferred.
403+ </description>
404+ </event>
405+
406+ <event name="finished">
407+ <description summary="the mode has disappeared">
408+ This event indicates that the mode is no longer available. The mode
409+ object becomes inert. Clients should send a destroy request and release
410+ any resources associated with it.
411+ </description>
412+ </event>
413+
414+ <!-- Version 3 additions -->
415+
416+ <request name="release" type="destructor" since="3">
417+ <description summary="destroy the mode object">
418+ This request indicates that the client will no longer use this mode
419+ object.
420+ </description>
421+ </request>
422+ </interface>
423+
424+ <interface name="zwlr_output_configuration_v1" version="4">
425+ <description summary="output configuration">
426+ This object is used by the client to describe a full output configuration.
427+
428+ First, the client needs to setup the output configuration. Each head can
429+ be either enabled (and configured) or disabled. It is a protocol error to
430+ send two enable_head or disable_head requests with the same head. It is a
431+ protocol error to omit a head in a configuration.
432+
433+ Then, the client can apply or test the configuration. The compositor will
434+ then reply with a succeeded, failed or cancelled event. Finally the client
435+ should destroy the configuration object.
436+ </description>
437+
438+ <enum name="error">
439+ <entry name="already_configured_head" value="1"
440+ summary="head has been configured twice"/>
441+ <entry name="unconfigured_head" value="2"
442+ summary="head has not been configured"/>
443+ <entry name="already_used" value="3"
444+ summary="request sent after configuration has been applied or tested"/>
445+ </enum>
446+
447+ <request name="enable_head">
448+ <description summary="enable and configure a head">
449+ Enable a head. This request creates a head configuration object that can
450+ be used to change the head's properties.
451+ </description>
452+ <arg name="id" type="new_id" interface="zwlr_output_configuration_head_v1"
453+ summary="a new object to configure the head"/>
454+ <arg name="head" type="object" interface="zwlr_output_head_v1"
455+ summary="the head to be enabled"/>
456+ </request>
457+
458+ <request name="disable_head">
459+ <description summary="disable a head">
460+ Disable a head.
461+ </description>
462+ <arg name="head" type="object" interface="zwlr_output_head_v1"
463+ summary="the head to be disabled"/>
464+ </request>
465+
466+ <request name="apply">
467+ <description summary="apply the configuration">
468+ Apply the new output configuration.
469+
470+ In case the configuration is successfully applied, there is no guarantee
471+ that the new output state matches completely the requested
472+ configuration. For instance, a compositor might round the scale if it
473+ doesn't support fractional scaling.
474+
475+ After this request has been sent, the compositor must respond with an
476+ succeeded, failed or cancelled event. Sending a request that isn't the
477+ destructor is a protocol error.
478+ </description>
479+ </request>
480+
481+ <request name="test">
482+ <description summary="test the configuration">
483+ Test the new output configuration. The configuration won't be applied,
484+ but will only be validated.
485+
486+ Even if the compositor succeeds to test a configuration, applying it may
487+ fail.
488+
489+ After this request has been sent, the compositor must respond with an
490+ succeeded, failed or cancelled event. Sending a request that isn't the
491+ destructor is a protocol error.
492+ </description>
493+ </request>
494+
495+ <event name="succeeded">
496+ <description summary="configuration changes succeeded">
497+ Sent after the compositor has successfully applied the changes or
498+ tested them.
499+
500+ Upon receiving this event, the client should destroy this object.
501+
502+ If the current configuration has changed, events to describe the changes
503+ will be sent followed by a wlr_output_manager.done event.
504+ </description>
505+ </event>
506+
507+ <event name="failed">
508+ <description summary="configuration changes failed">
509+ Sent if the compositor rejects the changes or failed to apply them. The
510+ compositor should revert any changes made by the apply request that
511+ triggered this event.
512+
513+ Upon receiving this event, the client should destroy this object.
514+ </description>
515+ </event>
516+
517+ <event name="cancelled">
518+ <description summary="configuration has been cancelled">
519+ Sent if the compositor cancels the configuration because the state of an
520+ output changed and the client has outdated information (e.g. after an
521+ output has been hotplugged).
522+
523+ The client can create a new configuration with a newer serial and try
524+ again.
525+
526+ Upon receiving this event, the client should destroy this object.
527+ </description>
528+ </event>
529+
530+ <request name="destroy" type="destructor">
531+ <description summary="destroy the output configuration">
532+ Using this request a client can tell the compositor that it is not going
533+ to use the configuration object anymore. Any changes to the outputs
534+ that have not been applied will be discarded.
535+
536+ This request also destroys wlr_output_configuration_head objects created
537+ via this object.
538+ </description>
539+ </request>
540+ </interface>
541+
542+ <interface name="zwlr_output_configuration_head_v1" version="4">
543+ <description summary="head configuration">
544+ This object is used by the client to update a single head's configuration.
545+
546+ It is a protocol error to set the same property twice.
547+ </description>
548+
549+ <enum name="error">
550+ <entry name="already_set" value="1" summary="property has already been set"/>
551+ <entry name="invalid_mode" value="2" summary="mode doesn't belong to head"/>
552+ <entry name="invalid_custom_mode" value="3" summary="mode is invalid"/>
553+ <entry name="invalid_transform" value="4" summary="transform value outside enum"/>
554+ <entry name="invalid_scale" value="5" summary="scale negative or zero"/>
555+ <entry name="invalid_adaptive_sync_state" value="6" since="4"
556+ summary="invalid enum value used in the set_adaptive_sync request"/>
557+ </enum>
558+
559+ <request name="set_mode">
560+ <description summary="set the mode">
561+ This request sets the head's mode.
562+ </description>
563+ <arg name="mode" type="object" interface="zwlr_output_mode_v1"/>
564+ </request>
565+
566+ <request name="set_custom_mode">
567+ <description summary="set a custom mode">
568+ This request assigns a custom mode to the head. The size is given in
569+ physical hardware units of the output device. If set to zero, the
570+ refresh rate is unspecified.
571+
572+ It is a protocol error to set both a mode and a custom mode.
573+ </description>
574+ <arg name="width" type="int" summary="width of the mode in hardware units"/>
575+ <arg name="height" type="int" summary="height of the mode in hardware units"/>
576+ <arg name="refresh" type="int" summary="vertical refresh rate in mHz or zero"/>
577+ </request>
578+
579+ <request name="set_position">
580+ <description summary="set the position">
581+ This request sets the head's position in the global compositor space.
582+ </description>
583+ <arg name="x" type="int" summary="x position in the global compositor space"/>
584+ <arg name="y" type="int" summary="y position in the global compositor space"/>
585+ </request>
586+
587+ <request name="set_transform">
588+ <description summary="set the transform">
589+ This request sets the head's transform.
590+ </description>
591+ <arg name="transform" type="int" enum="wl_output.transform"/>
592+ </request>
593+
594+ <request name="set_scale">
595+ <description summary="set the scale">
596+ This request sets the head's scale.
597+ </description>
598+ <arg name="scale" type="fixed"/>
599+ </request>
600+
601+ <!-- Version 4 additions -->
602+
603+ <request name="set_adaptive_sync" since="4">
604+ <description summary="enable/disable adaptive sync">
605+ This request enables/disables adaptive sync. Adaptive sync is also
606+ known as Variable Refresh Rate or VRR.
607+ </description>
608+ <arg name="state" type="uint" enum="zwlr_output_head_v1.adaptive_sync_state"/>
609+ </request>
610+ </interface>
611+</protocol>
A protocols/wlr-screencopy-unstable-v1.xml +234 -0
@@ -0,0 +1,234 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<protocol name="wlr_screencopy_unstable_v1">
3+ <copyright>
4+ Copyright © 2018 Simon Ser
5+ Copyright © 2019 Andri Yngvason
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="screen content capturing on client buffers">
28+ This protocol allows clients to ask the compositor to copy part of the
29+ screen content to a client buffer.
30+
31+ Warning! The protocol described in this file is experimental and
32+ backward incompatible changes may be made. Backward compatible changes
33+ may be added together with the corresponding interface version bump.
34+ Backward incompatible changes are done by bumping the version number in
35+ the protocol and interface names and resetting the interface version.
36+ Once the protocol is to be declared stable, the 'z' prefix and the
37+ version number in the protocol and interface names are removed and the
38+ interface version number is reset.
39+
40+ Note! This protocol is deprecated and not intended for production use.
41+ The ext-image-copy-capture-v1 protocol should be used instead.
42+ </description>
43+
44+ <interface name="zwlr_screencopy_manager_v1" version="3">
45+ <description summary="manager to inform clients and begin capturing">
46+ This object is a manager which offers requests to start capturing from a
47+ source.
48+ </description>
49+
50+ <request name="capture_output">
51+ <description summary="capture an output">
52+ Capture the next frame of an entire output.
53+ </description>
54+ <arg name="frame" type="new_id" interface="zwlr_screencopy_frame_v1"/>
55+ <arg name="overlay_cursor" type="int"
56+ summary="composite cursor onto the frame"/>
57+ <arg name="output" type="object" interface="wl_output"/>
58+ </request>
59+
60+ <request name="capture_output_region">
61+ <description summary="capture an output's region">
62+ Capture the next frame of an output's region.
63+
64+ The region is given in output logical coordinates, see
65+ xdg_output.logical_size. The region will be clipped to the output's
66+ extents.
67+ </description>
68+ <arg name="frame" type="new_id" interface="zwlr_screencopy_frame_v1"/>
69+ <arg name="overlay_cursor" type="int"
70+ summary="composite cursor onto the frame"/>
71+ <arg name="output" type="object" interface="wl_output"/>
72+ <arg name="x" type="int"/>
73+ <arg name="y" type="int"/>
74+ <arg name="width" type="int"/>
75+ <arg name="height" type="int"/>
76+ </request>
77+
78+ <request name="destroy" type="destructor">
79+ <description summary="destroy the manager">
80+ All objects created by the manager will still remain valid, until their
81+ appropriate destroy request has been called.
82+ </description>
83+ </request>
84+ </interface>
85+
86+ <interface name="zwlr_screencopy_frame_v1" version="3">
87+ <description summary="a frame ready for copy">
88+ This object represents a single frame.
89+
90+ When created, a series of buffer events will be sent, each representing a
91+ supported buffer type. The "buffer_done" event is sent afterwards to
92+ indicate that all supported buffer types have been enumerated. The client
93+ will then be able to send a "copy" request. If the capture is successful,
94+ the compositor will send a "flags" event followed by a "ready" event.
95+
96+ For objects version 2 or lower, wl_shm buffers are always supported, ie.
97+ the "buffer" event is guaranteed to be sent.
98+
99+ If the capture failed, the "failed" event is sent. This can happen anytime
100+ before the "ready" event.
101+
102+ Once either a "ready" or a "failed" event is received, the client should
103+ destroy the frame.
104+ </description>
105+
106+ <event name="buffer">
107+ <description summary="wl_shm buffer information">
108+ Provides information about wl_shm buffer parameters that need to be
109+ used for this frame. This event is sent once after the frame is created
110+ if wl_shm buffers are supported.
111+ </description>
112+ <arg name="format" type="uint" enum="wl_shm.format" summary="buffer format"/>
113+ <arg name="width" type="uint" summary="buffer width"/>
114+ <arg name="height" type="uint" summary="buffer height"/>
115+ <arg name="stride" type="uint" summary="buffer stride"/>
116+ </event>
117+
118+ <request name="copy">
119+ <description summary="copy the frame">
120+ Copy the frame to the supplied buffer. The buffer must have the
121+ correct size, see zwlr_screencopy_frame_v1.buffer and
122+ zwlr_screencopy_frame_v1.linux_dmabuf. The buffer needs to have a
123+ supported format.
124+
125+ If the frame is successfully copied, "flags" and "ready" events are
126+ sent. Otherwise, a "failed" event is sent.
127+ </description>
128+ <arg name="buffer" type="object" interface="wl_buffer"/>
129+ </request>
130+
131+ <enum name="error">
132+ <entry name="already_used" value="0"
133+ summary="the object has already been used to copy a wl_buffer"/>
134+ <entry name="invalid_buffer" value="1"
135+ summary="buffer attributes are invalid"/>
136+ </enum>
137+
138+ <enum name="flags" bitfield="true">
139+ <entry name="y_invert" value="1" summary="contents are y-inverted"/>
140+ </enum>
141+
142+ <event name="flags">
143+ <description summary="frame flags">
144+ Provides flags about the frame. This event is sent once before the
145+ "ready" event.
146+ </description>
147+ <arg name="flags" type="uint" enum="flags" summary="frame flags"/>
148+ </event>
149+
150+ <event name="ready">
151+ <description summary="indicates frame is available for reading">
152+ Called as soon as the frame is copied, indicating it is available
153+ for reading. This event includes the time at which the presentation took place.
154+
155+ The timestamp is expressed as tv_sec_hi, tv_sec_lo, tv_nsec triples,
156+ each component being an unsigned 32-bit value. Whole seconds are in
157+ tv_sec which is a 64-bit value combined from tv_sec_hi and tv_sec_lo,
158+ and the additional fractional part in tv_nsec as nanoseconds. Hence,
159+ for valid timestamps tv_nsec must be in [0, 999999999]. The seconds part
160+ may have an arbitrary offset at start.
161+
162+ After receiving this event, the client should destroy the object.
163+ </description>
164+ <arg name="tv_sec_hi" type="uint"
165+ summary="high 32 bits of the seconds part of the timestamp"/>
166+ <arg name="tv_sec_lo" type="uint"
167+ summary="low 32 bits of the seconds part of the timestamp"/>
168+ <arg name="tv_nsec" type="uint"
169+ summary="nanoseconds part of the timestamp"/>
170+ </event>
171+
172+ <event name="failed">
173+ <description summary="frame copy failed">
174+ This event indicates that the attempted frame copy has failed.
175+
176+ After receiving this event, the client should destroy the object.
177+ </description>
178+ </event>
179+
180+ <request name="destroy" type="destructor">
181+ <description summary="delete this object, used or not">
182+ Destroys the frame. This request can be sent at any time by the client.
183+ </description>
184+ </request>
185+
186+ <!-- Version 2 additions -->
187+ <request name="copy_with_damage" since="2">
188+ <description summary="copy the frame when it's damaged">
189+ Same as copy, except it waits until there is damage to copy.
190+ </description>
191+ <arg name="buffer" type="object" interface="wl_buffer"/>
192+ </request>
193+
194+ <event name="damage" since="2">
195+ <description summary="carries the coordinates of the damaged region">
196+ This event is sent right before the ready event when copy_with_damage is
197+ requested. It may be generated multiple times for each copy_with_damage
198+ request.
199+
200+ The arguments describe a box around an area that has changed since the
201+ last copy request that was derived from the current screencopy manager
202+ instance.
203+
204+ The union of all regions received between the call to copy_with_damage
205+ and a ready event is the total damage since the prior ready event.
206+ </description>
207+ <arg name="x" type="uint" summary="damaged x coordinates"/>
208+ <arg name="y" type="uint" summary="damaged y coordinates"/>
209+ <arg name="width" type="uint" summary="current width"/>
210+ <arg name="height" type="uint" summary="current height"/>
211+ </event>
212+
213+ <!-- Version 3 additions -->
214+ <event name="linux_dmabuf" since="3">
215+ <description summary="linux-dmabuf buffer information">
216+ Provides information about linux-dmabuf buffer parameters that need to
217+ be used for this frame. This event is sent once after the frame is
218+ created if linux-dmabuf buffers are supported.
219+ </description>
220+ <arg name="format" type="uint" summary="fourcc pixel format"/>
221+ <arg name="width" type="uint" summary="buffer width"/>
222+ <arg name="height" type="uint" summary="buffer height"/>
223+ </event>
224+
225+ <event name="buffer_done" since="3">
226+ <description summary="all buffer types reported">
227+ This event is sent once after all buffer events have been sent.
228+
229+ The client should proceed to create a buffer of one of the supported
230+ types, and send a "copy" request.
231+ </description>
232+ </event>
233+ </interface>
234+</protocol>
A protocols/wlr-virtual-pointer-unstable-v1.xml +152 -0
@@ -0,0 +1,152 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<protocol name="wlr_virtual_pointer_unstable_v1">
3+ <copyright>
4+ Copyright © 2019 Josef Gajdusek
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="zwlr_virtual_pointer_v1" version="2">
27+ <description summary="virtual pointer">
28+ This protocol allows clients to emulate a physical pointer device. The
29+ requests are mostly mirror opposites of those specified in wl_pointer.
30+ </description>
31+
32+ <enum name="error">
33+ <entry name="invalid_axis" value="0"
34+ summary="client sent invalid axis enumeration value" />
35+ <entry name="invalid_axis_source" value="1"
36+ summary="client sent invalid axis source enumeration value" />
37+ </enum>
38+
39+ <request name="motion">
40+ <description summary="pointer relative motion event">
41+ The pointer has moved by a relative amount to the previous request.
42+
43+ Values are in the global compositor space.
44+ </description>
45+ <arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
46+ <arg name="dx" type="fixed" summary="displacement on the x-axis"/>
47+ <arg name="dy" type="fixed" summary="displacement on the y-axis"/>
48+ </request>
49+
50+ <request name="motion_absolute">
51+ <description summary="pointer absolute motion event">
52+ The pointer has moved in an absolute coordinate frame.
53+
54+ Value of x can range from 0 to x_extent, value of y can range from 0
55+ to y_extent.
56+ </description>
57+ <arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
58+ <arg name="x" type="uint" summary="position on the x-axis"/>
59+ <arg name="y" type="uint" summary="position on the y-axis"/>
60+ <arg name="x_extent" type="uint" summary="extent of the x-axis"/>
61+ <arg name="y_extent" type="uint" summary="extent of the y-axis"/>
62+ </request>
63+
64+ <request name="button">
65+ <description summary="button event">
66+ A button was pressed or released.
67+ </description>
68+ <arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
69+ <arg name="button" type="uint" summary="button that produced the event"/>
70+ <arg name="state" type="uint" enum="wl_pointer.button_state" summary="physical state of the button"/>
71+ </request>
72+
73+ <request name="axis">
74+ <description summary="axis event">
75+ Scroll and other axis requests.
76+ </description>
77+ <arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
78+ <arg name="axis" type="uint" enum="wl_pointer.axis" summary="axis type"/>
79+ <arg name="value" type="fixed" summary="length of vector in touchpad coordinates"/>
80+ </request>
81+
82+ <request name="frame">
83+ <description summary="end of a pointer event sequence">
84+ Indicates the set of events that logically belong together.
85+ </description>
86+ </request>
87+
88+ <request name="axis_source">
89+ <description summary="axis source event">
90+ Source information for scroll and other axis.
91+ </description>
92+ <arg name="axis_source" type="uint" enum="wl_pointer.axis_source" summary="source of the axis event"/>
93+ </request>
94+
95+ <request name="axis_stop">
96+ <description summary="axis stop event">
97+ Stop notification for scroll and other axes.
98+ </description>
99+ <arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
100+ <arg name="axis" type="uint" enum="wl_pointer.axis" summary="the axis stopped with this event"/>
101+ </request>
102+
103+ <request name="axis_discrete">
104+ <description summary="axis click event">
105+ Discrete step information for scroll and other axes.
106+
107+ This event allows the client to extend data normally sent using the axis
108+ event with discrete value.
109+ </description>
110+ <arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
111+ <arg name="axis" type="uint" enum="wl_pointer.axis" summary="axis type"/>
112+ <arg name="value" type="fixed" summary="length of vector in touchpad coordinates"/>
113+ <arg name="discrete" type="int" summary="number of steps"/>
114+ </request>
115+
116+ <request name="destroy" type="destructor" since="1">
117+ <description summary="destroy the virtual pointer object"/>
118+ </request>
119+ </interface>
120+
121+ <interface name="zwlr_virtual_pointer_manager_v1" version="2">
122+ <description summary="virtual pointer manager">
123+ This object allows clients to create individual virtual pointer objects.
124+ </description>
125+
126+ <request name="create_virtual_pointer">
127+ <description summary="Create a new virtual pointer">
128+ Creates a new virtual pointer. The optional seat is a suggestion to the
129+ compositor.
130+ </description>
131+ <arg name="seat" type="object" interface="wl_seat" allow-null="true"/>
132+ <arg name="id" type="new_id" interface="zwlr_virtual_pointer_v1"/>
133+ </request>
134+
135+ <request name="destroy" type="destructor" since="1">
136+ <description summary="destroy the virtual pointer manager"/>
137+ </request>
138+
139+ <!-- Version 2 additions -->
140+ <request name="create_virtual_pointer_with_output" since="2">
141+ <description summary="Create a new virtual pointer">
142+ Creates a new virtual pointer. The seat and the output arguments are
143+ optional. If the seat argument is set, the compositor should assign the
144+ input device to the requested seat. If the output argument is set, the
145+ compositor should map the input device to the requested output.
146+ </description>
147+ <arg name="seat" type="object" interface="wl_seat" allow-null="true"/>
148+ <arg name="output" type="object" interface="wl_output" allow-null="true"/>
149+ <arg name="id" type="new_id" interface="zwlr_virtual_pointer_v1"/>
150+ </request>
151+ </interface>
152+</protocol>
A protocols/xdg-session-management-v1.xml +333 -0
@@ -0,0 +1,333 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<protocol name="xdg_session_management_v1">
3+ <copyright>
4+ Copyright 2018 Mike Blumenkrantz
5+ Copyright 2018 Samsung Electronics Co., Ltd
6+ Copyright 2018 Red Hat Inc.
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 for managing application sessions">
29+ This description provides a high-level overview of the interplay between
30+ the interfaces defined this protocol. For details, see the protocol
31+ specification.
32+
33+ The xdg_session_manager protocol declares interfaces necessary to
34+ allow clients to restore toplevel state from previous executions. The
35+ xdg_session_manager_v1.get_session request can be used to obtain a
36+ xdg_session_v1 resource representing the state of a set of toplevels.
37+
38+ Clients may obtain the session string to use in future calls through
39+ the xdg_session_v1.created event. Compositors will use this string
40+ as an identifiable token for future runs, possibly storing data about
41+ the related toplevels in persistent storage. Clients that wish to
42+ track sessions in multiple environments may use the $XDG_CURRENT_DESKTOP
43+ environment variable.
44+
45+ Toplevels are managed through the xdg_session_v1.add_toplevel and
46+ xdg_session_v1.remove_toplevel pair of requests. Clients will explicitly
47+ request a toplevel to be restored according to prior state through the
48+ xdg_session_v1.restore_toplevel request before the toplevel is mapped.
49+
50+ Compositors may store session information up to any arbitrary level, and
51+ apply any limits and policies to the amount of data stored and its lifetime.
52+ Clients must account for missing sessions and partial session restoration.
53+
54+ Warning! The protocol described in this file is currently in the testing
55+ phase. Backward compatible changes may be added together with the
56+ corresponding interface version bump. Backward incompatible changes can
57+ only be done by creating a new major version of the extension.
58+ </description>
59+
60+ <interface name="xdg_session_manager_v1" version="1">
61+ <description summary="manage sessions for applications">
62+ The xdg_session_manager_v1 interface defines base requests for creating and
63+ managing a session for an application. Sessions persist across application
64+ and compositor restarts unless explicitly destroyed. A session is created
65+ for the purpose of maintaining an application's xdg_toplevel surfaces
66+ across compositor or application restarts. The compositor should remember
67+ as many states as possible for surfaces in a given session, but there is
68+ no requirement for which states must be remembered.
69+
70+ Policies such as cache eviction are declared an implementation detail of
71+ the compositor. Clients should account for no longer existing sessions.
72+ </description>
73+
74+ <enum name="error">
75+ <entry name="in_use" summary="a requested session is already in use"
76+ value="1"/>
77+ <entry name="invalid_session_id" summary="invalid session identifier"
78+ value="2"/>
79+ <entry name="invalid_reason" summary="invalid reason" value="3"/>
80+ </enum>
81+
82+ <enum name="reason">
83+ <description summary="reason for getting a session">
84+ The reason may determine in what way a session restores the window
85+ management state of associated toplevels.
86+
87+ For example newly launched applications might be launched on the active
88+ workspace with restored size and position, while a recovered
89+ application might restore additional state such as active workspace and
90+ stacking order.
91+ </description>
92+ <entry name="launch" value="1">
93+ <description summary="an app is newly launched">
94+ A new app instance is launched, for example from an app launcher.
95+ </description>
96+ </entry>
97+ <entry name="recover" value="2">
98+ <description summary="an app recovered">
99+ An app instance is recovering from for example a compositor or app crash.
100+ </description>
101+ </entry>
102+ <entry name="session_restore" value="3">
103+ <description summary="an app restored">
104+ An app instance is restored, for example part of a restored session, or
105+ restored from having been temporarily terminated due to resource
106+ constraints.
107+ </description>
108+ </entry>
109+ </enum>
110+
111+ <request name="destroy" type="destructor">
112+ <description summary="Destroy this object">
113+ Destroy the manager object. The existing session objects will be
114+ unaffected.
115+ </description>
116+ </request>
117+
118+ <request name="get_session">
119+ <description summary="create or restore a session">
120+ Create a session object corresponding to either an existing session
121+ identified by the given session identifier string or a new session.
122+ While the session object exists, the session is considered to be "in
123+ use".
124+
125+ If an identifier string represents a session that is currently actively
126+ in use by the the same client, an 'in_use' error is raised. If some
127+ other client is currently using the same session, the new session will
128+ replace managing the associated state.
129+
130+ If the reason is not a valid enum entry, the 'invalid_reason' protocol
131+ error is raised.
132+
133+ NULL is passed to initiate a new session. If a session_id is passed
134+ which does not represent a valid session, the compositor treats it as if
135+ NULL had been passed.
136+
137+ The session id string must be UTF-8 encoded. It is also limited by the
138+ maximum length of wayland messages (around 4KB). The 'invalid_session_id'
139+ protocol error will be raised if an invalid string is provided.
140+
141+ A client is allowed to have any number of in use sessions at the same
142+ time.
143+ </description>
144+ <arg name="id" type="new_id" interface="xdg_session_v1"/>
145+ <arg name="reason" type="uint" enum="reason"
146+ summary="reason for session"/>
147+ <arg name="session_id" type="string"
148+ summary="the session to restore"
149+ allow-null="true"/>
150+ </request>
151+ </interface>
152+
153+ <interface name="xdg_session_v1" version="1">
154+ <description summary="A session for an application">
155+ A xdg_session_v1 object represents a session for an application. While the
156+ object exists, all surfaces which have been added to the session will
157+ have states stored by the compositor which can be reapplied at a later
158+ time. Two sessions cannot exist for the same identifier string.
159+
160+ States for surfaces added to a session are automatically updated by the
161+ compositor when they are changed.
162+ </description>
163+
164+ <enum name="error">
165+ <entry name="name_in_use"
166+ summary="toplevel name is already in use"
167+ value="1"/>
168+ <entry name="already_mapped"
169+ summary="toplevel was already mapped when restored"
170+ value="2"/>
171+ <entry name="invalid_name"
172+ summary="provided toplevel name is invalid"
173+ value="3"/>
174+ <entry name="already_added"
175+ summary="toplevel already added"
176+ value="4"/>
177+ </enum>
178+
179+ <request name="destroy" type="destructor">
180+ <description summary="Destroy the session">
181+ Destroy a session object, preserving the current state but not continuing
182+ to make further updates if state changes occur. This makes the associated
183+ xdg_toplevel_session_v1 objects inert.
184+ </description>
185+ </request>
186+
187+ <request name="remove" type="destructor">
188+ <description summary="Remove the session">
189+ Remove the session, making it no longer available for restoration. A
190+ compositor should in response to this request remove the data related to
191+ this session from its storage.
192+ </description>
193+ </request>
194+
195+ <request name="add_toplevel">
196+ <description summary="add a new surface to the session">
197+ Attempt to add a given surface to the session. The passed name is used
198+ to identify what window is being restored, and may be used to store
199+ window specific state within the session.
200+
201+ The name given to the toplevel must not correspond to any previously
202+ existing toplevel names in the session. If the name matches an already
203+ known toplevel name in the session, a 'name_in_use' protocol error will
204+ be raised.
205+
206+ The toplevel object must not be added more than once to any session
207+ created by the client, otherwise the 'already_added' protocol error
208+ will be raised.
209+
210+ This request will return a xdg_toplevel_session_v1 for later
211+ manipulation. As this resource is created from an empty initial state,
212+ compositors must not emit a xdg_toplevel_session_v1.restored event for
213+ resources created through this request.
214+
215+ The name string must be UTF-8 encoded. It is also limited by the maximum
216+ length of wayland messages (around 4KB). The 'invalid_name' protocol
217+ error will be raised if an invalid string is provided.
218+ </description>
219+ <arg name="id" type="new_id" interface="xdg_toplevel_session_v1"/>
220+ <arg name="toplevel" type="object" interface="xdg_toplevel"/>
221+ <arg name="name" type="string" summary="name identifying the toplevel"/>
222+ </request>
223+
224+ <request name="restore_toplevel">
225+ <description summary="restore a surface state">
226+ Inform the compositor that the toplevel associated with the passed name
227+ should have its window management state restored.
228+
229+ If the toplevel name was previously granted to another xdg_toplevel,
230+ the 'name_in_use' protocol error will be raised.
231+
232+ The toplevel object must not be added more than once to any session
233+ created by the client, otherwise the 'already_added' protocol error
234+ will be raised.
235+
236+ This request must be called prior to the first commit on the associated
237+ wl_surface after creating the toplevel, otherwise an 'already_mapped'
238+ error is raised.
239+
240+ As part of the initial configure sequence, if the toplevel was
241+ successfully restored, a xdg_toplevel_session_v1.restored event is
242+ emitted. If the toplevel name was not known in the session, this request
243+ will be equivalent to the xdg_toplevel_session_v1.add_toplevel request,
244+ and no such event will be emitted. See the xdg_toplevel_session_v1.restored
245+ event for further details.
246+
247+ The name string must be UTF-8 encoded. It is also limited by the maximum
248+ length of wayland messages (around 4KB). The 'invalid_name' protocol
249+ error will be raised if an invalid string is provided.
250+ </description>
251+ <arg name="id" type="new_id" interface="xdg_toplevel_session_v1"/>
252+ <arg name="toplevel" type="object" interface="xdg_toplevel"/>
253+ <arg name="name" type="string" summary="name identifying the toplevel"/>
254+ </request>
255+
256+ <request name="remove_toplevel">
257+ <description summary="remove a surface from the session">
258+ Remove a specified surface from the session and render any related
259+ xdg_toplevel_session_v1 object inert. The compositor should remove any
260+ data related to the toplevel in the corresponding session from its internal
261+ storage.
262+
263+ The window is specified by its name in the session. The name string
264+ must be encoded in UTF-8, and it is limited in size by the maximum
265+ length of wayland messages (around 4KB).
266+ </description>
267+ <arg name="name" type="string" summary="name identifying the toplevel"/>
268+ </request>
269+
270+ <event name="created">
271+ <description summary="newly-created session id">
272+ Emitted at most once some time after getting a new session object. It
273+ means that no previous state was restored, and a new session was created.
274+ The passed id can be persistently stored and used to restore previous
275+ sessions.
276+ </description>
277+ <arg name="session_id" type="string"/>
278+ </event>
279+
280+ <event name="restored">
281+ <description summary="the session has been restored">
282+ Emitted at most once some time after getting a new session object. It
283+ means that previous state was at least partially restored. The same id
284+ can again be used to restore previous sessions.
285+ </description>
286+ </event>
287+
288+ <event name="replaced">
289+ <description summary="the session has been replaced">
290+ Emitted at most once, if the session was taken over by some other
291+ client. When this happens, the session and all its toplevel session
292+ objects become inert, and should be destroyed.
293+ </description>
294+ </event>
295+ </interface>
296+
297+ <interface name="xdg_toplevel_session_v1" version="1">
298+ <description summary="A session for an application">
299+ A xdg_toplevel_session_v1 resource acts as a handle for the given
300+ toplevel in the session. It allows for receiving events after a
301+ toplevel state was restored, and has the requests to manage them.
302+ </description>
303+
304+ <request name="destroy" type="destructor">
305+ <description summary="Destroy the object">
306+ Destroy the object. This has no effect over window management of the
307+ associated toplevel.
308+ </description>
309+ </request>
310+
311+ <request name="rename">
312+ <description summary="change the name of toplevel session">
313+ Renames the toplevel session. The new name can be used in subsequent requests
314+ to identify this session object. The state associated with this toplevel
315+ session will be preserved.
316+
317+ If the xdg_session_v1 already contains a toplevel with the specified name,
318+ the 'name_in_use' protocol error will be raised.
319+ </description>
320+ <arg name="name" type="string" summary="new name to identify the toplevel"/>
321+ </request>
322+
323+ <event name="restored">
324+ <description summary="a toplevel's session has been restored">
325+ The "restored" event is emitted prior to the first
326+ xdg_toplevel.configure for the toplevel. It will only be emitted after
327+ xdg_session_v1.restore_toplevel, and the initial empty surface state has
328+ been applied, and it indicates that the surface's session is being
329+ restored with this configure event.
330+ </description>
331+ </event>
332+ </interface>
333+</protocol>
A protocols/xdg-toplevel-drag-v1.xml +142 -0
@@ -0,0 +1,142 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<protocol name="xdg_toplevel_drag_v1">
3+
4+ <copyright>
5+ Copyright 2023 David Redondo
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="xdg_toplevel_drag_manager_v1" version="1">
28+ <description summary="Move a window during a drag">
29+ This protocol enhances normal drag and drop with the ability to move a
30+ window at the same time. This allows having detachable parts of a window
31+ that when dragged out of it become a new window and can be dragged over
32+ an existing window to be reattached.
33+
34+ A typical workflow would be when the user starts dragging on top of a
35+ detachable part of a window, the client would create a wl_data_source and
36+ a xdg_toplevel_drag_v1 object and start the drag as normal via
37+ wl_data_device.start_drag. Once the client determines that the detachable
38+ window contents should be detached from the originating window, it creates
39+ a new xdg_toplevel with these contents and issues a
40+ xdg_toplevel_drag_v1.attach request before mapping it. From now on the new
41+ window is moved by the compositor during the drag as if the client called
42+ xdg_toplevel.move.
43+
44+ Dragging an existing window is similar. The client creates a
45+ xdg_toplevel_drag_v1 object and attaches the existing toplevel before
46+ starting the drag.
47+
48+ Clients use the existing drag and drop mechanism to detect when a window
49+ can be docked or undocked. If the client wants to snap a window into a
50+ parent window it should delete or unmap the dragged top-level. If the
51+ contents should be detached again it attaches a new toplevel as described
52+ above. If a drag operation is cancelled without being dropped, clients
53+ should revert to the previous state, deleting any newly created windows
54+ as appropriate. When a drag operation ends as indicated by
55+ wl_data_source.dnd_drop_performed the dragged toplevel window's final
56+ position is determined as if a xdg_toplevel_move operation ended.
57+
58+ Warning! The protocol described in this file is currently in the testing
59+ phase. Backward compatible changes may be added together with the
60+ corresponding interface version bump. Backward incompatible changes can
61+ only be done by creating a new major version of the extension.
62+ </description>
63+
64+ <enum name="error">
65+ <entry name="invalid_source" value="0"
66+ summary="data_source already used for toplevel drag"/>
67+ </enum>
68+
69+ <request name="destroy" type="destructor">
70+ <description summary="destroy the xdg_toplevel_drag_manager_v1 object">
71+ Destroy this xdg_toplevel_drag_manager_v1 object. Other objects,
72+ including xdg_toplevel_drag_v1 objects created by this factory, are not
73+ affected by this request.
74+ </description>
75+ </request>
76+
77+ <request name="get_xdg_toplevel_drag">
78+ <description summary="get an xdg_toplevel_drag for a wl_data_source">
79+ Create an xdg_toplevel_drag for a drag and drop operation that is going
80+ to be started with data_source.
81+
82+ This request can only be made on sources used in drag-and-drop, so it
83+ must be performed before wl_data_device.start_drag. Attempting to use
84+ the source other than for drag-and-drop such as in
85+ wl_data_device.set_selection will raise an invalid_source error.
86+
87+ Destroying data_source while a toplevel is attached to the
88+ xdg_toplevel_drag is undefined.
89+ </description>
90+
91+ <arg name="id" type="new_id" interface="xdg_toplevel_drag_v1"/>
92+ <arg name="data_source" type="object" interface="wl_data_source"/>
93+ </request>
94+ </interface>
95+
96+ <interface name="xdg_toplevel_drag_v1" version="1">
97+ <description summary="Object representing a toplevel move during a drag">
98+ </description>
99+
100+ <enum name="error">
101+ <entry name="toplevel_attached" value="0"
102+ summary="valid toplevel already attached"/>
103+ <entry name="ongoing_drag" value="1"
104+ summary="drag has not ended" />
105+ </enum>
106+
107+ <request name="destroy" type="destructor">
108+ <description summary="destroy an xdg_toplevel_drag_v1 object">
109+ Destroy this xdg_toplevel_drag_v1 object. This request must only be
110+ called after the underlying wl_data_source drag has ended, as indicated
111+ by the dnd_drop_performed or cancelled events. In any other case an
112+ ongoing_drag error is raised.
113+ </description>
114+ </request>
115+
116+ <request name="attach">
117+ <description summary="Move a toplevel with the drag operation">
118+ Request that the window will be moved with the cursor during the drag
119+ operation. The offset is a hint to the compositor how the toplevel
120+ should be positioned relative to the cursor hotspot in surface local
121+ coordinates and relative to the geometry of the toplevel being attached.
122+ See xdg_surface.set_window_geometry. For example it might only
123+ be used when an unmapped window is attached. The attached window
124+ does not participate in the selection of the drag target.
125+
126+ If the toplevel is unmapped while it is attached, it is automatically
127+ detached from the drag. In this case this request has to be called again
128+ if the window should be attached after it is remapped.
129+
130+ This request can be called multiple times but issuing it while a
131+ toplevel with an active role is attached raises a toplevel_attached
132+ error.
133+ </description>
134+
135+ <arg name="toplevel" type="object" interface="xdg_toplevel"/>
136+ <arg name="x_offset" type="int" summary="dragged surface x offset"/>
137+ <arg name="y_offset" type="int" summary="dragged surface y offset"/>
138+ </request>
139+
140+ </interface>
141+</protocol>
142+
A protocols/xwayland-keyboard-grab-unstable-v1.xml +121 -0
@@ -0,0 +1,121 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<protocol name="xwayland_keyboard_grab_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 grabbing the keyboard from Xwayland">
28+ This protocol is application-specific to meet the needs of the X11
29+ protocol through Xwayland. It provides a way for Xwayland to request
30+ all keyboard events to be forwarded to a surface even when the
31+ surface does not have keyboard focus.
32+
33+ In the X11 protocol, a client may request an "active grab" on the
34+ keyboard. On success, all key events are reported only to the
35+ grabbing X11 client. For details, see XGrabKeyboard(3).
36+
37+ The core Wayland protocol does not have a notion of an active
38+ keyboard grab. When running in Xwayland, X11 applications may
39+ acquire an active grab inside Xwayland but that cannot be translated
40+ to the Wayland compositor who may set the input focus to some other
41+ surface. In doing so, it breaks the X11 client assumption that all
42+ key events are reported to the grabbing client.
43+
44+ This protocol specifies a way for Xwayland to request all keyboard
45+ be directed to the given surface. The protocol does not guarantee
46+ that the compositor will honor this request and it does not
47+ prescribe user interfaces on how to handle the respond. For example,
48+ a compositor may inform the user that all key events are now
49+ forwarded to the given client surface, or it may ask the user for
50+ permission to do so.
51+
52+ Compositors are required to restrict access to this application
53+ specific protocol to Xwayland alone.
54+
55+ Warning! The protocol described in this file is experimental and
56+ backward incompatible changes may be made. Backward compatible
57+ changes may be added together with the corresponding interface
58+ version bump.
59+ Backward incompatible changes are done by bumping the version
60+ number in the protocol and interface names and resetting the
61+ interface version. Once the protocol is to be declared stable,
62+ the 'z' prefix and the version number in the protocol and
63+ interface names are removed and the interface version number is
64+ reset.
65+ </description>
66+
67+ <interface name="zwp_xwayland_keyboard_grab_manager_v1" version="1">
68+ <description summary="context object for keyboard grab manager">
69+ A global interface used for grabbing the keyboard.
70+ </description>
71+
72+ <request name="destroy" type="destructor">
73+ <description summary="destroy the keyboard grab manager">
74+ Destroy the keyboard grab manager.
75+ </description>
76+ </request>
77+
78+ <request name="grab_keyboard">
79+ <description summary="grab the keyboard to a surface">
80+ The grab_keyboard request asks for a grab of the keyboard, forcing
81+ the keyboard focus for the given seat upon the given surface.
82+
83+ The protocol provides no guarantee that the grab is ever satisfied,
84+ and does not require the compositor to send an error if the grab
85+ cannot ever be satisfied. It is thus possible to request a keyboard
86+ grab that will never be effective.
87+
88+ The protocol:
89+
90+ * does not guarantee that the grab itself is applied for a surface,
91+ the grab request may be silently ignored by the compositor,
92+ * does not guarantee that any events are sent to this client even
93+ if the grab is applied to a surface,
94+ * does not guarantee that events sent to this client are exhaustive,
95+ a compositor may filter some events for its own consumption,
96+ * does not guarantee that events sent to this client are continuous,
97+ a compositor may change and reroute keyboard events while the grab
98+ is nominally active.
99+ </description>
100+
101+ <arg name="id" type="new_id" interface="zwp_xwayland_keyboard_grab_v1"/>
102+ <arg name="surface" type="object" interface="wl_surface"
103+ summary="surface to report keyboard events to"/>
104+ <arg name="seat" type="object" interface="wl_seat"
105+ summary="the seat for which the keyboard should be grabbed"/>
106+ </request>
107+ </interface>
108+
109+ <interface name="zwp_xwayland_keyboard_grab_v1" version="1">
110+ <description summary="interface for grabbing the keyboard">
111+ A global interface used for grabbing the keyboard.
112+ </description>
113+
114+ <request name="destroy" type="destructor">
115+ <description summary="destroy the grabbed keyboard object">
116+ Destroy the grabbed keyboard object. If applicable, the compositor
117+ will ungrab the keyboard.
118+ </description>
119+ </request>
120+ </interface>
121+</protocol>
A protocols/xwayland-shell-v1.xml +161 -0
@@ -0,0 +1,161 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<protocol name="xwayland_shell_v1">
3+
4+ <copyright>
5+ Copyright © 2022 Joshua Ashton
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 associating X11 windows to wl_surfaces">
28+ This protocol adds a xwayland_surface role which allows an Xwayland
29+ server to associate an X11 window to a wl_surface.
30+
31+ Before this protocol, this would be done via the Xwayland server
32+ providing the wl_surface's resource id via the a client message with
33+ the WL_SURFACE_ID atom on the X window.
34+ This was problematic as a race could occur if the wl_surface
35+ associated with a WL_SURFACE_ID for a window was destroyed before the
36+ client message was processed by the compositor and another surface
37+ (or other object) had taken its id due to recycling.
38+
39+ This protocol solves the problem by moving the X11 window to wl_surface
40+ association step to the Wayland side, which means that the association
41+ cannot happen out-of-sync with the resource lifetime of the wl_surface.
42+
43+ This protocol avoids duplicating the race on the other side by adding a
44+ non-zero monotonic serial number which is entirely unique that is set on
45+ both the wl_surface (via. xwayland_surface_v1's set_serial method) and
46+ the X11 window (via. the `WL_SURFACE_SERIAL` client message) that can be
47+ used to associate them, and synchronize the two timelines.
48+
49+ The key words "must", "must not", "required", "shall", "shall not",
50+ "should", "should not", "recommended", "may", and "optional" in this
51+ document are to be interpreted as described in IETF RFC 2119.
52+
53+ Warning! The protocol described in this file is currently in the testing
54+ phase. Backward compatible changes may be added together with the
55+ corresponding interface version bump. Backward incompatible changes can
56+ only be done by creating a new major version of the extension.
57+ </description>
58+
59+ <interface name="xwayland_shell_v1" version="1">
60+ <description summary="context object for Xwayland shell">
61+ xwayland_shell_v1 is a singleton global object that
62+ provides the ability to create a xwayland_surface_v1 object
63+ for a given wl_surface.
64+
65+ This interface is intended to be bound by the Xwayland server.
66+
67+ A compositor must not allow clients other than Xwayland to
68+ bind to this interface. A compositor should hide this global
69+ from other clients' wl_registry.
70+ A client the compositor does not consider to be an Xwayland
71+ server attempting to bind this interface will result in
72+ an implementation-defined error.
73+
74+ An Xwayland server that has bound this interface must not
75+ set the `WL_SURFACE_ID` atom on a window.
76+ </description>
77+
78+ <enum name="error">
79+ <entry name="role" value="0" summary="given wl_surface has another role"/>
80+ </enum>
81+
82+ <request name="destroy" type="destructor">
83+ <description summary="destroy the Xwayland shell object">
84+ Destroy the xwayland_shell_v1 object.
85+
86+ The child objects created via this interface are unaffected.
87+ </description>
88+ </request>
89+
90+ <request name="get_xwayland_surface">
91+ <description summary="assign the xwayland_surface surface role">
92+ Create an xwayland_surface_v1 interface for a given wl_surface
93+ object and gives it the xwayland_surface role.
94+
95+ It is illegal to create an xwayland_surface_v1 for a wl_surface
96+ which already has an assigned role and this will result in the
97+ `role` protocol error.
98+
99+ See the documentation of xwayland_surface_v1 for more details
100+ about what an xwayland_surface_v1 is and how it is used.
101+ </description>
102+
103+ <arg name="id" type="new_id" interface="xwayland_surface_v1"/>
104+ <arg name="surface" type="object" interface="wl_surface"/>
105+ </request>
106+ </interface>
107+
108+ <interface name="xwayland_surface_v1" version="1">
109+ <description summary="interface for associating Xwayland windows to wl_surfaces">
110+ An Xwayland surface is a surface managed by an Xwayland server.
111+ It is used for associating surfaces to Xwayland windows.
112+
113+ The Xwayland server associated with actions in this interface is
114+ determined by the Wayland client making the request.
115+
116+ The client must call wl_surface.commit on the corresponding wl_surface
117+ for the xwayland_surface_v1 state to take effect.
118+ </description>
119+
120+ <enum name="error">
121+ <entry name="already_associated" value="0" summary="given wl_surface is already associated with an X11 window"/>
122+ <entry name="invalid_serial" value="1" summary="serial was not valid"/>
123+ </enum>
124+
125+ <request name="set_serial">
126+ <description summary="associates a Xwayland window to a wl_surface">
127+ Associates an Xwayland window to a wl_surface.
128+ The association state is double-buffered, see wl_surface.commit.
129+
130+ The `serial_lo` and `serial_hi` parameters specify a non-zero
131+ monotonic serial number which is entirely unique and provided by the
132+ Xwayland server equal to the serial value provided by a client message
133+ with a message type of the `WL_SURFACE_SERIAL` atom on the X11 window
134+ for this surface to be associated to.
135+
136+ The serial value in the `WL_SURFACE_SERIAL` client message is specified
137+ as having the lo-bits specified in `l[0]` and the hi-bits specified
138+ in `l[1]`.
139+
140+ If the serial value provided by `serial_lo` and `serial_hi` is not
141+ valid, the `invalid_serial` protocol error will be raised.
142+
143+ An X11 window may be associated with multiple surfaces throughout its
144+ lifespan. (eg. unmapping and remapping a window).
145+
146+ For each wl_surface, this state must not be committed more than once,
147+ otherwise the `already_associated` protocol error will be raised.
148+ </description>
149+ <arg name="serial_lo" type="uint" summary="The lower 32-bits of the serial number associated with the X11 window"/>
150+ <arg name="serial_hi" type="uint" summary="The upper 32-bits of the serial number associated with the X11 window"/>
151+ </request>
152+
153+ <request name="destroy" type="destructor">
154+ <description summary="destroy the Xwayland surface object">
155+ Destroy the xwayland_surface_v1 object.
156+
157+ Any already existing associations are unaffected by this action.
158+ </description>
159+ </request>
160+ </interface>
161+</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