// Code generated by wlbgen; DO NOT EDIT. // Upstream protocol copyright and license: // neferwl private protocol. No stability promise beyond the version of the // interface. package imagecapture import ( "fmt" extimagecapturesource "github.com/bnema/go-wayland-bindings/server/extimagecapturesource" extimagecopycapture "github.com/bnema/go-wayland-bindings/server/extimagecopycapture" extworkspace "github.com/bnema/go-wayland-bindings/server/extworkspace" wayland "github.com/bnema/go-wayland-bindings/server/wayland" "github.com/bnema/purego-libwayland/server" "runtime" ) var NeferwlImageCaptureSourceManagerV1Interface *server.Interface var NeferwlWorkspaceFrameV1Interface *server.Interface var NeferwlCaptureExclusionManagerV1Interface *server.Interface var NeferwlCaptureExclusionV1Interface *server.Interface var NeferwlCaptureLayerV1Interface *server.Interface func init() { NeferwlImageCaptureSourceManagerV1Interface = &server.Interface{Name: "neferwl_image_capture_source_manager_v1", Version: 1} NeferwlWorkspaceFrameV1Interface = &server.Interface{Name: "neferwl_workspace_frame_v1", Version: 1} NeferwlCaptureExclusionManagerV1Interface = &server.Interface{Name: "neferwl_capture_exclusion_manager_v1", Version: 1} NeferwlCaptureExclusionV1Interface = &server.Interface{Name: "neferwl_capture_exclusion_v1", Version: 1} NeferwlCaptureLayerV1Interface = &server.Interface{Name: "neferwl_capture_layer_v1", Version: 1} NeferwlImageCaptureSourceManagerV1Interface.Requests = []server.Message{ {Name: "destroy", Signature: "", Types: []*server.Interface{}}, {Name: "create_workspace_source", Signature: "no", Types: []*server.Interface{extimagecapturesource.ExtImageCaptureSourceV1Interface, extworkspace.ExtWorkspaceHandleV1Interface}}, {Name: "create_output_region_source", Signature: "noiiii", Types: []*server.Interface{extimagecapturesource.ExtImageCaptureSourceV1Interface, wayland.OutputInterface, nil, nil, nil, nil}}, {Name: "get_workspace_frame", Signature: "no", Types: []*server.Interface{NeferwlWorkspaceFrameV1Interface, extworkspace.ExtWorkspaceHandleV1Interface}}, } NeferwlImageCaptureSourceManagerV1Interface.Events = []server.Message{} NeferwlWorkspaceFrameV1Interface.Requests = []server.Message{ {Name: "destroy", Signature: "", Types: []*server.Interface{}}, } NeferwlWorkspaceFrameV1Interface.Events = []server.Message{ {Name: "frame", Signature: "iiii", Types: []*server.Interface{nil, nil, nil, nil}}, } NeferwlCaptureExclusionManagerV1Interface.Requests = []server.Message{ {Name: "destroy", Signature: "", Types: []*server.Interface{}}, {Name: "get_exclusion", Signature: "no", Types: []*server.Interface{NeferwlCaptureExclusionV1Interface, extimagecopycapture.ExtImageCopyCaptureSessionV1Interface}}, {Name: "attach_surface", Signature: "nso", Types: []*server.Interface{NeferwlCaptureLayerV1Interface, nil, wayland.SurfaceInterface}}, } NeferwlCaptureExclusionManagerV1Interface.Events = []server.Message{} NeferwlCaptureExclusionV1Interface.Requests = []server.Message{ {Name: "destroy", Signature: "", Types: []*server.Interface{}}, } NeferwlCaptureExclusionV1Interface.Events = []server.Message{ {Name: "token", Signature: "s", Types: []*server.Interface{nil}}, {Name: "failed", Signature: "u", Types: []*server.Interface{nil}}, } NeferwlCaptureLayerV1Interface.Requests = []server.Message{ {Name: "destroy", Signature: "", Types: []*server.Interface{}}, } NeferwlCaptureLayerV1Interface.Events = []server.Message{ {Name: "attached", Signature: "", Types: []*server.Interface{}}, {Name: "failed", Signature: "u", Types: []*server.Interface{nil}}, {Name: "detached", Signature: "u", Types: []*server.Interface{nil}}, } if err := server.NewInterfaces(NeferwlImageCaptureSourceManagerV1Interface, NeferwlWorkspaceFrameV1Interface, NeferwlCaptureExclusionManagerV1Interface, NeferwlCaptureExclusionV1Interface, NeferwlCaptureLayerV1Interface); err != nil { panic(err) } } // NeferwlImageCaptureSourceManagerV1 workspace and output-region capture sources. type NeferwlImageCaptureSourceManagerV1 struct{ *server.Resource } func WrapNeferwlImageCaptureSourceManagerV1(r *server.Resource) *NeferwlImageCaptureSourceManagerV1 { if r == nil { return nil } return &NeferwlImageCaptureSourceManagerV1{r} } const NeferwlImageCaptureSourceManagerV1RequestDestroy uint32 = 0 const NeferwlImageCaptureSourceManagerV1RequestCreateWorkspaceSource uint32 = 1 const NeferwlImageCaptureSourceManagerV1RequestCreateOutputRegionSource uint32 = 2 const NeferwlImageCaptureSourceManagerV1RequestGetWorkspaceFrame uint32 = 3 // NeferwlImageCaptureSourceManagerV1Error . type NeferwlImageCaptureSourceManagerV1Error uint32 const ( NeferwlImageCaptureSourceManagerV1ErrorInvalidRegion NeferwlImageCaptureSourceManagerV1Error = 0 ) // NeferwlImageCaptureSourceManagerV1Handler handles neferwl_image_capture_source_manager_v1 requests. type NeferwlImageCaptureSourceManagerV1Handler interface { Destroy(self *NeferwlImageCaptureSourceManagerV1) CreateWorkspaceSource(self *NeferwlImageCaptureSourceManagerV1, source uint32, workspace *extworkspace.ExtWorkspaceHandleV1) CreateOutputRegionSource(self *NeferwlImageCaptureSourceManagerV1, source uint32, output *wayland.Output, x int32, y int32, width int32, height int32) GetWorkspaceFrame(self *NeferwlImageCaptureSourceManagerV1, id uint32, workspace *extworkspace.ExtWorkspaceHandleV1) } func NewNeferwlImageCaptureSourceManagerV1(c server.Client, version int32, id uint32, h NeferwlImageCaptureSourceManagerV1Handler) (*NeferwlImageCaptureSourceManagerV1, error) { if h == nil { return nil, fmt.Errorf("purego-libwayland: nil handler for neferwl_image_capture_source_manager_v1") } var self *NeferwlImageCaptureSourceManagerV1 r, err := c.CreateResource(NeferwlImageCaptureSourceManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { switch opcode { case 0: h.Destroy(self) self.Destroy() case 1: h.CreateWorkspaceSource(self, args[0].NewID(), extworkspace.WrapExtWorkspaceHandleV1(args[1].Resource())) case 2: h.CreateOutputRegionSource(self, args[0].NewID(), wayland.WrapOutput(args[1].Resource()), args[2].Int(), args[3].Int(), args[4].Int(), args[5].Int()) case 3: h.GetWorkspaceFrame(self, args[0].NewID(), extworkspace.WrapExtWorkspaceHandleV1(args[1].Resource())) } }) if err != nil { return nil, err } self = WrapNeferwlImageCaptureSourceManagerV1(r) r.Data = self return self, nil } func NewNeferwlImageCaptureSourceManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error { return d.CreateGlobal(NeferwlImageCaptureSourceManagerV1Interface, version, bind) } // NeferwlWorkspaceFrameV1 the frame of one workspace. type NeferwlWorkspaceFrameV1 struct{ *server.Resource } func WrapNeferwlWorkspaceFrameV1(r *server.Resource) *NeferwlWorkspaceFrameV1 { if r == nil { return nil } return &NeferwlWorkspaceFrameV1{r} } const NeferwlWorkspaceFrameV1RequestDestroy uint32 = 0 const NeferwlWorkspaceFrameV1EventFrame uint32 = 0 // NeferwlWorkspaceFrameV1Handler handles neferwl_workspace_frame_v1 requests. type NeferwlWorkspaceFrameV1Handler interface { Destroy(self *NeferwlWorkspaceFrameV1) } func NewNeferwlWorkspaceFrameV1(c server.Client, version int32, id uint32, h NeferwlWorkspaceFrameV1Handler) (*NeferwlWorkspaceFrameV1, error) { if h == nil { return nil, fmt.Errorf("purego-libwayland: nil handler for neferwl_workspace_frame_v1") } var self *NeferwlWorkspaceFrameV1 r, err := c.CreateResource(NeferwlWorkspaceFrameV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { switch opcode { case 0: h.Destroy(self) self.Destroy() } }) if err != nil { return nil, err } self = WrapNeferwlWorkspaceFrameV1(r) r.Data = self return self, nil } // SendFrame the workspace frame. func (self *NeferwlWorkspaceFrameV1) SendFrame(x int32, y int32, width int32, height int32) { self.PostEvent(NeferwlWorkspaceFrameV1EventFrame, server.Int(x), server.Int(y), server.Int(width), server.Int(height)) } func NewNeferwlWorkspaceFrameV1Global(d *server.Display, version int32, bind server.BindFunc) error { return d.CreateGlobal(NeferwlWorkspaceFrameV1Interface, version, bind) } // NeferwlCaptureExclusionManagerV1 leave a client's own surfaces out of its captures. type NeferwlCaptureExclusionManagerV1 struct{ *server.Resource } func WrapNeferwlCaptureExclusionManagerV1(r *server.Resource) *NeferwlCaptureExclusionManagerV1 { if r == nil { return nil } return &NeferwlCaptureExclusionManagerV1{r} } const NeferwlCaptureExclusionManagerV1RequestDestroy uint32 = 0 const NeferwlCaptureExclusionManagerV1RequestGetExclusion uint32 = 1 const NeferwlCaptureExclusionManagerV1RequestAttachSurface uint32 = 2 // NeferwlCaptureExclusionManagerV1Error . type NeferwlCaptureExclusionManagerV1Error uint32 const ( NeferwlCaptureExclusionManagerV1ErrorSurfaceRole NeferwlCaptureExclusionManagerV1Error = 0 NeferwlCaptureExclusionManagerV1ErrorInvalidLayer NeferwlCaptureExclusionManagerV1Error = 1 NeferwlCaptureExclusionManagerV1ErrorExclusiveKeyboard NeferwlCaptureExclusionManagerV1Error = 2 NeferwlCaptureExclusionManagerV1ErrorInvalidSurface NeferwlCaptureExclusionManagerV1Error = 3 NeferwlCaptureExclusionManagerV1ErrorAlreadyExcluded NeferwlCaptureExclusionManagerV1Error = 4 ) // NeferwlCaptureExclusionManagerV1Handler handles neferwl_capture_exclusion_manager_v1 requests. type NeferwlCaptureExclusionManagerV1Handler interface { Destroy(self *NeferwlCaptureExclusionManagerV1) GetExclusion(self *NeferwlCaptureExclusionManagerV1, id uint32, session *extimagecopycapture.ExtImageCopyCaptureSessionV1) AttachSurface(self *NeferwlCaptureExclusionManagerV1, id uint32, token string, surface *wayland.Surface) } func NewNeferwlCaptureExclusionManagerV1(c server.Client, version int32, id uint32, h NeferwlCaptureExclusionManagerV1Handler) (*NeferwlCaptureExclusionManagerV1, error) { if h == nil { return nil, fmt.Errorf("purego-libwayland: nil handler for neferwl_capture_exclusion_manager_v1") } var self *NeferwlCaptureExclusionManagerV1 r, err := c.CreateResource(NeferwlCaptureExclusionManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { switch opcode { case 0: h.Destroy(self) self.Destroy() case 1: h.GetExclusion(self, args[0].NewID(), extimagecopycapture.WrapExtImageCopyCaptureSessionV1(args[1].Resource())) case 2: h.AttachSurface(self, args[0].NewID(), args[1].String(), wayland.WrapSurface(args[2].Resource())) } }) if err != nil { return nil, err } self = WrapNeferwlCaptureExclusionManagerV1(r) r.Data = self return self, nil } func NewNeferwlCaptureExclusionManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error { return d.CreateGlobal(NeferwlCaptureExclusionManagerV1Interface, version, bind) } // NeferwlCaptureExclusionV1 the exclusion of one capture session. type NeferwlCaptureExclusionV1 struct{ *server.Resource } func WrapNeferwlCaptureExclusionV1(r *server.Resource) *NeferwlCaptureExclusionV1 { if r == nil { return nil } return &NeferwlCaptureExclusionV1{r} } const NeferwlCaptureExclusionV1RequestDestroy uint32 = 0 const NeferwlCaptureExclusionV1EventToken uint32 = 0 const NeferwlCaptureExclusionV1EventFailed uint32 = 1 // NeferwlCaptureExclusionV1Failure . type NeferwlCaptureExclusionV1Failure uint32 const ( NeferwlCaptureExclusionV1FailureBusy NeferwlCaptureExclusionV1Failure = 0 NeferwlCaptureExclusionV1FailureSessionStopped NeferwlCaptureExclusionV1Failure = 1 ) // NeferwlCaptureExclusionV1Handler handles neferwl_capture_exclusion_v1 requests. type NeferwlCaptureExclusionV1Handler interface { Destroy(self *NeferwlCaptureExclusionV1) } func NewNeferwlCaptureExclusionV1(c server.Client, version int32, id uint32, h NeferwlCaptureExclusionV1Handler) (*NeferwlCaptureExclusionV1, error) { if h == nil { return nil, fmt.Errorf("purego-libwayland: nil handler for neferwl_capture_exclusion_v1") } var self *NeferwlCaptureExclusionV1 r, err := c.CreateResource(NeferwlCaptureExclusionV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { switch opcode { case 0: h.Destroy(self) self.Destroy() } }) if err != nil { return nil, err } self = WrapNeferwlCaptureExclusionV1(r) r.Data = self return self, nil } // SendToken the attachment token. func (self *NeferwlCaptureExclusionV1) SendToken(token string) { var p runtime.Pinner defer p.Unpin() self.PostEvent(NeferwlCaptureExclusionV1EventToken, server.String(&p, token, false)) } // SendFailed no exclusion. func (self *NeferwlCaptureExclusionV1) SendFailed(reason uint32) { self.PostEvent(NeferwlCaptureExclusionV1EventFailed, server.Uint(reason)) } func NewNeferwlCaptureExclusionV1Global(d *server.Display, version int32, bind server.BindFunc) error { return d.CreateGlobal(NeferwlCaptureExclusionV1Interface, version, bind) } // NeferwlCaptureLayerV1 a layer surface attached to an exclusion. type NeferwlCaptureLayerV1 struct{ *server.Resource } func WrapNeferwlCaptureLayerV1(r *server.Resource) *NeferwlCaptureLayerV1 { if r == nil { return nil } return &NeferwlCaptureLayerV1{r} } const NeferwlCaptureLayerV1RequestDestroy uint32 = 0 const NeferwlCaptureLayerV1EventAttached uint32 = 0 const NeferwlCaptureLayerV1EventFailed uint32 = 1 const NeferwlCaptureLayerV1EventDetached uint32 = 2 // NeferwlCaptureLayerV1Failure . type NeferwlCaptureLayerV1Failure uint32 const ( NeferwlCaptureLayerV1FailureUnknownToken NeferwlCaptureLayerV1Failure = 0 NeferwlCaptureLayerV1FailureUnauthorized NeferwlCaptureLayerV1Failure = 1 NeferwlCaptureLayerV1FailureTooManyLayers NeferwlCaptureLayerV1Failure = 2 NeferwlCaptureLayerV1FailureAlreadyAttached NeferwlCaptureLayerV1Failure = 3 NeferwlCaptureLayerV1FailureExclusionEnded NeferwlCaptureLayerV1Failure = 4 NeferwlCaptureLayerV1FailureLayerDestroyed NeferwlCaptureLayerV1Failure = 5 ) // NeferwlCaptureLayerV1DetachReason . type NeferwlCaptureLayerV1DetachReason uint32 const ( NeferwlCaptureLayerV1DetachReasonExclusionEnded NeferwlCaptureLayerV1DetachReason = 0 NeferwlCaptureLayerV1DetachReasonLayerDestroyed NeferwlCaptureLayerV1DetachReason = 1 ) // NeferwlCaptureLayerV1Handler handles neferwl_capture_layer_v1 requests. type NeferwlCaptureLayerV1Handler interface { Destroy(self *NeferwlCaptureLayerV1) } func NewNeferwlCaptureLayerV1(c server.Client, version int32, id uint32, h NeferwlCaptureLayerV1Handler) (*NeferwlCaptureLayerV1, error) { if h == nil { return nil, fmt.Errorf("purego-libwayland: nil handler for neferwl_capture_layer_v1") } var self *NeferwlCaptureLayerV1 r, err := c.CreateResource(NeferwlCaptureLayerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { switch opcode { case 0: h.Destroy(self) self.Destroy() } }) if err != nil { return nil, err } self = WrapNeferwlCaptureLayerV1(r) r.Data = self return self, nil } // SendAttached the layer is excluded. func (self *NeferwlCaptureLayerV1) SendAttached() { self.PostEvent(NeferwlCaptureLayerV1EventAttached) } // SendFailed the attachment was refused. func (self *NeferwlCaptureLayerV1) SendFailed(reason uint32) { self.PostEvent(NeferwlCaptureLayerV1EventFailed, server.Uint(reason)) } // SendDetached the layer left the exclusion. func (self *NeferwlCaptureLayerV1) SendDetached(reason uint32) { self.PostEvent(NeferwlCaptureLayerV1EventDetached, server.Uint(reason)) } func NewNeferwlCaptureLayerV1Global(d *server.Display, version int32, bind server.BindFunc) error { return d.CreateGlobal(NeferwlCaptureLayerV1Interface, version, bind) } func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource { if v == nil { return nil } return v.GetResource() } func (self *NeferwlImageCaptureSourceManagerV1) GetResource() *server.Resource { if self == nil { return nil } return self.Resource } func (self *NeferwlWorkspaceFrameV1) GetResource() *server.Resource { if self == nil { return nil } return self.Resource } func (self *NeferwlCaptureExclusionManagerV1) GetResource() *server.Resource { if self == nil { return nil } return self.Resource } func (self *NeferwlCaptureExclusionV1) GetResource() *server.Resource { if self == nil { return nil } return self.Resource } func (self *NeferwlCaptureLayerV1) GetResource() *server.Resource { if self == nil { return nil } return self.Resource }