1// Code generated by wlbgen. DO NOT EDIT.
2// Protocol: xdg_toplevel_tag_v1
3// Source: xdg-toplevel-tag-v1.xml
4
5// Upstream protocol copyright and license:
6// Copyright © 2024 Xaver Hugl
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 xdgtopleveltag
28
29import (
30 cross_xdg_toplevel "github.com/bnema/go-wayland-bindings/client/xdgshell"
31 "github.com/bnema/wlturbo/wl"
32)
33
34// XdgToplevelTagManagerInterface is the protocol interface name.
35const XdgToplevelTagManagerInterface = "xdg_toplevel_tag_manager_v1"
36
37// XdgToplevelTagManager is the generated binding for xdg_toplevel_tag_manager_v1 version 1.
38type XdgToplevelTagManager struct {
39 wl.BaseProxy
40}
41
42// NewXdgToplevelTagManager returns an unbound XdgToplevelTagManager.
43func NewXdgToplevelTagManager(ctx *wl.Context) *XdgToplevelTagManager {
44 obj := &XdgToplevelTagManager{}
45 obj.SetContext(ctx)
46 ctx.Register(obj)
47 return obj
48}
49
50// Destroy this toplevel tag manager object. This request has no other effects.
51func (o *XdgToplevelTagManager) Destroy() error {
52 if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 0, Name: "xdg_toplevel_tag_manager_v1.destroy", Destructor: true}); err != nil {
53 return err
54 }
55 return nil
56}
57
58// Set a tag for a toplevel. The tag may be shown to the user in UI, so it's preferable for it to be human readable, but it must be suitable for configuration files and should not be translated. Suitable tags would for example be "main window", "settings", "e-mail composer" or similar. The tag does not need to be unique across applications, and the client may set the same tag for multiple windows, for example if the user has opened the same UI twice. How the potentially resulting conflicts are handled is compositor policy. The client should set the tag as part of the initial commit on the associated toplevel, but it may set it at any time afterwards as well, for example if the purpose of the toplevel changes.
59func (o *XdgToplevelTagManager) SetToplevelTag(toplevel *cross_xdg_toplevel.XdgToplevel, tag string) error {
60 var arg0 wl.Object
61 if toplevel != nil {
62 arg0 = toplevel
63 }
64 if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 1, Name: "xdg_toplevel_tag_manager_v1.set_toplevel_tag"}, wl.ArgObject(arg0), wl.ArgString(tag)); err != nil {
65 return err
66 }
67 return nil
68}
69
70// Set a description for a toplevel. This description may be shown to the user in UI or read by a screen reader for accessibility purposes, and should be translated. It is recommended to make the description the translation of the tag. The client should set the description as part of the initial commit on the associated toplevel, but it may set it at any time afterwards as well, for example if the purpose of the toplevel changes.
71func (o *XdgToplevelTagManager) SetToplevelDescription(toplevel *cross_xdg_toplevel.XdgToplevel, description string) error {
72 var arg0 wl.Object
73 if toplevel != nil {
74 arg0 = toplevel
75 }
76 if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 2, Name: "xdg_toplevel_tag_manager_v1.set_toplevel_description"}, wl.ArgObject(arg0), wl.ArgString(description)); err != nil {
77 return err
78 }
79 return nil
80}
81
82// EventSignature returns the declared event argument types in wire order.
83func (o *XdgToplevelTagManager) EventSignature(opcode uint16) (string, bool) {
84 switch opcode {
85 default:
86 return "", false
87 }
88}
89
90// Dispatch decodes one event on xdg_toplevel_tag_manager_v1 and calls the registered handlers.
91func (o *XdgToplevelTagManager) Dispatch(event *wl.Event) {
92 switch event.Opcode {
93 default:
94 }
95}