1// Code generated by wlturbo-scanner. DO NOT EDIT.
2// Protocol: cursor_shape_v1
3// Source: cursor-shape-v1.xml
4
5package cursorshape
6
7import (
8 cross_wl_pointer "github.com/bnema/wlturbo/protocol/core"
9 cross_zwp_tablet_tool_v2 "github.com/bnema/wlturbo/protocol/tablet"
10 "github.com/bnema/wlturbo/wl"
11)
12
13// SHAPE_DEFAULT is the shape default value.
14const SHAPE_DEFAULT = 1
15
16// SHAPE_CONTEXT_MENU is the shape context_menu value.
17const SHAPE_CONTEXT_MENU = 2
18
19// SHAPE_HELP is the shape help value.
20const SHAPE_HELP = 3
21
22// SHAPE_POINTER is the shape pointer value.
23const SHAPE_POINTER = 4
24
25// SHAPE_PROGRESS is the shape progress value.
26const SHAPE_PROGRESS = 5
27
28// SHAPE_WAIT is the shape wait value.
29const SHAPE_WAIT = 6
30
31// SHAPE_CELL is the shape cell value.
32const SHAPE_CELL = 7
33
34// SHAPE_CROSSHAIR is the shape crosshair value.
35const SHAPE_CROSSHAIR = 8
36
37// SHAPE_TEXT is the shape text value.
38const SHAPE_TEXT = 9
39
40// SHAPE_VERTICAL_TEXT is the shape vertical_text value.
41const SHAPE_VERTICAL_TEXT = 10
42
43// SHAPE_ALIAS is the shape alias value.
44const SHAPE_ALIAS = 11
45
46// SHAPE_COPY is the shape copy value.
47const SHAPE_COPY = 12
48
49// SHAPE_MOVE is the shape move value.
50const SHAPE_MOVE = 13
51
52// SHAPE_NO_DROP is the shape no_drop value.
53const SHAPE_NO_DROP = 14
54
55// SHAPE_NOT_ALLOWED is the shape not_allowed value.
56const SHAPE_NOT_ALLOWED = 15
57
58// SHAPE_GRAB is the shape grab value.
59const SHAPE_GRAB = 16
60
61// SHAPE_GRABBING is the shape grabbing value.
62const SHAPE_GRABBING = 17
63
64// SHAPE_E_RESIZE is the shape e_resize value.
65const SHAPE_E_RESIZE = 18
66
67// SHAPE_N_RESIZE is the shape n_resize value.
68const SHAPE_N_RESIZE = 19
69
70// SHAPE_NE_RESIZE is the shape ne_resize value.
71const SHAPE_NE_RESIZE = 20
72
73// SHAPE_NW_RESIZE is the shape nw_resize value.
74const SHAPE_NW_RESIZE = 21
75
76// SHAPE_S_RESIZE is the shape s_resize value.
77const SHAPE_S_RESIZE = 22
78
79// SHAPE_SE_RESIZE is the shape se_resize value.
80const SHAPE_SE_RESIZE = 23
81
82// SHAPE_SW_RESIZE is the shape sw_resize value.
83const SHAPE_SW_RESIZE = 24
84
85// SHAPE_W_RESIZE is the shape w_resize value.
86const SHAPE_W_RESIZE = 25
87
88// SHAPE_EW_RESIZE is the shape ew_resize value.
89const SHAPE_EW_RESIZE = 26
90
91// SHAPE_NS_RESIZE is the shape ns_resize value.
92const SHAPE_NS_RESIZE = 27
93
94// SHAPE_NESW_RESIZE is the shape nesw_resize value.
95const SHAPE_NESW_RESIZE = 28
96
97// SHAPE_NWSE_RESIZE is the shape nwse_resize value.
98const SHAPE_NWSE_RESIZE = 29
99
100// SHAPE_COL_RESIZE is the shape col_resize value.
101const SHAPE_COL_RESIZE = 30
102
103// SHAPE_ROW_RESIZE is the shape row_resize value.
104const SHAPE_ROW_RESIZE = 31
105
106// SHAPE_ALL_SCROLL is the shape all_scroll value.
107const SHAPE_ALL_SCROLL = 32
108
109// SHAPE_ZOOM_IN is the shape zoom_in value.
110const SHAPE_ZOOM_IN = 33
111
112// SHAPE_ZOOM_OUT is the shape zoom_out value.
113const SHAPE_ZOOM_OUT = 34
114
115// SHAPE_DND_ASK is the shape dnd_ask value.
116const SHAPE_DND_ASK = 35
117
118// SHAPE_ALL_RESIZE is the shape all_resize value.
119const SHAPE_ALL_RESIZE = 36
120
121// ERROR_INVALID_SHAPE is the error invalid_shape value.
122const ERROR_INVALID_SHAPE = 1
123
124// WpCursorShapeManagerInterface is the protocol interface name.
125const WpCursorShapeManagerInterface = "wp_cursor_shape_manager_v1"
126
127// WpCursorShapeManager is the generated binding for wp_cursor_shape_manager_v1 version 2.
128type WpCursorShapeManager struct {
129 wl.BaseProxy
130}
131
132// NewWpCursorShapeManager returns an unbound WpCursorShapeManager.
133func NewWpCursorShapeManager(ctx *wl.Context) *WpCursorShapeManager {
134 obj := &WpCursorShapeManager{}
135 obj.SetContext(ctx)
136 ctx.Register(obj)
137 return obj
138}
139
140// Destroy the cursor shape manager.
141func (o *WpCursorShapeManager) Destroy() error {
142 if err := o.Context().Request(wl.Request{Proxy: o, Opcode: 0, Name: "wp_cursor_shape_manager_v1.destroy", Destructor: true}); err != nil {
143 return err
144 }
145 return nil
146}
147
148// Obtain a wp_cursor_shape_device_v1 for a wl_pointer object. When the pointer capability is removed from the wl_seat, the wp_cursor_shape_device_v1 object becomes inert.
149func (o *WpCursorShapeManager) GetPointer(pointer *cross_wl_pointer.Pointer) (*WpCursorShapeDevice, error) {
150 var arg1 wl.Object
151 if pointer != nil {
152 arg1 = pointer
153 }
154 child := &WpCursorShapeDevice{}
155 child.SetContext(o.Context())
156 if err := o.Context().Request(wl.Request{Proxy: o, Opcode: 1, Name: "wp_cursor_shape_manager_v1.get_pointer", Child: child}, child, arg1); err != nil {
157 return nil, err
158 }
159 return child, nil
160}
161
162// Obtain a wp_cursor_shape_device_v1 for a zwp_tablet_tool_v2 object. When the zwp_tablet_tool_v2 is removed, the wp_cursor_shape_device_v1 object becomes inert.
163func (o *WpCursorShapeManager) GetTabletTool(tabletTool *cross_zwp_tablet_tool_v2.TabletTool) (*WpCursorShapeDevice, error) {
164 var arg1 wl.Object
165 if tabletTool != nil {
166 arg1 = tabletTool
167 }
168 child := &WpCursorShapeDevice{}
169 child.SetContext(o.Context())
170 if err := o.Context().Request(wl.Request{Proxy: o, Opcode: 2, Name: "wp_cursor_shape_manager_v1.get_tablet_tool_v2", Child: child}, child, arg1); err != nil {
171 return nil, err
172 }
173 return child, nil
174}
175
176// EventSignature returns the declared event argument types in wire order.
177func (o *WpCursorShapeManager) EventSignature(opcode uint16) (string, bool) {
178 switch opcode {
179 default:
180 return "", false
181 }
182}
183
184// Dispatch decodes one event on wp_cursor_shape_manager_v1 and calls the registered handlers.
185func (o *WpCursorShapeManager) Dispatch(event *wl.Event) {
186 switch event.Opcode {
187 default:
188 }
189}
190
191// WpCursorShapeDeviceInterface is the protocol interface name.
192const WpCursorShapeDeviceInterface = "wp_cursor_shape_device_v1"
193
194// WpCursorShapeDevice is the generated binding for wp_cursor_shape_device_v1 version 2.
195type WpCursorShapeDevice struct {
196 wl.BaseProxy
197}
198
199// NewWpCursorShapeDevice returns an unbound WpCursorShapeDevice.
200func NewWpCursorShapeDevice(ctx *wl.Context) *WpCursorShapeDevice {
201 obj := &WpCursorShapeDevice{}
202 obj.SetContext(ctx)
203 ctx.Register(obj)
204 return obj
205}
206
207// Destroy the cursor shape device. The device cursor shape remains unchanged.
208func (o *WpCursorShapeDevice) Destroy() error {
209 if err := o.Context().Request(wl.Request{Proxy: o, Opcode: 0, Name: "wp_cursor_shape_device_v1.destroy", Destructor: true}); err != nil {
210 return err
211 }
212 return nil
213}
214
215// Sets the device cursor to the specified shape. The compositor will change the cursor image based on the specified shape. The cursor actually changes only if the input device focus is one of the requesting client's surfaces. If any, the previous cursor image (surface or shape) is replaced. The "shape" argument must be a valid enum entry, otherwise the invalid_shape protocol error is raised. This is similar to the wl_pointer.set_cursor and zwp_tablet_tool_v2.set_cursor requests, but this request accepts a shape instead of contents in the form of a surface. Clients can mix set_cursor and set_shape requests. The serial parameter must match the latest wl_pointer.enter or zwp_tablet_tool_v2.proximity_in serial number sent to the client. Otherwise the request will be ignored.
216func (o *WpCursorShapeDevice) SetShape(serial uint32, shape uint32) error {
217 if err := o.Context().Request(wl.Request{Proxy: o, Opcode: 1, Name: "wp_cursor_shape_device_v1.set_shape"}, serial, shape); err != nil {
218 return err
219 }
220 return nil
221}
222
223// EventSignature returns the declared event argument types in wire order.
224func (o *WpCursorShapeDevice) EventSignature(opcode uint16) (string, bool) {
225 switch opcode {
226 default:
227 return "", false
228 }
229}
230
231// Dispatch decodes one event on wp_cursor_shape_device_v1 and calls the registered handlers.
232func (o *WpCursorShapeDevice) Dispatch(event *wl.Event) {
233 switch event.Opcode {
234 default:
235 }
236}