// Code generated by wlbgen. DO NOT EDIT. // Protocol: commit_timing_v1 // Source: commit-timing-v1.xml // Upstream protocol copyright and license: // Copyright © 2023 Valve Corporation // // 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 committiming import ( cross_wl_surface "github.com/bnema/go-wayland-bindings/client/wayland" "github.com/bnema/wlturbo/wl" ) // ERROR_COMMIT_TIMER_EXISTS is the error commit_timer_exists value. const ERROR_COMMIT_TIMER_EXISTS = 0 // ERROR_INVALID_TIMESTAMP is the error invalid_timestamp value. const ERROR_INVALID_TIMESTAMP = 0 // ERROR_TIMESTAMP_EXISTS is the error timestamp_exists value. const ERROR_TIMESTAMP_EXISTS = 1 // ERROR_SURFACE_DESTROYED is the error surface_destroyed value. const ERROR_SURFACE_DESTROYED = 2 // WpCommitTimingManagerInterface is the protocol interface name. const WpCommitTimingManagerInterface = "wp_commit_timing_manager_v1" // WpCommitTimingManager is the generated binding for wp_commit_timing_manager_v1 version 1. type WpCommitTimingManager struct { wl.BaseProxy } // NewWpCommitTimingManager returns an unbound WpCommitTimingManager. func NewWpCommitTimingManager(ctx *wl.Context) *WpCommitTimingManager { obj := &WpCommitTimingManager{} obj.SetContext(ctx) ctx.Register(obj) return obj } // Informs the server that the client will no longer be using this protocol object. Existing objects created by this object are not affected. func (o *WpCommitTimingManager) Destroy() error { if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 0, Name: "wp_commit_timing_manager_v1.destroy", Destructor: true}); err != nil { return err } return nil } // Establish a timing controller for a surface. Only one commit timer can be created for a surface, or a commit_timer_exists protocol error will be generated. func (o *WpCommitTimingManager) GetTimer(surface *cross_wl_surface.Surface) (*WpCommitTimer, error) { var arg1 wl.Object if surface != nil { arg1 = surface } child := &WpCommitTimer{} child.SetContext(o.Context()) if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 1, Name: "wp_commit_timing_manager_v1.get_timer", 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 *WpCommitTimingManager) EventSignature(opcode uint16) (string, bool) { switch opcode { default: return "", false } } // Dispatch decodes one event on wp_commit_timing_manager_v1 and calls the registered handlers. func (o *WpCommitTimingManager) Dispatch(event *wl.Event) { switch event.Opcode { default: } } // WpCommitTimerInterface is the protocol interface name. const WpCommitTimerInterface = "wp_commit_timer_v1" // WpCommitTimer is the generated binding for wp_commit_timer_v1 version 1. type WpCommitTimer struct { wl.BaseProxy } // NewWpCommitTimer returns an unbound WpCommitTimer. func NewWpCommitTimer(ctx *wl.Context) *WpCommitTimer { obj := &WpCommitTimer{} obj.SetContext(ctx) ctx.Register(obj) return obj } // Provide a timing constraint for a surface content update. A set_timestamp request may be made before a wl_surface.commit to tell the compositor that the content is intended to be presented as closely as possible to, but not before, the specified time. The time is in the domain of the compositor's presentation clock. An invalid_timestamp error will be generated for invalid tv_nsec. If a timestamp already exists on the surface, a timestamp_exists error is generated. Requesting set_timestamp after the commit_timer object's surface is destroyed will generate a "surface_destroyed" error. func (o *WpCommitTimer) SetTimestamp(tvSecHi uint32, tvSecLo uint32, tvNsec uint32) error { if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 0, Name: "wp_commit_timer_v1.set_timestamp"}, wl.ArgUint(tvSecHi), wl.ArgUint(tvSecLo), wl.ArgUint(tvNsec)); err != nil { return err } return nil } // Informs the server that the client will no longer be using this protocol object. Existing timing constraints are not affected by the destruction. func (o *WpCommitTimer) Destroy() error { if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 1, Name: "wp_commit_timer_v1.destroy", Destructor: true}); err != nil { return err } return nil } // EventSignature returns the declared event argument types in wire order. func (o *WpCommitTimer) EventSignature(opcode uint16) (string, bool) { switch opcode { default: return "", false } } // Dispatch decodes one event on wp_commit_timer_v1 and calls the registered handlers. func (o *WpCommitTimer) Dispatch(event *wl.Event) { switch event.Opcode { default: } }