func (i *DrmLeaseConnector) AddWithdrawnHandler(f DrmLeaseConnectorWithdrawnHandlerFunc) {
	if f == nil {
		return
	}
	i.withdrawnHandlers = append(i.withdrawnHandlers, f)
}
AddWithdrawnHandler : adds handler for DrmLeaseConnectorWithdrawnEvent
package drm_lease
import (
	"reflect"
	"github.com/rajveermalviya/go-wayland/wayland/client"
)
type DrmLeaseDevice struct {
	client.BaseProxy
	drmFdHandlers     []DrmLeaseDeviceDrmFdHandlerFunc
	connectorHandlers []DrmLeaseDeviceConnectorHandlerFunc
	doneHandlers      []DrmLeaseDeviceDoneHandlerFunc
	releasedHandlers  []DrmLeaseDeviceReleasedHandlerFunc
}
func NewDrmLeaseDevice(ctx *client.Context) *DrmLeaseDevice {
	wpDrmLeaseDeviceV1 := &DrmLeaseDevice{}
	ctx.Register(wpDrmLeaseDeviceV1)
	return wpDrmLeaseDeviceV1
}
func (i *DrmLeaseDevice) CreateLeaseRequest() (*DrmLeaseRequest, error) {
	id := NewDrmLeaseRequest(i.Context())
	const opcode = 0
	const rLen = 8 + 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
	err := i.Context().WriteMsg(r, nil)
	return id, err
}
func (i *DrmLeaseDevice) Release() error {
	const opcode = 1
	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 *DrmLeaseDevice) Destroy() error {
	i.Context().Unregister(i)
	return nil
}
type DrmLeaseDeviceDrmFdEvent struct {
	Fd uintptr
}
type DrmLeaseDeviceDrmFdHandlerFunc func(DrmLeaseDeviceDrmFdEvent)
func (i *DrmLeaseDevice) AddDrmFdHandler(f DrmLeaseDeviceDrmFdHandlerFunc) {
	if f == nil {
		return
	}
	i.drmFdHandlers = append(i.drmFdHandlers, f)
}
func (i *DrmLeaseDevice) RemoveDrmFdHandler(f DrmLeaseDeviceDrmFdHandlerFunc) {
	for j, e := range i.drmFdHandlers {
		if reflect.ValueOf(e).Pointer() == reflect.ValueOf(f).Pointer() {
			i.drmFdHandlers = append(i.drmFdHandlers[:j], i.drmFdHandlers[j+1:]...)
			return
		}
	}
}
type DrmLeaseDeviceConnectorEvent struct {
	Id *DrmLeaseConnector
}
type DrmLeaseDeviceConnectorHandlerFunc func(DrmLeaseDeviceConnectorEvent)
func (i *DrmLeaseDevice) AddConnectorHandler(f DrmLeaseDeviceConnectorHandlerFunc) {
	if f == nil {
		return
	}
	i.connectorHandlers = append(i.connectorHandlers, f)
}
func (i *DrmLeaseDevice) RemoveConnectorHandler(f DrmLeaseDeviceConnectorHandlerFunc) {
	for j, e := range i.connectorHandlers {
		if reflect.ValueOf(e).Pointer() == reflect.ValueOf(f).Pointer() {
			i.connectorHandlers = append(i.connectorHandlers[:j], i.connectorHandlers[j+1:]...)
			return
		}
	}
}
type DrmLeaseDeviceDoneEvent struct{}
type DrmLeaseDeviceDoneHandlerFunc func(DrmLeaseDeviceDoneEvent)
func (i *DrmLeaseDevice) AddDoneHandler(f DrmLeaseDeviceDoneHandlerFunc) {
	if f == nil {
		return
	}
	i.doneHandlers = append(i.doneHandlers, f)
}
func (i *DrmLeaseDevice) RemoveDoneHandler(f DrmLeaseDeviceDoneHandlerFunc) {
	for j, e := range i.doneHandlers {
		if reflect.ValueOf(e).Pointer() == reflect.ValueOf(f).Pointer() {
			i.doneHandlers = append(i.doneHandlers[:j], i.doneHandlers[j+1:]...)
			return
		}
	}
}
type DrmLeaseDeviceReleasedEvent struct{}
type DrmLeaseDeviceReleasedHandlerFunc func(DrmLeaseDeviceReleasedEvent)
func (i *DrmLeaseDevice) AddReleasedHandler(f DrmLeaseDeviceReleasedHandlerFunc) {
	if f == nil {
		return
	}
	i.releasedHandlers = append(i.releasedHandlers, f)
}
func (i *DrmLeaseDevice) RemoveReleasedHandler(f DrmLeaseDeviceReleasedHandlerFunc) {
	for j, e := range i.releasedHandlers {
		if reflect.ValueOf(e).Pointer() == reflect.ValueOf(f).Pointer() {
			i.releasedHandlers = append(i.releasedHandlers[:j], i.releasedHandlers[j+1:]...)
			return
		}
	}
}
func (i *DrmLeaseDevice) Dispatch(opcode uint16, fd uintptr, data []byte) {
	switch opcode {
	case 0:
		if len(i.drmFdHandlers) == 0 {
			return
		}
		var e DrmLeaseDeviceDrmFdEvent
		e.Fd = fd
		for _, f := range i.drmFdHandlers {
			f(e)
		}
	case 1:
		if len(i.connectorHandlers) == 0 {
			return
		}
		var e DrmLeaseDeviceConnectorEvent
		l := 0
		e.Id = i.Context().GetProxy(client.Uint32(data[l : l+4])).(*DrmLeaseConnector)
		l += 4
		for _, f := range i.connectorHandlers {
			f(e)
		}
	case 2:
		if len(i.doneHandlers) == 0 {
			return
		}
		var e DrmLeaseDeviceDoneEvent
		for _, f := range i.doneHandlers {
			f(e)
		}
	case 3:
		if len(i.releasedHandlers) == 0 {
			return
		}
		var e DrmLeaseDeviceReleasedEvent
		for _, f := range i.releasedHandlers {
			f(e)
		}
	}
}
type DrmLeaseConnector struct {
	client.BaseProxy
	nameHandlers        []DrmLeaseConnectorNameHandlerFunc
	descriptionHandlers []DrmLeaseConnectorDescriptionHandlerFunc
	connectorIdHandlers []DrmLeaseConnectorConnectorIdHandlerFunc
	doneHandlers        []DrmLeaseConnectorDoneHandlerFunc
	withdrawnHandlers   []DrmLeaseConnectorWithdrawnHandlerFunc
}
func NewDrmLeaseConnector(ctx *client.Context) *DrmLeaseConnector {
	wpDrmLeaseConnectorV1 := &DrmLeaseConnector{}
	ctx.Register(wpDrmLeaseConnectorV1)
	return wpDrmLeaseConnectorV1
}
func (i *DrmLeaseConnector) 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 DrmLeaseConnectorNameEvent struct {
	Name string
}
type DrmLeaseConnectorNameHandlerFunc func(DrmLeaseConnectorNameEvent)
func (i *DrmLeaseConnector) AddNameHandler(f DrmLeaseConnectorNameHandlerFunc) {
	if f == nil {
		return
	}
	i.nameHandlers = append(i.nameHandlers, f)
}
func (i *DrmLeaseConnector) RemoveNameHandler(f DrmLeaseConnectorNameHandlerFunc) {
	for j, e := range i.nameHandlers {
		if reflect.ValueOf(e).Pointer() == reflect.ValueOf(f).Pointer() {
			i.nameHandlers = append(i.nameHandlers[:j], i.nameHandlers[j+1:]...)
			return
		}
	}
}
type DrmLeaseConnectorDescriptionEvent struct {
	Description string
}
type DrmLeaseConnectorDescriptionHandlerFunc func(DrmLeaseConnectorDescriptionEvent)
func (i *DrmLeaseConnector) AddDescriptionHandler(f DrmLeaseConnectorDescriptionHandlerFunc) {
	if f == nil {
		return
	}
	i.descriptionHandlers = append(i.descriptionHandlers, f)
}
func (i *DrmLeaseConnector) RemoveDescriptionHandler(f DrmLeaseConnectorDescriptionHandlerFunc) {
	for j, e := range i.descriptionHandlers {
		if reflect.ValueOf(e).Pointer() == reflect.ValueOf(f).Pointer() {
			i.descriptionHandlers = append(i.descriptionHandlers[:j], i.descriptionHandlers[j+1:]...)
			return
		}
	}
}
type DrmLeaseConnectorConnectorIdEvent struct {
	ConnectorId uint32
}
type DrmLeaseConnectorConnectorIdHandlerFunc func(DrmLeaseConnectorConnectorIdEvent)
func (i *DrmLeaseConnector) AddConnectorIdHandler(f DrmLeaseConnectorConnectorIdHandlerFunc) {
	if f == nil {
		return
	}
	i.connectorIdHandlers = append(i.connectorIdHandlers, f)
}
func (i *DrmLeaseConnector) RemoveConnectorIdHandler(f DrmLeaseConnectorConnectorIdHandlerFunc) {
	for j, e := range i.connectorIdHandlers {
		if reflect.ValueOf(e).Pointer() == reflect.ValueOf(f).Pointer() {
			i.connectorIdHandlers = append(i.connectorIdHandlers[:j], i.connectorIdHandlers[j+1:]...)
			return
		}
	}
}
type DrmLeaseConnectorDoneEvent struct{}
type DrmLeaseConnectorDoneHandlerFunc func(DrmLeaseConnectorDoneEvent)
func (i *DrmLeaseConnector) AddDoneHandler(f DrmLeaseConnectorDoneHandlerFunc) {
	if f == nil {
		return
	}
	i.doneHandlers = append(i.doneHandlers, f)
}
func (i *DrmLeaseConnector) RemoveDoneHandler(f DrmLeaseConnectorDoneHandlerFunc) {
	for j, e := range i.doneHandlers {
		if reflect.ValueOf(e).Pointer() == reflect.ValueOf(f).Pointer() {
			i.doneHandlers = append(i.doneHandlers[:j], i.doneHandlers[j+1:]...)
			return
		}
	}
}
type DrmLeaseConnectorWithdrawnEvent struct{}
type DrmLeaseConnectorWithdrawnHandlerFunc func(DrmLeaseConnectorWithdrawnEvent)