// Code generated by wlturbo-scanner. DO NOT EDIT. // Protocol: cursor_shape_v1 // Source: cursor-shape-v1.xml package cursorshape import ( cross_wl_pointer "github.com/bnema/wlturbo/protocol/core" cross_zwp_tablet_tool_v2 "github.com/bnema/wlturbo/protocol/tablet" "github.com/bnema/wlturbo/wl" ) // SHAPE_DEFAULT is the shape default value. const SHAPE_DEFAULT = 1 // SHAPE_CONTEXT_MENU is the shape context_menu value. const SHAPE_CONTEXT_MENU = 2 // SHAPE_HELP is the shape help value. const SHAPE_HELP = 3 // SHAPE_POINTER is the shape pointer value. const SHAPE_POINTER = 4 // SHAPE_PROGRESS is the shape progress value. const SHAPE_PROGRESS = 5 // SHAPE_WAIT is the shape wait value. const SHAPE_WAIT = 6 // SHAPE_CELL is the shape cell value. const SHAPE_CELL = 7 // SHAPE_CROSSHAIR is the shape crosshair value. const SHAPE_CROSSHAIR = 8 // SHAPE_TEXT is the shape text value. const SHAPE_TEXT = 9 // SHAPE_VERTICAL_TEXT is the shape vertical_text value. const SHAPE_VERTICAL_TEXT = 10 // SHAPE_ALIAS is the shape alias value. const SHAPE_ALIAS = 11 // SHAPE_COPY is the shape copy value. const SHAPE_COPY = 12 // SHAPE_MOVE is the shape move value. const SHAPE_MOVE = 13 // SHAPE_NO_DROP is the shape no_drop value. const SHAPE_NO_DROP = 14 // SHAPE_NOT_ALLOWED is the shape not_allowed value. const SHAPE_NOT_ALLOWED = 15 // SHAPE_GRAB is the shape grab value. const SHAPE_GRAB = 16 // SHAPE_GRABBING is the shape grabbing value. const SHAPE_GRABBING = 17 // SHAPE_E_RESIZE is the shape e_resize value. const SHAPE_E_RESIZE = 18 // SHAPE_N_RESIZE is the shape n_resize value. const SHAPE_N_RESIZE = 19 // SHAPE_NE_RESIZE is the shape ne_resize value. const SHAPE_NE_RESIZE = 20 // SHAPE_NW_RESIZE is the shape nw_resize value. const SHAPE_NW_RESIZE = 21 // SHAPE_S_RESIZE is the shape s_resize value. const SHAPE_S_RESIZE = 22 // SHAPE_SE_RESIZE is the shape se_resize value. const SHAPE_SE_RESIZE = 23 // SHAPE_SW_RESIZE is the shape sw_resize value. const SHAPE_SW_RESIZE = 24 // SHAPE_W_RESIZE is the shape w_resize value. const SHAPE_W_RESIZE = 25 // SHAPE_EW_RESIZE is the shape ew_resize value. const SHAPE_EW_RESIZE = 26 // SHAPE_NS_RESIZE is the shape ns_resize value. const SHAPE_NS_RESIZE = 27 // SHAPE_NESW_RESIZE is the shape nesw_resize value. const SHAPE_NESW_RESIZE = 28 // SHAPE_NWSE_RESIZE is the shape nwse_resize value. const SHAPE_NWSE_RESIZE = 29 // SHAPE_COL_RESIZE is the shape col_resize value. const SHAPE_COL_RESIZE = 30 // SHAPE_ROW_RESIZE is the shape row_resize value. const SHAPE_ROW_RESIZE = 31 // SHAPE_ALL_SCROLL is the shape all_scroll value. const SHAPE_ALL_SCROLL = 32 // SHAPE_ZOOM_IN is the shape zoom_in value. const SHAPE_ZOOM_IN = 33 // SHAPE_ZOOM_OUT is the shape zoom_out value. const SHAPE_ZOOM_OUT = 34 // SHAPE_DND_ASK is the shape dnd_ask value. const SHAPE_DND_ASK = 35 // SHAPE_ALL_RESIZE is the shape all_resize value. const SHAPE_ALL_RESIZE = 36 // ERROR_INVALID_SHAPE is the error invalid_shape value. const ERROR_INVALID_SHAPE = 1 // WpCursorShapeManagerInterface is the protocol interface name. const WpCursorShapeManagerInterface = "wp_cursor_shape_manager_v1" // WpCursorShapeManager is the generated binding for wp_cursor_shape_manager_v1 version 2. type WpCursorShapeManager struct { wl.BaseProxy } // NewWpCursorShapeManager returns an unbound WpCursorShapeManager. func NewWpCursorShapeManager(ctx *wl.Context) *WpCursorShapeManager { obj := &WpCursorShapeManager{} obj.SetContext(ctx) ctx.Register(obj) return obj } // Destroy the cursor shape manager. func (o *WpCursorShapeManager) Destroy() error { if err := o.Context().Request(wl.Request{Proxy: o, Opcode: 0, Name: "wp_cursor_shape_manager_v1.destroy", Destructor: true}); err != nil { return err } return nil } // 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. func (o *WpCursorShapeManager) GetPointer(pointer *cross_wl_pointer.Pointer) (*WpCursorShapeDevice, error) { var arg1 wl.Object if pointer != nil { arg1 = pointer } child := &WpCursorShapeDevice{} child.SetContext(o.Context()) 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 { return nil, err } return child, nil } // 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. func (o *WpCursorShapeManager) GetTabletTool(tabletTool *cross_zwp_tablet_tool_v2.TabletTool) (*WpCursorShapeDevice, error) { var arg1 wl.Object if tabletTool != nil { arg1 = tabletTool } child := &WpCursorShapeDevice{} child.SetContext(o.Context()) 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 { return nil, err } return child, nil } // EventSignature returns the declared event argument types in wire order. func (o *WpCursorShapeManager) EventSignature(opcode uint16) (string, bool) { switch opcode { default: return "", false } } // Dispatch decodes one event on wp_cursor_shape_manager_v1 and calls the registered handlers. func (o *WpCursorShapeManager) Dispatch(event *wl.Event) { switch event.Opcode { default: } } // WpCursorShapeDeviceInterface is the protocol interface name. const WpCursorShapeDeviceInterface = "wp_cursor_shape_device_v1" // WpCursorShapeDevice is the generated binding for wp_cursor_shape_device_v1 version 2. type WpCursorShapeDevice struct { wl.BaseProxy } // NewWpCursorShapeDevice returns an unbound WpCursorShapeDevice. func NewWpCursorShapeDevice(ctx *wl.Context) *WpCursorShapeDevice { obj := &WpCursorShapeDevice{} obj.SetContext(ctx) ctx.Register(obj) return obj } // Destroy the cursor shape device. The device cursor shape remains unchanged. func (o *WpCursorShapeDevice) Destroy() error { if err := o.Context().Request(wl.Request{Proxy: o, Opcode: 0, Name: "wp_cursor_shape_device_v1.destroy", Destructor: true}); err != nil { return err } return nil } // 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. func (o *WpCursorShapeDevice) SetShape(serial uint32, shape uint32) error { if err := o.Context().Request(wl.Request{Proxy: o, Opcode: 1, Name: "wp_cursor_shape_device_v1.set_shape"}, serial, shape); err != nil { return err } return nil } // EventSignature returns the declared event argument types in wire order. func (o *WpCursorShapeDevice) EventSignature(opcode uint16) (string, bool) { switch opcode { default: return "", false } } // Dispatch decodes one event on wp_cursor_shape_device_v1 and calls the registered handlers. func (o *WpCursorShapeDevice) Dispatch(event *wl.Event) { switch event.Opcode { default: } }