main 5004296

textinput_generated.go RawHistoryFolder

1// Code generated by wlbgen; DO NOT EDIT.
2
3// Upstream protocol copyright and license:
4// Copyright © 2012, 2013 Intel Corporation
5// Copyright © 2015, 2016 Jan Arne Petersen
6// Copyright © 2017, 2018 Red Hat, Inc.
7// Copyright © 2018       Purism SPC
8//
9// Permission to use, copy, modify, distribute, and sell this
10// software and its documentation for any purpose is hereby granted
11// without fee, provided that the above copyright notice appear in
12// all copies and that both that copyright notice and this permission
13// notice appear in supporting documentation, and that the name of
14// the copyright holders not be used in advertising or publicity
15// pertaining to distribution of the software without specific,
16// written prior permission.  The copyright holders make no
17// representations about the suitability of this software for any
18// purpose.  It is provided "as is" without express or implied
19// warranty.
20//
21// THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
22// SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
23// FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
24// SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
25// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
26// AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
27// ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
28// THIS SOFTWARE.
29
30package textinput
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 ZwpTextInputV3Interface *server.Interface
40var ZwpTextInputManagerV3Interface *server.Interface
41
42func init() {
43	ZwpTextInputV3Interface = &server.Interface{Name: "zwp_text_input_v3", Version: 2}
44	ZwpTextInputManagerV3Interface = &server.Interface{Name: "zwp_text_input_manager_v3", Version: 2}
45	ZwpTextInputV3Interface.Requests = []server.Message{
46		{Name: "destroy", Signature: "", Types: []*server.Interface{}},
47		{Name: "enable", Signature: "", Types: []*server.Interface{}},
48		{Name: "disable", Signature: "", Types: []*server.Interface{}},
49		{Name: "set_surrounding_text", Signature: "sii", Types: []*server.Interface{nil, nil, nil}},
50		{Name: "set_text_change_cause", Signature: "u", Types: []*server.Interface{nil}},
51		{Name: "set_content_type", Signature: "uu", Types: []*server.Interface{nil, nil}},
52		{Name: "set_cursor_rectangle", Signature: "iiii", Types: []*server.Interface{nil, nil, nil, nil}},
53		{Name: "commit", Signature: "", Types: []*server.Interface{}},
54		{Name: "set_available_actions", Signature: "2a", Types: []*server.Interface{nil}},
55		{Name: "show_input_panel", Signature: "2", Types: []*server.Interface{}},
56		{Name: "hide_input_panel", Signature: "2", Types: []*server.Interface{}},
57	}
58	ZwpTextInputV3Interface.Events = []server.Message{
59		{Name: "enter", Signature: "o", Types: []*server.Interface{wayland.SurfaceInterface}},
60		{Name: "leave", Signature: "o", Types: []*server.Interface{wayland.SurfaceInterface}},
61		{Name: "preedit_string", Signature: "?sii", Types: []*server.Interface{nil, nil, nil}},
62		{Name: "commit_string", Signature: "?s", Types: []*server.Interface{nil}},
63		{Name: "delete_surrounding_text", Signature: "uu", Types: []*server.Interface{nil, nil}},
64		{Name: "done", Signature: "u", Types: []*server.Interface{nil}},
65		{Name: "action", Signature: "2uu", Types: []*server.Interface{nil, nil}},
66		{Name: "language", Signature: "2s", Types: []*server.Interface{nil}},
67		{Name: "preedit_hint", Signature: "2uuu", Types: []*server.Interface{nil, nil, nil}},
68	}
69	ZwpTextInputManagerV3Interface.Requests = []server.Message{
70		{Name: "destroy", Signature: "", Types: []*server.Interface{}},
71		{Name: "get_text_input", Signature: "no", Types: []*server.Interface{ZwpTextInputV3Interface, wayland.SeatInterface}},
72	}
73	ZwpTextInputManagerV3Interface.Events = []server.Message{}
74	if err := server.NewInterfaces(ZwpTextInputV3Interface, ZwpTextInputManagerV3Interface); err != nil {
75		panic(err)
76	}
77}
78
79// ZwpTextInputV3 text input.
80type ZwpTextInputV3 struct{ *server.Resource }
81
82func WrapZwpTextInputV3(r *server.Resource) *ZwpTextInputV3 {
83	if r == nil {
84		return nil
85	}
86	return &ZwpTextInputV3{r}
87}
88
89const ZwpTextInputV3RequestDestroy uint32 = 0
90const ZwpTextInputV3RequestEnable uint32 = 1
91const ZwpTextInputV3RequestDisable uint32 = 2
92const ZwpTextInputV3RequestSetSurroundingText uint32 = 3
93const ZwpTextInputV3RequestSetTextChangeCause uint32 = 4
94const ZwpTextInputV3RequestSetContentType uint32 = 5
95const ZwpTextInputV3RequestSetCursorRectangle uint32 = 6
96const ZwpTextInputV3RequestCommit uint32 = 7
97const ZwpTextInputV3RequestSetAvailableActions uint32 = 8
98const ZwpTextInputV3RequestShowInputPanel uint32 = 9
99const ZwpTextInputV3RequestHideInputPanel uint32 = 10
100const ZwpTextInputV3EventEnter uint32 = 0
101const ZwpTextInputV3EventLeave uint32 = 1
102const ZwpTextInputV3EventPreeditString uint32 = 2
103const ZwpTextInputV3EventCommitString uint32 = 3
104const ZwpTextInputV3EventDeleteSurroundingText uint32 = 4
105const ZwpTextInputV3EventDone uint32 = 5
106const ZwpTextInputV3EventAction uint32 = 6
107const ZwpTextInputV3EventLanguage uint32 = 7
108const ZwpTextInputV3EventPreeditHint uint32 = 8
109
110// ZwpTextInputV3ChangeCause text change reason.
111type ZwpTextInputV3ChangeCause uint32
112
113const (
114	ZwpTextInputV3ChangeCauseInputMethod ZwpTextInputV3ChangeCause = 0
115	ZwpTextInputV3ChangeCauseOther       ZwpTextInputV3ChangeCause = 1
116)
117
118// ZwpTextInputV3ContentHint content hint (bitfield).
119type ZwpTextInputV3ContentHint uint32
120
121const (
122	ZwpTextInputV3ContentHintNone                  ZwpTextInputV3ContentHint = 0x0
123	ZwpTextInputV3ContentHintCompletion            ZwpTextInputV3ContentHint = 0x1
124	ZwpTextInputV3ContentHintSpellcheck            ZwpTextInputV3ContentHint = 0x2
125	ZwpTextInputV3ContentHintAutoCapitalization    ZwpTextInputV3ContentHint = 0x4
126	ZwpTextInputV3ContentHintLowercase             ZwpTextInputV3ContentHint = 0x8
127	ZwpTextInputV3ContentHintUppercase             ZwpTextInputV3ContentHint = 0x10
128	ZwpTextInputV3ContentHintTitlecase             ZwpTextInputV3ContentHint = 0x20
129	ZwpTextInputV3ContentHintHiddenText            ZwpTextInputV3ContentHint = 0x40
130	ZwpTextInputV3ContentHintSensitiveData         ZwpTextInputV3ContentHint = 0x80
131	ZwpTextInputV3ContentHintLatin                 ZwpTextInputV3ContentHint = 0x100
132	ZwpTextInputV3ContentHintMultiline             ZwpTextInputV3ContentHint = 0x200
133	ZwpTextInputV3ContentHintOnScreenInputProvided ZwpTextInputV3ContentHint = 0x400
134	ZwpTextInputV3ContentHintNoEmoji               ZwpTextInputV3ContentHint = 0x800
135	ZwpTextInputV3ContentHintPreeditShown          ZwpTextInputV3ContentHint = 0x1000
136)
137
138// ZwpTextInputV3ContentPurpose content purpose.
139type ZwpTextInputV3ContentPurpose uint32
140
141const (
142	ZwpTextInputV3ContentPurposeNormal   ZwpTextInputV3ContentPurpose = 0
143	ZwpTextInputV3ContentPurposeAlpha    ZwpTextInputV3ContentPurpose = 1
144	ZwpTextInputV3ContentPurposeDigits   ZwpTextInputV3ContentPurpose = 2
145	ZwpTextInputV3ContentPurposeNumber   ZwpTextInputV3ContentPurpose = 3
146	ZwpTextInputV3ContentPurposePhone    ZwpTextInputV3ContentPurpose = 4
147	ZwpTextInputV3ContentPurposeUrl      ZwpTextInputV3ContentPurpose = 5
148	ZwpTextInputV3ContentPurposeEmail    ZwpTextInputV3ContentPurpose = 6
149	ZwpTextInputV3ContentPurposeName     ZwpTextInputV3ContentPurpose = 7
150	ZwpTextInputV3ContentPurposePassword ZwpTextInputV3ContentPurpose = 8
151	ZwpTextInputV3ContentPurposePin      ZwpTextInputV3ContentPurpose = 9
152	ZwpTextInputV3ContentPurposeDate     ZwpTextInputV3ContentPurpose = 10
153	ZwpTextInputV3ContentPurposeTime     ZwpTextInputV3ContentPurpose = 11
154	ZwpTextInputV3ContentPurposeDatetime ZwpTextInputV3ContentPurpose = 12
155	ZwpTextInputV3ContentPurposeTerminal ZwpTextInputV3ContentPurpose = 13
156)
157
158// ZwpTextInputV3Error .
159type ZwpTextInputV3Error uint32
160
161const (
162	ZwpTextInputV3ErrorInvalidAction ZwpTextInputV3Error = 0
163)
164
165// ZwpTextInputV3Action action.
166type ZwpTextInputV3Action uint32
167
168const (
169	ZwpTextInputV3ActionNone   ZwpTextInputV3Action = 0
170	ZwpTextInputV3ActionSubmit ZwpTextInputV3Action = 1
171)
172
173// ZwpTextInputV3PreeditHint preedit style hint.
174type ZwpTextInputV3PreeditHint uint32
175
176const (
177	ZwpTextInputV3PreeditHintWhole         ZwpTextInputV3PreeditHint = 1
178	ZwpTextInputV3PreeditHintSelection     ZwpTextInputV3PreeditHint = 2
179	ZwpTextInputV3PreeditHintPrediction    ZwpTextInputV3PreeditHint = 3
180	ZwpTextInputV3PreeditHintPrefix        ZwpTextInputV3PreeditHint = 4
181	ZwpTextInputV3PreeditHintSuffix        ZwpTextInputV3PreeditHint = 5
182	ZwpTextInputV3PreeditHintSpellingError ZwpTextInputV3PreeditHint = 6
183	ZwpTextInputV3PreeditHintComposeError  ZwpTextInputV3PreeditHint = 7
184)
185
186// ZwpTextInputV3Handler handles zwp_text_input_v3 requests.
187type ZwpTextInputV3Handler interface {
188	Destroy(self *ZwpTextInputV3)
189	Enable(self *ZwpTextInputV3)
190	Disable(self *ZwpTextInputV3)
191	SetSurroundingText(self *ZwpTextInputV3, text string, cursor int32, anchor int32)
192	SetTextChangeCause(self *ZwpTextInputV3, cause uint32)
193	SetContentType(self *ZwpTextInputV3, hint uint32, purpose uint32)
194	SetCursorRectangle(self *ZwpTextInputV3, x int32, y int32, width int32, height int32)
195	Commit(self *ZwpTextInputV3)
196	SetAvailableActions(self *ZwpTextInputV3, availableActions []byte)
197	ShowInputPanel(self *ZwpTextInputV3)
198	HideInputPanel(self *ZwpTextInputV3)
199}
200
201func NewZwpTextInputV3(c server.Client, version int32, id uint32, h ZwpTextInputV3Handler) (*ZwpTextInputV3, error) {
202	if h == nil {
203		return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_text_input_v3")
204	}
205	var self *ZwpTextInputV3
206	r, err := c.CreateResource(ZwpTextInputV3Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
207		switch opcode {
208		case 0:
209			h.Destroy(self)
210			self.Destroy()
211		case 1:
212			h.Enable(self)
213		case 2:
214			h.Disable(self)
215		case 3:
216			h.SetSurroundingText(self, args[0].String(), args[1].Int(), args[2].Int())
217		case 4:
218			h.SetTextChangeCause(self, args[0].Uint())
219		case 5:
220			h.SetContentType(self, args[0].Uint(), args[1].Uint())
221		case 6:
222			h.SetCursorRectangle(self, args[0].Int(), args[1].Int(), args[2].Int(), args[3].Int())
223		case 7:
224			h.Commit(self)
225		case 8:
226			h.SetAvailableActions(self, args[0].Array())
227		case 9:
228			h.ShowInputPanel(self)
229		case 10:
230			h.HideInputPanel(self)
231		}
232	})
233	if err != nil {
234		return nil, err
235	}
236	self = WrapZwpTextInputV3(r)
237	r.Data = self
238	return self, nil
239}
240
241// SendEnter enter event.
242func (self *ZwpTextInputV3) SendEnter(surface *wayland.Surface) {
243	self.PostEvent(ZwpTextInputV3EventEnter, server.Object(resourceOf(surface)))
244}
245
246// SendLeave leave event.
247func (self *ZwpTextInputV3) SendLeave(surface *wayland.Surface) {
248	self.PostEvent(ZwpTextInputV3EventLeave, server.Object(resourceOf(surface)))
249}
250
251// SendPreeditString pre-edit.
252func (self *ZwpTextInputV3) SendPreeditString(text string, cursorBegin int32, cursorEnd int32) {
253	var p runtime.Pinner
254	defer p.Unpin()
255	self.PostEvent(ZwpTextInputV3EventPreeditString, server.String(&p, text, true), server.Int(cursorBegin), server.Int(cursorEnd))
256}
257
258// SendCommitString text commit.
259func (self *ZwpTextInputV3) SendCommitString(text string) {
260	var p runtime.Pinner
261	defer p.Unpin()
262	self.PostEvent(ZwpTextInputV3EventCommitString, server.String(&p, text, true))
263}
264
265// SendDeleteSurroundingText delete surrounding text.
266func (self *ZwpTextInputV3) SendDeleteSurroundingText(beforeLength uint32, afterLength uint32) {
267	self.PostEvent(ZwpTextInputV3EventDeleteSurroundingText, server.Uint(beforeLength), server.Uint(afterLength))
268}
269
270// SendDone apply changes.
271func (self *ZwpTextInputV3) SendDone(serial uint32) {
272	self.PostEvent(ZwpTextInputV3EventDone, server.Uint(serial))
273}
274
275// SendAction action performed (since version 2).
276func (self *ZwpTextInputV3) SendAction(action uint32, serial uint32) {
277	self.PostEvent(ZwpTextInputV3EventAction, server.Uint(action), server.Uint(serial))
278}
279
280// SendLanguage notify of language selection (since version 2).
281func (self *ZwpTextInputV3) SendLanguage(language string) {
282	var p runtime.Pinner
283	defer p.Unpin()
284	self.PostEvent(ZwpTextInputV3EventLanguage, server.String(&p, language, false))
285}
286
287// SendPreeditHint pre-edit (since version 2).
288func (self *ZwpTextInputV3) SendPreeditHint(start uint32, end uint32, hint uint32) {
289	self.PostEvent(ZwpTextInputV3EventPreeditHint, server.Uint(start), server.Uint(end), server.Uint(hint))
290}
291func NewZwpTextInputV3Global(d *server.Display, version int32, bind server.BindFunc) error {
292	return d.CreateGlobal(ZwpTextInputV3Interface, version, bind)
293}
294
295// ZwpTextInputManagerV3 text input manager.
296type ZwpTextInputManagerV3 struct{ *server.Resource }
297
298func WrapZwpTextInputManagerV3(r *server.Resource) *ZwpTextInputManagerV3 {
299	if r == nil {
300		return nil
301	}
302	return &ZwpTextInputManagerV3{r}
303}
304
305const ZwpTextInputManagerV3RequestDestroy uint32 = 0
306const ZwpTextInputManagerV3RequestGetTextInput uint32 = 1
307
308// ZwpTextInputManagerV3Handler handles zwp_text_input_manager_v3 requests.
309type ZwpTextInputManagerV3Handler interface {
310	Destroy(self *ZwpTextInputManagerV3)
311	GetTextInput(self *ZwpTextInputManagerV3, id uint32, seat *wayland.Seat)
312}
313
314func NewZwpTextInputManagerV3(c server.Client, version int32, id uint32, h ZwpTextInputManagerV3Handler) (*ZwpTextInputManagerV3, error) {
315	if h == nil {
316		return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_text_input_manager_v3")
317	}
318	var self *ZwpTextInputManagerV3
319	r, err := c.CreateResource(ZwpTextInputManagerV3Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
320		switch opcode {
321		case 0:
322			h.Destroy(self)
323			self.Destroy()
324		case 1:
325			h.GetTextInput(self, args[0].NewID(), wayland.WrapSeat(args[1].Resource()))
326		}
327	})
328	if err != nil {
329		return nil, err
330	}
331	self = WrapZwpTextInputManagerV3(r)
332	r.Data = self
333	return self, nil
334}
335func NewZwpTextInputManagerV3Global(d *server.Display, version int32, bind server.BindFunc) error {
336	return d.CreateGlobal(ZwpTextInputManagerV3Interface, version, bind)
337}
338func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
339	if v == nil {
340		return nil
341	}
342	return v.GetResource()
343}
344func (self *ZwpTextInputV3) GetResource() *server.Resource {
345	if self == nil {
346		return nil
347	}
348	return self.Resource
349}
350func (self *ZwpTextInputManagerV3) GetResource() *server.Resource {
351	if self == nil {
352		return nil
353	}
354	return self.Resource
355}

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