detached 1a6c6c9

xdgshell_generated.go RawHistoryFolder

1// Code generated by wlbgen; DO NOT EDIT.
2
3// Upstream protocol copyright and license:
4// Copyright © 2008-2013 Kristian Høgsberg
5// Copyright © 2013      Rafael Antognolli
6// Copyright © 2013      Jasper St. Pierre
7// Copyright © 2010-2013 Intel Corporation
8// Copyright © 2015-2017 Samsung Electronics Co., Ltd
9// Copyright © 2015-2017 Red Hat Inc.
10//
11// Permission is hereby granted, free of charge, to any person obtaining a
12// copy of this software and associated documentation files (the "Software"),
13// to deal in the Software without restriction, including without limitation
14// the rights to use, copy, modify, merge, publish, distribute, sublicense,
15// and/or sell copies of the Software, and to permit persons to whom the
16// Software is furnished to do so, subject to the following conditions:
17//
18// The above copyright notice and this permission notice (including the next
19// paragraph) shall be included in all copies or substantial portions of the
20// Software.
21//
22// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
25// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
27// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
28// DEALINGS IN THE SOFTWARE.
29
30package xdgshell
31
32import (
33	"fmt"
34	wayland "github.com/bnema/go-wayland-bindings/server/wayland"
35	"github.com/bnema/purego-libwayland/server"
36	"runtime"
37)
38
39var WmBaseInterface *server.Interface
40var PositionerInterface *server.Interface
41var SurfaceInterface *server.Interface
42var ToplevelInterface *server.Interface
43var PopupInterface *server.Interface
44
45func init() {
46	WmBaseInterface = &server.Interface{Name: "xdg_wm_base", Version: 7}
47	PositionerInterface = &server.Interface{Name: "xdg_positioner", Version: 7}
48	SurfaceInterface = &server.Interface{Name: "xdg_surface", Version: 7}
49	ToplevelInterface = &server.Interface{Name: "xdg_toplevel", Version: 7}
50	PopupInterface = &server.Interface{Name: "xdg_popup", Version: 7}
51	WmBaseInterface.Requests = []server.Message{
52		{Name: "destroy", Signature: "", Types: []*server.Interface{}},
53		{Name: "create_positioner", Signature: "n", Types: []*server.Interface{PositionerInterface}},
54		{Name: "get_xdg_surface", Signature: "no", Types: []*server.Interface{SurfaceInterface, wayland.SurfaceInterface}},
55		{Name: "pong", Signature: "u", Types: []*server.Interface{nil}},
56	}
57	WmBaseInterface.Events = []server.Message{
58		{Name: "ping", Signature: "u", Types: []*server.Interface{nil}},
59	}
60	PositionerInterface.Requests = []server.Message{
61		{Name: "destroy", Signature: "", Types: []*server.Interface{}},
62		{Name: "set_size", Signature: "ii", Types: []*server.Interface{nil, nil}},
63		{Name: "set_anchor_rect", Signature: "iiii", Types: []*server.Interface{nil, nil, nil, nil}},
64		{Name: "set_anchor", Signature: "u", Types: []*server.Interface{nil}},
65		{Name: "set_gravity", Signature: "u", Types: []*server.Interface{nil}},
66		{Name: "set_constraint_adjustment", Signature: "u", Types: []*server.Interface{nil}},
67		{Name: "set_offset", Signature: "ii", Types: []*server.Interface{nil, nil}},
68		{Name: "set_reactive", Signature: "3", Types: []*server.Interface{}},
69		{Name: "set_parent_size", Signature: "3ii", Types: []*server.Interface{nil, nil}},
70		{Name: "set_parent_configure", Signature: "3u", Types: []*server.Interface{nil}},
71	}
72	PositionerInterface.Events = []server.Message{}
73	SurfaceInterface.Requests = []server.Message{
74		{Name: "destroy", Signature: "", Types: []*server.Interface{}},
75		{Name: "get_toplevel", Signature: "n", Types: []*server.Interface{ToplevelInterface}},
76		{Name: "get_popup", Signature: "n?oo", Types: []*server.Interface{PopupInterface, SurfaceInterface, PositionerInterface}},
77		{Name: "set_window_geometry", Signature: "iiii", Types: []*server.Interface{nil, nil, nil, nil}},
78		{Name: "ack_configure", Signature: "u", Types: []*server.Interface{nil}},
79	}
80	SurfaceInterface.Events = []server.Message{
81		{Name: "configure", Signature: "u", Types: []*server.Interface{nil}},
82	}
83	ToplevelInterface.Requests = []server.Message{
84		{Name: "destroy", Signature: "", Types: []*server.Interface{}},
85		{Name: "set_parent", Signature: "?o", Types: []*server.Interface{ToplevelInterface}},
86		{Name: "set_title", Signature: "s", Types: []*server.Interface{nil}},
87		{Name: "set_app_id", Signature: "s", Types: []*server.Interface{nil}},
88		{Name: "show_window_menu", Signature: "ouii", Types: []*server.Interface{wayland.SeatInterface, nil, nil, nil}},
89		{Name: "move", Signature: "ou", Types: []*server.Interface{wayland.SeatInterface, nil}},
90		{Name: "resize", Signature: "ouu", Types: []*server.Interface{wayland.SeatInterface, nil, nil}},
91		{Name: "set_max_size", Signature: "ii", Types: []*server.Interface{nil, nil}},
92		{Name: "set_min_size", Signature: "ii", Types: []*server.Interface{nil, nil}},
93		{Name: "set_maximized", Signature: "", Types: []*server.Interface{}},
94		{Name: "unset_maximized", Signature: "", Types: []*server.Interface{}},
95		{Name: "set_fullscreen", Signature: "?o", Types: []*server.Interface{wayland.OutputInterface}},
96		{Name: "unset_fullscreen", Signature: "", Types: []*server.Interface{}},
97		{Name: "set_minimized", Signature: "", Types: []*server.Interface{}},
98	}
99	ToplevelInterface.Events = []server.Message{
100		{Name: "configure", Signature: "iia", Types: []*server.Interface{nil, nil, nil}},
101		{Name: "close", Signature: "", Types: []*server.Interface{}},
102		{Name: "configure_bounds", Signature: "4ii", Types: []*server.Interface{nil, nil}},
103		{Name: "wm_capabilities", Signature: "5a", Types: []*server.Interface{nil}},
104	}
105	PopupInterface.Requests = []server.Message{
106		{Name: "destroy", Signature: "", Types: []*server.Interface{}},
107		{Name: "grab", Signature: "ou", Types: []*server.Interface{wayland.SeatInterface, nil}},
108		{Name: "reposition", Signature: "3ou", Types: []*server.Interface{PositionerInterface, nil}},
109	}
110	PopupInterface.Events = []server.Message{
111		{Name: "configure", Signature: "iiii", Types: []*server.Interface{nil, nil, nil, nil}},
112		{Name: "popup_done", Signature: "", Types: []*server.Interface{}},
113		{Name: "repositioned", Signature: "3u", Types: []*server.Interface{nil}},
114	}
115	if err := server.NewInterfaces(WmBaseInterface, PositionerInterface, SurfaceInterface, ToplevelInterface, PopupInterface); err != nil {
116		panic(err)
117	}
118}
119
120// WmBase create desktop-style surfaces.
121type WmBase struct{ *server.Resource }
122
123func WrapWmBase(r *server.Resource) *WmBase {
124	if r == nil {
125		return nil
126	}
127	return &WmBase{r}
128}
129
130const WmBaseRequestDestroy uint32 = 0
131const WmBaseRequestCreatePositioner uint32 = 1
132const WmBaseRequestGetXdgSurface uint32 = 2
133const WmBaseRequestPong uint32 = 3
134const WmBaseEventPing uint32 = 0
135
136// WmBaseError .
137type WmBaseError uint32
138
139const (
140	WmBaseErrorRole                WmBaseError = 0
141	WmBaseErrorDefunctSurfaces     WmBaseError = 1
142	WmBaseErrorNotTheTopmostPopup  WmBaseError = 2
143	WmBaseErrorInvalidPopupParent  WmBaseError = 3
144	WmBaseErrorInvalidSurfaceState WmBaseError = 4
145	WmBaseErrorInvalidPositioner   WmBaseError = 5
146	WmBaseErrorUnresponsive        WmBaseError = 6
147)
148
149// WmBaseHandler handles xdg_wm_base requests.
150type WmBaseHandler interface {
151	Destroy(self *WmBase)
152	CreatePositioner(self *WmBase, id uint32)
153	GetXdgSurface(self *WmBase, id uint32, surface *wayland.Surface)
154	Pong(self *WmBase, serial uint32)
155}
156
157func NewWmBase(c server.Client, version int32, id uint32, h WmBaseHandler) (*WmBase, error) {
158	if h == nil {
159		return nil, fmt.Errorf("purego-libwayland: nil handler for xdg_wm_base")
160	}
161	var self *WmBase
162	r, err := c.CreateResource(WmBaseInterface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
163		switch opcode {
164		case 0:
165			h.Destroy(self)
166			self.Destroy()
167		case 1:
168			h.CreatePositioner(self, args[0].NewID())
169		case 2:
170			h.GetXdgSurface(self, args[0].NewID(), wayland.WrapSurface(args[1].Resource()))
171		case 3:
172			h.Pong(self, args[0].Uint())
173		}
174	})
175	if err != nil {
176		return nil, err
177	}
178	self = WrapWmBase(r)
179	r.Data = self
180	return self, nil
181}
182
183// SendPing check if the client is alive.
184func (self *WmBase) SendPing(serial uint32) {
185	self.PostEvent(WmBaseEventPing, server.Uint(serial))
186}
187func NewWmBaseGlobal(d *server.Display, version int32, bind server.BindFunc) error {
188	return d.CreateGlobal(WmBaseInterface, version, bind)
189}
190
191// Positioner child surface positioner.
192type Positioner struct{ *server.Resource }
193
194func WrapPositioner(r *server.Resource) *Positioner {
195	if r == nil {
196		return nil
197	}
198	return &Positioner{r}
199}
200
201const PositionerRequestDestroy uint32 = 0
202const PositionerRequestSetSize uint32 = 1
203const PositionerRequestSetAnchorRect uint32 = 2
204const PositionerRequestSetAnchor uint32 = 3
205const PositionerRequestSetGravity uint32 = 4
206const PositionerRequestSetConstraintAdjustment uint32 = 5
207const PositionerRequestSetOffset uint32 = 6
208const PositionerRequestSetReactive uint32 = 7
209const PositionerRequestSetParentSize uint32 = 8
210const PositionerRequestSetParentConfigure uint32 = 9
211
212// PositionerError .
213type PositionerError uint32
214
215const (
216	PositionerErrorInvalidInput PositionerError = 0
217)
218
219// PositionerAnchor .
220type PositionerAnchor uint32
221
222const (
223	PositionerAnchorNone        PositionerAnchor = 0
224	PositionerAnchorTop         PositionerAnchor = 1
225	PositionerAnchorBottom      PositionerAnchor = 2
226	PositionerAnchorLeft        PositionerAnchor = 3
227	PositionerAnchorRight       PositionerAnchor = 4
228	PositionerAnchorTopLeft     PositionerAnchor = 5
229	PositionerAnchorBottomLeft  PositionerAnchor = 6
230	PositionerAnchorTopRight    PositionerAnchor = 7
231	PositionerAnchorBottomRight PositionerAnchor = 8
232)
233
234// PositionerGravity .
235type PositionerGravity uint32
236
237const (
238	PositionerGravityNone        PositionerGravity = 0
239	PositionerGravityTop         PositionerGravity = 1
240	PositionerGravityBottom      PositionerGravity = 2
241	PositionerGravityLeft        PositionerGravity = 3
242	PositionerGravityRight       PositionerGravity = 4
243	PositionerGravityTopLeft     PositionerGravity = 5
244	PositionerGravityBottomLeft  PositionerGravity = 6
245	PositionerGravityTopRight    PositionerGravity = 7
246	PositionerGravityBottomRight PositionerGravity = 8
247)
248
249// PositionerConstraintAdjustment constraint adjustments (bitfield).
250type PositionerConstraintAdjustment uint32
251
252const (
253	PositionerConstraintAdjustmentNone    PositionerConstraintAdjustment = 0
254	PositionerConstraintAdjustmentSlideX  PositionerConstraintAdjustment = 1
255	PositionerConstraintAdjustmentSlideY  PositionerConstraintAdjustment = 2
256	PositionerConstraintAdjustmentFlipX   PositionerConstraintAdjustment = 4
257	PositionerConstraintAdjustmentFlipY   PositionerConstraintAdjustment = 8
258	PositionerConstraintAdjustmentResizeX PositionerConstraintAdjustment = 16
259	PositionerConstraintAdjustmentResizeY PositionerConstraintAdjustment = 32
260)
261
262// PositionerHandler handles xdg_positioner requests.
263type PositionerHandler interface {
264	Destroy(self *Positioner)
265	SetSize(self *Positioner, width int32, height int32)
266	SetAnchorRect(self *Positioner, x int32, y int32, width int32, height int32)
267	SetAnchor(self *Positioner, anchor uint32)
268	SetGravity(self *Positioner, gravity uint32)
269	SetConstraintAdjustment(self *Positioner, constraintAdjustment uint32)
270	SetOffset(self *Positioner, x int32, y int32)
271	SetReactive(self *Positioner)
272	SetParentSize(self *Positioner, parentWidth int32, parentHeight int32)
273	SetParentConfigure(self *Positioner, serial uint32)
274}
275
276func NewPositioner(c server.Client, version int32, id uint32, h PositionerHandler) (*Positioner, error) {
277	if h == nil {
278		return nil, fmt.Errorf("purego-libwayland: nil handler for xdg_positioner")
279	}
280	var self *Positioner
281	r, err := c.CreateResource(PositionerInterface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
282		switch opcode {
283		case 0:
284			h.Destroy(self)
285			self.Destroy()
286		case 1:
287			h.SetSize(self, args[0].Int(), args[1].Int())
288		case 2:
289			h.SetAnchorRect(self, args[0].Int(), args[1].Int(), args[2].Int(), args[3].Int())
290		case 3:
291			h.SetAnchor(self, args[0].Uint())
292		case 4:
293			h.SetGravity(self, args[0].Uint())
294		case 5:
295			h.SetConstraintAdjustment(self, args[0].Uint())
296		case 6:
297			h.SetOffset(self, args[0].Int(), args[1].Int())
298		case 7:
299			h.SetReactive(self)
300		case 8:
301			h.SetParentSize(self, args[0].Int(), args[1].Int())
302		case 9:
303			h.SetParentConfigure(self, args[0].Uint())
304		}
305	})
306	if err != nil {
307		return nil, err
308	}
309	self = WrapPositioner(r)
310	r.Data = self
311	return self, nil
312}
313func NewPositionerGlobal(d *server.Display, version int32, bind server.BindFunc) error {
314	return d.CreateGlobal(PositionerInterface, version, bind)
315}
316
317// Surface desktop user interface surface base interface.
318type Surface struct{ *server.Resource }
319
320func WrapSurface(r *server.Resource) *Surface {
321	if r == nil {
322		return nil
323	}
324	return &Surface{r}
325}
326
327const SurfaceRequestDestroy uint32 = 0
328const SurfaceRequestGetToplevel uint32 = 1
329const SurfaceRequestGetPopup uint32 = 2
330const SurfaceRequestSetWindowGeometry uint32 = 3
331const SurfaceRequestAckConfigure uint32 = 4
332const SurfaceEventConfigure uint32 = 0
333
334// SurfaceError .
335type SurfaceError uint32
336
337const (
338	SurfaceErrorNotConstructed     SurfaceError = 1
339	SurfaceErrorAlreadyConstructed SurfaceError = 2
340	SurfaceErrorUnconfiguredBuffer SurfaceError = 3
341	SurfaceErrorInvalidSerial      SurfaceError = 4
342	SurfaceErrorInvalidSize        SurfaceError = 5
343	SurfaceErrorDefunctRoleObject  SurfaceError = 6
344)
345
346// SurfaceHandler handles xdg_surface requests.
347type SurfaceHandler interface {
348	Destroy(self *Surface)
349	GetToplevel(self *Surface, id uint32)
350	GetPopup(self *Surface, id uint32, parent *Surface, positioner *Positioner)
351	SetWindowGeometry(self *Surface, x int32, y int32, width int32, height int32)
352	AckConfigure(self *Surface, serial uint32)
353}
354
355func NewSurface(c server.Client, version int32, id uint32, h SurfaceHandler) (*Surface, error) {
356	if h == nil {
357		return nil, fmt.Errorf("purego-libwayland: nil handler for xdg_surface")
358	}
359	var self *Surface
360	r, err := c.CreateResource(SurfaceInterface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
361		switch opcode {
362		case 0:
363			h.Destroy(self)
364			self.Destroy()
365		case 1:
366			h.GetToplevel(self, args[0].NewID())
367		case 2:
368			h.GetPopup(self, args[0].NewID(), WrapSurface(args[1].Resource()), WrapPositioner(args[2].Resource()))
369		case 3:
370			h.SetWindowGeometry(self, args[0].Int(), args[1].Int(), args[2].Int(), args[3].Int())
371		case 4:
372			h.AckConfigure(self, args[0].Uint())
373		}
374	})
375	if err != nil {
376		return nil, err
377	}
378	self = WrapSurface(r)
379	r.Data = self
380	return self, nil
381}
382
383// SendConfigure suggest a surface change.
384func (self *Surface) SendConfigure(serial uint32) {
385	self.PostEvent(SurfaceEventConfigure, server.Uint(serial))
386}
387func NewSurfaceGlobal(d *server.Display, version int32, bind server.BindFunc) error {
388	return d.CreateGlobal(SurfaceInterface, version, bind)
389}
390
391// Toplevel toplevel surface.
392type Toplevel struct{ *server.Resource }
393
394func WrapToplevel(r *server.Resource) *Toplevel {
395	if r == nil {
396		return nil
397	}
398	return &Toplevel{r}
399}
400
401const ToplevelRequestDestroy uint32 = 0
402const ToplevelRequestSetParent uint32 = 1
403const ToplevelRequestSetTitle uint32 = 2
404const ToplevelRequestSetAppId uint32 = 3
405const ToplevelRequestShowWindowMenu uint32 = 4
406const ToplevelRequestMove uint32 = 5
407const ToplevelRequestResize uint32 = 6
408const ToplevelRequestSetMaxSize uint32 = 7
409const ToplevelRequestSetMinSize uint32 = 8
410const ToplevelRequestSetMaximized uint32 = 9
411const ToplevelRequestUnsetMaximized uint32 = 10
412const ToplevelRequestSetFullscreen uint32 = 11
413const ToplevelRequestUnsetFullscreen uint32 = 12
414const ToplevelRequestSetMinimized uint32 = 13
415const ToplevelEventConfigure uint32 = 0
416const ToplevelEventClose uint32 = 1
417const ToplevelEventConfigureBounds uint32 = 2
418const ToplevelEventWmCapabilities uint32 = 3
419
420// ToplevelError .
421type ToplevelError uint32
422
423const (
424	ToplevelErrorInvalidResizeEdge ToplevelError = 0
425	ToplevelErrorInvalidParent     ToplevelError = 1
426	ToplevelErrorInvalidSize       ToplevelError = 2
427)
428
429// ToplevelResizeEdge edge values for resizing.
430type ToplevelResizeEdge uint32
431
432const (
433	ToplevelResizeEdgeNone        ToplevelResizeEdge = 0
434	ToplevelResizeEdgeTop         ToplevelResizeEdge = 1
435	ToplevelResizeEdgeBottom      ToplevelResizeEdge = 2
436	ToplevelResizeEdgeLeft        ToplevelResizeEdge = 4
437	ToplevelResizeEdgeTopLeft     ToplevelResizeEdge = 5
438	ToplevelResizeEdgeBottomLeft  ToplevelResizeEdge = 6
439	ToplevelResizeEdgeRight       ToplevelResizeEdge = 8
440	ToplevelResizeEdgeTopRight    ToplevelResizeEdge = 9
441	ToplevelResizeEdgeBottomRight ToplevelResizeEdge = 10
442)
443
444// ToplevelState types of state on the surface.
445type ToplevelState uint32
446
447const (
448	ToplevelStateMaximized         ToplevelState = 1
449	ToplevelStateFullscreen        ToplevelState = 2
450	ToplevelStateResizing          ToplevelState = 3
451	ToplevelStateActivated         ToplevelState = 4
452	ToplevelStateTiledLeft         ToplevelState = 5
453	ToplevelStateTiledRight        ToplevelState = 6
454	ToplevelStateTiledTop          ToplevelState = 7
455	ToplevelStateTiledBottom       ToplevelState = 8
456	ToplevelStateSuspended         ToplevelState = 9
457	ToplevelStateConstrainedLeft   ToplevelState = 10
458	ToplevelStateConstrainedRight  ToplevelState = 11
459	ToplevelStateConstrainedTop    ToplevelState = 12
460	ToplevelStateConstrainedBottom ToplevelState = 13
461)
462
463// ToplevelWmCapabilities .
464type ToplevelWmCapabilities uint32
465
466const (
467	ToplevelWmCapabilitiesWindowMenu ToplevelWmCapabilities = 1
468	ToplevelWmCapabilitiesMaximize   ToplevelWmCapabilities = 2
469	ToplevelWmCapabilitiesFullscreen ToplevelWmCapabilities = 3
470	ToplevelWmCapabilitiesMinimize   ToplevelWmCapabilities = 4
471)
472
473// ToplevelHandler handles xdg_toplevel requests.
474type ToplevelHandler interface {
475	Destroy(self *Toplevel)
476	SetParent(self *Toplevel, parent *Toplevel)
477	SetTitle(self *Toplevel, title string)
478	SetAppId(self *Toplevel, appId string)
479	ShowWindowMenu(self *Toplevel, seat *wayland.Seat, serial uint32, x int32, y int32)
480	Move(self *Toplevel, seat *wayland.Seat, serial uint32)
481	Resize(self *Toplevel, seat *wayland.Seat, serial uint32, edges uint32)
482	SetMaxSize(self *Toplevel, width int32, height int32)
483	SetMinSize(self *Toplevel, width int32, height int32)
484	SetMaximized(self *Toplevel)
485	UnsetMaximized(self *Toplevel)
486	SetFullscreen(self *Toplevel, output *wayland.Output)
487	UnsetFullscreen(self *Toplevel)
488	SetMinimized(self *Toplevel)
489}
490
491func NewToplevel(c server.Client, version int32, id uint32, h ToplevelHandler) (*Toplevel, error) {
492	if h == nil {
493		return nil, fmt.Errorf("purego-libwayland: nil handler for xdg_toplevel")
494	}
495	var self *Toplevel
496	r, err := c.CreateResource(ToplevelInterface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
497		switch opcode {
498		case 0:
499			h.Destroy(self)
500			self.Destroy()
501		case 1:
502			h.SetParent(self, WrapToplevel(args[0].Resource()))
503		case 2:
504			h.SetTitle(self, args[0].String())
505		case 3:
506			h.SetAppId(self, args[0].String())
507		case 4:
508			h.ShowWindowMenu(self, wayland.WrapSeat(args[0].Resource()), args[1].Uint(), args[2].Int(), args[3].Int())
509		case 5:
510			h.Move(self, wayland.WrapSeat(args[0].Resource()), args[1].Uint())
511		case 6:
512			h.Resize(self, wayland.WrapSeat(args[0].Resource()), args[1].Uint(), args[2].Uint())
513		case 7:
514			h.SetMaxSize(self, args[0].Int(), args[1].Int())
515		case 8:
516			h.SetMinSize(self, args[0].Int(), args[1].Int())
517		case 9:
518			h.SetMaximized(self)
519		case 10:
520			h.UnsetMaximized(self)
521		case 11:
522			h.SetFullscreen(self, wayland.WrapOutput(args[0].Resource()))
523		case 12:
524			h.UnsetFullscreen(self)
525		case 13:
526			h.SetMinimized(self)
527		}
528	})
529	if err != nil {
530		return nil, err
531	}
532	self = WrapToplevel(r)
533	r.Data = self
534	return self, nil
535}
536
537// SendConfigure suggest a surface change.
538func (self *Toplevel) SendConfigure(width int32, height int32, states []byte) {
539	var p runtime.Pinner
540	defer p.Unpin()
541	self.PostEvent(ToplevelEventConfigure, server.Int(width), server.Int(height), server.Array(&p, states))
542}
543
544// SendClose surface wants to be closed.
545func (self *Toplevel) SendClose() {
546	self.PostEvent(ToplevelEventClose)
547}
548
549// SendConfigureBounds recommended window geometry bounds (since version 4).
550func (self *Toplevel) SendConfigureBounds(width int32, height int32) {
551	self.PostEvent(ToplevelEventConfigureBounds, server.Int(width), server.Int(height))
552}
553
554// SendWmCapabilities compositor capabilities (since version 5).
555func (self *Toplevel) SendWmCapabilities(capabilities []byte) {
556	var p runtime.Pinner
557	defer p.Unpin()
558	self.PostEvent(ToplevelEventWmCapabilities, server.Array(&p, capabilities))
559}
560func NewToplevelGlobal(d *server.Display, version int32, bind server.BindFunc) error {
561	return d.CreateGlobal(ToplevelInterface, version, bind)
562}
563
564// Popup short-lived, popup surfaces for menus.
565type Popup struct{ *server.Resource }
566
567func WrapPopup(r *server.Resource) *Popup {
568	if r == nil {
569		return nil
570	}
571	return &Popup{r}
572}
573
574const PopupRequestDestroy uint32 = 0
575const PopupRequestGrab uint32 = 1
576const PopupRequestReposition uint32 = 2
577const PopupEventConfigure uint32 = 0
578const PopupEventPopupDone uint32 = 1
579const PopupEventRepositioned uint32 = 2
580
581// PopupError .
582type PopupError uint32
583
584const (
585	PopupErrorInvalidGrab PopupError = 0
586)
587
588// PopupHandler handles xdg_popup requests.
589type PopupHandler interface {
590	Destroy(self *Popup)
591	Grab(self *Popup, seat *wayland.Seat, serial uint32)
592	Reposition(self *Popup, positioner *Positioner, token uint32)
593}
594
595func NewPopup(c server.Client, version int32, id uint32, h PopupHandler) (*Popup, error) {
596	if h == nil {
597		return nil, fmt.Errorf("purego-libwayland: nil handler for xdg_popup")
598	}
599	var self *Popup
600	r, err := c.CreateResource(PopupInterface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
601		switch opcode {
602		case 0:
603			h.Destroy(self)
604			self.Destroy()
605		case 1:
606			h.Grab(self, wayland.WrapSeat(args[0].Resource()), args[1].Uint())
607		case 2:
608			h.Reposition(self, WrapPositioner(args[0].Resource()), args[1].Uint())
609		}
610	})
611	if err != nil {
612		return nil, err
613	}
614	self = WrapPopup(r)
615	r.Data = self
616	return self, nil
617}
618
619// SendConfigure configure the popup surface.
620func (self *Popup) SendConfigure(x int32, y int32, width int32, height int32) {
621	self.PostEvent(PopupEventConfigure, server.Int(x), server.Int(y), server.Int(width), server.Int(height))
622}
623
624// SendPopupDone popup interaction is done.
625func (self *Popup) SendPopupDone() {
626	self.PostEvent(PopupEventPopupDone)
627}
628
629// SendRepositioned signal the completion of a repositioned request (since version 3).
630func (self *Popup) SendRepositioned(token uint32) {
631	self.PostEvent(PopupEventRepositioned, server.Uint(token))
632}
633func NewPopupGlobal(d *server.Display, version int32, bind server.BindFunc) error {
634	return d.CreateGlobal(PopupInterface, version, bind)
635}
636func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
637	if v == nil {
638		return nil
639	}
640	return v.GetResource()
641}
642func (self *WmBase) GetResource() *server.Resource {
643	if self == nil {
644		return nil
645	}
646	return self.Resource
647}
648func (self *Positioner) GetResource() *server.Resource {
649	if self == nil {
650		return nil
651	}
652	return self.Resource
653}
654func (self *Surface) GetResource() *server.Resource {
655	if self == nil {
656		return nil
657	}
658	return self.Resource
659}
660func (self *Toplevel) GetResource() *server.Resource {
661	if self == nil {
662		return nil
663	}
664	return self.Resource
665}
666func (self *Popup) GetResource() *server.Resource {
667	if self == nil {
668		return nil
669	}
670	return self.Resource
671}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 1

↑↓ moveenter openesc close