merge: kde server-decoration bindings
3 files · +249 -0
M protocol/gen.go +1 -0
| @@ -9,3 +9,4 @@ package protocol | |||
| 9 | 9 | //go:generate go run ../cmd/wlgen -package viewporter -out viewporter/viewporter.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/viewporter.xml | |
| 10 | 10 | //go:generate go run ../cmd/wlgen -package fractionalscale -out fractionalscale/fractionalscale.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/fractional-scale-v1.xml | |
| 11 | 11 | //go:generate go run ../cmd/wlgen -package linuxdmabuf -out linuxdmabuf/linuxdmabuf.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/linux-dmabuf-v1.xml | |
| 12 | + | //go:generate go run ../cmd/wlgen -package kdedecoration -out kdedecoration/kdedecoration.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/server-decoration.xml | |
| @@ -9,3 +9,4 @@ package protocol | |||||
| 9 | //go:generate go run ../cmd/wlgen -package viewporter -out viewporter/viewporter.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/viewporter.xml | 9 | //go:generate go run ../cmd/wlgen -package viewporter -out viewporter/viewporter.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/viewporter.xml | ||
| 10 | //go:generate go run ../cmd/wlgen -package fractionalscale -out fractionalscale/fractionalscale.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/fractional-scale-v1.xml | 10 | //go:generate go run ../cmd/wlgen -package fractionalscale -out fractionalscale/fractionalscale.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/fractional-scale-v1.xml | ||
| 11 | //go:generate go run ../cmd/wlgen -package linuxdmabuf -out linuxdmabuf/linuxdmabuf.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/linux-dmabuf-v1.xml | 11 | //go:generate go run ../cmd/wlgen -package linuxdmabuf -out linuxdmabuf/linuxdmabuf.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/linux-dmabuf-v1.xml | ||
| 12 | + | //go:generate go run ../cmd/wlgen -package kdedecoration -out kdedecoration/kdedecoration.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/server-decoration.xml | |||
A protocol/kdedecoration/kdedecoration.go +163 -0
| @@ -0,0 +1,163 @@ | |||
| 1 | + | // Code generated by wlgen; DO NOT EDIT. | |
| 2 | + | package kdedecoration | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "fmt" | |
| 6 | + | wayland "github.com/bnema/purego-libwayland/protocol/wayland" | |
| 7 | + | "github.com/bnema/purego-libwayland/server" | |
| 8 | + | ) | |
| 9 | + | ||
| 10 | + | var OrgKdeKwinServerDecorationManagerInterface *server.Interface | |
| 11 | + | var OrgKdeKwinServerDecorationInterface *server.Interface | |
| 12 | + | ||
| 13 | + | func init() { | |
| 14 | + | OrgKdeKwinServerDecorationManagerInterface = &server.Interface{Name: "org_kde_kwin_server_decoration_manager", Version: 1} | |
| 15 | + | OrgKdeKwinServerDecorationInterface = &server.Interface{Name: "org_kde_kwin_server_decoration", Version: 1} | |
| 16 | + | OrgKdeKwinServerDecorationManagerInterface.Requests = []server.Message{ | |
| 17 | + | {Name: "create", Signature: "no", Types: []*server.Interface{OrgKdeKwinServerDecorationInterface, wayland.SurfaceInterface}}, | |
| 18 | + | } | |
| 19 | + | OrgKdeKwinServerDecorationManagerInterface.Events = []server.Message{ | |
| 20 | + | {Name: "default_mode", Signature: "u", Types: []*server.Interface{nil}}, | |
| 21 | + | } | |
| 22 | + | OrgKdeKwinServerDecorationInterface.Requests = []server.Message{ | |
| 23 | + | {Name: "release", Signature: "", Types: []*server.Interface{}}, | |
| 24 | + | {Name: "request_mode", Signature: "u", Types: []*server.Interface{nil}}, | |
| 25 | + | } | |
| 26 | + | OrgKdeKwinServerDecorationInterface.Events = []server.Message{ | |
| 27 | + | {Name: "mode", Signature: "u", Types: []*server.Interface{nil}}, | |
| 28 | + | } | |
| 29 | + | if err := server.NewInterfaces(OrgKdeKwinServerDecorationManagerInterface, OrgKdeKwinServerDecorationInterface); err != nil { | |
| 30 | + | panic(err) | |
| 31 | + | } | |
| 32 | + | } | |
| 33 | + | ||
| 34 | + | // OrgKdeKwinServerDecorationManager Server side window decoration manager. | |
| 35 | + | type OrgKdeKwinServerDecorationManager struct{ *server.Resource } | |
| 36 | + | ||
| 37 | + | func WrapOrgKdeKwinServerDecorationManager(r *server.Resource) *OrgKdeKwinServerDecorationManager { | |
| 38 | + | if r == nil { | |
| 39 | + | return nil | |
| 40 | + | } | |
| 41 | + | return &OrgKdeKwinServerDecorationManager{r} | |
| 42 | + | } | |
| 43 | + | ||
| 44 | + | const OrgKdeKwinServerDecorationManagerRequestCreate uint32 = 0 | |
| 45 | + | const OrgKdeKwinServerDecorationManagerEventDefaultMode uint32 = 0 | |
| 46 | + | ||
| 47 | + | // OrgKdeKwinServerDecorationManagerMode Possible values to use in request_mode and the event mode.. | |
| 48 | + | type OrgKdeKwinServerDecorationManagerMode uint32 | |
| 49 | + | ||
| 50 | + | const ( | |
| 51 | + | OrgKdeKwinServerDecorationManagerModeNone OrgKdeKwinServerDecorationManagerMode = 0 | |
| 52 | + | OrgKdeKwinServerDecorationManagerModeClient OrgKdeKwinServerDecorationManagerMode = 1 | |
| 53 | + | OrgKdeKwinServerDecorationManagerModeServer OrgKdeKwinServerDecorationManagerMode = 2 | |
| 54 | + | ) | |
| 55 | + | ||
| 56 | + | // OrgKdeKwinServerDecorationManagerHandler handles org_kde_kwin_server_decoration_manager requests. | |
| 57 | + | type OrgKdeKwinServerDecorationManagerHandler interface { | |
| 58 | + | Create(self *OrgKdeKwinServerDecorationManager, id uint32, surface *wayland.Surface) | |
| 59 | + | } | |
| 60 | + | ||
| 61 | + | func NewOrgKdeKwinServerDecorationManager(c server.Client, version int32, id uint32, h OrgKdeKwinServerDecorationManagerHandler) (*OrgKdeKwinServerDecorationManager, error) { | |
| 62 | + | if h == nil { | |
| 63 | + | return nil, fmt.Errorf("purego-libwayland: nil handler for org_kde_kwin_server_decoration_manager") | |
| 64 | + | } | |
| 65 | + | var self *OrgKdeKwinServerDecorationManager | |
| 66 | + | r, err := c.CreateResource(OrgKdeKwinServerDecorationManagerInterface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { | |
| 67 | + | switch opcode { | |
| 68 | + | case 0: | |
| 69 | + | h.Create(self, args[0].NewID(), wayland.WrapSurface(args[1].Resource())) | |
| 70 | + | } | |
| 71 | + | }) | |
| 72 | + | if err != nil { | |
| 73 | + | return nil, err | |
| 74 | + | } | |
| 75 | + | self = WrapOrgKdeKwinServerDecorationManager(r) | |
| 76 | + | r.Data = self | |
| 77 | + | return self, nil | |
| 78 | + | } | |
| 79 | + | ||
| 80 | + | // SendDefaultMode The default mode used on the server. | |
| 81 | + | func (self *OrgKdeKwinServerDecorationManager) SendDefaultMode(mode uint32) { | |
| 82 | + | self.PostEvent(OrgKdeKwinServerDecorationManagerEventDefaultMode, server.Uint(mode)) | |
| 83 | + | } | |
| 84 | + | func NewOrgKdeKwinServerDecorationManagerGlobal(d *server.Display, version int32, bind server.BindFunc) error { | |
| 85 | + | return d.CreateGlobal(OrgKdeKwinServerDecorationManagerInterface, version, bind) | |
| 86 | + | } | |
| 87 | + | ||
| 88 | + | // OrgKdeKwinServerDecoration . | |
| 89 | + | type OrgKdeKwinServerDecoration struct{ *server.Resource } | |
| 90 | + | ||
| 91 | + | func WrapOrgKdeKwinServerDecoration(r *server.Resource) *OrgKdeKwinServerDecoration { | |
| 92 | + | if r == nil { | |
| 93 | + | return nil | |
| 94 | + | } | |
| 95 | + | return &OrgKdeKwinServerDecoration{r} | |
| 96 | + | } | |
| 97 | + | ||
| 98 | + | const OrgKdeKwinServerDecorationRequestRelease uint32 = 0 | |
| 99 | + | const OrgKdeKwinServerDecorationRequestRequestMode uint32 = 1 | |
| 100 | + | const OrgKdeKwinServerDecorationEventMode uint32 = 0 | |
| 101 | + | ||
| 102 | + | // OrgKdeKwinServerDecorationMode Possible values to use in request_mode and the event mode.. | |
| 103 | + | type OrgKdeKwinServerDecorationMode uint32 | |
| 104 | + | ||
| 105 | + | const ( | |
| 106 | + | OrgKdeKwinServerDecorationModeNone OrgKdeKwinServerDecorationMode = 0 | |
| 107 | + | OrgKdeKwinServerDecorationModeClient OrgKdeKwinServerDecorationMode = 1 | |
| 108 | + | OrgKdeKwinServerDecorationModeServer OrgKdeKwinServerDecorationMode = 2 | |
| 109 | + | ) | |
| 110 | + | ||
| 111 | + | // OrgKdeKwinServerDecorationHandler handles org_kde_kwin_server_decoration requests. | |
| 112 | + | type OrgKdeKwinServerDecorationHandler interface { | |
| 113 | + | Release(self *OrgKdeKwinServerDecoration) | |
| 114 | + | RequestMode(self *OrgKdeKwinServerDecoration, mode uint32) | |
| 115 | + | } | |
| 116 | + | ||
| 117 | + | func NewOrgKdeKwinServerDecoration(c server.Client, version int32, id uint32, h OrgKdeKwinServerDecorationHandler) (*OrgKdeKwinServerDecoration, error) { | |
| 118 | + | if h == nil { | |
| 119 | + | return nil, fmt.Errorf("purego-libwayland: nil handler for org_kde_kwin_server_decoration") | |
| 120 | + | } | |
| 121 | + | var self *OrgKdeKwinServerDecoration | |
| 122 | + | r, err := c.CreateResource(OrgKdeKwinServerDecorationInterface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { | |
| 123 | + | switch opcode { | |
| 124 | + | case 0: | |
| 125 | + | h.Release(self) | |
| 126 | + | self.Destroy() | |
| 127 | + | case 1: | |
| 128 | + | h.RequestMode(self, args[0].Uint()) | |
| 129 | + | } | |
| 130 | + | }) | |
| 131 | + | if err != nil { | |
| 132 | + | return nil, err | |
| 133 | + | } | |
| 134 | + | self = WrapOrgKdeKwinServerDecoration(r) | |
| 135 | + | r.Data = self | |
| 136 | + | return self, nil | |
| 137 | + | } | |
| 138 | + | ||
| 139 | + | // SendMode The new decoration mode applied by the server. | |
| 140 | + | func (self *OrgKdeKwinServerDecoration) SendMode(mode uint32) { | |
| 141 | + | self.PostEvent(OrgKdeKwinServerDecorationEventMode, server.Uint(mode)) | |
| 142 | + | } | |
| 143 | + | func NewOrgKdeKwinServerDecorationGlobal(d *server.Display, version int32, bind server.BindFunc) error { | |
| 144 | + | return d.CreateGlobal(OrgKdeKwinServerDecorationInterface, version, bind) | |
| 145 | + | } | |
| 146 | + | func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource { | |
| 147 | + | if v == nil { | |
| 148 | + | return nil | |
| 149 | + | } | |
| 150 | + | return v.GetResource() | |
| 151 | + | } | |
| 152 | + | func (self *OrgKdeKwinServerDecorationManager) GetResource() *server.Resource { | |
| 153 | + | if self == nil { | |
| 154 | + | return nil | |
| 155 | + | } | |
| 156 | + | return self.Resource | |
| 157 | + | } | |
| 158 | + | func (self *OrgKdeKwinServerDecoration) GetResource() *server.Resource { | |
| 159 | + | if self == nil { | |
| 160 | + | return nil | |
| 161 | + | } | |
| 162 | + | return self.Resource | |
| 163 | + | } | |
| @@ -0,0 +1,163 @@ | |||||
| 1 | + | // Code generated by wlgen; DO NOT EDIT. | |||
| 2 | + | package kdedecoration | |||
| 3 | + | ||||
| 4 | + | import ( | |||
| 5 | + | "fmt" | |||
| 6 | + | wayland "github.com/bnema/purego-libwayland/protocol/wayland" | |||
| 7 | + | "github.com/bnema/purego-libwayland/server" | |||
| 8 | + | ) | |||
| 9 | + | ||||
| 10 | + | var OrgKdeKwinServerDecorationManagerInterface *server.Interface | |||
| 11 | + | var OrgKdeKwinServerDecorationInterface *server.Interface | |||
| 12 | + | ||||
| 13 | + | func init() { | |||
| 14 | + | OrgKdeKwinServerDecorationManagerInterface = &server.Interface{Name: "org_kde_kwin_server_decoration_manager", Version: 1} | |||
| 15 | + | OrgKdeKwinServerDecorationInterface = &server.Interface{Name: "org_kde_kwin_server_decoration", Version: 1} | |||
| 16 | + | OrgKdeKwinServerDecorationManagerInterface.Requests = []server.Message{ | |||
| 17 | + | {Name: "create", Signature: "no", Types: []*server.Interface{OrgKdeKwinServerDecorationInterface, wayland.SurfaceInterface}}, | |||
| 18 | + | } | |||
| 19 | + | OrgKdeKwinServerDecorationManagerInterface.Events = []server.Message{ | |||
| 20 | + | {Name: "default_mode", Signature: "u", Types: []*server.Interface{nil}}, | |||
| 21 | + | } | |||
| 22 | + | OrgKdeKwinServerDecorationInterface.Requests = []server.Message{ | |||
| 23 | + | {Name: "release", Signature: "", Types: []*server.Interface{}}, | |||
| 24 | + | {Name: "request_mode", Signature: "u", Types: []*server.Interface{nil}}, | |||
| 25 | + | } | |||
| 26 | + | OrgKdeKwinServerDecorationInterface.Events = []server.Message{ | |||
| 27 | + | {Name: "mode", Signature: "u", Types: []*server.Interface{nil}}, | |||
| 28 | + | } | |||
| 29 | + | if err := server.NewInterfaces(OrgKdeKwinServerDecorationManagerInterface, OrgKdeKwinServerDecorationInterface); err != nil { | |||
| 30 | + | panic(err) | |||
| 31 | + | } | |||
| 32 | + | } | |||
| 33 | + | ||||
| 34 | + | // OrgKdeKwinServerDecorationManager Server side window decoration manager. | |||
| 35 | + | type OrgKdeKwinServerDecorationManager struct{ *server.Resource } | |||
| 36 | + | ||||
| 37 | + | func WrapOrgKdeKwinServerDecorationManager(r *server.Resource) *OrgKdeKwinServerDecorationManager { | |||
| 38 | + | if r == nil { | |||
| 39 | + | return nil | |||
| 40 | + | } | |||
| 41 | + | return &OrgKdeKwinServerDecorationManager{r} | |||
| 42 | + | } | |||
| 43 | + | ||||
| 44 | + | const OrgKdeKwinServerDecorationManagerRequestCreate uint32 = 0 | |||
| 45 | + | const OrgKdeKwinServerDecorationManagerEventDefaultMode uint32 = 0 | |||
| 46 | + | ||||
| 47 | + | // OrgKdeKwinServerDecorationManagerMode Possible values to use in request_mode and the event mode.. | |||
| 48 | + | type OrgKdeKwinServerDecorationManagerMode uint32 | |||
| 49 | + | ||||
| 50 | + | const ( | |||
| 51 | + | OrgKdeKwinServerDecorationManagerModeNone OrgKdeKwinServerDecorationManagerMode = 0 | |||
| 52 | + | OrgKdeKwinServerDecorationManagerModeClient OrgKdeKwinServerDecorationManagerMode = 1 | |||
| 53 | + | OrgKdeKwinServerDecorationManagerModeServer OrgKdeKwinServerDecorationManagerMode = 2 | |||
| 54 | + | ) | |||
| 55 | + | ||||
| 56 | + | // OrgKdeKwinServerDecorationManagerHandler handles org_kde_kwin_server_decoration_manager requests. | |||
| 57 | + | type OrgKdeKwinServerDecorationManagerHandler interface { | |||
| 58 | + | Create(self *OrgKdeKwinServerDecorationManager, id uint32, surface *wayland.Surface) | |||
| 59 | + | } | |||
| 60 | + | ||||
| 61 | + | func NewOrgKdeKwinServerDecorationManager(c server.Client, version int32, id uint32, h OrgKdeKwinServerDecorationManagerHandler) (*OrgKdeKwinServerDecorationManager, error) { | |||
| 62 | + | if h == nil { | |||
| 63 | + | return nil, fmt.Errorf("purego-libwayland: nil handler for org_kde_kwin_server_decoration_manager") | |||
| 64 | + | } | |||
| 65 | + | var self *OrgKdeKwinServerDecorationManager | |||
| 66 | + | r, err := c.CreateResource(OrgKdeKwinServerDecorationManagerInterface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { | |||
| 67 | + | switch opcode { | |||
| 68 | + | case 0: | |||
| 69 | + | h.Create(self, args[0].NewID(), wayland.WrapSurface(args[1].Resource())) | |||
| 70 | + | } | |||
| 71 | + | }) | |||
| 72 | + | if err != nil { | |||
| 73 | + | return nil, err | |||
| 74 | + | } | |||
| 75 | + | self = WrapOrgKdeKwinServerDecorationManager(r) | |||
| 76 | + | r.Data = self | |||
| 77 | + | return self, nil | |||
| 78 | + | } | |||
| 79 | + | ||||
| 80 | + | // SendDefaultMode The default mode used on the server. | |||
| 81 | + | func (self *OrgKdeKwinServerDecorationManager) SendDefaultMode(mode uint32) { | |||
| 82 | + | self.PostEvent(OrgKdeKwinServerDecorationManagerEventDefaultMode, server.Uint(mode)) | |||
| 83 | + | } | |||
| 84 | + | func NewOrgKdeKwinServerDecorationManagerGlobal(d *server.Display, version int32, bind server.BindFunc) error { | |||
| 85 | + | return d.CreateGlobal(OrgKdeKwinServerDecorationManagerInterface, version, bind) | |||
| 86 | + | } | |||
| 87 | + | ||||
| 88 | + | // OrgKdeKwinServerDecoration . | |||
| 89 | + | type OrgKdeKwinServerDecoration struct{ *server.Resource } | |||
| 90 | + | ||||
| 91 | + | func WrapOrgKdeKwinServerDecoration(r *server.Resource) *OrgKdeKwinServerDecoration { | |||
| 92 | + | if r == nil { | |||
| 93 | + | return nil | |||
| 94 | + | } | |||
| 95 | + | return &OrgKdeKwinServerDecoration{r} | |||
| 96 | + | } | |||
| 97 | + | ||||
| 98 | + | const OrgKdeKwinServerDecorationRequestRelease uint32 = 0 | |||
| 99 | + | const OrgKdeKwinServerDecorationRequestRequestMode uint32 = 1 | |||
| 100 | + | const OrgKdeKwinServerDecorationEventMode uint32 = 0 | |||
| 101 | + | ||||
| 102 | + | // OrgKdeKwinServerDecorationMode Possible values to use in request_mode and the event mode.. | |||
| 103 | + | type OrgKdeKwinServerDecorationMode uint32 | |||
| 104 | + | ||||
| 105 | + | const ( | |||
| 106 | + | OrgKdeKwinServerDecorationModeNone OrgKdeKwinServerDecorationMode = 0 | |||
| 107 | + | OrgKdeKwinServerDecorationModeClient OrgKdeKwinServerDecorationMode = 1 | |||
| 108 | + | OrgKdeKwinServerDecorationModeServer OrgKdeKwinServerDecorationMode = 2 | |||
| 109 | + | ) | |||
| 110 | + | ||||
| 111 | + | // OrgKdeKwinServerDecorationHandler handles org_kde_kwin_server_decoration requests. | |||
| 112 | + | type OrgKdeKwinServerDecorationHandler interface { | |||
| 113 | + | Release(self *OrgKdeKwinServerDecoration) | |||
| 114 | + | RequestMode(self *OrgKdeKwinServerDecoration, mode uint32) | |||
| 115 | + | } | |||
| 116 | + | ||||
| 117 | + | func NewOrgKdeKwinServerDecoration(c server.Client, version int32, id uint32, h OrgKdeKwinServerDecorationHandler) (*OrgKdeKwinServerDecoration, error) { | |||
| 118 | + | if h == nil { | |||
| 119 | + | return nil, fmt.Errorf("purego-libwayland: nil handler for org_kde_kwin_server_decoration") | |||
| 120 | + | } | |||
| 121 | + | var self *OrgKdeKwinServerDecoration | |||
| 122 | + | r, err := c.CreateResource(OrgKdeKwinServerDecorationInterface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { | |||
| 123 | + | switch opcode { | |||
| 124 | + | case 0: | |||
| 125 | + | h.Release(self) | |||
| 126 | + | self.Destroy() | |||
| 127 | + | case 1: | |||
| 128 | + | h.RequestMode(self, args[0].Uint()) | |||
| 129 | + | } | |||
| 130 | + | }) | |||
| 131 | + | if err != nil { | |||
| 132 | + | return nil, err | |||
| 133 | + | } | |||
| 134 | + | self = WrapOrgKdeKwinServerDecoration(r) | |||
| 135 | + | r.Data = self | |||
| 136 | + | return self, nil | |||
| 137 | + | } | |||
| 138 | + | ||||
| 139 | + | // SendMode The new decoration mode applied by the server. | |||
| 140 | + | func (self *OrgKdeKwinServerDecoration) SendMode(mode uint32) { | |||
| 141 | + | self.PostEvent(OrgKdeKwinServerDecorationEventMode, server.Uint(mode)) | |||
| 142 | + | } | |||
| 143 | + | func NewOrgKdeKwinServerDecorationGlobal(d *server.Display, version int32, bind server.BindFunc) error { | |||
| 144 | + | return d.CreateGlobal(OrgKdeKwinServerDecorationInterface, version, bind) | |||
| 145 | + | } | |||
| 146 | + | func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource { | |||
| 147 | + | if v == nil { | |||
| 148 | + | return nil | |||
| 149 | + | } | |||
| 150 | + | return v.GetResource() | |||
| 151 | + | } | |||
| 152 | + | func (self *OrgKdeKwinServerDecorationManager) GetResource() *server.Resource { | |||
| 153 | + | if self == nil { | |||
| 154 | + | return nil | |||
| 155 | + | } | |||
| 156 | + | return self.Resource | |||
| 157 | + | } | |||
| 158 | + | func (self *OrgKdeKwinServerDecoration) GetResource() *server.Resource { | |||
| 159 | + | if self == nil { | |||
| 160 | + | return nil | |||
| 161 | + | } | |||
| 162 | + | return self.Resource | |||
| 163 | + | } | |||
A protocols/server-decoration.xml +85 -0
| @@ -0,0 +1,85 @@ | |||
| 1 | + | <?xml version="1.0" encoding="UTF-8"?> | |
| 2 | + | <protocol name="server_decoration"> | |
| 3 | + | <copyright><![CDATA[ | |
| 4 | + | SPDX-FileCopyrightText: 2015 Martin Gräßlin | |
| 5 | + | ||
| 6 | + | SPDX-License-Identifier: LGPL-2.1-or-later | |
| 7 | + | ]]></copyright> | |
| 8 | + | <interface name="org_kde_kwin_server_decoration_manager" version="1"> | |
| 9 | + | <description summary="Server side window decoration manager"> | |
| 10 | + | This interface allows to coordinate whether the server should create | |
| 11 | + | a server-side window decoration around a wl_surface representing a | |
| 12 | + | shell surface (wl_shell_surface or similar). By announcing support | |
| 13 | + | for this interface the server indicates that it supports server | |
| 14 | + | side decorations. | |
| 15 | + | ||
| 16 | + | Use in conjunction with zxdg_decoration_manager_v1 is undefined. | |
| 17 | + | </description> | |
| 18 | + | <request name="create"> | |
| 19 | + | <description summary="Create a server-side decoration object for a given surface"> | |
| 20 | + | When a client creates a server-side decoration object it indicates | |
| 21 | + | that it supports the protocol. The client is supposed to tell the | |
| 22 | + | server whether it wants server-side decorations or will provide | |
| 23 | + | client-side decorations. | |
| 24 | + | ||
| 25 | + | If the client does not create a server-side decoration object for | |
| 26 | + | a surface the server interprets this as lack of support for this | |
| 27 | + | protocol and considers it as client-side decorated. Nevertheless a | |
| 28 | + | client-side decorated surface should use this protocol to indicate | |
| 29 | + | to the server that it does not want a server-side deco. | |
| 30 | + | </description> | |
| 31 | + | <arg name="id" type="new_id" interface="org_kde_kwin_server_decoration"/> | |
| 32 | + | <arg name="surface" type="object" interface="wl_surface"/> | |
| 33 | + | </request> | |
| 34 | + | <enum name="mode"> | |
| 35 | + | <description summary="Possible values to use in request_mode and the event mode."/> | |
| 36 | + | <entry name="None" value="0" summary="Undecorated: The surface is not decorated at all, neither server nor client-side. An example is a popup surface which should not be decorated."/> | |
| 37 | + | <entry name="Client" value="1" summary="Client-side decoration: The decoration is part of the surface and the client."/> | |
| 38 | + | <entry name="Server" value="2" summary="Server-side decoration: The server embeds the surface into a decoration frame."/> | |
| 39 | + | </enum> | |
| 40 | + | <event name="default_mode"> | |
| 41 | + | <description summary="The default mode used on the server"> | |
| 42 | + | This event is emitted directly after binding the interface. It contains | |
| 43 | + | the default mode for the decoration. When a new server decoration object | |
| 44 | + | is created this new object will be in the default mode until the first | |
| 45 | + | request_mode is requested. | |
| 46 | + | ||
| 47 | + | The server may change the default mode at any time. | |
| 48 | + | </description> | |
| 49 | + | <arg name="mode" type="uint" summary="The default decoration mode applied to newly created server decorations."/> | |
| 50 | + | </event> | |
| 51 | + | </interface> | |
| 52 | + | <interface name="org_kde_kwin_server_decoration" version="1"> | |
| 53 | + | <request name="release" type="destructor"> | |
| 54 | + | <description summary="release the server decoration object"/> | |
| 55 | + | </request> | |
| 56 | + | <enum name="mode"> | |
| 57 | + | <description summary="Possible values to use in request_mode and the event mode."/> | |
| 58 | + | <entry name="None" value="0" summary="Undecorated: The surface is not decorated at all, neither server nor client-side. An example is a popup surface which should not be decorated."/> | |
| 59 | + | <entry name="Client" value="1" summary="Client-side decoration: The decoration is part of the surface and the client."/> | |
| 60 | + | <entry name="Server" value="2" summary="Server-side decoration: The server embeds the surface into a decoration frame."/> | |
| 61 | + | </enum> | |
| 62 | + | <request name="request_mode"> | |
| 63 | + | <description summary="The decoration mode the surface wants to use."/> | |
| 64 | + | <arg name="mode" type="uint" summary="The mode this surface wants to use."/> | |
| 65 | + | </request> | |
| 66 | + | <event name="mode"> | |
| 67 | + | <description summary="The new decoration mode applied by the server"> | |
| 68 | + | This event is emitted directly after the decoration is created and | |
| 69 | + | represents the base decoration policy by the server. E.g. a server | |
| 70 | + | which wants all surfaces to be client-side decorated will send Client, | |
| 71 | + | a server which wants server-side decoration will send Server. | |
| 72 | + | ||
| 73 | + | The client can request a different mode through the decoration request. | |
| 74 | + | The server will acknowledge this by another event with the same mode. So | |
| 75 | + | even if a server prefers server-side decoration it's possible to force a | |
| 76 | + | client-side decoration. | |
| 77 | + | ||
| 78 | + | The server may emit this event at any time. In this case the client can | |
| 79 | + | again request a different mode. It's the responsibility of the server to | |
| 80 | + | prevent a feedback loop. | |
| 81 | + | </description> | |
| 82 | + | <arg name="mode" type="uint" summary="The decoration mode applied to the surface by the server."/> | |
| 83 | + | </event> | |
| 84 | + | </interface> | |
| 85 | + | </protocol> | |
| @@ -0,0 +1,85 @@ | |||||
| 1 | + | <?xml version="1.0" encoding="UTF-8"?> | |||
| 2 | + | <protocol name="server_decoration"> | |||
| 3 | + | <copyright><![CDATA[ | |||
| 4 | + | SPDX-FileCopyrightText: 2015 Martin Gräßlin | |||
| 5 | + | ||||
| 6 | + | SPDX-License-Identifier: LGPL-2.1-or-later | |||
| 7 | + | ]]></copyright> | |||
| 8 | + | <interface name="org_kde_kwin_server_decoration_manager" version="1"> | |||
| 9 | + | <description summary="Server side window decoration manager"> | |||
| 10 | + | This interface allows to coordinate whether the server should create | |||
| 11 | + | a server-side window decoration around a wl_surface representing a | |||
| 12 | + | shell surface (wl_shell_surface or similar). By announcing support | |||
| 13 | + | for this interface the server indicates that it supports server | |||
| 14 | + | side decorations. | |||
| 15 | + | ||||
| 16 | + | Use in conjunction with zxdg_decoration_manager_v1 is undefined. | |||
| 17 | + | </description> | |||
| 18 | + | <request name="create"> | |||
| 19 | + | <description summary="Create a server-side decoration object for a given surface"> | |||
| 20 | + | When a client creates a server-side decoration object it indicates | |||
| 21 | + | that it supports the protocol. The client is supposed to tell the | |||
| 22 | + | server whether it wants server-side decorations or will provide | |||
| 23 | + | client-side decorations. | |||
| 24 | + | ||||
| 25 | + | If the client does not create a server-side decoration object for | |||
| 26 | + | a surface the server interprets this as lack of support for this | |||
| 27 | + | protocol and considers it as client-side decorated. Nevertheless a | |||
| 28 | + | client-side decorated surface should use this protocol to indicate | |||
| 29 | + | to the server that it does not want a server-side deco. | |||
| 30 | + | </description> | |||
| 31 | + | <arg name="id" type="new_id" interface="org_kde_kwin_server_decoration"/> | |||
| 32 | + | <arg name="surface" type="object" interface="wl_surface"/> | |||
| 33 | + | </request> | |||
| 34 | + | <enum name="mode"> | |||
| 35 | + | <description summary="Possible values to use in request_mode and the event mode."/> | |||
| 36 | + | <entry name="None" value="0" summary="Undecorated: The surface is not decorated at all, neither server nor client-side. An example is a popup surface which should not be decorated."/> | |||
| 37 | + | <entry name="Client" value="1" summary="Client-side decoration: The decoration is part of the surface and the client."/> | |||
| 38 | + | <entry name="Server" value="2" summary="Server-side decoration: The server embeds the surface into a decoration frame."/> | |||
| 39 | + | </enum> | |||
| 40 | + | <event name="default_mode"> | |||
| 41 | + | <description summary="The default mode used on the server"> | |||
| 42 | + | This event is emitted directly after binding the interface. It contains | |||
| 43 | + | the default mode for the decoration. When a new server decoration object | |||
| 44 | + | is created this new object will be in the default mode until the first | |||
| 45 | + | request_mode is requested. | |||
| 46 | + | ||||
| 47 | + | The server may change the default mode at any time. | |||
| 48 | + | </description> | |||
| 49 | + | <arg name="mode" type="uint" summary="The default decoration mode applied to newly created server decorations."/> | |||
| 50 | + | </event> | |||
| 51 | + | </interface> | |||
| 52 | + | <interface name="org_kde_kwin_server_decoration" version="1"> | |||
| 53 | + | <request name="release" type="destructor"> | |||
| 54 | + | <description summary="release the server decoration object"/> | |||
| 55 | + | </request> | |||
| 56 | + | <enum name="mode"> | |||
| 57 | + | <description summary="Possible values to use in request_mode and the event mode."/> | |||
| 58 | + | <entry name="None" value="0" summary="Undecorated: The surface is not decorated at all, neither server nor client-side. An example is a popup surface which should not be decorated."/> | |||
| 59 | + | <entry name="Client" value="1" summary="Client-side decoration: The decoration is part of the surface and the client."/> | |||
| 60 | + | <entry name="Server" value="2" summary="Server-side decoration: The server embeds the surface into a decoration frame."/> | |||
| 61 | + | </enum> | |||
| 62 | + | <request name="request_mode"> | |||
| 63 | + | <description summary="The decoration mode the surface wants to use."/> | |||
| 64 | + | <arg name="mode" type="uint" summary="The mode this surface wants to use."/> | |||
| 65 | + | </request> | |||
| 66 | + | <event name="mode"> | |||
| 67 | + | <description summary="The new decoration mode applied by the server"> | |||
| 68 | + | This event is emitted directly after the decoration is created and | |||
| 69 | + | represents the base decoration policy by the server. E.g. a server | |||
| 70 | + | which wants all surfaces to be client-side decorated will send Client, | |||
| 71 | + | a server which wants server-side decoration will send Server. | |||
| 72 | + | ||||
| 73 | + | The client can request a different mode through the decoration request. | |||
| 74 | + | The server will acknowledge this by another event with the same mode. So | |||
| 75 | + | even if a server prefers server-side decoration it's possible to force a | |||
| 76 | + | client-side decoration. | |||
| 77 | + | ||||
| 78 | + | The server may emit this event at any time. In this case the client can | |||
| 79 | + | again request a different mode. It's the responsibility of the server to | |||
| 80 | + | prevent a feedback loop. | |||
| 81 | + | </description> | |||
| 82 | + | <arg name="mode" type="uint" summary="The decoration mode applied to the surface by the server."/> | |||
| 83 | + | </event> | |||
| 84 | + | </interface> | |||
| 85 | + | </protocol> | |||