feat(protocol): tearing-control, fifo, commit-timing, content-type and xdg-activation bindings
- commit
- ec3bae1045762c7aa65d148dbc6327f2345e21df
- author
- brice · · 2026-09-25 17:35 UTC
- parent
- 17637c7
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
11 files · +1503 -0
A protocol/committiming/committiming.go +151 -0
| @@ -0,0 +1,151 @@ | |||
| 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 | + | } | |
| @@ -0,0 +1,151 @@ | |||||
| 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 | + | } | |||
A protocol/contenttype/contenttype.go +152 -0
| @@ -0,0 +1,152 @@ | |||
| 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 | + | } | |
| @@ -0,0 +1,152 @@ | |||||
| 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 | + | } | |||
A protocol/fifo/fifo.go +154 -0
| @@ -0,0 +1,154 @@ | |||
| 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 | + | } | |
| @@ -0,0 +1,154 @@ | |||||
| 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 | + | } | |||
M protocol/gen.go +5 -0
| @@ -16,3 +16,8 @@ package protocol | |||
| 16 | 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 | 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 | 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 | |
| @@ -16,3 +16,8 @@ package protocol | |||||
| 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 | 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 | 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 | 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 | |||
A protocol/tearingcontrol/tearingcontrol.go +150 -0
| @@ -0,0 +1,150 @@ | |||
| 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 | + | } | |
| @@ -0,0 +1,150 @@ | |||||
| 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 | + | } | |||
A protocol/xdgactivation/xdgactivation.go +173 -0
| @@ -0,0 +1,173 @@ | |||
| 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 | + | } | |
| @@ -0,0 +1,173 @@ | |||||
| 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 | + | } | |||
A protocols/commit-timing-v1.xml +124 -0
| @@ -0,0 +1,124 @@ | |||
| 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> | |
| @@ -0,0 +1,124 @@ | |||||
| 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> | |||
A protocols/content-type-v1.xml +128 -0
| @@ -0,0 +1,128 @@ | |||
| 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> | |
| @@ -0,0 +1,128 @@ | |||||
| 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> | |||
A protocols/fifo-v1.xml +143 -0
| @@ -0,0 +1,143 @@ | |||
| 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> | |
| @@ -0,0 +1,143 @@ | |||||
| 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> | |||
A protocols/tearing-control-v1.xml +123 -0
| @@ -0,0 +1,123 @@ | |||
| 1 | + | <?xml version="1.0" encoding="UTF-8"?> | |
| 2 | + | <protocol name="tearing_control_v1"> | |
| 3 | + | <copyright> | |
| 4 | + | Copyright © 2021 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_tearing_control_manager_v1" version="1"> | |
| 27 | + | <description summary="protocol for tearing control"> | |
| 28 | + | For some use cases like games or drawing tablets it can make sense to | |
| 29 | + | reduce latency by accepting tearing with the use of asynchronous page | |
| 30 | + | flips. This global is a factory interface, allowing clients to inform | |
| 31 | + | which type of presentation the content of their surfaces is suitable for. | |
| 32 | + | ||
| 33 | + | Graphics APIs like EGL or Vulkan, that manage the buffer queue and commits | |
| 34 | + | of a wl_surface themselves, are likely to be using this extension | |
| 35 | + | internally. If a client is using such an API for a wl_surface, it should | |
| 36 | + | not directly use this extension on that surface, to avoid raising a | |
| 37 | + | tearing_control_exists protocol error. | |
| 38 | + | ||
| 39 | + | Warning! The protocol described in this file is currently in the testing | |
| 40 | + | phase. Backward compatible changes may be added together with the | |
| 41 | + | corresponding interface version bump. Backward incompatible changes can | |
| 42 | + | only be done by creating a new major version of the extension. | |
| 43 | + | </description> | |
| 44 | + | ||
| 45 | + | <request name="destroy" type="destructor"> | |
| 46 | + | <description summary="destroy tearing control factory object"> | |
| 47 | + | Destroy this tearing control factory object. Other objects, including | |
| 48 | + | wp_tearing_control_v1 objects created by this factory, are not affected | |
| 49 | + | by this request. | |
| 50 | + | </description> | |
| 51 | + | </request> | |
| 52 | + | ||
| 53 | + | <enum name="error"> | |
| 54 | + | <entry name="tearing_control_exists" value="0" | |
| 55 | + | summary="the surface already has a tearing object associated"/> | |
| 56 | + | </enum> | |
| 57 | + | ||
| 58 | + | <request name="get_tearing_control"> | |
| 59 | + | <description summary="extend surface interface for tearing control"> | |
| 60 | + | Instantiate an interface extension for the given wl_surface to request | |
| 61 | + | asynchronous page flips for presentation. | |
| 62 | + | ||
| 63 | + | If the given wl_surface already has a wp_tearing_control_v1 object | |
| 64 | + | associated, the tearing_control_exists protocol error is raised. | |
| 65 | + | </description> | |
| 66 | + | <arg name="id" type="new_id" interface="wp_tearing_control_v1"/> | |
| 67 | + | <arg name="surface" type="object" interface="wl_surface"/> | |
| 68 | + | </request> | |
| 69 | + | </interface> | |
| 70 | + | ||
| 71 | + | <interface name="wp_tearing_control_v1" version="1"> | |
| 72 | + | <description summary="per-surface tearing control interface"> | |
| 73 | + | An additional interface to a wl_surface object, which allows the client | |
| 74 | + | to hint to the compositor if the content on the surface is suitable for | |
| 75 | + | presentation with tearing. | |
| 76 | + | The default presentation hint is vsync. See presentation_hint for more | |
| 77 | + | details. | |
| 78 | + | ||
| 79 | + | If the associated wl_surface is destroyed, this object becomes inert and | |
| 80 | + | should be destroyed. | |
| 81 | + | </description> | |
| 82 | + | ||
| 83 | + | <enum name="presentation_hint"> | |
| 84 | + | <description summary="presentation hint values"> | |
| 85 | + | This enum provides information for if submitted frames from the client | |
| 86 | + | may be presented with tearing. | |
| 87 | + | </description> | |
| 88 | + | <entry name="vsync" value="0"> | |
| 89 | + | <description summary="tearing-free presentation"> | |
| 90 | + | The content of this surface is meant to be synchronized to the | |
| 91 | + | vertical blanking period. This should not result in visible tearing | |
| 92 | + | and may result in a delay before a surface commit is presented. | |
| 93 | + | </description> | |
| 94 | + | </entry> | |
| 95 | + | <entry name="async" value="1"> | |
| 96 | + | <description summary="asynchronous presentation"> | |
| 97 | + | The content of this surface is meant to be presented with minimal | |
| 98 | + | latency and tearing is acceptable. | |
| 99 | + | </description> | |
| 100 | + | </entry> | |
| 101 | + | </enum> | |
| 102 | + | ||
| 103 | + | <request name="set_presentation_hint"> | |
| 104 | + | <description summary="set presentation hint"> | |
| 105 | + | Set the presentation hint for the associated wl_surface. This state is | |
| 106 | + | double-buffered, see wl_surface.commit. | |
| 107 | + | ||
| 108 | + | The compositor is free to dynamically respect or ignore this hint based | |
| 109 | + | on various conditions like hardware capabilities, surface state and | |
| 110 | + | user preferences. | |
| 111 | + | </description> | |
| 112 | + | <arg name="hint" type="uint" enum="presentation_hint"/> | |
| 113 | + | </request> | |
| 114 | + | ||
| 115 | + | <request name="destroy" type="destructor"> | |
| 116 | + | <description summary="destroy tearing control object"> | |
| 117 | + | Destroy this surface tearing object and revert the presentation hint to | |
| 118 | + | vsync. The change will be applied on the next wl_surface.commit. | |
| 119 | + | </description> | |
| 120 | + | </request> | |
| 121 | + | </interface> | |
| 122 | + | ||
| 123 | + | </protocol> | |
| @@ -0,0 +1,123 @@ | |||||
| 1 | + | <?xml version="1.0" encoding="UTF-8"?> | |||
| 2 | + | <protocol name="tearing_control_v1"> | |||
| 3 | + | <copyright> | |||
| 4 | + | Copyright © 2021 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_tearing_control_manager_v1" version="1"> | |||
| 27 | + | <description summary="protocol for tearing control"> | |||
| 28 | + | For some use cases like games or drawing tablets it can make sense to | |||
| 29 | + | reduce latency by accepting tearing with the use of asynchronous page | |||
| 30 | + | flips. This global is a factory interface, allowing clients to inform | |||
| 31 | + | which type of presentation the content of their surfaces is suitable for. | |||
| 32 | + | ||||
| 33 | + | Graphics APIs like EGL or Vulkan, that manage the buffer queue and commits | |||
| 34 | + | of a wl_surface themselves, are likely to be using this extension | |||
| 35 | + | internally. If a client is using such an API for a wl_surface, it should | |||
| 36 | + | not directly use this extension on that surface, to avoid raising a | |||
| 37 | + | tearing_control_exists protocol error. | |||
| 38 | + | ||||
| 39 | + | Warning! The protocol described in this file is currently in the testing | |||
| 40 | + | phase. Backward compatible changes may be added together with the | |||
| 41 | + | corresponding interface version bump. Backward incompatible changes can | |||
| 42 | + | only be done by creating a new major version of the extension. | |||
| 43 | + | </description> | |||
| 44 | + | ||||
| 45 | + | <request name="destroy" type="destructor"> | |||
| 46 | + | <description summary="destroy tearing control factory object"> | |||
| 47 | + | Destroy this tearing control factory object. Other objects, including | |||
| 48 | + | wp_tearing_control_v1 objects created by this factory, are not affected | |||
| 49 | + | by this request. | |||
| 50 | + | </description> | |||
| 51 | + | </request> | |||
| 52 | + | ||||
| 53 | + | <enum name="error"> | |||
| 54 | + | <entry name="tearing_control_exists" value="0" | |||
| 55 | + | summary="the surface already has a tearing object associated"/> | |||
| 56 | + | </enum> | |||
| 57 | + | ||||
| 58 | + | <request name="get_tearing_control"> | |||
| 59 | + | <description summary="extend surface interface for tearing control"> | |||
| 60 | + | Instantiate an interface extension for the given wl_surface to request | |||
| 61 | + | asynchronous page flips for presentation. | |||
| 62 | + | ||||
| 63 | + | If the given wl_surface already has a wp_tearing_control_v1 object | |||
| 64 | + | associated, the tearing_control_exists protocol error is raised. | |||
| 65 | + | </description> | |||
| 66 | + | <arg name="id" type="new_id" interface="wp_tearing_control_v1"/> | |||
| 67 | + | <arg name="surface" type="object" interface="wl_surface"/> | |||
| 68 | + | </request> | |||
| 69 | + | </interface> | |||
| 70 | + | ||||
| 71 | + | <interface name="wp_tearing_control_v1" version="1"> | |||
| 72 | + | <description summary="per-surface tearing control interface"> | |||
| 73 | + | An additional interface to a wl_surface object, which allows the client | |||
| 74 | + | to hint to the compositor if the content on the surface is suitable for | |||
| 75 | + | presentation with tearing. | |||
| 76 | + | The default presentation hint is vsync. See presentation_hint for more | |||
| 77 | + | details. | |||
| 78 | + | ||||
| 79 | + | If the associated wl_surface is destroyed, this object becomes inert and | |||
| 80 | + | should be destroyed. | |||
| 81 | + | </description> | |||
| 82 | + | ||||
| 83 | + | <enum name="presentation_hint"> | |||
| 84 | + | <description summary="presentation hint values"> | |||
| 85 | + | This enum provides information for if submitted frames from the client | |||
| 86 | + | may be presented with tearing. | |||
| 87 | + | </description> | |||
| 88 | + | <entry name="vsync" value="0"> | |||
| 89 | + | <description summary="tearing-free presentation"> | |||
| 90 | + | The content of this surface is meant to be synchronized to the | |||
| 91 | + | vertical blanking period. This should not result in visible tearing | |||
| 92 | + | and may result in a delay before a surface commit is presented. | |||
| 93 | + | </description> | |||
| 94 | + | </entry> | |||
| 95 | + | <entry name="async" value="1"> | |||
| 96 | + | <description summary="asynchronous presentation"> | |||
| 97 | + | The content of this surface is meant to be presented with minimal | |||
| 98 | + | latency and tearing is acceptable. | |||
| 99 | + | </description> | |||
| 100 | + | </entry> | |||
| 101 | + | </enum> | |||
| 102 | + | ||||
| 103 | + | <request name="set_presentation_hint"> | |||
| 104 | + | <description summary="set presentation hint"> | |||
| 105 | + | Set the presentation hint for the associated wl_surface. This state is | |||
| 106 | + | double-buffered, see wl_surface.commit. | |||
| 107 | + | ||||
| 108 | + | The compositor is free to dynamically respect or ignore this hint based | |||
| 109 | + | on various conditions like hardware capabilities, surface state and | |||
| 110 | + | user preferences. | |||
| 111 | + | </description> | |||
| 112 | + | <arg name="hint" type="uint" enum="presentation_hint"/> | |||
| 113 | + | </request> | |||
| 114 | + | ||||
| 115 | + | <request name="destroy" type="destructor"> | |||
| 116 | + | <description summary="destroy tearing control object"> | |||
| 117 | + | Destroy this surface tearing object and revert the presentation hint to | |||
| 118 | + | vsync. The change will be applied on the next wl_surface.commit. | |||
| 119 | + | </description> | |||
| 120 | + | </request> | |||
| 121 | + | </interface> | |||
| 122 | + | ||||
| 123 | + | </protocol> | |||
A protocols/xdg-activation-v1.xml +200 -0
| @@ -0,0 +1,200 @@ | |||
| 1 | + | <?xml version="1.0" encoding="UTF-8"?> | |
| 2 | + | <protocol name="xdg_activation_v1"> | |
| 3 | + | ||
| 4 | + | <copyright> | |
| 5 | + | Copyright © 2020 Aleix Pol Gonzalez <aleixpol@kde.org> | |
| 6 | + | Copyright © 2020 Carlos Garnacho <carlosg@gnome.org> | |
| 7 | + | ||
| 8 | + | Permission is hereby granted, free of charge, to any person obtaining a | |
| 9 | + | copy of this software and associated documentation files (the "Software"), | |
| 10 | + | to deal in the Software without restriction, including without limitation | |
| 11 | + | the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
| 12 | + | and/or sell copies of the Software, and to permit persons to whom the | |
| 13 | + | Software is furnished to do so, subject to the following conditions: | |
| 14 | + | ||
| 15 | + | The above copyright notice and this permission notice (including the next | |
| 16 | + | paragraph) shall be included in all copies or substantial portions of the | |
| 17 | + | Software. | |
| 18 | + | ||
| 19 | + | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
| 20 | + | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
| 21 | + | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | |
| 22 | + | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
| 23 | + | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
| 24 | + | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
| 25 | + | DEALINGS IN THE SOFTWARE. | |
| 26 | + | </copyright> | |
| 27 | + | ||
| 28 | + | <description summary="Protocol for requesting activation of surfaces"> | |
| 29 | + | The way for a client to pass focus to another toplevel is as follows. | |
| 30 | + | ||
| 31 | + | The client that intends to activate another toplevel uses the | |
| 32 | + | xdg_activation_v1.get_activation_token request to get an activation token. | |
| 33 | + | This token is then forwarded to the client, which is supposed to activate | |
| 34 | + | one of its surfaces, through a separate band of communication. | |
| 35 | + | ||
| 36 | + | One established way of doing this is through the XDG_ACTIVATION_TOKEN | |
| 37 | + | environment variable of a newly launched child process. The child process | |
| 38 | + | should unset the environment variable again right after reading it out in | |
| 39 | + | order to avoid propagating it to other child processes. | |
| 40 | + | ||
| 41 | + | Another established way exists for Applications implementing the D-Bus | |
| 42 | + | interface org.freedesktop.Application, which should get their token under | |
| 43 | + | activation-token on their platform_data. | |
| 44 | + | ||
| 45 | + | In general activation tokens may be transferred across clients through | |
| 46 | + | means not described in this protocol. | |
| 47 | + | ||
| 48 | + | The client to be activated will then pass the token | |
| 49 | + | it received to the xdg_activation_v1.activate request. The compositor can | |
| 50 | + | then use this token to decide how to react to the activation request. | |
| 51 | + | ||
| 52 | + | The token the activating client gets may be ineffective either already at | |
| 53 | + | the time it receives it, for example if it was not focused, for focus | |
| 54 | + | stealing prevention. The activating client will have no way to discover | |
| 55 | + | the validity of the token, and may still forward it to the to be activated | |
| 56 | + | client. | |
| 57 | + | ||
| 58 | + | The created activation token may optionally get information attached to it | |
| 59 | + | that can be used by the compositor to identify the application that we | |
| 60 | + | intend to activate. This can for example be used to display a visual hint | |
| 61 | + | about what application is being started. | |
| 62 | + | ||
| 63 | + | Warning! The protocol described in this file is currently in the testing | |
| 64 | + | phase. Backward compatible changes may be added together with the | |
| 65 | + | corresponding interface version bump. Backward incompatible changes can | |
| 66 | + | only be done by creating a new major version of the extension. | |
| 67 | + | </description> | |
| 68 | + | ||
| 69 | + | <interface name="xdg_activation_v1" version="1"> | |
| 70 | + | <description summary="interface for activating surfaces"> | |
| 71 | + | A global interface used for informing the compositor about applications | |
| 72 | + | being activated or started, or for applications to request to be | |
| 73 | + | activated. | |
| 74 | + | </description> | |
| 75 | + | ||
| 76 | + | <request name="destroy" type="destructor"> | |
| 77 | + | <description summary="destroy the xdg_activation object"> | |
| 78 | + | Notify the compositor that the xdg_activation object will no longer be | |
| 79 | + | used. | |
| 80 | + | ||
| 81 | + | The child objects created via this interface are unaffected and should | |
| 82 | + | be destroyed separately. | |
| 83 | + | </description> | |
| 84 | + | </request> | |
| 85 | + | ||
| 86 | + | <request name="get_activation_token"> | |
| 87 | + | <description summary="requests a token"> | |
| 88 | + | Creates an xdg_activation_token_v1 object that will provide | |
| 89 | + | the initiating client with a unique token for this activation. This | |
| 90 | + | token should be offered to the clients to be activated. | |
| 91 | + | </description> | |
| 92 | + | ||
| 93 | + | <arg name="id" type="new_id" interface="xdg_activation_token_v1"/> | |
| 94 | + | </request> | |
| 95 | + | ||
| 96 | + | <request name="activate"> | |
| 97 | + | <description summary="notify new interaction being available"> | |
| 98 | + | Requests surface activation. It's up to the compositor to display | |
| 99 | + | this information as desired, for example by placing the surface above | |
| 100 | + | the rest. | |
| 101 | + | ||
| 102 | + | The compositor may know who requested this by checking the activation | |
| 103 | + | token and might decide not to follow through with the activation if it's | |
| 104 | + | considered unwanted. | |
| 105 | + | ||
| 106 | + | Compositors can ignore unknown activation tokens when an invalid | |
| 107 | + | token is passed. | |
| 108 | + | </description> | |
| 109 | + | <arg name="token" type="string" summary="the activation token of the initiating client"/> | |
| 110 | + | <arg name="surface" type="object" interface="wl_surface" | |
| 111 | + | summary="the wl_surface to activate"/> | |
| 112 | + | </request> | |
| 113 | + | </interface> | |
| 114 | + | ||
| 115 | + | <interface name="xdg_activation_token_v1" version="1"> | |
| 116 | + | <description summary="an exported activation handle"> | |
| 117 | + | An object for setting up a token and receiving a token handle that can | |
| 118 | + | be passed as an activation token to another client. | |
| 119 | + | ||
| 120 | + | The object is created using the xdg_activation_v1.get_activation_token | |
| 121 | + | request. This object should then be populated with the app_id, surface | |
| 122 | + | and serial information and committed. The compositor shall then issue a | |
| 123 | + | done event with the token. In case the request's parameters are invalid, | |
| 124 | + | the compositor will provide an invalid token. | |
| 125 | + | </description> | |
| 126 | + | ||
| 127 | + | <enum name="error"> | |
| 128 | + | <entry name="already_used" value="0" | |
| 129 | + | summary="The token has already been used previously"/> | |
| 130 | + | </enum> | |
| 131 | + | ||
| 132 | + | <request name="set_serial"> | |
| 133 | + | <description summary="specifies the seat and serial of the activating event"> | |
| 134 | + | Provides information about the seat and serial event that requested the | |
| 135 | + | token. | |
| 136 | + | ||
| 137 | + | The serial can come from an input or focus event. For instance, if a | |
| 138 | + | click triggers the launch of a third-party client, the launcher client | |
| 139 | + | should send a set_serial request with the serial and seat from the | |
| 140 | + | wl_pointer.button event. | |
| 141 | + | ||
| 142 | + | Some compositors might refuse to activate toplevels when the token | |
| 143 | + | doesn't have a valid and recent enough event serial. | |
| 144 | + | ||
| 145 | + | Must be sent before commit. This information is optional. | |
| 146 | + | </description> | |
| 147 | + | <arg name="serial" type="uint" | |
| 148 | + | summary="the serial of the event that triggered the activation"/> | |
| 149 | + | <arg name="seat" type="object" interface="wl_seat" | |
| 150 | + | summary="the wl_seat of the event"/> | |
| 151 | + | </request> | |
| 152 | + | ||
| 153 | + | <request name="set_app_id"> | |
| 154 | + | <description summary="specifies the application being activated"> | |
| 155 | + | The requesting client can specify an app_id to associate the token | |
| 156 | + | being created with it. | |
| 157 | + | ||
| 158 | + | Must be sent before commit. This information is optional. | |
| 159 | + | </description> | |
| 160 | + | <arg name="app_id" type="string" | |
| 161 | + | summary="the application id of the client being activated."/> | |
| 162 | + | </request> | |
| 163 | + | ||
| 164 | + | <request name="set_surface"> | |
| 165 | + | <description summary="specifies the surface requesting activation"> | |
| 166 | + | This request sets the surface requesting the activation. Note, this is | |
| 167 | + | different from the surface that will be activated. | |
| 168 | + | ||
| 169 | + | Some compositors might refuse to activate toplevels when the token | |
| 170 | + | doesn't have a requesting surface. | |
| 171 | + | ||
| 172 | + | Must be sent before commit. This information is optional. | |
| 173 | + | </description> | |
| 174 | + | <arg name="surface" type="object" interface="wl_surface" | |
| 175 | + | summary="the requesting surface"/> | |
| 176 | + | </request> | |
| 177 | + | ||
| 178 | + | <request name="commit"> | |
| 179 | + | <description summary="issues the token request"> | |
| 180 | + | Requests an activation token based on the different parameters that | |
| 181 | + | have been offered through set_serial, set_surface and set_app_id. | |
| 182 | + | </description> | |
| 183 | + | </request> | |
| 184 | + | ||
| 185 | + | <event name="done"> | |
| 186 | + | <description summary="the exported activation token"> | |
| 187 | + | The 'done' event contains the unique token of this activation request | |
| 188 | + | and notifies that the provider is done. | |
| 189 | + | </description> | |
| 190 | + | <arg name="token" type="string" summary="the exported activation token"/> | |
| 191 | + | </event> | |
| 192 | + | ||
| 193 | + | <request name="destroy" type="destructor"> | |
| 194 | + | <description summary="destroy the xdg_activation_token_v1 object"> | |
| 195 | + | Notify the compositor that the xdg_activation_token_v1 object will no | |
| 196 | + | longer be used. The received token stays valid. | |
| 197 | + | </description> | |
| 198 | + | </request> | |
| 199 | + | </interface> | |
| 200 | + | </protocol> | |
| @@ -0,0 +1,200 @@ | |||||
| 1 | + | <?xml version="1.0" encoding="UTF-8"?> | |||
| 2 | + | <protocol name="xdg_activation_v1"> | |||
| 3 | + | ||||
| 4 | + | <copyright> | |||
| 5 | + | Copyright © 2020 Aleix Pol Gonzalez <aleixpol@kde.org> | |||
| 6 | + | Copyright © 2020 Carlos Garnacho <carlosg@gnome.org> | |||
| 7 | + | ||||
| 8 | + | Permission is hereby granted, free of charge, to any person obtaining a | |||
| 9 | + | copy of this software and associated documentation files (the "Software"), | |||
| 10 | + | to deal in the Software without restriction, including without limitation | |||
| 11 | + | the rights to use, copy, modify, merge, publish, distribute, sublicense, | |||
| 12 | + | and/or sell copies of the Software, and to permit persons to whom the | |||
| 13 | + | Software is furnished to do so, subject to the following conditions: | |||
| 14 | + | ||||
| 15 | + | The above copyright notice and this permission notice (including the next | |||
| 16 | + | paragraph) shall be included in all copies or substantial portions of the | |||
| 17 | + | Software. | |||
| 18 | + | ||||
| 19 | + | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |||
| 20 | + | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |||
| 21 | + | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | |||
| 22 | + | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |||
| 23 | + | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |||
| 24 | + | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |||
| 25 | + | DEALINGS IN THE SOFTWARE. | |||
| 26 | + | </copyright> | |||
| 27 | + | ||||
| 28 | + | <description summary="Protocol for requesting activation of surfaces"> | |||
| 29 | + | The way for a client to pass focus to another toplevel is as follows. | |||
| 30 | + | ||||
| 31 | + | The client that intends to activate another toplevel uses the | |||
| 32 | + | xdg_activation_v1.get_activation_token request to get an activation token. | |||
| 33 | + | This token is then forwarded to the client, which is supposed to activate | |||
| 34 | + | one of its surfaces, through a separate band of communication. | |||
| 35 | + | ||||
| 36 | + | One established way of doing this is through the XDG_ACTIVATION_TOKEN | |||
| 37 | + | environment variable of a newly launched child process. The child process | |||
| 38 | + | should unset the environment variable again right after reading it out in | |||
| 39 | + | order to avoid propagating it to other child processes. | |||
| 40 | + | ||||
| 41 | + | Another established way exists for Applications implementing the D-Bus | |||
| 42 | + | interface org.freedesktop.Application, which should get their token under | |||
| 43 | + | activation-token on their platform_data. | |||
| 44 | + | ||||
| 45 | + | In general activation tokens may be transferred across clients through | |||
| 46 | + | means not described in this protocol. | |||
| 47 | + | ||||
| 48 | + | The client to be activated will then pass the token | |||
| 49 | + | it received to the xdg_activation_v1.activate request. The compositor can | |||
| 50 | + | then use this token to decide how to react to the activation request. | |||
| 51 | + | ||||
| 52 | + | The token the activating client gets may be ineffective either already at | |||
| 53 | + | the time it receives it, for example if it was not focused, for focus | |||
| 54 | + | stealing prevention. The activating client will have no way to discover | |||
| 55 | + | the validity of the token, and may still forward it to the to be activated | |||
| 56 | + | client. | |||
| 57 | + | ||||
| 58 | + | The created activation token may optionally get information attached to it | |||
| 59 | + | that can be used by the compositor to identify the application that we | |||
| 60 | + | intend to activate. This can for example be used to display a visual hint | |||
| 61 | + | about what application is being started. | |||
| 62 | + | ||||
| 63 | + | Warning! The protocol described in this file is currently in the testing | |||
| 64 | + | phase. Backward compatible changes may be added together with the | |||
| 65 | + | corresponding interface version bump. Backward incompatible changes can | |||
| 66 | + | only be done by creating a new major version of the extension. | |||
| 67 | + | </description> | |||
| 68 | + | ||||
| 69 | + | <interface name="xdg_activation_v1" version="1"> | |||
| 70 | + | <description summary="interface for activating surfaces"> | |||
| 71 | + | A global interface used for informing the compositor about applications | |||
| 72 | + | being activated or started, or for applications to request to be | |||
| 73 | + | activated. | |||
| 74 | + | </description> | |||
| 75 | + | ||||
| 76 | + | <request name="destroy" type="destructor"> | |||
| 77 | + | <description summary="destroy the xdg_activation object"> | |||
| 78 | + | Notify the compositor that the xdg_activation object will no longer be | |||
| 79 | + | used. | |||
| 80 | + | ||||
| 81 | + | The child objects created via this interface are unaffected and should | |||
| 82 | + | be destroyed separately. | |||
| 83 | + | </description> | |||
| 84 | + | </request> | |||
| 85 | + | ||||
| 86 | + | <request name="get_activation_token"> | |||
| 87 | + | <description summary="requests a token"> | |||
| 88 | + | Creates an xdg_activation_token_v1 object that will provide | |||
| 89 | + | the initiating client with a unique token for this activation. This | |||
| 90 | + | token should be offered to the clients to be activated. | |||
| 91 | + | </description> | |||
| 92 | + | ||||
| 93 | + | <arg name="id" type="new_id" interface="xdg_activation_token_v1"/> | |||
| 94 | + | </request> | |||
| 95 | + | ||||
| 96 | + | <request name="activate"> | |||
| 97 | + | <description summary="notify new interaction being available"> | |||
| 98 | + | Requests surface activation. It's up to the compositor to display | |||
| 99 | + | this information as desired, for example by placing the surface above | |||
| 100 | + | the rest. | |||
| 101 | + | ||||
| 102 | + | The compositor may know who requested this by checking the activation | |||
| 103 | + | token and might decide not to follow through with the activation if it's | |||
| 104 | + | considered unwanted. | |||
| 105 | + | ||||
| 106 | + | Compositors can ignore unknown activation tokens when an invalid | |||
| 107 | + | token is passed. | |||
| 108 | + | </description> | |||
| 109 | + | <arg name="token" type="string" summary="the activation token of the initiating client"/> | |||
| 110 | + | <arg name="surface" type="object" interface="wl_surface" | |||
| 111 | + | summary="the wl_surface to activate"/> | |||
| 112 | + | </request> | |||
| 113 | + | </interface> | |||
| 114 | + | ||||
| 115 | + | <interface name="xdg_activation_token_v1" version="1"> | |||
| 116 | + | <description summary="an exported activation handle"> | |||
| 117 | + | An object for setting up a token and receiving a token handle that can | |||
| 118 | + | be passed as an activation token to another client. | |||
| 119 | + | ||||
| 120 | + | The object is created using the xdg_activation_v1.get_activation_token | |||
| 121 | + | request. This object should then be populated with the app_id, surface | |||
| 122 | + | and serial information and committed. The compositor shall then issue a | |||
| 123 | + | done event with the token. In case the request's parameters are invalid, | |||
| 124 | + | the compositor will provide an invalid token. | |||
| 125 | + | </description> | |||
| 126 | + | ||||
| 127 | + | <enum name="error"> | |||
| 128 | + | <entry name="already_used" value="0" | |||
| 129 | + | summary="The token has already been used previously"/> | |||
| 130 | + | </enum> | |||
| 131 | + | ||||
| 132 | + | <request name="set_serial"> | |||
| 133 | + | <description summary="specifies the seat and serial of the activating event"> | |||
| 134 | + | Provides information about the seat and serial event that requested the | |||
| 135 | + | token. | |||
| 136 | + | ||||
| 137 | + | The serial can come from an input or focus event. For instance, if a | |||
| 138 | + | click triggers the launch of a third-party client, the launcher client | |||
| 139 | + | should send a set_serial request with the serial and seat from the | |||
| 140 | + | wl_pointer.button event. | |||
| 141 | + | ||||
| 142 | + | Some compositors might refuse to activate toplevels when the token | |||
| 143 | + | doesn't have a valid and recent enough event serial. | |||
| 144 | + | ||||
| 145 | + | Must be sent before commit. This information is optional. | |||
| 146 | + | </description> | |||
| 147 | + | <arg name="serial" type="uint" | |||
| 148 | + | summary="the serial of the event that triggered the activation"/> | |||
| 149 | + | <arg name="seat" type="object" interface="wl_seat" | |||
| 150 | + | summary="the wl_seat of the event"/> | |||
| 151 | + | </request> | |||
| 152 | + | ||||
| 153 | + | <request name="set_app_id"> | |||
| 154 | + | <description summary="specifies the application being activated"> | |||
| 155 | + | The requesting client can specify an app_id to associate the token | |||
| 156 | + | being created with it. | |||
| 157 | + | ||||
| 158 | + | Must be sent before commit. This information is optional. | |||
| 159 | + | </description> | |||
| 160 | + | <arg name="app_id" type="string" | |||
| 161 | + | summary="the application id of the client being activated."/> | |||
| 162 | + | </request> | |||
| 163 | + | ||||
| 164 | + | <request name="set_surface"> | |||
| 165 | + | <description summary="specifies the surface requesting activation"> | |||
| 166 | + | This request sets the surface requesting the activation. Note, this is | |||
| 167 | + | different from the surface that will be activated. | |||
| 168 | + | ||||
| 169 | + | Some compositors might refuse to activate toplevels when the token | |||
| 170 | + | doesn't have a requesting surface. | |||
| 171 | + | ||||
| 172 | + | Must be sent before commit. This information is optional. | |||
| 173 | + | </description> | |||
| 174 | + | <arg name="surface" type="object" interface="wl_surface" | |||
| 175 | + | summary="the requesting surface"/> | |||
| 176 | + | </request> | |||
| 177 | + | ||||
| 178 | + | <request name="commit"> | |||
| 179 | + | <description summary="issues the token request"> | |||
| 180 | + | Requests an activation token based on the different parameters that | |||
| 181 | + | have been offered through set_serial, set_surface and set_app_id. | |||
| 182 | + | </description> | |||
| 183 | + | </request> | |||
| 184 | + | ||||
| 185 | + | <event name="done"> | |||
| 186 | + | <description summary="the exported activation token"> | |||
| 187 | + | The 'done' event contains the unique token of this activation request | |||
| 188 | + | and notifies that the provider is done. | |||
| 189 | + | </description> | |||
| 190 | + | <arg name="token" type="string" summary="the exported activation token"/> | |||
| 191 | + | </event> | |||
| 192 | + | ||||
| 193 | + | <request name="destroy" type="destructor"> | |||
| 194 | + | <description summary="destroy the xdg_activation_token_v1 object"> | |||
| 195 | + | Notify the compositor that the xdg_activation_token_v1 object will no | |||
| 196 | + | longer be used. The received token stays valid. | |||
| 197 | + | </description> | |||
| 198 | + | </request> | |||
| 199 | + | </interface> | |||
| 200 | + | </protocol> | |||