func NewImported(ctx *client.Context) *Imported {
	zxdgImportedV2 := &Imported{}
	ctx.Register(zxdgImportedV2)
	return zxdgImportedV2
}
NewImported : an imported surface handle

An xdg_imported object represents an imported reference to surface exported
by some client. A client can use this interface to manipulate
relationships between its own surfaces and the imported surface.
package xdg_foreign
import (
	"reflect"
	"github.com/rajveermalviya/go-wayland/wayland/client"
)
type Exporter struct {
	client.BaseProxy
}
func NewExporter(ctx *client.Context) *Exporter {
	zxdgExporterV2 := &Exporter{}
	ctx.Register(zxdgExporterV2)
	return zxdgExporterV2
}
func (i *Exporter) Destroy() error {
	defer i.Context().Unregister(i)
	const opcode = 0
	const rLen = 8
	r := make([]byte, rLen)
	l := 0
	client.PutUint32(r[l:4], i.ID())
	l += 4
	client.PutUint32(r[l:l+4], uint32(rLen<<16|opcode&0x0000ffff))
	l += 4
	err := i.Context().WriteMsg(r, nil)
	return err
}
func (i *Exporter) ExportToplevel(surface *client.Surface) (*Exported, error) {
	id := NewExported(i.Context())
	const opcode = 1
	const rLen = 8 + 4 + 4
	r := make([]byte, rLen)
	l := 0
	client.PutUint32(r[l:4], i.ID())
	l += 4
	client.PutUint32(r[l:l+4], uint32(rLen<<16|opcode&0x0000ffff))
	l += 4
	client.PutUint32(r[l:l+4], id.ID())
	l += 4
	client.PutUint32(r[l:l+4], surface.ID())
	l += 4
	err := i.Context().WriteMsg(r, nil)
	return id, err
}
type ExporterError uint32
const (
	ExporterErrorInvalidSurface ExporterError = 0
)
func (e ExporterError) Name() string {
	switch e {
	case ExporterErrorInvalidSurface:
		return "invalid_surface"
	default:
		return ""
	}
}
func (e ExporterError) Value() string {
	switch e {
	case ExporterErrorInvalidSurface:
		return "0"
	default:
		return ""
	}
}
func (e ExporterError) String() string {
	return e.Name() + "=" + e.Value()
}
type Importer struct {
	client.BaseProxy
}
func NewImporter(ctx *client.Context) *Importer {
	zxdgImporterV2 := &Importer{}
	ctx.Register(zxdgImporterV2)
	return zxdgImporterV2
}
func (i *Importer) Destroy() error {
	defer i.Context().Unregister(i)
	const opcode = 0
	const rLen = 8
	r := make([]byte, rLen)
	l := 0
	client.PutUint32(r[l:4], i.ID())
	l += 4
	client.PutUint32(r[l:l+4], uint32(rLen<<16|opcode&0x0000ffff))
	l += 4
	err := i.Context().WriteMsg(r, nil)
	return err
}
func (i *Importer) ImportToplevel(handle string) (*Imported, error) {
	id := NewImported(i.Context())
	const opcode = 1
	handleLen := client.PaddedLen(len(handle) + 1)
	rLen := 8 + 4 + (4 + handleLen)
	r := make([]byte, rLen)
	l := 0
	client.PutUint32(r[l:4], i.ID())
	l += 4
	client.PutUint32(r[l:l+4], uint32(rLen<<16|opcode&0x0000ffff))
	l += 4
	client.PutUint32(r[l:l+4], id.ID())
	l += 4
	client.PutString(r[l:l+(4+handleLen)], handle, handleLen)
	l += (4 + handleLen)
	err := i.Context().WriteMsg(r, nil)
	return id, err
}
type Exported struct {
	client.BaseProxy
	handleHandlers []ExportedHandleHandlerFunc
}
func NewExported(ctx *client.Context) *Exported {
	zxdgExportedV2 := &Exported{}
	ctx.Register(zxdgExportedV2)
	return zxdgExportedV2
}
func (i *Exported) Destroy() error {
	defer i.Context().Unregister(i)
	const opcode = 0
	const rLen = 8
	r := make([]byte, rLen)
	l := 0
	client.PutUint32(r[l:4], i.ID())
	l += 4
	client.PutUint32(r[l:l+4], uint32(rLen<<16|opcode&0x0000ffff))
	l += 4
	err := i.Context().WriteMsg(r, nil)
	return err
}
type ExportedHandleEvent struct {
	Handle string
}
type ExportedHandleHandlerFunc func(ExportedHandleEvent)
func (i *Exported) AddHandleHandler(f ExportedHandleHandlerFunc) {
	if f == nil {
		return
	}
	i.handleHandlers = append(i.handleHandlers, f)
}
func (i *Exported) RemoveHandleHandler(f ExportedHandleHandlerFunc) {
	for j, e := range i.handleHandlers {
		if reflect.ValueOf(e).Pointer() == reflect.ValueOf(f).Pointer() {
			i.handleHandlers = append(i.handleHandlers[:j], i.handleHandlers[j+1:]...)
			return
		}
	}
}
func (i *Exported) Dispatch(opcode uint16, fd uintptr, data []byte) {
	switch opcode {
	case 0:
		if len(i.handleHandlers) == 0 {
			return
		}
		var e ExportedHandleEvent
		l := 0
		handleLen := client.PaddedLen(int(client.Uint32(data[l : l+4])))
		l += 4
		e.Handle = client.String(data[l : l+handleLen])
		l += handleLen
		for _, f := range i.handleHandlers {
			f(e)
		}
	}
}
type Imported struct {
	client.BaseProxy
	destroyedHandlers []ImportedDestroyedHandlerFunc
}