detached 2e85f57

Merge pull request #9 from bnema/refactor/remove-protocol-bindings

refactor(protocol)!: move protocol bindings to go-wayland-bindings
commit
2e85f575149cc795cbb5bf6bcced6d16698c995a
author
bnema · · 2026-10-01 06:18 UTC
committer
GitHub · · 2026-10-01 06:18 UTC
merge of
5f793eb + 294942a · diff against the first parent
signature
GPG UnverifiedB5690EEEBB952194 The key is unknown
refs
tag: v0.9.0
133 files · +378 -36984
M .github/workflows/ci.yml +29 -1
@@ -12,6 +12,34 @@ jobs:
1212 - uses: actions/setup-go@v5
1313 with:
1414 go-version: '1.27'
15- - run: sudo apt-get install -y libwayland-server0 libwayland-client0 wayland-utils
15+ - run: sudo apt-get update && sudo apt-get install -y --no-install-recommends libwayland-server0
1616 - run: make check
1717 - run: make race
18+
19+ bindings:
20+ runs-on: ubuntu-latest
21+ permissions:
22+ contents: read
23+ steps:
24+ - uses: actions/checkout@v4
25+ with:
26+ path: purego-libwayland
27+ persist-credentials: false
28+ - uses: actions/checkout@v4
29+ with:
30+ repository: bnema/go-wayland-bindings
31+ ref: main
32+ path: bindings
33+ persist-credentials: false
34+ - uses: actions/setup-go@v5
35+ with:
36+ go-version-file: bindings/go.mod
37+ - run: sudo apt-get update && sudo apt-get install -y --no-install-recommends libwayland-server0
38+ - name: Build and test go-wayland-bindings against this checkout
39+ working-directory: bindings
40+ run: |
41+ go mod edit -replace github.com/bnema/purego-libwayland=../purego-libwayland
42+ go mod tidy
43+ CGO_ENABLED=0 go build ./...
44+ go vet ./server/...
45+ CGO_ENABLED=0 go test ./server/... ./internal/e2e/...
M Makefile +1 -4
@@ -1,7 +1,4 @@
1-.PHONY: test vet race check generate
2-
3-generate:
4- CGO_ENABLED=0 go generate ./protocol
1+.PHONY: test vet race check
52
63 test:
74 CGO_ENABLED=0 go test ./...
M README.md +5 -5
@@ -1,10 +1,10 @@
11 # purego-libwayland
22
3-Go bindings for libwayland without cgo, loaded at runtime through github.com/bnema/purego.
3+Go bindings for libwayland-server without cgo, loaded at runtime through github.com/bnema/purego.
44
55 ## Status
66
7-Early v0.x. Server bindings and generated Wayland protocol packages are available.
7+Early v0.x. A server-side libwayland runtime (`server/` package).
88
99 ## Requirements
1010
@@ -16,10 +16,10 @@ Linux, Go 1.27, and `libwayland-server.so.0` at runtime.
1616 CGO_ENABLED=0 go build ./...
1717 ```
1818
19-## Protocol generation
19+## Protocol bindings
2020
21-Vendored protocol XML lives in `protocols/`. Run `make generate` to regenerate the Go packages in `protocol/`. Each XML file keeps the copyright and license of its upstream project (wayland, wayland-protocols, wlr-protocols, KDE).
21+Generated protocol bindings live in [github.com/bnema/go-wayland-bindings](https://github.com/bnema/go-wayland-bindings), one package per protocol under `server/<pkg>`, for example `server/xdgshell` and `server/wlrlayershell`. They build on this runtime's `server` package.
2222
2323 ## License
2424
25-MIT, see `LICENSE`. Vendored protocol XML files keep their own licenses.
25+MIT, see `LICENSE`.
D cmd/wlgen/main.go +0 -438
@@ -1,438 +0,0 @@
1-package main
2-
3-import (
4- "bytes"
5- "encoding/xml"
6- "flag"
7- "fmt"
8- "go/format"
9- "os"
10- "sort"
11- "strings"
12- "unicode"
13-)
14-
15-type protocol struct {
16- Interfaces []iface `xml:"interface"`
17-}
18-type iface struct {
19- Name string `xml:"name,attr"`
20- Version int32 `xml:"version,attr"`
21- Description description `xml:"description"`
22- Requests []message `xml:"request"`
23- Events []message `xml:"event"`
24- Enums []enum `xml:"enum"`
25-}
26-type description struct {
27- Summary string `xml:"summary,attr"`
28-}
29-type message struct {
30- Name string `xml:"name,attr"`
31- Type string `xml:"type,attr"`
32- Since int `xml:"since,attr"`
33- Description description `xml:"description"`
34- Args []arg `xml:"arg"`
35-}
36-type arg struct {
37- Name string `xml:"name,attr"`
38- Type string `xml:"type,attr"`
39- Interface string `xml:"interface,attr"`
40- Nullable bool `xml:"allow-null,attr"`
41-}
42-type enum struct {
43- Name string `xml:"name,attr"`
44- Bitfield bool `xml:"bitfield,attr"`
45- Description description `xml:"description"`
46- Entries []entry `xml:"entry"`
47-}
48-type entry struct {
49- Name string `xml:"name,attr"`
50- Value string `xml:"value,attr"`
51-}
52-type flags []string
53-
54-func (f *flags) String() string { return strings.Join(*f, ",") }
55-func (f *flags) Set(s string) error { *f = append(*f, s); return nil }
56-func parse(path string) (protocol, error) {
57- var p protocol
58- b, e := os.ReadFile(path)
59- if e == nil {
60- e = xml.Unmarshal(b, &p)
61- }
62- return p, e
63-}
64-func camel(s string) string {
65- var b strings.Builder
66- for _, part := range strings.Split(s, "_") {
67- if part == "" {
68- continue
69- }
70- r := []rune(part)
71- b.WriteRune(unicode.ToUpper(r[0]))
72- b.WriteString(string(r[1:]))
73- }
74- return b.String()
75-}
76-func name(s string) string {
77- for _, prefix := range []string{"wl_", "xdg_"} {
78- if strings.HasPrefix(s, prefix) {
79- s = strings.TrimPrefix(s, prefix)
80- break
81- }
82- }
83- return camel(s)
84-}
85-func signature(m message) string {
86- var b strings.Builder
87- if m.Since > 1 {
88- fmt.Fprint(&b, m.Since)
89- }
90- for _, a := range m.Args {
91- if a.Type == "new_id" && a.Interface == "" {
92- b.WriteString("sun")
93- continue
94- }
95- if a.Nullable {
96- b.WriteByte('?')
97- }
98- b.WriteString(map[string]string{"int": "i", "uint": "u", "fixed": "f", "string": "s", "array": "a", "object": "o", "new_id": "n", "fd": "h"}[a.Type])
99- }
100- return b.String()
101-}
102-
103-type gen struct {
104- bytes.Buffer
105- owners map[string]string
106- imports map[string]string
107-}
108-
109-func (g *gen) p(f string, a ...any) { fmt.Fprintf(&g.Buffer, f, a...) }
110-func (g *gen) ref(s string) (string, error) {
111- if s == "" {
112- return "nil", nil
113- }
114- alias, ok := g.owners[s]
115- if !ok {
116- return "", fmt.Errorf("unknown interface %s", s)
117- }
118- if alias != "" {
119- alias += "."
120- }
121- return alias + name(s) + "Interface", nil
122-}
123-func (g *gen) wrapper(s string) string {
124- alias := g.owners[s]
125- if alias != "" {
126- alias += "."
127- }
128- return alias + name(s)
129-}
130-func (g *gen) table(m message) error {
131- var ts []string
132- for _, a := range m.Args {
133- if a.Type == "new_id" && a.Interface == "" {
134- ts = append(ts, "nil", "nil", "nil")
135- continue
136- }
137- t := "nil"
138- if a.Type == "object" || a.Type == "new_id" {
139- var e error
140- t, e = g.ref(a.Interface)
141- if e != nil {
142- return e
143- }
144- }
145- ts = append(ts, t)
146- }
147- g.p("{Name:%q,Signature:%q,Types:[]*server.Interface{%s}},\n", m.Name, signature(m), strings.Join(ts, ","))
148- return nil
149-}
150-func (g *gen) typ(a arg, event bool) string {
151- switch a.Type {
152- case "uint":
153- return "uint32"
154- case "int":
155- return "int32"
156- case "fixed":
157- return "server.Fixed"
158- case "string":
159- return "string"
160- case "array":
161- return "[]byte"
162- case "fd":
163- return "int"
164- case "new_id":
165- if !event {
166- return "uint32"
167- }
168- fallthrough
169- case "object":
170- if a.Interface == "" {
171- return "*server.Resource"
172- }
173- return "*" + g.wrapper(a.Interface)
174- }
175- return "server.Arg"
176-}
177-func param(a arg) string {
178- s := a.Name
179- if parts := strings.Split(s, "_"); len(parts) > 1 {
180- s = parts[0]
181- for _, part := range parts[1:] {
182- s += camel(part)
183- }
184- }
185- switch s {
186- case "interface", "type", "map", "range", "func", "var", "package", "select", "default", "go", "defer", "return", "chan", "import":
187- return s + "Arg"
188- }
189- return s
190-}
191-func (g *gen) params(m message, event bool) {
192- for _, a := range m.Args {
193- if a.Type == "new_id" && a.Interface == "" && !event {
194- g.p(", interfaceName string, version uint32, id uint32")
195- continue
196- }
197- g.p(", %s %s", param(a), g.typ(a, event))
198- }
199-}
200-func (g *gen) generate(pr protocol, pkg string) ([]byte, error) {
201- g.p("// Code generated by wlgen; DO NOT EDIT.\npackage %s\nimport (\"github.com/bnema/purego-libwayland/server\"\n", pkg)
202- pin := false
203- for _, it := range pr.Interfaces {
204- for _, m := range it.Events {
205- for _, a := range m.Args {
206- if a.Type == "string" || a.Type == "array" || (a.Type == "new_id" && a.Interface == "") {
207- pin = true
208- }
209- }
210- }
211- }
212- if pin {
213- g.p("\"runtime\"\n")
214- }
215- for _, it := range pr.Interfaces {
216- if len(it.Requests) > 0 {
217- g.p("\"fmt\"\n")
218- break
219- }
220- }
221- aliases := make([]string, 0, len(g.imports))
222- for alias := range g.imports {
223- aliases = append(aliases, alias)
224- }
225- sort.Strings(aliases)
226- for _, alias := range aliases {
227- g.p("%s %q\n", alias, g.imports[alias])
228- }
229- g.p(")\n")
230- for _, it := range pr.Interfaces {
231- g.p("var %sInterface *server.Interface\n", name(it.Name))
232- }
233- g.p("func init(){\n")
234- for _, it := range pr.Interfaces {
235- g.p("%sInterface=&server.Interface{Name:%q,Version:%d}\n", name(it.Name), it.Name, it.Version)
236- }
237- for _, it := range pr.Interfaces {
238- n := name(it.Name)
239- g.p("%sInterface.Requests=[]server.Message{\n", n)
240- for _, m := range it.Requests {
241- if e := g.table(m); e != nil {
242- return nil, e
243- }
244- }
245- g.p("}\n%sInterface.Events=[]server.Message{\n", n)
246- for _, m := range it.Events {
247- if e := g.table(m); e != nil {
248- return nil, e
249- }
250- }
251- g.p("}\n")
252- }
253- g.p("if err:=server.NewInterfaces(")
254- for _, it := range pr.Interfaces {
255- g.p("%sInterface,", name(it.Name))
256- }
257- g.p(");err!=nil{panic(err)}}\n")
258- for _, it := range pr.Interfaces {
259- n := name(it.Name)
260- g.p("// %s %s.\ntype %s struct{*server.Resource}\nfunc Wrap%s(r *server.Resource)*%s{if r==nil{return nil};return &%s{r}}\n", n, it.Description.Summary, n, n, n, n)
261- for j, m := range it.Requests {
262- g.p("const %sRequest%s uint32=%d\n", n, camel(m.Name), j)
263- }
264- for j, m := range it.Events {
265- g.p("const %sEvent%s uint32=%d\n", n, camel(m.Name), j)
266- }
267- for _, en := range it.Enums {
268- t := n + camel(en.Name)
269- g.p("// %s %s", t, en.Description.Summary)
270- if en.Bitfield {
271- g.p(" (bitfield)")
272- }
273- g.p(".\ntype %s uint32\nconst(\n", t)
274- for _, v := range en.Entries {
275- g.p("%s%s %s=%s\n", t, camel(v.Name), t, v.Value)
276- }
277- g.p(")\n")
278- }
279- g.p("// %sHandler handles %s requests.\ntype %sHandler interface{\n", n, it.Name, n)
280- for _, m := range it.Requests {
281- g.p("%s(self *%s", camel(m.Name), n)
282- g.params(m, false)
283- g.p(")\n")
284- }
285- g.p("}\nfunc New%s(c server.Client,version int32,id uint32,h %sHandler)(*%s,error){", n, n, n)
286- if len(it.Requests) > 0 {
287- g.p("if h==nil{return nil,fmt.Errorf(%q)}\n", "purego-libwayland: nil handler for "+it.Name)
288- }
289- g.p("var self *%s\nr,err:=c.CreateResource(%sInterface,version,id,func(_ *server.Resource,opcode uint32,args []server.Arg){switch opcode{\n", n, n)
290- for j, m := range it.Requests {
291- g.p("case %d:h.%s(self", j, camel(m.Name))
292- idx := 0
293- for _, a := range m.Args {
294- if a.Type == "new_id" && a.Interface == "" {
295- g.p(",args[%d].String(),args[%d].Uint(),args[%d].NewID()", idx, idx+1, idx+2)
296- idx += 3
297- continue
298- }
299- x := fmt.Sprintf("args[%d]", idx)
300- idx++
301- switch a.Type {
302- case "uint", "int", "fixed", "string", "array", "fd", "new_id":
303- accessor := camel(a.Type)
304- if a.Type == "new_id" {
305- accessor = "NewID"
306- }
307- g.p(",%s.%s()", x, accessor)
308- case "object":
309- if a.Interface == "" {
310- g.p(",%s.Resource()", x)
311- } else {
312- g.p(",%sWrap%s(%s.Resource())", func() string {
313- if v := g.owners[a.Interface]; v != "" {
314- return v + "."
315- }
316- return ""
317- }(), name(a.Interface), x)
318- }
319- }
320- }
321- g.p(")")
322- if m.Type == "destructor" {
323- g.p(";self.Destroy()")
324- }
325- g.p("\n")
326- }
327- g.p("}});if err!=nil{return nil,err};self=Wrap%s(r);r.Data=self;return self,nil}\n", n)
328- for _, m := range it.Events {
329- g.p("// Send%s %s", camel(m.Name), m.Description.Summary)
330- if m.Since > 1 {
331- g.p(" (since version %d)", m.Since)
332- }
333- g.p(".\nfunc(self *%s)Send%s(", n, camel(m.Name))
334- for i, a := range m.Args {
335- if i > 0 {
336- g.p(",")
337- }
338- g.p("%s %s", param(a), g.typ(a, true))
339- }
340- g.p("){\n")
341- needsPin := false
342- for _, a := range m.Args {
343- if a.Type == "string" || a.Type == "array" || (a.Type == "new_id" && a.Interface == "") {
344- needsPin = true
345- }
346- }
347- if needsPin {
348- g.p("var p runtime.Pinner;defer p.Unpin()\n")
349- }
350- g.p("self.PostEvent(%sEvent%s", n, camel(m.Name))
351- for _, a := range m.Args {
352- v := param(a)
353- if a.Type == "new_id" && a.Interface == "" {
354- g.p(",server.String(&p,%s.Iface().Name,false),server.Uint(uint32(%s.Version())),server.NewID(%s)", v, v, v)
355- continue
356- }
357- switch a.Type {
358- case "uint", "int", "fd":
359- g.p(",server.%s(%s)", map[string]string{"uint": "Uint", "int": "Int", "fd": "Fd"}[a.Type], v)
360- case "fixed":
361- g.p(",server.FixedArg(%s)", v)
362- case "string":
363- g.p(",server.String(&p,%s,%t)", v, a.Nullable)
364- case "array":
365- g.p(",server.Array(&p,%s)", v)
366- case "object", "new_id":
367- constructor := "Object"
368- if a.Type == "new_id" {
369- constructor = "NewID"
370- }
371- if a.Interface == "" {
372- g.p(",server.%s(%s)", constructor, v)
373- } else {
374- g.p(",server.%s(resourceOf(%s))", constructor, v)
375- }
376- }
377- }
378- g.p(")\n}\n")
379- }
380- g.p("func New%sGlobal(d *server.Display,version int32,bind server.BindFunc)error{return d.CreateGlobal(%sInterface,version,bind)}\n", n, n)
381- }
382- g.p("func resourceOf(v interface{GetResource()*server.Resource})*server.Resource{if v==nil{return nil};return v.GetResource()}\n")
383- for _, it := range pr.Interfaces {
384- n := name(it.Name)
385- g.p("func(self *%s)GetResource()*server.Resource{if self==nil{return nil};return self.Resource}\n", n)
386- }
387- return format.Source(g.Bytes())
388-}
389-func main() {
390- if e := run(); e != nil {
391- fmt.Fprintln(os.Stderr, e)
392- os.Exit(1)
393- }
394-}
395-func run() error {
396- var im, ix flags
397- flag.Var(&im, "import", "alias=Go package path")
398- flag.Var(&ix, "import-xml", "alias=protocol XML")
399- pkg := flag.String("package", "", "Go package")
400- out := flag.String("out", "", "output file")
401- flag.Parse()
402- if *pkg == "" || *out == "" || flag.NArg() != 1 {
403- return fmt.Errorf("usage: wlgen -package name -out file [-import alias=path -import-xml alias=xml] protocol.xml")
404- }
405- g := &gen{owners: map[string]string{}, imports: map[string]string{}}
406- for _, s := range im {
407- a, v, ok := strings.Cut(s, "=")
408- if !ok {
409- return fmt.Errorf("invalid import %q", s)
410- }
411- g.imports[a] = v
412- }
413- for _, s := range ix {
414- a, v, ok := strings.Cut(s, "=")
415- if !ok || g.imports[a] == "" {
416- return fmt.Errorf("invalid import XML %q", s)
417- }
418- p, e := parse(v)
419- if e != nil {
420- return e
421- }
422- for _, it := range p.Interfaces {
423- g.owners[it.Name] = a
424- }
425- }
426- p, e := parse(flag.Arg(0))
427- if e != nil {
428- return e
429- }
430- for _, it := range p.Interfaces {
431- g.owners[it.Name] = ""
432- }
433- b, e := g.generate(p, *pkg)
434- if e != nil {
435- return e
436- }
437- return os.WriteFile(*out, b, 0644)
438-}
D cmd/wlgen/main_test.go +0 -34
@@ -1,34 +0,0 @@
1-package main
2-
3-import (
4- "strings"
5- "testing"
6-)
7-
8-func TestUntypedNewIDEvent(t *testing.T) {
9- g := &gen{owners: map[string]string{"test_device": ""}, imports: map[string]string{}}
10- b, err := g.generate(protocol{Interfaces: []iface{{Name: "test_device", Version: 1, Events: []message{{Name: "created", Args: []arg{{Name: "id", Type: "new_id"}}}}}}}, "test")
11- if err != nil {
12- t.Fatal(err)
13- }
14- s := string(b)
15- if !strings.Contains(s, `Signature: "sun"`) || !strings.Contains(s, `server.String(&p, id.Iface().Name, false), server.Uint(uint32(id.Version())), server.NewID(id)`) {
16- t.Fatalf("untyped new_id event missing wire args:\n%s", s)
17- }
18-}
19-
20-func TestSignature(t *testing.T) {
21- cases := []struct {
22- m message
23- want string
24- }{
25- {message{Name: "bind", Args: []arg{{Type: "uint"}, {Type: "new_id"}}}, "usun"},
26- {message{Since: 2, Args: []arg{{Type: "object", Nullable: true}, {Type: "fd"}, {Type: "fixed"}}}, "2?ohf"},
27- {message{Args: []arg{{Type: "new_id", Interface: "wl_surface"}}}, "n"},
28- }
29- for _, c := range cases {
30- if got := signature(c.m); got != c.want {
31- t.Errorf("signature(%+v)=%q, want %q", c.m, got, c.want)
32- }
33- }
34-}
M go.mod +0 -1
@@ -4,6 +4,5 @@ go 1.27
44
55 require (
66 github.com/bnema/purego v0.13.0-bnema.1
7- github.com/bnema/wlturbo v0.2.0
87 golang.org/x/sys v0.48.0
98 )
M go.sum +0 -2 generated file: collapsed
D internal/e2e/args_test.go +0 -253
@@ -1,253 +0,0 @@
1-package e2e_test
2-
3-import (
4- "bytes"
5- "errors"
6- "testing"
7- "time"
8-
9- "github.com/bnema/purego-libwayland/protocol/wayland"
10- "github.com/bnema/purego-libwayland/server"
11- "github.com/bnema/wlturbo"
12- "golang.org/x/sys/unix"
13-)
14-
15-func receive[T any](t *testing.T, ch <-chan T) T {
16- t.Helper()
17- select {
18- case v := <-ch:
19- return v
20- case <-time.After(3 * time.Second):
21- t.Fatal("timed out waiting for event")
22- var zero T
23- return zero
24- }
25-}
26-
27-type argsProxy struct {
28- wlturbo.BaseProxy
29- received chan argsEvent
30- kind string
31-}
32-type argsEvent struct {
33- text string
34- data []byte
35- fixed wlturbo.Fixed
36- fd int
37-}
38-
39-func (p *argsProxy) Dispatch(e *wlturbo.Event) {
40- switch p.kind {
41- case "seat":
42- p.received <- argsEvent{text: e.String()}
43- case "keyboard":
44- if e.Opcode == uint16(wayland.KeyboardEventKeymap) {
45- _ = e.Uint32()
46- p.received <- argsEvent{fd: int(e.Fd())}
47- } else if e.Opcode == uint16(wayland.KeyboardEventEnter) {
48- _ = e.Uint32()
49- _ = e.Uint32()
50- p.received <- argsEvent{data: e.Array()}
51- }
52- case "pointer":
53- _ = e.Uint32()
54- p.received <- argsEvent{fixed: e.Fixed()}
55- }
56-}
57-
58-type sourceHandler struct{ requests chan string }
59-
60-func (h sourceHandler) Offer(_ *wayland.DataSource, mimeType string) { h.requests <- mimeType }
61-func (sourceHandler) Destroy(*wayland.DataSource) {}
62-func (sourceHandler) SetActions(*wayland.DataSource, uint32) {}
63-
64-type managerHandler struct {
65- requests chan string
66- t *testing.T
67-}
68-
69-func (h managerHandler) CreateDataSource(self *wayland.DataDeviceManager, id uint32) {
70- if _, err := wayland.NewDataSource(self.Client(), 1, id, sourceHandler{h.requests}); err != nil {
71- h.t.Error(err)
72- }
73-}
74-func (managerHandler) GetDataDevice(*wayland.DataDeviceManager, uint32, *wayland.Seat) {}
75-func (managerHandler) Release(*wayland.DataDeviceManager) {}
76-
77-type shmHandler struct {
78- requests chan string
79- t *testing.T
80-}
81-
82-func (h shmHandler) CreatePool(self *wayland.Shm, id uint32, fd int, size int32) {
83- defer unix.Close(fd)
84- h.requests <- "pool"
85- if _, err := wayland.NewShmPool(self.Client(), 1, id, poolHandler{}); err != nil {
86- h.t.Error(err)
87- }
88-}
89-func (shmHandler) Release(*wayland.Shm) {}
90-
91-type poolHandler struct{}
92-
93-func (poolHandler) CreateBuffer(*wayland.ShmPool, uint32, int32, int32, int32, int32, uint32) {}
94-func (poolHandler) Destroy(*wayland.ShmPool) {}
95-func (poolHandler) Resize(self *wayland.ShmPool, size int32) { self.PostError(7, "bad % request") }
96-
97-type seatHandler struct{ t *testing.T }
98-
99-type noPointerRequests struct{}
100-
101-func (noPointerRequests) SetCursor(*wayland.Pointer, uint32, *wayland.Surface, int32, int32) {}
102-func (noPointerRequests) Release(*wayland.Pointer) {}
103-
104-type noKeyboardRequests struct{}
105-
106-func (noKeyboardRequests) Release(*wayland.Keyboard) {}
107-
108-func (h seatHandler) GetPointer(self *wayland.Seat, id uint32) {
109- p, err := wayland.NewPointer(self.Client(), 1, id, noPointerRequests{})
110- if err != nil {
111- h.t.Error(err)
112- return
113- }
114- p.SendMotion(42, server.FixedFromFloat(-1.5), 0)
115-}
116-func (h seatHandler) GetKeyboard(self *wayland.Seat, id uint32) {
117- k, err := wayland.NewKeyboard(self.Client(), 1, id, noKeyboardRequests{})
118- if err != nil {
119- h.t.Error(err)
120- return
121- }
122- fds := []int{0, 0}
123- if err := unix.Pipe(fds); err != nil {
124- h.t.Error(err)
125- return
126- }
127- defer unix.Close(fds[0])
128- defer unix.Close(fds[1])
129- if _, err := unix.Write(fds[1], []byte("fd contents")); err != nil {
130- h.t.Error(err)
131- return
132- }
133- k.SendKeymap(1, fds[0], 11)
134- k.SendEnter(1, wayland.WrapSurface(self.Resource), []byte{1, 2, 3})
135-}
136-func (seatHandler) GetTouch(*wayland.Seat, uint32) {}
137-func (seatHandler) Release(*wayland.Seat) {}
138-func TestArgumentRoundtripAndPostError(t *testing.T) {
139- socket, d, _ := startServer(t)
140- requests := make(chan string, 1)
141- stringsReceived := make(chan string, 1)
142- if !d.Do(func() {
143- if err := wayland.NewDataDeviceManagerGlobal(d, 1, func(c server.Client, v, id uint32) {
144- if _, e := wayland.NewDataDeviceManager(c, int32(v), id, managerHandler{stringsReceived, t}); e != nil {
145- t.Error(e)
146- }
147- }); err != nil {
148- t.Error(err)
149- }
150- if err := wayland.NewShmGlobal(d, 1, func(c server.Client, v, id uint32) {
151- if _, e := wayland.NewShm(c, int32(v), id, shmHandler{requests, t}); e != nil {
152- t.Error(e)
153- }
154- }); err != nil {
155- t.Error(err)
156- }
157- if err := wayland.NewSeatGlobal(d, 1, func(c server.Client, v, id uint32) {
158- s, e := wayland.NewSeat(c, int32(v), id, seatHandler{t})
159- if e != nil {
160- t.Error(e)
161- return
162- }
163- s.SendName("hello")
164- }); err != nil {
165- t.Error(err)
166- }
167- }) {
168- t.Fatal("display stopped")
169- }
170- c, err := wlturbo.Connect(socket)
171- must(t, err)
172- defer c.Close()
173- must(t, c.Roundtrip())
174- bind := func(name string) (uint32, *argsProxy) {
175- t.Helper()
176- g, ok := c.Registry().FindGlobal(name)
177- if !ok {
178- t.Fatalf("%s missing", name)
179- }
180- id, e := c.Registry().BindID(g.Name, g.Interface, 1)
181- must(t, e)
182- p := &argsProxy{received: make(chan argsEvent, 4), kind: name[3:]}
183- p.SetID(id)
184- c.Context().Register(p)
185- return id, p
186- }
187- manager, _ := bind("wl_data_device_manager")
188- seat, sp := bind("wl_seat")
189- shm, _ := bind("wl_shm")
190- source := c.AllocateID()
191- must(t, c.SendRequest(manager, uint16(wayland.DataDeviceManagerRequestCreateDataSource), source))
192- must(t, c.SendRequest(source, uint16(wayland.DataSourceRequestOffer), "request text"))
193- pool := c.AllocateID()
194- fds := []int{0, 0}
195- must(t, unix.Pipe(fds))
196- defer unix.Close(fds[0])
197- defer unix.Close(fds[1])
198- must(t, c.SendRequestWithFDs(shm, uint16(wayland.ShmRequestCreatePool), []int{fds[0]}, pool, uint32(0), int32(4096)))
199- keyboard := c.AllocateID()
200- kp := &argsProxy{received: make(chan argsEvent, 4), kind: "keyboard"}
201- kp.SetID(keyboard)
202- c.Context().Register(kp)
203- pointer := c.AllocateID()
204- pp := &argsProxy{received: make(chan argsEvent, 4), kind: "pointer"}
205- pp.SetID(pointer)
206- c.Context().Register(pp)
207- must(t, c.SendRequest(seat, uint16(wayland.SeatRequestGetKeyboard), keyboard))
208- must(t, c.SendRequest(seat, uint16(wayland.SeatRequestGetPointer), pointer))
209- must(t, c.Roundtrip())
210- if text := receive(t, stringsReceived); text != "request text" {
211- t.Fatalf("string request = %q", text)
212- }
213- if receive(t, requests) != "pool" {
214- t.Fatal("fd request missing")
215- }
216- if e := receive(t, sp.received); e.text != "hello" {
217- t.Fatalf("string event: %+v", e)
218- }
219- a, b := receive(t, kp.received), receive(t, kp.received)
220- if a.fd <= 0 || !bytes.Equal(b.data, []byte{1, 2, 3}) {
221- t.Fatalf("keyboard events: %+v %+v", a, b)
222- }
223- buf := make([]byte, 32)
224- n, e := unix.Read(a.fd, buf)
225- unix.Close(a.fd)
226- if e != nil || string(buf[:n]) != "fd contents" {
227- t.Fatalf("fd: %q %v", buf[:n], e)
228- }
229- if e := receive(t, pp.received); e.fixed.Float64() != -1.5 {
230- t.Fatalf("fixed: %+v", e)
231- }
232- must(t, c.SendRequest(pool, uint16(wayland.ShmPoolRequestResize), int32(8192)))
233- result := make(chan error, 1)
234- go func() {
235- for i := 0; i < 10; i++ {
236- if err := c.Dispatch(); err != nil {
237- result <- err
238- return
239- }
240- }
241- result <- nil
242- }()
243- select {
244- case err := <-result:
245- var displayErr *wlturbo.DisplayError
246- if !errors.As(err, &displayErr) || displayErr.ObjectID != pool || displayErr.Code != 7 || displayErr.Message != "bad % request" {
247- t.Fatalf("PostError result = %v", err)
248- }
249- case <-time.After(3 * time.Second):
250- t.Fatal("client did not disconnect after PostError")
251- }
252-
253-}
D internal/e2e/feasibility_test.go +0 -355
@@ -1,355 +0,0 @@
1-package e2e_test
2-
3-import (
4- "context"
5- "os"
6- "os/exec"
7- "path/filepath"
8- "strings"
9- "testing"
10- "time"
11-
12- "github.com/bnema/purego-libwayland/protocol/wayland"
13- "github.com/bnema/purego-libwayland/server"
14- "github.com/bnema/wlturbo"
15- "golang.org/x/sys/unix"
16-)
17-
18-// startServer runs a display with a wl_compositor global on a private socket.
19-// commits counts wl_surface.commit requests received by Go handlers.
20-func startServer(t *testing.T, captured ...chan *server.Resource) (socket string, d *server.Display, commits chan uint32) {
21- t.Helper()
22- d, err := server.NewDisplay()
23- if err != nil {
24- t.Fatal(err)
25- }
26- socket = filepath.Join(t.TempDir(), "wayland-test")
27- // libwayland takes ownership of the listening fd.
28- fd, err := unix.Socket(unix.AF_UNIX, unix.SOCK_STREAM|unix.SOCK_CLOEXEC, 0)
29- if err != nil {
30- t.Fatal(err)
31- }
32- if err := unix.Bind(fd, &unix.SockaddrUnix{Name: socket}); err != nil {
33- t.Fatal(err)
34- }
35- if err := unix.Listen(fd, 128); err != nil {
36- t.Fatal(err)
37- }
38- if err := d.AddSocketFD(fd); err != nil {
39- t.Fatal(err)
40- }
41-
42- commits = make(chan uint32, 16)
43- var serial uint32
44- surface := &surfaceHandler{commits: commits, serial: &serial, t: t}
45- compositor := &compositorHandler{surface: surface, t: t}
46- if len(captured) > 0 {
47- compositor.captured = captured[0]
48- }
49- err = wayland.NewCompositorGlobal(d, 1, func(c server.Client, version, id uint32) {
50- if _, err := wayland.NewCompositor(c, int32(version), id, compositor); err != nil {
51- t.Error(err)
52- }
53- })
54- if err != nil {
55- t.Fatal(err)
56- }
57-
58- ctx, cancel := context.WithCancel(context.Background())
59- done := make(chan error, 1)
60- go func() { done <- d.Run(ctx) }()
61- t.Cleanup(func() {
62- cancel()
63- select {
64- case err := <-done:
65- if err != nil {
66- t.Error(err)
67- }
68- case <-time.After(3 * time.Second):
69- t.Fatal("server did not stop")
70- }
71- })
72- return socket, d, commits
73-}
74-
75-// Gates 1 and 2: the global exists and wayland-info lists it.
76-func TestWaylandInfoListsCompositor(t *testing.T) {
77- if _, err := exec.LookPath("wayland-info"); err != nil {
78- t.Skip("wayland-info not installed")
79- }
80- socket, _, _ := startServer(t)
81- ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
82- defer cancel()
83- cmd := exec.CommandContext(ctx, "wayland-info")
84- cmd.Env = []string{"XDG_RUNTIME_DIR=" + filepath.Dir(socket), "WAYLAND_DISPLAY=" + filepath.Base(socket)}
85- out, err := cmd.CombinedOutput()
86- if err != nil {
87- t.Fatalf("wayland-info: %v\n%s", err, out)
88- }
89- if !strings.Contains(string(out), "wl_compositor") {
90- t.Fatalf("wl_compositor missing from wayland-info output:\n%s", out)
91- }
92-}
93-
94-// Gates 3 and 4: requests reach Go handlers, events reach the client, and a
95-// disconnect frees every resource. Run repeatedly and under -race.
96-func TestRequestEventRoundtripAndDisconnect(t *testing.T) {
97- socket, d, commits := startServer(t)
98-
99- for round := range 20 {
100- c, err := wlturbo.Connect(socket)
101- if err != nil {
102- t.Fatal(err)
103- }
104- if err := c.Roundtrip(); err != nil {
105- t.Fatal(err)
106- }
107- g, ok := c.Registry().FindGlobal("wl_compositor")
108- if !ok {
109- t.Fatal("wl_compositor not advertised")
110- }
111- comp, err := c.Registry().BindID(g.Name, g.Interface, 1)
112- if err != nil {
113- t.Fatal(err)
114- }
115- surf := c.AllocateID()
116- must(t, c.SendRequest(comp, uint16(wayland.CompositorRequestCreateSurface), surf))
117- cb := c.AllocateID()
118- gotDone := make(chan uint32, 1)
119- cbProxy := &doneProxy{done: gotDone}
120- cbProxy.SetID(cb)
121- c.Context().Register(cbProxy)
122- must(t, c.SendRequest(surf, uint16(wayland.SurfaceRequestFrame), cb))
123- must(t, c.SendRequest(surf, uint16(wayland.SurfaceRequestCommit)))
124- must(t, c.Roundtrip())
125-
126- select {
127- case id := <-commits:
128- if id != surf {
129- t.Fatalf("commit on %d, want %d", id, surf)
130- }
131- case <-time.After(2 * time.Second):
132- t.Fatal("commit never reached the Go handler")
133- }
134- select {
135- case serial := <-gotDone:
136- if serial != uint32(round+1) {
137- t.Fatalf("callback serial %d, want %d", serial, round+1)
138- }
139- default:
140- t.Fatal("wl_callback.done never reached the client")
141- }
142- _ = c.Close()
143-
144- // libwayland frees the client's resources once it notices the hangup.
145- deadline := time.Now().Add(2 * time.Second)
146- for {
147- var n int
148- if !d.Do(func() { n = server.LiveResources() }) {
149- t.Fatal("display stopped")
150- }
151- if n == 0 {
152- break
153- }
154- if time.Now().After(deadline) {
155- t.Fatalf("round %d: %d resources still alive after disconnect", round, n)
156- }
157- time.Sleep(5 * time.Millisecond)
158- }
159- }
160-}
161-
162-// A resource retained by Go must be harmless after libwayland destroys its client.
163-func TestPostEventAfterDisconnect(t *testing.T) {
164- captured := make(chan *server.Resource, 1)
165- socket, d, _ := startServer(t, captured)
166- c, err := wlturbo.Connect(socket)
167- if err != nil {
168- t.Fatal(err)
169- }
170- if err := c.Roundtrip(); err != nil {
171- t.Fatal(err)
172- }
173- // Create a surface retained by the server after the client disconnects.
174- g, ok := c.Registry().FindGlobal("wl_compositor")
175- if !ok {
176- t.Fatal("wl_compositor not advertised")
177- }
178- comp, err := c.Registry().BindID(g.Name, g.Interface, 1)
179- if err != nil {
180- t.Fatal(err)
181- }
182- surf := c.AllocateID()
183- must(t, c.SendRequest(comp, uint16(wayland.CompositorRequestCreateSurface), surf))
184- if err := c.Roundtrip(); err != nil {
185- t.Fatal(err)
186- }
187- stale := <-captured
188- _ = c.Close()
189- deadline := time.Now().Add(2 * time.Second)
190- for {
191- var n int
192- if !d.Do(func() { n = server.LiveResources() }) {
193- t.Fatal("display stopped")
194- }
195- if n == 0 {
196- break
197- }
198- if time.Now().After(deadline) {
199- t.Fatalf("%d resources still alive", n)
200- }
201- time.Sleep(5 * time.Millisecond)
202- }
203- if !d.Do(func() {
204- if stale == nil {
205- t.Error("resource was not created")
206- return
207- }
208- if stale.Alive() {
209- t.Error("resource still alive")
210- }
211- stale.PostEvent(0)
212- stale.PostError(0, "gone")
213- if stale.ID() != 0 || stale.Version() != 0 || stale.Client() != (server.Client{}) {
214- t.Error("destroyed resource returned nonzero metadata")
215- }
216- }) {
217- t.Fatal("display stopped")
218- }
219-}
220-
221-// doneProxy records wl_callback.done.
222-type doneProxy struct {
223- wlturbo.BaseProxy
224- done chan uint32
225-}
226-
227-func (p *doneProxy) Dispatch(e *wlturbo.Event) {
228- if e.Opcode == uint16(wayland.CallbackEventDone) {
229- p.done <- e.Uint32()
230- }
231-}
232-
233-func must(t *testing.T, err error) {
234- t.Helper()
235- if err != nil {
236- t.Fatal(err)
237- }
238-}
239-
240-type compositorHandler struct {
241- surface *surfaceHandler
242- t *testing.T
243- captured chan *server.Resource
244-}
245-
246-func (h *compositorHandler) CreateSurface(self *wayland.Compositor, id uint32) {
247- r, err := wayland.NewSurface(self.Client(), self.Version(), id, h.surface)
248- if err != nil {
249- h.t.Error(err)
250- return
251- }
252- if h.captured != nil {
253- h.captured <- r.Resource
254- }
255-}
256-func (h *compositorHandler) CreateRegion(self *wayland.Compositor, id uint32) {
257- if _, err := wayland.NewRegion(self.Client(), self.Version(), id, regionHandler{}); err != nil {
258- h.t.Error(err)
259- }
260-}
261-func (*compositorHandler) Release(*wayland.Compositor) {}
262-
263-type regionHandler struct{}
264-
265-func (regionHandler) Destroy(*wayland.Region) {}
266-func (regionHandler) Add(*wayland.Region, int32, int32, int32, int32) {}
267-func (regionHandler) Subtract(*wayland.Region, int32, int32, int32, int32) {}
268-
269-type surfaceHandler struct {
270- commits chan uint32
271- serial *uint32
272- t *testing.T
273-}
274-
275-func (*surfaceHandler) Destroy(*wayland.Surface) {}
276-func (*surfaceHandler) Attach(*wayland.Surface, *wayland.Buffer, int32, int32) {}
277-func (*surfaceHandler) Damage(*wayland.Surface, int32, int32, int32, int32) {}
278-func (h *surfaceHandler) Frame(self *wayland.Surface, id uint32) {
279- cb, err := wayland.NewCallback(self.Client(), 1, id, nil)
280- if err != nil {
281- h.t.Error(err)
282- return
283- }
284- *h.serial++
285- cb.SendDone(*h.serial)
286- cb.Destroy()
287-}
288-func (*surfaceHandler) SetOpaqueRegion(*wayland.Surface, *wayland.Region) {}
289-func (*surfaceHandler) SetInputRegion(*wayland.Surface, *wayland.Region) {}
290-func (h *surfaceHandler) Commit(self *wayland.Surface) { h.commits <- self.ID() }
291-func (*surfaceHandler) SetBufferTransform(*wayland.Surface, int32) {}
292-func (*surfaceHandler) SetBufferScale(*wayland.Surface, int32) {}
293-func (*surfaceHandler) DamageBuffer(*wayland.Surface, int32, int32, int32, int32) {}
294-func (*surfaceHandler) Offset(*wayland.Surface, int32, int32) {}
295-func (*surfaceHandler) GetRelease(*wayland.Surface, uint32) {}
296-
297-// The client PID comes from the socket credentials; in-process clients share ours.
298-func TestClientPID(t *testing.T) {
299- captured := make(chan *server.Resource, 1)
300- socket, d, _ := startServer(t, captured)
301- c, err := wlturbo.Connect(socket)
302- if err != nil {
303- t.Fatal(err)
304- }
305- defer c.Close()
306- must(t, c.Roundtrip())
307- g, ok := c.Registry().FindGlobal("wl_compositor")
308- if !ok {
309- t.Fatal("wl_compositor not advertised")
310- }
311- comp, err := c.Registry().BindID(g.Name, g.Interface, 1)
312- must(t, err)
313- must(t, c.SendRequest(comp, uint16(wayland.CompositorRequestCreateSurface), c.AllocateID()))
314- must(t, c.Roundtrip())
315- r := receive(t, captured)
316- pid := make(chan int, 1)
317- if !d.Do(func() { pid <- r.Client().PID() }) {
318- t.Fatal("display stopped")
319- }
320- if got := <-pid; got != os.Getpid() {
321- t.Fatalf("pid %d, want %d", got, os.Getpid())
322- }
323-}
324-
325-// A removed global disappears from the registry of new clients.
326-func TestGlobalRemove(t *testing.T) {
327- socket, d, _ := startServer(t)
328- var g *server.Global
329- added := make(chan error, 1)
330- if !d.Do(func() {
331- var err error
332- g, err = d.AddGlobal(wayland.OutputInterface, 4, func(server.Client, uint32, uint32) {})
333- added <- err
334- }) {
335- t.Fatal("display stopped")
336- }
337- must(t, <-added)
338- has := func() bool {
339- c, err := wlturbo.Connect(socket)
340- must(t, err)
341- defer c.Close()
342- must(t, c.Roundtrip())
343- _, ok := c.Registry().FindGlobal("wl_output")
344- return ok
345- }
346- if !has() {
347- t.Fatal("wl_output not advertised")
348- }
349- if !d.Do(func() { g.Remove(); g.Remove() }) {
350- t.Fatal("display stopped")
351- }
352- if has() {
353- t.Fatal("wl_output still advertised after Remove")
354- }
355-}
D protocol/alphamodifier/alphamodifier.go +0 -149
@@ -1,149 +0,0 @@
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-}
D protocol/colormanagement/colormanagement.go +0 -890
@@ -1,890 +0,0 @@
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-}
D protocol/colorrepresentation/colorrepresentation.go +0 -228
@@ -1,228 +0,0 @@
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-}
D protocol/committiming/committiming.go +0 -151
@@ -1,151 +0,0 @@
1-// Code generated by wlgen; DO NOT EDIT.
2-package committiming
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 WpCommitTimingManagerV1Interface *server.Interface
11-var WpCommitTimerV1Interface *server.Interface
12-
13-func init() {
14- WpCommitTimingManagerV1Interface = &server.Interface{Name: "wp_commit_timing_manager_v1", Version: 1}
15- WpCommitTimerV1Interface = &server.Interface{Name: "wp_commit_timer_v1", Version: 1}
16- WpCommitTimingManagerV1Interface.Requests = []server.Message{
17- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
18- {Name: "get_timer", Signature: "no", Types: []*server.Interface{WpCommitTimerV1Interface, wayland.SurfaceInterface}},
19- }
20- WpCommitTimingManagerV1Interface.Events = []server.Message{}
21- WpCommitTimerV1Interface.Requests = []server.Message{
22- {Name: "set_timestamp", Signature: "uuu", Types: []*server.Interface{nil, nil, nil}},
23- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
24- }
25- WpCommitTimerV1Interface.Events = []server.Message{}
26- if err := server.NewInterfaces(WpCommitTimingManagerV1Interface, WpCommitTimerV1Interface); err != nil {
27- panic(err)
28- }
29-}
30-
31-// WpCommitTimingManagerV1 commit timing.
32-type WpCommitTimingManagerV1 struct{ *server.Resource }
33-
34-func WrapWpCommitTimingManagerV1(r *server.Resource) *WpCommitTimingManagerV1 {
35- if r == nil {
36- return nil
37- }
38- return &WpCommitTimingManagerV1{r}
39-}
40-
41-const WpCommitTimingManagerV1RequestDestroy uint32 = 0
42-const WpCommitTimingManagerV1RequestGetTimer uint32 = 1
43-
44-// WpCommitTimingManagerV1Error .
45-type WpCommitTimingManagerV1Error uint32
46-
47-const (
48- WpCommitTimingManagerV1ErrorCommitTimerExists WpCommitTimingManagerV1Error = 0
49-)
50-
51-// WpCommitTimingManagerV1Handler handles wp_commit_timing_manager_v1 requests.
52-type WpCommitTimingManagerV1Handler interface {
53- Destroy(self *WpCommitTimingManagerV1)
54- GetTimer(self *WpCommitTimingManagerV1, id uint32, surface *wayland.Surface)
55-}
56-
57-func NewWpCommitTimingManagerV1(c server.Client, version int32, id uint32, h WpCommitTimingManagerV1Handler) (*WpCommitTimingManagerV1, error) {
58- if h == nil {
59- return nil, fmt.Errorf("purego-libwayland: nil handler for wp_commit_timing_manager_v1")
60- }
61- var self *WpCommitTimingManagerV1
62- r, err := c.CreateResource(WpCommitTimingManagerV1Interface, 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.GetTimer(self, args[0].NewID(), wayland.WrapSurface(args[1].Resource()))
69- }
70- })
71- if err != nil {
72- return nil, err
73- }
74- self = WrapWpCommitTimingManagerV1(r)
75- r.Data = self
76- return self, nil
77-}
78-func NewWpCommitTimingManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
79- return d.CreateGlobal(WpCommitTimingManagerV1Interface, version, bind)
80-}
81-
82-// WpCommitTimerV1 Surface commit timer.
83-type WpCommitTimerV1 struct{ *server.Resource }
84-
85-func WrapWpCommitTimerV1(r *server.Resource) *WpCommitTimerV1 {
86- if r == nil {
87- return nil
88- }
89- return &WpCommitTimerV1{r}
90-}
91-
92-const WpCommitTimerV1RequestSetTimestamp uint32 = 0
93-const WpCommitTimerV1RequestDestroy uint32 = 1
94-
95-// WpCommitTimerV1Error .
96-type WpCommitTimerV1Error uint32
97-
98-const (
99- WpCommitTimerV1ErrorInvalidTimestamp WpCommitTimerV1Error = 0
100- WpCommitTimerV1ErrorTimestampExists WpCommitTimerV1Error = 1
101- WpCommitTimerV1ErrorSurfaceDestroyed WpCommitTimerV1Error = 2
102-)
103-
104-// WpCommitTimerV1Handler handles wp_commit_timer_v1 requests.
105-type WpCommitTimerV1Handler interface {
106- SetTimestamp(self *WpCommitTimerV1, tvSecHi uint32, tvSecLo uint32, tvNsec uint32)
107- Destroy(self *WpCommitTimerV1)
108-}
109-
110-func NewWpCommitTimerV1(c server.Client, version int32, id uint32, h WpCommitTimerV1Handler) (*WpCommitTimerV1, error) {
111- if h == nil {
112- return nil, fmt.Errorf("purego-libwayland: nil handler for wp_commit_timer_v1")
113- }
114- var self *WpCommitTimerV1
115- r, err := c.CreateResource(WpCommitTimerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
116- switch opcode {
117- case 0:
118- h.SetTimestamp(self, args[0].Uint(), args[1].Uint(), args[2].Uint())
119- case 1:
120- h.Destroy(self)
121- self.Destroy()
122- }
123- })
124- if err != nil {
125- return nil, err
126- }
127- self = WrapWpCommitTimerV1(r)
128- r.Data = self
129- return self, nil
130-}
131-func NewWpCommitTimerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
132- return d.CreateGlobal(WpCommitTimerV1Interface, 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 *WpCommitTimingManagerV1) GetResource() *server.Resource {
141- if self == nil {
142- return nil
143- }
144- return self.Resource
145-}
146-func (self *WpCommitTimerV1) GetResource() *server.Resource {
147- if self == nil {
148- return nil
149- }
150- return self.Resource
151-}
D protocol/contenttype/contenttype.go +0 -152
@@ -1,152 +0,0 @@
1-// Code generated by wlgen; DO NOT EDIT.
2-package contenttype
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 WpContentTypeManagerV1Interface *server.Interface
11-var WpContentTypeV1Interface *server.Interface
12-
13-func init() {
14- WpContentTypeManagerV1Interface = &server.Interface{Name: "wp_content_type_manager_v1", Version: 1}
15- WpContentTypeV1Interface = &server.Interface{Name: "wp_content_type_v1", Version: 1}
16- WpContentTypeManagerV1Interface.Requests = []server.Message{
17- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
18- {Name: "get_surface_content_type", Signature: "no", Types: []*server.Interface{WpContentTypeV1Interface, wayland.SurfaceInterface}},
19- }
20- WpContentTypeManagerV1Interface.Events = []server.Message{}
21- WpContentTypeV1Interface.Requests = []server.Message{
22- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
23- {Name: "set_content_type", Signature: "u", Types: []*server.Interface{nil}},
24- }
25- WpContentTypeV1Interface.Events = []server.Message{}
26- if err := server.NewInterfaces(WpContentTypeManagerV1Interface, WpContentTypeV1Interface); err != nil {
27- panic(err)
28- }
29-}
30-
31-// WpContentTypeManagerV1 surface content type manager.
32-type WpContentTypeManagerV1 struct{ *server.Resource }
33-
34-func WrapWpContentTypeManagerV1(r *server.Resource) *WpContentTypeManagerV1 {
35- if r == nil {
36- return nil
37- }
38- return &WpContentTypeManagerV1{r}
39-}
40-
41-const WpContentTypeManagerV1RequestDestroy uint32 = 0
42-const WpContentTypeManagerV1RequestGetSurfaceContentType uint32 = 1
43-
44-// WpContentTypeManagerV1Error .
45-type WpContentTypeManagerV1Error uint32
46-
47-const (
48- WpContentTypeManagerV1ErrorAlreadyConstructed WpContentTypeManagerV1Error = 0
49-)
50-
51-// WpContentTypeManagerV1Handler handles wp_content_type_manager_v1 requests.
52-type WpContentTypeManagerV1Handler interface {
53- Destroy(self *WpContentTypeManagerV1)
54- GetSurfaceContentType(self *WpContentTypeManagerV1, id uint32, surface *wayland.Surface)
55-}
56-
57-func NewWpContentTypeManagerV1(c server.Client, version int32, id uint32, h WpContentTypeManagerV1Handler) (*WpContentTypeManagerV1, error) {
58- if h == nil {
59- return nil, fmt.Errorf("purego-libwayland: nil handler for wp_content_type_manager_v1")
60- }
61- var self *WpContentTypeManagerV1
62- r, err := c.CreateResource(WpContentTypeManagerV1Interface, 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.GetSurfaceContentType(self, args[0].NewID(), wayland.WrapSurface(args[1].Resource()))
69- }
70- })
71- if err != nil {
72- return nil, err
73- }
74- self = WrapWpContentTypeManagerV1(r)
75- r.Data = self
76- return self, nil
77-}
78-func NewWpContentTypeManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
79- return d.CreateGlobal(WpContentTypeManagerV1Interface, version, bind)
80-}
81-
82-// WpContentTypeV1 content type object for a surface.
83-type WpContentTypeV1 struct{ *server.Resource }
84-
85-func WrapWpContentTypeV1(r *server.Resource) *WpContentTypeV1 {
86- if r == nil {
87- return nil
88- }
89- return &WpContentTypeV1{r}
90-}
91-
92-const WpContentTypeV1RequestDestroy uint32 = 0
93-const WpContentTypeV1RequestSetContentType uint32 = 1
94-
95-// WpContentTypeV1Type possible content types.
96-type WpContentTypeV1Type uint32
97-
98-const (
99- WpContentTypeV1TypeNone WpContentTypeV1Type = 0
100- WpContentTypeV1TypePhoto WpContentTypeV1Type = 1
101- WpContentTypeV1TypeVideo WpContentTypeV1Type = 2
102- WpContentTypeV1TypeGame WpContentTypeV1Type = 3
103-)
104-
105-// WpContentTypeV1Handler handles wp_content_type_v1 requests.
106-type WpContentTypeV1Handler interface {
107- Destroy(self *WpContentTypeV1)
108- SetContentType(self *WpContentTypeV1, contentType uint32)
109-}
110-
111-func NewWpContentTypeV1(c server.Client, version int32, id uint32, h WpContentTypeV1Handler) (*WpContentTypeV1, error) {
112- if h == nil {
113- return nil, fmt.Errorf("purego-libwayland: nil handler for wp_content_type_v1")
114- }
115- var self *WpContentTypeV1
116- r, err := c.CreateResource(WpContentTypeV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
117- switch opcode {
118- case 0:
119- h.Destroy(self)
120- self.Destroy()
121- case 1:
122- h.SetContentType(self, args[0].Uint())
123- }
124- })
125- if err != nil {
126- return nil, err
127- }
128- self = WrapWpContentTypeV1(r)
129- r.Data = self
130- return self, nil
131-}
132-func NewWpContentTypeV1Global(d *server.Display, version int32, bind server.BindFunc) error {
133- return d.CreateGlobal(WpContentTypeV1Interface, version, bind)
134-}
135-func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
136- if v == nil {
137- return nil
138- }
139- return v.GetResource()
140-}
141-func (self *WpContentTypeManagerV1) GetResource() *server.Resource {
142- if self == nil {
143- return nil
144- }
145- return self.Resource
146-}
147-func (self *WpContentTypeV1) GetResource() *server.Resource {
148- if self == nil {
149- return nil
150- }
151- return self.Resource
152-}
D protocol/cursorshape/cursorshape.go +0 -190
@@ -1,190 +0,0 @@
1-// Code generated by wlgen; DO NOT EDIT.
2-package cursorshape
3-
4-import (
5- "fmt"
6- tabletv2 "github.com/bnema/purego-libwayland/protocol/tabletv2"
7- wayland "github.com/bnema/purego-libwayland/protocol/wayland"
8- "github.com/bnema/purego-libwayland/server"
9-)
10-
11-var WpCursorShapeManagerV1Interface *server.Interface
12-var WpCursorShapeDeviceV1Interface *server.Interface
13-
14-func init() {
15- WpCursorShapeManagerV1Interface = &server.Interface{Name: "wp_cursor_shape_manager_v1", Version: 2}
16- WpCursorShapeDeviceV1Interface = &server.Interface{Name: "wp_cursor_shape_device_v1", Version: 2}
17- WpCursorShapeManagerV1Interface.Requests = []server.Message{
18- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
19- {Name: "get_pointer", Signature: "no", Types: []*server.Interface{WpCursorShapeDeviceV1Interface, wayland.PointerInterface}},
20- {Name: "get_tablet_tool_v2", Signature: "no", Types: []*server.Interface{WpCursorShapeDeviceV1Interface, tabletv2.ZwpTabletToolV2Interface}},
21- }
22- WpCursorShapeManagerV1Interface.Events = []server.Message{}
23- WpCursorShapeDeviceV1Interface.Requests = []server.Message{
24- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
25- {Name: "set_shape", Signature: "uu", Types: []*server.Interface{nil, nil}},
26- }
27- WpCursorShapeDeviceV1Interface.Events = []server.Message{}
28- if err := server.NewInterfaces(WpCursorShapeManagerV1Interface, WpCursorShapeDeviceV1Interface); err != nil {
29- panic(err)
30- }
31-}
32-
33-// WpCursorShapeManagerV1 cursor shape manager.
34-type WpCursorShapeManagerV1 struct{ *server.Resource }
35-
36-func WrapWpCursorShapeManagerV1(r *server.Resource) *WpCursorShapeManagerV1 {
37- if r == nil {
38- return nil
39- }
40- return &WpCursorShapeManagerV1{r}
41-}
42-
43-const WpCursorShapeManagerV1RequestDestroy uint32 = 0
44-const WpCursorShapeManagerV1RequestGetPointer uint32 = 1
45-const WpCursorShapeManagerV1RequestGetTabletToolV2 uint32 = 2
46-
47-// WpCursorShapeManagerV1Handler handles wp_cursor_shape_manager_v1 requests.
48-type WpCursorShapeManagerV1Handler interface {
49- Destroy(self *WpCursorShapeManagerV1)
50- GetPointer(self *WpCursorShapeManagerV1, cursorShapeDevice uint32, pointer *wayland.Pointer)
51- GetTabletToolV2(self *WpCursorShapeManagerV1, cursorShapeDevice uint32, tabletTool *tabletv2.ZwpTabletToolV2)
52-}
53-
54-func NewWpCursorShapeManagerV1(c server.Client, version int32, id uint32, h WpCursorShapeManagerV1Handler) (*WpCursorShapeManagerV1, error) {
55- if h == nil {
56- return nil, fmt.Errorf("purego-libwayland: nil handler for wp_cursor_shape_manager_v1")
57- }
58- var self *WpCursorShapeManagerV1
59- r, err := c.CreateResource(WpCursorShapeManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
60- switch opcode {
61- case 0:
62- h.Destroy(self)
63- self.Destroy()
64- case 1:
65- h.GetPointer(self, args[0].NewID(), wayland.WrapPointer(args[1].Resource()))
66- case 2:
67- h.GetTabletToolV2(self, args[0].NewID(), tabletv2.WrapZwpTabletToolV2(args[1].Resource()))
68- }
69- })
70- if err != nil {
71- return nil, err
72- }
73- self = WrapWpCursorShapeManagerV1(r)
74- r.Data = self
75- return self, nil
76-}
77-func NewWpCursorShapeManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
78- return d.CreateGlobal(WpCursorShapeManagerV1Interface, version, bind)
79-}
80-
81-// WpCursorShapeDeviceV1 cursor shape for a device.
82-type WpCursorShapeDeviceV1 struct{ *server.Resource }
83-
84-func WrapWpCursorShapeDeviceV1(r *server.Resource) *WpCursorShapeDeviceV1 {
85- if r == nil {
86- return nil
87- }
88- return &WpCursorShapeDeviceV1{r}
89-}
90-
91-const WpCursorShapeDeviceV1RequestDestroy uint32 = 0
92-const WpCursorShapeDeviceV1RequestSetShape uint32 = 1
93-
94-// WpCursorShapeDeviceV1Shape cursor shapes.
95-type WpCursorShapeDeviceV1Shape uint32
96-
97-const (
98- WpCursorShapeDeviceV1ShapeDefault WpCursorShapeDeviceV1Shape = 1
99- WpCursorShapeDeviceV1ShapeContextMenu WpCursorShapeDeviceV1Shape = 2
100- WpCursorShapeDeviceV1ShapeHelp WpCursorShapeDeviceV1Shape = 3
101- WpCursorShapeDeviceV1ShapePointer WpCursorShapeDeviceV1Shape = 4
102- WpCursorShapeDeviceV1ShapeProgress WpCursorShapeDeviceV1Shape = 5
103- WpCursorShapeDeviceV1ShapeWait WpCursorShapeDeviceV1Shape = 6
104- WpCursorShapeDeviceV1ShapeCell WpCursorShapeDeviceV1Shape = 7
105- WpCursorShapeDeviceV1ShapeCrosshair WpCursorShapeDeviceV1Shape = 8
106- WpCursorShapeDeviceV1ShapeText WpCursorShapeDeviceV1Shape = 9
107- WpCursorShapeDeviceV1ShapeVerticalText WpCursorShapeDeviceV1Shape = 10
108- WpCursorShapeDeviceV1ShapeAlias WpCursorShapeDeviceV1Shape = 11
109- WpCursorShapeDeviceV1ShapeCopy WpCursorShapeDeviceV1Shape = 12
110- WpCursorShapeDeviceV1ShapeMove WpCursorShapeDeviceV1Shape = 13
111- WpCursorShapeDeviceV1ShapeNoDrop WpCursorShapeDeviceV1Shape = 14
112- WpCursorShapeDeviceV1ShapeNotAllowed WpCursorShapeDeviceV1Shape = 15
113- WpCursorShapeDeviceV1ShapeGrab WpCursorShapeDeviceV1Shape = 16
114- WpCursorShapeDeviceV1ShapeGrabbing WpCursorShapeDeviceV1Shape = 17
115- WpCursorShapeDeviceV1ShapeEResize WpCursorShapeDeviceV1Shape = 18
116- WpCursorShapeDeviceV1ShapeNResize WpCursorShapeDeviceV1Shape = 19
117- WpCursorShapeDeviceV1ShapeNeResize WpCursorShapeDeviceV1Shape = 20
118- WpCursorShapeDeviceV1ShapeNwResize WpCursorShapeDeviceV1Shape = 21
119- WpCursorShapeDeviceV1ShapeSResize WpCursorShapeDeviceV1Shape = 22
120- WpCursorShapeDeviceV1ShapeSeResize WpCursorShapeDeviceV1Shape = 23
121- WpCursorShapeDeviceV1ShapeSwResize WpCursorShapeDeviceV1Shape = 24
122- WpCursorShapeDeviceV1ShapeWResize WpCursorShapeDeviceV1Shape = 25
123- WpCursorShapeDeviceV1ShapeEwResize WpCursorShapeDeviceV1Shape = 26
124- WpCursorShapeDeviceV1ShapeNsResize WpCursorShapeDeviceV1Shape = 27
125- WpCursorShapeDeviceV1ShapeNeswResize WpCursorShapeDeviceV1Shape = 28
126- WpCursorShapeDeviceV1ShapeNwseResize WpCursorShapeDeviceV1Shape = 29
127- WpCursorShapeDeviceV1ShapeColResize WpCursorShapeDeviceV1Shape = 30
128- WpCursorShapeDeviceV1ShapeRowResize WpCursorShapeDeviceV1Shape = 31
129- WpCursorShapeDeviceV1ShapeAllScroll WpCursorShapeDeviceV1Shape = 32
130- WpCursorShapeDeviceV1ShapeZoomIn WpCursorShapeDeviceV1Shape = 33
131- WpCursorShapeDeviceV1ShapeZoomOut WpCursorShapeDeviceV1Shape = 34
132- WpCursorShapeDeviceV1ShapeDndAsk WpCursorShapeDeviceV1Shape = 35
133- WpCursorShapeDeviceV1ShapeAllResize WpCursorShapeDeviceV1Shape = 36
134-)
135-
136-// WpCursorShapeDeviceV1Error .
137-type WpCursorShapeDeviceV1Error uint32
138-
139-const (
140- WpCursorShapeDeviceV1ErrorInvalidShape WpCursorShapeDeviceV1Error = 1
141-)
142-
143-// WpCursorShapeDeviceV1Handler handles wp_cursor_shape_device_v1 requests.
144-type WpCursorShapeDeviceV1Handler interface {
145- Destroy(self *WpCursorShapeDeviceV1)
146- SetShape(self *WpCursorShapeDeviceV1, serial uint32, shape uint32)
147-}
148-
149-func NewWpCursorShapeDeviceV1(c server.Client, version int32, id uint32, h WpCursorShapeDeviceV1Handler) (*WpCursorShapeDeviceV1, error) {
150- if h == nil {
151- return nil, fmt.Errorf("purego-libwayland: nil handler for wp_cursor_shape_device_v1")
152- }
153- var self *WpCursorShapeDeviceV1
154- r, err := c.CreateResource(WpCursorShapeDeviceV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
155- switch opcode {
156- case 0:
157- h.Destroy(self)
158- self.Destroy()
159- case 1:
160- h.SetShape(self, args[0].Uint(), args[1].Uint())
161- }
162- })
163- if err != nil {
164- return nil, err
165- }
166- self = WrapWpCursorShapeDeviceV1(r)
167- r.Data = self
168- return self, nil
169-}
170-func NewWpCursorShapeDeviceV1Global(d *server.Display, version int32, bind server.BindFunc) error {
171- return d.CreateGlobal(WpCursorShapeDeviceV1Interface, version, bind)
172-}
173-func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
174- if v == nil {
175- return nil
176- }
177- return v.GetResource()
178-}
179-func (self *WpCursorShapeManagerV1) GetResource() *server.Resource {
180- if self == nil {
181- return nil
182- }
183- return self.Resource
184-}
185-func (self *WpCursorShapeDeviceV1) GetResource() *server.Resource {
186- if self == nil {
187- return nil
188- }
189- return self.Resource
190-}
D protocol/drmlease/drmlease.go +0 -331
@@ -1,331 +0,0 @@
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-}
D protocol/extbackgroundeffect/extbackgroundeffect.go +0 -164
@@ -1,164 +0,0 @@
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-}
D protocol/extdatacontrol/extdatacontrol.go +0 -330
@@ -1,330 +0,0 @@
1-// Code generated by wlgen; DO NOT EDIT.
2-package extdatacontrol
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 ExtDataControlManagerV1Interface *server.Interface
12-var ExtDataControlDeviceV1Interface *server.Interface
13-var ExtDataControlSourceV1Interface *server.Interface
14-var ExtDataControlOfferV1Interface *server.Interface
15-
16-func init() {
17- ExtDataControlManagerV1Interface = &server.Interface{Name: "ext_data_control_manager_v1", Version: 1}
18- ExtDataControlDeviceV1Interface = &server.Interface{Name: "ext_data_control_device_v1", Version: 1}
19- ExtDataControlSourceV1Interface = &server.Interface{Name: "ext_data_control_source_v1", Version: 1}
20- ExtDataControlOfferV1Interface = &server.Interface{Name: "ext_data_control_offer_v1", Version: 1}
21- ExtDataControlManagerV1Interface.Requests = []server.Message{
22- {Name: "create_data_source", Signature: "n", Types: []*server.Interface{ExtDataControlSourceV1Interface}},
23- {Name: "get_data_device", Signature: "no", Types: []*server.Interface{ExtDataControlDeviceV1Interface, wayland.SeatInterface}},
24- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
25- }
26- ExtDataControlManagerV1Interface.Events = []server.Message{}
27- ExtDataControlDeviceV1Interface.Requests = []server.Message{
28- {Name: "set_selection", Signature: "?o", Types: []*server.Interface{ExtDataControlSourceV1Interface}},
29- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
30- {Name: "set_primary_selection", Signature: "?o", Types: []*server.Interface{ExtDataControlSourceV1Interface}},
31- }
32- ExtDataControlDeviceV1Interface.Events = []server.Message{
33- {Name: "data_offer", Signature: "n", Types: []*server.Interface{ExtDataControlOfferV1Interface}},
34- {Name: "selection", Signature: "?o", Types: []*server.Interface{ExtDataControlOfferV1Interface}},
35- {Name: "finished", Signature: "", Types: []*server.Interface{}},
36- {Name: "primary_selection", Signature: "?o", Types: []*server.Interface{ExtDataControlOfferV1Interface}},
37- }
38- ExtDataControlSourceV1Interface.Requests = []server.Message{
39- {Name: "offer", Signature: "s", Types: []*server.Interface{nil}},
40- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
41- }
42- ExtDataControlSourceV1Interface.Events = []server.Message{
43- {Name: "send", Signature: "sh", Types: []*server.Interface{nil, nil}},
44- {Name: "cancelled", Signature: "", Types: []*server.Interface{}},
45- }
46- ExtDataControlOfferV1Interface.Requests = []server.Message{
47- {Name: "receive", Signature: "sh", Types: []*server.Interface{nil, nil}},
48- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
49- }
50- ExtDataControlOfferV1Interface.Events = []server.Message{
51- {Name: "offer", Signature: "s", Types: []*server.Interface{nil}},
52- }
53- if err := server.NewInterfaces(ExtDataControlManagerV1Interface, ExtDataControlDeviceV1Interface, ExtDataControlSourceV1Interface, ExtDataControlOfferV1Interface); err != nil {
54- panic(err)
55- }
56-}
57-
58-// ExtDataControlManagerV1 manager to control data devices.
59-type ExtDataControlManagerV1 struct{ *server.Resource }
60-
61-func WrapExtDataControlManagerV1(r *server.Resource) *ExtDataControlManagerV1 {
62- if r == nil {
63- return nil
64- }
65- return &ExtDataControlManagerV1{r}
66-}
67-
68-const ExtDataControlManagerV1RequestCreateDataSource uint32 = 0
69-const ExtDataControlManagerV1RequestGetDataDevice uint32 = 1
70-const ExtDataControlManagerV1RequestDestroy uint32 = 2
71-
72-// ExtDataControlManagerV1Handler handles ext_data_control_manager_v1 requests.
73-type ExtDataControlManagerV1Handler interface {
74- CreateDataSource(self *ExtDataControlManagerV1, id uint32)
75- GetDataDevice(self *ExtDataControlManagerV1, id uint32, seat *wayland.Seat)
76- Destroy(self *ExtDataControlManagerV1)
77-}
78-
79-func NewExtDataControlManagerV1(c server.Client, version int32, id uint32, h ExtDataControlManagerV1Handler) (*ExtDataControlManagerV1, error) {
80- if h == nil {
81- return nil, fmt.Errorf("purego-libwayland: nil handler for ext_data_control_manager_v1")
82- }
83- var self *ExtDataControlManagerV1
84- r, err := c.CreateResource(ExtDataControlManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
85- switch opcode {
86- case 0:
87- h.CreateDataSource(self, args[0].NewID())
88- case 1:
89- h.GetDataDevice(self, args[0].NewID(), wayland.WrapSeat(args[1].Resource()))
90- case 2:
91- h.Destroy(self)
92- self.Destroy()
93- }
94- })
95- if err != nil {
96- return nil, err
97- }
98- self = WrapExtDataControlManagerV1(r)
99- r.Data = self
100- return self, nil
101-}
102-func NewExtDataControlManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
103- return d.CreateGlobal(ExtDataControlManagerV1Interface, version, bind)
104-}
105-
106-// ExtDataControlDeviceV1 manage a data device for a seat.
107-type ExtDataControlDeviceV1 struct{ *server.Resource }
108-
109-func WrapExtDataControlDeviceV1(r *server.Resource) *ExtDataControlDeviceV1 {
110- if r == nil {
111- return nil
112- }
113- return &ExtDataControlDeviceV1{r}
114-}
115-
116-const ExtDataControlDeviceV1RequestSetSelection uint32 = 0
117-const ExtDataControlDeviceV1RequestDestroy uint32 = 1
118-const ExtDataControlDeviceV1RequestSetPrimarySelection uint32 = 2
119-const ExtDataControlDeviceV1EventDataOffer uint32 = 0
120-const ExtDataControlDeviceV1EventSelection uint32 = 1
121-const ExtDataControlDeviceV1EventFinished uint32 = 2
122-const ExtDataControlDeviceV1EventPrimarySelection uint32 = 3
123-
124-// ExtDataControlDeviceV1Error .
125-type ExtDataControlDeviceV1Error uint32
126-
127-const (
128- ExtDataControlDeviceV1ErrorUsedSource ExtDataControlDeviceV1Error = 1
129-)
130-
131-// ExtDataControlDeviceV1Handler handles ext_data_control_device_v1 requests.
132-type ExtDataControlDeviceV1Handler interface {
133- SetSelection(self *ExtDataControlDeviceV1, source *ExtDataControlSourceV1)
134- Destroy(self *ExtDataControlDeviceV1)
135- SetPrimarySelection(self *ExtDataControlDeviceV1, source *ExtDataControlSourceV1)
136-}
137-
138-func NewExtDataControlDeviceV1(c server.Client, version int32, id uint32, h ExtDataControlDeviceV1Handler) (*ExtDataControlDeviceV1, error) {
139- if h == nil {
140- return nil, fmt.Errorf("purego-libwayland: nil handler for ext_data_control_device_v1")
141- }
142- var self *ExtDataControlDeviceV1
143- r, err := c.CreateResource(ExtDataControlDeviceV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
144- switch opcode {
145- case 0:
146- h.SetSelection(self, WrapExtDataControlSourceV1(args[0].Resource()))
147- case 1:
148- h.Destroy(self)
149- self.Destroy()
150- case 2:
151- h.SetPrimarySelection(self, WrapExtDataControlSourceV1(args[0].Resource()))
152- }
153- })
154- if err != nil {
155- return nil, err
156- }
157- self = WrapExtDataControlDeviceV1(r)
158- r.Data = self
159- return self, nil
160-}
161-
162-// SendDataOffer introduce a new ext_data_control_offer.
163-func (self *ExtDataControlDeviceV1) SendDataOffer(id *ExtDataControlOfferV1) {
164- self.PostEvent(ExtDataControlDeviceV1EventDataOffer, server.NewID(resourceOf(id)))
165-}
166-
167-// SendSelection advertise new selection.
168-func (self *ExtDataControlDeviceV1) SendSelection(id *ExtDataControlOfferV1) {
169- self.PostEvent(ExtDataControlDeviceV1EventSelection, server.Object(resourceOf(id)))
170-}
171-
172-// SendFinished this data control is no longer valid.
173-func (self *ExtDataControlDeviceV1) SendFinished() {
174- self.PostEvent(ExtDataControlDeviceV1EventFinished)
175-}
176-
177-// SendPrimarySelection advertise new primary selection.
178-func (self *ExtDataControlDeviceV1) SendPrimarySelection(id *ExtDataControlOfferV1) {
179- self.PostEvent(ExtDataControlDeviceV1EventPrimarySelection, server.Object(resourceOf(id)))
180-}
181-func NewExtDataControlDeviceV1Global(d *server.Display, version int32, bind server.BindFunc) error {
182- return d.CreateGlobal(ExtDataControlDeviceV1Interface, version, bind)
183-}
184-
185-// ExtDataControlSourceV1 offer to transfer data.
186-type ExtDataControlSourceV1 struct{ *server.Resource }
187-
188-func WrapExtDataControlSourceV1(r *server.Resource) *ExtDataControlSourceV1 {
189- if r == nil {
190- return nil
191- }
192- return &ExtDataControlSourceV1{r}
193-}
194-
195-const ExtDataControlSourceV1RequestOffer uint32 = 0
196-const ExtDataControlSourceV1RequestDestroy uint32 = 1
197-const ExtDataControlSourceV1EventSend uint32 = 0
198-const ExtDataControlSourceV1EventCancelled uint32 = 1
199-
200-// ExtDataControlSourceV1Error .
201-type ExtDataControlSourceV1Error uint32
202-
203-const (
204- ExtDataControlSourceV1ErrorInvalidOffer ExtDataControlSourceV1Error = 1
205-)
206-
207-// ExtDataControlSourceV1Handler handles ext_data_control_source_v1 requests.
208-type ExtDataControlSourceV1Handler interface {
209- Offer(self *ExtDataControlSourceV1, mimeType string)
210- Destroy(self *ExtDataControlSourceV1)
211-}
212-
213-func NewExtDataControlSourceV1(c server.Client, version int32, id uint32, h ExtDataControlSourceV1Handler) (*ExtDataControlSourceV1, error) {
214- if h == nil {
215- return nil, fmt.Errorf("purego-libwayland: nil handler for ext_data_control_source_v1")
216- }
217- var self *ExtDataControlSourceV1
218- r, err := c.CreateResource(ExtDataControlSourceV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
219- switch opcode {
220- case 0:
221- h.Offer(self, args[0].String())
222- case 1:
223- h.Destroy(self)
224- self.Destroy()
225- }
226- })
227- if err != nil {
228- return nil, err
229- }
230- self = WrapExtDataControlSourceV1(r)
231- r.Data = self
232- return self, nil
233-}
234-
235-// SendSend send the data.
236-func (self *ExtDataControlSourceV1) SendSend(mimeType string, fd int) {
237- var p runtime.Pinner
238- defer p.Unpin()
239- self.PostEvent(ExtDataControlSourceV1EventSend, server.String(&p, mimeType, false), server.Fd(fd))
240-}
241-
242-// SendCancelled selection was cancelled.
243-func (self *ExtDataControlSourceV1) SendCancelled() {
244- self.PostEvent(ExtDataControlSourceV1EventCancelled)
245-}
246-func NewExtDataControlSourceV1Global(d *server.Display, version int32, bind server.BindFunc) error {
247- return d.CreateGlobal(ExtDataControlSourceV1Interface, version, bind)
248-}
249-
250-// ExtDataControlOfferV1 offer to transfer data.
251-type ExtDataControlOfferV1 struct{ *server.Resource }
252-
253-func WrapExtDataControlOfferV1(r *server.Resource) *ExtDataControlOfferV1 {
254- if r == nil {
255- return nil
256- }
257- return &ExtDataControlOfferV1{r}
258-}
259-
260-const ExtDataControlOfferV1RequestReceive uint32 = 0
261-const ExtDataControlOfferV1RequestDestroy uint32 = 1
262-const ExtDataControlOfferV1EventOffer uint32 = 0
263-
264-// ExtDataControlOfferV1Handler handles ext_data_control_offer_v1 requests.
265-type ExtDataControlOfferV1Handler interface {
266- Receive(self *ExtDataControlOfferV1, mimeType string, fd int)
267- Destroy(self *ExtDataControlOfferV1)
268-}
269-
270-func NewExtDataControlOfferV1(c server.Client, version int32, id uint32, h ExtDataControlOfferV1Handler) (*ExtDataControlOfferV1, error) {
271- if h == nil {
272- return nil, fmt.Errorf("purego-libwayland: nil handler for ext_data_control_offer_v1")
273- }
274- var self *ExtDataControlOfferV1
275- r, err := c.CreateResource(ExtDataControlOfferV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
276- switch opcode {
277- case 0:
278- h.Receive(self, args[0].String(), args[1].Fd())
279- case 1:
280- h.Destroy(self)
281- self.Destroy()
282- }
283- })
284- if err != nil {
285- return nil, err
286- }
287- self = WrapExtDataControlOfferV1(r)
288- r.Data = self
289- return self, nil
290-}
291-
292-// SendOffer advertise offered MIME type.
293-func (self *ExtDataControlOfferV1) SendOffer(mimeType string) {
294- var p runtime.Pinner
295- defer p.Unpin()
296- self.PostEvent(ExtDataControlOfferV1EventOffer, server.String(&p, mimeType, false))
297-}
298-func NewExtDataControlOfferV1Global(d *server.Display, version int32, bind server.BindFunc) error {
299- return d.CreateGlobal(ExtDataControlOfferV1Interface, version, bind)
300-}
301-func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
302- if v == nil {
303- return nil
304- }
305- return v.GetResource()
306-}
307-func (self *ExtDataControlManagerV1) GetResource() *server.Resource {
308- if self == nil {
309- return nil
310- }
311- return self.Resource
312-}
313-func (self *ExtDataControlDeviceV1) GetResource() *server.Resource {
314- if self == nil {
315- return nil
316- }
317- return self.Resource
318-}
319-func (self *ExtDataControlSourceV1) GetResource() *server.Resource {
320- if self == nil {
321- return nil
322- }
323- return self.Resource
324-}
325-func (self *ExtDataControlOfferV1) GetResource() *server.Resource {
326- if self == nil {
327- return nil
328- }
329- return self.Resource
330-}
D protocol/extforeigntoplevellist/extforeigntoplevellist.go +0 -187
@@ -1,187 +0,0 @@
1-// Code generated by wlgen; DO NOT EDIT.
2-package extforeigntoplevellist
3-
4-import (
5- "fmt"
6- "github.com/bnema/purego-libwayland/server"
7- "runtime"
8-)
9-
10-var ExtForeignToplevelListV1Interface *server.Interface
11-var ExtForeignToplevelHandleV1Interface *server.Interface
12-
13-func init() {
14- ExtForeignToplevelListV1Interface = &server.Interface{Name: "ext_foreign_toplevel_list_v1", Version: 1}
15- ExtForeignToplevelHandleV1Interface = &server.Interface{Name: "ext_foreign_toplevel_handle_v1", Version: 1}
16- ExtForeignToplevelListV1Interface.Requests = []server.Message{
17- {Name: "stop", Signature: "", Types: []*server.Interface{}},
18- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
19- }
20- ExtForeignToplevelListV1Interface.Events = []server.Message{
21- {Name: "toplevel", Signature: "n", Types: []*server.Interface{ExtForeignToplevelHandleV1Interface}},
22- {Name: "finished", Signature: "", Types: []*server.Interface{}},
23- }
24- ExtForeignToplevelHandleV1Interface.Requests = []server.Message{
25- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
26- }
27- ExtForeignToplevelHandleV1Interface.Events = []server.Message{
28- {Name: "closed", Signature: "", Types: []*server.Interface{}},
29- {Name: "done", Signature: "", Types: []*server.Interface{}},
30- {Name: "title", Signature: "s", Types: []*server.Interface{nil}},
31- {Name: "app_id", Signature: "s", Types: []*server.Interface{nil}},
32- {Name: "identifier", Signature: "s", Types: []*server.Interface{nil}},
33- }
34- if err := server.NewInterfaces(ExtForeignToplevelListV1Interface, ExtForeignToplevelHandleV1Interface); err != nil {
35- panic(err)
36- }
37-}
38-
39-// ExtForeignToplevelListV1 list toplevels.
40-type ExtForeignToplevelListV1 struct{ *server.Resource }
41-
42-func WrapExtForeignToplevelListV1(r *server.Resource) *ExtForeignToplevelListV1 {
43- if r == nil {
44- return nil
45- }
46- return &ExtForeignToplevelListV1{r}
47-}
48-
49-const ExtForeignToplevelListV1RequestStop uint32 = 0
50-const ExtForeignToplevelListV1RequestDestroy uint32 = 1
51-const ExtForeignToplevelListV1EventToplevel uint32 = 0
52-const ExtForeignToplevelListV1EventFinished uint32 = 1
53-
54-// ExtForeignToplevelListV1Handler handles ext_foreign_toplevel_list_v1 requests.
55-type ExtForeignToplevelListV1Handler interface {
56- Stop(self *ExtForeignToplevelListV1)
57- Destroy(self *ExtForeignToplevelListV1)
58-}
59-
60-func NewExtForeignToplevelListV1(c server.Client, version int32, id uint32, h ExtForeignToplevelListV1Handler) (*ExtForeignToplevelListV1, error) {
61- if h == nil {
62- return nil, fmt.Errorf("purego-libwayland: nil handler for ext_foreign_toplevel_list_v1")
63- }
64- var self *ExtForeignToplevelListV1
65- r, err := c.CreateResource(ExtForeignToplevelListV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
66- switch opcode {
67- case 0:
68- h.Stop(self)
69- case 1:
70- h.Destroy(self)
71- self.Destroy()
72- }
73- })
74- if err != nil {
75- return nil, err
76- }
77- self = WrapExtForeignToplevelListV1(r)
78- r.Data = self
79- return self, nil
80-}
81-
82-// SendToplevel a toplevel has been created.
83-func (self *ExtForeignToplevelListV1) SendToplevel(toplevel *ExtForeignToplevelHandleV1) {
84- self.PostEvent(ExtForeignToplevelListV1EventToplevel, server.NewID(resourceOf(toplevel)))
85-}
86-
87-// SendFinished the compositor has finished with the toplevel manager.
88-func (self *ExtForeignToplevelListV1) SendFinished() {
89- self.PostEvent(ExtForeignToplevelListV1EventFinished)
90-}
91-func NewExtForeignToplevelListV1Global(d *server.Display, version int32, bind server.BindFunc) error {
92- return d.CreateGlobal(ExtForeignToplevelListV1Interface, version, bind)
93-}
94-
95-// ExtForeignToplevelHandleV1 a mapped toplevel.
96-type ExtForeignToplevelHandleV1 struct{ *server.Resource }
97-
98-func WrapExtForeignToplevelHandleV1(r *server.Resource) *ExtForeignToplevelHandleV1 {
99- if r == nil {
100- return nil
101- }
102- return &ExtForeignToplevelHandleV1{r}
103-}
104-
105-const ExtForeignToplevelHandleV1RequestDestroy uint32 = 0
106-const ExtForeignToplevelHandleV1EventClosed uint32 = 0
107-const ExtForeignToplevelHandleV1EventDone uint32 = 1
108-const ExtForeignToplevelHandleV1EventTitle uint32 = 2
109-const ExtForeignToplevelHandleV1EventAppId uint32 = 3
110-const ExtForeignToplevelHandleV1EventIdentifier uint32 = 4
111-
112-// ExtForeignToplevelHandleV1Handler handles ext_foreign_toplevel_handle_v1 requests.
113-type ExtForeignToplevelHandleV1Handler interface {
114- Destroy(self *ExtForeignToplevelHandleV1)
115-}
116-
117-func NewExtForeignToplevelHandleV1(c server.Client, version int32, id uint32, h ExtForeignToplevelHandleV1Handler) (*ExtForeignToplevelHandleV1, error) {
118- if h == nil {
119- return nil, fmt.Errorf("purego-libwayland: nil handler for ext_foreign_toplevel_handle_v1")
120- }
121- var self *ExtForeignToplevelHandleV1
122- r, err := c.CreateResource(ExtForeignToplevelHandleV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
123- switch opcode {
124- case 0:
125- h.Destroy(self)
126- self.Destroy()
127- }
128- })
129- if err != nil {
130- return nil, err
131- }
132- self = WrapExtForeignToplevelHandleV1(r)
133- r.Data = self
134- return self, nil
135-}
136-
137-// SendClosed the toplevel has been closed.
138-func (self *ExtForeignToplevelHandleV1) SendClosed() {
139- self.PostEvent(ExtForeignToplevelHandleV1EventClosed)
140-}
141-
142-// SendDone all information about the toplevel has been sent.
143-func (self *ExtForeignToplevelHandleV1) SendDone() {
144- self.PostEvent(ExtForeignToplevelHandleV1EventDone)
145-}
146-
147-// SendTitle title change.
148-func (self *ExtForeignToplevelHandleV1) SendTitle(title string) {
149- var p runtime.Pinner
150- defer p.Unpin()
151- self.PostEvent(ExtForeignToplevelHandleV1EventTitle, server.String(&p, title, false))
152-}
153-
154-// SendAppId app_id change.
155-func (self *ExtForeignToplevelHandleV1) SendAppId(appId string) {
156- var p runtime.Pinner
157- defer p.Unpin()
158- self.PostEvent(ExtForeignToplevelHandleV1EventAppId, server.String(&p, appId, false))
159-}
160-
161-// SendIdentifier a stable identifier for a toplevel.
162-func (self *ExtForeignToplevelHandleV1) SendIdentifier(identifier string) {
163- var p runtime.Pinner
164- defer p.Unpin()
165- self.PostEvent(ExtForeignToplevelHandleV1EventIdentifier, server.String(&p, identifier, false))
166-}
167-func NewExtForeignToplevelHandleV1Global(d *server.Display, version int32, bind server.BindFunc) error {
168- return d.CreateGlobal(ExtForeignToplevelHandleV1Interface, version, bind)
169-}
170-func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
171- if v == nil {
172- return nil
173- }
174- return v.GetResource()
175-}
176-func (self *ExtForeignToplevelListV1) GetResource() *server.Resource {
177- if self == nil {
178- return nil
179- }
180- return self.Resource
181-}
182-func (self *ExtForeignToplevelHandleV1) GetResource() *server.Resource {
183- if self == nil {
184- return nil
185- }
186- return self.Resource
187-}
D protocol/extidlenotify/extidlenotify.go +0 -150
@@ -1,150 +0,0 @@
1-// Code generated by wlgen; DO NOT EDIT.
2-package extidlenotify
3-
4-import (
5- "fmt"
6- wayland "github.com/bnema/purego-libwayland/protocol/wayland"
7- "github.com/bnema/purego-libwayland/server"
8-)
9-
10-var ExtIdleNotifierV1Interface *server.Interface
11-var ExtIdleNotificationV1Interface *server.Interface
12-
13-func init() {
14- ExtIdleNotifierV1Interface = &server.Interface{Name: "ext_idle_notifier_v1", Version: 2}
15- ExtIdleNotificationV1Interface = &server.Interface{Name: "ext_idle_notification_v1", Version: 2}
16- ExtIdleNotifierV1Interface.Requests = []server.Message{
17- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
18- {Name: "get_idle_notification", Signature: "nuo", Types: []*server.Interface{ExtIdleNotificationV1Interface, nil, wayland.SeatInterface}},
19- {Name: "get_input_idle_notification", Signature: "2nuo", Types: []*server.Interface{ExtIdleNotificationV1Interface, nil, wayland.SeatInterface}},
20- }
21- ExtIdleNotifierV1Interface.Events = []server.Message{}
22- ExtIdleNotificationV1Interface.Requests = []server.Message{
23- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
24- }
25- ExtIdleNotificationV1Interface.Events = []server.Message{
26- {Name: "idled", Signature: "", Types: []*server.Interface{}},
27- {Name: "resumed", Signature: "", Types: []*server.Interface{}},
28- }
29- if err := server.NewInterfaces(ExtIdleNotifierV1Interface, ExtIdleNotificationV1Interface); err != nil {
30- panic(err)
31- }
32-}
33-
34-// ExtIdleNotifierV1 idle notification manager.
35-type ExtIdleNotifierV1 struct{ *server.Resource }
36-
37-func WrapExtIdleNotifierV1(r *server.Resource) *ExtIdleNotifierV1 {
38- if r == nil {
39- return nil
40- }
41- return &ExtIdleNotifierV1{r}
42-}
43-
44-const ExtIdleNotifierV1RequestDestroy uint32 = 0
45-const ExtIdleNotifierV1RequestGetIdleNotification uint32 = 1
46-const ExtIdleNotifierV1RequestGetInputIdleNotification uint32 = 2
47-
48-// ExtIdleNotifierV1Handler handles ext_idle_notifier_v1 requests.
49-type ExtIdleNotifierV1Handler interface {
50- Destroy(self *ExtIdleNotifierV1)
51- GetIdleNotification(self *ExtIdleNotifierV1, id uint32, timeout uint32, seat *wayland.Seat)
52- GetInputIdleNotification(self *ExtIdleNotifierV1, id uint32, timeout uint32, seat *wayland.Seat)
53-}
54-
55-func NewExtIdleNotifierV1(c server.Client, version int32, id uint32, h ExtIdleNotifierV1Handler) (*ExtIdleNotifierV1, error) {
56- if h == nil {
57- return nil, fmt.Errorf("purego-libwayland: nil handler for ext_idle_notifier_v1")
58- }
59- var self *ExtIdleNotifierV1
60- r, err := c.CreateResource(ExtIdleNotifierV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
61- switch opcode {
62- case 0:
63- h.Destroy(self)
64- self.Destroy()
65- case 1:
66- h.GetIdleNotification(self, args[0].NewID(), args[1].Uint(), wayland.WrapSeat(args[2].Resource()))
67- case 2:
68- h.GetInputIdleNotification(self, args[0].NewID(), args[1].Uint(), wayland.WrapSeat(args[2].Resource()))
69- }
70- })
71- if err != nil {
72- return nil, err
73- }
74- self = WrapExtIdleNotifierV1(r)
75- r.Data = self
76- return self, nil
77-}
78-func NewExtIdleNotifierV1Global(d *server.Display, version int32, bind server.BindFunc) error {
79- return d.CreateGlobal(ExtIdleNotifierV1Interface, version, bind)
80-}
81-
82-// ExtIdleNotificationV1 idle notification.
83-type ExtIdleNotificationV1 struct{ *server.Resource }
84-
85-func WrapExtIdleNotificationV1(r *server.Resource) *ExtIdleNotificationV1 {
86- if r == nil {
87- return nil
88- }
89- return &ExtIdleNotificationV1{r}
90-}
91-
92-const ExtIdleNotificationV1RequestDestroy uint32 = 0
93-const ExtIdleNotificationV1EventIdled uint32 = 0
94-const ExtIdleNotificationV1EventResumed uint32 = 1
95-
96-// ExtIdleNotificationV1Handler handles ext_idle_notification_v1 requests.
97-type ExtIdleNotificationV1Handler interface {
98- Destroy(self *ExtIdleNotificationV1)
99-}
100-
101-func NewExtIdleNotificationV1(c server.Client, version int32, id uint32, h ExtIdleNotificationV1Handler) (*ExtIdleNotificationV1, error) {
102- if h == nil {
103- return nil, fmt.Errorf("purego-libwayland: nil handler for ext_idle_notification_v1")
104- }
105- var self *ExtIdleNotificationV1
106- r, err := c.CreateResource(ExtIdleNotificationV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
107- switch opcode {
108- case 0:
109- h.Destroy(self)
110- self.Destroy()
111- }
112- })
113- if err != nil {
114- return nil, err
115- }
116- self = WrapExtIdleNotificationV1(r)
117- r.Data = self
118- return self, nil
119-}
120-
121-// SendIdled notification object is idle.
122-func (self *ExtIdleNotificationV1) SendIdled() {
123- self.PostEvent(ExtIdleNotificationV1EventIdled)
124-}
125-
126-// SendResumed notification object is no longer idle.
127-func (self *ExtIdleNotificationV1) SendResumed() {
128- self.PostEvent(ExtIdleNotificationV1EventResumed)
129-}
130-func NewExtIdleNotificationV1Global(d *server.Display, version int32, bind server.BindFunc) error {
131- return d.CreateGlobal(ExtIdleNotificationV1Interface, version, bind)
132-}
133-func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
134- if v == nil {
135- return nil
136- }
137- return v.GetResource()
138-}
139-func (self *ExtIdleNotifierV1) GetResource() *server.Resource {
140- if self == nil {
141- return nil
142- }
143- return self.Resource
144-}
145-func (self *ExtIdleNotificationV1) GetResource() *server.Resource {
146- if self == nil {
147- return nil
148- }
149- return self.Resource
150-}
D protocol/extimagecapturesource/extimagecapturesource.go +0 -188
@@ -1,188 +0,0 @@
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-}
D protocol/extimagecopycapture/extimagecopycapture.go +0 -424
@@ -1,424 +0,0 @@
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-}
D protocol/extsessionlock/extsessionlock.go +0 -242
@@ -1,242 +0,0 @@
1-// Code generated by wlgen; DO NOT EDIT.
2-package extsessionlock
3-
4-import (
5- "fmt"
6- wayland "github.com/bnema/purego-libwayland/protocol/wayland"
7- "github.com/bnema/purego-libwayland/server"
8-)
9-
10-var ExtSessionLockManagerV1Interface *server.Interface
11-var ExtSessionLockV1Interface *server.Interface
12-var ExtSessionLockSurfaceV1Interface *server.Interface
13-
14-func init() {
15- ExtSessionLockManagerV1Interface = &server.Interface{Name: "ext_session_lock_manager_v1", Version: 1}
16- ExtSessionLockV1Interface = &server.Interface{Name: "ext_session_lock_v1", Version: 1}
17- ExtSessionLockSurfaceV1Interface = &server.Interface{Name: "ext_session_lock_surface_v1", Version: 1}
18- ExtSessionLockManagerV1Interface.Requests = []server.Message{
19- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
20- {Name: "lock", Signature: "n", Types: []*server.Interface{ExtSessionLockV1Interface}},
21- }
22- ExtSessionLockManagerV1Interface.Events = []server.Message{}
23- ExtSessionLockV1Interface.Requests = []server.Message{
24- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
25- {Name: "get_lock_surface", Signature: "noo", Types: []*server.Interface{ExtSessionLockSurfaceV1Interface, wayland.SurfaceInterface, wayland.OutputInterface}},
26- {Name: "unlock_and_destroy", Signature: "", Types: []*server.Interface{}},
27- }
28- ExtSessionLockV1Interface.Events = []server.Message{
29- {Name: "locked", Signature: "", Types: []*server.Interface{}},
30- {Name: "finished", Signature: "", Types: []*server.Interface{}},
31- }
32- ExtSessionLockSurfaceV1Interface.Requests = []server.Message{
33- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
34- {Name: "ack_configure", Signature: "u", Types: []*server.Interface{nil}},
35- }
36- ExtSessionLockSurfaceV1Interface.Events = []server.Message{
37- {Name: "configure", Signature: "uuu", Types: []*server.Interface{nil, nil, nil}},
38- }
39- if err := server.NewInterfaces(ExtSessionLockManagerV1Interface, ExtSessionLockV1Interface, ExtSessionLockSurfaceV1Interface); err != nil {
40- panic(err)
41- }
42-}
43-
44-// ExtSessionLockManagerV1 used to lock the session.
45-type ExtSessionLockManagerV1 struct{ *server.Resource }
46-
47-func WrapExtSessionLockManagerV1(r *server.Resource) *ExtSessionLockManagerV1 {
48- if r == nil {
49- return nil
50- }
51- return &ExtSessionLockManagerV1{r}
52-}
53-
54-const ExtSessionLockManagerV1RequestDestroy uint32 = 0
55-const ExtSessionLockManagerV1RequestLock uint32 = 1
56-
57-// ExtSessionLockManagerV1Handler handles ext_session_lock_manager_v1 requests.
58-type ExtSessionLockManagerV1Handler interface {
59- Destroy(self *ExtSessionLockManagerV1)
60- Lock(self *ExtSessionLockManagerV1, id uint32)
61-}
62-
63-func NewExtSessionLockManagerV1(c server.Client, version int32, id uint32, h ExtSessionLockManagerV1Handler) (*ExtSessionLockManagerV1, error) {
64- if h == nil {
65- return nil, fmt.Errorf("purego-libwayland: nil handler for ext_session_lock_manager_v1")
66- }
67- var self *ExtSessionLockManagerV1
68- r, err := c.CreateResource(ExtSessionLockManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
69- switch opcode {
70- case 0:
71- h.Destroy(self)
72- self.Destroy()
73- case 1:
74- h.Lock(self, args[0].NewID())
75- }
76- })
77- if err != nil {
78- return nil, err
79- }
80- self = WrapExtSessionLockManagerV1(r)
81- r.Data = self
82- return self, nil
83-}
84-func NewExtSessionLockManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
85- return d.CreateGlobal(ExtSessionLockManagerV1Interface, version, bind)
86-}
87-
88-// ExtSessionLockV1 manage lock state and create lock surfaces.
89-type ExtSessionLockV1 struct{ *server.Resource }
90-
91-func WrapExtSessionLockV1(r *server.Resource) *ExtSessionLockV1 {
92- if r == nil {
93- return nil
94- }
95- return &ExtSessionLockV1{r}
96-}
97-
98-const ExtSessionLockV1RequestDestroy uint32 = 0
99-const ExtSessionLockV1RequestGetLockSurface uint32 = 1
100-const ExtSessionLockV1RequestUnlockAndDestroy uint32 = 2
101-const ExtSessionLockV1EventLocked uint32 = 0
102-const ExtSessionLockV1EventFinished uint32 = 1
103-
104-// ExtSessionLockV1Error .
105-type ExtSessionLockV1Error uint32
106-
107-const (
108- ExtSessionLockV1ErrorInvalidDestroy ExtSessionLockV1Error = 0
109- ExtSessionLockV1ErrorInvalidUnlock ExtSessionLockV1Error = 1
110- ExtSessionLockV1ErrorRole ExtSessionLockV1Error = 2
111- ExtSessionLockV1ErrorDuplicateOutput ExtSessionLockV1Error = 3
112- ExtSessionLockV1ErrorAlreadyConstructed ExtSessionLockV1Error = 4
113-)
114-
115-// ExtSessionLockV1Handler handles ext_session_lock_v1 requests.
116-type ExtSessionLockV1Handler interface {
117- Destroy(self *ExtSessionLockV1)
118- GetLockSurface(self *ExtSessionLockV1, id uint32, surface *wayland.Surface, output *wayland.Output)
119- UnlockAndDestroy(self *ExtSessionLockV1)
120-}
121-
122-func NewExtSessionLockV1(c server.Client, version int32, id uint32, h ExtSessionLockV1Handler) (*ExtSessionLockV1, error) {
123- if h == nil {
124- return nil, fmt.Errorf("purego-libwayland: nil handler for ext_session_lock_v1")
125- }
126- var self *ExtSessionLockV1
127- r, err := c.CreateResource(ExtSessionLockV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
128- switch opcode {
129- case 0:
130- h.Destroy(self)
131- self.Destroy()
132- case 1:
133- h.GetLockSurface(self, args[0].NewID(), wayland.WrapSurface(args[1].Resource()), wayland.WrapOutput(args[2].Resource()))
134- case 2:
135- h.UnlockAndDestroy(self)
136- self.Destroy()
137- }
138- })
139- if err != nil {
140- return nil, err
141- }
142- self = WrapExtSessionLockV1(r)
143- r.Data = self
144- return self, nil
145-}
146-
147-// SendLocked session successfully locked.
148-func (self *ExtSessionLockV1) SendLocked() {
149- self.PostEvent(ExtSessionLockV1EventLocked)
150-}
151-
152-// SendFinished the session lock object should be destroyed.
153-func (self *ExtSessionLockV1) SendFinished() {
154- self.PostEvent(ExtSessionLockV1EventFinished)
155-}
156-func NewExtSessionLockV1Global(d *server.Display, version int32, bind server.BindFunc) error {
157- return d.CreateGlobal(ExtSessionLockV1Interface, version, bind)
158-}
159-
160-// ExtSessionLockSurfaceV1 a surface displayed while the session is locked.
161-type ExtSessionLockSurfaceV1 struct{ *server.Resource }
162-
163-func WrapExtSessionLockSurfaceV1(r *server.Resource) *ExtSessionLockSurfaceV1 {
164- if r == nil {
165- return nil
166- }
167- return &ExtSessionLockSurfaceV1{r}
168-}
169-
170-const ExtSessionLockSurfaceV1RequestDestroy uint32 = 0
171-const ExtSessionLockSurfaceV1RequestAckConfigure uint32 = 1
172-const ExtSessionLockSurfaceV1EventConfigure uint32 = 0
173-
174-// ExtSessionLockSurfaceV1Error .
175-type ExtSessionLockSurfaceV1Error uint32
176-
177-const (
178- ExtSessionLockSurfaceV1ErrorCommitBeforeFirstAck ExtSessionLockSurfaceV1Error = 0
179- ExtSessionLockSurfaceV1ErrorNullBuffer ExtSessionLockSurfaceV1Error = 1
180- ExtSessionLockSurfaceV1ErrorDimensionsMismatch ExtSessionLockSurfaceV1Error = 2
181- ExtSessionLockSurfaceV1ErrorInvalidSerial ExtSessionLockSurfaceV1Error = 3
182-)
183-
184-// ExtSessionLockSurfaceV1Handler handles ext_session_lock_surface_v1 requests.
185-type ExtSessionLockSurfaceV1Handler interface {
186- Destroy(self *ExtSessionLockSurfaceV1)
187- AckConfigure(self *ExtSessionLockSurfaceV1, serial uint32)
188-}
189-
190-func NewExtSessionLockSurfaceV1(c server.Client, version int32, id uint32, h ExtSessionLockSurfaceV1Handler) (*ExtSessionLockSurfaceV1, error) {
191- if h == nil {
192- return nil, fmt.Errorf("purego-libwayland: nil handler for ext_session_lock_surface_v1")
193- }
194- var self *ExtSessionLockSurfaceV1
195- r, err := c.CreateResource(ExtSessionLockSurfaceV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
196- switch opcode {
197- case 0:
198- h.Destroy(self)
199- self.Destroy()
200- case 1:
201- h.AckConfigure(self, args[0].Uint())
202- }
203- })
204- if err != nil {
205- return nil, err
206- }
207- self = WrapExtSessionLockSurfaceV1(r)
208- r.Data = self
209- return self, nil
210-}
211-
212-// SendConfigure the client should resize its surface.
213-func (self *ExtSessionLockSurfaceV1) SendConfigure(serial uint32, width uint32, height uint32) {
214- self.PostEvent(ExtSessionLockSurfaceV1EventConfigure, server.Uint(serial), server.Uint(width), server.Uint(height))
215-}
216-func NewExtSessionLockSurfaceV1Global(d *server.Display, version int32, bind server.BindFunc) error {
217- return d.CreateGlobal(ExtSessionLockSurfaceV1Interface, version, bind)
218-}
219-func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
220- if v == nil {
221- return nil
222- }
223- return v.GetResource()
224-}
225-func (self *ExtSessionLockManagerV1) GetResource() *server.Resource {
226- if self == nil {
227- return nil
228- }
229- return self.Resource
230-}
231-func (self *ExtSessionLockV1) GetResource() *server.Resource {
232- if self == nil {
233- return nil
234- }
235- return self.Resource
236-}
237-func (self *ExtSessionLockSurfaceV1) GetResource() *server.Resource {
238- if self == nil {
239- return nil
240- }
241- return self.Resource
242-}
D protocol/exttransientseat/exttransientseat.go +0 -144
@@ -1,144 +0,0 @@
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-}
D protocol/extworkspace/extworkspace.go +0 -354
@@ -1,354 +0,0 @@
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-}
D protocol/fifo/fifo.go +0 -154
@@ -1,154 +0,0 @@
1-// Code generated by wlgen; DO NOT EDIT.
2-package fifo
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 WpFifoManagerV1Interface *server.Interface
11-var WpFifoV1Interface *server.Interface
12-
13-func init() {
14- WpFifoManagerV1Interface = &server.Interface{Name: "wp_fifo_manager_v1", Version: 1}
15- WpFifoV1Interface = &server.Interface{Name: "wp_fifo_v1", Version: 1}
16- WpFifoManagerV1Interface.Requests = []server.Message{
17- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
18- {Name: "get_fifo", Signature: "no", Types: []*server.Interface{WpFifoV1Interface, wayland.SurfaceInterface}},
19- }
20- WpFifoManagerV1Interface.Events = []server.Message{}
21- WpFifoV1Interface.Requests = []server.Message{
22- {Name: "set_barrier", Signature: "", Types: []*server.Interface{}},
23- {Name: "wait_barrier", Signature: "", Types: []*server.Interface{}},
24- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
25- }
26- WpFifoV1Interface.Events = []server.Message{}
27- if err := server.NewInterfaces(WpFifoManagerV1Interface, WpFifoV1Interface); err != nil {
28- panic(err)
29- }
30-}
31-
32-// WpFifoManagerV1 protocol for fifo constraints.
33-type WpFifoManagerV1 struct{ *server.Resource }
34-
35-func WrapWpFifoManagerV1(r *server.Resource) *WpFifoManagerV1 {
36- if r == nil {
37- return nil
38- }
39- return &WpFifoManagerV1{r}
40-}
41-
42-const WpFifoManagerV1RequestDestroy uint32 = 0
43-const WpFifoManagerV1RequestGetFifo uint32 = 1
44-
45-// WpFifoManagerV1Error fatal presentation error.
46-type WpFifoManagerV1Error uint32
47-
48-const (
49- WpFifoManagerV1ErrorAlreadyExists WpFifoManagerV1Error = 0
50-)
51-
52-// WpFifoManagerV1Handler handles wp_fifo_manager_v1 requests.
53-type WpFifoManagerV1Handler interface {
54- Destroy(self *WpFifoManagerV1)
55- GetFifo(self *WpFifoManagerV1, id uint32, surface *wayland.Surface)
56-}
57-
58-func NewWpFifoManagerV1(c server.Client, version int32, id uint32, h WpFifoManagerV1Handler) (*WpFifoManagerV1, error) {
59- if h == nil {
60- return nil, fmt.Errorf("purego-libwayland: nil handler for wp_fifo_manager_v1")
61- }
62- var self *WpFifoManagerV1
63- r, err := c.CreateResource(WpFifoManagerV1Interface, 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.GetFifo(self, args[0].NewID(), wayland.WrapSurface(args[1].Resource()))
70- }
71- })
72- if err != nil {
73- return nil, err
74- }
75- self = WrapWpFifoManagerV1(r)
76- r.Data = self
77- return self, nil
78-}
79-func NewWpFifoManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
80- return d.CreateGlobal(WpFifoManagerV1Interface, version, bind)
81-}
82-
83-// WpFifoV1 fifo interface.
84-type WpFifoV1 struct{ *server.Resource }
85-
86-func WrapWpFifoV1(r *server.Resource) *WpFifoV1 {
87- if r == nil {
88- return nil
89- }
90- return &WpFifoV1{r}
91-}
92-
93-const WpFifoV1RequestSetBarrier uint32 = 0
94-const WpFifoV1RequestWaitBarrier uint32 = 1
95-const WpFifoV1RequestDestroy uint32 = 2
96-
97-// WpFifoV1Error fatal error.
98-type WpFifoV1Error uint32
99-
100-const (
101- WpFifoV1ErrorSurfaceDestroyed WpFifoV1Error = 0
102-)
103-
104-// WpFifoV1Handler handles wp_fifo_v1 requests.
105-type WpFifoV1Handler interface {
106- SetBarrier(self *WpFifoV1)
107- WaitBarrier(self *WpFifoV1)
108- Destroy(self *WpFifoV1)
109-}
110-
111-func NewWpFifoV1(c server.Client, version int32, id uint32, h WpFifoV1Handler) (*WpFifoV1, error) {
112- if h == nil {
113- return nil, fmt.Errorf("purego-libwayland: nil handler for wp_fifo_v1")
114- }
115- var self *WpFifoV1
116- r, err := c.CreateResource(WpFifoV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
117- switch opcode {
118- case 0:
119- h.SetBarrier(self)
120- case 1:
121- h.WaitBarrier(self)
122- case 2:
123- h.Destroy(self)
124- self.Destroy()
125- }
126- })
127- if err != nil {
128- return nil, err
129- }
130- self = WrapWpFifoV1(r)
131- r.Data = self
132- return self, nil
133-}
134-func NewWpFifoV1Global(d *server.Display, version int32, bind server.BindFunc) error {
135- return d.CreateGlobal(WpFifoV1Interface, version, bind)
136-}
137-func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
138- if v == nil {
139- return nil
140- }
141- return v.GetResource()
142-}
143-func (self *WpFifoManagerV1) GetResource() *server.Resource {
144- if self == nil {
145- return nil
146- }
147- return self.Resource
148-}
149-func (self *WpFifoV1) GetResource() *server.Resource {
150- if self == nil {
151- return nil
152- }
153- return self.Resource
154-}
D protocol/fractionalscale/fractionalscale.go +0 -145
@@ -1,145 +0,0 @@
1-// Code generated by wlgen; DO NOT EDIT.
2-package fractionalscale
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 WpFractionalScaleManagerV1Interface *server.Interface
11-var WpFractionalScaleV1Interface *server.Interface
12-
13-func init() {
14- WpFractionalScaleManagerV1Interface = &server.Interface{Name: "wp_fractional_scale_manager_v1", Version: 1}
15- WpFractionalScaleV1Interface = &server.Interface{Name: "wp_fractional_scale_v1", Version: 1}
16- WpFractionalScaleManagerV1Interface.Requests = []server.Message{
17- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
18- {Name: "get_fractional_scale", Signature: "no", Types: []*server.Interface{WpFractionalScaleV1Interface, wayland.SurfaceInterface}},
19- }
20- WpFractionalScaleManagerV1Interface.Events = []server.Message{}
21- WpFractionalScaleV1Interface.Requests = []server.Message{
22- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
23- }
24- WpFractionalScaleV1Interface.Events = []server.Message{
25- {Name: "preferred_scale", Signature: "u", Types: []*server.Interface{nil}},
26- }
27- if err := server.NewInterfaces(WpFractionalScaleManagerV1Interface, WpFractionalScaleV1Interface); err != nil {
28- panic(err)
29- }
30-}
31-
32-// WpFractionalScaleManagerV1 fractional surface scale information.
33-type WpFractionalScaleManagerV1 struct{ *server.Resource }
34-
35-func WrapWpFractionalScaleManagerV1(r *server.Resource) *WpFractionalScaleManagerV1 {
36- if r == nil {
37- return nil
38- }
39- return &WpFractionalScaleManagerV1{r}
40-}
41-
42-const WpFractionalScaleManagerV1RequestDestroy uint32 = 0
43-const WpFractionalScaleManagerV1RequestGetFractionalScale uint32 = 1
44-
45-// WpFractionalScaleManagerV1Error .
46-type WpFractionalScaleManagerV1Error uint32
47-
48-const (
49- WpFractionalScaleManagerV1ErrorFractionalScaleExists WpFractionalScaleManagerV1Error = 0
50-)
51-
52-// WpFractionalScaleManagerV1Handler handles wp_fractional_scale_manager_v1 requests.
53-type WpFractionalScaleManagerV1Handler interface {
54- Destroy(self *WpFractionalScaleManagerV1)
55- GetFractionalScale(self *WpFractionalScaleManagerV1, id uint32, surface *wayland.Surface)
56-}
57-
58-func NewWpFractionalScaleManagerV1(c server.Client, version int32, id uint32, h WpFractionalScaleManagerV1Handler) (*WpFractionalScaleManagerV1, error) {
59- if h == nil {
60- return nil, fmt.Errorf("purego-libwayland: nil handler for wp_fractional_scale_manager_v1")
61- }
62- var self *WpFractionalScaleManagerV1
63- r, err := c.CreateResource(WpFractionalScaleManagerV1Interface, 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.GetFractionalScale(self, args[0].NewID(), wayland.WrapSurface(args[1].Resource()))
70- }
71- })
72- if err != nil {
73- return nil, err
74- }
75- self = WrapWpFractionalScaleManagerV1(r)
76- r.Data = self
77- return self, nil
78-}
79-func NewWpFractionalScaleManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
80- return d.CreateGlobal(WpFractionalScaleManagerV1Interface, version, bind)
81-}
82-
83-// WpFractionalScaleV1 fractional scale interface to a wl_surface.
84-type WpFractionalScaleV1 struct{ *server.Resource }
85-
86-func WrapWpFractionalScaleV1(r *server.Resource) *WpFractionalScaleV1 {
87- if r == nil {
88- return nil
89- }
90- return &WpFractionalScaleV1{r}
91-}
92-
93-const WpFractionalScaleV1RequestDestroy uint32 = 0
94-const WpFractionalScaleV1EventPreferredScale uint32 = 0
95-
96-// WpFractionalScaleV1Handler handles wp_fractional_scale_v1 requests.
97-type WpFractionalScaleV1Handler interface {
98- Destroy(self *WpFractionalScaleV1)
99-}
100-
101-func NewWpFractionalScaleV1(c server.Client, version int32, id uint32, h WpFractionalScaleV1Handler) (*WpFractionalScaleV1, error) {
102- if h == nil {
103- return nil, fmt.Errorf("purego-libwayland: nil handler for wp_fractional_scale_v1")
104- }
105- var self *WpFractionalScaleV1
106- r, err := c.CreateResource(WpFractionalScaleV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
107- switch opcode {
108- case 0:
109- h.Destroy(self)
110- self.Destroy()
111- }
112- })
113- if err != nil {
114- return nil, err
115- }
116- self = WrapWpFractionalScaleV1(r)
117- r.Data = self
118- return self, nil
119-}
120-
121-// SendPreferredScale notify of new preferred scale.
122-func (self *WpFractionalScaleV1) SendPreferredScale(scale uint32) {
123- self.PostEvent(WpFractionalScaleV1EventPreferredScale, server.Uint(scale))
124-}
125-func NewWpFractionalScaleV1Global(d *server.Display, version int32, bind server.BindFunc) error {
126- return d.CreateGlobal(WpFractionalScaleV1Interface, version, bind)
127-}
128-func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
129- if v == nil {
130- return nil
131- }
132- return v.GetResource()
133-}
134-func (self *WpFractionalScaleManagerV1) GetResource() *server.Resource {
135- if self == nil {
136- return nil
137- }
138- return self.Resource
139-}
140-func (self *WpFractionalScaleV1) GetResource() *server.Resource {
141- if self == nil {
142- return nil
143- }
144- return self.Resource
145-}
D protocol/gen.go +0 -61
@@ -1,61 +0,0 @@
1-// Package protocol holds generated server bindings for vendored Wayland protocols.
2-package protocol
3-
4-//go:generate go run ../cmd/wlgen -package wayland -out wayland/wayland.go ../protocols/wayland.xml
5-//go:generate go run ../cmd/wlgen -package xdgshell -out xdgshell/xdgshell.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/xdg-shell.xml
6-//go:generate go run ../cmd/wlgen -package wlrlayershell -out wlrlayershell/wlrlayershell.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/wlr-layer-shell-unstable-v1.xml
7-//go:generate go run ../cmd/wlgen -package xdgoutput -out xdgoutput/xdgoutput.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/xdg-output-unstable-v1.xml
8-//go:generate go run ../cmd/wlgen -package xdgdecoration -out xdgdecoration/xdgdecoration.go -import xdgshell=github.com/bnema/purego-libwayland/protocol/xdgshell -import-xml xdgshell=../protocols/xdg-shell.xml ../protocols/xdg-decoration-unstable-v1.xml
9-//go:generate go run ../cmd/wlgen -package viewporter -out viewporter/viewporter.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/viewporter.xml
10-//go:generate go run ../cmd/wlgen -package fractionalscale -out fractionalscale/fractionalscale.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/fractional-scale-v1.xml
11-//go:generate go run ../cmd/wlgen -package linuxdmabuf -out linuxdmabuf/linuxdmabuf.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/linux-dmabuf-v1.xml
12-//go:generate go run ../cmd/wlgen -package kdedecoration -out kdedecoration/kdedecoration.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/server-decoration.xml
13-//go:generate go run ../cmd/wlgen -package tabletv2 -out tabletv2/tabletv2.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/tablet-v2.xml
14-//go:generate go run ../cmd/wlgen -package cursorshape -out cursorshape/cursorshape.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml -import tabletv2=github.com/bnema/purego-libwayland/protocol/tabletv2 -import-xml tabletv2=../protocols/tablet-v2.xml ../protocols/cursor-shape-v1.xml
15-//go:generate go run ../cmd/wlgen -package primaryselection -out primaryselection/primaryselection.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/primary-selection-unstable-v1.xml
16-//go:generate go run ../cmd/wlgen -package extdatacontrol -out extdatacontrol/extdatacontrol.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/ext-data-control-v1.xml
17-//go:generate go run ../cmd/wlgen -package relativepointer -out relativepointer/relativepointer.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/relative-pointer-unstable-v1.xml
18-//go:generate go run ../cmd/wlgen -package pointerconstraints -out pointerconstraints/pointerconstraints.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/pointer-constraints-unstable-v1.xml
19-//go:generate go run ../cmd/wlgen -package tearingcontrol -out tearingcontrol/tearingcontrol.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/tearing-control-v1.xml
20-//go:generate go run ../cmd/wlgen -package fifo -out fifo/fifo.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/fifo-v1.xml
21-//go:generate go run ../cmd/wlgen -package committiming -out committiming/committiming.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/commit-timing-v1.xml
22-//go:generate go run ../cmd/wlgen -package contenttype -out contenttype/contenttype.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/content-type-v1.xml
23-//go:generate go run ../cmd/wlgen -package xdgactivation -out xdgactivation/xdgactivation.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/xdg-activation-v1.xml
24-//go:generate go run ../cmd/wlgen -package virtualkeyboard -out virtualkeyboard/virtualkeyboard.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/virtual-keyboard-unstable-v1.xml
25-//go:generate go run ../cmd/wlgen -package presentationtime -out presentationtime/presentationtime.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/presentation-time.xml
26-//go:generate go run ../cmd/wlgen -package linuxdrmsyncobj -out linuxdrmsyncobj/linuxdrmsyncobj.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/linux-drm-syncobj-v1.xml
27-//go:generate go run ../cmd/wlgen -package pointergestures -out pointergestures/pointergestures.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/pointer-gestures-unstable-v1.xml
28-//go:generate go run ../cmd/wlgen -package keyboardshortcutsinhibit -out keyboardshortcutsinhibit/keyboardshortcutsinhibit.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/keyboard-shortcuts-inhibit-unstable-v1.xml
29-//go:generate go run ../cmd/wlgen -package idleinhibit -out idleinhibit/idleinhibit.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/idle-inhibit-unstable-v1.xml
30-//go:generate go run ../cmd/wlgen -package extsessionlock -out extsessionlock/extsessionlock.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/ext-session-lock-v1.xml
31-//go:generate go run ../cmd/wlgen -package extidlenotify -out extidlenotify/extidlenotify.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/ext-idle-notify-v1.xml
32-//go:generate go run ../cmd/wlgen -package extforeigntoplevellist -out extforeigntoplevellist/extforeigntoplevellist.go ../protocols/ext-foreign-toplevel-list-v1.xml
33-//go:generate go run ../cmd/wlgen -package xdgdialog -out xdgdialog/xdgdialog.go -import xdgshell=github.com/bnema/purego-libwayland/protocol/xdgshell -import-xml xdgshell=../protocols/xdg-shell.xml ../protocols/xdg-dialog-v1.xml
34-//go:generate go run ../cmd/wlgen -package xdgtoplevelicon -out xdgtoplevelicon/xdgtoplevelicon.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml -import xdgshell=github.com/bnema/purego-libwayland/protocol/xdgshell -import-xml xdgshell=../protocols/xdg-shell.xml ../protocols/xdg-toplevel-icon-v1.xml
35-//go:generate go run ../cmd/wlgen -package xdgtopleveltag -out xdgtopleveltag/xdgtopleveltag.go -import xdgshell=github.com/bnema/purego-libwayland/protocol/xdgshell -import-xml xdgshell=../protocols/xdg-shell.xml ../protocols/xdg-toplevel-tag-v1.xml
36-//go:generate go run ../cmd/wlgen -package xdgsystembell -out xdgsystembell/xdgsystembell.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/xdg-system-bell-v1.xml
37-//go:generate go run ../cmd/wlgen -package xdgforeign -out xdgforeign/xdgforeign.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/xdg-foreign-unstable-v2.xml
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
61-//go:generate go run ../cmd/wlgen -package wlroutputpower -out wlroutputpower/wlroutputpower.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/wlr-output-power-management-unstable-v1.xml
D protocol/idleinhibit/idleinhibit.go +0 -130
@@ -1,130 +0,0 @@
1-// Code generated by wlgen; DO NOT EDIT.
2-package idleinhibit
3-
4-import (
5- "fmt"
6- wayland "github.com/bnema/purego-libwayland/protocol/wayland"
7- "github.com/bnema/purego-libwayland/server"
8-)
9-
10-var ZwpIdleInhibitManagerV1Interface *server.Interface
11-var ZwpIdleInhibitorV1Interface *server.Interface
12-
13-func init() {
14- ZwpIdleInhibitManagerV1Interface = &server.Interface{Name: "zwp_idle_inhibit_manager_v1", Version: 1}
15- ZwpIdleInhibitorV1Interface = &server.Interface{Name: "zwp_idle_inhibitor_v1", Version: 1}
16- ZwpIdleInhibitManagerV1Interface.Requests = []server.Message{
17- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
18- {Name: "create_inhibitor", Signature: "no", Types: []*server.Interface{ZwpIdleInhibitorV1Interface, wayland.SurfaceInterface}},
19- }
20- ZwpIdleInhibitManagerV1Interface.Events = []server.Message{}
21- ZwpIdleInhibitorV1Interface.Requests = []server.Message{
22- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
23- }
24- ZwpIdleInhibitorV1Interface.Events = []server.Message{}
25- if err := server.NewInterfaces(ZwpIdleInhibitManagerV1Interface, ZwpIdleInhibitorV1Interface); err != nil {
26- panic(err)
27- }
28-}
29-
30-// ZwpIdleInhibitManagerV1 control behavior when display idles.
31-type ZwpIdleInhibitManagerV1 struct{ *server.Resource }
32-
33-func WrapZwpIdleInhibitManagerV1(r *server.Resource) *ZwpIdleInhibitManagerV1 {
34- if r == nil {
35- return nil
36- }
37- return &ZwpIdleInhibitManagerV1{r}
38-}
39-
40-const ZwpIdleInhibitManagerV1RequestDestroy uint32 = 0
41-const ZwpIdleInhibitManagerV1RequestCreateInhibitor uint32 = 1
42-
43-// ZwpIdleInhibitManagerV1Handler handles zwp_idle_inhibit_manager_v1 requests.
44-type ZwpIdleInhibitManagerV1Handler interface {
45- Destroy(self *ZwpIdleInhibitManagerV1)
46- CreateInhibitor(self *ZwpIdleInhibitManagerV1, id uint32, surface *wayland.Surface)
47-}
48-
49-func NewZwpIdleInhibitManagerV1(c server.Client, version int32, id uint32, h ZwpIdleInhibitManagerV1Handler) (*ZwpIdleInhibitManagerV1, error) {
50- if h == nil {
51- return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_idle_inhibit_manager_v1")
52- }
53- var self *ZwpIdleInhibitManagerV1
54- r, err := c.CreateResource(ZwpIdleInhibitManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
55- switch opcode {
56- case 0:
57- h.Destroy(self)
58- self.Destroy()
59- case 1:
60- h.CreateInhibitor(self, args[0].NewID(), wayland.WrapSurface(args[1].Resource()))
61- }
62- })
63- if err != nil {
64- return nil, err
65- }
66- self = WrapZwpIdleInhibitManagerV1(r)
67- r.Data = self
68- return self, nil
69-}
70-func NewZwpIdleInhibitManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
71- return d.CreateGlobal(ZwpIdleInhibitManagerV1Interface, version, bind)
72-}
73-
74-// ZwpIdleInhibitorV1 context object for inhibiting idle behavior.
75-type ZwpIdleInhibitorV1 struct{ *server.Resource }
76-
77-func WrapZwpIdleInhibitorV1(r *server.Resource) *ZwpIdleInhibitorV1 {
78- if r == nil {
79- return nil
80- }
81- return &ZwpIdleInhibitorV1{r}
82-}
83-
84-const ZwpIdleInhibitorV1RequestDestroy uint32 = 0
85-
86-// ZwpIdleInhibitorV1Handler handles zwp_idle_inhibitor_v1 requests.
87-type ZwpIdleInhibitorV1Handler interface {
88- Destroy(self *ZwpIdleInhibitorV1)
89-}
90-
91-func NewZwpIdleInhibitorV1(c server.Client, version int32, id uint32, h ZwpIdleInhibitorV1Handler) (*ZwpIdleInhibitorV1, error) {
92- if h == nil {
93- return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_idle_inhibitor_v1")
94- }
95- var self *ZwpIdleInhibitorV1
96- r, err := c.CreateResource(ZwpIdleInhibitorV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
97- switch opcode {
98- case 0:
99- h.Destroy(self)
100- self.Destroy()
101- }
102- })
103- if err != nil {
104- return nil, err
105- }
106- self = WrapZwpIdleInhibitorV1(r)
107- r.Data = self
108- return self, nil
109-}
110-func NewZwpIdleInhibitorV1Global(d *server.Display, version int32, bind server.BindFunc) error {
111- return d.CreateGlobal(ZwpIdleInhibitorV1Interface, version, bind)
112-}
113-func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
114- if v == nil {
115- return nil
116- }
117- return v.GetResource()
118-}
119-func (self *ZwpIdleInhibitManagerV1) GetResource() *server.Resource {
120- if self == nil {
121- return nil
122- }
123- return self.Resource
124-}
125-func (self *ZwpIdleInhibitorV1) GetResource() *server.Resource {
126- if self == nil {
127- return nil
128- }
129- return self.Resource
130-}
D protocol/inputmethod/inputmethod.go +0 -361
@@ -1,361 +0,0 @@
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-}
D protocol/kdedecoration/kdedecoration.go +0 -163
@@ -1,163 +0,0 @@
1-// Code generated by wlgen; DO NOT EDIT.
2-package kdedecoration
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 OrgKdeKwinServerDecorationManagerInterface *server.Interface
11-var OrgKdeKwinServerDecorationInterface *server.Interface
12-
13-func init() {
14- OrgKdeKwinServerDecorationManagerInterface = &server.Interface{Name: "org_kde_kwin_server_decoration_manager", Version: 1}
15- OrgKdeKwinServerDecorationInterface = &server.Interface{Name: "org_kde_kwin_server_decoration", Version: 1}
16- OrgKdeKwinServerDecorationManagerInterface.Requests = []server.Message{
17- {Name: "create", Signature: "no", Types: []*server.Interface{OrgKdeKwinServerDecorationInterface, wayland.SurfaceInterface}},
18- }
19- OrgKdeKwinServerDecorationManagerInterface.Events = []server.Message{
20- {Name: "default_mode", Signature: "u", Types: []*server.Interface{nil}},
21- }
22- OrgKdeKwinServerDecorationInterface.Requests = []server.Message{
23- {Name: "release", Signature: "", Types: []*server.Interface{}},
24- {Name: "request_mode", Signature: "u", Types: []*server.Interface{nil}},
25- }
26- OrgKdeKwinServerDecorationInterface.Events = []server.Message{
27- {Name: "mode", Signature: "u", Types: []*server.Interface{nil}},
28- }
29- if err := server.NewInterfaces(OrgKdeKwinServerDecorationManagerInterface, OrgKdeKwinServerDecorationInterface); err != nil {
30- panic(err)
31- }
32-}
33-
34-// OrgKdeKwinServerDecorationManager Server side window decoration manager.
35-type OrgKdeKwinServerDecorationManager struct{ *server.Resource }
36-
37-func WrapOrgKdeKwinServerDecorationManager(r *server.Resource) *OrgKdeKwinServerDecorationManager {
38- if r == nil {
39- return nil
40- }
41- return &OrgKdeKwinServerDecorationManager{r}
42-}
43-
44-const OrgKdeKwinServerDecorationManagerRequestCreate uint32 = 0
45-const OrgKdeKwinServerDecorationManagerEventDefaultMode uint32 = 0
46-
47-// OrgKdeKwinServerDecorationManagerMode Possible values to use in request_mode and the event mode..
48-type OrgKdeKwinServerDecorationManagerMode uint32
49-
50-const (
51- OrgKdeKwinServerDecorationManagerModeNone OrgKdeKwinServerDecorationManagerMode = 0
52- OrgKdeKwinServerDecorationManagerModeClient OrgKdeKwinServerDecorationManagerMode = 1
53- OrgKdeKwinServerDecorationManagerModeServer OrgKdeKwinServerDecorationManagerMode = 2
54-)
55-
56-// OrgKdeKwinServerDecorationManagerHandler handles org_kde_kwin_server_decoration_manager requests.
57-type OrgKdeKwinServerDecorationManagerHandler interface {
58- Create(self *OrgKdeKwinServerDecorationManager, id uint32, surface *wayland.Surface)
59-}
60-
61-func NewOrgKdeKwinServerDecorationManager(c server.Client, version int32, id uint32, h OrgKdeKwinServerDecorationManagerHandler) (*OrgKdeKwinServerDecorationManager, error) {
62- if h == nil {
63- return nil, fmt.Errorf("purego-libwayland: nil handler for org_kde_kwin_server_decoration_manager")
64- }
65- var self *OrgKdeKwinServerDecorationManager
66- r, err := c.CreateResource(OrgKdeKwinServerDecorationManagerInterface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
67- switch opcode {
68- case 0:
69- h.Create(self, args[0].NewID(), wayland.WrapSurface(args[1].Resource()))
70- }
71- })
72- if err != nil {
73- return nil, err
74- }
75- self = WrapOrgKdeKwinServerDecorationManager(r)
76- r.Data = self
77- return self, nil
78-}
79-
80-// SendDefaultMode The default mode used on the server.
81-func (self *OrgKdeKwinServerDecorationManager) SendDefaultMode(mode uint32) {
82- self.PostEvent(OrgKdeKwinServerDecorationManagerEventDefaultMode, server.Uint(mode))
83-}
84-func NewOrgKdeKwinServerDecorationManagerGlobal(d *server.Display, version int32, bind server.BindFunc) error {
85- return d.CreateGlobal(OrgKdeKwinServerDecorationManagerInterface, version, bind)
86-}
87-
88-// OrgKdeKwinServerDecoration .
89-type OrgKdeKwinServerDecoration struct{ *server.Resource }
90-
91-func WrapOrgKdeKwinServerDecoration(r *server.Resource) *OrgKdeKwinServerDecoration {
92- if r == nil {
93- return nil
94- }
95- return &OrgKdeKwinServerDecoration{r}
96-}
97-
98-const OrgKdeKwinServerDecorationRequestRelease uint32 = 0
99-const OrgKdeKwinServerDecorationRequestRequestMode uint32 = 1
100-const OrgKdeKwinServerDecorationEventMode uint32 = 0
101-
102-// OrgKdeKwinServerDecorationMode Possible values to use in request_mode and the event mode..
103-type OrgKdeKwinServerDecorationMode uint32
104-
105-const (
106- OrgKdeKwinServerDecorationModeNone OrgKdeKwinServerDecorationMode = 0
107- OrgKdeKwinServerDecorationModeClient OrgKdeKwinServerDecorationMode = 1
108- OrgKdeKwinServerDecorationModeServer OrgKdeKwinServerDecorationMode = 2
109-)
110-
111-// OrgKdeKwinServerDecorationHandler handles org_kde_kwin_server_decoration requests.
112-type OrgKdeKwinServerDecorationHandler interface {
113- Release(self *OrgKdeKwinServerDecoration)
114- RequestMode(self *OrgKdeKwinServerDecoration, mode uint32)
115-}
116-
117-func NewOrgKdeKwinServerDecoration(c server.Client, version int32, id uint32, h OrgKdeKwinServerDecorationHandler) (*OrgKdeKwinServerDecoration, error) {
118- if h == nil {
119- return nil, fmt.Errorf("purego-libwayland: nil handler for org_kde_kwin_server_decoration")
120- }
121- var self *OrgKdeKwinServerDecoration
122- r, err := c.CreateResource(OrgKdeKwinServerDecorationInterface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
123- switch opcode {
124- case 0:
125- h.Release(self)
126- self.Destroy()
127- case 1:
128- h.RequestMode(self, args[0].Uint())
129- }
130- })
131- if err != nil {
132- return nil, err
133- }
134- self = WrapOrgKdeKwinServerDecoration(r)
135- r.Data = self
136- return self, nil
137-}
138-
139-// SendMode The new decoration mode applied by the server.
140-func (self *OrgKdeKwinServerDecoration) SendMode(mode uint32) {
141- self.PostEvent(OrgKdeKwinServerDecorationEventMode, server.Uint(mode))
142-}
143-func NewOrgKdeKwinServerDecorationGlobal(d *server.Display, version int32, bind server.BindFunc) error {
144- return d.CreateGlobal(OrgKdeKwinServerDecorationInterface, version, bind)
145-}
146-func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
147- if v == nil {
148- return nil
149- }
150- return v.GetResource()
151-}
152-func (self *OrgKdeKwinServerDecorationManager) GetResource() *server.Resource {
153- if self == nil {
154- return nil
155- }
156- return self.Resource
157-}
158-func (self *OrgKdeKwinServerDecoration) GetResource() *server.Resource {
159- if self == nil {
160- return nil
161- }
162- return self.Resource
163-}
D protocol/keyboardshortcutsinhibit/keyboardshortcutsinhibit.go +0 -152
@@ -1,152 +0,0 @@
1-// Code generated by wlgen; DO NOT EDIT.
2-package keyboardshortcutsinhibit
3-
4-import (
5- "fmt"
6- wayland "github.com/bnema/purego-libwayland/protocol/wayland"
7- "github.com/bnema/purego-libwayland/server"
8-)
9-
10-var ZwpKeyboardShortcutsInhibitManagerV1Interface *server.Interface
11-var ZwpKeyboardShortcutsInhibitorV1Interface *server.Interface
12-
13-func init() {
14- ZwpKeyboardShortcutsInhibitManagerV1Interface = &server.Interface{Name: "zwp_keyboard_shortcuts_inhibit_manager_v1", Version: 1}
15- ZwpKeyboardShortcutsInhibitorV1Interface = &server.Interface{Name: "zwp_keyboard_shortcuts_inhibitor_v1", Version: 1}
16- ZwpKeyboardShortcutsInhibitManagerV1Interface.Requests = []server.Message{
17- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
18- {Name: "inhibit_shortcuts", Signature: "noo", Types: []*server.Interface{ZwpKeyboardShortcutsInhibitorV1Interface, wayland.SurfaceInterface, wayland.SeatInterface}},
19- }
20- ZwpKeyboardShortcutsInhibitManagerV1Interface.Events = []server.Message{}
21- ZwpKeyboardShortcutsInhibitorV1Interface.Requests = []server.Message{
22- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
23- }
24- ZwpKeyboardShortcutsInhibitorV1Interface.Events = []server.Message{
25- {Name: "active", Signature: "", Types: []*server.Interface{}},
26- {Name: "inactive", Signature: "", Types: []*server.Interface{}},
27- }
28- if err := server.NewInterfaces(ZwpKeyboardShortcutsInhibitManagerV1Interface, ZwpKeyboardShortcutsInhibitorV1Interface); err != nil {
29- panic(err)
30- }
31-}
32-
33-// ZwpKeyboardShortcutsInhibitManagerV1 context object for keyboard grab_manager.
34-type ZwpKeyboardShortcutsInhibitManagerV1 struct{ *server.Resource }
35-
36-func WrapZwpKeyboardShortcutsInhibitManagerV1(r *server.Resource) *ZwpKeyboardShortcutsInhibitManagerV1 {
37- if r == nil {
38- return nil
39- }
40- return &ZwpKeyboardShortcutsInhibitManagerV1{r}
41-}
42-
43-const ZwpKeyboardShortcutsInhibitManagerV1RequestDestroy uint32 = 0
44-const ZwpKeyboardShortcutsInhibitManagerV1RequestInhibitShortcuts uint32 = 1
45-
46-// ZwpKeyboardShortcutsInhibitManagerV1Error .
47-type ZwpKeyboardShortcutsInhibitManagerV1Error uint32
48-
49-const (
50- ZwpKeyboardShortcutsInhibitManagerV1ErrorAlreadyInhibited ZwpKeyboardShortcutsInhibitManagerV1Error = 0
51-)
52-
53-// ZwpKeyboardShortcutsInhibitManagerV1Handler handles zwp_keyboard_shortcuts_inhibit_manager_v1 requests.
54-type ZwpKeyboardShortcutsInhibitManagerV1Handler interface {
55- Destroy(self *ZwpKeyboardShortcutsInhibitManagerV1)
56- InhibitShortcuts(self *ZwpKeyboardShortcutsInhibitManagerV1, id uint32, surface *wayland.Surface, seat *wayland.Seat)
57-}
58-
59-func NewZwpKeyboardShortcutsInhibitManagerV1(c server.Client, version int32, id uint32, h ZwpKeyboardShortcutsInhibitManagerV1Handler) (*ZwpKeyboardShortcutsInhibitManagerV1, error) {
60- if h == nil {
61- return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_keyboard_shortcuts_inhibit_manager_v1")
62- }
63- var self *ZwpKeyboardShortcutsInhibitManagerV1
64- r, err := c.CreateResource(ZwpKeyboardShortcutsInhibitManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
65- switch opcode {
66- case 0:
67- h.Destroy(self)
68- self.Destroy()
69- case 1:
70- h.InhibitShortcuts(self, args[0].NewID(), wayland.WrapSurface(args[1].Resource()), wayland.WrapSeat(args[2].Resource()))
71- }
72- })
73- if err != nil {
74- return nil, err
75- }
76- self = WrapZwpKeyboardShortcutsInhibitManagerV1(r)
77- r.Data = self
78- return self, nil
79-}
80-func NewZwpKeyboardShortcutsInhibitManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
81- return d.CreateGlobal(ZwpKeyboardShortcutsInhibitManagerV1Interface, version, bind)
82-}
83-
84-// ZwpKeyboardShortcutsInhibitorV1 context object for keyboard shortcuts inhibitor.
85-type ZwpKeyboardShortcutsInhibitorV1 struct{ *server.Resource }
86-
87-func WrapZwpKeyboardShortcutsInhibitorV1(r *server.Resource) *ZwpKeyboardShortcutsInhibitorV1 {
88- if r == nil {
89- return nil
90- }
91- return &ZwpKeyboardShortcutsInhibitorV1{r}
92-}
93-
94-const ZwpKeyboardShortcutsInhibitorV1RequestDestroy uint32 = 0
95-const ZwpKeyboardShortcutsInhibitorV1EventActive uint32 = 0
96-const ZwpKeyboardShortcutsInhibitorV1EventInactive uint32 = 1
97-
98-// ZwpKeyboardShortcutsInhibitorV1Handler handles zwp_keyboard_shortcuts_inhibitor_v1 requests.
99-type ZwpKeyboardShortcutsInhibitorV1Handler interface {
100- Destroy(self *ZwpKeyboardShortcutsInhibitorV1)
101-}
102-
103-func NewZwpKeyboardShortcutsInhibitorV1(c server.Client, version int32, id uint32, h ZwpKeyboardShortcutsInhibitorV1Handler) (*ZwpKeyboardShortcutsInhibitorV1, error) {
104- if h == nil {
105- return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_keyboard_shortcuts_inhibitor_v1")
106- }
107- var self *ZwpKeyboardShortcutsInhibitorV1
108- r, err := c.CreateResource(ZwpKeyboardShortcutsInhibitorV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
109- switch opcode {
110- case 0:
111- h.Destroy(self)
112- self.Destroy()
113- }
114- })
115- if err != nil {
116- return nil, err
117- }
118- self = WrapZwpKeyboardShortcutsInhibitorV1(r)
119- r.Data = self
120- return self, nil
121-}
122-
123-// SendActive shortcuts are inhibited.
124-func (self *ZwpKeyboardShortcutsInhibitorV1) SendActive() {
125- self.PostEvent(ZwpKeyboardShortcutsInhibitorV1EventActive)
126-}
127-
128-// SendInactive shortcuts are restored.
129-func (self *ZwpKeyboardShortcutsInhibitorV1) SendInactive() {
130- self.PostEvent(ZwpKeyboardShortcutsInhibitorV1EventInactive)
131-}
132-func NewZwpKeyboardShortcutsInhibitorV1Global(d *server.Display, version int32, bind server.BindFunc) error {
133- return d.CreateGlobal(ZwpKeyboardShortcutsInhibitorV1Interface, version, bind)
134-}
135-func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
136- if v == nil {
137- return nil
138- }
139- return v.GetResource()
140-}
141-func (self *ZwpKeyboardShortcutsInhibitManagerV1) GetResource() *server.Resource {
142- if self == nil {
143- return nil
144- }
145- return self.Resource
146-}
147-func (self *ZwpKeyboardShortcutsInhibitorV1) GetResource() *server.Resource {
148- if self == nil {
149- return nil
150- }
151- return self.Resource
152-}
D protocol/linuxdmabuf/linuxdmabuf.go +0 -331
@@ -1,331 +0,0 @@
1-// Code generated by wlgen; DO NOT EDIT.
2-package linuxdmabuf
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 ZwpLinuxDmabufV1Interface *server.Interface
12-var ZwpLinuxBufferParamsV1Interface *server.Interface
13-var ZwpLinuxDmabufFeedbackV1Interface *server.Interface
14-
15-func init() {
16- ZwpLinuxDmabufV1Interface = &server.Interface{Name: "zwp_linux_dmabuf_v1", Version: 6}
17- ZwpLinuxBufferParamsV1Interface = &server.Interface{Name: "zwp_linux_buffer_params_v1", Version: 6}
18- ZwpLinuxDmabufFeedbackV1Interface = &server.Interface{Name: "zwp_linux_dmabuf_feedback_v1", Version: 6}
19- ZwpLinuxDmabufV1Interface.Requests = []server.Message{
20- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
21- {Name: "create_params", Signature: "n", Types: []*server.Interface{ZwpLinuxBufferParamsV1Interface}},
22- {Name: "get_default_feedback", Signature: "4n", Types: []*server.Interface{ZwpLinuxDmabufFeedbackV1Interface}},
23- {Name: "get_surface_feedback", Signature: "4no", Types: []*server.Interface{ZwpLinuxDmabufFeedbackV1Interface, wayland.SurfaceInterface}},
24- }
25- ZwpLinuxDmabufV1Interface.Events = []server.Message{
26- {Name: "format", Signature: "u", Types: []*server.Interface{nil}},
27- {Name: "modifier", Signature: "3uuu", Types: []*server.Interface{nil, nil, nil}},
28- }
29- ZwpLinuxBufferParamsV1Interface.Requests = []server.Message{
30- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
31- {Name: "add", Signature: "huuuuu", Types: []*server.Interface{nil, nil, nil, nil, nil, nil}},
32- {Name: "create", Signature: "iiuu", Types: []*server.Interface{nil, nil, nil, nil}},
33- {Name: "create_immed", Signature: "2niiuu", Types: []*server.Interface{wayland.BufferInterface, nil, nil, nil, nil}},
34- {Name: "set_sampling_device", Signature: "6a", Types: []*server.Interface{nil}},
35- }
36- ZwpLinuxBufferParamsV1Interface.Events = []server.Message{
37- {Name: "created", Signature: "n", Types: []*server.Interface{wayland.BufferInterface}},
38- {Name: "failed", Signature: "", Types: []*server.Interface{}},
39- }
40- ZwpLinuxDmabufFeedbackV1Interface.Requests = []server.Message{
41- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
42- }
43- ZwpLinuxDmabufFeedbackV1Interface.Events = []server.Message{
44- {Name: "done", Signature: "", Types: []*server.Interface{}},
45- {Name: "format_table", Signature: "hu", Types: []*server.Interface{nil, nil}},
46- {Name: "main_device", Signature: "a", Types: []*server.Interface{nil}},
47- {Name: "tranche_done", Signature: "", Types: []*server.Interface{}},
48- {Name: "tranche_target_device", Signature: "a", Types: []*server.Interface{nil}},
49- {Name: "tranche_formats", Signature: "a", Types: []*server.Interface{nil}},
50- {Name: "tranche_flags", Signature: "u", Types: []*server.Interface{nil}},
51- }
52- if err := server.NewInterfaces(ZwpLinuxDmabufV1Interface, ZwpLinuxBufferParamsV1Interface, ZwpLinuxDmabufFeedbackV1Interface); err != nil {
53- panic(err)
54- }
55-}
56-
57-// ZwpLinuxDmabufV1 factory for creating dmabuf-based wl_buffers.
58-type ZwpLinuxDmabufV1 struct{ *server.Resource }
59-
60-func WrapZwpLinuxDmabufV1(r *server.Resource) *ZwpLinuxDmabufV1 {
61- if r == nil {
62- return nil
63- }
64- return &ZwpLinuxDmabufV1{r}
65-}
66-
67-const ZwpLinuxDmabufV1RequestDestroy uint32 = 0
68-const ZwpLinuxDmabufV1RequestCreateParams uint32 = 1
69-const ZwpLinuxDmabufV1RequestGetDefaultFeedback uint32 = 2
70-const ZwpLinuxDmabufV1RequestGetSurfaceFeedback uint32 = 3
71-const ZwpLinuxDmabufV1EventFormat uint32 = 0
72-const ZwpLinuxDmabufV1EventModifier uint32 = 1
73-
74-// ZwpLinuxDmabufV1Handler handles zwp_linux_dmabuf_v1 requests.
75-type ZwpLinuxDmabufV1Handler interface {
76- Destroy(self *ZwpLinuxDmabufV1)
77- CreateParams(self *ZwpLinuxDmabufV1, paramsId uint32)
78- GetDefaultFeedback(self *ZwpLinuxDmabufV1, id uint32)
79- GetSurfaceFeedback(self *ZwpLinuxDmabufV1, id uint32, surface *wayland.Surface)
80-}
81-
82-func NewZwpLinuxDmabufV1(c server.Client, version int32, id uint32, h ZwpLinuxDmabufV1Handler) (*ZwpLinuxDmabufV1, error) {
83- if h == nil {
84- return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_linux_dmabuf_v1")
85- }
86- var self *ZwpLinuxDmabufV1
87- r, err := c.CreateResource(ZwpLinuxDmabufV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
88- switch opcode {
89- case 0:
90- h.Destroy(self)
91- self.Destroy()
92- case 1:
93- h.CreateParams(self, args[0].NewID())
94- case 2:
95- h.GetDefaultFeedback(self, args[0].NewID())
96- case 3:
97- h.GetSurfaceFeedback(self, args[0].NewID(), wayland.WrapSurface(args[1].Resource()))
98- }
99- })
100- if err != nil {
101- return nil, err
102- }
103- self = WrapZwpLinuxDmabufV1(r)
104- r.Data = self
105- return self, nil
106-}
107-
108-// SendFormat supported buffer format.
109-func (self *ZwpLinuxDmabufV1) SendFormat(format uint32) {
110- self.PostEvent(ZwpLinuxDmabufV1EventFormat, server.Uint(format))
111-}
112-
113-// SendModifier supported buffer format modifier (since version 3).
114-func (self *ZwpLinuxDmabufV1) SendModifier(format uint32, modifierHi uint32, modifierLo uint32) {
115- self.PostEvent(ZwpLinuxDmabufV1EventModifier, server.Uint(format), server.Uint(modifierHi), server.Uint(modifierLo))
116-}
117-func NewZwpLinuxDmabufV1Global(d *server.Display, version int32, bind server.BindFunc) error {
118- return d.CreateGlobal(ZwpLinuxDmabufV1Interface, version, bind)
119-}
120-
121-// ZwpLinuxBufferParamsV1 parameters for creating a dmabuf-based wl_buffer.
122-type ZwpLinuxBufferParamsV1 struct{ *server.Resource }
123-
124-func WrapZwpLinuxBufferParamsV1(r *server.Resource) *ZwpLinuxBufferParamsV1 {
125- if r == nil {
126- return nil
127- }
128- return &ZwpLinuxBufferParamsV1{r}
129-}
130-
131-const ZwpLinuxBufferParamsV1RequestDestroy uint32 = 0
132-const ZwpLinuxBufferParamsV1RequestAdd uint32 = 1
133-const ZwpLinuxBufferParamsV1RequestCreate uint32 = 2
134-const ZwpLinuxBufferParamsV1RequestCreateImmed uint32 = 3
135-const ZwpLinuxBufferParamsV1RequestSetSamplingDevice uint32 = 4
136-const ZwpLinuxBufferParamsV1EventCreated uint32 = 0
137-const ZwpLinuxBufferParamsV1EventFailed uint32 = 1
138-
139-// ZwpLinuxBufferParamsV1Error .
140-type ZwpLinuxBufferParamsV1Error uint32
141-
142-const (
143- ZwpLinuxBufferParamsV1ErrorAlreadyUsed ZwpLinuxBufferParamsV1Error = 0
144- ZwpLinuxBufferParamsV1ErrorPlaneIdx ZwpLinuxBufferParamsV1Error = 1
145- ZwpLinuxBufferParamsV1ErrorPlaneSet ZwpLinuxBufferParamsV1Error = 2
146- ZwpLinuxBufferParamsV1ErrorIncomplete ZwpLinuxBufferParamsV1Error = 3
147- ZwpLinuxBufferParamsV1ErrorInvalidFormat ZwpLinuxBufferParamsV1Error = 4
148- ZwpLinuxBufferParamsV1ErrorInvalidDimensions ZwpLinuxBufferParamsV1Error = 5
149- ZwpLinuxBufferParamsV1ErrorOutOfBounds ZwpLinuxBufferParamsV1Error = 6
150- ZwpLinuxBufferParamsV1ErrorInvalidWlBuffer ZwpLinuxBufferParamsV1Error = 7
151- ZwpLinuxBufferParamsV1ErrorInvalidDevTSize ZwpLinuxBufferParamsV1Error = 8
152-)
153-
154-// ZwpLinuxBufferParamsV1Flags (bitfield).
155-type ZwpLinuxBufferParamsV1Flags uint32
156-
157-const (
158- ZwpLinuxBufferParamsV1FlagsYInvert ZwpLinuxBufferParamsV1Flags = 1
159- ZwpLinuxBufferParamsV1FlagsInterlaced ZwpLinuxBufferParamsV1Flags = 2
160- ZwpLinuxBufferParamsV1FlagsBottomFirst ZwpLinuxBufferParamsV1Flags = 4
161-)
162-
163-// ZwpLinuxBufferParamsV1Handler handles zwp_linux_buffer_params_v1 requests.
164-type ZwpLinuxBufferParamsV1Handler interface {
165- Destroy(self *ZwpLinuxBufferParamsV1)
166- Add(self *ZwpLinuxBufferParamsV1, fd int, planeIdx uint32, offset uint32, stride uint32, modifierHi uint32, modifierLo uint32)
167- Create(self *ZwpLinuxBufferParamsV1, width int32, height int32, format uint32, flags uint32)
168- CreateImmed(self *ZwpLinuxBufferParamsV1, bufferId uint32, width int32, height int32, format uint32, flags uint32)
169- SetSamplingDevice(self *ZwpLinuxBufferParamsV1, device []byte)
170-}
171-
172-func NewZwpLinuxBufferParamsV1(c server.Client, version int32, id uint32, h ZwpLinuxBufferParamsV1Handler) (*ZwpLinuxBufferParamsV1, error) {
173- if h == nil {
174- return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_linux_buffer_params_v1")
175- }
176- var self *ZwpLinuxBufferParamsV1
177- r, err := c.CreateResource(ZwpLinuxBufferParamsV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
178- switch opcode {
179- case 0:
180- h.Destroy(self)
181- self.Destroy()
182- case 1:
183- h.Add(self, args[0].Fd(), args[1].Uint(), args[2].Uint(), args[3].Uint(), args[4].Uint(), args[5].Uint())
184- case 2:
185- h.Create(self, args[0].Int(), args[1].Int(), args[2].Uint(), args[3].Uint())
186- case 3:
187- h.CreateImmed(self, args[0].NewID(), args[1].Int(), args[2].Int(), args[3].Uint(), args[4].Uint())
188- case 4:
189- h.SetSamplingDevice(self, args[0].Array())
190- }
191- })
192- if err != nil {
193- return nil, err
194- }
195- self = WrapZwpLinuxBufferParamsV1(r)
196- r.Data = self
197- return self, nil
198-}
199-
200-// SendCreated buffer creation succeeded.
201-func (self *ZwpLinuxBufferParamsV1) SendCreated(buffer *wayland.Buffer) {
202- self.PostEvent(ZwpLinuxBufferParamsV1EventCreated, server.NewID(resourceOf(buffer)))
203-}
204-
205-// SendFailed buffer creation failed.
206-func (self *ZwpLinuxBufferParamsV1) SendFailed() {
207- self.PostEvent(ZwpLinuxBufferParamsV1EventFailed)
208-}
209-func NewZwpLinuxBufferParamsV1Global(d *server.Display, version int32, bind server.BindFunc) error {
210- return d.CreateGlobal(ZwpLinuxBufferParamsV1Interface, version, bind)
211-}
212-
213-// ZwpLinuxDmabufFeedbackV1 dmabuf feedback.
214-type ZwpLinuxDmabufFeedbackV1 struct{ *server.Resource }
215-
216-func WrapZwpLinuxDmabufFeedbackV1(r *server.Resource) *ZwpLinuxDmabufFeedbackV1 {
217- if r == nil {
218- return nil
219- }
220- return &ZwpLinuxDmabufFeedbackV1{r}
221-}
222-
223-const ZwpLinuxDmabufFeedbackV1RequestDestroy uint32 = 0
224-const ZwpLinuxDmabufFeedbackV1EventDone uint32 = 0
225-const ZwpLinuxDmabufFeedbackV1EventFormatTable uint32 = 1
226-const ZwpLinuxDmabufFeedbackV1EventMainDevice uint32 = 2
227-const ZwpLinuxDmabufFeedbackV1EventTrancheDone uint32 = 3
228-const ZwpLinuxDmabufFeedbackV1EventTrancheTargetDevice uint32 = 4
229-const ZwpLinuxDmabufFeedbackV1EventTrancheFormats uint32 = 5
230-const ZwpLinuxDmabufFeedbackV1EventTrancheFlags uint32 = 6
231-
232-// ZwpLinuxDmabufFeedbackV1TrancheFlags (bitfield).
233-type ZwpLinuxDmabufFeedbackV1TrancheFlags uint32
234-
235-const (
236- ZwpLinuxDmabufFeedbackV1TrancheFlagsScanout ZwpLinuxDmabufFeedbackV1TrancheFlags = 1
237- ZwpLinuxDmabufFeedbackV1TrancheFlagsSampling ZwpLinuxDmabufFeedbackV1TrancheFlags = 2
238-)
239-
240-// ZwpLinuxDmabufFeedbackV1Handler handles zwp_linux_dmabuf_feedback_v1 requests.
241-type ZwpLinuxDmabufFeedbackV1Handler interface {
242- Destroy(self *ZwpLinuxDmabufFeedbackV1)
243-}
244-
245-func NewZwpLinuxDmabufFeedbackV1(c server.Client, version int32, id uint32, h ZwpLinuxDmabufFeedbackV1Handler) (*ZwpLinuxDmabufFeedbackV1, error) {
246- if h == nil {
247- return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_linux_dmabuf_feedback_v1")
248- }
249- var self *ZwpLinuxDmabufFeedbackV1
250- r, err := c.CreateResource(ZwpLinuxDmabufFeedbackV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
251- switch opcode {
252- case 0:
253- h.Destroy(self)
254- self.Destroy()
255- }
256- })
257- if err != nil {
258- return nil, err
259- }
260- self = WrapZwpLinuxDmabufFeedbackV1(r)
261- r.Data = self
262- return self, nil
263-}
264-
265-// SendDone all feedback has been sent.
266-func (self *ZwpLinuxDmabufFeedbackV1) SendDone() {
267- self.PostEvent(ZwpLinuxDmabufFeedbackV1EventDone)
268-}
269-
270-// SendFormatTable format and modifier table.
271-func (self *ZwpLinuxDmabufFeedbackV1) SendFormatTable(fd int, size uint32) {
272- self.PostEvent(ZwpLinuxDmabufFeedbackV1EventFormatTable, server.Fd(fd), server.Uint(size))
273-}
274-
275-// SendMainDevice preferred main device.
276-func (self *ZwpLinuxDmabufFeedbackV1) SendMainDevice(device []byte) {
277- var p runtime.Pinner
278- defer p.Unpin()
279- self.PostEvent(ZwpLinuxDmabufFeedbackV1EventMainDevice, server.Array(&p, device))
280-}
281-
282-// SendTrancheDone a preference tranche has been sent.
283-func (self *ZwpLinuxDmabufFeedbackV1) SendTrancheDone() {
284- self.PostEvent(ZwpLinuxDmabufFeedbackV1EventTrancheDone)
285-}
286-
287-// SendTrancheTargetDevice target device.
288-func (self *ZwpLinuxDmabufFeedbackV1) SendTrancheTargetDevice(device []byte) {
289- var p runtime.Pinner
290- defer p.Unpin()
291- self.PostEvent(ZwpLinuxDmabufFeedbackV1EventTrancheTargetDevice, server.Array(&p, device))
292-}
293-
294-// SendTrancheFormats supported buffer format modifiers.
295-func (self *ZwpLinuxDmabufFeedbackV1) SendTrancheFormats(indices []byte) {
296- var p runtime.Pinner
297- defer p.Unpin()
298- self.PostEvent(ZwpLinuxDmabufFeedbackV1EventTrancheFormats, server.Array(&p, indices))
299-}
300-
301-// SendTrancheFlags tranche flags.
302-func (self *ZwpLinuxDmabufFeedbackV1) SendTrancheFlags(flags uint32) {
303- self.PostEvent(ZwpLinuxDmabufFeedbackV1EventTrancheFlags, server.Uint(flags))
304-}
305-func NewZwpLinuxDmabufFeedbackV1Global(d *server.Display, version int32, bind server.BindFunc) error {
306- return d.CreateGlobal(ZwpLinuxDmabufFeedbackV1Interface, version, bind)
307-}
308-func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
309- if v == nil {
310- return nil
311- }
312- return v.GetResource()
313-}
314-func (self *ZwpLinuxDmabufV1) GetResource() *server.Resource {
315- if self == nil {
316- return nil
317- }
318- return self.Resource
319-}
320-func (self *ZwpLinuxBufferParamsV1) GetResource() *server.Resource {
321- if self == nil {
322- return nil
323- }
324- return self.Resource
325-}
326-func (self *ZwpLinuxDmabufFeedbackV1) GetResource() *server.Resource {
327- if self == nil {
328- return nil
329- }
330- return self.Resource
331-}
D protocol/linuxdrmsyncobj/linuxdrmsyncobj.go +0 -217
@@ -1,217 +0,0 @@
1-// Code generated by wlgen; DO NOT EDIT.
2-package linuxdrmsyncobj
3-
4-import (
5- "fmt"
6- wayland "github.com/bnema/purego-libwayland/protocol/wayland"
7- "github.com/bnema/purego-libwayland/server"
8-)
9-
10-var WpLinuxDrmSyncobjManagerV1Interface *server.Interface
11-var WpLinuxDrmSyncobjTimelineV1Interface *server.Interface
12-var WpLinuxDrmSyncobjSurfaceV1Interface *server.Interface
13-
14-func init() {
15- WpLinuxDrmSyncobjManagerV1Interface = &server.Interface{Name: "wp_linux_drm_syncobj_manager_v1", Version: 1}
16- WpLinuxDrmSyncobjTimelineV1Interface = &server.Interface{Name: "wp_linux_drm_syncobj_timeline_v1", Version: 1}
17- WpLinuxDrmSyncobjSurfaceV1Interface = &server.Interface{Name: "wp_linux_drm_syncobj_surface_v1", Version: 1}
18- WpLinuxDrmSyncobjManagerV1Interface.Requests = []server.Message{
19- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
20- {Name: "get_surface", Signature: "no", Types: []*server.Interface{WpLinuxDrmSyncobjSurfaceV1Interface, wayland.SurfaceInterface}},
21- {Name: "import_timeline", Signature: "nh", Types: []*server.Interface{WpLinuxDrmSyncobjTimelineV1Interface, nil}},
22- }
23- WpLinuxDrmSyncobjManagerV1Interface.Events = []server.Message{}
24- WpLinuxDrmSyncobjTimelineV1Interface.Requests = []server.Message{
25- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
26- }
27- WpLinuxDrmSyncobjTimelineV1Interface.Events = []server.Message{}
28- WpLinuxDrmSyncobjSurfaceV1Interface.Requests = []server.Message{
29- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
30- {Name: "set_acquire_point", Signature: "ouu", Types: []*server.Interface{WpLinuxDrmSyncobjTimelineV1Interface, nil, nil}},
31- {Name: "set_release_point", Signature: "ouu", Types: []*server.Interface{WpLinuxDrmSyncobjTimelineV1Interface, nil, nil}},
32- }
33- WpLinuxDrmSyncobjSurfaceV1Interface.Events = []server.Message{}
34- if err := server.NewInterfaces(WpLinuxDrmSyncobjManagerV1Interface, WpLinuxDrmSyncobjTimelineV1Interface, WpLinuxDrmSyncobjSurfaceV1Interface); err != nil {
35- panic(err)
36- }
37-}
38-
39-// WpLinuxDrmSyncobjManagerV1 global for providing explicit synchronization.
40-type WpLinuxDrmSyncobjManagerV1 struct{ *server.Resource }
41-
42-func WrapWpLinuxDrmSyncobjManagerV1(r *server.Resource) *WpLinuxDrmSyncobjManagerV1 {
43- if r == nil {
44- return nil
45- }
46- return &WpLinuxDrmSyncobjManagerV1{r}
47-}
48-
49-const WpLinuxDrmSyncobjManagerV1RequestDestroy uint32 = 0
50-const WpLinuxDrmSyncobjManagerV1RequestGetSurface uint32 = 1
51-const WpLinuxDrmSyncobjManagerV1RequestImportTimeline uint32 = 2
52-
53-// WpLinuxDrmSyncobjManagerV1Error .
54-type WpLinuxDrmSyncobjManagerV1Error uint32
55-
56-const (
57- WpLinuxDrmSyncobjManagerV1ErrorSurfaceExists WpLinuxDrmSyncobjManagerV1Error = 0
58- WpLinuxDrmSyncobjManagerV1ErrorInvalidTimeline WpLinuxDrmSyncobjManagerV1Error = 1
59-)
60-
61-// WpLinuxDrmSyncobjManagerV1Handler handles wp_linux_drm_syncobj_manager_v1 requests.
62-type WpLinuxDrmSyncobjManagerV1Handler interface {
63- Destroy(self *WpLinuxDrmSyncobjManagerV1)
64- GetSurface(self *WpLinuxDrmSyncobjManagerV1, id uint32, surface *wayland.Surface)
65- ImportTimeline(self *WpLinuxDrmSyncobjManagerV1, id uint32, fd int)
66-}
67-
68-func NewWpLinuxDrmSyncobjManagerV1(c server.Client, version int32, id uint32, h WpLinuxDrmSyncobjManagerV1Handler) (*WpLinuxDrmSyncobjManagerV1, error) {
69- if h == nil {
70- return nil, fmt.Errorf("purego-libwayland: nil handler for wp_linux_drm_syncobj_manager_v1")
71- }
72- var self *WpLinuxDrmSyncobjManagerV1
73- r, err := c.CreateResource(WpLinuxDrmSyncobjManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
74- switch opcode {
75- case 0:
76- h.Destroy(self)
77- self.Destroy()
78- case 1:
79- h.GetSurface(self, args[0].NewID(), wayland.WrapSurface(args[1].Resource()))
80- case 2:
81- h.ImportTimeline(self, args[0].NewID(), args[1].Fd())
82- }
83- })
84- if err != nil {
85- return nil, err
86- }
87- self = WrapWpLinuxDrmSyncobjManagerV1(r)
88- r.Data = self
89- return self, nil
90-}
91-func NewWpLinuxDrmSyncobjManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
92- return d.CreateGlobal(WpLinuxDrmSyncobjManagerV1Interface, version, bind)
93-}
94-
95-// WpLinuxDrmSyncobjTimelineV1 synchronization object timeline.
96-type WpLinuxDrmSyncobjTimelineV1 struct{ *server.Resource }
97-
98-func WrapWpLinuxDrmSyncobjTimelineV1(r *server.Resource) *WpLinuxDrmSyncobjTimelineV1 {
99- if r == nil {
100- return nil
101- }
102- return &WpLinuxDrmSyncobjTimelineV1{r}
103-}
104-
105-const WpLinuxDrmSyncobjTimelineV1RequestDestroy uint32 = 0
106-
107-// WpLinuxDrmSyncobjTimelineV1Handler handles wp_linux_drm_syncobj_timeline_v1 requests.
108-type WpLinuxDrmSyncobjTimelineV1Handler interface {
109- Destroy(self *WpLinuxDrmSyncobjTimelineV1)
110-}
111-
112-func NewWpLinuxDrmSyncobjTimelineV1(c server.Client, version int32, id uint32, h WpLinuxDrmSyncobjTimelineV1Handler) (*WpLinuxDrmSyncobjTimelineV1, error) {
113- if h == nil {
114- return nil, fmt.Errorf("purego-libwayland: nil handler for wp_linux_drm_syncobj_timeline_v1")
115- }
116- var self *WpLinuxDrmSyncobjTimelineV1
117- r, err := c.CreateResource(WpLinuxDrmSyncobjTimelineV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
118- switch opcode {
119- case 0:
120- h.Destroy(self)
121- self.Destroy()
122- }
123- })
124- if err != nil {
125- return nil, err
126- }
127- self = WrapWpLinuxDrmSyncobjTimelineV1(r)
128- r.Data = self
129- return self, nil
130-}
131-func NewWpLinuxDrmSyncobjTimelineV1Global(d *server.Display, version int32, bind server.BindFunc) error {
132- return d.CreateGlobal(WpLinuxDrmSyncobjTimelineV1Interface, version, bind)
133-}
134-
135-// WpLinuxDrmSyncobjSurfaceV1 per-surface explicit synchronization.
136-type WpLinuxDrmSyncobjSurfaceV1 struct{ *server.Resource }
137-
138-func WrapWpLinuxDrmSyncobjSurfaceV1(r *server.Resource) *WpLinuxDrmSyncobjSurfaceV1 {
139- if r == nil {
140- return nil
141- }
142- return &WpLinuxDrmSyncobjSurfaceV1{r}
143-}
144-
145-const WpLinuxDrmSyncobjSurfaceV1RequestDestroy uint32 = 0
146-const WpLinuxDrmSyncobjSurfaceV1RequestSetAcquirePoint uint32 = 1
147-const WpLinuxDrmSyncobjSurfaceV1RequestSetReleasePoint uint32 = 2
148-
149-// WpLinuxDrmSyncobjSurfaceV1Error .
150-type WpLinuxDrmSyncobjSurfaceV1Error uint32
151-
152-const (
153- WpLinuxDrmSyncobjSurfaceV1ErrorNoSurface WpLinuxDrmSyncobjSurfaceV1Error = 1
154- WpLinuxDrmSyncobjSurfaceV1ErrorUnsupportedBuffer WpLinuxDrmSyncobjSurfaceV1Error = 2
155- WpLinuxDrmSyncobjSurfaceV1ErrorNoBuffer WpLinuxDrmSyncobjSurfaceV1Error = 3
156- WpLinuxDrmSyncobjSurfaceV1ErrorNoAcquirePoint WpLinuxDrmSyncobjSurfaceV1Error = 4
157- WpLinuxDrmSyncobjSurfaceV1ErrorNoReleasePoint WpLinuxDrmSyncobjSurfaceV1Error = 5
158- WpLinuxDrmSyncobjSurfaceV1ErrorConflictingPoints WpLinuxDrmSyncobjSurfaceV1Error = 6
159-)
160-
161-// WpLinuxDrmSyncobjSurfaceV1Handler handles wp_linux_drm_syncobj_surface_v1 requests.
162-type WpLinuxDrmSyncobjSurfaceV1Handler interface {
163- Destroy(self *WpLinuxDrmSyncobjSurfaceV1)
164- SetAcquirePoint(self *WpLinuxDrmSyncobjSurfaceV1, timeline *WpLinuxDrmSyncobjTimelineV1, pointHi uint32, pointLo uint32)
165- SetReleasePoint(self *WpLinuxDrmSyncobjSurfaceV1, timeline *WpLinuxDrmSyncobjTimelineV1, pointHi uint32, pointLo uint32)
166-}
167-
168-func NewWpLinuxDrmSyncobjSurfaceV1(c server.Client, version int32, id uint32, h WpLinuxDrmSyncobjSurfaceV1Handler) (*WpLinuxDrmSyncobjSurfaceV1, error) {
169- if h == nil {
170- return nil, fmt.Errorf("purego-libwayland: nil handler for wp_linux_drm_syncobj_surface_v1")
171- }
172- var self *WpLinuxDrmSyncobjSurfaceV1
173- r, err := c.CreateResource(WpLinuxDrmSyncobjSurfaceV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
174- switch opcode {
175- case 0:
176- h.Destroy(self)
177- self.Destroy()
178- case 1:
179- h.SetAcquirePoint(self, WrapWpLinuxDrmSyncobjTimelineV1(args[0].Resource()), args[1].Uint(), args[2].Uint())
180- case 2:
181- h.SetReleasePoint(self, WrapWpLinuxDrmSyncobjTimelineV1(args[0].Resource()), args[1].Uint(), args[2].Uint())
182- }
183- })
184- if err != nil {
185- return nil, err
186- }
187- self = WrapWpLinuxDrmSyncobjSurfaceV1(r)
188- r.Data = self
189- return self, nil
190-}
191-func NewWpLinuxDrmSyncobjSurfaceV1Global(d *server.Display, version int32, bind server.BindFunc) error {
192- return d.CreateGlobal(WpLinuxDrmSyncobjSurfaceV1Interface, version, bind)
193-}
194-func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
195- if v == nil {
196- return nil
197- }
198- return v.GetResource()
199-}
200-func (self *WpLinuxDrmSyncobjManagerV1) GetResource() *server.Resource {
201- if self == nil {
202- return nil
203- }
204- return self.Resource
205-}
206-func (self *WpLinuxDrmSyncobjTimelineV1) GetResource() *server.Resource {
207- if self == nil {
208- return nil
209- }
210- return self.Resource
211-}
212-func (self *WpLinuxDrmSyncobjSurfaceV1) GetResource() *server.Resource {
213- if self == nil {
214- return nil
215- }
216- return self.Resource
217-}
D protocol/pointerconstraints/pointerconstraints.go +0 -247
@@ -1,247 +0,0 @@
1-// Code generated by wlgen; DO NOT EDIT.
2-package pointerconstraints
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 ZwpPointerConstraintsV1Interface *server.Interface
11-var ZwpLockedPointerV1Interface *server.Interface
12-var ZwpConfinedPointerV1Interface *server.Interface
13-
14-func init() {
15- ZwpPointerConstraintsV1Interface = &server.Interface{Name: "zwp_pointer_constraints_v1", Version: 1}
16- ZwpLockedPointerV1Interface = &server.Interface{Name: "zwp_locked_pointer_v1", Version: 1}
17- ZwpConfinedPointerV1Interface = &server.Interface{Name: "zwp_confined_pointer_v1", Version: 1}
18- ZwpPointerConstraintsV1Interface.Requests = []server.Message{
19- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
20- {Name: "lock_pointer", Signature: "noo?ou", Types: []*server.Interface{ZwpLockedPointerV1Interface, wayland.SurfaceInterface, wayland.PointerInterface, wayland.RegionInterface, nil}},
21- {Name: "confine_pointer", Signature: "noo?ou", Types: []*server.Interface{ZwpConfinedPointerV1Interface, wayland.SurfaceInterface, wayland.PointerInterface, wayland.RegionInterface, nil}},
22- }
23- ZwpPointerConstraintsV1Interface.Events = []server.Message{}
24- ZwpLockedPointerV1Interface.Requests = []server.Message{
25- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
26- {Name: "set_cursor_position_hint", Signature: "ff", Types: []*server.Interface{nil, nil}},
27- {Name: "set_region", Signature: "?o", Types: []*server.Interface{wayland.RegionInterface}},
28- }
29- ZwpLockedPointerV1Interface.Events = []server.Message{
30- {Name: "locked", Signature: "", Types: []*server.Interface{}},
31- {Name: "unlocked", Signature: "", Types: []*server.Interface{}},
32- }
33- ZwpConfinedPointerV1Interface.Requests = []server.Message{
34- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
35- {Name: "set_region", Signature: "?o", Types: []*server.Interface{wayland.RegionInterface}},
36- }
37- ZwpConfinedPointerV1Interface.Events = []server.Message{
38- {Name: "confined", Signature: "", Types: []*server.Interface{}},
39- {Name: "unconfined", Signature: "", Types: []*server.Interface{}},
40- }
41- if err := server.NewInterfaces(ZwpPointerConstraintsV1Interface, ZwpLockedPointerV1Interface, ZwpConfinedPointerV1Interface); err != nil {
42- panic(err)
43- }
44-}
45-
46-// ZwpPointerConstraintsV1 constrain the movement of a pointer.
47-type ZwpPointerConstraintsV1 struct{ *server.Resource }
48-
49-func WrapZwpPointerConstraintsV1(r *server.Resource) *ZwpPointerConstraintsV1 {
50- if r == nil {
51- return nil
52- }
53- return &ZwpPointerConstraintsV1{r}
54-}
55-
56-const ZwpPointerConstraintsV1RequestDestroy uint32 = 0
57-const ZwpPointerConstraintsV1RequestLockPointer uint32 = 1
58-const ZwpPointerConstraintsV1RequestConfinePointer uint32 = 2
59-
60-// ZwpPointerConstraintsV1Error wp_pointer_constraints error values.
61-type ZwpPointerConstraintsV1Error uint32
62-
63-const (
64- ZwpPointerConstraintsV1ErrorAlreadyConstrained ZwpPointerConstraintsV1Error = 1
65-)
66-
67-// ZwpPointerConstraintsV1Lifetime constraint lifetime.
68-type ZwpPointerConstraintsV1Lifetime uint32
69-
70-const (
71- ZwpPointerConstraintsV1LifetimeOneshot ZwpPointerConstraintsV1Lifetime = 1
72- ZwpPointerConstraintsV1LifetimePersistent ZwpPointerConstraintsV1Lifetime = 2
73-)
74-
75-// ZwpPointerConstraintsV1Handler handles zwp_pointer_constraints_v1 requests.
76-type ZwpPointerConstraintsV1Handler interface {
77- Destroy(self *ZwpPointerConstraintsV1)
78- LockPointer(self *ZwpPointerConstraintsV1, id uint32, surface *wayland.Surface, pointer *wayland.Pointer, region *wayland.Region, lifetime uint32)
79- ConfinePointer(self *ZwpPointerConstraintsV1, id uint32, surface *wayland.Surface, pointer *wayland.Pointer, region *wayland.Region, lifetime uint32)
80-}
81-
82-func NewZwpPointerConstraintsV1(c server.Client, version int32, id uint32, h ZwpPointerConstraintsV1Handler) (*ZwpPointerConstraintsV1, error) {
83- if h == nil {
84- return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_pointer_constraints_v1")
85- }
86- var self *ZwpPointerConstraintsV1
87- r, err := c.CreateResource(ZwpPointerConstraintsV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
88- switch opcode {
89- case 0:
90- h.Destroy(self)
91- self.Destroy()
92- case 1:
93- h.LockPointer(self, args[0].NewID(), wayland.WrapSurface(args[1].Resource()), wayland.WrapPointer(args[2].Resource()), wayland.WrapRegion(args[3].Resource()), args[4].Uint())
94- case 2:
95- h.ConfinePointer(self, args[0].NewID(), wayland.WrapSurface(args[1].Resource()), wayland.WrapPointer(args[2].Resource()), wayland.WrapRegion(args[3].Resource()), args[4].Uint())
96- }
97- })
98- if err != nil {
99- return nil, err
100- }
101- self = WrapZwpPointerConstraintsV1(r)
102- r.Data = self
103- return self, nil
104-}
105-func NewZwpPointerConstraintsV1Global(d *server.Display, version int32, bind server.BindFunc) error {
106- return d.CreateGlobal(ZwpPointerConstraintsV1Interface, version, bind)
107-}
108-
109-// ZwpLockedPointerV1 receive relative pointer motion events.
110-type ZwpLockedPointerV1 struct{ *server.Resource }
111-
112-func WrapZwpLockedPointerV1(r *server.Resource) *ZwpLockedPointerV1 {
113- if r == nil {
114- return nil
115- }
116- return &ZwpLockedPointerV1{r}
117-}
118-
119-const ZwpLockedPointerV1RequestDestroy uint32 = 0
120-const ZwpLockedPointerV1RequestSetCursorPositionHint uint32 = 1
121-const ZwpLockedPointerV1RequestSetRegion uint32 = 2
122-const ZwpLockedPointerV1EventLocked uint32 = 0
123-const ZwpLockedPointerV1EventUnlocked uint32 = 1
124-
125-// ZwpLockedPointerV1Handler handles zwp_locked_pointer_v1 requests.
126-type ZwpLockedPointerV1Handler interface {
127- Destroy(self *ZwpLockedPointerV1)
128- SetCursorPositionHint(self *ZwpLockedPointerV1, surfaceX server.Fixed, surfaceY server.Fixed)
129- SetRegion(self *ZwpLockedPointerV1, region *wayland.Region)
130-}
131-
132-func NewZwpLockedPointerV1(c server.Client, version int32, id uint32, h ZwpLockedPointerV1Handler) (*ZwpLockedPointerV1, error) {
133- if h == nil {
134- return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_locked_pointer_v1")
135- }
136- var self *ZwpLockedPointerV1
137- r, err := c.CreateResource(ZwpLockedPointerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
138- switch opcode {
139- case 0:
140- h.Destroy(self)
141- self.Destroy()
142- case 1:
143- h.SetCursorPositionHint(self, args[0].Fixed(), args[1].Fixed())
144- case 2:
145- h.SetRegion(self, wayland.WrapRegion(args[0].Resource()))
146- }
147- })
148- if err != nil {
149- return nil, err
150- }
151- self = WrapZwpLockedPointerV1(r)
152- r.Data = self
153- return self, nil
154-}
155-
156-// SendLocked lock activation event.
157-func (self *ZwpLockedPointerV1) SendLocked() {
158- self.PostEvent(ZwpLockedPointerV1EventLocked)
159-}
160-
161-// SendUnlocked lock deactivation event.
162-func (self *ZwpLockedPointerV1) SendUnlocked() {
163- self.PostEvent(ZwpLockedPointerV1EventUnlocked)
164-}
165-func NewZwpLockedPointerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
166- return d.CreateGlobal(ZwpLockedPointerV1Interface, version, bind)
167-}
168-
169-// ZwpConfinedPointerV1 confined pointer object.
170-type ZwpConfinedPointerV1 struct{ *server.Resource }
171-
172-func WrapZwpConfinedPointerV1(r *server.Resource) *ZwpConfinedPointerV1 {
173- if r == nil {
174- return nil
175- }
176- return &ZwpConfinedPointerV1{r}
177-}
178-
179-const ZwpConfinedPointerV1RequestDestroy uint32 = 0
180-const ZwpConfinedPointerV1RequestSetRegion uint32 = 1
181-const ZwpConfinedPointerV1EventConfined uint32 = 0
182-const ZwpConfinedPointerV1EventUnconfined uint32 = 1
183-
184-// ZwpConfinedPointerV1Handler handles zwp_confined_pointer_v1 requests.
185-type ZwpConfinedPointerV1Handler interface {
186- Destroy(self *ZwpConfinedPointerV1)
187- SetRegion(self *ZwpConfinedPointerV1, region *wayland.Region)
188-}
189-
190-func NewZwpConfinedPointerV1(c server.Client, version int32, id uint32, h ZwpConfinedPointerV1Handler) (*ZwpConfinedPointerV1, error) {
191- if h == nil {
192- return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_confined_pointer_v1")
193- }
194- var self *ZwpConfinedPointerV1
195- r, err := c.CreateResource(ZwpConfinedPointerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
196- switch opcode {
197- case 0:
198- h.Destroy(self)
199- self.Destroy()
200- case 1:
201- h.SetRegion(self, wayland.WrapRegion(args[0].Resource()))
202- }
203- })
204- if err != nil {
205- return nil, err
206- }
207- self = WrapZwpConfinedPointerV1(r)
208- r.Data = self
209- return self, nil
210-}
211-
212-// SendConfined pointer confined.
213-func (self *ZwpConfinedPointerV1) SendConfined() {
214- self.PostEvent(ZwpConfinedPointerV1EventConfined)
215-}
216-
217-// SendUnconfined pointer unconfined.
218-func (self *ZwpConfinedPointerV1) SendUnconfined() {
219- self.PostEvent(ZwpConfinedPointerV1EventUnconfined)
220-}
221-func NewZwpConfinedPointerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
222- return d.CreateGlobal(ZwpConfinedPointerV1Interface, version, bind)
223-}
224-func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
225- if v == nil {
226- return nil
227- }
228- return v.GetResource()
229-}
230-func (self *ZwpPointerConstraintsV1) GetResource() *server.Resource {
231- if self == nil {
232- return nil
233- }
234- return self.Resource
235-}
236-func (self *ZwpLockedPointerV1) GetResource() *server.Resource {
237- if self == nil {
238- return nil
239- }
240- return self.Resource
241-}
242-func (self *ZwpConfinedPointerV1) GetResource() *server.Resource {
243- if self == nil {
244- return nil
245- }
246- return self.Resource
247-}
D protocol/pointergestures/pointergestures.go +0 -303
@@ -1,303 +0,0 @@
1-// Code generated by wlgen; DO NOT EDIT.
2-package pointergestures
3-
4-import (
5- "fmt"
6- wayland "github.com/bnema/purego-libwayland/protocol/wayland"
7- "github.com/bnema/purego-libwayland/server"
8-)
9-
10-var ZwpPointerGesturesV1Interface *server.Interface
11-var ZwpPointerGestureSwipeV1Interface *server.Interface
12-var ZwpPointerGesturePinchV1Interface *server.Interface
13-var ZwpPointerGestureHoldV1Interface *server.Interface
14-
15-func init() {
16- ZwpPointerGesturesV1Interface = &server.Interface{Name: "zwp_pointer_gestures_v1", Version: 3}
17- ZwpPointerGestureSwipeV1Interface = &server.Interface{Name: "zwp_pointer_gesture_swipe_v1", Version: 3}
18- ZwpPointerGesturePinchV1Interface = &server.Interface{Name: "zwp_pointer_gesture_pinch_v1", Version: 3}
19- ZwpPointerGestureHoldV1Interface = &server.Interface{Name: "zwp_pointer_gesture_hold_v1", Version: 3}
20- ZwpPointerGesturesV1Interface.Requests = []server.Message{
21- {Name: "get_swipe_gesture", Signature: "no", Types: []*server.Interface{ZwpPointerGestureSwipeV1Interface, wayland.PointerInterface}},
22- {Name: "get_pinch_gesture", Signature: "no", Types: []*server.Interface{ZwpPointerGesturePinchV1Interface, wayland.PointerInterface}},
23- {Name: "release", Signature: "2", Types: []*server.Interface{}},
24- {Name: "get_hold_gesture", Signature: "3no", Types: []*server.Interface{ZwpPointerGestureHoldV1Interface, wayland.PointerInterface}},
25- }
26- ZwpPointerGesturesV1Interface.Events = []server.Message{}
27- ZwpPointerGestureSwipeV1Interface.Requests = []server.Message{
28- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
29- }
30- ZwpPointerGestureSwipeV1Interface.Events = []server.Message{
31- {Name: "begin", Signature: "uuou", Types: []*server.Interface{nil, nil, wayland.SurfaceInterface, nil}},
32- {Name: "update", Signature: "uff", Types: []*server.Interface{nil, nil, nil}},
33- {Name: "end", Signature: "uui", Types: []*server.Interface{nil, nil, nil}},
34- }
35- ZwpPointerGesturePinchV1Interface.Requests = []server.Message{
36- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
37- }
38- ZwpPointerGesturePinchV1Interface.Events = []server.Message{
39- {Name: "begin", Signature: "uuou", Types: []*server.Interface{nil, nil, wayland.SurfaceInterface, nil}},
40- {Name: "update", Signature: "uffff", Types: []*server.Interface{nil, nil, nil, nil, nil}},
41- {Name: "end", Signature: "uui", Types: []*server.Interface{nil, nil, nil}},
42- }
43- ZwpPointerGestureHoldV1Interface.Requests = []server.Message{
44- {Name: "destroy", Signature: "3", Types: []*server.Interface{}},
45- }
46- ZwpPointerGestureHoldV1Interface.Events = []server.Message{
47- {Name: "begin", Signature: "3uuou", Types: []*server.Interface{nil, nil, wayland.SurfaceInterface, nil}},
48- {Name: "end", Signature: "3uui", Types: []*server.Interface{nil, nil, nil}},
49- }
50- if err := server.NewInterfaces(ZwpPointerGesturesV1Interface, ZwpPointerGestureSwipeV1Interface, ZwpPointerGesturePinchV1Interface, ZwpPointerGestureHoldV1Interface); err != nil {
51- panic(err)
52- }
53-}
54-
55-// ZwpPointerGesturesV1 touchpad gestures.
56-type ZwpPointerGesturesV1 struct{ *server.Resource }
57-
58-func WrapZwpPointerGesturesV1(r *server.Resource) *ZwpPointerGesturesV1 {
59- if r == nil {
60- return nil
61- }
62- return &ZwpPointerGesturesV1{r}
63-}
64-
65-const ZwpPointerGesturesV1RequestGetSwipeGesture uint32 = 0
66-const ZwpPointerGesturesV1RequestGetPinchGesture uint32 = 1
67-const ZwpPointerGesturesV1RequestRelease uint32 = 2
68-const ZwpPointerGesturesV1RequestGetHoldGesture uint32 = 3
69-
70-// ZwpPointerGesturesV1Handler handles zwp_pointer_gestures_v1 requests.
71-type ZwpPointerGesturesV1Handler interface {
72- GetSwipeGesture(self *ZwpPointerGesturesV1, id uint32, pointer *wayland.Pointer)
73- GetPinchGesture(self *ZwpPointerGesturesV1, id uint32, pointer *wayland.Pointer)
74- Release(self *ZwpPointerGesturesV1)
75- GetHoldGesture(self *ZwpPointerGesturesV1, id uint32, pointer *wayland.Pointer)
76-}
77-
78-func NewZwpPointerGesturesV1(c server.Client, version int32, id uint32, h ZwpPointerGesturesV1Handler) (*ZwpPointerGesturesV1, error) {
79- if h == nil {
80- return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_pointer_gestures_v1")
81- }
82- var self *ZwpPointerGesturesV1
83- r, err := c.CreateResource(ZwpPointerGesturesV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
84- switch opcode {
85- case 0:
86- h.GetSwipeGesture(self, args[0].NewID(), wayland.WrapPointer(args[1].Resource()))
87- case 1:
88- h.GetPinchGesture(self, args[0].NewID(), wayland.WrapPointer(args[1].Resource()))
89- case 2:
90- h.Release(self)
91- self.Destroy()
92- case 3:
93- h.GetHoldGesture(self, args[0].NewID(), wayland.WrapPointer(args[1].Resource()))
94- }
95- })
96- if err != nil {
97- return nil, err
98- }
99- self = WrapZwpPointerGesturesV1(r)
100- r.Data = self
101- return self, nil
102-}
103-func NewZwpPointerGesturesV1Global(d *server.Display, version int32, bind server.BindFunc) error {
104- return d.CreateGlobal(ZwpPointerGesturesV1Interface, version, bind)
105-}
106-
107-// ZwpPointerGestureSwipeV1 a swipe gesture object.
108-type ZwpPointerGestureSwipeV1 struct{ *server.Resource }
109-
110-func WrapZwpPointerGestureSwipeV1(r *server.Resource) *ZwpPointerGestureSwipeV1 {
111- if r == nil {
112- return nil
113- }
114- return &ZwpPointerGestureSwipeV1{r}
115-}
116-
117-const ZwpPointerGestureSwipeV1RequestDestroy uint32 = 0
118-const ZwpPointerGestureSwipeV1EventBegin uint32 = 0
119-const ZwpPointerGestureSwipeV1EventUpdate uint32 = 1
120-const ZwpPointerGestureSwipeV1EventEnd uint32 = 2
121-
122-// ZwpPointerGestureSwipeV1Handler handles zwp_pointer_gesture_swipe_v1 requests.
123-type ZwpPointerGestureSwipeV1Handler interface {
124- Destroy(self *ZwpPointerGestureSwipeV1)
125-}
126-
127-func NewZwpPointerGestureSwipeV1(c server.Client, version int32, id uint32, h ZwpPointerGestureSwipeV1Handler) (*ZwpPointerGestureSwipeV1, error) {
128- if h == nil {
129- return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_pointer_gesture_swipe_v1")
130- }
131- var self *ZwpPointerGestureSwipeV1
132- r, err := c.CreateResource(ZwpPointerGestureSwipeV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
133- switch opcode {
134- case 0:
135- h.Destroy(self)
136- self.Destroy()
137- }
138- })
139- if err != nil {
140- return nil, err
141- }
142- self = WrapZwpPointerGestureSwipeV1(r)
143- r.Data = self
144- return self, nil
145-}
146-
147-// SendBegin multi-finger swipe begin.
148-func (self *ZwpPointerGestureSwipeV1) SendBegin(serial uint32, time uint32, surface *wayland.Surface, fingers uint32) {
149- self.PostEvent(ZwpPointerGestureSwipeV1EventBegin, server.Uint(serial), server.Uint(time), server.Object(resourceOf(surface)), server.Uint(fingers))
150-}
151-
152-// SendUpdate multi-finger swipe motion.
153-func (self *ZwpPointerGestureSwipeV1) SendUpdate(time uint32, dx server.Fixed, dy server.Fixed) {
154- self.PostEvent(ZwpPointerGestureSwipeV1EventUpdate, server.Uint(time), server.FixedArg(dx), server.FixedArg(dy))
155-}
156-
157-// SendEnd multi-finger swipe end.
158-func (self *ZwpPointerGestureSwipeV1) SendEnd(serial uint32, time uint32, cancelled int32) {
159- self.PostEvent(ZwpPointerGestureSwipeV1EventEnd, server.Uint(serial), server.Uint(time), server.Int(cancelled))
160-}
161-func NewZwpPointerGestureSwipeV1Global(d *server.Display, version int32, bind server.BindFunc) error {
162- return d.CreateGlobal(ZwpPointerGestureSwipeV1Interface, version, bind)
163-}
164-
165-// ZwpPointerGesturePinchV1 a pinch gesture object.
166-type ZwpPointerGesturePinchV1 struct{ *server.Resource }
167-
168-func WrapZwpPointerGesturePinchV1(r *server.Resource) *ZwpPointerGesturePinchV1 {
169- if r == nil {
170- return nil
171- }
172- return &ZwpPointerGesturePinchV1{r}
173-}
174-
175-const ZwpPointerGesturePinchV1RequestDestroy uint32 = 0
176-const ZwpPointerGesturePinchV1EventBegin uint32 = 0
177-const ZwpPointerGesturePinchV1EventUpdate uint32 = 1
178-const ZwpPointerGesturePinchV1EventEnd uint32 = 2
179-
180-// ZwpPointerGesturePinchV1Handler handles zwp_pointer_gesture_pinch_v1 requests.
181-type ZwpPointerGesturePinchV1Handler interface {
182- Destroy(self *ZwpPointerGesturePinchV1)
183-}
184-
185-func NewZwpPointerGesturePinchV1(c server.Client, version int32, id uint32, h ZwpPointerGesturePinchV1Handler) (*ZwpPointerGesturePinchV1, error) {
186- if h == nil {
187- return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_pointer_gesture_pinch_v1")
188- }
189- var self *ZwpPointerGesturePinchV1
190- r, err := c.CreateResource(ZwpPointerGesturePinchV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
191- switch opcode {
192- case 0:
193- h.Destroy(self)
194- self.Destroy()
195- }
196- })
197- if err != nil {
198- return nil, err
199- }
200- self = WrapZwpPointerGesturePinchV1(r)
201- r.Data = self
202- return self, nil
203-}
204-
205-// SendBegin multi-finger pinch begin.
206-func (self *ZwpPointerGesturePinchV1) SendBegin(serial uint32, time uint32, surface *wayland.Surface, fingers uint32) {
207- self.PostEvent(ZwpPointerGesturePinchV1EventBegin, server.Uint(serial), server.Uint(time), server.Object(resourceOf(surface)), server.Uint(fingers))
208-}
209-
210-// SendUpdate multi-finger pinch motion.
211-func (self *ZwpPointerGesturePinchV1) SendUpdate(time uint32, dx server.Fixed, dy server.Fixed, scale server.Fixed, rotation server.Fixed) {
212- self.PostEvent(ZwpPointerGesturePinchV1EventUpdate, server.Uint(time), server.FixedArg(dx), server.FixedArg(dy), server.FixedArg(scale), server.FixedArg(rotation))
213-}
214-
215-// SendEnd multi-finger pinch end.
216-func (self *ZwpPointerGesturePinchV1) SendEnd(serial uint32, time uint32, cancelled int32) {
217- self.PostEvent(ZwpPointerGesturePinchV1EventEnd, server.Uint(serial), server.Uint(time), server.Int(cancelled))
218-}
219-func NewZwpPointerGesturePinchV1Global(d *server.Display, version int32, bind server.BindFunc) error {
220- return d.CreateGlobal(ZwpPointerGesturePinchV1Interface, version, bind)
221-}
222-
223-// ZwpPointerGestureHoldV1 a hold gesture object.
224-type ZwpPointerGestureHoldV1 struct{ *server.Resource }
225-
226-func WrapZwpPointerGestureHoldV1(r *server.Resource) *ZwpPointerGestureHoldV1 {
227- if r == nil {
228- return nil
229- }
230- return &ZwpPointerGestureHoldV1{r}
231-}
232-
233-const ZwpPointerGestureHoldV1RequestDestroy uint32 = 0
234-const ZwpPointerGestureHoldV1EventBegin uint32 = 0
235-const ZwpPointerGestureHoldV1EventEnd uint32 = 1
236-
237-// ZwpPointerGestureHoldV1Handler handles zwp_pointer_gesture_hold_v1 requests.
238-type ZwpPointerGestureHoldV1Handler interface {
239- Destroy(self *ZwpPointerGestureHoldV1)
240-}
241-
242-func NewZwpPointerGestureHoldV1(c server.Client, version int32, id uint32, h ZwpPointerGestureHoldV1Handler) (*ZwpPointerGestureHoldV1, error) {
243- if h == nil {
244- return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_pointer_gesture_hold_v1")
245- }
246- var self *ZwpPointerGestureHoldV1
247- r, err := c.CreateResource(ZwpPointerGestureHoldV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
248- switch opcode {
249- case 0:
250- h.Destroy(self)
251- self.Destroy()
252- }
253- })
254- if err != nil {
255- return nil, err
256- }
257- self = WrapZwpPointerGestureHoldV1(r)
258- r.Data = self
259- return self, nil
260-}
261-
262-// SendBegin multi-finger hold begin (since version 3).
263-func (self *ZwpPointerGestureHoldV1) SendBegin(serial uint32, time uint32, surface *wayland.Surface, fingers uint32) {
264- self.PostEvent(ZwpPointerGestureHoldV1EventBegin, server.Uint(serial), server.Uint(time), server.Object(resourceOf(surface)), server.Uint(fingers))
265-}
266-
267-// SendEnd multi-finger hold end (since version 3).
268-func (self *ZwpPointerGestureHoldV1) SendEnd(serial uint32, time uint32, cancelled int32) {
269- self.PostEvent(ZwpPointerGestureHoldV1EventEnd, server.Uint(serial), server.Uint(time), server.Int(cancelled))
270-}
271-func NewZwpPointerGestureHoldV1Global(d *server.Display, version int32, bind server.BindFunc) error {
272- return d.CreateGlobal(ZwpPointerGestureHoldV1Interface, version, bind)
273-}
274-func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
275- if v == nil {
276- return nil
277- }
278- return v.GetResource()
279-}
280-func (self *ZwpPointerGesturesV1) GetResource() *server.Resource {
281- if self == nil {
282- return nil
283- }
284- return self.Resource
285-}
286-func (self *ZwpPointerGestureSwipeV1) GetResource() *server.Resource {
287- if self == nil {
288- return nil
289- }
290- return self.Resource
291-}
292-func (self *ZwpPointerGesturePinchV1) GetResource() *server.Resource {
293- if self == nil {
294- return nil
295- }
296- return self.Resource
297-}
298-func (self *ZwpPointerGestureHoldV1) GetResource() *server.Resource {
299- if self == nil {
300- return nil
301- }
302- return self.Resource
303-}
D protocol/pointerwarp/pointerwarp.go +0 -78
@@ -1,78 +0,0 @@
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-}
D protocol/presentationtime/presentationtime.go +0 -168
@@ -1,168 +0,0 @@
1-// Code generated by wlgen; DO NOT EDIT.
2-package presentationtime
3-
4-import (
5- "fmt"
6- wayland "github.com/bnema/purego-libwayland/protocol/wayland"
7- "github.com/bnema/purego-libwayland/server"
8-)
9-
10-var WpPresentationInterface *server.Interface
11-var WpPresentationFeedbackInterface *server.Interface
12-
13-func init() {
14- WpPresentationInterface = &server.Interface{Name: "wp_presentation", Version: 2}
15- WpPresentationFeedbackInterface = &server.Interface{Name: "wp_presentation_feedback", Version: 2}
16- WpPresentationInterface.Requests = []server.Message{
17- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
18- {Name: "feedback", Signature: "on", Types: []*server.Interface{wayland.SurfaceInterface, WpPresentationFeedbackInterface}},
19- }
20- WpPresentationInterface.Events = []server.Message{
21- {Name: "clock_id", Signature: "u", Types: []*server.Interface{nil}},
22- }
23- WpPresentationFeedbackInterface.Requests = []server.Message{}
24- WpPresentationFeedbackInterface.Events = []server.Message{
25- {Name: "sync_output", Signature: "o", Types: []*server.Interface{wayland.OutputInterface}},
26- {Name: "presented", Signature: "uuuuuuu", Types: []*server.Interface{nil, nil, nil, nil, nil, nil, nil}},
27- {Name: "discarded", Signature: "", Types: []*server.Interface{}},
28- }
29- if err := server.NewInterfaces(WpPresentationInterface, WpPresentationFeedbackInterface); err != nil {
30- panic(err)
31- }
32-}
33-
34-// WpPresentation timed presentation related wl_surface requests.
35-type WpPresentation struct{ *server.Resource }
36-
37-func WrapWpPresentation(r *server.Resource) *WpPresentation {
38- if r == nil {
39- return nil
40- }
41- return &WpPresentation{r}
42-}
43-
44-const WpPresentationRequestDestroy uint32 = 0
45-const WpPresentationRequestFeedback uint32 = 1
46-const WpPresentationEventClockId uint32 = 0
47-
48-// WpPresentationError fatal presentation errors.
49-type WpPresentationError uint32
50-
51-const (
52- WpPresentationErrorInvalidTimestamp WpPresentationError = 0
53- WpPresentationErrorInvalidFlag WpPresentationError = 1
54-)
55-
56-// WpPresentationHandler handles wp_presentation requests.
57-type WpPresentationHandler interface {
58- Destroy(self *WpPresentation)
59- Feedback(self *WpPresentation, surface *wayland.Surface, callback uint32)
60-}
61-
62-func NewWpPresentation(c server.Client, version int32, id uint32, h WpPresentationHandler) (*WpPresentation, error) {
63- if h == nil {
64- return nil, fmt.Errorf("purego-libwayland: nil handler for wp_presentation")
65- }
66- var self *WpPresentation
67- r, err := c.CreateResource(WpPresentationInterface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
68- switch opcode {
69- case 0:
70- h.Destroy(self)
71- self.Destroy()
72- case 1:
73- h.Feedback(self, wayland.WrapSurface(args[0].Resource()), args[1].NewID())
74- }
75- })
76- if err != nil {
77- return nil, err
78- }
79- self = WrapWpPresentation(r)
80- r.Data = self
81- return self, nil
82-}
83-
84-// SendClockId clock ID for timestamps.
85-func (self *WpPresentation) SendClockId(clkId uint32) {
86- self.PostEvent(WpPresentationEventClockId, server.Uint(clkId))
87-}
88-func NewWpPresentationGlobal(d *server.Display, version int32, bind server.BindFunc) error {
89- return d.CreateGlobal(WpPresentationInterface, version, bind)
90-}
91-
92-// WpPresentationFeedback presentation time feedback event.
93-type WpPresentationFeedback struct{ *server.Resource }
94-
95-func WrapWpPresentationFeedback(r *server.Resource) *WpPresentationFeedback {
96- if r == nil {
97- return nil
98- }
99- return &WpPresentationFeedback{r}
100-}
101-
102-const WpPresentationFeedbackEventSyncOutput uint32 = 0
103-const WpPresentationFeedbackEventPresented uint32 = 1
104-const WpPresentationFeedbackEventDiscarded uint32 = 2
105-
106-// WpPresentationFeedbackKind bitmask of flags in presented event (bitfield).
107-type WpPresentationFeedbackKind uint32
108-
109-const (
110- WpPresentationFeedbackKindVsync WpPresentationFeedbackKind = 0x1
111- WpPresentationFeedbackKindHwClock WpPresentationFeedbackKind = 0x2
112- WpPresentationFeedbackKindHwCompletion WpPresentationFeedbackKind = 0x4
113- WpPresentationFeedbackKindZeroCopy WpPresentationFeedbackKind = 0x8
114-)
115-
116-// WpPresentationFeedbackHandler handles wp_presentation_feedback requests.
117-type WpPresentationFeedbackHandler interface {
118-}
119-
120-func NewWpPresentationFeedback(c server.Client, version int32, id uint32, h WpPresentationFeedbackHandler) (*WpPresentationFeedback, error) {
121- var self *WpPresentationFeedback
122- r, err := c.CreateResource(WpPresentationFeedbackInterface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
123- switch opcode {
124- }
125- })
126- if err != nil {
127- return nil, err
128- }
129- self = WrapWpPresentationFeedback(r)
130- r.Data = self
131- return self, nil
132-}
133-
134-// SendSyncOutput presentation synchronized to this output.
135-func (self *WpPresentationFeedback) SendSyncOutput(output *wayland.Output) {
136- self.PostEvent(WpPresentationFeedbackEventSyncOutput, server.Object(resourceOf(output)))
137-}
138-
139-// SendPresented the content update was displayed.
140-func (self *WpPresentationFeedback) SendPresented(tvSecHi uint32, tvSecLo uint32, tvNsec uint32, refresh uint32, seqHi uint32, seqLo uint32, flags uint32) {
141- self.PostEvent(WpPresentationFeedbackEventPresented, server.Uint(tvSecHi), server.Uint(tvSecLo), server.Uint(tvNsec), server.Uint(refresh), server.Uint(seqHi), server.Uint(seqLo), server.Uint(flags))
142-}
143-
144-// SendDiscarded the content update was not displayed.
145-func (self *WpPresentationFeedback) SendDiscarded() {
146- self.PostEvent(WpPresentationFeedbackEventDiscarded)
147-}
148-func NewWpPresentationFeedbackGlobal(d *server.Display, version int32, bind server.BindFunc) error {
149- return d.CreateGlobal(WpPresentationFeedbackInterface, version, bind)
150-}
151-func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
152- if v == nil {
153- return nil
154- }
155- return v.GetResource()
156-}
157-func (self *WpPresentation) GetResource() *server.Resource {
158- if self == nil {
159- return nil
160- }
161- return self.Resource
162-}
163-func (self *WpPresentationFeedback) GetResource() *server.Resource {
164- if self == nil {
165- return nil
166- }
167- return self.Resource
168-}
D protocol/primaryselection/primaryselection.go +0 -297
@@ -1,297 +0,0 @@
1-// Code generated by wlgen; DO NOT EDIT.
2-package primaryselection
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 ZwpPrimarySelectionDeviceManagerV1Interface *server.Interface
12-var ZwpPrimarySelectionDeviceV1Interface *server.Interface
13-var ZwpPrimarySelectionOfferV1Interface *server.Interface
14-var ZwpPrimarySelectionSourceV1Interface *server.Interface
15-
16-func init() {
17- ZwpPrimarySelectionDeviceManagerV1Interface = &server.Interface{Name: "zwp_primary_selection_device_manager_v1", Version: 1}
18- ZwpPrimarySelectionDeviceV1Interface = &server.Interface{Name: "zwp_primary_selection_device_v1", Version: 1}
19- ZwpPrimarySelectionOfferV1Interface = &server.Interface{Name: "zwp_primary_selection_offer_v1", Version: 1}
20- ZwpPrimarySelectionSourceV1Interface = &server.Interface{Name: "zwp_primary_selection_source_v1", Version: 1}
21- ZwpPrimarySelectionDeviceManagerV1Interface.Requests = []server.Message{
22- {Name: "create_source", Signature: "n", Types: []*server.Interface{ZwpPrimarySelectionSourceV1Interface}},
23- {Name: "get_device", Signature: "no", Types: []*server.Interface{ZwpPrimarySelectionDeviceV1Interface, wayland.SeatInterface}},
24- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
25- }
26- ZwpPrimarySelectionDeviceManagerV1Interface.Events = []server.Message{}
27- ZwpPrimarySelectionDeviceV1Interface.Requests = []server.Message{
28- {Name: "set_selection", Signature: "?ou", Types: []*server.Interface{ZwpPrimarySelectionSourceV1Interface, nil}},
29- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
30- }
31- ZwpPrimarySelectionDeviceV1Interface.Events = []server.Message{
32- {Name: "data_offer", Signature: "n", Types: []*server.Interface{ZwpPrimarySelectionOfferV1Interface}},
33- {Name: "selection", Signature: "?o", Types: []*server.Interface{ZwpPrimarySelectionOfferV1Interface}},
34- }
35- ZwpPrimarySelectionOfferV1Interface.Requests = []server.Message{
36- {Name: "receive", Signature: "sh", Types: []*server.Interface{nil, nil}},
37- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
38- }
39- ZwpPrimarySelectionOfferV1Interface.Events = []server.Message{
40- {Name: "offer", Signature: "s", Types: []*server.Interface{nil}},
41- }
42- ZwpPrimarySelectionSourceV1Interface.Requests = []server.Message{
43- {Name: "offer", Signature: "s", Types: []*server.Interface{nil}},
44- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
45- }
46- ZwpPrimarySelectionSourceV1Interface.Events = []server.Message{
47- {Name: "send", Signature: "sh", Types: []*server.Interface{nil, nil}},
48- {Name: "cancelled", Signature: "", Types: []*server.Interface{}},
49- }
50- if err := server.NewInterfaces(ZwpPrimarySelectionDeviceManagerV1Interface, ZwpPrimarySelectionDeviceV1Interface, ZwpPrimarySelectionOfferV1Interface, ZwpPrimarySelectionSourceV1Interface); err != nil {
51- panic(err)
52- }
53-}
54-
55-// ZwpPrimarySelectionDeviceManagerV1 X primary selection emulation.
56-type ZwpPrimarySelectionDeviceManagerV1 struct{ *server.Resource }
57-
58-func WrapZwpPrimarySelectionDeviceManagerV1(r *server.Resource) *ZwpPrimarySelectionDeviceManagerV1 {
59- if r == nil {
60- return nil
61- }
62- return &ZwpPrimarySelectionDeviceManagerV1{r}
63-}
64-
65-const ZwpPrimarySelectionDeviceManagerV1RequestCreateSource uint32 = 0
66-const ZwpPrimarySelectionDeviceManagerV1RequestGetDevice uint32 = 1
67-const ZwpPrimarySelectionDeviceManagerV1RequestDestroy uint32 = 2
68-
69-// ZwpPrimarySelectionDeviceManagerV1Handler handles zwp_primary_selection_device_manager_v1 requests.
70-type ZwpPrimarySelectionDeviceManagerV1Handler interface {
71- CreateSource(self *ZwpPrimarySelectionDeviceManagerV1, id uint32)
72- GetDevice(self *ZwpPrimarySelectionDeviceManagerV1, id uint32, seat *wayland.Seat)
73- Destroy(self *ZwpPrimarySelectionDeviceManagerV1)
74-}
75-
76-func NewZwpPrimarySelectionDeviceManagerV1(c server.Client, version int32, id uint32, h ZwpPrimarySelectionDeviceManagerV1Handler) (*ZwpPrimarySelectionDeviceManagerV1, error) {
77- if h == nil {
78- return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_primary_selection_device_manager_v1")
79- }
80- var self *ZwpPrimarySelectionDeviceManagerV1
81- r, err := c.CreateResource(ZwpPrimarySelectionDeviceManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
82- switch opcode {
83- case 0:
84- h.CreateSource(self, args[0].NewID())
85- case 1:
86- h.GetDevice(self, args[0].NewID(), wayland.WrapSeat(args[1].Resource()))
87- case 2:
88- h.Destroy(self)
89- self.Destroy()
90- }
91- })
92- if err != nil {
93- return nil, err
94- }
95- self = WrapZwpPrimarySelectionDeviceManagerV1(r)
96- r.Data = self
97- return self, nil
98-}
99-func NewZwpPrimarySelectionDeviceManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
100- return d.CreateGlobal(ZwpPrimarySelectionDeviceManagerV1Interface, version, bind)
101-}
102-
103-// ZwpPrimarySelectionDeviceV1 .
104-type ZwpPrimarySelectionDeviceV1 struct{ *server.Resource }
105-
106-func WrapZwpPrimarySelectionDeviceV1(r *server.Resource) *ZwpPrimarySelectionDeviceV1 {
107- if r == nil {
108- return nil
109- }
110- return &ZwpPrimarySelectionDeviceV1{r}
111-}
112-
113-const ZwpPrimarySelectionDeviceV1RequestSetSelection uint32 = 0
114-const ZwpPrimarySelectionDeviceV1RequestDestroy uint32 = 1
115-const ZwpPrimarySelectionDeviceV1EventDataOffer uint32 = 0
116-const ZwpPrimarySelectionDeviceV1EventSelection uint32 = 1
117-
118-// ZwpPrimarySelectionDeviceV1Handler handles zwp_primary_selection_device_v1 requests.
119-type ZwpPrimarySelectionDeviceV1Handler interface {
120- SetSelection(self *ZwpPrimarySelectionDeviceV1, source *ZwpPrimarySelectionSourceV1, serial uint32)
121- Destroy(self *ZwpPrimarySelectionDeviceV1)
122-}
123-
124-func NewZwpPrimarySelectionDeviceV1(c server.Client, version int32, id uint32, h ZwpPrimarySelectionDeviceV1Handler) (*ZwpPrimarySelectionDeviceV1, error) {
125- if h == nil {
126- return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_primary_selection_device_v1")
127- }
128- var self *ZwpPrimarySelectionDeviceV1
129- r, err := c.CreateResource(ZwpPrimarySelectionDeviceV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
130- switch opcode {
131- case 0:
132- h.SetSelection(self, WrapZwpPrimarySelectionSourceV1(args[0].Resource()), args[1].Uint())
133- case 1:
134- h.Destroy(self)
135- self.Destroy()
136- }
137- })
138- if err != nil {
139- return nil, err
140- }
141- self = WrapZwpPrimarySelectionDeviceV1(r)
142- r.Data = self
143- return self, nil
144-}
145-
146-// SendDataOffer introduce a new wp_primary_selection_offer.
147-func (self *ZwpPrimarySelectionDeviceV1) SendDataOffer(offer *ZwpPrimarySelectionOfferV1) {
148- self.PostEvent(ZwpPrimarySelectionDeviceV1EventDataOffer, server.NewID(resourceOf(offer)))
149-}
150-
151-// SendSelection advertise a new primary selection.
152-func (self *ZwpPrimarySelectionDeviceV1) SendSelection(id *ZwpPrimarySelectionOfferV1) {
153- self.PostEvent(ZwpPrimarySelectionDeviceV1EventSelection, server.Object(resourceOf(id)))
154-}
155-func NewZwpPrimarySelectionDeviceV1Global(d *server.Display, version int32, bind server.BindFunc) error {
156- return d.CreateGlobal(ZwpPrimarySelectionDeviceV1Interface, version, bind)
157-}
158-
159-// ZwpPrimarySelectionOfferV1 offer to transfer primary selection contents.
160-type ZwpPrimarySelectionOfferV1 struct{ *server.Resource }
161-
162-func WrapZwpPrimarySelectionOfferV1(r *server.Resource) *ZwpPrimarySelectionOfferV1 {
163- if r == nil {
164- return nil
165- }
166- return &ZwpPrimarySelectionOfferV1{r}
167-}
168-
169-const ZwpPrimarySelectionOfferV1RequestReceive uint32 = 0
170-const ZwpPrimarySelectionOfferV1RequestDestroy uint32 = 1
171-const ZwpPrimarySelectionOfferV1EventOffer uint32 = 0
172-
173-// ZwpPrimarySelectionOfferV1Handler handles zwp_primary_selection_offer_v1 requests.
174-type ZwpPrimarySelectionOfferV1Handler interface {
175- Receive(self *ZwpPrimarySelectionOfferV1, mimeType string, fd int)
176- Destroy(self *ZwpPrimarySelectionOfferV1)
177-}
178-
179-func NewZwpPrimarySelectionOfferV1(c server.Client, version int32, id uint32, h ZwpPrimarySelectionOfferV1Handler) (*ZwpPrimarySelectionOfferV1, error) {
180- if h == nil {
181- return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_primary_selection_offer_v1")
182- }
183- var self *ZwpPrimarySelectionOfferV1
184- r, err := c.CreateResource(ZwpPrimarySelectionOfferV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
185- switch opcode {
186- case 0:
187- h.Receive(self, args[0].String(), args[1].Fd())
188- case 1:
189- h.Destroy(self)
190- self.Destroy()
191- }
192- })
193- if err != nil {
194- return nil, err
195- }
196- self = WrapZwpPrimarySelectionOfferV1(r)
197- r.Data = self
198- return self, nil
199-}
200-
201-// SendOffer advertise offered mime type.
202-func (self *ZwpPrimarySelectionOfferV1) SendOffer(mimeType string) {
203- var p runtime.Pinner
204- defer p.Unpin()
205- self.PostEvent(ZwpPrimarySelectionOfferV1EventOffer, server.String(&p, mimeType, false))
206-}
207-func NewZwpPrimarySelectionOfferV1Global(d *server.Display, version int32, bind server.BindFunc) error {
208- return d.CreateGlobal(ZwpPrimarySelectionOfferV1Interface, version, bind)
209-}
210-
211-// ZwpPrimarySelectionSourceV1 offer to replace the contents of the primary selection.
212-type ZwpPrimarySelectionSourceV1 struct{ *server.Resource }
213-
214-func WrapZwpPrimarySelectionSourceV1(r *server.Resource) *ZwpPrimarySelectionSourceV1 {
215- if r == nil {
216- return nil
217- }
218- return &ZwpPrimarySelectionSourceV1{r}
219-}
220-
221-const ZwpPrimarySelectionSourceV1RequestOffer uint32 = 0
222-const ZwpPrimarySelectionSourceV1RequestDestroy uint32 = 1
223-const ZwpPrimarySelectionSourceV1EventSend uint32 = 0
224-const ZwpPrimarySelectionSourceV1EventCancelled uint32 = 1
225-
226-// ZwpPrimarySelectionSourceV1Handler handles zwp_primary_selection_source_v1 requests.
227-type ZwpPrimarySelectionSourceV1Handler interface {
228- Offer(self *ZwpPrimarySelectionSourceV1, mimeType string)
229- Destroy(self *ZwpPrimarySelectionSourceV1)
230-}
231-
232-func NewZwpPrimarySelectionSourceV1(c server.Client, version int32, id uint32, h ZwpPrimarySelectionSourceV1Handler) (*ZwpPrimarySelectionSourceV1, error) {
233- if h == nil {
234- return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_primary_selection_source_v1")
235- }
236- var self *ZwpPrimarySelectionSourceV1
237- r, err := c.CreateResource(ZwpPrimarySelectionSourceV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
238- switch opcode {
239- case 0:
240- h.Offer(self, args[0].String())
241- case 1:
242- h.Destroy(self)
243- self.Destroy()
244- }
245- })
246- if err != nil {
247- return nil, err
248- }
249- self = WrapZwpPrimarySelectionSourceV1(r)
250- r.Data = self
251- return self, nil
252-}
253-
254-// SendSend send the primary selection contents.
255-func (self *ZwpPrimarySelectionSourceV1) SendSend(mimeType string, fd int) {
256- var p runtime.Pinner
257- defer p.Unpin()
258- self.PostEvent(ZwpPrimarySelectionSourceV1EventSend, server.String(&p, mimeType, false), server.Fd(fd))
259-}
260-
261-// SendCancelled request for primary selection contents was canceled.
262-func (self *ZwpPrimarySelectionSourceV1) SendCancelled() {
263- self.PostEvent(ZwpPrimarySelectionSourceV1EventCancelled)
264-}
265-func NewZwpPrimarySelectionSourceV1Global(d *server.Display, version int32, bind server.BindFunc) error {
266- return d.CreateGlobal(ZwpPrimarySelectionSourceV1Interface, version, bind)
267-}
268-func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
269- if v == nil {
270- return nil
271- }
272- return v.GetResource()
273-}
274-func (self *ZwpPrimarySelectionDeviceManagerV1) GetResource() *server.Resource {
275- if self == nil {
276- return nil
277- }
278- return self.Resource
279-}
280-func (self *ZwpPrimarySelectionDeviceV1) GetResource() *server.Resource {
281- if self == nil {
282- return nil
283- }
284- return self.Resource
285-}
286-func (self *ZwpPrimarySelectionOfferV1) GetResource() *server.Resource {
287- if self == nil {
288- return nil
289- }
290- return self.Resource
291-}
292-func (self *ZwpPrimarySelectionSourceV1) GetResource() *server.Resource {
293- if self == nil {
294- return nil
295- }
296- return self.Resource
297-}
D protocol/protocol_test.go +0 -67
@@ -1,67 +0,0 @@
1-package protocol_test
2-
3-// Importing every generated package runs its init, which builds the
4-// libwayland interface tables and panics on any inconsistency.
5-import (
6- "testing"
7-
8- _ "github.com/bnema/purego-libwayland/protocol/alphamodifier"
9- _ "github.com/bnema/purego-libwayland/protocol/colormanagement"
10- _ "github.com/bnema/purego-libwayland/protocol/colorrepresentation"
11- _ "github.com/bnema/purego-libwayland/protocol/committiming"
12- _ "github.com/bnema/purego-libwayland/protocol/contenttype"
13- _ "github.com/bnema/purego-libwayland/protocol/cursorshape"
14- _ "github.com/bnema/purego-libwayland/protocol/drmlease"
15- _ "github.com/bnema/purego-libwayland/protocol/extbackgroundeffect"
16- _ "github.com/bnema/purego-libwayland/protocol/extdatacontrol"
17- _ "github.com/bnema/purego-libwayland/protocol/extforeigntoplevellist"
18- _ "github.com/bnema/purego-libwayland/protocol/extidlenotify"
19- _ "github.com/bnema/purego-libwayland/protocol/extimagecapturesource"
20- _ "github.com/bnema/purego-libwayland/protocol/extimagecopycapture"
21- _ "github.com/bnema/purego-libwayland/protocol/extsessionlock"
22- _ "github.com/bnema/purego-libwayland/protocol/exttransientseat"
23- _ "github.com/bnema/purego-libwayland/protocol/extworkspace"
24- _ "github.com/bnema/purego-libwayland/protocol/fifo"
25- _ "github.com/bnema/purego-libwayland/protocol/fractionalscale"
26- _ "github.com/bnema/purego-libwayland/protocol/idleinhibit"
27- _ "github.com/bnema/purego-libwayland/protocol/inputmethod"
28- _ "github.com/bnema/purego-libwayland/protocol/kdedecoration"
29- _ "github.com/bnema/purego-libwayland/protocol/keyboardshortcutsinhibit"
30- _ "github.com/bnema/purego-libwayland/protocol/linuxdmabuf"
31- _ "github.com/bnema/purego-libwayland/protocol/linuxdrmsyncobj"
32- _ "github.com/bnema/purego-libwayland/protocol/pointerconstraints"
33- _ "github.com/bnema/purego-libwayland/protocol/pointergestures"
34- _ "github.com/bnema/purego-libwayland/protocol/pointerwarp"
35- _ "github.com/bnema/purego-libwayland/protocol/presentationtime"
36- _ "github.com/bnema/purego-libwayland/protocol/primaryselection"
37- _ "github.com/bnema/purego-libwayland/protocol/relativepointer"
38- _ "github.com/bnema/purego-libwayland/protocol/securitycontext"
39- _ "github.com/bnema/purego-libwayland/protocol/singlepixelbuffer"
40- _ "github.com/bnema/purego-libwayland/protocol/tabletv2"
41- _ "github.com/bnema/purego-libwayland/protocol/tearingcontrol"
42- _ "github.com/bnema/purego-libwayland/protocol/textinput"
43- _ "github.com/bnema/purego-libwayland/protocol/viewporter"
44- _ "github.com/bnema/purego-libwayland/protocol/virtualkeyboard"
45- _ "github.com/bnema/purego-libwayland/protocol/wayland"
46- _ "github.com/bnema/purego-libwayland/protocol/wlrforeigntoplevel"
47- _ "github.com/bnema/purego-libwayland/protocol/wlrgammacontrol"
48- _ "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"
52- _ "github.com/bnema/purego-libwayland/protocol/xdgactivation"
53- _ "github.com/bnema/purego-libwayland/protocol/xdgdecoration"
54- _ "github.com/bnema/purego-libwayland/protocol/xdgdialog"
55- _ "github.com/bnema/purego-libwayland/protocol/xdgforeign"
56- _ "github.com/bnema/purego-libwayland/protocol/xdgoutput"
57- _ "github.com/bnema/purego-libwayland/protocol/xdgsessionmanagement"
58- _ "github.com/bnema/purego-libwayland/protocol/xdgshell"
59- _ "github.com/bnema/purego-libwayland/protocol/xdgsystembell"
60- _ "github.com/bnema/purego-libwayland/protocol/xdgtopleveldrag"
61- _ "github.com/bnema/purego-libwayland/protocol/xdgtoplevelicon"
62- _ "github.com/bnema/purego-libwayland/protocol/xdgtopleveltag"
63- _ "github.com/bnema/purego-libwayland/protocol/xwaylandkeyboardgrab"
64- _ "github.com/bnema/purego-libwayland/protocol/xwaylandshell"
65-)
66-
67-func TestGeneratedPackagesInit(t *testing.T) {}
D protocol/relativepointer/relativepointer.go +0 -138
@@ -1,138 +0,0 @@
1-// Code generated by wlgen; DO NOT EDIT.
2-package relativepointer
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 ZwpRelativePointerManagerV1Interface *server.Interface
11-var ZwpRelativePointerV1Interface *server.Interface
12-
13-func init() {
14- ZwpRelativePointerManagerV1Interface = &server.Interface{Name: "zwp_relative_pointer_manager_v1", Version: 1}
15- ZwpRelativePointerV1Interface = &server.Interface{Name: "zwp_relative_pointer_v1", Version: 1}
16- ZwpRelativePointerManagerV1Interface.Requests = []server.Message{
17- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
18- {Name: "get_relative_pointer", Signature: "no", Types: []*server.Interface{ZwpRelativePointerV1Interface, wayland.PointerInterface}},
19- }
20- ZwpRelativePointerManagerV1Interface.Events = []server.Message{}
21- ZwpRelativePointerV1Interface.Requests = []server.Message{
22- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
23- }
24- ZwpRelativePointerV1Interface.Events = []server.Message{
25- {Name: "relative_motion", Signature: "uuffff", Types: []*server.Interface{nil, nil, nil, nil, nil, nil}},
26- }
27- if err := server.NewInterfaces(ZwpRelativePointerManagerV1Interface, ZwpRelativePointerV1Interface); err != nil {
28- panic(err)
29- }
30-}
31-
32-// ZwpRelativePointerManagerV1 get relative pointer objects.
33-type ZwpRelativePointerManagerV1 struct{ *server.Resource }
34-
35-func WrapZwpRelativePointerManagerV1(r *server.Resource) *ZwpRelativePointerManagerV1 {
36- if r == nil {
37- return nil
38- }
39- return &ZwpRelativePointerManagerV1{r}
40-}
41-
42-const ZwpRelativePointerManagerV1RequestDestroy uint32 = 0
43-const ZwpRelativePointerManagerV1RequestGetRelativePointer uint32 = 1
44-
45-// ZwpRelativePointerManagerV1Handler handles zwp_relative_pointer_manager_v1 requests.
46-type ZwpRelativePointerManagerV1Handler interface {
47- Destroy(self *ZwpRelativePointerManagerV1)
48- GetRelativePointer(self *ZwpRelativePointerManagerV1, id uint32, pointer *wayland.Pointer)
49-}
50-
51-func NewZwpRelativePointerManagerV1(c server.Client, version int32, id uint32, h ZwpRelativePointerManagerV1Handler) (*ZwpRelativePointerManagerV1, error) {
52- if h == nil {
53- return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_relative_pointer_manager_v1")
54- }
55- var self *ZwpRelativePointerManagerV1
56- r, err := c.CreateResource(ZwpRelativePointerManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
57- switch opcode {
58- case 0:
59- h.Destroy(self)
60- self.Destroy()
61- case 1:
62- h.GetRelativePointer(self, args[0].NewID(), wayland.WrapPointer(args[1].Resource()))
63- }
64- })
65- if err != nil {
66- return nil, err
67- }
68- self = WrapZwpRelativePointerManagerV1(r)
69- r.Data = self
70- return self, nil
71-}
72-func NewZwpRelativePointerManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
73- return d.CreateGlobal(ZwpRelativePointerManagerV1Interface, version, bind)
74-}
75-
76-// ZwpRelativePointerV1 relative pointer object.
77-type ZwpRelativePointerV1 struct{ *server.Resource }
78-
79-func WrapZwpRelativePointerV1(r *server.Resource) *ZwpRelativePointerV1 {
80- if r == nil {
81- return nil
82- }
83- return &ZwpRelativePointerV1{r}
84-}
85-
86-const ZwpRelativePointerV1RequestDestroy uint32 = 0
87-const ZwpRelativePointerV1EventRelativeMotion uint32 = 0
88-
89-// ZwpRelativePointerV1Handler handles zwp_relative_pointer_v1 requests.
90-type ZwpRelativePointerV1Handler interface {
91- Destroy(self *ZwpRelativePointerV1)
92-}
93-
94-func NewZwpRelativePointerV1(c server.Client, version int32, id uint32, h ZwpRelativePointerV1Handler) (*ZwpRelativePointerV1, error) {
95- if h == nil {
96- return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_relative_pointer_v1")
97- }
98- var self *ZwpRelativePointerV1
99- r, err := c.CreateResource(ZwpRelativePointerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
100- switch opcode {
101- case 0:
102- h.Destroy(self)
103- self.Destroy()
104- }
105- })
106- if err != nil {
107- return nil, err
108- }
109- self = WrapZwpRelativePointerV1(r)
110- r.Data = self
111- return self, nil
112-}
113-
114-// SendRelativeMotion relative pointer motion.
115-func (self *ZwpRelativePointerV1) SendRelativeMotion(utimeHi uint32, utimeLo uint32, dx server.Fixed, dy server.Fixed, dxUnaccel server.Fixed, dyUnaccel server.Fixed) {
116- self.PostEvent(ZwpRelativePointerV1EventRelativeMotion, server.Uint(utimeHi), server.Uint(utimeLo), server.FixedArg(dx), server.FixedArg(dy), server.FixedArg(dxUnaccel), server.FixedArg(dyUnaccel))
117-}
118-func NewZwpRelativePointerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
119- return d.CreateGlobal(ZwpRelativePointerV1Interface, version, bind)
120-}
121-func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
122- if v == nil {
123- return nil
124- }
125- return v.GetResource()
126-}
127-func (self *ZwpRelativePointerManagerV1) GetResource() *server.Resource {
128- if self == nil {
129- return nil
130- }
131- return self.Resource
132-}
133-func (self *ZwpRelativePointerV1) GetResource() *server.Resource {
134- if self == nil {
135- return nil
136- }
137- return self.Resource
138-}
D protocol/securitycontext/securitycontext.go +0 -166
@@ -1,166 +0,0 @@
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-}
D protocol/singlepixelbuffer/singlepixelbuffer.go +0 -78
@@ -1,78 +0,0 @@
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-}
D protocol/tabletv2/tabletv2.go +0 -981
@@ -1,981 +0,0 @@
1-// Code generated by wlgen; DO NOT EDIT.
2-package tabletv2
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 ZwpTabletManagerV2Interface *server.Interface
12-var ZwpTabletSeatV2Interface *server.Interface
13-var ZwpTabletToolV2Interface *server.Interface
14-var ZwpTabletV2Interface *server.Interface
15-var ZwpTabletPadRingV2Interface *server.Interface
16-var ZwpTabletPadStripV2Interface *server.Interface
17-var ZwpTabletPadGroupV2Interface *server.Interface
18-var ZwpTabletPadV2Interface *server.Interface
19-var ZwpTabletPadDialV2Interface *server.Interface
20-
21-func init() {
22- ZwpTabletManagerV2Interface = &server.Interface{Name: "zwp_tablet_manager_v2", Version: 2}
23- ZwpTabletSeatV2Interface = &server.Interface{Name: "zwp_tablet_seat_v2", Version: 2}
24- ZwpTabletToolV2Interface = &server.Interface{Name: "zwp_tablet_tool_v2", Version: 2}
25- ZwpTabletV2Interface = &server.Interface{Name: "zwp_tablet_v2", Version: 2}
26- ZwpTabletPadRingV2Interface = &server.Interface{Name: "zwp_tablet_pad_ring_v2", Version: 2}
27- ZwpTabletPadStripV2Interface = &server.Interface{Name: "zwp_tablet_pad_strip_v2", Version: 2}
28- ZwpTabletPadGroupV2Interface = &server.Interface{Name: "zwp_tablet_pad_group_v2", Version: 2}
29- ZwpTabletPadV2Interface = &server.Interface{Name: "zwp_tablet_pad_v2", Version: 2}
30- ZwpTabletPadDialV2Interface = &server.Interface{Name: "zwp_tablet_pad_dial_v2", Version: 2}
31- ZwpTabletManagerV2Interface.Requests = []server.Message{
32- {Name: "get_tablet_seat", Signature: "no", Types: []*server.Interface{ZwpTabletSeatV2Interface, wayland.SeatInterface}},
33- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
34- }
35- ZwpTabletManagerV2Interface.Events = []server.Message{}
36- ZwpTabletSeatV2Interface.Requests = []server.Message{
37- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
38- }
39- ZwpTabletSeatV2Interface.Events = []server.Message{
40- {Name: "tablet_added", Signature: "n", Types: []*server.Interface{ZwpTabletV2Interface}},
41- {Name: "tool_added", Signature: "n", Types: []*server.Interface{ZwpTabletToolV2Interface}},
42- {Name: "pad_added", Signature: "n", Types: []*server.Interface{ZwpTabletPadV2Interface}},
43- }
44- ZwpTabletToolV2Interface.Requests = []server.Message{
45- {Name: "set_cursor", Signature: "u?oii", Types: []*server.Interface{nil, wayland.SurfaceInterface, nil, nil}},
46- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
47- }
48- ZwpTabletToolV2Interface.Events = []server.Message{
49- {Name: "type", Signature: "u", Types: []*server.Interface{nil}},
50- {Name: "hardware_serial", Signature: "uu", Types: []*server.Interface{nil, nil}},
51- {Name: "hardware_id_wacom", Signature: "uu", Types: []*server.Interface{nil, nil}},
52- {Name: "capability", Signature: "u", Types: []*server.Interface{nil}},
53- {Name: "done", Signature: "", Types: []*server.Interface{}},
54- {Name: "removed", Signature: "", Types: []*server.Interface{}},
55- {Name: "proximity_in", Signature: "uoo", Types: []*server.Interface{nil, ZwpTabletV2Interface, wayland.SurfaceInterface}},
56- {Name: "proximity_out", Signature: "", Types: []*server.Interface{}},
57- {Name: "down", Signature: "u", Types: []*server.Interface{nil}},
58- {Name: "up", Signature: "", Types: []*server.Interface{}},
59- {Name: "motion", Signature: "ff", Types: []*server.Interface{nil, nil}},
60- {Name: "pressure", Signature: "u", Types: []*server.Interface{nil}},
61- {Name: "distance", Signature: "u", Types: []*server.Interface{nil}},
62- {Name: "tilt", Signature: "ff", Types: []*server.Interface{nil, nil}},
63- {Name: "rotation", Signature: "f", Types: []*server.Interface{nil}},
64- {Name: "slider", Signature: "i", Types: []*server.Interface{nil}},
65- {Name: "wheel", Signature: "fi", Types: []*server.Interface{nil, nil}},
66- {Name: "button", Signature: "uuu", Types: []*server.Interface{nil, nil, nil}},
67- {Name: "frame", Signature: "u", Types: []*server.Interface{nil}},
68- }
69- ZwpTabletV2Interface.Requests = []server.Message{
70- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
71- }
72- ZwpTabletV2Interface.Events = []server.Message{
73- {Name: "name", Signature: "s", Types: []*server.Interface{nil}},
74- {Name: "id", Signature: "uu", Types: []*server.Interface{nil, nil}},
75- {Name: "path", Signature: "s", Types: []*server.Interface{nil}},
76- {Name: "done", Signature: "", Types: []*server.Interface{}},
77- {Name: "removed", Signature: "", Types: []*server.Interface{}},
78- {Name: "bustype", Signature: "2u", Types: []*server.Interface{nil}},
79- }
80- ZwpTabletPadRingV2Interface.Requests = []server.Message{
81- {Name: "set_feedback", Signature: "su", Types: []*server.Interface{nil, nil}},
82- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
83- }
84- ZwpTabletPadRingV2Interface.Events = []server.Message{
85- {Name: "source", Signature: "u", Types: []*server.Interface{nil}},
86- {Name: "angle", Signature: "f", Types: []*server.Interface{nil}},
87- {Name: "stop", Signature: "", Types: []*server.Interface{}},
88- {Name: "frame", Signature: "u", Types: []*server.Interface{nil}},
89- }
90- ZwpTabletPadStripV2Interface.Requests = []server.Message{
91- {Name: "set_feedback", Signature: "su", Types: []*server.Interface{nil, nil}},
92- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
93- }
94- ZwpTabletPadStripV2Interface.Events = []server.Message{
95- {Name: "source", Signature: "u", Types: []*server.Interface{nil}},
96- {Name: "position", Signature: "u", Types: []*server.Interface{nil}},
97- {Name: "stop", Signature: "", Types: []*server.Interface{}},
98- {Name: "frame", Signature: "u", Types: []*server.Interface{nil}},
99- }
100- ZwpTabletPadGroupV2Interface.Requests = []server.Message{
101- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
102- }
103- ZwpTabletPadGroupV2Interface.Events = []server.Message{
104- {Name: "buttons", Signature: "a", Types: []*server.Interface{nil}},
105- {Name: "ring", Signature: "n", Types: []*server.Interface{ZwpTabletPadRingV2Interface}},
106- {Name: "strip", Signature: "n", Types: []*server.Interface{ZwpTabletPadStripV2Interface}},
107- {Name: "modes", Signature: "u", Types: []*server.Interface{nil}},
108- {Name: "done", Signature: "", Types: []*server.Interface{}},
109- {Name: "mode_switch", Signature: "uuu", Types: []*server.Interface{nil, nil, nil}},
110- {Name: "dial", Signature: "2n", Types: []*server.Interface{ZwpTabletPadDialV2Interface}},
111- }
112- ZwpTabletPadV2Interface.Requests = []server.Message{
113- {Name: "set_feedback", Signature: "usu", Types: []*server.Interface{nil, nil, nil}},
114- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
115- }
116- ZwpTabletPadV2Interface.Events = []server.Message{
117- {Name: "group", Signature: "n", Types: []*server.Interface{ZwpTabletPadGroupV2Interface}},
118- {Name: "path", Signature: "s", Types: []*server.Interface{nil}},
119- {Name: "buttons", Signature: "u", Types: []*server.Interface{nil}},
120- {Name: "done", Signature: "", Types: []*server.Interface{}},
121- {Name: "button", Signature: "uuu", Types: []*server.Interface{nil, nil, nil}},
122- {Name: "enter", Signature: "uoo", Types: []*server.Interface{nil, ZwpTabletV2Interface, wayland.SurfaceInterface}},
123- {Name: "leave", Signature: "uo", Types: []*server.Interface{nil, wayland.SurfaceInterface}},
124- {Name: "removed", Signature: "", Types: []*server.Interface{}},
125- }
126- ZwpTabletPadDialV2Interface.Requests = []server.Message{
127- {Name: "set_feedback", Signature: "su", Types: []*server.Interface{nil, nil}},
128- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
129- }
130- ZwpTabletPadDialV2Interface.Events = []server.Message{
131- {Name: "delta", Signature: "i", Types: []*server.Interface{nil}},
132- {Name: "frame", Signature: "u", Types: []*server.Interface{nil}},
133- }
134- if err := server.NewInterfaces(ZwpTabletManagerV2Interface, ZwpTabletSeatV2Interface, ZwpTabletToolV2Interface, ZwpTabletV2Interface, ZwpTabletPadRingV2Interface, ZwpTabletPadStripV2Interface, ZwpTabletPadGroupV2Interface, ZwpTabletPadV2Interface, ZwpTabletPadDialV2Interface); err != nil {
135- panic(err)
136- }
137-}
138-
139-// ZwpTabletManagerV2 controller object for graphic tablet devices.
140-type ZwpTabletManagerV2 struct{ *server.Resource }
141-
142-func WrapZwpTabletManagerV2(r *server.Resource) *ZwpTabletManagerV2 {
143- if r == nil {
144- return nil
145- }
146- return &ZwpTabletManagerV2{r}
147-}
148-
149-const ZwpTabletManagerV2RequestGetTabletSeat uint32 = 0
150-const ZwpTabletManagerV2RequestDestroy uint32 = 1
151-
152-// ZwpTabletManagerV2Handler handles zwp_tablet_manager_v2 requests.
153-type ZwpTabletManagerV2Handler interface {
154- GetTabletSeat(self *ZwpTabletManagerV2, tabletSeat uint32, seat *wayland.Seat)
155- Destroy(self *ZwpTabletManagerV2)
156-}
157-
158-func NewZwpTabletManagerV2(c server.Client, version int32, id uint32, h ZwpTabletManagerV2Handler) (*ZwpTabletManagerV2, error) {
159- if h == nil {
160- return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_tablet_manager_v2")
161- }
162- var self *ZwpTabletManagerV2
163- r, err := c.CreateResource(ZwpTabletManagerV2Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
164- switch opcode {
165- case 0:
166- h.GetTabletSeat(self, args[0].NewID(), wayland.WrapSeat(args[1].Resource()))
167- case 1:
168- h.Destroy(self)
169- self.Destroy()
170- }
171- })
172- if err != nil {
173- return nil, err
174- }
175- self = WrapZwpTabletManagerV2(r)
176- r.Data = self
177- return self, nil
178-}
179-func NewZwpTabletManagerV2Global(d *server.Display, version int32, bind server.BindFunc) error {
180- return d.CreateGlobal(ZwpTabletManagerV2Interface, version, bind)
181-}
182-
183-// ZwpTabletSeatV2 controller object for graphic tablet devices of a seat.
184-type ZwpTabletSeatV2 struct{ *server.Resource }
185-
186-func WrapZwpTabletSeatV2(r *server.Resource) *ZwpTabletSeatV2 {
187- if r == nil {
188- return nil
189- }
190- return &ZwpTabletSeatV2{r}
191-}
192-
193-const ZwpTabletSeatV2RequestDestroy uint32 = 0
194-const ZwpTabletSeatV2EventTabletAdded uint32 = 0
195-const ZwpTabletSeatV2EventToolAdded uint32 = 1
196-const ZwpTabletSeatV2EventPadAdded uint32 = 2
197-
198-// ZwpTabletSeatV2Handler handles zwp_tablet_seat_v2 requests.
199-type ZwpTabletSeatV2Handler interface {
200- Destroy(self *ZwpTabletSeatV2)
201-}
202-
203-func NewZwpTabletSeatV2(c server.Client, version int32, id uint32, h ZwpTabletSeatV2Handler) (*ZwpTabletSeatV2, error) {
204- if h == nil {
205- return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_tablet_seat_v2")
206- }
207- var self *ZwpTabletSeatV2
208- r, err := c.CreateResource(ZwpTabletSeatV2Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
209- switch opcode {
210- case 0:
211- h.Destroy(self)
212- self.Destroy()
213- }
214- })
215- if err != nil {
216- return nil, err
217- }
218- self = WrapZwpTabletSeatV2(r)
219- r.Data = self
220- return self, nil
221-}
222-
223-// SendTabletAdded new device notification.
224-func (self *ZwpTabletSeatV2) SendTabletAdded(id *ZwpTabletV2) {
225- self.PostEvent(ZwpTabletSeatV2EventTabletAdded, server.NewID(resourceOf(id)))
226-}
227-
228-// SendToolAdded a new tool has been used with a tablet.
229-func (self *ZwpTabletSeatV2) SendToolAdded(id *ZwpTabletToolV2) {
230- self.PostEvent(ZwpTabletSeatV2EventToolAdded, server.NewID(resourceOf(id)))
231-}
232-
233-// SendPadAdded new pad notification.
234-func (self *ZwpTabletSeatV2) SendPadAdded(id *ZwpTabletPadV2) {
235- self.PostEvent(ZwpTabletSeatV2EventPadAdded, server.NewID(resourceOf(id)))
236-}
237-func NewZwpTabletSeatV2Global(d *server.Display, version int32, bind server.BindFunc) error {
238- return d.CreateGlobal(ZwpTabletSeatV2Interface, version, bind)
239-}
240-
241-// ZwpTabletToolV2 a physical tablet tool.
242-type ZwpTabletToolV2 struct{ *server.Resource }
243-
244-func WrapZwpTabletToolV2(r *server.Resource) *ZwpTabletToolV2 {
245- if r == nil {
246- return nil
247- }
248- return &ZwpTabletToolV2{r}
249-}
250-
251-const ZwpTabletToolV2RequestSetCursor uint32 = 0
252-const ZwpTabletToolV2RequestDestroy uint32 = 1
253-const ZwpTabletToolV2EventType uint32 = 0
254-const ZwpTabletToolV2EventHardwareSerial uint32 = 1
255-const ZwpTabletToolV2EventHardwareIdWacom uint32 = 2
256-const ZwpTabletToolV2EventCapability uint32 = 3
257-const ZwpTabletToolV2EventDone uint32 = 4
258-const ZwpTabletToolV2EventRemoved uint32 = 5
259-const ZwpTabletToolV2EventProximityIn uint32 = 6
260-const ZwpTabletToolV2EventProximityOut uint32 = 7
261-const ZwpTabletToolV2EventDown uint32 = 8
262-const ZwpTabletToolV2EventUp uint32 = 9
263-const ZwpTabletToolV2EventMotion uint32 = 10
264-const ZwpTabletToolV2EventPressure uint32 = 11
265-const ZwpTabletToolV2EventDistance uint32 = 12
266-const ZwpTabletToolV2EventTilt uint32 = 13
267-const ZwpTabletToolV2EventRotation uint32 = 14
268-const ZwpTabletToolV2EventSlider uint32 = 15
269-const ZwpTabletToolV2EventWheel uint32 = 16
270-const ZwpTabletToolV2EventButton uint32 = 17
271-const ZwpTabletToolV2EventFrame uint32 = 18
272-
273-// ZwpTabletToolV2Type a physical tool type.
274-type ZwpTabletToolV2Type uint32
275-
276-const (
277- ZwpTabletToolV2TypePen ZwpTabletToolV2Type = 0x140
278- ZwpTabletToolV2TypeEraser ZwpTabletToolV2Type = 0x141
279- ZwpTabletToolV2TypeBrush ZwpTabletToolV2Type = 0x142
280- ZwpTabletToolV2TypePencil ZwpTabletToolV2Type = 0x143
281- ZwpTabletToolV2TypeAirbrush ZwpTabletToolV2Type = 0x144
282- ZwpTabletToolV2TypeFinger ZwpTabletToolV2Type = 0x145
283- ZwpTabletToolV2TypeMouse ZwpTabletToolV2Type = 0x146
284- ZwpTabletToolV2TypeLens ZwpTabletToolV2Type = 0x147
285-)
286-
287-// ZwpTabletToolV2Capability capability flags for a tool.
288-type ZwpTabletToolV2Capability uint32
289-
290-const (
291- ZwpTabletToolV2CapabilityTilt ZwpTabletToolV2Capability = 1
292- ZwpTabletToolV2CapabilityPressure ZwpTabletToolV2Capability = 2
293- ZwpTabletToolV2CapabilityDistance ZwpTabletToolV2Capability = 3
294- ZwpTabletToolV2CapabilityRotation ZwpTabletToolV2Capability = 4
295- ZwpTabletToolV2CapabilitySlider ZwpTabletToolV2Capability = 5
296- ZwpTabletToolV2CapabilityWheel ZwpTabletToolV2Capability = 6
297-)
298-
299-// ZwpTabletToolV2ButtonState physical button state.
300-type ZwpTabletToolV2ButtonState uint32
301-
302-const (
303- ZwpTabletToolV2ButtonStateReleased ZwpTabletToolV2ButtonState = 0
304- ZwpTabletToolV2ButtonStatePressed ZwpTabletToolV2ButtonState = 1
305-)
306-
307-// ZwpTabletToolV2Error .
308-type ZwpTabletToolV2Error uint32
309-
310-const (
311- ZwpTabletToolV2ErrorRole ZwpTabletToolV2Error = 0
312-)
313-
314-// ZwpTabletToolV2Handler handles zwp_tablet_tool_v2 requests.
315-type ZwpTabletToolV2Handler interface {
316- SetCursor(self *ZwpTabletToolV2, serial uint32, surface *wayland.Surface, hotspotX int32, hotspotY int32)
317- Destroy(self *ZwpTabletToolV2)
318-}
319-
320-func NewZwpTabletToolV2(c server.Client, version int32, id uint32, h ZwpTabletToolV2Handler) (*ZwpTabletToolV2, error) {
321- if h == nil {
322- return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_tablet_tool_v2")
323- }
324- var self *ZwpTabletToolV2
325- r, err := c.CreateResource(ZwpTabletToolV2Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
326- switch opcode {
327- case 0:
328- h.SetCursor(self, args[0].Uint(), wayland.WrapSurface(args[1].Resource()), args[2].Int(), args[3].Int())
329- case 1:
330- h.Destroy(self)
331- self.Destroy()
332- }
333- })
334- if err != nil {
335- return nil, err
336- }
337- self = WrapZwpTabletToolV2(r)
338- r.Data = self
339- return self, nil
340-}
341-
342-// SendType tool type.
343-func (self *ZwpTabletToolV2) SendType(toolType uint32) {
344- self.PostEvent(ZwpTabletToolV2EventType, server.Uint(toolType))
345-}
346-
347-// SendHardwareSerial unique hardware serial number of the tool.
348-func (self *ZwpTabletToolV2) SendHardwareSerial(hardwareSerialHi uint32, hardwareSerialLo uint32) {
349- self.PostEvent(ZwpTabletToolV2EventHardwareSerial, server.Uint(hardwareSerialHi), server.Uint(hardwareSerialLo))
350-}
351-
352-// SendHardwareIdWacom hardware id notification in Wacom's format.
353-func (self *ZwpTabletToolV2) SendHardwareIdWacom(hardwareIdHi uint32, hardwareIdLo uint32) {
354- self.PostEvent(ZwpTabletToolV2EventHardwareIdWacom, server.Uint(hardwareIdHi), server.Uint(hardwareIdLo))
355-}
356-
357-// SendCapability tool capability notification.
358-func (self *ZwpTabletToolV2) SendCapability(capability uint32) {
359- self.PostEvent(ZwpTabletToolV2EventCapability, server.Uint(capability))
360-}
361-
362-// SendDone tool description events sequence complete.
363-func (self *ZwpTabletToolV2) SendDone() {
364- self.PostEvent(ZwpTabletToolV2EventDone)
365-}
366-
367-// SendRemoved tool removed.
368-func (self *ZwpTabletToolV2) SendRemoved() {
369- self.PostEvent(ZwpTabletToolV2EventRemoved)
370-}
371-
372-// SendProximityIn proximity in event.
373-func (self *ZwpTabletToolV2) SendProximityIn(serial uint32, tablet *ZwpTabletV2, surface *wayland.Surface) {
374- self.PostEvent(ZwpTabletToolV2EventProximityIn, server.Uint(serial), server.Object(resourceOf(tablet)), server.Object(resourceOf(surface)))
375-}
376-
377-// SendProximityOut proximity out event.
378-func (self *ZwpTabletToolV2) SendProximityOut() {
379- self.PostEvent(ZwpTabletToolV2EventProximityOut)
380-}
381-
382-// SendDown tablet tool is making contact.
383-func (self *ZwpTabletToolV2) SendDown(serial uint32) {
384- self.PostEvent(ZwpTabletToolV2EventDown, server.Uint(serial))
385-}
386-
387-// SendUp tablet tool is no longer making contact.
388-func (self *ZwpTabletToolV2) SendUp() {
389- self.PostEvent(ZwpTabletToolV2EventUp)
390-}
391-
392-// SendMotion motion event.
393-func (self *ZwpTabletToolV2) SendMotion(x server.Fixed, y server.Fixed) {
394- self.PostEvent(ZwpTabletToolV2EventMotion, server.FixedArg(x), server.FixedArg(y))
395-}
396-
397-// SendPressure pressure change event.
398-func (self *ZwpTabletToolV2) SendPressure(pressure uint32) {
399- self.PostEvent(ZwpTabletToolV2EventPressure, server.Uint(pressure))
400-}
401-
402-// SendDistance distance change event.
403-func (self *ZwpTabletToolV2) SendDistance(distance uint32) {
404- self.PostEvent(ZwpTabletToolV2EventDistance, server.Uint(distance))
405-}
406-
407-// SendTilt tilt change event.
408-func (self *ZwpTabletToolV2) SendTilt(tiltX server.Fixed, tiltY server.Fixed) {
409- self.PostEvent(ZwpTabletToolV2EventTilt, server.FixedArg(tiltX), server.FixedArg(tiltY))
410-}
411-
412-// SendRotation z-rotation change event.
413-func (self *ZwpTabletToolV2) SendRotation(degrees server.Fixed) {
414- self.PostEvent(ZwpTabletToolV2EventRotation, server.FixedArg(degrees))
415-}
416-
417-// SendSlider Slider position change event.
418-func (self *ZwpTabletToolV2) SendSlider(position int32) {
419- self.PostEvent(ZwpTabletToolV2EventSlider, server.Int(position))
420-}
421-
422-// SendWheel Wheel delta event.
423-func (self *ZwpTabletToolV2) SendWheel(degrees server.Fixed, clicks int32) {
424- self.PostEvent(ZwpTabletToolV2EventWheel, server.FixedArg(degrees), server.Int(clicks))
425-}
426-
427-// SendButton button event.
428-func (self *ZwpTabletToolV2) SendButton(serial uint32, button uint32, state uint32) {
429- self.PostEvent(ZwpTabletToolV2EventButton, server.Uint(serial), server.Uint(button), server.Uint(state))
430-}
431-
432-// SendFrame frame event.
433-func (self *ZwpTabletToolV2) SendFrame(time uint32) {
434- self.PostEvent(ZwpTabletToolV2EventFrame, server.Uint(time))
435-}
436-func NewZwpTabletToolV2Global(d *server.Display, version int32, bind server.BindFunc) error {
437- return d.CreateGlobal(ZwpTabletToolV2Interface, version, bind)
438-}
439-
440-// ZwpTabletV2 graphics tablet device.
441-type ZwpTabletV2 struct{ *server.Resource }
442-
443-func WrapZwpTabletV2(r *server.Resource) *ZwpTabletV2 {
444- if r == nil {
445- return nil
446- }
447- return &ZwpTabletV2{r}
448-}
449-
450-const ZwpTabletV2RequestDestroy uint32 = 0
451-const ZwpTabletV2EventName uint32 = 0
452-const ZwpTabletV2EventId uint32 = 1
453-const ZwpTabletV2EventPath uint32 = 2
454-const ZwpTabletV2EventDone uint32 = 3
455-const ZwpTabletV2EventRemoved uint32 = 4
456-const ZwpTabletV2EventBustype uint32 = 5
457-
458-// ZwpTabletV2Bustype bus type .
459-type ZwpTabletV2Bustype uint32
460-
461-const (
462- ZwpTabletV2BustypeUsb ZwpTabletV2Bustype = 3
463- ZwpTabletV2BustypeBluetooth ZwpTabletV2Bustype = 5
464- ZwpTabletV2BustypeVirtual ZwpTabletV2Bustype = 6
465- ZwpTabletV2BustypeSerial ZwpTabletV2Bustype = 17
466- ZwpTabletV2BustypeI2c ZwpTabletV2Bustype = 24
467-)
468-
469-// ZwpTabletV2Handler handles zwp_tablet_v2 requests.
470-type ZwpTabletV2Handler interface {
471- Destroy(self *ZwpTabletV2)
472-}
473-
474-func NewZwpTabletV2(c server.Client, version int32, id uint32, h ZwpTabletV2Handler) (*ZwpTabletV2, error) {
475- if h == nil {
476- return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_tablet_v2")
477- }
478- var self *ZwpTabletV2
479- r, err := c.CreateResource(ZwpTabletV2Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
480- switch opcode {
481- case 0:
482- h.Destroy(self)
483- self.Destroy()
484- }
485- })
486- if err != nil {
487- return nil, err
488- }
489- self = WrapZwpTabletV2(r)
490- r.Data = self
491- return self, nil
492-}
493-
494-// SendName tablet device name.
495-func (self *ZwpTabletV2) SendName(name string) {
496- var p runtime.Pinner
497- defer p.Unpin()
498- self.PostEvent(ZwpTabletV2EventName, server.String(&p, name, false))
499-}
500-
501-// SendId tablet device vendor/product id.
502-func (self *ZwpTabletV2) SendId(vid uint32, pid uint32) {
503- self.PostEvent(ZwpTabletV2EventId, server.Uint(vid), server.Uint(pid))
504-}
505-
506-// SendPath path to the device.
507-func (self *ZwpTabletV2) SendPath(path string) {
508- var p runtime.Pinner
509- defer p.Unpin()
510- self.PostEvent(ZwpTabletV2EventPath, server.String(&p, path, false))
511-}
512-
513-// SendDone tablet description events sequence complete.
514-func (self *ZwpTabletV2) SendDone() {
515- self.PostEvent(ZwpTabletV2EventDone)
516-}
517-
518-// SendRemoved tablet removed event.
519-func (self *ZwpTabletV2) SendRemoved() {
520- self.PostEvent(ZwpTabletV2EventRemoved)
521-}
522-
523-// SendBustype tablet device bus type (since version 2).
524-func (self *ZwpTabletV2) SendBustype(bustype uint32) {
525- self.PostEvent(ZwpTabletV2EventBustype, server.Uint(bustype))
526-}
527-func NewZwpTabletV2Global(d *server.Display, version int32, bind server.BindFunc) error {
528- return d.CreateGlobal(ZwpTabletV2Interface, version, bind)
529-}
530-
531-// ZwpTabletPadRingV2 pad ring.
532-type ZwpTabletPadRingV2 struct{ *server.Resource }
533-
534-func WrapZwpTabletPadRingV2(r *server.Resource) *ZwpTabletPadRingV2 {
535- if r == nil {
536- return nil
537- }
538- return &ZwpTabletPadRingV2{r}
539-}
540-
541-const ZwpTabletPadRingV2RequestSetFeedback uint32 = 0
542-const ZwpTabletPadRingV2RequestDestroy uint32 = 1
543-const ZwpTabletPadRingV2EventSource uint32 = 0
544-const ZwpTabletPadRingV2EventAngle uint32 = 1
545-const ZwpTabletPadRingV2EventStop uint32 = 2
546-const ZwpTabletPadRingV2EventFrame uint32 = 3
547-
548-// ZwpTabletPadRingV2Source ring axis source.
549-type ZwpTabletPadRingV2Source uint32
550-
551-const (
552- ZwpTabletPadRingV2SourceFinger ZwpTabletPadRingV2Source = 1
553-)
554-
555-// ZwpTabletPadRingV2Handler handles zwp_tablet_pad_ring_v2 requests.
556-type ZwpTabletPadRingV2Handler interface {
557- SetFeedback(self *ZwpTabletPadRingV2, description string, serial uint32)
558- Destroy(self *ZwpTabletPadRingV2)
559-}
560-
561-func NewZwpTabletPadRingV2(c server.Client, version int32, id uint32, h ZwpTabletPadRingV2Handler) (*ZwpTabletPadRingV2, error) {
562- if h == nil {
563- return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_tablet_pad_ring_v2")
564- }
565- var self *ZwpTabletPadRingV2
566- r, err := c.CreateResource(ZwpTabletPadRingV2Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
567- switch opcode {
568- case 0:
569- h.SetFeedback(self, args[0].String(), args[1].Uint())
570- case 1:
571- h.Destroy(self)
572- self.Destroy()
573- }
574- })
575- if err != nil {
576- return nil, err
577- }
578- self = WrapZwpTabletPadRingV2(r)
579- r.Data = self
580- return self, nil
581-}
582-
583-// SendSource ring event source.
584-func (self *ZwpTabletPadRingV2) SendSource(source uint32) {
585- self.PostEvent(ZwpTabletPadRingV2EventSource, server.Uint(source))
586-}
587-
588-// SendAngle angle changed.
589-func (self *ZwpTabletPadRingV2) SendAngle(degrees server.Fixed) {
590- self.PostEvent(ZwpTabletPadRingV2EventAngle, server.FixedArg(degrees))
591-}
592-
593-// SendStop interaction stopped.
594-func (self *ZwpTabletPadRingV2) SendStop() {
595- self.PostEvent(ZwpTabletPadRingV2EventStop)
596-}
597-
598-// SendFrame end of a ring event sequence.
599-func (self *ZwpTabletPadRingV2) SendFrame(time uint32) {
600- self.PostEvent(ZwpTabletPadRingV2EventFrame, server.Uint(time))
601-}
602-func NewZwpTabletPadRingV2Global(d *server.Display, version int32, bind server.BindFunc) error {
603- return d.CreateGlobal(ZwpTabletPadRingV2Interface, version, bind)
604-}
605-
606-// ZwpTabletPadStripV2 pad strip.
607-type ZwpTabletPadStripV2 struct{ *server.Resource }
608-
609-func WrapZwpTabletPadStripV2(r *server.Resource) *ZwpTabletPadStripV2 {
610- if r == nil {
611- return nil
612- }
613- return &ZwpTabletPadStripV2{r}
614-}
615-
616-const ZwpTabletPadStripV2RequestSetFeedback uint32 = 0
617-const ZwpTabletPadStripV2RequestDestroy uint32 = 1
618-const ZwpTabletPadStripV2EventSource uint32 = 0
619-const ZwpTabletPadStripV2EventPosition uint32 = 1
620-const ZwpTabletPadStripV2EventStop uint32 = 2
621-const ZwpTabletPadStripV2EventFrame uint32 = 3
622-
623-// ZwpTabletPadStripV2Source strip axis source.
624-type ZwpTabletPadStripV2Source uint32
625-
626-const (
627- ZwpTabletPadStripV2SourceFinger ZwpTabletPadStripV2Source = 1
628-)
629-
630-// ZwpTabletPadStripV2Handler handles zwp_tablet_pad_strip_v2 requests.
631-type ZwpTabletPadStripV2Handler interface {
632- SetFeedback(self *ZwpTabletPadStripV2, description string, serial uint32)
633- Destroy(self *ZwpTabletPadStripV2)
634-}
635-
636-func NewZwpTabletPadStripV2(c server.Client, version int32, id uint32, h ZwpTabletPadStripV2Handler) (*ZwpTabletPadStripV2, error) {
637- if h == nil {
638- return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_tablet_pad_strip_v2")
639- }
640- var self *ZwpTabletPadStripV2
641- r, err := c.CreateResource(ZwpTabletPadStripV2Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
642- switch opcode {
643- case 0:
644- h.SetFeedback(self, args[0].String(), args[1].Uint())
645- case 1:
646- h.Destroy(self)
647- self.Destroy()
648- }
649- })
650- if err != nil {
651- return nil, err
652- }
653- self = WrapZwpTabletPadStripV2(r)
654- r.Data = self
655- return self, nil
656-}
657-
658-// SendSource strip event source.
659-func (self *ZwpTabletPadStripV2) SendSource(source uint32) {
660- self.PostEvent(ZwpTabletPadStripV2EventSource, server.Uint(source))
661-}
662-
663-// SendPosition position changed.
664-func (self *ZwpTabletPadStripV2) SendPosition(position uint32) {
665- self.PostEvent(ZwpTabletPadStripV2EventPosition, server.Uint(position))
666-}
667-
668-// SendStop interaction stopped.
669-func (self *ZwpTabletPadStripV2) SendStop() {
670- self.PostEvent(ZwpTabletPadStripV2EventStop)
671-}
672-
673-// SendFrame end of a strip event sequence.
674-func (self *ZwpTabletPadStripV2) SendFrame(time uint32) {
675- self.PostEvent(ZwpTabletPadStripV2EventFrame, server.Uint(time))
676-}
677-func NewZwpTabletPadStripV2Global(d *server.Display, version int32, bind server.BindFunc) error {
678- return d.CreateGlobal(ZwpTabletPadStripV2Interface, version, bind)
679-}
680-
681-// ZwpTabletPadGroupV2 a set of buttons, rings and strips.
682-type ZwpTabletPadGroupV2 struct{ *server.Resource }
683-
684-func WrapZwpTabletPadGroupV2(r *server.Resource) *ZwpTabletPadGroupV2 {
685- if r == nil {
686- return nil
687- }
688- return &ZwpTabletPadGroupV2{r}
689-}
690-
691-const ZwpTabletPadGroupV2RequestDestroy uint32 = 0
692-const ZwpTabletPadGroupV2EventButtons uint32 = 0
693-const ZwpTabletPadGroupV2EventRing uint32 = 1
694-const ZwpTabletPadGroupV2EventStrip uint32 = 2
695-const ZwpTabletPadGroupV2EventModes uint32 = 3
696-const ZwpTabletPadGroupV2EventDone uint32 = 4
697-const ZwpTabletPadGroupV2EventModeSwitch uint32 = 5
698-const ZwpTabletPadGroupV2EventDial uint32 = 6
699-
700-// ZwpTabletPadGroupV2Handler handles zwp_tablet_pad_group_v2 requests.
701-type ZwpTabletPadGroupV2Handler interface {
702- Destroy(self *ZwpTabletPadGroupV2)
703-}
704-
705-func NewZwpTabletPadGroupV2(c server.Client, version int32, id uint32, h ZwpTabletPadGroupV2Handler) (*ZwpTabletPadGroupV2, error) {
706- if h == nil {
707- return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_tablet_pad_group_v2")
708- }
709- var self *ZwpTabletPadGroupV2
710- r, err := c.CreateResource(ZwpTabletPadGroupV2Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
711- switch opcode {
712- case 0:
713- h.Destroy(self)
714- self.Destroy()
715- }
716- })
717- if err != nil {
718- return nil, err
719- }
720- self = WrapZwpTabletPadGroupV2(r)
721- r.Data = self
722- return self, nil
723-}
724-
725-// SendButtons buttons announced.
726-func (self *ZwpTabletPadGroupV2) SendButtons(buttons []byte) {
727- var p runtime.Pinner
728- defer p.Unpin()
729- self.PostEvent(ZwpTabletPadGroupV2EventButtons, server.Array(&p, buttons))
730-}
731-
732-// SendRing ring announced.
733-func (self *ZwpTabletPadGroupV2) SendRing(ring *ZwpTabletPadRingV2) {
734- self.PostEvent(ZwpTabletPadGroupV2EventRing, server.NewID(resourceOf(ring)))
735-}
736-
737-// SendStrip strip announced.
738-func (self *ZwpTabletPadGroupV2) SendStrip(strip *ZwpTabletPadStripV2) {
739- self.PostEvent(ZwpTabletPadGroupV2EventStrip, server.NewID(resourceOf(strip)))
740-}
741-
742-// SendModes mode-switch ability announced.
743-func (self *ZwpTabletPadGroupV2) SendModes(modes uint32) {
744- self.PostEvent(ZwpTabletPadGroupV2EventModes, server.Uint(modes))
745-}
746-
747-// SendDone tablet group description events sequence complete.
748-func (self *ZwpTabletPadGroupV2) SendDone() {
749- self.PostEvent(ZwpTabletPadGroupV2EventDone)
750-}
751-
752-// SendModeSwitch mode switch event.
753-func (self *ZwpTabletPadGroupV2) SendModeSwitch(time uint32, serial uint32, mode uint32) {
754- self.PostEvent(ZwpTabletPadGroupV2EventModeSwitch, server.Uint(time), server.Uint(serial), server.Uint(mode))
755-}
756-
757-// SendDial dial announced (since version 2).
758-func (self *ZwpTabletPadGroupV2) SendDial(dial *ZwpTabletPadDialV2) {
759- self.PostEvent(ZwpTabletPadGroupV2EventDial, server.NewID(resourceOf(dial)))
760-}
761-func NewZwpTabletPadGroupV2Global(d *server.Display, version int32, bind server.BindFunc) error {
762- return d.CreateGlobal(ZwpTabletPadGroupV2Interface, version, bind)
763-}
764-
765-// ZwpTabletPadV2 a set of buttons, rings, strips and dials.
766-type ZwpTabletPadV2 struct{ *server.Resource }
767-
768-func WrapZwpTabletPadV2(r *server.Resource) *ZwpTabletPadV2 {
769- if r == nil {
770- return nil
771- }
772- return &ZwpTabletPadV2{r}
773-}
774-
775-const ZwpTabletPadV2RequestSetFeedback uint32 = 0
776-const ZwpTabletPadV2RequestDestroy uint32 = 1
777-const ZwpTabletPadV2EventGroup uint32 = 0
778-const ZwpTabletPadV2EventPath uint32 = 1
779-const ZwpTabletPadV2EventButtons uint32 = 2
780-const ZwpTabletPadV2EventDone uint32 = 3
781-const ZwpTabletPadV2EventButton uint32 = 4
782-const ZwpTabletPadV2EventEnter uint32 = 5
783-const ZwpTabletPadV2EventLeave uint32 = 6
784-const ZwpTabletPadV2EventRemoved uint32 = 7
785-
786-// ZwpTabletPadV2ButtonState physical button state.
787-type ZwpTabletPadV2ButtonState uint32
788-
789-const (
790- ZwpTabletPadV2ButtonStateReleased ZwpTabletPadV2ButtonState = 0
791- ZwpTabletPadV2ButtonStatePressed ZwpTabletPadV2ButtonState = 1
792-)
793-
794-// ZwpTabletPadV2Handler handles zwp_tablet_pad_v2 requests.
795-type ZwpTabletPadV2Handler interface {
796- SetFeedback(self *ZwpTabletPadV2, button uint32, description string, serial uint32)
797- Destroy(self *ZwpTabletPadV2)
798-}
799-
800-func NewZwpTabletPadV2(c server.Client, version int32, id uint32, h ZwpTabletPadV2Handler) (*ZwpTabletPadV2, error) {
801- if h == nil {
802- return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_tablet_pad_v2")
803- }
804- var self *ZwpTabletPadV2
805- r, err := c.CreateResource(ZwpTabletPadV2Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
806- switch opcode {
807- case 0:
808- h.SetFeedback(self, args[0].Uint(), args[1].String(), args[2].Uint())
809- case 1:
810- h.Destroy(self)
811- self.Destroy()
812- }
813- })
814- if err != nil {
815- return nil, err
816- }
817- self = WrapZwpTabletPadV2(r)
818- r.Data = self
819- return self, nil
820-}
821-
822-// SendGroup group announced.
823-func (self *ZwpTabletPadV2) SendGroup(padGroup *ZwpTabletPadGroupV2) {
824- self.PostEvent(ZwpTabletPadV2EventGroup, server.NewID(resourceOf(padGroup)))
825-}
826-
827-// SendPath path to the device.
828-func (self *ZwpTabletPadV2) SendPath(path string) {
829- var p runtime.Pinner
830- defer p.Unpin()
831- self.PostEvent(ZwpTabletPadV2EventPath, server.String(&p, path, false))
832-}
833-
834-// SendButtons buttons announced.
835-func (self *ZwpTabletPadV2) SendButtons(buttons uint32) {
836- self.PostEvent(ZwpTabletPadV2EventButtons, server.Uint(buttons))
837-}
838-
839-// SendDone pad description event sequence complete.
840-func (self *ZwpTabletPadV2) SendDone() {
841- self.PostEvent(ZwpTabletPadV2EventDone)
842-}
843-
844-// SendButton physical button state.
845-func (self *ZwpTabletPadV2) SendButton(time uint32, button uint32, state uint32) {
846- self.PostEvent(ZwpTabletPadV2EventButton, server.Uint(time), server.Uint(button), server.Uint(state))
847-}
848-
849-// SendEnter enter event.
850-func (self *ZwpTabletPadV2) SendEnter(serial uint32, tablet *ZwpTabletV2, surface *wayland.Surface) {
851- self.PostEvent(ZwpTabletPadV2EventEnter, server.Uint(serial), server.Object(resourceOf(tablet)), server.Object(resourceOf(surface)))
852-}
853-
854-// SendLeave leave event.
855-func (self *ZwpTabletPadV2) SendLeave(serial uint32, surface *wayland.Surface) {
856- self.PostEvent(ZwpTabletPadV2EventLeave, server.Uint(serial), server.Object(resourceOf(surface)))
857-}
858-
859-// SendRemoved pad removed event.
860-func (self *ZwpTabletPadV2) SendRemoved() {
861- self.PostEvent(ZwpTabletPadV2EventRemoved)
862-}
863-func NewZwpTabletPadV2Global(d *server.Display, version int32, bind server.BindFunc) error {
864- return d.CreateGlobal(ZwpTabletPadV2Interface, version, bind)
865-}
866-
867-// ZwpTabletPadDialV2 pad dial.
868-type ZwpTabletPadDialV2 struct{ *server.Resource }
869-
870-func WrapZwpTabletPadDialV2(r *server.Resource) *ZwpTabletPadDialV2 {
871- if r == nil {
872- return nil
873- }
874- return &ZwpTabletPadDialV2{r}
875-}
876-
877-const ZwpTabletPadDialV2RequestSetFeedback uint32 = 0
878-const ZwpTabletPadDialV2RequestDestroy uint32 = 1
879-const ZwpTabletPadDialV2EventDelta uint32 = 0
880-const ZwpTabletPadDialV2EventFrame uint32 = 1
881-
882-// ZwpTabletPadDialV2Handler handles zwp_tablet_pad_dial_v2 requests.
883-type ZwpTabletPadDialV2Handler interface {
884- SetFeedback(self *ZwpTabletPadDialV2, description string, serial uint32)
885- Destroy(self *ZwpTabletPadDialV2)
886-}
887-
888-func NewZwpTabletPadDialV2(c server.Client, version int32, id uint32, h ZwpTabletPadDialV2Handler) (*ZwpTabletPadDialV2, error) {
889- if h == nil {
890- return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_tablet_pad_dial_v2")
891- }
892- var self *ZwpTabletPadDialV2
893- r, err := c.CreateResource(ZwpTabletPadDialV2Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
894- switch opcode {
895- case 0:
896- h.SetFeedback(self, args[0].String(), args[1].Uint())
897- case 1:
898- h.Destroy(self)
899- self.Destroy()
900- }
901- })
902- if err != nil {
903- return nil, err
904- }
905- self = WrapZwpTabletPadDialV2(r)
906- r.Data = self
907- return self, nil
908-}
909-
910-// SendDelta delta movement.
911-func (self *ZwpTabletPadDialV2) SendDelta(value120 int32) {
912- self.PostEvent(ZwpTabletPadDialV2EventDelta, server.Int(value120))
913-}
914-
915-// SendFrame end of a dial event sequence.
916-func (self *ZwpTabletPadDialV2) SendFrame(time uint32) {
917- self.PostEvent(ZwpTabletPadDialV2EventFrame, server.Uint(time))
918-}
919-func NewZwpTabletPadDialV2Global(d *server.Display, version int32, bind server.BindFunc) error {
920- return d.CreateGlobal(ZwpTabletPadDialV2Interface, version, bind)
921-}
922-func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
923- if v == nil {
924- return nil
925- }
926- return v.GetResource()
927-}
928-func (self *ZwpTabletManagerV2) GetResource() *server.Resource {
929- if self == nil {
930- return nil
931- }
932- return self.Resource
933-}
934-func (self *ZwpTabletSeatV2) GetResource() *server.Resource {
935- if self == nil {
936- return nil
937- }
938- return self.Resource
939-}
940-func (self *ZwpTabletToolV2) GetResource() *server.Resource {
941- if self == nil {
942- return nil
943- }
944- return self.Resource
945-}
946-func (self *ZwpTabletV2) GetResource() *server.Resource {
947- if self == nil {
948- return nil
949- }
950- return self.Resource
951-}
952-func (self *ZwpTabletPadRingV2) GetResource() *server.Resource {
953- if self == nil {
954- return nil
955- }
956- return self.Resource
957-}
958-func (self *ZwpTabletPadStripV2) GetResource() *server.Resource {
959- if self == nil {
960- return nil
961- }
962- return self.Resource
963-}
964-func (self *ZwpTabletPadGroupV2) GetResource() *server.Resource {
965- if self == nil {
966- return nil
967- }
968- return self.Resource
969-}
970-func (self *ZwpTabletPadV2) GetResource() *server.Resource {
971- if self == nil {
972- return nil
973- }
974- return self.Resource
975-}
976-func (self *ZwpTabletPadDialV2) GetResource() *server.Resource {
977- if self == nil {
978- return nil
979- }
980- return self.Resource
981-}
D protocol/tearingcontrol/tearingcontrol.go +0 -150
@@ -1,150 +0,0 @@
1-// Code generated by wlgen; DO NOT EDIT.
2-package tearingcontrol
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 WpTearingControlManagerV1Interface *server.Interface
11-var WpTearingControlV1Interface *server.Interface
12-
13-func init() {
14- WpTearingControlManagerV1Interface = &server.Interface{Name: "wp_tearing_control_manager_v1", Version: 1}
15- WpTearingControlV1Interface = &server.Interface{Name: "wp_tearing_control_v1", Version: 1}
16- WpTearingControlManagerV1Interface.Requests = []server.Message{
17- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
18- {Name: "get_tearing_control", Signature: "no", Types: []*server.Interface{WpTearingControlV1Interface, wayland.SurfaceInterface}},
19- }
20- WpTearingControlManagerV1Interface.Events = []server.Message{}
21- WpTearingControlV1Interface.Requests = []server.Message{
22- {Name: "set_presentation_hint", Signature: "u", Types: []*server.Interface{nil}},
23- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
24- }
25- WpTearingControlV1Interface.Events = []server.Message{}
26- if err := server.NewInterfaces(WpTearingControlManagerV1Interface, WpTearingControlV1Interface); err != nil {
27- panic(err)
28- }
29-}
30-
31-// WpTearingControlManagerV1 protocol for tearing control.
32-type WpTearingControlManagerV1 struct{ *server.Resource }
33-
34-func WrapWpTearingControlManagerV1(r *server.Resource) *WpTearingControlManagerV1 {
35- if r == nil {
36- return nil
37- }
38- return &WpTearingControlManagerV1{r}
39-}
40-
41-const WpTearingControlManagerV1RequestDestroy uint32 = 0
42-const WpTearingControlManagerV1RequestGetTearingControl uint32 = 1
43-
44-// WpTearingControlManagerV1Error .
45-type WpTearingControlManagerV1Error uint32
46-
47-const (
48- WpTearingControlManagerV1ErrorTearingControlExists WpTearingControlManagerV1Error = 0
49-)
50-
51-// WpTearingControlManagerV1Handler handles wp_tearing_control_manager_v1 requests.
52-type WpTearingControlManagerV1Handler interface {
53- Destroy(self *WpTearingControlManagerV1)
54- GetTearingControl(self *WpTearingControlManagerV1, id uint32, surface *wayland.Surface)
55-}
56-
57-func NewWpTearingControlManagerV1(c server.Client, version int32, id uint32, h WpTearingControlManagerV1Handler) (*WpTearingControlManagerV1, error) {
58- if h == nil {
59- return nil, fmt.Errorf("purego-libwayland: nil handler for wp_tearing_control_manager_v1")
60- }
61- var self *WpTearingControlManagerV1
62- r, err := c.CreateResource(WpTearingControlManagerV1Interface, 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.GetTearingControl(self, args[0].NewID(), wayland.WrapSurface(args[1].Resource()))
69- }
70- })
71- if err != nil {
72- return nil, err
73- }
74- self = WrapWpTearingControlManagerV1(r)
75- r.Data = self
76- return self, nil
77-}
78-func NewWpTearingControlManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
79- return d.CreateGlobal(WpTearingControlManagerV1Interface, version, bind)
80-}
81-
82-// WpTearingControlV1 per-surface tearing control interface.
83-type WpTearingControlV1 struct{ *server.Resource }
84-
85-func WrapWpTearingControlV1(r *server.Resource) *WpTearingControlV1 {
86- if r == nil {
87- return nil
88- }
89- return &WpTearingControlV1{r}
90-}
91-
92-const WpTearingControlV1RequestSetPresentationHint uint32 = 0
93-const WpTearingControlV1RequestDestroy uint32 = 1
94-
95-// WpTearingControlV1PresentationHint presentation hint values.
96-type WpTearingControlV1PresentationHint uint32
97-
98-const (
99- WpTearingControlV1PresentationHintVsync WpTearingControlV1PresentationHint = 0
100- WpTearingControlV1PresentationHintAsync WpTearingControlV1PresentationHint = 1
101-)
102-
103-// WpTearingControlV1Handler handles wp_tearing_control_v1 requests.
104-type WpTearingControlV1Handler interface {
105- SetPresentationHint(self *WpTearingControlV1, hint uint32)
106- Destroy(self *WpTearingControlV1)
107-}
108-
109-func NewWpTearingControlV1(c server.Client, version int32, id uint32, h WpTearingControlV1Handler) (*WpTearingControlV1, error) {
110- if h == nil {
111- return nil, fmt.Errorf("purego-libwayland: nil handler for wp_tearing_control_v1")
112- }
113- var self *WpTearingControlV1
114- r, err := c.CreateResource(WpTearingControlV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
115- switch opcode {
116- case 0:
117- h.SetPresentationHint(self, args[0].Uint())
118- case 1:
119- h.Destroy(self)
120- self.Destroy()
121- }
122- })
123- if err != nil {
124- return nil, err
125- }
126- self = WrapWpTearingControlV1(r)
127- r.Data = self
128- return self, nil
129-}
130-func NewWpTearingControlV1Global(d *server.Display, version int32, bind server.BindFunc) error {
131- return d.CreateGlobal(WpTearingControlV1Interface, 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 *WpTearingControlManagerV1) GetResource() *server.Resource {
140- if self == nil {
141- return nil
142- }
143- return self.Resource
144-}
145-func (self *WpTearingControlV1) GetResource() *server.Resource {
146- if self == nil {
147- return nil
148- }
149- return self.Resource
150-}
D protocol/textinput/textinput.go +0 -327
@@ -1,327 +0,0 @@
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-}
D protocol/viewporter/viewporter.go +0 -157
@@ -1,157 +0,0 @@
1-// Code generated by wlgen; DO NOT EDIT.
2-package viewporter
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 WpViewporterInterface *server.Interface
11-var WpViewportInterface *server.Interface
12-
13-func init() {
14- WpViewporterInterface = &server.Interface{Name: "wp_viewporter", Version: 1}
15- WpViewportInterface = &server.Interface{Name: "wp_viewport", Version: 1}
16- WpViewporterInterface.Requests = []server.Message{
17- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
18- {Name: "get_viewport", Signature: "no", Types: []*server.Interface{WpViewportInterface, wayland.SurfaceInterface}},
19- }
20- WpViewporterInterface.Events = []server.Message{}
21- WpViewportInterface.Requests = []server.Message{
22- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
23- {Name: "set_source", Signature: "ffff", Types: []*server.Interface{nil, nil, nil, nil}},
24- {Name: "set_destination", Signature: "ii", Types: []*server.Interface{nil, nil}},
25- }
26- WpViewportInterface.Events = []server.Message{}
27- if err := server.NewInterfaces(WpViewporterInterface, WpViewportInterface); err != nil {
28- panic(err)
29- }
30-}
31-
32-// WpViewporter surface cropping and scaling.
33-type WpViewporter struct{ *server.Resource }
34-
35-func WrapWpViewporter(r *server.Resource) *WpViewporter {
36- if r == nil {
37- return nil
38- }
39- return &WpViewporter{r}
40-}
41-
42-const WpViewporterRequestDestroy uint32 = 0
43-const WpViewporterRequestGetViewport uint32 = 1
44-
45-// WpViewporterError .
46-type WpViewporterError uint32
47-
48-const (
49- WpViewporterErrorViewportExists WpViewporterError = 0
50-)
51-
52-// WpViewporterHandler handles wp_viewporter requests.
53-type WpViewporterHandler interface {
54- Destroy(self *WpViewporter)
55- GetViewport(self *WpViewporter, id uint32, surface *wayland.Surface)
56-}
57-
58-func NewWpViewporter(c server.Client, version int32, id uint32, h WpViewporterHandler) (*WpViewporter, error) {
59- if h == nil {
60- return nil, fmt.Errorf("purego-libwayland: nil handler for wp_viewporter")
61- }
62- var self *WpViewporter
63- r, err := c.CreateResource(WpViewporterInterface, 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.GetViewport(self, args[0].NewID(), wayland.WrapSurface(args[1].Resource()))
70- }
71- })
72- if err != nil {
73- return nil, err
74- }
75- self = WrapWpViewporter(r)
76- r.Data = self
77- return self, nil
78-}
79-func NewWpViewporterGlobal(d *server.Display, version int32, bind server.BindFunc) error {
80- return d.CreateGlobal(WpViewporterInterface, version, bind)
81-}
82-
83-// WpViewport crop and scale interface to a wl_surface.
84-type WpViewport struct{ *server.Resource }
85-
86-func WrapWpViewport(r *server.Resource) *WpViewport {
87- if r == nil {
88- return nil
89- }
90- return &WpViewport{r}
91-}
92-
93-const WpViewportRequestDestroy uint32 = 0
94-const WpViewportRequestSetSource uint32 = 1
95-const WpViewportRequestSetDestination uint32 = 2
96-
97-// WpViewportError .
98-type WpViewportError uint32
99-
100-const (
101- WpViewportErrorBadValue WpViewportError = 0
102- WpViewportErrorBadSize WpViewportError = 1
103- WpViewportErrorOutOfBuffer WpViewportError = 2
104- WpViewportErrorNoSurface WpViewportError = 3
105-)
106-
107-// WpViewportHandler handles wp_viewport requests.
108-type WpViewportHandler interface {
109- Destroy(self *WpViewport)
110- SetSource(self *WpViewport, x server.Fixed, y server.Fixed, width server.Fixed, height server.Fixed)
111- SetDestination(self *WpViewport, width int32, height int32)
112-}
113-
114-func NewWpViewport(c server.Client, version int32, id uint32, h WpViewportHandler) (*WpViewport, error) {
115- if h == nil {
116- return nil, fmt.Errorf("purego-libwayland: nil handler for wp_viewport")
117- }
118- var self *WpViewport
119- r, err := c.CreateResource(WpViewportInterface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
120- switch opcode {
121- case 0:
122- h.Destroy(self)
123- self.Destroy()
124- case 1:
125- h.SetSource(self, args[0].Fixed(), args[1].Fixed(), args[2].Fixed(), args[3].Fixed())
126- case 2:
127- h.SetDestination(self, args[0].Int(), args[1].Int())
128- }
129- })
130- if err != nil {
131- return nil, err
132- }
133- self = WrapWpViewport(r)
134- r.Data = self
135- return self, nil
136-}
137-func NewWpViewportGlobal(d *server.Display, version int32, bind server.BindFunc) error {
138- return d.CreateGlobal(WpViewportInterface, 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 *WpViewporter) GetResource() *server.Resource {
147- if self == nil {
148- return nil
149- }
150- return self.Resource
151-}
152-func (self *WpViewport) GetResource() *server.Resource {
153- if self == nil {
154- return nil
155- }
156- return self.Resource
157-}
D protocol/virtualkeyboard/virtualkeyboard.go +0 -153
@@ -1,153 +0,0 @@
1-// Code generated by wlgen; DO NOT EDIT.
2-package virtualkeyboard
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 ZwpVirtualKeyboardV1Interface *server.Interface
11-var ZwpVirtualKeyboardManagerV1Interface *server.Interface
12-
13-func init() {
14- ZwpVirtualKeyboardV1Interface = &server.Interface{Name: "zwp_virtual_keyboard_v1", Version: 1}
15- ZwpVirtualKeyboardManagerV1Interface = &server.Interface{Name: "zwp_virtual_keyboard_manager_v1", Version: 1}
16- ZwpVirtualKeyboardV1Interface.Requests = []server.Message{
17- {Name: "keymap", Signature: "uhu", Types: []*server.Interface{nil, nil, nil}},
18- {Name: "key", Signature: "uuu", Types: []*server.Interface{nil, nil, nil}},
19- {Name: "modifiers", Signature: "uuuu", Types: []*server.Interface{nil, nil, nil, nil}},
20- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
21- }
22- ZwpVirtualKeyboardV1Interface.Events = []server.Message{}
23- ZwpVirtualKeyboardManagerV1Interface.Requests = []server.Message{
24- {Name: "create_virtual_keyboard", Signature: "on", Types: []*server.Interface{wayland.SeatInterface, ZwpVirtualKeyboardV1Interface}},
25- }
26- ZwpVirtualKeyboardManagerV1Interface.Events = []server.Message{}
27- if err := server.NewInterfaces(ZwpVirtualKeyboardV1Interface, ZwpVirtualKeyboardManagerV1Interface); err != nil {
28- panic(err)
29- }
30-}
31-
32-// ZwpVirtualKeyboardV1 virtual keyboard.
33-type ZwpVirtualKeyboardV1 struct{ *server.Resource }
34-
35-func WrapZwpVirtualKeyboardV1(r *server.Resource) *ZwpVirtualKeyboardV1 {
36- if r == nil {
37- return nil
38- }
39- return &ZwpVirtualKeyboardV1{r}
40-}
41-
42-const ZwpVirtualKeyboardV1RequestKeymap uint32 = 0
43-const ZwpVirtualKeyboardV1RequestKey uint32 = 1
44-const ZwpVirtualKeyboardV1RequestModifiers uint32 = 2
45-const ZwpVirtualKeyboardV1RequestDestroy uint32 = 3
46-
47-// ZwpVirtualKeyboardV1Error .
48-type ZwpVirtualKeyboardV1Error uint32
49-
50-const (
51- ZwpVirtualKeyboardV1ErrorNoKeymap ZwpVirtualKeyboardV1Error = 0
52-)
53-
54-// ZwpVirtualKeyboardV1Handler handles zwp_virtual_keyboard_v1 requests.
55-type ZwpVirtualKeyboardV1Handler interface {
56- Keymap(self *ZwpVirtualKeyboardV1, format uint32, fd int, size uint32)
57- Key(self *ZwpVirtualKeyboardV1, time uint32, key uint32, state uint32)
58- Modifiers(self *ZwpVirtualKeyboardV1, modsDepressed uint32, modsLatched uint32, modsLocked uint32, group uint32)
59- Destroy(self *ZwpVirtualKeyboardV1)
60-}
61-
62-func NewZwpVirtualKeyboardV1(c server.Client, version int32, id uint32, h ZwpVirtualKeyboardV1Handler) (*ZwpVirtualKeyboardV1, error) {
63- if h == nil {
64- return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_virtual_keyboard_v1")
65- }
66- var self *ZwpVirtualKeyboardV1
67- r, err := c.CreateResource(ZwpVirtualKeyboardV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
68- switch opcode {
69- case 0:
70- h.Keymap(self, args[0].Uint(), args[1].Fd(), args[2].Uint())
71- case 1:
72- h.Key(self, args[0].Uint(), args[1].Uint(), args[2].Uint())
73- case 2:
74- h.Modifiers(self, args[0].Uint(), args[1].Uint(), args[2].Uint(), args[3].Uint())
75- case 3:
76- h.Destroy(self)
77- self.Destroy()
78- }
79- })
80- if err != nil {
81- return nil, err
82- }
83- self = WrapZwpVirtualKeyboardV1(r)
84- r.Data = self
85- return self, nil
86-}
87-func NewZwpVirtualKeyboardV1Global(d *server.Display, version int32, bind server.BindFunc) error {
88- return d.CreateGlobal(ZwpVirtualKeyboardV1Interface, version, bind)
89-}
90-
91-// ZwpVirtualKeyboardManagerV1 virtual keyboard manager.
92-type ZwpVirtualKeyboardManagerV1 struct{ *server.Resource }
93-
94-func WrapZwpVirtualKeyboardManagerV1(r *server.Resource) *ZwpVirtualKeyboardManagerV1 {
95- if r == nil {
96- return nil
97- }
98- return &ZwpVirtualKeyboardManagerV1{r}
99-}
100-
101-const ZwpVirtualKeyboardManagerV1RequestCreateVirtualKeyboard uint32 = 0
102-
103-// ZwpVirtualKeyboardManagerV1Error .
104-type ZwpVirtualKeyboardManagerV1Error uint32
105-
106-const (
107- ZwpVirtualKeyboardManagerV1ErrorUnauthorized ZwpVirtualKeyboardManagerV1Error = 0
108-)
109-
110-// ZwpVirtualKeyboardManagerV1Handler handles zwp_virtual_keyboard_manager_v1 requests.
111-type ZwpVirtualKeyboardManagerV1Handler interface {
112- CreateVirtualKeyboard(self *ZwpVirtualKeyboardManagerV1, seat *wayland.Seat, id uint32)
113-}
114-
115-func NewZwpVirtualKeyboardManagerV1(c server.Client, version int32, id uint32, h ZwpVirtualKeyboardManagerV1Handler) (*ZwpVirtualKeyboardManagerV1, error) {
116- if h == nil {
117- return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_virtual_keyboard_manager_v1")
118- }
119- var self *ZwpVirtualKeyboardManagerV1
120- r, err := c.CreateResource(ZwpVirtualKeyboardManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
121- switch opcode {
122- case 0:
123- h.CreateVirtualKeyboard(self, wayland.WrapSeat(args[0].Resource()), args[1].NewID())
124- }
125- })
126- if err != nil {
127- return nil, err
128- }
129- self = WrapZwpVirtualKeyboardManagerV1(r)
130- r.Data = self
131- return self, nil
132-}
133-func NewZwpVirtualKeyboardManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
134- return d.CreateGlobal(ZwpVirtualKeyboardManagerV1Interface, version, bind)
135-}
136-func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
137- if v == nil {
138- return nil
139- }
140- return v.GetResource()
141-}
142-func (self *ZwpVirtualKeyboardV1) GetResource() *server.Resource {
143- if self == nil {
144- return nil
145- }
146- return self.Resource
147-}
148-func (self *ZwpVirtualKeyboardManagerV1) GetResource() *server.Resource {
149- if self == nil {
150- return nil
151- }
152- return self.Resource
153-}
D protocol/wayland/wayland.go +0 -2320 large diff (2320 lines changed): collapsed
D protocol/wayland/wayland_test.go +0 -25
@@ -1,25 +0,0 @@
1-package wayland
2-
3-import (
4- "github.com/bnema/purego-libwayland/server"
5- "testing"
6-)
7-
8-func TestNilHandlerRejected(t *testing.T) {
9- if _, err := NewCompositor(server.Client{}, 1, 1, nil); err == nil {
10- t.Fatal("nil handler accepted")
11- }
12-}
13-
14-func TestForwardReferences(t *testing.T) {
15- for _, tc := range []struct {
16- name string
17- got, want interface{}
18- }{
19- {"create_surface", CompositorInterface.Requests[0].Types[0], SurfaceInterface},
20- } {
21- if tc.got == nil || tc.got != tc.want {
22- t.Fatalf("%s type=%v want %v", tc.name, tc.got, tc.want)
23- }
24- }
25-}
D protocol/wlrforeigntoplevel/wlrforeigntoplevel.go +0 -265
@@ -1,265 +0,0 @@
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-}
D protocol/wlrgammacontrol/wlrgammacontrol.go +0 -157
@@ -1,157 +0,0 @@
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-}
D protocol/wlrlayershell/wlrlayershell.go +0 -240
@@ -1,240 +0,0 @@
1-// Code generated by wlgen; DO NOT EDIT.
2-package wlrlayershell
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 ZwlrLayerShellV1Interface *server.Interface
12-var ZwlrLayerSurfaceV1Interface *server.Interface
13-
14-func init() {
15- ZwlrLayerShellV1Interface = &server.Interface{Name: "zwlr_layer_shell_v1", Version: 5}
16- ZwlrLayerSurfaceV1Interface = &server.Interface{Name: "zwlr_layer_surface_v1", Version: 5}
17- ZwlrLayerShellV1Interface.Requests = []server.Message{
18- {Name: "get_layer_surface", Signature: "no?ous", Types: []*server.Interface{ZwlrLayerSurfaceV1Interface, wayland.SurfaceInterface, wayland.OutputInterface, nil, nil}},
19- {Name: "destroy", Signature: "3", Types: []*server.Interface{}},
20- }
21- ZwlrLayerShellV1Interface.Events = []server.Message{}
22- ZwlrLayerSurfaceV1Interface.Requests = []server.Message{
23- {Name: "set_size", Signature: "uu", Types: []*server.Interface{nil, nil}},
24- {Name: "set_anchor", Signature: "u", Types: []*server.Interface{nil}},
25- {Name: "set_exclusive_zone", Signature: "i", Types: []*server.Interface{nil}},
26- {Name: "set_margin", Signature: "iiii", Types: []*server.Interface{nil, nil, nil, nil}},
27- {Name: "set_keyboard_interactivity", Signature: "u", Types: []*server.Interface{nil}},
28- {Name: "get_popup", Signature: "o", Types: []*server.Interface{xdgshell.PopupInterface}},
29- {Name: "ack_configure", Signature: "u", Types: []*server.Interface{nil}},
30- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
31- {Name: "set_layer", Signature: "2u", Types: []*server.Interface{nil}},
32- {Name: "set_exclusive_edge", Signature: "5u", Types: []*server.Interface{nil}},
33- }
34- ZwlrLayerSurfaceV1Interface.Events = []server.Message{
35- {Name: "configure", Signature: "uuu", Types: []*server.Interface{nil, nil, nil}},
36- {Name: "closed", Signature: "", Types: []*server.Interface{}},
37- }
38- if err := server.NewInterfaces(ZwlrLayerShellV1Interface, ZwlrLayerSurfaceV1Interface); err != nil {
39- panic(err)
40- }
41-}
42-
43-// ZwlrLayerShellV1 create surfaces that are layers of the desktop.
44-type ZwlrLayerShellV1 struct{ *server.Resource }
45-
46-func WrapZwlrLayerShellV1(r *server.Resource) *ZwlrLayerShellV1 {
47- if r == nil {
48- return nil
49- }
50- return &ZwlrLayerShellV1{r}
51-}
52-
53-const ZwlrLayerShellV1RequestGetLayerSurface uint32 = 0
54-const ZwlrLayerShellV1RequestDestroy uint32 = 1
55-
56-// ZwlrLayerShellV1Error .
57-type ZwlrLayerShellV1Error uint32
58-
59-const (
60- ZwlrLayerShellV1ErrorRole ZwlrLayerShellV1Error = 0
61- ZwlrLayerShellV1ErrorInvalidLayer ZwlrLayerShellV1Error = 1
62- ZwlrLayerShellV1ErrorAlreadyConstructed ZwlrLayerShellV1Error = 2
63-)
64-
65-// ZwlrLayerShellV1Layer available layers for surfaces.
66-type ZwlrLayerShellV1Layer uint32
67-
68-const (
69- ZwlrLayerShellV1LayerBackground ZwlrLayerShellV1Layer = 0
70- ZwlrLayerShellV1LayerBottom ZwlrLayerShellV1Layer = 1
71- ZwlrLayerShellV1LayerTop ZwlrLayerShellV1Layer = 2
72- ZwlrLayerShellV1LayerOverlay ZwlrLayerShellV1Layer = 3
73-)
74-
75-// ZwlrLayerShellV1Handler handles zwlr_layer_shell_v1 requests.
76-type ZwlrLayerShellV1Handler interface {
77- GetLayerSurface(self *ZwlrLayerShellV1, id uint32, surface *wayland.Surface, output *wayland.Output, layer uint32, namespace string)
78- Destroy(self *ZwlrLayerShellV1)
79-}
80-
81-func NewZwlrLayerShellV1(c server.Client, version int32, id uint32, h ZwlrLayerShellV1Handler) (*ZwlrLayerShellV1, error) {
82- if h == nil {
83- return nil, fmt.Errorf("purego-libwayland: nil handler for zwlr_layer_shell_v1")
84- }
85- var self *ZwlrLayerShellV1
86- r, err := c.CreateResource(ZwlrLayerShellV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
87- switch opcode {
88- case 0:
89- h.GetLayerSurface(self, args[0].NewID(), wayland.WrapSurface(args[1].Resource()), wayland.WrapOutput(args[2].Resource()), args[3].Uint(), args[4].String())
90- case 1:
91- h.Destroy(self)
92- self.Destroy()
93- }
94- })
95- if err != nil {
96- return nil, err
97- }
98- self = WrapZwlrLayerShellV1(r)
99- r.Data = self
100- return self, nil
101-}
102-func NewZwlrLayerShellV1Global(d *server.Display, version int32, bind server.BindFunc) error {
103- return d.CreateGlobal(ZwlrLayerShellV1Interface, version, bind)
104-}
105-
106-// ZwlrLayerSurfaceV1 layer metadata interface.
107-type ZwlrLayerSurfaceV1 struct{ *server.Resource }
108-
109-func WrapZwlrLayerSurfaceV1(r *server.Resource) *ZwlrLayerSurfaceV1 {
110- if r == nil {
111- return nil
112- }
113- return &ZwlrLayerSurfaceV1{r}
114-}
115-
116-const ZwlrLayerSurfaceV1RequestSetSize uint32 = 0
117-const ZwlrLayerSurfaceV1RequestSetAnchor uint32 = 1
118-const ZwlrLayerSurfaceV1RequestSetExclusiveZone uint32 = 2
119-const ZwlrLayerSurfaceV1RequestSetMargin uint32 = 3
120-const ZwlrLayerSurfaceV1RequestSetKeyboardInteractivity uint32 = 4
121-const ZwlrLayerSurfaceV1RequestGetPopup uint32 = 5
122-const ZwlrLayerSurfaceV1RequestAckConfigure uint32 = 6
123-const ZwlrLayerSurfaceV1RequestDestroy uint32 = 7
124-const ZwlrLayerSurfaceV1RequestSetLayer uint32 = 8
125-const ZwlrLayerSurfaceV1RequestSetExclusiveEdge uint32 = 9
126-const ZwlrLayerSurfaceV1EventConfigure uint32 = 0
127-const ZwlrLayerSurfaceV1EventClosed uint32 = 1
128-
129-// ZwlrLayerSurfaceV1KeyboardInteractivity types of keyboard interaction possible for a layer shell surface.
130-type ZwlrLayerSurfaceV1KeyboardInteractivity uint32
131-
132-const (
133- ZwlrLayerSurfaceV1KeyboardInteractivityNone ZwlrLayerSurfaceV1KeyboardInteractivity = 0
134- ZwlrLayerSurfaceV1KeyboardInteractivityExclusive ZwlrLayerSurfaceV1KeyboardInteractivity = 1
135- ZwlrLayerSurfaceV1KeyboardInteractivityOnDemand ZwlrLayerSurfaceV1KeyboardInteractivity = 2
136-)
137-
138-// ZwlrLayerSurfaceV1Error .
139-type ZwlrLayerSurfaceV1Error uint32
140-
141-const (
142- ZwlrLayerSurfaceV1ErrorInvalidSurfaceState ZwlrLayerSurfaceV1Error = 0
143- ZwlrLayerSurfaceV1ErrorInvalidSize ZwlrLayerSurfaceV1Error = 1
144- ZwlrLayerSurfaceV1ErrorInvalidAnchor ZwlrLayerSurfaceV1Error = 2
145- ZwlrLayerSurfaceV1ErrorInvalidKeyboardInteractivity ZwlrLayerSurfaceV1Error = 3
146- ZwlrLayerSurfaceV1ErrorInvalidExclusiveEdge ZwlrLayerSurfaceV1Error = 4
147-)
148-
149-// ZwlrLayerSurfaceV1Anchor (bitfield).
150-type ZwlrLayerSurfaceV1Anchor uint32
151-
152-const (
153- ZwlrLayerSurfaceV1AnchorTop ZwlrLayerSurfaceV1Anchor = 1
154- ZwlrLayerSurfaceV1AnchorBottom ZwlrLayerSurfaceV1Anchor = 2
155- ZwlrLayerSurfaceV1AnchorLeft ZwlrLayerSurfaceV1Anchor = 4
156- ZwlrLayerSurfaceV1AnchorRight ZwlrLayerSurfaceV1Anchor = 8
157-)
158-
159-// ZwlrLayerSurfaceV1Handler handles zwlr_layer_surface_v1 requests.
160-type ZwlrLayerSurfaceV1Handler interface {
161- SetSize(self *ZwlrLayerSurfaceV1, width uint32, height uint32)
162- SetAnchor(self *ZwlrLayerSurfaceV1, anchor uint32)
163- SetExclusiveZone(self *ZwlrLayerSurfaceV1, zone int32)
164- SetMargin(self *ZwlrLayerSurfaceV1, top int32, right int32, bottom int32, left int32)
165- SetKeyboardInteractivity(self *ZwlrLayerSurfaceV1, keyboardInteractivity uint32)
166- GetPopup(self *ZwlrLayerSurfaceV1, popup *xdgshell.Popup)
167- AckConfigure(self *ZwlrLayerSurfaceV1, serial uint32)
168- Destroy(self *ZwlrLayerSurfaceV1)
169- SetLayer(self *ZwlrLayerSurfaceV1, layer uint32)
170- SetExclusiveEdge(self *ZwlrLayerSurfaceV1, edge uint32)
171-}
172-
173-func NewZwlrLayerSurfaceV1(c server.Client, version int32, id uint32, h ZwlrLayerSurfaceV1Handler) (*ZwlrLayerSurfaceV1, error) {
174- if h == nil {
175- return nil, fmt.Errorf("purego-libwayland: nil handler for zwlr_layer_surface_v1")
176- }
177- var self *ZwlrLayerSurfaceV1
178- r, err := c.CreateResource(ZwlrLayerSurfaceV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
179- switch opcode {
180- case 0:
181- h.SetSize(self, args[0].Uint(), args[1].Uint())
182- case 1:
183- h.SetAnchor(self, args[0].Uint())
184- case 2:
185- h.SetExclusiveZone(self, args[0].Int())
186- case 3:
187- h.SetMargin(self, args[0].Int(), args[1].Int(), args[2].Int(), args[3].Int())
188- case 4:
189- h.SetKeyboardInteractivity(self, args[0].Uint())
190- case 5:
191- h.GetPopup(self, xdgshell.WrapPopup(args[0].Resource()))
192- case 6:
193- h.AckConfigure(self, args[0].Uint())
194- case 7:
195- h.Destroy(self)
196- self.Destroy()
197- case 8:
198- h.SetLayer(self, args[0].Uint())
199- case 9:
200- h.SetExclusiveEdge(self, args[0].Uint())
201- }
202- })
203- if err != nil {
204- return nil, err
205- }
206- self = WrapZwlrLayerSurfaceV1(r)
207- r.Data = self
208- return self, nil
209-}
210-
211-// SendConfigure suggest a surface change.
212-func (self *ZwlrLayerSurfaceV1) SendConfigure(serial uint32, width uint32, height uint32) {
213- self.PostEvent(ZwlrLayerSurfaceV1EventConfigure, server.Uint(serial), server.Uint(width), server.Uint(height))
214-}
215-
216-// SendClosed surface should be closed.
217-func (self *ZwlrLayerSurfaceV1) SendClosed() {
218- self.PostEvent(ZwlrLayerSurfaceV1EventClosed)
219-}
220-func NewZwlrLayerSurfaceV1Global(d *server.Display, version int32, bind server.BindFunc) error {
221- return d.CreateGlobal(ZwlrLayerSurfaceV1Interface, version, bind)
222-}
223-func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
224- if v == nil {
225- return nil
226- }
227- return v.GetResource()
228-}
229-func (self *ZwlrLayerShellV1) GetResource() *server.Resource {
230- if self == nil {
231- return nil
232- }
233- return self.Resource
234-}
235-func (self *ZwlrLayerSurfaceV1) GetResource() *server.Resource {
236- if self == nil {
237- return nil
238- }
239- return self.Resource
240-}
D protocol/wlrlayershell/wlrlayershell_test.go +0 -20
@@ -1,20 +0,0 @@
1-package wlrlayershell
2-
3-import (
4- "testing"
5-
6- "github.com/bnema/purego-libwayland/protocol/wayland"
7- "github.com/bnema/purego-libwayland/protocol/xdgshell"
8-)
9-
10-func TestImportedInterfaces(t *testing.T) {
11- if got := ZwlrLayerShellV1Interface.Requests[0].Types[1]; got != wayland.SurfaceInterface {
12- t.Fatalf("surface type=%v", got)
13- }
14- if got := ZwlrLayerShellV1Interface.Requests[0].Types[2]; got != wayland.OutputInterface {
15- t.Fatalf("output type=%v", got)
16- }
17- if got := ZwlrLayerSurfaceV1Interface.Requests[5].Types[0]; got != xdgshell.PopupInterface {
18- t.Fatalf("popup type=%v", got)
19- }
20-}
D protocol/wlroutputmanagement/wlroutputmanagement.go +0 -540
@@ -1,540 +0,0 @@
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-}
D protocol/wlroutputpower/wlroutputpower.go +0 -165
@@ -1,165 +0,0 @@
1-// Code generated by wlgen; DO NOT EDIT.
2-package wlroutputpower
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 ZwlrOutputPowerManagerV1Interface *server.Interface
11-var ZwlrOutputPowerV1Interface *server.Interface
12-
13-func init() {
14- ZwlrOutputPowerManagerV1Interface = &server.Interface{Name: "zwlr_output_power_manager_v1", Version: 1}
15- ZwlrOutputPowerV1Interface = &server.Interface{Name: "zwlr_output_power_v1", Version: 1}
16- ZwlrOutputPowerManagerV1Interface.Requests = []server.Message{
17- {Name: "get_output_power", Signature: "no", Types: []*server.Interface{ZwlrOutputPowerV1Interface, wayland.OutputInterface}},
18- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
19- }
20- ZwlrOutputPowerManagerV1Interface.Events = []server.Message{}
21- ZwlrOutputPowerV1Interface.Requests = []server.Message{
22- {Name: "set_mode", Signature: "u", Types: []*server.Interface{nil}},
23- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
24- }
25- ZwlrOutputPowerV1Interface.Events = []server.Message{
26- {Name: "mode", Signature: "u", Types: []*server.Interface{nil}},
27- {Name: "failed", Signature: "", Types: []*server.Interface{}},
28- }
29- if err := server.NewInterfaces(ZwlrOutputPowerManagerV1Interface, ZwlrOutputPowerV1Interface); err != nil {
30- panic(err)
31- }
32-}
33-
34-// ZwlrOutputPowerManagerV1 manager to create per-output power management.
35-type ZwlrOutputPowerManagerV1 struct{ *server.Resource }
36-
37-func WrapZwlrOutputPowerManagerV1(r *server.Resource) *ZwlrOutputPowerManagerV1 {
38- if r == nil {
39- return nil
40- }
41- return &ZwlrOutputPowerManagerV1{r}
42-}
43-
44-const ZwlrOutputPowerManagerV1RequestGetOutputPower uint32 = 0
45-const ZwlrOutputPowerManagerV1RequestDestroy uint32 = 1
46-
47-// ZwlrOutputPowerManagerV1Handler handles zwlr_output_power_manager_v1 requests.
48-type ZwlrOutputPowerManagerV1Handler interface {
49- GetOutputPower(self *ZwlrOutputPowerManagerV1, id uint32, output *wayland.Output)
50- Destroy(self *ZwlrOutputPowerManagerV1)
51-}
52-
53-func NewZwlrOutputPowerManagerV1(c server.Client, version int32, id uint32, h ZwlrOutputPowerManagerV1Handler) (*ZwlrOutputPowerManagerV1, error) {
54- if h == nil {
55- return nil, fmt.Errorf("purego-libwayland: nil handler for zwlr_output_power_manager_v1")
56- }
57- var self *ZwlrOutputPowerManagerV1
58- r, err := c.CreateResource(ZwlrOutputPowerManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
59- switch opcode {
60- case 0:
61- h.GetOutputPower(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 = WrapZwlrOutputPowerManagerV1(r)
71- r.Data = self
72- return self, nil
73-}
74-func NewZwlrOutputPowerManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
75- return d.CreateGlobal(ZwlrOutputPowerManagerV1Interface, version, bind)
76-}
77-
78-// ZwlrOutputPowerV1 adjust power management mode for an output.
79-type ZwlrOutputPowerV1 struct{ *server.Resource }
80-
81-func WrapZwlrOutputPowerV1(r *server.Resource) *ZwlrOutputPowerV1 {
82- if r == nil {
83- return nil
84- }
85- return &ZwlrOutputPowerV1{r}
86-}
87-
88-const ZwlrOutputPowerV1RequestSetMode uint32 = 0
89-const ZwlrOutputPowerV1RequestDestroy uint32 = 1
90-const ZwlrOutputPowerV1EventMode uint32 = 0
91-const ZwlrOutputPowerV1EventFailed uint32 = 1
92-
93-// ZwlrOutputPowerV1Mode .
94-type ZwlrOutputPowerV1Mode uint32
95-
96-const (
97- ZwlrOutputPowerV1ModeOff ZwlrOutputPowerV1Mode = 0
98- ZwlrOutputPowerV1ModeOn ZwlrOutputPowerV1Mode = 1
99-)
100-
101-// ZwlrOutputPowerV1Error .
102-type ZwlrOutputPowerV1Error uint32
103-
104-const (
105- ZwlrOutputPowerV1ErrorInvalidMode ZwlrOutputPowerV1Error = 1
106-)
107-
108-// ZwlrOutputPowerV1Handler handles zwlr_output_power_v1 requests.
109-type ZwlrOutputPowerV1Handler interface {
110- SetMode(self *ZwlrOutputPowerV1, mode uint32)
111- Destroy(self *ZwlrOutputPowerV1)
112-}
113-
114-func NewZwlrOutputPowerV1(c server.Client, version int32, id uint32, h ZwlrOutputPowerV1Handler) (*ZwlrOutputPowerV1, error) {
115- if h == nil {
116- return nil, fmt.Errorf("purego-libwayland: nil handler for zwlr_output_power_v1")
117- }
118- var self *ZwlrOutputPowerV1
119- r, err := c.CreateResource(ZwlrOutputPowerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
120- switch opcode {
121- case 0:
122- h.SetMode(self, args[0].Uint())
123- case 1:
124- h.Destroy(self)
125- self.Destroy()
126- }
127- })
128- if err != nil {
129- return nil, err
130- }
131- self = WrapZwlrOutputPowerV1(r)
132- r.Data = self
133- return self, nil
134-}
135-
136-// SendMode Report a power management mode change.
137-func (self *ZwlrOutputPowerV1) SendMode(mode uint32) {
138- self.PostEvent(ZwlrOutputPowerV1EventMode, server.Uint(mode))
139-}
140-
141-// SendFailed object no longer valid.
142-func (self *ZwlrOutputPowerV1) SendFailed() {
143- self.PostEvent(ZwlrOutputPowerV1EventFailed)
144-}
145-func NewZwlrOutputPowerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
146- return d.CreateGlobal(ZwlrOutputPowerV1Interface, version, bind)
147-}
148-func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
149- if v == nil {
150- return nil
151- }
152- return v.GetResource()
153-}
154-func (self *ZwlrOutputPowerManagerV1) GetResource() *server.Resource {
155- if self == nil {
156- return nil
157- }
158- return self.Resource
159-}
160-func (self *ZwlrOutputPowerV1) GetResource() *server.Resource {
161- if self == nil {
162- return nil
163- }
164- return self.Resource
165-}
D protocol/wlroutputpower/wlroutputpower_test.go +0 -17
@@ -1,17 +0,0 @@
1-package wlroutputpower
2-
3-import (
4- "testing"
5-
6- "github.com/bnema/purego-libwayland/protocol/wayland"
7-)
8-
9-func TestImportedInterfaces(t *testing.T) {
10- req := ZwlrOutputPowerManagerV1Interface.Requests[ZwlrOutputPowerManagerV1RequestGetOutputPower]
11- if got := req.Types[0]; got != ZwlrOutputPowerV1Interface {
12- t.Fatalf("new_id type=%v", got)
13- }
14- if got := req.Types[1]; got != wayland.OutputInterface {
15- t.Fatalf("output type=%v", got)
16- }
17-}
D protocol/wlrscreencopy/wlrscreencopy.go +0 -210
@@ -1,210 +0,0 @@
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-}
D protocol/wlrvirtualpointer/wlrvirtualpointer.go +0 -183
@@ -1,183 +0,0 @@
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-}
D protocol/xdgactivation/xdgactivation.go +0 -173
@@ -1,173 +0,0 @@
1-// Code generated by wlgen; DO NOT EDIT.
2-package xdgactivation
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 ActivationV1Interface *server.Interface
12-var ActivationTokenV1Interface *server.Interface
13-
14-func init() {
15- ActivationV1Interface = &server.Interface{Name: "xdg_activation_v1", Version: 1}
16- ActivationTokenV1Interface = &server.Interface{Name: "xdg_activation_token_v1", Version: 1}
17- ActivationV1Interface.Requests = []server.Message{
18- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
19- {Name: "get_activation_token", Signature: "n", Types: []*server.Interface{ActivationTokenV1Interface}},
20- {Name: "activate", Signature: "so", Types: []*server.Interface{nil, wayland.SurfaceInterface}},
21- }
22- ActivationV1Interface.Events = []server.Message{}
23- ActivationTokenV1Interface.Requests = []server.Message{
24- {Name: "set_serial", Signature: "uo", Types: []*server.Interface{nil, wayland.SeatInterface}},
25- {Name: "set_app_id", Signature: "s", Types: []*server.Interface{nil}},
26- {Name: "set_surface", Signature: "o", Types: []*server.Interface{wayland.SurfaceInterface}},
27- {Name: "commit", Signature: "", Types: []*server.Interface{}},
28- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
29- }
30- ActivationTokenV1Interface.Events = []server.Message{
31- {Name: "done", Signature: "s", Types: []*server.Interface{nil}},
32- }
33- if err := server.NewInterfaces(ActivationV1Interface, ActivationTokenV1Interface); err != nil {
34- panic(err)
35- }
36-}
37-
38-// ActivationV1 interface for activating surfaces.
39-type ActivationV1 struct{ *server.Resource }
40-
41-func WrapActivationV1(r *server.Resource) *ActivationV1 {
42- if r == nil {
43- return nil
44- }
45- return &ActivationV1{r}
46-}
47-
48-const ActivationV1RequestDestroy uint32 = 0
49-const ActivationV1RequestGetActivationToken uint32 = 1
50-const ActivationV1RequestActivate uint32 = 2
51-
52-// ActivationV1Handler handles xdg_activation_v1 requests.
53-type ActivationV1Handler interface {
54- Destroy(self *ActivationV1)
55- GetActivationToken(self *ActivationV1, id uint32)
56- Activate(self *ActivationV1, token string, surface *wayland.Surface)
57-}
58-
59-func NewActivationV1(c server.Client, version int32, id uint32, h ActivationV1Handler) (*ActivationV1, error) {
60- if h == nil {
61- return nil, fmt.Errorf("purego-libwayland: nil handler for xdg_activation_v1")
62- }
63- var self *ActivationV1
64- r, err := c.CreateResource(ActivationV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
65- switch opcode {
66- case 0:
67- h.Destroy(self)
68- self.Destroy()
69- case 1:
70- h.GetActivationToken(self, args[0].NewID())
71- case 2:
72- h.Activate(self, args[0].String(), wayland.WrapSurface(args[1].Resource()))
73- }
74- })
75- if err != nil {
76- return nil, err
77- }
78- self = WrapActivationV1(r)
79- r.Data = self
80- return self, nil
81-}
82-func NewActivationV1Global(d *server.Display, version int32, bind server.BindFunc) error {
83- return d.CreateGlobal(ActivationV1Interface, version, bind)
84-}
85-
86-// ActivationTokenV1 an exported activation handle.
87-type ActivationTokenV1 struct{ *server.Resource }
88-
89-func WrapActivationTokenV1(r *server.Resource) *ActivationTokenV1 {
90- if r == nil {
91- return nil
92- }
93- return &ActivationTokenV1{r}
94-}
95-
96-const ActivationTokenV1RequestSetSerial uint32 = 0
97-const ActivationTokenV1RequestSetAppId uint32 = 1
98-const ActivationTokenV1RequestSetSurface uint32 = 2
99-const ActivationTokenV1RequestCommit uint32 = 3
100-const ActivationTokenV1RequestDestroy uint32 = 4
101-const ActivationTokenV1EventDone uint32 = 0
102-
103-// ActivationTokenV1Error .
104-type ActivationTokenV1Error uint32
105-
106-const (
107- ActivationTokenV1ErrorAlreadyUsed ActivationTokenV1Error = 0
108-)
109-
110-// ActivationTokenV1Handler handles xdg_activation_token_v1 requests.
111-type ActivationTokenV1Handler interface {
112- SetSerial(self *ActivationTokenV1, serial uint32, seat *wayland.Seat)
113- SetAppId(self *ActivationTokenV1, appId string)
114- SetSurface(self *ActivationTokenV1, surface *wayland.Surface)
115- Commit(self *ActivationTokenV1)
116- Destroy(self *ActivationTokenV1)
117-}
118-
119-func NewActivationTokenV1(c server.Client, version int32, id uint32, h ActivationTokenV1Handler) (*ActivationTokenV1, error) {
120- if h == nil {
121- return nil, fmt.Errorf("purego-libwayland: nil handler for xdg_activation_token_v1")
122- }
123- var self *ActivationTokenV1
124- r, err := c.CreateResource(ActivationTokenV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
125- switch opcode {
126- case 0:
127- h.SetSerial(self, args[0].Uint(), wayland.WrapSeat(args[1].Resource()))
128- case 1:
129- h.SetAppId(self, args[0].String())
130- case 2:
131- h.SetSurface(self, wayland.WrapSurface(args[0].Resource()))
132- case 3:
133- h.Commit(self)
134- case 4:
135- h.Destroy(self)
136- self.Destroy()
137- }
138- })
139- if err != nil {
140- return nil, err
141- }
142- self = WrapActivationTokenV1(r)
143- r.Data = self
144- return self, nil
145-}
146-
147-// SendDone the exported activation token.
148-func (self *ActivationTokenV1) SendDone(token string) {
149- var p runtime.Pinner
150- defer p.Unpin()
151- self.PostEvent(ActivationTokenV1EventDone, server.String(&p, token, false))
152-}
153-func NewActivationTokenV1Global(d *server.Display, version int32, bind server.BindFunc) error {
154- return d.CreateGlobal(ActivationTokenV1Interface, version, bind)
155-}
156-func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
157- if v == nil {
158- return nil
159- }
160- return v.GetResource()
161-}
162-func (self *ActivationV1) GetResource() *server.Resource {
163- if self == nil {
164- return nil
165- }
166- return self.Resource
167-}
168-func (self *ActivationTokenV1) GetResource() *server.Resource {
169- if self == nil {
170- return nil
171- }
172- return self.Resource
173-}
D protocol/xdgdecoration/xdgdecoration.go +0 -166
@@ -1,166 +0,0 @@
1-// Code generated by wlgen; DO NOT EDIT.
2-package xdgdecoration
3-
4-import (
5- "fmt"
6- xdgshell "github.com/bnema/purego-libwayland/protocol/xdgshell"
7- "github.com/bnema/purego-libwayland/server"
8-)
9-
10-var ZxdgDecorationManagerV1Interface *server.Interface
11-var ZxdgToplevelDecorationV1Interface *server.Interface
12-
13-func init() {
14- ZxdgDecorationManagerV1Interface = &server.Interface{Name: "zxdg_decoration_manager_v1", Version: 2}
15- ZxdgToplevelDecorationV1Interface = &server.Interface{Name: "zxdg_toplevel_decoration_v1", Version: 2}
16- ZxdgDecorationManagerV1Interface.Requests = []server.Message{
17- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
18- {Name: "get_toplevel_decoration", Signature: "no", Types: []*server.Interface{ZxdgToplevelDecorationV1Interface, xdgshell.ToplevelInterface}},
19- }
20- ZxdgDecorationManagerV1Interface.Events = []server.Message{}
21- ZxdgToplevelDecorationV1Interface.Requests = []server.Message{
22- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
23- {Name: "set_mode", Signature: "u", Types: []*server.Interface{nil}},
24- {Name: "unset_mode", Signature: "", Types: []*server.Interface{}},
25- }
26- ZxdgToplevelDecorationV1Interface.Events = []server.Message{
27- {Name: "configure", Signature: "u", Types: []*server.Interface{nil}},
28- }
29- if err := server.NewInterfaces(ZxdgDecorationManagerV1Interface, ZxdgToplevelDecorationV1Interface); err != nil {
30- panic(err)
31- }
32-}
33-
34-// ZxdgDecorationManagerV1 window decoration manager.
35-type ZxdgDecorationManagerV1 struct{ *server.Resource }
36-
37-func WrapZxdgDecorationManagerV1(r *server.Resource) *ZxdgDecorationManagerV1 {
38- if r == nil {
39- return nil
40- }
41- return &ZxdgDecorationManagerV1{r}
42-}
43-
44-const ZxdgDecorationManagerV1RequestDestroy uint32 = 0
45-const ZxdgDecorationManagerV1RequestGetToplevelDecoration uint32 = 1
46-
47-// ZxdgDecorationManagerV1Handler handles zxdg_decoration_manager_v1 requests.
48-type ZxdgDecorationManagerV1Handler interface {
49- Destroy(self *ZxdgDecorationManagerV1)
50- GetToplevelDecoration(self *ZxdgDecorationManagerV1, id uint32, toplevel *xdgshell.Toplevel)
51-}
52-
53-func NewZxdgDecorationManagerV1(c server.Client, version int32, id uint32, h ZxdgDecorationManagerV1Handler) (*ZxdgDecorationManagerV1, error) {
54- if h == nil {
55- return nil, fmt.Errorf("purego-libwayland: nil handler for zxdg_decoration_manager_v1")
56- }
57- var self *ZxdgDecorationManagerV1
58- r, err := c.CreateResource(ZxdgDecorationManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
59- switch opcode {
60- case 0:
61- h.Destroy(self)
62- self.Destroy()
63- case 1:
64- h.GetToplevelDecoration(self, args[0].NewID(), xdgshell.WrapToplevel(args[1].Resource()))
65- }
66- })
67- if err != nil {
68- return nil, err
69- }
70- self = WrapZxdgDecorationManagerV1(r)
71- r.Data = self
72- return self, nil
73-}
74-func NewZxdgDecorationManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
75- return d.CreateGlobal(ZxdgDecorationManagerV1Interface, version, bind)
76-}
77-
78-// ZxdgToplevelDecorationV1 decoration object for a toplevel surface.
79-type ZxdgToplevelDecorationV1 struct{ *server.Resource }
80-
81-func WrapZxdgToplevelDecorationV1(r *server.Resource) *ZxdgToplevelDecorationV1 {
82- if r == nil {
83- return nil
84- }
85- return &ZxdgToplevelDecorationV1{r}
86-}
87-
88-const ZxdgToplevelDecorationV1RequestDestroy uint32 = 0
89-const ZxdgToplevelDecorationV1RequestSetMode uint32 = 1
90-const ZxdgToplevelDecorationV1RequestUnsetMode uint32 = 2
91-const ZxdgToplevelDecorationV1EventConfigure uint32 = 0
92-
93-// ZxdgToplevelDecorationV1Error .
94-type ZxdgToplevelDecorationV1Error uint32
95-
96-const (
97- ZxdgToplevelDecorationV1ErrorUnconfiguredBuffer ZxdgToplevelDecorationV1Error = 0
98- ZxdgToplevelDecorationV1ErrorAlreadyConstructed ZxdgToplevelDecorationV1Error = 1
99- ZxdgToplevelDecorationV1ErrorOrphaned ZxdgToplevelDecorationV1Error = 2
100- ZxdgToplevelDecorationV1ErrorInvalidMode ZxdgToplevelDecorationV1Error = 3
101-)
102-
103-// ZxdgToplevelDecorationV1Mode window decoration modes.
104-type ZxdgToplevelDecorationV1Mode uint32
105-
106-const (
107- ZxdgToplevelDecorationV1ModeClientSide ZxdgToplevelDecorationV1Mode = 1
108- ZxdgToplevelDecorationV1ModeServerSide ZxdgToplevelDecorationV1Mode = 2
109-)
110-
111-// ZxdgToplevelDecorationV1Handler handles zxdg_toplevel_decoration_v1 requests.
112-type ZxdgToplevelDecorationV1Handler interface {
113- Destroy(self *ZxdgToplevelDecorationV1)
114- SetMode(self *ZxdgToplevelDecorationV1, mode uint32)
115- UnsetMode(self *ZxdgToplevelDecorationV1)
116-}
117-
118-func NewZxdgToplevelDecorationV1(c server.Client, version int32, id uint32, h ZxdgToplevelDecorationV1Handler) (*ZxdgToplevelDecorationV1, error) {
119- if h == nil {
120- return nil, fmt.Errorf("purego-libwayland: nil handler for zxdg_toplevel_decoration_v1")
121- }
122- var self *ZxdgToplevelDecorationV1
123- r, err := c.CreateResource(ZxdgToplevelDecorationV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
124- switch opcode {
125- case 0:
126- h.Destroy(self)
127- self.Destroy()
128- case 1:
129- h.SetMode(self, args[0].Uint())
130- case 2:
131- h.UnsetMode(self)
132- }
133- })
134- if err != nil {
135- return nil, err
136- }
137- self = WrapZxdgToplevelDecorationV1(r)
138- r.Data = self
139- return self, nil
140-}
141-
142-// SendConfigure notify a decoration mode change.
143-func (self *ZxdgToplevelDecorationV1) SendConfigure(mode uint32) {
144- self.PostEvent(ZxdgToplevelDecorationV1EventConfigure, server.Uint(mode))
145-}
146-func NewZxdgToplevelDecorationV1Global(d *server.Display, version int32, bind server.BindFunc) error {
147- return d.CreateGlobal(ZxdgToplevelDecorationV1Interface, 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 *ZxdgDecorationManagerV1) GetResource() *server.Resource {
156- if self == nil {
157- return nil
158- }
159- return self.Resource
160-}
161-func (self *ZxdgToplevelDecorationV1) GetResource() *server.Resource {
162- if self == nil {
163- return nil
164- }
165- return self.Resource
166-}
D protocol/xdgdialog/xdgdialog.go +0 -147
@@ -1,147 +0,0 @@
1-// Code generated by wlgen; DO NOT EDIT.
2-package xdgdialog
3-
4-import (
5- "fmt"
6- xdgshell "github.com/bnema/purego-libwayland/protocol/xdgshell"
7- "github.com/bnema/purego-libwayland/server"
8-)
9-
10-var WmDialogV1Interface *server.Interface
11-var DialogV1Interface *server.Interface
12-
13-func init() {
14- WmDialogV1Interface = &server.Interface{Name: "xdg_wm_dialog_v1", Version: 1}
15- DialogV1Interface = &server.Interface{Name: "xdg_dialog_v1", Version: 1}
16- WmDialogV1Interface.Requests = []server.Message{
17- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
18- {Name: "get_xdg_dialog", Signature: "no", Types: []*server.Interface{DialogV1Interface, xdgshell.ToplevelInterface}},
19- }
20- WmDialogV1Interface.Events = []server.Message{}
21- DialogV1Interface.Requests = []server.Message{
22- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
23- {Name: "set_modal", Signature: "", Types: []*server.Interface{}},
24- {Name: "unset_modal", Signature: "", Types: []*server.Interface{}},
25- }
26- DialogV1Interface.Events = []server.Message{}
27- if err := server.NewInterfaces(WmDialogV1Interface, DialogV1Interface); err != nil {
28- panic(err)
29- }
30-}
31-
32-// WmDialogV1 create dialogs related to other toplevels.
33-type WmDialogV1 struct{ *server.Resource }
34-
35-func WrapWmDialogV1(r *server.Resource) *WmDialogV1 {
36- if r == nil {
37- return nil
38- }
39- return &WmDialogV1{r}
40-}
41-
42-const WmDialogV1RequestDestroy uint32 = 0
43-const WmDialogV1RequestGetXdgDialog uint32 = 1
44-
45-// WmDialogV1Error .
46-type WmDialogV1Error uint32
47-
48-const (
49- WmDialogV1ErrorAlreadyUsed WmDialogV1Error = 0
50-)
51-
52-// WmDialogV1Handler handles xdg_wm_dialog_v1 requests.
53-type WmDialogV1Handler interface {
54- Destroy(self *WmDialogV1)
55- GetXdgDialog(self *WmDialogV1, id uint32, toplevel *xdgshell.Toplevel)
56-}
57-
58-func NewWmDialogV1(c server.Client, version int32, id uint32, h WmDialogV1Handler) (*WmDialogV1, error) {
59- if h == nil {
60- return nil, fmt.Errorf("purego-libwayland: nil handler for xdg_wm_dialog_v1")
61- }
62- var self *WmDialogV1
63- r, err := c.CreateResource(WmDialogV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
64- switch opcode {
65- case 0:
66- h.Destroy(self)
67- self.Destroy()
68- case 1:
69- h.GetXdgDialog(self, args[0].NewID(), xdgshell.WrapToplevel(args[1].Resource()))
70- }
71- })
72- if err != nil {
73- return nil, err
74- }
75- self = WrapWmDialogV1(r)
76- r.Data = self
77- return self, nil
78-}
79-func NewWmDialogV1Global(d *server.Display, version int32, bind server.BindFunc) error {
80- return d.CreateGlobal(WmDialogV1Interface, version, bind)
81-}
82-
83-// DialogV1 dialog object.
84-type DialogV1 struct{ *server.Resource }
85-
86-func WrapDialogV1(r *server.Resource) *DialogV1 {
87- if r == nil {
88- return nil
89- }
90- return &DialogV1{r}
91-}
92-
93-const DialogV1RequestDestroy uint32 = 0
94-const DialogV1RequestSetModal uint32 = 1
95-const DialogV1RequestUnsetModal uint32 = 2
96-
97-// DialogV1Handler handles xdg_dialog_v1 requests.
98-type DialogV1Handler interface {
99- Destroy(self *DialogV1)
100- SetModal(self *DialogV1)
101- UnsetModal(self *DialogV1)
102-}
103-
104-func NewDialogV1(c server.Client, version int32, id uint32, h DialogV1Handler) (*DialogV1, error) {
105- if h == nil {
106- return nil, fmt.Errorf("purego-libwayland: nil handler for xdg_dialog_v1")
107- }
108- var self *DialogV1
109- r, err := c.CreateResource(DialogV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
110- switch opcode {
111- case 0:
112- h.Destroy(self)
113- self.Destroy()
114- case 1:
115- h.SetModal(self)
116- case 2:
117- h.UnsetModal(self)
118- }
119- })
120- if err != nil {
121- return nil, err
122- }
123- self = WrapDialogV1(r)
124- r.Data = self
125- return self, nil
126-}
127-func NewDialogV1Global(d *server.Display, version int32, bind server.BindFunc) error {
128- return d.CreateGlobal(DialogV1Interface, version, bind)
129-}
130-func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
131- if v == nil {
132- return nil
133- }
134- return v.GetResource()
135-}
136-func (self *WmDialogV1) GetResource() *server.Resource {
137- if self == nil {
138- return nil
139- }
140- return self.Resource
141-}
142-func (self *DialogV1) GetResource() *server.Resource {
143- if self == nil {
144- return nil
145- }
146- return self.Resource
147-}
D protocol/xdgforeign/xdgforeign.go +0 -277
@@ -1,277 +0,0 @@
1-// Code generated by wlgen; DO NOT EDIT.
2-package xdgforeign
3-
4-import (
5- "fmt"
6- wayland "github.com/bnema/purego-libwayland/protocol/wayland"
7- "github.com/bnema/purego-libwayland/server"
8- "runtime"
9-)
10-
11-var ZxdgExporterV2Interface *server.Interface
12-var ZxdgImporterV2Interface *server.Interface
13-var ZxdgExportedV2Interface *server.Interface
14-var ZxdgImportedV2Interface *server.Interface
15-
16-func init() {
17- ZxdgExporterV2Interface = &server.Interface{Name: "zxdg_exporter_v2", Version: 1}
18- ZxdgImporterV2Interface = &server.Interface{Name: "zxdg_importer_v2", Version: 1}
19- ZxdgExportedV2Interface = &server.Interface{Name: "zxdg_exported_v2", Version: 1}
20- ZxdgImportedV2Interface = &server.Interface{Name: "zxdg_imported_v2", Version: 1}
21- ZxdgExporterV2Interface.Requests = []server.Message{
22- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
23- {Name: "export_toplevel", Signature: "no", Types: []*server.Interface{ZxdgExportedV2Interface, wayland.SurfaceInterface}},
24- }
25- ZxdgExporterV2Interface.Events = []server.Message{}
26- ZxdgImporterV2Interface.Requests = []server.Message{
27- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
28- {Name: "import_toplevel", Signature: "ns", Types: []*server.Interface{ZxdgImportedV2Interface, nil}},
29- }
30- ZxdgImporterV2Interface.Events = []server.Message{}
31- ZxdgExportedV2Interface.Requests = []server.Message{
32- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
33- }
34- ZxdgExportedV2Interface.Events = []server.Message{
35- {Name: "handle", Signature: "s", Types: []*server.Interface{nil}},
36- }
37- ZxdgImportedV2Interface.Requests = []server.Message{
38- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
39- {Name: "set_parent_of", Signature: "o", Types: []*server.Interface{wayland.SurfaceInterface}},
40- }
41- ZxdgImportedV2Interface.Events = []server.Message{
42- {Name: "destroyed", Signature: "", Types: []*server.Interface{}},
43- }
44- if err := server.NewInterfaces(ZxdgExporterV2Interface, ZxdgImporterV2Interface, ZxdgExportedV2Interface, ZxdgImportedV2Interface); err != nil {
45- panic(err)
46- }
47-}
48-
49-// ZxdgExporterV2 interface for exporting surfaces.
50-type ZxdgExporterV2 struct{ *server.Resource }
51-
52-func WrapZxdgExporterV2(r *server.Resource) *ZxdgExporterV2 {
53- if r == nil {
54- return nil
55- }
56- return &ZxdgExporterV2{r}
57-}
58-
59-const ZxdgExporterV2RequestDestroy uint32 = 0
60-const ZxdgExporterV2RequestExportToplevel uint32 = 1
61-
62-// ZxdgExporterV2Error error values.
63-type ZxdgExporterV2Error uint32
64-
65-const (
66- ZxdgExporterV2ErrorInvalidSurface ZxdgExporterV2Error = 0
67-)
68-
69-// ZxdgExporterV2Handler handles zxdg_exporter_v2 requests.
70-type ZxdgExporterV2Handler interface {
71- Destroy(self *ZxdgExporterV2)
72- ExportToplevel(self *ZxdgExporterV2, id uint32, surface *wayland.Surface)
73-}
74-
75-func NewZxdgExporterV2(c server.Client, version int32, id uint32, h ZxdgExporterV2Handler) (*ZxdgExporterV2, error) {
76- if h == nil {
77- return nil, fmt.Errorf("purego-libwayland: nil handler for zxdg_exporter_v2")
78- }
79- var self *ZxdgExporterV2
80- r, err := c.CreateResource(ZxdgExporterV2Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
81- switch opcode {
82- case 0:
83- h.Destroy(self)
84- self.Destroy()
85- case 1:
86- h.ExportToplevel(self, args[0].NewID(), wayland.WrapSurface(args[1].Resource()))
87- }
88- })
89- if err != nil {
90- return nil, err
91- }
92- self = WrapZxdgExporterV2(r)
93- r.Data = self
94- return self, nil
95-}
96-func NewZxdgExporterV2Global(d *server.Display, version int32, bind server.BindFunc) error {
97- return d.CreateGlobal(ZxdgExporterV2Interface, version, bind)
98-}
99-
100-// ZxdgImporterV2 interface for importing surfaces.
101-type ZxdgImporterV2 struct{ *server.Resource }
102-
103-func WrapZxdgImporterV2(r *server.Resource) *ZxdgImporterV2 {
104- if r == nil {
105- return nil
106- }
107- return &ZxdgImporterV2{r}
108-}
109-
110-const ZxdgImporterV2RequestDestroy uint32 = 0
111-const ZxdgImporterV2RequestImportToplevel uint32 = 1
112-
113-// ZxdgImporterV2Handler handles zxdg_importer_v2 requests.
114-type ZxdgImporterV2Handler interface {
115- Destroy(self *ZxdgImporterV2)
116- ImportToplevel(self *ZxdgImporterV2, id uint32, handle string)
117-}
118-
119-func NewZxdgImporterV2(c server.Client, version int32, id uint32, h ZxdgImporterV2Handler) (*ZxdgImporterV2, error) {
120- if h == nil {
121- return nil, fmt.Errorf("purego-libwayland: nil handler for zxdg_importer_v2")
122- }
123- var self *ZxdgImporterV2
124- r, err := c.CreateResource(ZxdgImporterV2Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
125- switch opcode {
126- case 0:
127- h.Destroy(self)
128- self.Destroy()
129- case 1:
130- h.ImportToplevel(self, args[0].NewID(), args[1].String())
131- }
132- })
133- if err != nil {
134- return nil, err
135- }
136- self = WrapZxdgImporterV2(r)
137- r.Data = self
138- return self, nil
139-}
140-func NewZxdgImporterV2Global(d *server.Display, version int32, bind server.BindFunc) error {
141- return d.CreateGlobal(ZxdgImporterV2Interface, version, bind)
142-}
143-
144-// ZxdgExportedV2 an exported surface handle.
145-type ZxdgExportedV2 struct{ *server.Resource }
146-
147-func WrapZxdgExportedV2(r *server.Resource) *ZxdgExportedV2 {
148- if r == nil {
149- return nil
150- }
151- return &ZxdgExportedV2{r}
152-}
153-
154-const ZxdgExportedV2RequestDestroy uint32 = 0
155-const ZxdgExportedV2EventHandle uint32 = 0
156-
157-// ZxdgExportedV2Handler handles zxdg_exported_v2 requests.
158-type ZxdgExportedV2Handler interface {
159- Destroy(self *ZxdgExportedV2)
160-}
161-
162-func NewZxdgExportedV2(c server.Client, version int32, id uint32, h ZxdgExportedV2Handler) (*ZxdgExportedV2, error) {
163- if h == nil {
164- return nil, fmt.Errorf("purego-libwayland: nil handler for zxdg_exported_v2")
165- }
166- var self *ZxdgExportedV2
167- r, err := c.CreateResource(ZxdgExportedV2Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
168- switch opcode {
169- case 0:
170- h.Destroy(self)
171- self.Destroy()
172- }
173- })
174- if err != nil {
175- return nil, err
176- }
177- self = WrapZxdgExportedV2(r)
178- r.Data = self
179- return self, nil
180-}
181-
182-// SendHandle the exported surface handle.
183-func (self *ZxdgExportedV2) SendHandle(handle string) {
184- var p runtime.Pinner
185- defer p.Unpin()
186- self.PostEvent(ZxdgExportedV2EventHandle, server.String(&p, handle, false))
187-}
188-func NewZxdgExportedV2Global(d *server.Display, version int32, bind server.BindFunc) error {
189- return d.CreateGlobal(ZxdgExportedV2Interface, version, bind)
190-}
191-
192-// ZxdgImportedV2 an imported surface handle.
193-type ZxdgImportedV2 struct{ *server.Resource }
194-
195-func WrapZxdgImportedV2(r *server.Resource) *ZxdgImportedV2 {
196- if r == nil {
197- return nil
198- }
199- return &ZxdgImportedV2{r}
200-}
201-
202-const ZxdgImportedV2RequestDestroy uint32 = 0
203-const ZxdgImportedV2RequestSetParentOf uint32 = 1
204-const ZxdgImportedV2EventDestroyed uint32 = 0
205-
206-// ZxdgImportedV2Error error values.
207-type ZxdgImportedV2Error uint32
208-
209-const (
210- ZxdgImportedV2ErrorInvalidSurface ZxdgImportedV2Error = 0
211-)
212-
213-// ZxdgImportedV2Handler handles zxdg_imported_v2 requests.
214-type ZxdgImportedV2Handler interface {
215- Destroy(self *ZxdgImportedV2)
216- SetParentOf(self *ZxdgImportedV2, surface *wayland.Surface)
217-}
218-
219-func NewZxdgImportedV2(c server.Client, version int32, id uint32, h ZxdgImportedV2Handler) (*ZxdgImportedV2, error) {
220- if h == nil {
221- return nil, fmt.Errorf("purego-libwayland: nil handler for zxdg_imported_v2")
222- }
223- var self *ZxdgImportedV2
224- r, err := c.CreateResource(ZxdgImportedV2Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
225- switch opcode {
226- case 0:
227- h.Destroy(self)
228- self.Destroy()
229- case 1:
230- h.SetParentOf(self, wayland.WrapSurface(args[0].Resource()))
231- }
232- })
233- if err != nil {
234- return nil, err
235- }
236- self = WrapZxdgImportedV2(r)
237- r.Data = self
238- return self, nil
239-}
240-
241-// SendDestroyed the imported surface handle has been destroyed.
242-func (self *ZxdgImportedV2) SendDestroyed() {
243- self.PostEvent(ZxdgImportedV2EventDestroyed)
244-}
245-func NewZxdgImportedV2Global(d *server.Display, version int32, bind server.BindFunc) error {
246- return d.CreateGlobal(ZxdgImportedV2Interface, version, bind)
247-}
248-func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
249- if v == nil {
250- return nil
251- }
252- return v.GetResource()
253-}
254-func (self *ZxdgExporterV2) GetResource() *server.Resource {
255- if self == nil {
256- return nil
257- }
258- return self.Resource
259-}
260-func (self *ZxdgImporterV2) GetResource() *server.Resource {
261- if self == nil {
262- return nil
263- }
264- return self.Resource
265-}
266-func (self *ZxdgExportedV2) GetResource() *server.Resource {
267- if self == nil {
268- return nil
269- }
270- return self.Resource
271-}
272-func (self *ZxdgImportedV2) GetResource() *server.Resource {
273- if self == nil {
274- return nil
275- }
276- return self.Resource
277-}
D protocol/xdgoutput/xdgoutput.go +0 -171
@@ -1,171 +0,0 @@
1-// Code generated by wlgen; DO NOT EDIT.
2-package xdgoutput
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 ZxdgOutputManagerV1Interface *server.Interface
12-var ZxdgOutputV1Interface *server.Interface
13-
14-func init() {
15- ZxdgOutputManagerV1Interface = &server.Interface{Name: "zxdg_output_manager_v1", Version: 3}
16- ZxdgOutputV1Interface = &server.Interface{Name: "zxdg_output_v1", Version: 3}
17- ZxdgOutputManagerV1Interface.Requests = []server.Message{
18- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
19- {Name: "get_xdg_output", Signature: "no", Types: []*server.Interface{ZxdgOutputV1Interface, wayland.OutputInterface}},
20- }
21- ZxdgOutputManagerV1Interface.Events = []server.Message{}
22- ZxdgOutputV1Interface.Requests = []server.Message{
23- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
24- }
25- ZxdgOutputV1Interface.Events = []server.Message{
26- {Name: "logical_position", Signature: "ii", Types: []*server.Interface{nil, nil}},
27- {Name: "logical_size", Signature: "ii", Types: []*server.Interface{nil, nil}},
28- {Name: "done", Signature: "", Types: []*server.Interface{}},
29- {Name: "name", Signature: "2s", Types: []*server.Interface{nil}},
30- {Name: "description", Signature: "2s", Types: []*server.Interface{nil}},
31- }
32- if err := server.NewInterfaces(ZxdgOutputManagerV1Interface, ZxdgOutputV1Interface); err != nil {
33- panic(err)
34- }
35-}
36-
37-// ZxdgOutputManagerV1 manage xdg_output objects.
38-type ZxdgOutputManagerV1 struct{ *server.Resource }
39-
40-func WrapZxdgOutputManagerV1(r *server.Resource) *ZxdgOutputManagerV1 {
41- if r == nil {
42- return nil
43- }
44- return &ZxdgOutputManagerV1{r}
45-}
46-
47-const ZxdgOutputManagerV1RequestDestroy uint32 = 0
48-const ZxdgOutputManagerV1RequestGetXdgOutput uint32 = 1
49-
50-// ZxdgOutputManagerV1Handler handles zxdg_output_manager_v1 requests.
51-type ZxdgOutputManagerV1Handler interface {
52- Destroy(self *ZxdgOutputManagerV1)
53- GetXdgOutput(self *ZxdgOutputManagerV1, id uint32, output *wayland.Output)
54-}
55-
56-func NewZxdgOutputManagerV1(c server.Client, version int32, id uint32, h ZxdgOutputManagerV1Handler) (*ZxdgOutputManagerV1, error) {
57- if h == nil {
58- return nil, fmt.Errorf("purego-libwayland: nil handler for zxdg_output_manager_v1")
59- }
60- var self *ZxdgOutputManagerV1
61- r, err := c.CreateResource(ZxdgOutputManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
62- switch opcode {
63- case 0:
64- h.Destroy(self)
65- self.Destroy()
66- case 1:
67- h.GetXdgOutput(self, args[0].NewID(), wayland.WrapOutput(args[1].Resource()))
68- }
69- })
70- if err != nil {
71- return nil, err
72- }
73- self = WrapZxdgOutputManagerV1(r)
74- r.Data = self
75- return self, nil
76-}
77-func NewZxdgOutputManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
78- return d.CreateGlobal(ZxdgOutputManagerV1Interface, version, bind)
79-}
80-
81-// ZxdgOutputV1 compositor logical output region.
82-type ZxdgOutputV1 struct{ *server.Resource }
83-
84-func WrapZxdgOutputV1(r *server.Resource) *ZxdgOutputV1 {
85- if r == nil {
86- return nil
87- }
88- return &ZxdgOutputV1{r}
89-}
90-
91-const ZxdgOutputV1RequestDestroy uint32 = 0
92-const ZxdgOutputV1EventLogicalPosition uint32 = 0
93-const ZxdgOutputV1EventLogicalSize uint32 = 1
94-const ZxdgOutputV1EventDone uint32 = 2
95-const ZxdgOutputV1EventName uint32 = 3
96-const ZxdgOutputV1EventDescription uint32 = 4
97-
98-// ZxdgOutputV1Handler handles zxdg_output_v1 requests.
99-type ZxdgOutputV1Handler interface {
100- Destroy(self *ZxdgOutputV1)
101-}
102-
103-func NewZxdgOutputV1(c server.Client, version int32, id uint32, h ZxdgOutputV1Handler) (*ZxdgOutputV1, error) {
104- if h == nil {
105- return nil, fmt.Errorf("purego-libwayland: nil handler for zxdg_output_v1")
106- }
107- var self *ZxdgOutputV1
108- r, err := c.CreateResource(ZxdgOutputV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
109- switch opcode {
110- case 0:
111- h.Destroy(self)
112- self.Destroy()
113- }
114- })
115- if err != nil {
116- return nil, err
117- }
118- self = WrapZxdgOutputV1(r)
119- r.Data = self
120- return self, nil
121-}
122-
123-// SendLogicalPosition position of the output within the global compositor space.
124-func (self *ZxdgOutputV1) SendLogicalPosition(x int32, y int32) {
125- self.PostEvent(ZxdgOutputV1EventLogicalPosition, server.Int(x), server.Int(y))
126-}
127-
128-// SendLogicalSize size of the output in the global compositor space.
129-func (self *ZxdgOutputV1) SendLogicalSize(width int32, height int32) {
130- self.PostEvent(ZxdgOutputV1EventLogicalSize, server.Int(width), server.Int(height))
131-}
132-
133-// SendDone all information about the output have been sent.
134-func (self *ZxdgOutputV1) SendDone() {
135- self.PostEvent(ZxdgOutputV1EventDone)
136-}
137-
138-// SendName name of this output (since version 2).
139-func (self *ZxdgOutputV1) SendName(name string) {
140- var p runtime.Pinner
141- defer p.Unpin()
142- self.PostEvent(ZxdgOutputV1EventName, server.String(&p, name, false))
143-}
144-
145-// SendDescription human-readable description of this output (since version 2).
146-func (self *ZxdgOutputV1) SendDescription(description string) {
147- var p runtime.Pinner
148- defer p.Unpin()
149- self.PostEvent(ZxdgOutputV1EventDescription, server.String(&p, description, false))
150-}
151-func NewZxdgOutputV1Global(d *server.Display, version int32, bind server.BindFunc) error {
152- return d.CreateGlobal(ZxdgOutputV1Interface, version, bind)
153-}
154-func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
155- if v == nil {
156- return nil
157- }
158- return v.GetResource()
159-}
160-func (self *ZxdgOutputManagerV1) GetResource() *server.Resource {
161- if self == nil {
162- return nil
163- }
164- return self.Resource
165-}
166-func (self *ZxdgOutputV1) GetResource() *server.Resource {
167- if self == nil {
168- return nil
169- }
170- return self.Resource
171-}
D protocol/xdgoutput/xdgoutput_test.go +0 -12
@@ -1,12 +0,0 @@
1-package xdgoutput
2-
3-import "testing"
4-
5-func TestOutputInterface(t *testing.T) {
6- if ZxdgOutputManagerV1Interface == nil || ZxdgOutputV1Interface == nil {
7- t.Fatal("xdg-output interfaces not initialized")
8- }
9- if got := ZxdgOutputManagerV1Interface.Requests[1].Types[0]; got != ZxdgOutputV1Interface {
10- t.Fatalf("get_xdg_output new_id type = %v", got)
11- }
12-}
D protocol/xdgsessionmanagement/xdgsessionmanagement.go +0 -269
@@ -1,269 +0,0 @@
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-}
D protocol/xdgshell/xdgshell.go +0 -643
@@ -1,643 +0,0 @@
1-// Code generated by wlgen; DO NOT EDIT.
2-package xdgshell
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 WmBaseInterface *server.Interface
12-var PositionerInterface *server.Interface
13-var SurfaceInterface *server.Interface
14-var ToplevelInterface *server.Interface
15-var PopupInterface *server.Interface
16-
17-func init() {
18- WmBaseInterface = &server.Interface{Name: "xdg_wm_base", Version: 7}
19- PositionerInterface = &server.Interface{Name: "xdg_positioner", Version: 7}
20- SurfaceInterface = &server.Interface{Name: "xdg_surface", Version: 7}
21- ToplevelInterface = &server.Interface{Name: "xdg_toplevel", Version: 7}
22- PopupInterface = &server.Interface{Name: "xdg_popup", Version: 7}
23- WmBaseInterface.Requests = []server.Message{
24- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
25- {Name: "create_positioner", Signature: "n", Types: []*server.Interface{PositionerInterface}},
26- {Name: "get_xdg_surface", Signature: "no", Types: []*server.Interface{SurfaceInterface, wayland.SurfaceInterface}},
27- {Name: "pong", Signature: "u", Types: []*server.Interface{nil}},
28- }
29- WmBaseInterface.Events = []server.Message{
30- {Name: "ping", Signature: "u", Types: []*server.Interface{nil}},
31- }
32- PositionerInterface.Requests = []server.Message{
33- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
34- {Name: "set_size", Signature: "ii", Types: []*server.Interface{nil, nil}},
35- {Name: "set_anchor_rect", Signature: "iiii", Types: []*server.Interface{nil, nil, nil, nil}},
36- {Name: "set_anchor", Signature: "u", Types: []*server.Interface{nil}},
37- {Name: "set_gravity", Signature: "u", Types: []*server.Interface{nil}},
38- {Name: "set_constraint_adjustment", Signature: "u", Types: []*server.Interface{nil}},
39- {Name: "set_offset", Signature: "ii", Types: []*server.Interface{nil, nil}},
40- {Name: "set_reactive", Signature: "3", Types: []*server.Interface{}},
41- {Name: "set_parent_size", Signature: "3ii", Types: []*server.Interface{nil, nil}},
42- {Name: "set_parent_configure", Signature: "3u", Types: []*server.Interface{nil}},
43- }
44- PositionerInterface.Events = []server.Message{}
45- SurfaceInterface.Requests = []server.Message{
46- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
47- {Name: "get_toplevel", Signature: "n", Types: []*server.Interface{ToplevelInterface}},
48- {Name: "get_popup", Signature: "n?oo", Types: []*server.Interface{PopupInterface, SurfaceInterface, PositionerInterface}},
49- {Name: "set_window_geometry", Signature: "iiii", Types: []*server.Interface{nil, nil, nil, nil}},
50- {Name: "ack_configure", Signature: "u", Types: []*server.Interface{nil}},
51- }
52- SurfaceInterface.Events = []server.Message{
53- {Name: "configure", Signature: "u", Types: []*server.Interface{nil}},
54- }
55- ToplevelInterface.Requests = []server.Message{
56- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
57- {Name: "set_parent", Signature: "?o", Types: []*server.Interface{ToplevelInterface}},
58- {Name: "set_title", Signature: "s", Types: []*server.Interface{nil}},
59- {Name: "set_app_id", Signature: "s", Types: []*server.Interface{nil}},
60- {Name: "show_window_menu", Signature: "ouii", Types: []*server.Interface{wayland.SeatInterface, nil, nil, nil}},
61- {Name: "move", Signature: "ou", Types: []*server.Interface{wayland.SeatInterface, nil}},
62- {Name: "resize", Signature: "ouu", Types: []*server.Interface{wayland.SeatInterface, nil, nil}},
63- {Name: "set_max_size", Signature: "ii", Types: []*server.Interface{nil, nil}},
64- {Name: "set_min_size", Signature: "ii", Types: []*server.Interface{nil, nil}},
65- {Name: "set_maximized", Signature: "", Types: []*server.Interface{}},
66- {Name: "unset_maximized", Signature: "", Types: []*server.Interface{}},
67- {Name: "set_fullscreen", Signature: "?o", Types: []*server.Interface{wayland.OutputInterface}},
68- {Name: "unset_fullscreen", Signature: "", Types: []*server.Interface{}},
69- {Name: "set_minimized", Signature: "", Types: []*server.Interface{}},
70- }
71- ToplevelInterface.Events = []server.Message{
72- {Name: "configure", Signature: "iia", Types: []*server.Interface{nil, nil, nil}},
73- {Name: "close", Signature: "", Types: []*server.Interface{}},
74- {Name: "configure_bounds", Signature: "4ii", Types: []*server.Interface{nil, nil}},
75- {Name: "wm_capabilities", Signature: "5a", Types: []*server.Interface{nil}},
76- }
77- PopupInterface.Requests = []server.Message{
78- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
79- {Name: "grab", Signature: "ou", Types: []*server.Interface{wayland.SeatInterface, nil}},
80- {Name: "reposition", Signature: "3ou", Types: []*server.Interface{PositionerInterface, nil}},
81- }
82- PopupInterface.Events = []server.Message{
83- {Name: "configure", Signature: "iiii", Types: []*server.Interface{nil, nil, nil, nil}},
84- {Name: "popup_done", Signature: "", Types: []*server.Interface{}},
85- {Name: "repositioned", Signature: "3u", Types: []*server.Interface{nil}},
86- }
87- if err := server.NewInterfaces(WmBaseInterface, PositionerInterface, SurfaceInterface, ToplevelInterface, PopupInterface); err != nil {
88- panic(err)
89- }
90-}
91-
92-// WmBase create desktop-style surfaces.
93-type WmBase struct{ *server.Resource }
94-
95-func WrapWmBase(r *server.Resource) *WmBase {
96- if r == nil {
97- return nil
98- }
99- return &WmBase{r}
100-}
101-
102-const WmBaseRequestDestroy uint32 = 0
103-const WmBaseRequestCreatePositioner uint32 = 1
104-const WmBaseRequestGetXdgSurface uint32 = 2
105-const WmBaseRequestPong uint32 = 3
106-const WmBaseEventPing uint32 = 0
107-
108-// WmBaseError .
109-type WmBaseError uint32
110-
111-const (
112- WmBaseErrorRole WmBaseError = 0
113- WmBaseErrorDefunctSurfaces WmBaseError = 1
114- WmBaseErrorNotTheTopmostPopup WmBaseError = 2
115- WmBaseErrorInvalidPopupParent WmBaseError = 3
116- WmBaseErrorInvalidSurfaceState WmBaseError = 4
117- WmBaseErrorInvalidPositioner WmBaseError = 5
118- WmBaseErrorUnresponsive WmBaseError = 6
119-)
120-
121-// WmBaseHandler handles xdg_wm_base requests.
122-type WmBaseHandler interface {
123- Destroy(self *WmBase)
124- CreatePositioner(self *WmBase, id uint32)
125- GetXdgSurface(self *WmBase, id uint32, surface *wayland.Surface)
126- Pong(self *WmBase, serial uint32)
127-}
128-
129-func NewWmBase(c server.Client, version int32, id uint32, h WmBaseHandler) (*WmBase, error) {
130- if h == nil {
131- return nil, fmt.Errorf("purego-libwayland: nil handler for xdg_wm_base")
132- }
133- var self *WmBase
134- r, err := c.CreateResource(WmBaseInterface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
135- switch opcode {
136- case 0:
137- h.Destroy(self)
138- self.Destroy()
139- case 1:
140- h.CreatePositioner(self, args[0].NewID())
141- case 2:
142- h.GetXdgSurface(self, args[0].NewID(), wayland.WrapSurface(args[1].Resource()))
143- case 3:
144- h.Pong(self, args[0].Uint())
145- }
146- })
147- if err != nil {
148- return nil, err
149- }
150- self = WrapWmBase(r)
151- r.Data = self
152- return self, nil
153-}
154-
155-// SendPing check if the client is alive.
156-func (self *WmBase) SendPing(serial uint32) {
157- self.PostEvent(WmBaseEventPing, server.Uint(serial))
158-}
159-func NewWmBaseGlobal(d *server.Display, version int32, bind server.BindFunc) error {
160- return d.CreateGlobal(WmBaseInterface, version, bind)
161-}
162-
163-// Positioner child surface positioner.
164-type Positioner struct{ *server.Resource }
165-
166-func WrapPositioner(r *server.Resource) *Positioner {
167- if r == nil {
168- return nil
169- }
170- return &Positioner{r}
171-}
172-
173-const PositionerRequestDestroy uint32 = 0
174-const PositionerRequestSetSize uint32 = 1
175-const PositionerRequestSetAnchorRect uint32 = 2
176-const PositionerRequestSetAnchor uint32 = 3
177-const PositionerRequestSetGravity uint32 = 4
178-const PositionerRequestSetConstraintAdjustment uint32 = 5
179-const PositionerRequestSetOffset uint32 = 6
180-const PositionerRequestSetReactive uint32 = 7
181-const PositionerRequestSetParentSize uint32 = 8
182-const PositionerRequestSetParentConfigure uint32 = 9
183-
184-// PositionerError .
185-type PositionerError uint32
186-
187-const (
188- PositionerErrorInvalidInput PositionerError = 0
189-)
190-
191-// PositionerAnchor .
192-type PositionerAnchor uint32
193-
194-const (
195- PositionerAnchorNone PositionerAnchor = 0
196- PositionerAnchorTop PositionerAnchor = 1
197- PositionerAnchorBottom PositionerAnchor = 2
198- PositionerAnchorLeft PositionerAnchor = 3
199- PositionerAnchorRight PositionerAnchor = 4
200- PositionerAnchorTopLeft PositionerAnchor = 5
201- PositionerAnchorBottomLeft PositionerAnchor = 6
202- PositionerAnchorTopRight PositionerAnchor = 7
203- PositionerAnchorBottomRight PositionerAnchor = 8
204-)
205-
206-// PositionerGravity .
207-type PositionerGravity uint32
208-
209-const (
210- PositionerGravityNone PositionerGravity = 0
211- PositionerGravityTop PositionerGravity = 1
212- PositionerGravityBottom PositionerGravity = 2
213- PositionerGravityLeft PositionerGravity = 3
214- PositionerGravityRight PositionerGravity = 4
215- PositionerGravityTopLeft PositionerGravity = 5
216- PositionerGravityBottomLeft PositionerGravity = 6
217- PositionerGravityTopRight PositionerGravity = 7
218- PositionerGravityBottomRight PositionerGravity = 8
219-)
220-
221-// PositionerConstraintAdjustment constraint adjustments (bitfield).
222-type PositionerConstraintAdjustment uint32
223-
224-const (
225- PositionerConstraintAdjustmentNone PositionerConstraintAdjustment = 0
226- PositionerConstraintAdjustmentSlideX PositionerConstraintAdjustment = 1
227- PositionerConstraintAdjustmentSlideY PositionerConstraintAdjustment = 2
228- PositionerConstraintAdjustmentFlipX PositionerConstraintAdjustment = 4
229- PositionerConstraintAdjustmentFlipY PositionerConstraintAdjustment = 8
230- PositionerConstraintAdjustmentResizeX PositionerConstraintAdjustment = 16
231- PositionerConstraintAdjustmentResizeY PositionerConstraintAdjustment = 32
232-)
233-
234-// PositionerHandler handles xdg_positioner requests.
235-type PositionerHandler interface {
236- Destroy(self *Positioner)
237- SetSize(self *Positioner, width int32, height int32)
238- SetAnchorRect(self *Positioner, x int32, y int32, width int32, height int32)
239- SetAnchor(self *Positioner, anchor uint32)
240- SetGravity(self *Positioner, gravity uint32)
241- SetConstraintAdjustment(self *Positioner, constraintAdjustment uint32)
242- SetOffset(self *Positioner, x int32, y int32)
243- SetReactive(self *Positioner)
244- SetParentSize(self *Positioner, parentWidth int32, parentHeight int32)
245- SetParentConfigure(self *Positioner, serial uint32)
246-}
247-
248-func NewPositioner(c server.Client, version int32, id uint32, h PositionerHandler) (*Positioner, error) {
249- if h == nil {
250- return nil, fmt.Errorf("purego-libwayland: nil handler for xdg_positioner")
251- }
252- var self *Positioner
253- r, err := c.CreateResource(PositionerInterface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
254- switch opcode {
255- case 0:
256- h.Destroy(self)
257- self.Destroy()
258- case 1:
259- h.SetSize(self, args[0].Int(), args[1].Int())
260- case 2:
261- h.SetAnchorRect(self, args[0].Int(), args[1].Int(), args[2].Int(), args[3].Int())
262- case 3:
263- h.SetAnchor(self, args[0].Uint())
264- case 4:
265- h.SetGravity(self, args[0].Uint())
266- case 5:
267- h.SetConstraintAdjustment(self, args[0].Uint())
268- case 6:
269- h.SetOffset(self, args[0].Int(), args[1].Int())
270- case 7:
271- h.SetReactive(self)
272- case 8:
273- h.SetParentSize(self, args[0].Int(), args[1].Int())
274- case 9:
275- h.SetParentConfigure(self, args[0].Uint())
276- }
277- })
278- if err != nil {
279- return nil, err
280- }
281- self = WrapPositioner(r)
282- r.Data = self
283- return self, nil
284-}
285-func NewPositionerGlobal(d *server.Display, version int32, bind server.BindFunc) error {
286- return d.CreateGlobal(PositionerInterface, version, bind)
287-}
288-
289-// Surface desktop user interface surface base interface.
290-type Surface struct{ *server.Resource }
291-
292-func WrapSurface(r *server.Resource) *Surface {
293- if r == nil {
294- return nil
295- }
296- return &Surface{r}
297-}
298-
299-const SurfaceRequestDestroy uint32 = 0
300-const SurfaceRequestGetToplevel uint32 = 1
301-const SurfaceRequestGetPopup uint32 = 2
302-const SurfaceRequestSetWindowGeometry uint32 = 3
303-const SurfaceRequestAckConfigure uint32 = 4
304-const SurfaceEventConfigure uint32 = 0
305-
306-// SurfaceError .
307-type SurfaceError uint32
308-
309-const (
310- SurfaceErrorNotConstructed SurfaceError = 1
311- SurfaceErrorAlreadyConstructed SurfaceError = 2
312- SurfaceErrorUnconfiguredBuffer SurfaceError = 3
313- SurfaceErrorInvalidSerial SurfaceError = 4
314- SurfaceErrorInvalidSize SurfaceError = 5
315- SurfaceErrorDefunctRoleObject SurfaceError = 6
316-)
317-
318-// SurfaceHandler handles xdg_surface requests.
319-type SurfaceHandler interface {
320- Destroy(self *Surface)
321- GetToplevel(self *Surface, id uint32)
322- GetPopup(self *Surface, id uint32, parent *Surface, positioner *Positioner)
323- SetWindowGeometry(self *Surface, x int32, y int32, width int32, height int32)
324- AckConfigure(self *Surface, serial uint32)
325-}
326-
327-func NewSurface(c server.Client, version int32, id uint32, h SurfaceHandler) (*Surface, error) {
328- if h == nil {
329- return nil, fmt.Errorf("purego-libwayland: nil handler for xdg_surface")
330- }
331- var self *Surface
332- r, err := c.CreateResource(SurfaceInterface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
333- switch opcode {
334- case 0:
335- h.Destroy(self)
336- self.Destroy()
337- case 1:
338- h.GetToplevel(self, args[0].NewID())
339- case 2:
340- h.GetPopup(self, args[0].NewID(), WrapSurface(args[1].Resource()), WrapPositioner(args[2].Resource()))
341- case 3:
342- h.SetWindowGeometry(self, args[0].Int(), args[1].Int(), args[2].Int(), args[3].Int())
343- case 4:
344- h.AckConfigure(self, args[0].Uint())
345- }
346- })
347- if err != nil {
348- return nil, err
349- }
350- self = WrapSurface(r)
351- r.Data = self
352- return self, nil
353-}
354-
355-// SendConfigure suggest a surface change.
356-func (self *Surface) SendConfigure(serial uint32) {
357- self.PostEvent(SurfaceEventConfigure, server.Uint(serial))
358-}
359-func NewSurfaceGlobal(d *server.Display, version int32, bind server.BindFunc) error {
360- return d.CreateGlobal(SurfaceInterface, version, bind)
361-}
362-
363-// Toplevel toplevel surface.
364-type Toplevel struct{ *server.Resource }
365-
366-func WrapToplevel(r *server.Resource) *Toplevel {
367- if r == nil {
368- return nil
369- }
370- return &Toplevel{r}
371-}
372-
373-const ToplevelRequestDestroy uint32 = 0
374-const ToplevelRequestSetParent uint32 = 1
375-const ToplevelRequestSetTitle uint32 = 2
376-const ToplevelRequestSetAppId uint32 = 3
377-const ToplevelRequestShowWindowMenu uint32 = 4
378-const ToplevelRequestMove uint32 = 5
379-const ToplevelRequestResize uint32 = 6
380-const ToplevelRequestSetMaxSize uint32 = 7
381-const ToplevelRequestSetMinSize uint32 = 8
382-const ToplevelRequestSetMaximized uint32 = 9
383-const ToplevelRequestUnsetMaximized uint32 = 10
384-const ToplevelRequestSetFullscreen uint32 = 11
385-const ToplevelRequestUnsetFullscreen uint32 = 12
386-const ToplevelRequestSetMinimized uint32 = 13
387-const ToplevelEventConfigure uint32 = 0
388-const ToplevelEventClose uint32 = 1
389-const ToplevelEventConfigureBounds uint32 = 2
390-const ToplevelEventWmCapabilities uint32 = 3
391-
392-// ToplevelError .
393-type ToplevelError uint32
394-
395-const (
396- ToplevelErrorInvalidResizeEdge ToplevelError = 0
397- ToplevelErrorInvalidParent ToplevelError = 1
398- ToplevelErrorInvalidSize ToplevelError = 2
399-)
400-
401-// ToplevelResizeEdge edge values for resizing.
402-type ToplevelResizeEdge uint32
403-
404-const (
405- ToplevelResizeEdgeNone ToplevelResizeEdge = 0
406- ToplevelResizeEdgeTop ToplevelResizeEdge = 1
407- ToplevelResizeEdgeBottom ToplevelResizeEdge = 2
408- ToplevelResizeEdgeLeft ToplevelResizeEdge = 4
409- ToplevelResizeEdgeTopLeft ToplevelResizeEdge = 5
410- ToplevelResizeEdgeBottomLeft ToplevelResizeEdge = 6
411- ToplevelResizeEdgeRight ToplevelResizeEdge = 8
412- ToplevelResizeEdgeTopRight ToplevelResizeEdge = 9
413- ToplevelResizeEdgeBottomRight ToplevelResizeEdge = 10
414-)
415-
416-// ToplevelState types of state on the surface.
417-type ToplevelState uint32
418-
419-const (
420- ToplevelStateMaximized ToplevelState = 1
421- ToplevelStateFullscreen ToplevelState = 2
422- ToplevelStateResizing ToplevelState = 3
423- ToplevelStateActivated ToplevelState = 4
424- ToplevelStateTiledLeft ToplevelState = 5
425- ToplevelStateTiledRight ToplevelState = 6
426- ToplevelStateTiledTop ToplevelState = 7
427- ToplevelStateTiledBottom ToplevelState = 8
428- ToplevelStateSuspended ToplevelState = 9
429- ToplevelStateConstrainedLeft ToplevelState = 10
430- ToplevelStateConstrainedRight ToplevelState = 11
431- ToplevelStateConstrainedTop ToplevelState = 12
432- ToplevelStateConstrainedBottom ToplevelState = 13
433-)
434-
435-// ToplevelWmCapabilities .
436-type ToplevelWmCapabilities uint32
437-
438-const (
439- ToplevelWmCapabilitiesWindowMenu ToplevelWmCapabilities = 1
440- ToplevelWmCapabilitiesMaximize ToplevelWmCapabilities = 2
441- ToplevelWmCapabilitiesFullscreen ToplevelWmCapabilities = 3
442- ToplevelWmCapabilitiesMinimize ToplevelWmCapabilities = 4
443-)
444-
445-// ToplevelHandler handles xdg_toplevel requests.
446-type ToplevelHandler interface {
447- Destroy(self *Toplevel)
448- SetParent(self *Toplevel, parent *Toplevel)
449- SetTitle(self *Toplevel, title string)
450- SetAppId(self *Toplevel, appId string)
451- ShowWindowMenu(self *Toplevel, seat *wayland.Seat, serial uint32, x int32, y int32)
452- Move(self *Toplevel, seat *wayland.Seat, serial uint32)
453- Resize(self *Toplevel, seat *wayland.Seat, serial uint32, edges uint32)
454- SetMaxSize(self *Toplevel, width int32, height int32)
455- SetMinSize(self *Toplevel, width int32, height int32)
456- SetMaximized(self *Toplevel)
457- UnsetMaximized(self *Toplevel)
458- SetFullscreen(self *Toplevel, output *wayland.Output)
459- UnsetFullscreen(self *Toplevel)
460- SetMinimized(self *Toplevel)
461-}
462-
463-func NewToplevel(c server.Client, version int32, id uint32, h ToplevelHandler) (*Toplevel, error) {
464- if h == nil {
465- return nil, fmt.Errorf("purego-libwayland: nil handler for xdg_toplevel")
466- }
467- var self *Toplevel
468- r, err := c.CreateResource(ToplevelInterface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
469- switch opcode {
470- case 0:
471- h.Destroy(self)
472- self.Destroy()
473- case 1:
474- h.SetParent(self, WrapToplevel(args[0].Resource()))
475- case 2:
476- h.SetTitle(self, args[0].String())
477- case 3:
478- h.SetAppId(self, args[0].String())
479- case 4:
480- h.ShowWindowMenu(self, wayland.WrapSeat(args[0].Resource()), args[1].Uint(), args[2].Int(), args[3].Int())
481- case 5:
482- h.Move(self, wayland.WrapSeat(args[0].Resource()), args[1].Uint())
483- case 6:
484- h.Resize(self, wayland.WrapSeat(args[0].Resource()), args[1].Uint(), args[2].Uint())
485- case 7:
486- h.SetMaxSize(self, args[0].Int(), args[1].Int())
487- case 8:
488- h.SetMinSize(self, args[0].Int(), args[1].Int())
489- case 9:
490- h.SetMaximized(self)
491- case 10:
492- h.UnsetMaximized(self)
493- case 11:
494- h.SetFullscreen(self, wayland.WrapOutput(args[0].Resource()))
495- case 12:
496- h.UnsetFullscreen(self)
497- case 13:
498- h.SetMinimized(self)
499- }
500- })
501- if err != nil {
502- return nil, err
503- }
504- self = WrapToplevel(r)
505- r.Data = self
506- return self, nil
507-}
508-
509-// SendConfigure suggest a surface change.
510-func (self *Toplevel) SendConfigure(width int32, height int32, states []byte) {
511- var p runtime.Pinner
512- defer p.Unpin()
513- self.PostEvent(ToplevelEventConfigure, server.Int(width), server.Int(height), server.Array(&p, states))
514-}
515-
516-// SendClose surface wants to be closed.
517-func (self *Toplevel) SendClose() {
518- self.PostEvent(ToplevelEventClose)
519-}
520-
521-// SendConfigureBounds recommended window geometry bounds (since version 4).
522-func (self *Toplevel) SendConfigureBounds(width int32, height int32) {
523- self.PostEvent(ToplevelEventConfigureBounds, server.Int(width), server.Int(height))
524-}
525-
526-// SendWmCapabilities compositor capabilities (since version 5).
527-func (self *Toplevel) SendWmCapabilities(capabilities []byte) {
528- var p runtime.Pinner
529- defer p.Unpin()
530- self.PostEvent(ToplevelEventWmCapabilities, server.Array(&p, capabilities))
531-}
532-func NewToplevelGlobal(d *server.Display, version int32, bind server.BindFunc) error {
533- return d.CreateGlobal(ToplevelInterface, version, bind)
534-}
535-
536-// Popup short-lived, popup surfaces for menus.
537-type Popup struct{ *server.Resource }
538-
539-func WrapPopup(r *server.Resource) *Popup {
540- if r == nil {
541- return nil
542- }
543- return &Popup{r}
544-}
545-
546-const PopupRequestDestroy uint32 = 0
547-const PopupRequestGrab uint32 = 1
548-const PopupRequestReposition uint32 = 2
549-const PopupEventConfigure uint32 = 0
550-const PopupEventPopupDone uint32 = 1
551-const PopupEventRepositioned uint32 = 2
552-
553-// PopupError .
554-type PopupError uint32
555-
556-const (
557- PopupErrorInvalidGrab PopupError = 0
558-)
559-
560-// PopupHandler handles xdg_popup requests.
561-type PopupHandler interface {
562- Destroy(self *Popup)
563- Grab(self *Popup, seat *wayland.Seat, serial uint32)
564- Reposition(self *Popup, positioner *Positioner, token uint32)
565-}
566-
567-func NewPopup(c server.Client, version int32, id uint32, h PopupHandler) (*Popup, error) {
568- if h == nil {
569- return nil, fmt.Errorf("purego-libwayland: nil handler for xdg_popup")
570- }
571- var self *Popup
572- r, err := c.CreateResource(PopupInterface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
573- switch opcode {
574- case 0:
575- h.Destroy(self)
576- self.Destroy()
577- case 1:
578- h.Grab(self, wayland.WrapSeat(args[0].Resource()), args[1].Uint())
579- case 2:
580- h.Reposition(self, WrapPositioner(args[0].Resource()), args[1].Uint())
581- }
582- })
583- if err != nil {
584- return nil, err
585- }
586- self = WrapPopup(r)
587- r.Data = self
588- return self, nil
589-}
590-
591-// SendConfigure configure the popup surface.
592-func (self *Popup) SendConfigure(x int32, y int32, width int32, height int32) {
593- self.PostEvent(PopupEventConfigure, server.Int(x), server.Int(y), server.Int(width), server.Int(height))
594-}
595-
596-// SendPopupDone popup interaction is done.
597-func (self *Popup) SendPopupDone() {
598- self.PostEvent(PopupEventPopupDone)
599-}
600-
601-// SendRepositioned signal the completion of a repositioned request (since version 3).
602-func (self *Popup) SendRepositioned(token uint32) {
603- self.PostEvent(PopupEventRepositioned, server.Uint(token))
604-}
605-func NewPopupGlobal(d *server.Display, version int32, bind server.BindFunc) error {
606- return d.CreateGlobal(PopupInterface, version, bind)
607-}
608-func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
609- if v == nil {
610- return nil
611- }
612- return v.GetResource()
613-}
614-func (self *WmBase) GetResource() *server.Resource {
615- if self == nil {
616- return nil
617- }
618- return self.Resource
619-}
620-func (self *Positioner) GetResource() *server.Resource {
621- if self == nil {
622- return nil
623- }
624- return self.Resource
625-}
626-func (self *Surface) GetResource() *server.Resource {
627- if self == nil {
628- return nil
629- }
630- return self.Resource
631-}
632-func (self *Toplevel) GetResource() *server.Resource {
633- if self == nil {
634- return nil
635- }
636- return self.Resource
637-}
638-func (self *Popup) GetResource() *server.Resource {
639- if self == nil {
640- return nil
641- }
642- return self.Resource
643-}
D protocol/xdgshell/xdgshell_test.go +0 -9
@@ -1,9 +0,0 @@
1-package xdgshell
2-
3-import "testing"
4-
5-func TestForwardReference(t *testing.T) {
6- if got := WmBaseInterface.Requests[2].Types[0]; got == nil || got != SurfaceInterface {
7- t.Fatalf("get_xdg_surface type=%v want %v", got, SurfaceInterface)
8- }
9-}
D protocol/xdgsystembell/xdgsystembell.go +0 -78
@@ -1,78 +0,0 @@
1-// Code generated by wlgen; DO NOT EDIT.
2-package xdgsystembell
3-
4-import (
5- "fmt"
6- wayland "github.com/bnema/purego-libwayland/protocol/wayland"
7- "github.com/bnema/purego-libwayland/server"
8-)
9-
10-var SystemBellV1Interface *server.Interface
11-
12-func init() {
13- SystemBellV1Interface = &server.Interface{Name: "xdg_system_bell_v1", Version: 1}
14- SystemBellV1Interface.Requests = []server.Message{
15- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
16- {Name: "ring", Signature: "?o", Types: []*server.Interface{wayland.SurfaceInterface}},
17- }
18- SystemBellV1Interface.Events = []server.Message{}
19- if err := server.NewInterfaces(SystemBellV1Interface); err != nil {
20- panic(err)
21- }
22-}
23-
24-// SystemBellV1 system bell.
25-type SystemBellV1 struct{ *server.Resource }
26-
27-func WrapSystemBellV1(r *server.Resource) *SystemBellV1 {
28- if r == nil {
29- return nil
30- }
31- return &SystemBellV1{r}
32-}
33-
34-const SystemBellV1RequestDestroy uint32 = 0
35-const SystemBellV1RequestRing uint32 = 1
36-
37-// SystemBellV1Handler handles xdg_system_bell_v1 requests.
38-type SystemBellV1Handler interface {
39- Destroy(self *SystemBellV1)
40- Ring(self *SystemBellV1, surface *wayland.Surface)
41-}
42-
43-func NewSystemBellV1(c server.Client, version int32, id uint32, h SystemBellV1Handler) (*SystemBellV1, error) {
44- if h == nil {
45- return nil, fmt.Errorf("purego-libwayland: nil handler for xdg_system_bell_v1")
46- }
47- var self *SystemBellV1
48- r, err := c.CreateResource(SystemBellV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
49- switch opcode {
50- case 0:
51- h.Destroy(self)
52- self.Destroy()
53- case 1:
54- h.Ring(self, wayland.WrapSurface(args[0].Resource()))
55- }
56- })
57- if err != nil {
58- return nil, err
59- }
60- self = WrapSystemBellV1(r)
61- r.Data = self
62- return self, nil
63-}
64-func NewSystemBellV1Global(d *server.Display, version int32, bind server.BindFunc) error {
65- return d.CreateGlobal(SystemBellV1Interface, version, bind)
66-}
67-func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
68- if v == nil {
69- return nil
70- }
71- return v.GetResource()
72-}
73-func (self *SystemBellV1) GetResource() *server.Resource {
74- if self == nil {
75- return nil
76- }
77- return self.Resource
78-}
D protocol/xdgtopleveldrag/xdgtopleveldrag.go +0 -151
@@ -1,151 +0,0 @@
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-}
D protocol/xdgtoplevelicon/xdgtoplevelicon.go +0 -170
@@ -1,170 +0,0 @@
1-// Code generated by wlgen; DO NOT EDIT.
2-package xdgtoplevelicon
3-
4-import (
5- "fmt"
6- wayland "github.com/bnema/purego-libwayland/protocol/wayland"
7- xdgshell "github.com/bnema/purego-libwayland/protocol/xdgshell"
8- "github.com/bnema/purego-libwayland/server"
9-)
10-
11-var ToplevelIconManagerV1Interface *server.Interface
12-var ToplevelIconV1Interface *server.Interface
13-
14-func init() {
15- ToplevelIconManagerV1Interface = &server.Interface{Name: "xdg_toplevel_icon_manager_v1", Version: 1}
16- ToplevelIconV1Interface = &server.Interface{Name: "xdg_toplevel_icon_v1", Version: 1}
17- ToplevelIconManagerV1Interface.Requests = []server.Message{
18- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
19- {Name: "create_icon", Signature: "n", Types: []*server.Interface{ToplevelIconV1Interface}},
20- {Name: "set_icon", Signature: "o?o", Types: []*server.Interface{xdgshell.ToplevelInterface, ToplevelIconV1Interface}},
21- }
22- ToplevelIconManagerV1Interface.Events = []server.Message{
23- {Name: "icon_size", Signature: "i", Types: []*server.Interface{nil}},
24- {Name: "done", Signature: "", Types: []*server.Interface{}},
25- }
26- ToplevelIconV1Interface.Requests = []server.Message{
27- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
28- {Name: "set_name", Signature: "s", Types: []*server.Interface{nil}},
29- {Name: "add_buffer", Signature: "oi", Types: []*server.Interface{wayland.BufferInterface, nil}},
30- }
31- ToplevelIconV1Interface.Events = []server.Message{}
32- if err := server.NewInterfaces(ToplevelIconManagerV1Interface, ToplevelIconV1Interface); err != nil {
33- panic(err)
34- }
35-}
36-
37-// ToplevelIconManagerV1 interface to manage toplevel icons.
38-type ToplevelIconManagerV1 struct{ *server.Resource }
39-
40-func WrapToplevelIconManagerV1(r *server.Resource) *ToplevelIconManagerV1 {
41- if r == nil {
42- return nil
43- }
44- return &ToplevelIconManagerV1{r}
45-}
46-
47-const ToplevelIconManagerV1RequestDestroy uint32 = 0
48-const ToplevelIconManagerV1RequestCreateIcon uint32 = 1
49-const ToplevelIconManagerV1RequestSetIcon uint32 = 2
50-const ToplevelIconManagerV1EventIconSize uint32 = 0
51-const ToplevelIconManagerV1EventDone uint32 = 1
52-
53-// ToplevelIconManagerV1Handler handles xdg_toplevel_icon_manager_v1 requests.
54-type ToplevelIconManagerV1Handler interface {
55- Destroy(self *ToplevelIconManagerV1)
56- CreateIcon(self *ToplevelIconManagerV1, id uint32)
57- SetIcon(self *ToplevelIconManagerV1, toplevel *xdgshell.Toplevel, icon *ToplevelIconV1)
58-}
59-
60-func NewToplevelIconManagerV1(c server.Client, version int32, id uint32, h ToplevelIconManagerV1Handler) (*ToplevelIconManagerV1, error) {
61- if h == nil {
62- return nil, fmt.Errorf("purego-libwayland: nil handler for xdg_toplevel_icon_manager_v1")
63- }
64- var self *ToplevelIconManagerV1
65- r, err := c.CreateResource(ToplevelIconManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
66- switch opcode {
67- case 0:
68- h.Destroy(self)
69- self.Destroy()
70- case 1:
71- h.CreateIcon(self, args[0].NewID())
72- case 2:
73- h.SetIcon(self, xdgshell.WrapToplevel(args[0].Resource()), WrapToplevelIconV1(args[1].Resource()))
74- }
75- })
76- if err != nil {
77- return nil, err
78- }
79- self = WrapToplevelIconManagerV1(r)
80- r.Data = self
81- return self, nil
82-}
83-
84-// SendIconSize describes a supported & preferred icon size.
85-func (self *ToplevelIconManagerV1) SendIconSize(size int32) {
86- self.PostEvent(ToplevelIconManagerV1EventIconSize, server.Int(size))
87-}
88-
89-// SendDone all information has been sent.
90-func (self *ToplevelIconManagerV1) SendDone() {
91- self.PostEvent(ToplevelIconManagerV1EventDone)
92-}
93-func NewToplevelIconManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
94- return d.CreateGlobal(ToplevelIconManagerV1Interface, version, bind)
95-}
96-
97-// ToplevelIconV1 a toplevel window icon.
98-type ToplevelIconV1 struct{ *server.Resource }
99-
100-func WrapToplevelIconV1(r *server.Resource) *ToplevelIconV1 {
101- if r == nil {
102- return nil
103- }
104- return &ToplevelIconV1{r}
105-}
106-
107-const ToplevelIconV1RequestDestroy uint32 = 0
108-const ToplevelIconV1RequestSetName uint32 = 1
109-const ToplevelIconV1RequestAddBuffer uint32 = 2
110-
111-// ToplevelIconV1Error .
112-type ToplevelIconV1Error uint32
113-
114-const (
115- ToplevelIconV1ErrorInvalidBuffer ToplevelIconV1Error = 1
116- ToplevelIconV1ErrorImmutable ToplevelIconV1Error = 2
117- ToplevelIconV1ErrorNoBuffer ToplevelIconV1Error = 3
118-)
119-
120-// ToplevelIconV1Handler handles xdg_toplevel_icon_v1 requests.
121-type ToplevelIconV1Handler interface {
122- Destroy(self *ToplevelIconV1)
123- SetName(self *ToplevelIconV1, iconName string)
124- AddBuffer(self *ToplevelIconV1, buffer *wayland.Buffer, scale int32)
125-}
126-
127-func NewToplevelIconV1(c server.Client, version int32, id uint32, h ToplevelIconV1Handler) (*ToplevelIconV1, error) {
128- if h == nil {
129- return nil, fmt.Errorf("purego-libwayland: nil handler for xdg_toplevel_icon_v1")
130- }
131- var self *ToplevelIconV1
132- r, err := c.CreateResource(ToplevelIconV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
133- switch opcode {
134- case 0:
135- h.Destroy(self)
136- self.Destroy()
137- case 1:
138- h.SetName(self, args[0].String())
139- case 2:
140- h.AddBuffer(self, wayland.WrapBuffer(args[0].Resource()), args[1].Int())
141- }
142- })
143- if err != nil {
144- return nil, err
145- }
146- self = WrapToplevelIconV1(r)
147- r.Data = self
148- return self, nil
149-}
150-func NewToplevelIconV1Global(d *server.Display, version int32, bind server.BindFunc) error {
151- return d.CreateGlobal(ToplevelIconV1Interface, version, bind)
152-}
153-func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
154- if v == nil {
155- return nil
156- }
157- return v.GetResource()
158-}
159-func (self *ToplevelIconManagerV1) GetResource() *server.Resource {
160- if self == nil {
161- return nil
162- }
163- return self.Resource
164-}
165-func (self *ToplevelIconV1) GetResource() *server.Resource {
166- if self == nil {
167- return nil
168- }
169- return self.Resource
170-}
D protocol/xdgtopleveltag/xdgtopleveltag.go +0 -83
@@ -1,83 +0,0 @@
1-// Code generated by wlgen; DO NOT EDIT.
2-package xdgtopleveltag
3-
4-import (
5- "fmt"
6- xdgshell "github.com/bnema/purego-libwayland/protocol/xdgshell"
7- "github.com/bnema/purego-libwayland/server"
8-)
9-
10-var ToplevelTagManagerV1Interface *server.Interface
11-
12-func init() {
13- ToplevelTagManagerV1Interface = &server.Interface{Name: "xdg_toplevel_tag_manager_v1", Version: 1}
14- ToplevelTagManagerV1Interface.Requests = []server.Message{
15- {Name: "destroy", Signature: "", Types: []*server.Interface{}},
16- {Name: "set_toplevel_tag", Signature: "os", Types: []*server.Interface{xdgshell.ToplevelInterface, nil}},
17- {Name: "set_toplevel_description", Signature: "os", Types: []*server.Interface{xdgshell.ToplevelInterface, nil}},
18- }
19- ToplevelTagManagerV1Interface.Events = []server.Message{}
20- if err := server.NewInterfaces(ToplevelTagManagerV1Interface); err != nil {
21- panic(err)
22- }
23-}
24-
25-// ToplevelTagManagerV1 protocol for setting toplevel tags.
26-type ToplevelTagManagerV1 struct{ *server.Resource }
27-
28-func WrapToplevelTagManagerV1(r *server.Resource) *ToplevelTagManagerV1 {
29- if r == nil {
30- return nil
31- }
32- return &ToplevelTagManagerV1{r}
33-}
34-
35-const ToplevelTagManagerV1RequestDestroy uint32 = 0
36-const ToplevelTagManagerV1RequestSetToplevelTag uint32 = 1
37-const ToplevelTagManagerV1RequestSetToplevelDescription uint32 = 2
38-
39-// ToplevelTagManagerV1Handler handles xdg_toplevel_tag_manager_v1 requests.
40-type ToplevelTagManagerV1Handler interface {
41- Destroy(self *ToplevelTagManagerV1)
42- SetToplevelTag(self *ToplevelTagManagerV1, toplevel *xdgshell.Toplevel, tag string)
43- SetToplevelDescription(self *ToplevelTagManagerV1, toplevel *xdgshell.Toplevel, description string)
44-}
45-
46-func NewToplevelTagManagerV1(c server.Client, version int32, id uint32, h ToplevelTagManagerV1Handler) (*ToplevelTagManagerV1, error) {
47- if h == nil {
48- return nil, fmt.Errorf("purego-libwayland: nil handler for xdg_toplevel_tag_manager_v1")
49- }
50- var self *ToplevelTagManagerV1
51- r, err := c.CreateResource(ToplevelTagManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
52- switch opcode {
53- case 0:
54- h.Destroy(self)
55- self.Destroy()
56- case 1:
57- h.SetToplevelTag(self, xdgshell.WrapToplevel(args[0].Resource()), args[1].String())
58- case 2:
59- h.SetToplevelDescription(self, xdgshell.WrapToplevel(args[0].Resource()), args[1].String())
60- }
61- })
62- if err != nil {
63- return nil, err
64- }
65- self = WrapToplevelTagManagerV1(r)
66- r.Data = self
67- return self, nil
68-}
69-func NewToplevelTagManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
70- return d.CreateGlobal(ToplevelTagManagerV1Interface, version, bind)
71-}
72-func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
73- if v == nil {
74- return nil
75- }
76- return v.GetResource()
77-}
78-func (self *ToplevelTagManagerV1) GetResource() *server.Resource {
79- if self == nil {
80- return nil
81- }
82- return self.Resource
83-}
D protocol/xwaylandkeyboardgrab/xwaylandkeyboardgrab.go +0 -130
@@ -1,130 +0,0 @@
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-}
D protocol/xwaylandshell/xwaylandshell.go +0 -150
@@ -1,150 +0,0 @@
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-}
D protocols/alpha-modifier-v1.xml +0 -103
@@ -1,103 +0,0 @@
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>
D protocols/color-management-v1.xml +0 -1756
@@ -1,1756 +0,0 @@
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>
D protocols/color-representation-v1.xml +0 -433
@@ -1,433 +0,0 @@
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>
D protocols/commit-timing-v1.xml +0 -124
@@ -1,124 +0,0 @@
1-<?xml version="1.0" encoding="UTF-8"?>
2-<protocol name="commit_timing_v1">
3-
4- <copyright>
5- Copyright © 2023 Valve Corporation
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="wp_commit_timing_manager_v1" version="1">
28- <description summary="commit timing">
29- When a compositor latches on to new content updates it will check for
30- any number of requirements of the available content updates (such as
31- fences of all buffers being signalled) to consider the update ready.
32-
33- This protocol provides a method for adding a time constraint to surface
34- content. This constraint indicates to the compositor that a content
35- update should be presented as closely as possible to, but not before,
36- a specified time.
37-
38- This protocol does not change the Wayland property that content
39- updates are applied in the order they are received, even when some
40- content updates contain timestamps and others do not.
41-
42- To provide timestamps, this global factory interface must be used to
43- acquire a wp_commit_timing_v1 object for a surface, which may then be
44- used to provide timestamp information for commits.
45-
46- Warning! The protocol described in this file is currently in the testing
47- phase. Backward compatible changes may be added together with the
48- corresponding interface version bump. Backward incompatible changes can
49- only be done by creating a new major version of the extension.
50- </description>
51- <enum name="error">
52- <entry name="commit_timer_exists" value="0"
53- summary="commit timer already exists for surface"/>
54- </enum>
55-
56- <request name="destroy" type="destructor">
57- <description summary="unbind from the commit timing interface">
58- Informs the server that the client will no longer be using
59- this protocol object. Existing objects created by this object
60- are not affected.
61- </description>
62- </request>
63-
64- <request name="get_timer">
65- <description summary="request commit timer interface for surface">
66- Establish a timing controller for a surface.
67-
68- Only one commit timer can be created for a surface, or a
69- commit_timer_exists protocol error will be generated.
70- </description>
71- <arg name="id" type="new_id" interface="wp_commit_timer_v1"/>
72- <arg name="surface" type="object" interface="wl_surface"/>
73- </request>
74- </interface>
75-
76- <interface name="wp_commit_timer_v1" version="1">
77- <description summary="Surface commit timer">
78- An object to set a time constraint for a content update on a surface.
79- </description>
80-
81- <enum name="error">
82- <entry name="invalid_timestamp" value="0"
83- summary="timestamp contains an invalid value"/>
84- <entry name="timestamp_exists" value="1"
85- summary="timestamp exists"/>
86- <entry name="surface_destroyed" value="2"
87- summary="the associated surface no longer exists"/>
88- </enum>
89-
90- <request name="set_timestamp">
91- <description summary="Specify time the following commit takes effect">
92- Provide a timing constraint for a surface content update.
93-
94- A set_timestamp request may be made before a wl_surface.commit to
95- tell the compositor that the content is intended to be presented
96- as closely as possible to, but not before, the specified time.
97- The time is in the domain of the compositor's presentation clock.
98-
99- An invalid_timestamp error will be generated for invalid tv_nsec.
100-
101- If a timestamp already exists on the surface, a timestamp_exists
102- error is generated.
103-
104- Requesting set_timestamp after the commit_timer object's surface is
105- destroyed will generate a "surface_destroyed" error.
106- </description>
107- <arg name="tv_sec_hi" type="uint"
108- summary="high 32 bits of the seconds part of target time"/>
109- <arg name="tv_sec_lo" type="uint"
110- summary="low 32 bits of the seconds part of target time"/>
111- <arg name="tv_nsec" type="uint"
112- summary="nanoseconds part of target time"/>
113- </request>
114-
115- <request name="destroy" type="destructor">
116- <description summary="Destroy the timer">
117- Informs the server that the client will no longer be using
118- this protocol object.
119-
120- Existing timing constraints are not affected by the destruction.
121- </description>
122- </request>
123- </interface>
124-</protocol>
D protocols/content-type-v1.xml +0 -128
@@ -1,128 +0,0 @@
1-<?xml version="1.0" encoding="UTF-8"?>
2-<protocol name="content_type_v1">
3- <copyright>
4- Copyright © 2021 Emmanuel Gil Peyrot
5- Copyright © 2022 Xaver Hugl
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="wp_content_type_manager_v1" version="1">
28- <description summary="surface content type manager">
29- This interface allows a client to describe the kind of content a surface
30- will display, to allow the compositor to optimize its behavior for it.
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 content type manager object">
40- Destroy the content type manager. This doesn't destroy objects created
41- 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 content type object"/>
48- </enum>
49-
50- <request name="get_surface_content_type">
51- <description summary="create a new content type object">
52- Create a new content type object associated with the given surface.
53-
54- Creating a wp_content_type_v1 from a wl_surface which already has one
55- attached is a client error: already_constructed.
56- </description>
57- <arg name="id" type="new_id" interface="wp_content_type_v1"/>
58- <arg name="surface" type="object" interface="wl_surface"/>
59- </request>
60- </interface>
61-
62- <interface name="wp_content_type_v1" version="1">
63- <description summary="content type object for a surface">
64- The content type object allows the compositor to optimize for the kind
65- of content shown on the surface. A compositor may for example use it to
66- set relevant drm properties like "content type".
67-
68- The client may request to switch to another content type at any time.
69- When the associated surface gets destroyed, this object becomes inert and
70- the client should destroy it.
71- </description>
72-
73- <request name="destroy" type="destructor">
74- <description summary="destroy the content type object">
75- Switch back to not specifying the content type of this surface. This is
76- equivalent to setting the content type to none, including double
77- buffering semantics. See set_content_type for details.
78- </description>
79- </request>
80-
81- <enum name="type">
82- <description summary="possible content types">
83- These values describe the available content types for a surface.
84- </description>
85- <entry name="none" value="0">
86- <description summary="no content type applies">
87- The content type none means that either the application has no data
88- about the content type, or that the content doesn't fit into one of
89- the other categories.
90- </description>
91- </entry>
92- <entry name="photo" value="1">
93- <description summary="photo content type">
94- The content type photo describes content derived from digital still
95- pictures and may be presented with minimal processing.
96- </description>
97- </entry>
98- <entry name="video" value="2">
99- <description summary="video content type">
100- The content type video describes a video or animation and may be
101- presented with more accurate timing to avoid stutter. Where scaling
102- is needed, scaling methods more appropriate for video may be used.
103- </description>
104- </entry>
105- <entry name="game" value="3">
106- <description summary="game content type">
107- The content type game describes a running game. Its content may be
108- presented with reduced latency.
109- </description>
110- </entry>
111- </enum>
112-
113- <request name="set_content_type">
114- <description summary="specify the content type">
115- Set the surface content type. This informs the compositor that the
116- client believes it is displaying buffers matching this content type.
117-
118- This is purely a hint for the compositor, which can be used to adjust
119- its behavior or hardware settings to fit the presented content best.
120-
121- The content type is double-buffered state, see wl_surface.commit for
122- details.
123- </description>
124- <arg name="content_type" type="uint" enum="type"
125- summary="the content type"/>
126- </request>
127- </interface>
128-</protocol>
D protocols/cursor-shape-v1.xml +0 -162
@@ -1,162 +0,0 @@
1-<?xml version="1.0" encoding="UTF-8"?>
2-<protocol name="cursor_shape_v1">
3- <copyright>
4- Copyright 2018 The Chromium Authors
5- Copyright 2023 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- 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- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19- THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22- DEALINGS IN THE SOFTWARE.
23- </copyright>
24-
25- <interface name="wp_cursor_shape_manager_v1" version="2">
26- <description summary="cursor shape manager">
27- This global offers an alternative, optional way to set cursor images. This
28- new way uses enumerated cursors instead of a wl_surface like
29- wl_pointer.set_cursor does.
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- <request name="destroy" type="destructor">
38- <description summary="destroy the manager">
39- Destroy the cursor shape manager.
40- </description>
41- </request>
42-
43- <request name="get_pointer">
44- <description summary="manage the cursor shape of a pointer device">
45- Obtain a wp_cursor_shape_device_v1 for a wl_pointer object.
46-
47- When the pointer capability is removed from the wl_seat, the
48- wp_cursor_shape_device_v1 object becomes inert.
49- </description>
50- <arg name="cursor_shape_device" type="new_id" interface="wp_cursor_shape_device_v1"/>
51- <arg name="pointer" type="object" interface="wl_pointer"/>
52- </request>
53-
54- <request name="get_tablet_tool_v2">
55- <description summary="manage the cursor shape of a tablet tool device">
56- Obtain a wp_cursor_shape_device_v1 for a zwp_tablet_tool_v2 object.
57-
58- When the zwp_tablet_tool_v2 is removed, the wp_cursor_shape_device_v1
59- object becomes inert.
60- </description>
61- <arg name="cursor_shape_device" type="new_id" interface="wp_cursor_shape_device_v1"/>
62- <arg name="tablet_tool" type="object" interface="zwp_tablet_tool_v2"/>
63- </request>
64- </interface>
65-
66- <interface name="wp_cursor_shape_device_v1" version="2">
67- <description summary="cursor shape for a device">
68- This interface allows clients to set the cursor shape.
69- </description>
70-
71- <enum name="shape">
72- <description summary="cursor shapes">
73- This enum describes cursor shapes.
74-
75- The names are taken from the CSS W3C specification:
76- https://w3c.github.io/csswg-drafts/css-ui/#cursor
77- with a few additions.
78-
79- Note that there are some groups of cursor shapes that are related:
80- The first group is drag-and-drop cursors which are used to indicate
81- the selected action during dnd operations. The second group is resize
82- cursors which are used to indicate resizing and moving possibilities
83- on window borders. It is recommended that the shapes in these groups
84- should use visually compatible images and metaphors.
85- </description>
86- <entry name="default" value="1" summary="default cursor"/>
87- <entry name="context_menu" value="2" summary="a context menu is available for the object under the cursor"/>
88- <entry name="help" value="3" summary="help is available for the object under the cursor"/>
89- <entry name="pointer" value="4" summary="pointer that indicates a link or another interactive element"/>
90- <entry name="progress" value="5" summary="progress indicator"/>
91- <entry name="wait" value="6" summary="program is busy, user should wait"/>
92- <entry name="cell" value="7" summary="a cell or set of cells may be selected"/>
93- <entry name="crosshair" value="8" summary="simple crosshair"/>
94- <entry name="text" value="9" summary="text may be selected"/>
95- <entry name="vertical_text" value="10" summary="vertical text may be selected"/>
96- <entry name="alias" value="11" summary="drag-and-drop: alias of/shortcut to something is to be created"/>
97- <entry name="copy" value="12" summary="drag-and-drop: something is to be copied"/>
98- <entry name="move" value="13" summary="drag-and-drop: something is to be moved"/>
99- <entry name="no_drop" value="14" summary="drag-and-drop: the dragged item cannot be dropped at the current cursor location"/>
100- <entry name="not_allowed" value="15" summary="drag-and-drop: the requested action will not be carried out"/>
101- <entry name="grab" value="16" summary="drag-and-drop: something can be grabbed"/>
102- <entry name="grabbing" value="17" summary="drag-and-drop: something is being grabbed"/>
103- <entry name="e_resize" value="18" summary="resizing: the east border is to be moved"/>
104- <entry name="n_resize" value="19" summary="resizing: the north border is to be moved"/>
105- <entry name="ne_resize" value="20" summary="resizing: the north-east corner is to be moved"/>
106- <entry name="nw_resize" value="21" summary="resizing: the north-west corner is to be moved"/>
107- <entry name="s_resize" value="22" summary="resizing: the south border is to be moved"/>
108- <entry name="se_resize" value="23" summary="resizing: the south-east corner is to be moved"/>
109- <entry name="sw_resize" value="24" summary="resizing: the south-west corner is to be moved"/>
110- <entry name="w_resize" value="25" summary="resizing: the west border is to be moved"/>
111- <entry name="ew_resize" value="26" summary="resizing: the east and west borders are to be moved"/>
112- <entry name="ns_resize" value="27" summary="resizing: the north and south borders are to be moved"/>
113- <entry name="nesw_resize" value="28" summary="resizing: the north-east and south-west corners are to be moved"/>
114- <entry name="nwse_resize" value="29" summary="resizing: the north-west and south-east corners are to be moved"/>
115- <entry name="col_resize" value="30" summary="resizing: that the item/column can be resized horizontally"/>
116- <entry name="row_resize" value="31" summary="resizing: that the item/row can be resized vertically"/>
117- <entry name="all_scroll" value="32" summary="something can be scrolled in any direction"/>
118- <entry name="zoom_in" value="33" summary="something can be zoomed in"/>
119- <entry name="zoom_out" value="34" summary="something can be zoomed out"/>
120- <entry name="dnd_ask" value="35" summary="drag-and-drop: the user will select which action will be carried out (non-css value)" since="2"/>
121- <entry name="all_resize" value="36" summary="resizing: something can be moved or resized in any direction (non-css value)" since="2"/>
122- </enum>
123-
124- <enum name="error">
125- <entry name="invalid_shape" value="1"
126- summary="the specified shape value is invalid"/>
127- </enum>
128-
129- <request name="destroy" type="destructor">
130- <description summary="destroy the cursor shape device">
131- Destroy the cursor shape device.
132-
133- The device cursor shape remains unchanged.
134- </description>
135- </request>
136-
137- <request name="set_shape">
138- <description summary="set device cursor to the shape">
139- Sets the device cursor to the specified shape. The compositor will
140- change the cursor image based on the specified shape.
141-
142- The cursor actually changes only if the input device focus is one of
143- the requesting client's surfaces. If any, the previous cursor image
144- (surface or shape) is replaced.
145-
146- The "shape" argument must be a valid enum entry, otherwise the
147- invalid_shape protocol error is raised.
148-
149- This is similar to the wl_pointer.set_cursor and
150- zwp_tablet_tool_v2.set_cursor requests, but this request accepts a
151- shape instead of contents in the form of a surface. Clients can mix
152- set_cursor and set_shape requests.
153-
154- The serial parameter must match the latest wl_pointer.enter or
155- zwp_tablet_tool_v2.proximity_in serial number sent to the client.
156- Otherwise the request will be ignored.
157- </description>
158- <arg name="serial" type="uint" summary="serial number of the enter event"/>
159- <arg name="shape" type="uint" enum="shape"/>
160- </request>
161- </interface>
162-</protocol>
D protocols/drm-lease-v1.xml +0 -317
@@ -1,317 +0,0 @@
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>
D protocols/ext-background-effect-v1.xml +0 -129
@@ -1,129 +0,0 @@
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>
D protocols/ext-data-control-v1.xml +0 -276
@@ -1,276 +0,0 @@
1-<?xml version="1.0" encoding="UTF-8"?>
2-<protocol name="ext_data_control_v1">
3- <copyright>
4- Copyright © 2018 Simon Ser
5- Copyright © 2019 Ivan Molodetskikh
6- Copyright © 2024 Neal Gompa
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- <description summary="control data devices">
31- This protocol allows a privileged client to control data devices. In
32- particular, the client will be able to manage the current selection and take
33- the role of a clipboard manager.
34-
35- Warning! The protocol described in this file is currently in the testing
36- phase. Backward compatible changes may be added together with the
37- corresponding interface version bump. Backward incompatible changes can
38- only be done by creating a new major version of the extension.
39- </description>
40-
41- <interface name="ext_data_control_manager_v1" version="1">
42- <description summary="manager to control data devices">
43- This interface is a manager that allows creating per-seat data device
44- controls.
45- </description>
46-
47- <request name="create_data_source">
48- <description summary="create a new data source">
49- Create a new data source.
50- </description>
51- <arg name="id" type="new_id" interface="ext_data_control_source_v1"
52- summary="data source to create"/>
53- </request>
54-
55- <request name="get_data_device">
56- <description summary="get a data device for a seat">
57- Create a data device that can be used to manage a seat's selection.
58- </description>
59- <arg name="id" type="new_id" interface="ext_data_control_device_v1"/>
60- <arg name="seat" type="object" interface="wl_seat"/>
61- </request>
62-
63- <request name="destroy" type="destructor">
64- <description summary="destroy the manager">
65- All objects created by the manager will still remain valid, until their
66- appropriate destroy request has been called.
67- </description>
68- </request>
69- </interface>
70-
71- <interface name="ext_data_control_device_v1" version="1">
72- <description summary="manage a data device for a seat">
73- This interface allows a client to manage a seat's selection.
74-
75- When the seat is destroyed, this object becomes inert.
76- </description>
77-
78- <request name="set_selection">
79- <description summary="copy data to the selection">
80- This request asks the compositor to set the selection to the data from
81- the source on behalf of the client.
82-
83- The given source may not be used in any further set_selection or
84- set_primary_selection requests. Attempting to use a previously used
85- source triggers the used_source protocol error.
86-
87- To unset the selection, set the source to NULL.
88- </description>
89- <arg name="source" type="object" interface="ext_data_control_source_v1"
90- allow-null="true"/>
91- </request>
92-
93- <request name="destroy" type="destructor">
94- <description summary="destroy this data device">
95- Destroys the data device object.
96- </description>
97- </request>
98-
99- <event name="data_offer">
100- <description summary="introduce a new ext_data_control_offer">
101- The data_offer event introduces a new ext_data_control_offer object,
102- which will subsequently be used in either the
103- ext_data_control_device.selection event (for the regular clipboard
104- selections) or the ext_data_control_device.primary_selection event (for
105- the primary clipboard selections). Immediately following the
106- ext_data_control_device.data_offer event, the new data_offer object
107- will send out ext_data_control_offer.offer events to describe the MIME
108- types it offers.
109- </description>
110- <arg name="id" type="new_id" interface="ext_data_control_offer_v1"/>
111- </event>
112-
113- <event name="selection">
114- <description summary="advertise new selection">
115- The selection event is sent out to notify the client of a new
116- ext_data_control_offer for the selection for this device. The
117- ext_data_control_device.data_offer and the ext_data_control_offer.offer
118- events are sent out immediately before this event to introduce the data
119- offer object. The selection event is sent to a client when a new
120- selection is set. The ext_data_control_offer is valid until a new
121- ext_data_control_offer or NULL is received. The client must destroy the
122- previous selection ext_data_control_offer, if any, upon receiving this
123- event. Regardless, the previous selection will be ignored once a new
124- selection ext_data_control_offer is received.
125-
126- The first selection event is sent upon binding the
127- ext_data_control_device object.
128- </description>
129- <arg name="id" type="object" interface="ext_data_control_offer_v1"
130- allow-null="true"/>
131- </event>
132-
133- <event name="finished">
134- <description summary="this data control is no longer valid">
135- This data control object is no longer valid and should be destroyed by
136- the client.
137- </description>
138- </event>
139-
140- <event name="primary_selection">
141- <description summary="advertise new primary selection">
142- The primary_selection event is sent out to notify the client of a new
143- ext_data_control_offer for the primary selection for this device. The
144- ext_data_control_device.data_offer and the ext_data_control_offer.offer
145- events are sent out immediately before this event to introduce the data
146- offer object. The primary_selection event is sent to a client when a
147- new primary selection is set. The ext_data_control_offer is valid until
148- a new ext_data_control_offer or NULL is received. The client must
149- destroy the previous primary selection ext_data_control_offer, if any,
150- upon receiving this event. Regardless, the previous primary selection
151- will be ignored once a new primary selection ext_data_control_offer is
152- received.
153-
154- If the compositor supports primary selection, the first
155- primary_selection event is sent upon binding the
156- ext_data_control_device object.
157- </description>
158- <arg name="id" type="object" interface="ext_data_control_offer_v1"
159- allow-null="true"/>
160- </event>
161-
162- <request name="set_primary_selection">
163- <description summary="copy data to the primary selection">
164- This request asks the compositor to set the primary selection to the
165- data from the source on behalf of the client.
166-
167- The given source may not be used in any further set_selection or
168- set_primary_selection requests. Attempting to use a previously used
169- source triggers the used_source protocol error.
170-
171- To unset the primary selection, set the source to NULL.
172-
173- The compositor will ignore this request if it does not support primary
174- selection.
175- </description>
176- <arg name="source" type="object" interface="ext_data_control_source_v1"
177- allow-null="true"/>
178- </request>
179-
180- <enum name="error">
181- <entry name="used_source" value="1"
182- summary="source given to set_selection or set_primary_selection was already used before"/>
183- </enum>
184- </interface>
185-
186- <interface name="ext_data_control_source_v1" version="1">
187- <description summary="offer to transfer data">
188- The ext_data_control_source object is the source side of a
189- ext_data_control_offer. It is created by the source client in a data
190- transfer and provides a way to describe the offered data and a way to
191- respond to requests to transfer the data.
192- </description>
193-
194- <enum name="error">
195- <entry name="invalid_offer" value="1"
196- summary="offer sent after ext_data_control_device.set_selection"/>
197- </enum>
198-
199- <request name="offer">
200- <description summary="add an offered MIME type">
201- This request adds a MIME type to the set of MIME types advertised to
202- targets. Can be called several times to offer multiple types.
203-
204- Calling this after ext_data_control_device.set_selection is a protocol
205- error.
206- </description>
207- <arg name="mime_type" type="string"
208- summary="MIME type offered by the data source"/>
209- </request>
210-
211- <request name="destroy" type="destructor">
212- <description summary="destroy this source">
213- Destroys the data source object.
214- </description>
215- </request>
216-
217- <event name="send">
218- <description summary="send the data">
219- Request for data from the client. Send the data as the specified MIME
220- type over the passed file descriptor, then close it.
221- </description>
222- <arg name="mime_type" type="string" summary="MIME type for the data"/>
223- <arg name="fd" type="fd" summary="file descriptor for the data"/>
224- </event>
225-
226- <event name="cancelled">
227- <description summary="selection was cancelled">
228- This data source is no longer valid. The data source has been replaced
229- by another data source.
230-
231- The client should clean up and destroy this data source.
232- </description>
233- </event>
234- </interface>
235-
236- <interface name="ext_data_control_offer_v1" version="1">
237- <description summary="offer to transfer data">
238- A ext_data_control_offer represents a piece of data offered for transfer
239- by another client (the source client). The offer describes the different
240- MIME types that the data can be converted to and provides the mechanism
241- for transferring the data directly from the source client.
242- </description>
243-
244- <request name="receive">
245- <description summary="request that the data is transferred">
246- To transfer the offered data, the client issues this request and
247- indicates the MIME type it wants to receive. The transfer happens
248- through the passed file descriptor (typically created with the pipe
249- system call). The source client writes the data in the MIME type
250- representation requested and then closes the file descriptor.
251-
252- The receiving client reads from the read end of the pipe until EOF and
253- then closes its end, at which point the transfer is complete.
254-
255- This request may happen multiple times for different MIME types.
256- </description>
257- <arg name="mime_type" type="string"
258- summary="MIME type desired by receiver"/>
259- <arg name="fd" type="fd" summary="file descriptor for data transfer"/>
260- </request>
261-
262- <request name="destroy" type="destructor">
263- <description summary="destroy this offer">
264- Destroys the data offer object.
265- </description>
266- </request>
267-
268- <event name="offer">
269- <description summary="advertise offered MIME type">
270- Sent immediately after creating the ext_data_control_offer object.
271- One event per offered MIME type.
272- </description>
273- <arg name="mime_type" type="string" summary="offered MIME type"/>
274- </event>
275- </interface>
276-</protocol>
D protocols/ext-foreign-toplevel-list-v1.xml +0 -219
@@ -1,219 +0,0 @@
1-<?xml version="1.0" encoding="UTF-8"?>
2-<protocol name="ext_foreign_toplevel_list_v1">
3- <copyright>
4- Copyright © 2018 Ilia Bozhinov
5- Copyright © 2020 Isaac Freund
6- Copyright © 2022 wb9688
7- Copyright © 2023 i509VCB
8-
9- Permission to use, copy, modify, distribute, and sell this
10- software and its documentation for any purpose is hereby granted
11- without fee, provided that the above copyright notice appear in
12- all copies and that both that copyright notice and this permission
13- notice appear in supporting documentation, and that the name of
14- the copyright holders not be used in advertising or publicity
15- pertaining to distribution of the software without specific,
16- written prior permission. The copyright holders make no
17- representations about the suitability of this software for any
18- purpose. It is provided "as is" without express or implied
19- warranty.
20-
21- THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
22- SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
23- FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
24- SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
25- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
26- AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
27- ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
28- THIS SOFTWARE.
29- </copyright>
30-
31- <description summary="list toplevels">
32- The purpose of this protocol is to provide protocol object handles for
33- toplevels, possibly originating from another client.
34-
35- This protocol is intentionally minimalistic and expects additional
36- functionality (e.g. creating a screencopy source from a toplevel handle,
37- getting information about the state of the toplevel) to be implemented
38- in extension protocols.
39-
40- The compositor may choose to restrict this protocol to a special client
41- launched by the compositor itself or expose it to all clients,
42- this is compositor policy.
43-
44- The key words "must", "must not", "required", "shall", "shall not",
45- "should", "should not", "recommended", "may", and "optional" in this
46- document are to be interpreted as described in IETF RFC 2119.
47-
48- Warning! The protocol described in this file is currently in the testing
49- phase. Backward compatible changes may be added together with the
50- corresponding interface version bump. Backward incompatible changes can
51- only be done by creating a new major version of the extension.
52- </description>
53-
54- <interface name="ext_foreign_toplevel_list_v1" version="1">
55- <description summary="list toplevels">
56- A toplevel is defined as a surface with a role similar to xdg_toplevel.
57- XWayland surfaces may be treated like toplevels in this protocol.
58-
59- After a client binds the ext_foreign_toplevel_list_v1, each mapped
60- toplevel window will be sent using the ext_foreign_toplevel_list_v1.toplevel
61- event.
62-
63- Clients which only care about the current state can perform a roundtrip after
64- binding this global.
65-
66- For each instance of ext_foreign_toplevel_list_v1, the compositor must
67- create a new ext_foreign_toplevel_handle_v1 object for each mapped toplevel.
68-
69- If a compositor implementation sends the ext_foreign_toplevel_list_v1.finished
70- event after the global is bound, the compositor must not send any
71- ext_foreign_toplevel_list_v1.toplevel events.
72- </description>
73-
74- <event name="toplevel">
75- <description summary="a toplevel has been created">
76- This event is emitted whenever a new toplevel window is created. It is
77- emitted for all toplevels, regardless of the app that has created them.
78-
79- All initial properties of the toplevel (identifier, title, app_id) will be sent
80- immediately after this event using the corresponding events for
81- ext_foreign_toplevel_handle_v1. The compositor will use the
82- ext_foreign_toplevel_handle_v1.done event to indicate when all data has
83- been sent.
84- </description>
85- <arg name="toplevel" type="new_id" interface="ext_foreign_toplevel_handle_v1"/>
86- </event>
87-
88- <event name="finished">
89- <description summary="the compositor has finished with the toplevel manager">
90- This event indicates that the compositor is done sending events
91- to this object. The client should destroy the object.
92- See ext_foreign_toplevel_list_v1.destroy for more information.
93-
94- The compositor must not send any more toplevel events after this event.
95- </description>
96- </event>
97-
98- <request name="stop">
99- <description summary="stop sending events">
100- This request indicates that the client no longer wishes to receive
101- events for new toplevels.
102-
103- The Wayland protocol is asynchronous, meaning the compositor may send
104- further toplevel events until the stop request is processed.
105- The client should wait for a ext_foreign_toplevel_list_v1.finished
106- event before destroying this object.
107- </description>
108- </request>
109-
110- <request name="destroy" type="destructor">
111- <description summary="destroy the ext_foreign_toplevel_list_v1 object">
112- This request should be called either when the client will no longer
113- use the ext_foreign_toplevel_list_v1 or after the finished event
114- has been received to allow destruction of the object.
115-
116- If a client wishes to destroy this object it should send a
117- ext_foreign_toplevel_list_v1.stop request and wait for a ext_foreign_toplevel_list_v1.finished
118- event, then destroy the handles and then this object.
119- </description>
120- </request>
121- </interface>
122-
123- <interface name="ext_foreign_toplevel_handle_v1" version="1">
124- <description summary="a mapped toplevel">
125- A ext_foreign_toplevel_handle_v1 object represents a mapped toplevel
126- window. A single app may have multiple mapped toplevels.
127- </description>
128-
129- <request name="destroy" type="destructor">
130- <description summary="destroy the ext_foreign_toplevel_handle_v1 object">
131- This request should be used when the client will no longer use the handle
132- or after the closed event has been received to allow destruction of the
133- object.
134-
135- When a handle is destroyed, a new handle may not be created by the server
136- until the toplevel is unmapped and then remapped. Destroying a toplevel handle
137- is not recommended unless the client is cleaning up child objects
138- before destroying the ext_foreign_toplevel_list_v1 object, the toplevel
139- was closed or the toplevel handle will not be used in the future.
140-
141- Other protocols which extend the ext_foreign_toplevel_handle_v1
142- interface should require destructors for extension interfaces be
143- called before allowing the toplevel handle to be destroyed.
144- </description>
145- </request>
146-
147- <event name="closed">
148- <description summary="the toplevel has been closed">
149- The server will emit no further events on the ext_foreign_toplevel_handle_v1
150- after this event. Any requests received aside from the destroy request must
151- be ignored. Upon receiving this event, the client should destroy the handle.
152-
153- Other protocols which extend the ext_foreign_toplevel_handle_v1
154- interface must also ignore requests other than destructors.
155- </description>
156- </event>
157-
158- <event name="done">
159- <description summary="all information about the toplevel has been sent">
160- This event is sent after all changes in the toplevel state have
161- been sent.
162-
163- This allows changes to the ext_foreign_toplevel_handle_v1 properties
164- to be atomically applied. Other protocols which extend the
165- ext_foreign_toplevel_handle_v1 interface may use this event to also
166- atomically apply any pending state.
167-
168- This event must not be sent after the ext_foreign_toplevel_handle_v1.closed
169- event.
170- </description>
171- </event>
172-
173- <event name="title">
174- <description summary="title change">
175- The title of the toplevel has changed.
176-
177- The configured state must not be applied immediately. See
178- ext_foreign_toplevel_handle_v1.done for details.
179- </description>
180- <arg name="title" type="string"/>
181- </event>
182-
183- <event name="app_id">
184- <description summary="app_id change">
185- The app id of the toplevel has changed.
186-
187- The configured state must not be applied immediately. See
188- ext_foreign_toplevel_handle_v1.done for details.
189- </description>
190- <arg name="app_id" type="string"/>
191- </event>
192-
193- <event name="identifier">
194- <description summary="a stable identifier for a toplevel">
195- This identifier is used to check if two or more toplevel handles belong
196- to the same toplevel.
197-
198- The identifier is useful for command line tools or privileged clients
199- which may need to reference an exact toplevel across processes or
200- instances of the ext_foreign_toplevel_list_v1 global.
201-
202- The compositor must only send this event when the handle is created.
203-
204- The identifier must be unique per toplevel and its handles. Two different
205- toplevels must not have the same identifier. The identifier is only valid
206- as long as the toplevel is mapped. If the toplevel is unmapped the identifier
207- must not be reused. An identifier must not be reused by the compositor to
208- ensure there are no races when sharing identifiers between processes.
209-
210- An identifier is a string that contains up to 32 printable ASCII bytes.
211- An identifier must not be an empty string. It is recommended that a
212- compositor includes an opaque generation value in identifiers. How the
213- generation value is used when generating the identifier is implementation
214- dependent.
215- </description>
216- <arg name="identifier" type="string"/>
217- </event>
218- </interface>
219-</protocol>
D protocols/ext-idle-notify-v1.xml +0 -131
@@ -1,131 +0,0 @@
1-<?xml version="1.0" encoding="UTF-8"?>
2-<protocol name="ext_idle_notify_v1">
3- <copyright>
4- Copyright © 2015 Martin Gräßlin
5- Copyright © 2022 Simon Ser
6-
7- Permission is hereby granted, free of charge, to any person obtaining a
8- copy of this software and associated documentation files (the "Software"),
9- to deal in the Software without restriction, including without limitation
10- the rights to use, copy, modify, merge, publish, distribute, sublicense,
11- and/or sell copies of the Software, and to permit persons to whom the
12- Software is furnished to do so, subject to the following conditions:
13-
14- The above copyright notice and this permission notice (including the next
15- paragraph) shall be included in all copies or substantial portions of the
16- Software.
17-
18- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
21- THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
24- DEALINGS IN THE SOFTWARE.
25- </copyright>
26-
27- <interface name="ext_idle_notifier_v1" version="2">
28- <description summary="idle notification manager">
29- This interface allows clients to monitor user idle status.
30-
31- After binding to this global, clients can create ext_idle_notification_v1
32- objects to get notified when the user is idle for a given amount of time.
33- </description>
34-
35- <request name="destroy" type="destructor">
36- <description summary="destroy the manager">
37- Destroy the manager object. All objects created via this interface
38- remain valid.
39- </description>
40- </request>
41-
42- <request name="get_idle_notification">
43- <description summary="create a notification object">
44- Create a new idle notification object.
45-
46- The notification object has a minimum timeout duration and is tied to a
47- seat. The client will be notified if the seat is inactive for at least
48- the provided timeout. See ext_idle_notification_v1 for more details.
49-
50- A zero timeout is valid and means the client wants to be notified as
51- soon as possible when the seat is inactive.
52- </description>
53- <arg name="id" type="new_id" interface="ext_idle_notification_v1"/>
54- <arg name="timeout" type="uint" summary="minimum idle timeout in msec"/>
55- <arg name="seat" type="object" interface="wl_seat"/>
56- </request>
57-
58- <!-- Version 2 additions -->
59-
60- <request name="get_input_idle_notification" since="2">
61- <description summary="create a notification object">
62- Create a new idle notification object to track input from the
63- user, such as keyboard and mouse movement. Because this object is
64- meant to track user input alone, it ignores idle inhibitors.
65-
66- The notification object has a minimum timeout duration and is tied to a
67- seat. The client will be notified if the seat is inactive for at least
68- the provided timeout. See ext_idle_notification_v1 for more details.
69-
70- A zero timeout is valid and means the client wants to be notified as
71- soon as possible when the seat is inactive.
72- </description>
73- <arg name="id" type="new_id" interface="ext_idle_notification_v1"/>
74- <arg name="timeout" type="uint" summary="minimum idle timeout in msec"/>
75- <arg name="seat" type="object" interface="wl_seat"/>
76- </request>
77-
78- </interface>
79-
80- <interface name="ext_idle_notification_v1" version="2">
81- <description summary="idle notification">
82- This interface is used by the compositor to send idle notification events
83- to clients.
84-
85- Initially the notification object is not idle. The notification object
86- becomes idle when no user activity has happened for at least the timeout
87- duration, starting from the creation of the notification object. User
88- activity may include input events or a presence sensor, but is
89- compositor-specific.
90-
91- How this notification responds to idle inhibitors depends on how
92- it was constructed. If constructed from the
93- get_idle_notification request, then if an idle inhibitor is
94- active (e.g. another client has created a zwp_idle_inhibitor_v1
95- on a visible surface), the compositor must not make the
96- notification object idle. However, if constructed from the
97- get_input_idle_notification request, then idle inhibitors are
98- ignored, and only input from the user, e.g. from a keyboard or
99- mouse, counts as activity.
100-
101- When the notification object becomes idle, an idled event is sent. When
102- user activity starts again, the notification object stops being idle,
103- a resumed event is sent and the timeout is restarted.
104- </description>
105-
106- <request name="destroy" type="destructor">
107- <description summary="destroy the notification object">
108- Destroy the notification object.
109- </description>
110- </request>
111-
112- <event name="idled">
113- <description summary="notification object is idle">
114- This event is sent when the notification object becomes idle.
115-
116- It's a compositor protocol error to send this event twice without a
117- resumed event in-between.
118- </description>
119- </event>
120-
121- <event name="resumed">
122- <description summary="notification object is no longer idle">
123- This event is sent when the notification object stops being idle.
124-
125- It's a compositor protocol error to send this event twice without an
126- idled event in-between. It's a compositor protocol error to send this
127- event prior to any idled event.
128- </description>
129- </event>
130- </interface>
131-</protocol>
D protocols/ext-image-capture-source-v1.xml +0 -109
@@ -1,109 +0,0 @@
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>
D protocols/ext-image-copy-capture-v1.xml +0 -456
@@ -1,456 +0,0 @@
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>
D protocols/ext-session-lock-v1.xml +0 -328
@@ -1,328 +0,0 @@
1-<?xml version="1.0" encoding="UTF-8"?>
2-<protocol name="ext_session_lock_v1">
3- <copyright>
4- Copyright 2021 Isaac Freund
5-
6- Permission is hereby granted, free of charge, to any person obtaining a
7- copy of this software and associated documentation files (the "Software"),
8- to deal in the Software without restriction, including without limitation
9- the rights to use, copy, modify, merge, publish, distribute, sublicense,
10- and/or sell copies of the Software, and to permit persons to whom the
11- Software is furnished to do so, subject to the following conditions:
12-
13- The above copyright notice and this permission notice shall be included in
14- all copies or substantial portions of the Software.
15-
16- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19- THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22- THE SOFTWARE.
23- </copyright>
24-
25- <description summary="secure session locking with arbitrary graphics">
26- This protocol allows for a privileged Wayland client to lock the session
27- and display arbitrary graphics while the session is locked.
28-
29- The compositor may choose to restrict this protocol to a special client
30- launched by the compositor itself or expose it to all privileged clients,
31- this is compositor policy.
32-
33- The client is responsible for performing authentication and informing the
34- compositor when the session should be unlocked. If the client dies while
35- the session is locked the session remains locked, possibly permanently
36- depending on compositor policy.
37-
38- The key words "must", "must not", "required", "shall", "shall not",
39- "should", "should not", "recommended", "may", and "optional" in this
40- document are to be interpreted as described in IETF RFC 2119.
41-
42- Warning! The protocol described in this file is currently in the
43- testing phase. Backward compatible changes may be added together with
44- the corresponding interface version bump. Backward incompatible changes
45- can only be done by creating a new major version of the extension.
46- </description>
47-
48- <interface name="ext_session_lock_manager_v1" version="1">
49- <description summary="used to lock the session">
50- This interface is used to request that the session be locked.
51- </description>
52-
53- <request name="destroy" type="destructor">
54- <description summary="destroy the session lock manager object">
55- This informs the compositor that the session lock manager object will
56- no longer be used. Existing objects created through this interface
57- remain valid.
58- </description>
59- </request>
60-
61- <request name="lock">
62- <description summary="attempt to lock the session">
63- This request creates a session lock and asks the compositor to lock the
64- session. The compositor will send either the ext_session_lock_v1.locked
65- or ext_session_lock_v1.finished event on the created object in
66- response to this request.
67- </description>
68- <arg name="id" type="new_id" interface="ext_session_lock_v1"/>
69- </request>
70- </interface>
71-
72- <interface name="ext_session_lock_v1" version="1">
73- <description summary="manage lock state and create lock surfaces">
74- In response to the creation of this object the compositor must send
75- either the locked or finished event.
76-
77- The locked event indicates that the session is locked. This means
78- that the compositor must stop rendering and providing input to normal
79- clients. Instead the compositor must blank all outputs with an opaque
80- color such that their normal content is fully hidden.
81-
82- The only surfaces that should be rendered while the session is locked
83- are the lock surfaces created through this interface and optionally,
84- at the compositor's discretion, special privileged surfaces such as
85- input methods or portions of desktop shell UIs.
86-
87- The locked event must not be sent until a new "locked" frame (either
88- from a session lock surface or the compositor blanking the output) has
89- been presented on all outputs and no security sensitive normal/unlocked
90- content is possibly visible.
91-
92- The finished event should be sent immediately on creation of this
93- object if the compositor decides that the locked event will not be sent.
94-
95- The compositor may wait for the client to create and render session lock
96- surfaces before sending the locked event to avoid displaying intermediate
97- blank frames. However, it must impose a reasonable time limit if
98- waiting and send the locked event as soon as the hard requirements
99- described above can be met if the time limit expires. Clients should
100- immediately create lock surfaces for all outputs on creation of this
101- object to make this possible.
102-
103- This behavior of the locked event is required in order to prevent
104- possible race conditions with clients that wish to suspend the system
105- or similar after locking the session. Without these semantics, clients
106- triggering a suspend after receiving the locked event would race with
107- the first "locked" frame being presented and normal/unlocked frames
108- might be briefly visible as the system is resumed if the suspend
109- operation wins the race.
110-
111- If the client dies while the session is locked, the compositor must not
112- unlock the session in response. It is acceptable for the session to be
113- permanently locked if this happens. The compositor may choose to continue
114- to display the lock surfaces the client had mapped before it died or
115- alternatively fall back to a solid color, this is compositor policy.
116-
117- Compositors may also allow a secure way to recover the session, the
118- details of this are compositor policy. Compositors may allow a new
119- client to create a ext_session_lock_v1 object and take responsibility
120- for unlocking the session, they may even start a new lock client
121- instance automatically.
122- </description>
123-
124- <enum name="error">
125- <entry name="invalid_destroy" value="0"
126- summary="attempted to destroy session lock while locked"/>
127- <entry name="invalid_unlock" value="1"
128- summary="unlock requested but locked event was never sent"/>
129- <entry name="role" value="2"
130- summary="given wl_surface already has a role"/>
131- <entry name="duplicate_output" value="3"
132- summary="given output already has a lock surface"/>
133- <entry name="already_constructed" value="4"
134- summary="given wl_surface has a buffer attached or committed"/>
135- </enum>
136-
137- <request name="destroy" type="destructor">
138- <description summary="destroy the session lock">
139- This informs the compositor that the lock object will no longer be
140- used. Existing objects created through this interface remain valid.
141-
142- After this request is made, lock surfaces created through this object
143- should be destroyed by the client as they will no longer be used by
144- the compositor.
145-
146- It is a protocol error to make this request if the locked event was
147- sent, the unlock_and_destroy request must be used instead.
148- </description>
149- </request>
150-
151- <event name="locked">
152- <description summary="session successfully locked">
153- This client is now responsible for displaying graphics while the
154- session is locked and deciding when to unlock the session.
155-
156- The locked event must not be sent until a new "locked" frame has been
157- presented on all outputs and no security sensitive normal/unlocked
158- content is possibly visible.
159-
160- If this event is sent, making the destroy request is a protocol error,
161- the lock object must be destroyed using the unlock_and_destroy request.
162- </description>
163- </event>
164-
165- <event name="finished">
166- <description summary="the session lock object should be destroyed">
167- The compositor has decided that the session lock should be destroyed
168- as it will no longer be used by the compositor. Exactly when this
169- event is sent is compositor policy, but it must never be sent more
170- than once for a given session lock object.
171-
172- This might be sent because there is already another ext_session_lock_v1
173- object held by a client, or the compositor has decided to deny the
174- request to lock the session for some other reason. This might also
175- be sent because the compositor implements some alternative, secure
176- way to authenticate and unlock the session.
177-
178- The finished event should be sent immediately on creation of this
179- object if the compositor decides that the locked event will not
180- be sent.
181-
182- If the locked event is sent on creation of this object the finished
183- event may still be sent at some later time in this object's
184- lifetime. This is compositor policy.
185-
186- Upon receiving this event, the client should make either the destroy
187- request or the unlock_and_destroy request, depending on whether or
188- not the locked event was received on this object.
189- </description>
190- </event>
191-
192- <request name="get_lock_surface">
193- <description summary="create a lock surface for a given output">
194- The client is expected to create lock surfaces for all outputs
195- currently present and any new outputs as they are advertised. These
196- won't be displayed by the compositor unless the lock is successful
197- and the locked event is sent.
198-
199- Providing a wl_surface which already has a role or already has a buffer
200- attached or committed is a protocol error, as is attaching/committing
201- a buffer before the first ext_session_lock_surface_v1.configure event.
202-
203- Attempting to create more than one lock surface for a given output
204- is a duplicate_output protocol error.
205- </description>
206- <arg name="id" type="new_id" interface="ext_session_lock_surface_v1"/>
207- <arg name="surface" type="object" interface="wl_surface"/>
208- <arg name="output" type="object" interface="wl_output"/>
209- </request>
210-
211- <request name="unlock_and_destroy" type="destructor">
212- <description summary="unlock the session, destroying the object">
213- This request indicates that the session should be unlocked, for
214- example because the user has entered their password and it has been
215- verified by the client.
216-
217- This request also informs the compositor that the lock object will
218- no longer be used and should be destroyed. Existing objects created
219- through this interface remain valid.
220-
221- After this request is made, lock surfaces created through this object
222- should be destroyed by the client as they will no longer be used by
223- the compositor.
224-
225- It is a protocol error to make this request if the locked event has
226- not been sent. In that case, the lock object must be destroyed using
227- the destroy request.
228-
229- Note that a correct client that wishes to exit directly after unlocking
230- the session must use the wl_display.sync request to ensure the server
231- receives and processes the unlock_and_destroy request. Otherwise
232- there is no guarantee that the server has unlocked the session due
233- to the asynchronous nature of the Wayland protocol. For example,
234- the server might terminate the client with a protocol error before
235- it processes the unlock_and_destroy request.
236- </description>
237- </request>
238- </interface>
239-
240- <interface name="ext_session_lock_surface_v1" version="1">
241- <description summary="a surface displayed while the session is locked">
242- The client may use lock surfaces to display a screensaver, render a
243- dialog to enter a password and unlock the session, or however else it
244- sees fit.
245-
246- On binding this interface the compositor will immediately send the
247- first configure event. After making the ack_configure request in
248- response to this event the client should attach and commit the first
249- buffer. Committing the surface before acking the first configure is a
250- protocol error. Committing the surface with a null buffer at any time
251- is a protocol error.
252-
253- The compositor is free to handle keyboard/pointer focus for lock
254- surfaces however it chooses. A reasonable way to do this would be to
255- give the first lock surface created keyboard focus and change keyboard
256- focus if the user clicks on other surfaces.
257- </description>
258-
259- <enum name="error">
260- <entry name="commit_before_first_ack" value="0"
261- summary="surface committed before first ack_configure request"/>
262- <entry name="null_buffer" value="1"
263- summary="surface committed with a null buffer"/>
264- <entry name="dimensions_mismatch" value="2"
265- summary="failed to match ack'd width/height"/>
266- <entry name="invalid_serial" value="3"
267- summary="serial provided in ack_configure is invalid"/>
268- </enum>
269-
270- <request name="destroy" type="destructor">
271- <description summary="destroy the lock surface object">
272- This informs the compositor that the lock surface object will no
273- longer be used.
274-
275- It is recommended for a lock client to destroy lock surfaces if
276- their corresponding wl_output global is removed.
277-
278- If a lock surface on an active output is destroyed before the
279- ext_session_lock_v1.unlock_and_destroy event is sent, the compositor
280- must fall back to rendering a solid color.
281- </description>
282- </request>
283-
284- <request name="ack_configure">
285- <description summary="ack a configure event">
286- When a configure event is received, if a client commits the surface
287- in response to the configure event, then the client must make an
288- ack_configure request sometime before the commit request, passing
289- along the serial of the configure event.
290-
291- If the client receives multiple configure events before it can
292- respond to one, it only has to ack the last configure event.
293-
294- A client is not required to commit immediately after sending an
295- ack_configure request - it may even ack_configure several times
296- before its next surface commit.
297-
298- A client may send multiple ack_configure requests before committing,
299- but only the last request sent before a commit indicates which
300- configure event the client really is responding to.
301-
302- Sending an ack_configure request consumes the configure event
303- referenced by the given serial, as well as all older configure events
304- sent on this object.
305-
306- It is a protocol error to issue multiple ack_configure requests
307- referencing the same configure event or to issue an ack_configure
308- request referencing a configure event older than the last configure
309- event acked for a given lock surface.
310- </description>
311- <arg name="serial" type="uint" summary="serial from the configure event"/>
312- </request>
313-
314- <event name="configure">
315- <description summary="the client should resize its surface">
316- This event is sent once on binding the interface and may be sent again
317- at the compositor's discretion, for example if output geometry changes.
318-
319- The width and height are in surface-local coordinates and are exact
320- requirements. Failing to match these surface dimensions in the next
321- commit after acking a configure is a protocol error.
322- </description>
323- <arg name="serial" type="uint" summary="serial for use in ack_configure"/>
324- <arg name="width" type="uint"/>
325- <arg name="height" type="uint"/>
326- </event>
327- </interface>
328-</protocol>
D protocols/ext-transient-seat-v1.xml +0 -110
@@ -1,110 +0,0 @@
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>
D protocols/ext-workspace-v1.xml +0 -422 collapsed to keep the page light
D protocols/fifo-v1.xml +0 -143
@@ -1,143 +0,0 @@
1-<?xml version="1.0" encoding="UTF-8"?>
2-<protocol name="fifo_v1">
3- <copyright>
4- Copyright © 2023 Valve Corporation
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_fifo_manager_v1" version="1">
27- <description summary="protocol for fifo constraints">
28- When a Wayland compositor considers applying a content update,
29- it must ensure all the update's readiness constraints (fences, etc)
30- are met.
31-
32- This protocol provides a way to use the completion of a display refresh
33- cycle as an additional readiness constraint.
34-
35- Warning! The protocol described in this file is currently in the testing
36- phase. Backward compatible changes may be added together with the
37- corresponding interface version bump. Backward incompatible changes can
38- only be done by creating a new major version of the extension.
39- </description>
40-
41- <enum name="error">
42- <description summary="fatal presentation error">
43- These fatal protocol errors may be emitted in response to
44- illegal requests.
45- </description>
46- <entry name="already_exists" value="0"
47- summary="fifo manager already exists for surface"/>
48- </enum>
49-
50- <request name="destroy" type="destructor">
51- <description summary="unbind from the manager interface">
52- Informs the server that the client will no longer be using
53- this protocol object. Existing objects created by this object
54- are not affected.
55- </description>
56- </request>
57-
58- <request name="get_fifo">
59- <description summary="request fifo interface for surface">
60- Establish a fifo object for a surface that may be used to add
61- display refresh constraints to content updates.
62-
63- Only one such object may exist for a surface and attempting
64- to create more than one will result in an already_exists
65- protocol error. If a surface is acted on by multiple software
66- components, general best practice is that only the component
67- performing wl_surface.attach operations should use this protocol.
68- </description>
69- <arg name="id" type="new_id" interface="wp_fifo_v1"/>
70- <arg name="surface" type="object" interface="wl_surface"/>
71- </request>
72- </interface>
73-
74- <interface name="wp_fifo_v1" version="1">
75- <description summary="fifo interface">
76- A fifo object for a surface that may be used to add
77- display refresh constraints to content updates.
78- </description>
79-
80- <enum name="error">
81- <description summary="fatal error">
82- These fatal protocol errors may be emitted in response to
83- illegal requests.
84- </description>
85- <entry name="surface_destroyed" value="0"
86- summary="the associated surface no longer exists"/>
87- </enum>
88-
89- <request name="set_barrier">
90- <description summary="sets the start point for a fifo constraint">
91- When the content update containing the "set_barrier" is applied,
92- it sets a "fifo_barrier" condition on the surface associated with
93- the fifo object. The condition is cleared immediately after the
94- following latching deadline for non-tearing presentation.
95-
96- The compositor may clear the condition early if it must do so to
97- ensure client forward progress assumptions.
98-
99- To wait for this condition to clear, use the "wait_barrier" request.
100-
101- "set_barrier" is double-buffered state, see wl_surface.commit.
102-
103- Requesting set_barrier after the fifo object's surface is
104- destroyed will generate a "surface_destroyed" error.
105- </description>
106- </request>
107-
108- <request name="wait_barrier">
109- <description summary="adds a fifo constraint to a content update">
110- Indicate that this content update is not ready while a
111- "fifo_barrier" condition is present on the surface.
112-
113- This means that when the content update containing "set_barrier"
114- was made active at a latching deadline, it will be active for
115- at least one refresh cycle. A content update which is allowed to
116- tear might become active after a latching deadline if no content
117- update became active at the deadline.
118-
119- The constraint must be ignored if the surface is a subsurface in
120- synchronized mode. If the surface is not being updated by the
121- compositor (off-screen, occluded) the compositor may ignore the
122- constraint. Clients must use an additional mechanism such as
123- frame callbacks or timestamps to ensure throttling occurs under
124- all conditions.
125-
126- "wait_barrier" is double-buffered state, see wl_surface.commit.
127-
128- Requesting "wait_barrier" after the fifo object's surface is
129- destroyed will generate a "surface_destroyed" error.
130- </description>
131- </request>
132-
133- <request name="destroy" type="destructor">
134- <description summary="destroy the fifo interface">
135- Informs the server that the client will no longer be using
136- this protocol object.
137-
138- Surface state changes previously made by this protocol are
139- unaffected by this object's destruction.
140- </description>
141- </request>
142- </interface>
143-</protocol>
D protocols/fractional-scale-v1.xml +0 -102
@@ -1,102 +0,0 @@
1-<?xml version="1.0" encoding="UTF-8"?>
2-<protocol name="fractional_scale_v1">
3- <copyright>
4- Copyright © 2022 Kenny Levinsen
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 requesting fractional surface scales">
27- This protocol allows a compositor to suggest for surfaces to render at
28- fractional scales.
29-
30- A client can submit scaled content by utilizing wp_viewport. This is done by
31- creating a wp_viewport object for the surface and setting the destination
32- rectangle to the surface size before the scale factor is applied.
33-
34- The buffer size is calculated by multiplying the surface size by the
35- intended scale.
36-
37- The wl_surface buffer scale should remain set to 1.
38-
39- If a surface has a surface-local size of 100 px by 50 px and wishes to
40- submit buffers with a scale of 1.5, then a buffer of 150px by 75 px should
41- be used and the wp_viewport destination rectangle should be 100 px by 50 px.
42-
43- For toplevel surfaces, the size is rounded halfway away from zero. The
44- rounding algorithm for subsurface position and size is not defined.
45- </description>
46-
47- <interface name="wp_fractional_scale_manager_v1" version="1">
48- <description summary="fractional surface scale information">
49- A global interface for requesting surfaces to use fractional scales.
50- </description>
51-
52- <request name="destroy" type="destructor">
53- <description summary="unbind the fractional surface scale interface">
54- Informs the server that the client will not be using this protocol
55- object anymore. This does not affect any other objects,
56- wp_fractional_scale_v1 objects included.
57- </description>
58- </request>
59-
60- <enum name="error">
61- <entry name="fractional_scale_exists" value="0"
62- summary="the surface already has a fractional_scale object associated"/>
63- </enum>
64-
65- <request name="get_fractional_scale">
66- <description summary="extend surface interface for scale information">
67- Create an add-on object for the the wl_surface to let the compositor
68- request fractional scales. If the given wl_surface already has a
69- wp_fractional_scale_v1 object associated, the fractional_scale_exists
70- protocol error is raised.
71- </description>
72- <arg name="id" type="new_id" interface="wp_fractional_scale_v1"
73- summary="the new surface scale info interface id"/>
74- <arg name="surface" type="object" interface="wl_surface"
75- summary="the surface"/>
76- </request>
77- </interface>
78-
79- <interface name="wp_fractional_scale_v1" version="1">
80- <description summary="fractional scale interface to a wl_surface">
81- An additional interface to a wl_surface object which allows the compositor
82- to inform the client of the preferred scale.
83- </description>
84-
85- <request name="destroy" type="destructor">
86- <description summary="remove surface scale information for surface">
87- Destroy the fractional scale object. When this object is destroyed,
88- preferred_scale events will no longer be sent.
89- </description>
90- </request>
91-
92- <event name="preferred_scale">
93- <description summary="notify of new preferred scale">
94- Notification of a new preferred scale for this surface that the
95- compositor suggests that the client should use.
96-
97- The sent scale is the numerator of a fraction with a denominator of 120.
98- </description>
99- <arg name="scale" type="uint" summary="the new preferred scale"/>
100- </event>
101- </interface>
102-</protocol>
D protocols/idle-inhibit-unstable-v1.xml +0 -83
@@ -1,83 +0,0 @@
1-<?xml version="1.0" encoding="UTF-8"?>
2-<protocol name="idle_inhibit_unstable_v1">
3-
4- <copyright>
5- Copyright © 2015 Samsung Electronics Co., Ltd
6-
7- Permission is hereby granted, free of charge, to any person obtaining a
8- copy of this software and associated documentation files (the "Software"),
9- to deal in the Software without restriction, including without limitation
10- the rights to use, copy, modify, merge, publish, distribute, sublicense,
11- and/or sell copies of the Software, and to permit persons to whom the
12- Software is furnished to do so, subject to the following conditions:
13-
14- The above copyright notice and this permission notice (including the next
15- paragraph) shall be included in all copies or substantial portions of the
16- Software.
17-
18- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
21- THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
24- DEALINGS IN THE SOFTWARE.
25- </copyright>
26-
27- <interface name="zwp_idle_inhibit_manager_v1" version="1">
28- <description summary="control behavior when display idles">
29- This interface permits inhibiting the idle behavior such as screen
30- blanking, locking, and screensaving. The client binds the idle manager
31- globally, then creates idle-inhibitor objects for each surface.
32-
33- Warning! The protocol described in this file is experimental and
34- backward incompatible changes may be made. Backward compatible changes
35- may be added together with the corresponding interface version bump.
36- Backward incompatible changes are done by bumping the version number in
37- the protocol and interface names and resetting the interface version.
38- Once the protocol is to be declared stable, the 'z' prefix and the
39- version number in the protocol and interface names are removed and the
40- interface version number is reset.
41- </description>
42-
43- <request name="destroy" type="destructor">
44- <description summary="destroy the idle inhibitor object">
45- Destroy the inhibit manager.
46- </description>
47- </request>
48-
49- <request name="create_inhibitor">
50- <description summary="create a new inhibitor object">
51- Create a new inhibitor object associated with the given surface.
52- </description>
53- <arg name="id" type="new_id" interface="zwp_idle_inhibitor_v1"/>
54- <arg name="surface" type="object" interface="wl_surface"
55- summary="the surface that inhibits the idle behavior"/>
56- </request>
57-
58- </interface>
59-
60- <interface name="zwp_idle_inhibitor_v1" version="1">
61- <description summary="context object for inhibiting idle behavior">
62- An idle inhibitor prevents the output that the associated surface is
63- visible on from being set to a state where it is not visually usable due
64- to lack of user interaction (e.g. blanked, dimmed, locked, set to power
65- save, etc.) Any screensaver processes are also blocked from displaying.
66-
67- If the surface is destroyed, unmapped, becomes occluded, loses
68- visibility, or otherwise becomes not visually relevant for the user, the
69- idle inhibitor will not be honored by the compositor; if the surface
70- subsequently regains visibility the inhibitor takes effect once again.
71- Likewise, the inhibitor isn't honored if the system was already idled at
72- the time the inhibitor was established, although if the system later
73- de-idles and re-idles the inhibitor will take effect.
74- </description>
75-
76- <request name="destroy" type="destructor">
77- <description summary="destroy the idle inhibitor object">
78- Remove the inhibitor effect from the associated wl_surface.
79- </description>
80- </request>
81-
82- </interface>
83-</protocol>
D protocols/input-method-unstable-v2.xml +0 -494
@@ -1,494 +0,0 @@
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>
D protocols/keyboard-shortcuts-inhibit-unstable-v1.xml +0 -143 collapsed to keep the page light
D protocols/linux-dmabuf-v1.xml +0 -623 collapsed to keep the page light
D protocols/linux-drm-syncobj-v1.xml +0 -261 collapsed to keep the page light
D protocols/pointer-constraints-unstable-v1.xml +0 -334 collapsed to keep the page light
D protocols/pointer-gestures-unstable-v1.xml +0 -277 collapsed to keep the page light
D protocols/pointer-warp-v1.xml +0 -72 collapsed to keep the page light
D protocols/presentation-time.xml +0 -268 collapsed to keep the page light
D protocols/primary-selection-unstable-v1.xml +0 -225 collapsed to keep the page light
D protocols/relative-pointer-unstable-v1.xml +0 -136 collapsed to keep the page light
D protocols/security-context-v1.xml +0 -180 collapsed to keep the page light
D protocols/server-decoration.xml +0 -85 collapsed to keep the page light
D protocols/single-pixel-buffer-v1.xml +0 -76 collapsed to keep the page light
D protocols/tablet-v2.xml +0 -1297 collapsed to keep the page light
D protocols/tearing-control-v1.xml +0 -123 collapsed to keep the page light
D protocols/text-input-unstable-v3.xml +0 -604 collapsed to keep the page light
D protocols/viewporter.xml +0 -177 collapsed to keep the page light
D protocols/virtual-keyboard-unstable-v1.xml +0 -113 collapsed to keep the page light
D protocols/wayland.xml +0 -3442 large diff (3442 lines changed): collapsed
D protocols/wlr-foreign-toplevel-management-unstable-v1.xml +0 -270 collapsed to keep the page light
D protocols/wlr-gamma-control-unstable-v1.xml +0 -126 collapsed to keep the page light
D protocols/wlr-layer-shell-unstable-v1.xml +0 -407 collapsed to keep the page light
D protocols/wlr-output-management-unstable-v1.xml +0 -611 collapsed to keep the page light
D protocols/wlr-output-power-management-unstable-v1.xml +0 -128 collapsed to keep the page light
D protocols/wlr-screencopy-unstable-v1.xml +0 -234 collapsed to keep the page light
D protocols/wlr-virtual-pointer-unstable-v1.xml +0 -152 collapsed to keep the page light
D protocols/xdg-activation-v1.xml +0 -200 collapsed to keep the page light
D protocols/xdg-decoration-unstable-v1.xml +0 -176 collapsed to keep the page light
D protocols/xdg-dialog-v1.xml +0 -110 collapsed to keep the page light
D protocols/xdg-foreign-unstable-v2.xml +0 -200 collapsed to keep the page light
D protocols/xdg-output-unstable-v1.xml +0 -222 collapsed to keep the page light
D protocols/xdg-session-management-v1.xml +0 -333 collapsed to keep the page light
D protocols/xdg-shell.xml +0 -1420 collapsed to keep the page light
D protocols/xdg-system-bell-v1.xml +0 -58 collapsed to keep the page light
D protocols/xdg-toplevel-drag-v1.xml +0 -142 collapsed to keep the page light
D protocols/xdg-toplevel-icon-v1.xml +0 -205 collapsed to keep the page light
D protocols/xdg-toplevel-tag-v1.xml +0 -85 collapsed to keep the page light
D protocols/xwayland-keyboard-grab-unstable-v1.xml +0 -121 collapsed to keep the page light
D protocols/xwayland-shell-v1.xml +0 -161 collapsed to keep the page light
A server/runtime_test.go +343 -0 collapsed to keep the page light

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