// Code generated by wlturbo-scanner. DO NOT EDIT. // Protocol: content_type_v1 // Source: content-type-v1.xml // Upstream protocol copyright and license: // Copyright © 2021 Emmanuel Gil Peyrot // Copyright © 2022 Xaver Hugl // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice (including the next // paragraph) shall be included in all copies or substantial portions of the // Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. package contenttype import ( cross_wl_surface "github.com/bnema/wlturbo/protocol/core" "github.com/bnema/wlturbo/wl" ) // ERROR_ALREADY_CONSTRUCTED is the error already_constructed value. const ERROR_ALREADY_CONSTRUCTED = 0 // TYPE_NONE is the type none value. const TYPE_NONE = 0 // TYPE_PHOTO is the type photo value. const TYPE_PHOTO = 1 // TYPE_VIDEO is the type video value. const TYPE_VIDEO = 2 // TYPE_GAME is the type game value. const TYPE_GAME = 3 // WpContentTypeManagerInterface is the protocol interface name. const WpContentTypeManagerInterface = "wp_content_type_manager_v1" // WpContentTypeManager is the generated binding for wp_content_type_manager_v1 version 1. type WpContentTypeManager struct { wl.BaseProxy } // NewWpContentTypeManager returns an unbound WpContentTypeManager. func NewWpContentTypeManager(ctx *wl.Context) *WpContentTypeManager { obj := &WpContentTypeManager{} obj.SetContext(ctx) ctx.Register(obj) return obj } // Destroy the content type manager. This doesn't destroy objects created with the manager. func (o *WpContentTypeManager) Destroy() error { if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 0, Name: "wp_content_type_manager_v1.destroy", Destructor: true}); err != nil { return err } return nil } // Create a new content type object associated with the given surface. Creating a wp_content_type_v1 from a wl_surface which already has one attached is a client error: already_constructed. func (o *WpContentTypeManager) GetSurfaceContentType(surface *cross_wl_surface.Surface) (*WpContentType, error) { var arg1 wl.Object if surface != nil { arg1 = surface } child := &WpContentType{} child.SetContext(o.Context()) if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 1, Name: "wp_content_type_manager_v1.get_surface_content_type", Child: child}, wl.ArgObject(child), wl.ArgObject(arg1)); err != nil { return nil, err } return child, nil } // EventSignature returns the declared event argument types in wire order. func (o *WpContentTypeManager) EventSignature(opcode uint16) (string, bool) { switch opcode { default: return "", false } } // Dispatch decodes one event on wp_content_type_manager_v1 and calls the registered handlers. func (o *WpContentTypeManager) Dispatch(event *wl.Event) { switch event.Opcode { default: } } // WpContentTypeInterface is the protocol interface name. const WpContentTypeInterface = "wp_content_type_v1" // WpContentType is the generated binding for wp_content_type_v1 version 1. type WpContentType struct { wl.BaseProxy } // NewWpContentType returns an unbound WpContentType. func NewWpContentType(ctx *wl.Context) *WpContentType { obj := &WpContentType{} obj.SetContext(ctx) ctx.Register(obj) return obj } // Switch back to not specifying the content type of this surface. This is equivalent to setting the content type to none, including double buffering semantics. See set_content_type for details. func (o *WpContentType) Destroy() error { if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 0, Name: "wp_content_type_v1.destroy", Destructor: true}); err != nil { return err } return nil } // Set the surface content type. This informs the compositor that the client believes it is displaying buffers matching this content type. This is purely a hint for the compositor, which can be used to adjust its behavior or hardware settings to fit the presented content best. The content type is double-buffered state, see wl_surface.commit for details. func (o *WpContentType) SetContentType(contentType uint32) error { if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 1, Name: "wp_content_type_v1.set_content_type"}, wl.ArgUint(contentType)); err != nil { return err } return nil } // EventSignature returns the declared event argument types in wire order. func (o *WpContentType) EventSignature(opcode uint16) (string, bool) { switch opcode { default: return "", false } } // Dispatch decodes one event on wp_content_type_v1 and calls the registered handlers. func (o *WpContentType) Dispatch(event *wl.Event) { switch event.Opcode { default: } }