1// Code generated by wlbgen. DO NOT EDIT.
2// Protocol: idle_inhibit_unstable_v1
3// Source: idle-inhibit-unstable-v1.xml
4
5// Upstream protocol copyright and license:
6// Copyright © 2015 Samsung Electronics Co., Ltd
7//
8// Permission is hereby granted, free of charge, to any person obtaining a
9// copy of this software and associated documentation files (the "Software"),
10// to deal in the Software without restriction, including without limitation
11// the rights to use, copy, modify, merge, publish, distribute, sublicense,
12// and/or sell copies of the Software, and to permit persons to whom the
13// Software is furnished to do so, subject to the following conditions:
14//
15// The above copyright notice and this permission notice (including the next
16// paragraph) shall be included in all copies or substantial portions of the
17// Software.
18//
19// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25// DEALINGS IN THE SOFTWARE.
26
27package idleinhibit
28
29import (
30 cross_wl_surface "github.com/bnema/go-wayland-bindings/client/wayland"
31 "github.com/bnema/wlturbo/wl"
32)
33
34// IdleInhibitManagerInterface is the protocol interface name.
35const IdleInhibitManagerInterface = "zwp_idle_inhibit_manager_v1"
36
37// IdleInhibitManager is the generated binding for zwp_idle_inhibit_manager_v1 version 1.
38type IdleInhibitManager struct {
39 wl.BaseProxy
40}
41
42// NewIdleInhibitManager returns an unbound IdleInhibitManager.
43func NewIdleInhibitManager(ctx *wl.Context) *IdleInhibitManager {
44 obj := &IdleInhibitManager{}
45 obj.SetContext(ctx)
46 ctx.Register(obj)
47 return obj
48}
49
50// Destroy the inhibit manager.
51func (o *IdleInhibitManager) Destroy() error {
52 if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 0, Name: "zwp_idle_inhibit_manager_v1.destroy", Destructor: true}); err != nil {
53 return err
54 }
55 return nil
56}
57
58// Create a new inhibitor object associated with the given surface.
59func (o *IdleInhibitManager) CreateInhibitor(surface *cross_wl_surface.Surface) (*IdleInhibitor, error) {
60 var arg1 wl.Object
61 if surface != nil {
62 arg1 = surface
63 }
64 child := &IdleInhibitor{}
65 child.SetContext(o.Context())
66 if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 1, Name: "zwp_idle_inhibit_manager_v1.create_inhibitor", Child: child}, wl.ArgObject(child), wl.ArgObject(arg1)); err != nil {
67 return nil, err
68 }
69 return child, nil
70}
71
72// EventSignature returns the declared event argument types in wire order.
73func (o *IdleInhibitManager) EventSignature(opcode uint16) (string, bool) {
74 switch opcode {
75 default:
76 return "", false
77 }
78}
79
80// Dispatch decodes one event on zwp_idle_inhibit_manager_v1 and calls the registered handlers.
81func (o *IdleInhibitManager) Dispatch(event *wl.Event) {
82 switch event.Opcode {
83 default:
84 }
85}
86
87// IdleInhibitorInterface is the protocol interface name.
88const IdleInhibitorInterface = "zwp_idle_inhibitor_v1"
89
90// IdleInhibitor is the generated binding for zwp_idle_inhibitor_v1 version 1.
91type IdleInhibitor struct {
92 wl.BaseProxy
93}
94
95// NewIdleInhibitor returns an unbound IdleInhibitor.
96func NewIdleInhibitor(ctx *wl.Context) *IdleInhibitor {
97 obj := &IdleInhibitor{}
98 obj.SetContext(ctx)
99 ctx.Register(obj)
100 return obj
101}
102
103// Remove the inhibitor effect from the associated wl_surface.
104func (o *IdleInhibitor) Destroy() error {
105 if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 0, Name: "zwp_idle_inhibitor_v1.destroy", Destructor: true}); err != nil {
106 return err
107 }
108 return nil
109}
110
111// EventSignature returns the declared event argument types in wire order.
112func (o *IdleInhibitor) EventSignature(opcode uint16) (string, bool) {
113 switch opcode {
114 default:
115 return "", false
116 }
117}
118
119// Dispatch decodes one event on zwp_idle_inhibitor_v1 and calls the registered handlers.
120func (o *IdleInhibitor) Dispatch(event *wl.Event) {
121 switch event.Opcode {
122 default:
123 }
124}