// Code generated by wlbgen; DO NOT EDIT. // Upstream protocol copyright and license: // Copyright © 2019 Christopher Billington // Copyright © 2020 Ilia Bozhinov // Copyright © 2022 Victoria Brekenfeld // // Permission to use, copy, modify, distribute, and sell this // software and its documentation for any purpose is hereby granted // without fee, provided that the above copyright notice appear in // all copies and that both that copyright notice and this permission // notice appear in supporting documentation, and that the name of // the copyright holders not be used in advertising or publicity // pertaining to distribution of the software without specific, // written prior permission. The copyright holders make no // representations about the suitability of this software for any // purpose. It is provided "as is" without express or implied // warranty. // // THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS // SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND // FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY // SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN // AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, // ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF // THIS SOFTWARE. package extworkspace import ( "fmt" wayland "github.com/bnema/go-wayland-bindings/server/wayland" "github.com/bnema/purego-libwayland/server" "runtime" ) var ExtWorkspaceManagerV1Interface *server.Interface var ExtWorkspaceGroupHandleV1Interface *server.Interface var ExtWorkspaceHandleV1Interface *server.Interface func init() { ExtWorkspaceManagerV1Interface = &server.Interface{Name: "ext_workspace_manager_v1", Version: 1} ExtWorkspaceGroupHandleV1Interface = &server.Interface{Name: "ext_workspace_group_handle_v1", Version: 1} ExtWorkspaceHandleV1Interface = &server.Interface{Name: "ext_workspace_handle_v1", Version: 1} ExtWorkspaceManagerV1Interface.Requests = []server.Message{ {Name: "commit", Signature: "", Types: []*server.Interface{}}, {Name: "stop", Signature: "", Types: []*server.Interface{}}, } ExtWorkspaceManagerV1Interface.Events = []server.Message{ {Name: "workspace_group", Signature: "n", Types: []*server.Interface{ExtWorkspaceGroupHandleV1Interface}}, {Name: "workspace", Signature: "n", Types: []*server.Interface{ExtWorkspaceHandleV1Interface}}, {Name: "done", Signature: "", Types: []*server.Interface{}}, {Name: "finished", Signature: "", Types: []*server.Interface{}}, } ExtWorkspaceGroupHandleV1Interface.Requests = []server.Message{ {Name: "create_workspace", Signature: "s", Types: []*server.Interface{nil}}, {Name: "destroy", Signature: "", Types: []*server.Interface{}}, } ExtWorkspaceGroupHandleV1Interface.Events = []server.Message{ {Name: "capabilities", Signature: "u", Types: []*server.Interface{nil}}, {Name: "output_enter", Signature: "o", Types: []*server.Interface{wayland.OutputInterface}}, {Name: "output_leave", Signature: "o", Types: []*server.Interface{wayland.OutputInterface}}, {Name: "workspace_enter", Signature: "o", Types: []*server.Interface{ExtWorkspaceHandleV1Interface}}, {Name: "workspace_leave", Signature: "o", Types: []*server.Interface{ExtWorkspaceHandleV1Interface}}, {Name: "removed", Signature: "", Types: []*server.Interface{}}, } ExtWorkspaceHandleV1Interface.Requests = []server.Message{ {Name: "destroy", Signature: "", Types: []*server.Interface{}}, {Name: "activate", Signature: "", Types: []*server.Interface{}}, {Name: "deactivate", Signature: "", Types: []*server.Interface{}}, {Name: "assign", Signature: "o", Types: []*server.Interface{ExtWorkspaceGroupHandleV1Interface}}, {Name: "remove", Signature: "", Types: []*server.Interface{}}, } ExtWorkspaceHandleV1Interface.Events = []server.Message{ {Name: "id", Signature: "s", Types: []*server.Interface{nil}}, {Name: "name", Signature: "s", Types: []*server.Interface{nil}}, {Name: "coordinates", Signature: "a", Types: []*server.Interface{nil}}, {Name: "state", Signature: "u", Types: []*server.Interface{nil}}, {Name: "capabilities", Signature: "u", Types: []*server.Interface{nil}}, {Name: "removed", Signature: "", Types: []*server.Interface{}}, } if err := server.NewInterfaces(ExtWorkspaceManagerV1Interface, ExtWorkspaceGroupHandleV1Interface, ExtWorkspaceHandleV1Interface); err != nil { panic(err) } } // ExtWorkspaceManagerV1 list and control workspaces. type ExtWorkspaceManagerV1 struct{ *server.Resource } func WrapExtWorkspaceManagerV1(r *server.Resource) *ExtWorkspaceManagerV1 { if r == nil { return nil } return &ExtWorkspaceManagerV1{r} } const ExtWorkspaceManagerV1RequestCommit uint32 = 0 const ExtWorkspaceManagerV1RequestStop uint32 = 1 const ExtWorkspaceManagerV1EventWorkspaceGroup uint32 = 0 const ExtWorkspaceManagerV1EventWorkspace uint32 = 1 const ExtWorkspaceManagerV1EventDone uint32 = 2 const ExtWorkspaceManagerV1EventFinished uint32 = 3 // ExtWorkspaceManagerV1Handler handles ext_workspace_manager_v1 requests. type ExtWorkspaceManagerV1Handler interface { Commit(self *ExtWorkspaceManagerV1) Stop(self *ExtWorkspaceManagerV1) } func NewExtWorkspaceManagerV1(c server.Client, version int32, id uint32, h ExtWorkspaceManagerV1Handler) (*ExtWorkspaceManagerV1, error) { if h == nil { return nil, fmt.Errorf("purego-libwayland: nil handler for ext_workspace_manager_v1") } var self *ExtWorkspaceManagerV1 r, err := c.CreateResource(ExtWorkspaceManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { switch opcode { case 0: h.Commit(self) case 1: h.Stop(self) } }) if err != nil { return nil, err } self = WrapExtWorkspaceManagerV1(r) r.Data = self return self, nil } // SendWorkspaceGroup a workspace group has been created. func (self *ExtWorkspaceManagerV1) SendWorkspaceGroup(workspaceGroup *ExtWorkspaceGroupHandleV1) { self.PostEvent(ExtWorkspaceManagerV1EventWorkspaceGroup, server.NewID(resourceOf(workspaceGroup))) } // SendWorkspace workspace has been created. func (self *ExtWorkspaceManagerV1) SendWorkspace(workspace *ExtWorkspaceHandleV1) { self.PostEvent(ExtWorkspaceManagerV1EventWorkspace, server.NewID(resourceOf(workspace))) } // SendDone all information about the workspaces and workspace groups has been sent. func (self *ExtWorkspaceManagerV1) SendDone() { self.PostEvent(ExtWorkspaceManagerV1EventDone) } // SendFinished the compositor has finished with the workspace_manager. func (self *ExtWorkspaceManagerV1) SendFinished() { self.PostEvent(ExtWorkspaceManagerV1EventFinished) } func NewExtWorkspaceManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error { return d.CreateGlobal(ExtWorkspaceManagerV1Interface, version, bind) } // ExtWorkspaceGroupHandleV1 a workspace group assigned to a set of outputs. type ExtWorkspaceGroupHandleV1 struct{ *server.Resource } func WrapExtWorkspaceGroupHandleV1(r *server.Resource) *ExtWorkspaceGroupHandleV1 { if r == nil { return nil } return &ExtWorkspaceGroupHandleV1{r} } const ExtWorkspaceGroupHandleV1RequestCreateWorkspace uint32 = 0 const ExtWorkspaceGroupHandleV1RequestDestroy uint32 = 1 const ExtWorkspaceGroupHandleV1EventCapabilities uint32 = 0 const ExtWorkspaceGroupHandleV1EventOutputEnter uint32 = 1 const ExtWorkspaceGroupHandleV1EventOutputLeave uint32 = 2 const ExtWorkspaceGroupHandleV1EventWorkspaceEnter uint32 = 3 const ExtWorkspaceGroupHandleV1EventWorkspaceLeave uint32 = 4 const ExtWorkspaceGroupHandleV1EventRemoved uint32 = 5 // ExtWorkspaceGroupHandleV1GroupCapabilities (bitfield). type ExtWorkspaceGroupHandleV1GroupCapabilities uint32 const ( ExtWorkspaceGroupHandleV1GroupCapabilitiesCreateWorkspace ExtWorkspaceGroupHandleV1GroupCapabilities = 1 ) // ExtWorkspaceGroupHandleV1Handler handles ext_workspace_group_handle_v1 requests. type ExtWorkspaceGroupHandleV1Handler interface { CreateWorkspace(self *ExtWorkspaceGroupHandleV1, workspace string) Destroy(self *ExtWorkspaceGroupHandleV1) } func NewExtWorkspaceGroupHandleV1(c server.Client, version int32, id uint32, h ExtWorkspaceGroupHandleV1Handler) (*ExtWorkspaceGroupHandleV1, error) { if h == nil { return nil, fmt.Errorf("purego-libwayland: nil handler for ext_workspace_group_handle_v1") } var self *ExtWorkspaceGroupHandleV1 r, err := c.CreateResource(ExtWorkspaceGroupHandleV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { switch opcode { case 0: h.CreateWorkspace(self, args[0].String()) case 1: h.Destroy(self) self.Destroy() } }) if err != nil { return nil, err } self = WrapExtWorkspaceGroupHandleV1(r) r.Data = self return self, nil } // SendCapabilities compositor capabilities. func (self *ExtWorkspaceGroupHandleV1) SendCapabilities(capabilities uint32) { self.PostEvent(ExtWorkspaceGroupHandleV1EventCapabilities, server.Uint(capabilities)) } // SendOutputEnter output assigned to workspace group. func (self *ExtWorkspaceGroupHandleV1) SendOutputEnter(output *wayland.Output) { self.PostEvent(ExtWorkspaceGroupHandleV1EventOutputEnter, server.Object(resourceOf(output))) } // SendOutputLeave output removed from workspace group. func (self *ExtWorkspaceGroupHandleV1) SendOutputLeave(output *wayland.Output) { self.PostEvent(ExtWorkspaceGroupHandleV1EventOutputLeave, server.Object(resourceOf(output))) } // SendWorkspaceEnter workspace added to workspace group. func (self *ExtWorkspaceGroupHandleV1) SendWorkspaceEnter(workspace *ExtWorkspaceHandleV1) { self.PostEvent(ExtWorkspaceGroupHandleV1EventWorkspaceEnter, server.Object(resourceOf(workspace))) } // SendWorkspaceLeave workspace removed from workspace group. func (self *ExtWorkspaceGroupHandleV1) SendWorkspaceLeave(workspace *ExtWorkspaceHandleV1) { self.PostEvent(ExtWorkspaceGroupHandleV1EventWorkspaceLeave, server.Object(resourceOf(workspace))) } // SendRemoved this workspace group has been removed. func (self *ExtWorkspaceGroupHandleV1) SendRemoved() { self.PostEvent(ExtWorkspaceGroupHandleV1EventRemoved) } func NewExtWorkspaceGroupHandleV1Global(d *server.Display, version int32, bind server.BindFunc) error { return d.CreateGlobal(ExtWorkspaceGroupHandleV1Interface, version, bind) } // ExtWorkspaceHandleV1 a workspace handing a group of surfaces. type ExtWorkspaceHandleV1 struct{ *server.Resource } func WrapExtWorkspaceHandleV1(r *server.Resource) *ExtWorkspaceHandleV1 { if r == nil { return nil } return &ExtWorkspaceHandleV1{r} } const ExtWorkspaceHandleV1RequestDestroy uint32 = 0 const ExtWorkspaceHandleV1RequestActivate uint32 = 1 const ExtWorkspaceHandleV1RequestDeactivate uint32 = 2 const ExtWorkspaceHandleV1RequestAssign uint32 = 3 const ExtWorkspaceHandleV1RequestRemove uint32 = 4 const ExtWorkspaceHandleV1EventId uint32 = 0 const ExtWorkspaceHandleV1EventName uint32 = 1 const ExtWorkspaceHandleV1EventCoordinates uint32 = 2 const ExtWorkspaceHandleV1EventState uint32 = 3 const ExtWorkspaceHandleV1EventCapabilities uint32 = 4 const ExtWorkspaceHandleV1EventRemoved uint32 = 5 // ExtWorkspaceHandleV1State types of states on the workspace (bitfield). type ExtWorkspaceHandleV1State uint32 const ( ExtWorkspaceHandleV1StateActive ExtWorkspaceHandleV1State = 1 ExtWorkspaceHandleV1StateUrgent ExtWorkspaceHandleV1State = 2 ExtWorkspaceHandleV1StateHidden ExtWorkspaceHandleV1State = 4 ) // ExtWorkspaceHandleV1WorkspaceCapabilities (bitfield). type ExtWorkspaceHandleV1WorkspaceCapabilities uint32 const ( ExtWorkspaceHandleV1WorkspaceCapabilitiesActivate ExtWorkspaceHandleV1WorkspaceCapabilities = 1 ExtWorkspaceHandleV1WorkspaceCapabilitiesDeactivate ExtWorkspaceHandleV1WorkspaceCapabilities = 2 ExtWorkspaceHandleV1WorkspaceCapabilitiesRemove ExtWorkspaceHandleV1WorkspaceCapabilities = 4 ExtWorkspaceHandleV1WorkspaceCapabilitiesAssign ExtWorkspaceHandleV1WorkspaceCapabilities = 8 ) // ExtWorkspaceHandleV1Handler handles ext_workspace_handle_v1 requests. type ExtWorkspaceHandleV1Handler interface { Destroy(self *ExtWorkspaceHandleV1) Activate(self *ExtWorkspaceHandleV1) Deactivate(self *ExtWorkspaceHandleV1) Assign(self *ExtWorkspaceHandleV1, workspaceGroup *ExtWorkspaceGroupHandleV1) Remove(self *ExtWorkspaceHandleV1) } func NewExtWorkspaceHandleV1(c server.Client, version int32, id uint32, h ExtWorkspaceHandleV1Handler) (*ExtWorkspaceHandleV1, error) { if h == nil { return nil, fmt.Errorf("purego-libwayland: nil handler for ext_workspace_handle_v1") } var self *ExtWorkspaceHandleV1 r, err := c.CreateResource(ExtWorkspaceHandleV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { switch opcode { case 0: h.Destroy(self) self.Destroy() case 1: h.Activate(self) case 2: h.Deactivate(self) case 3: h.Assign(self, WrapExtWorkspaceGroupHandleV1(args[0].Resource())) case 4: h.Remove(self) } }) if err != nil { return nil, err } self = WrapExtWorkspaceHandleV1(r) r.Data = self return self, nil } // SendId workspace id. func (self *ExtWorkspaceHandleV1) SendId(id string) { var p runtime.Pinner defer p.Unpin() self.PostEvent(ExtWorkspaceHandleV1EventId, server.String(&p, id, false)) } // SendName workspace name changed. func (self *ExtWorkspaceHandleV1) SendName(name string) { var p runtime.Pinner defer p.Unpin() self.PostEvent(ExtWorkspaceHandleV1EventName, server.String(&p, name, false)) } // SendCoordinates workspace coordinates changed. func (self *ExtWorkspaceHandleV1) SendCoordinates(coordinates []byte) { var p runtime.Pinner defer p.Unpin() self.PostEvent(ExtWorkspaceHandleV1EventCoordinates, server.Array(&p, coordinates)) } // SendState the state of the workspace changed. func (self *ExtWorkspaceHandleV1) SendState(state uint32) { self.PostEvent(ExtWorkspaceHandleV1EventState, server.Uint(state)) } // SendCapabilities compositor capabilities. func (self *ExtWorkspaceHandleV1) SendCapabilities(capabilities uint32) { self.PostEvent(ExtWorkspaceHandleV1EventCapabilities, server.Uint(capabilities)) } // SendRemoved this workspace has been removed. func (self *ExtWorkspaceHandleV1) SendRemoved() { self.PostEvent(ExtWorkspaceHandleV1EventRemoved) } func NewExtWorkspaceHandleV1Global(d *server.Display, version int32, bind server.BindFunc) error { return d.CreateGlobal(ExtWorkspaceHandleV1Interface, version, bind) } func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource { if v == nil { return nil } return v.GetResource() } func (self *ExtWorkspaceManagerV1) GetResource() *server.Resource { if self == nil { return nil } return self.Resource } func (self *ExtWorkspaceGroupHandleV1) GetResource() *server.Resource { if self == nil { return nil } return self.Resource } func (self *ExtWorkspaceHandleV1) GetResource() *server.Resource { if self == nil { return nil } return self.Resource }