v0.2.1 c0399be

gtkshortcut.go RawHistoryFolder

1// Package gtk was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package gtk
3
4import (
5	"structs"
6	"unsafe"
7
8	"github.com/ebitengine/purego"
9
10	"github.com/bnema/puregotk/pkg/core"
11	"github.com/bnema/puregotk/v4/glib"
12	"github.com/bnema/puregotk/v4/gobject"
13	"github.com/bnema/puregotk/v4/gobject/types"
14)
15
16type ShortcutClass struct {
17	_ structs.HostLayout
18
19	ParentClass gobject.ObjectClass
20}
21
22func (x *ShortcutClass) GoPointer() uintptr {
23	return uintptr(unsafe.Pointer(x))
24}
25
26// Describes a keyboard shortcut.
27//
28// It contains a description of how to trigger the shortcut via a
29// [class@Gtk.ShortcutTrigger] and a way to activate the shortcut
30// on a widget via a [class@Gtk.ShortcutAction].
31//
32// The actual work is usually done via [class@Gtk.ShortcutController],
33// which decides if and when to activate a shortcut. Using that controller
34// directly however is rarely necessary as various higher level
35// convenience APIs exist on `GtkWidget`s that make it easier to use
36// shortcuts in GTK.
37//
38// `GtkShortcut` does provide functionality to make it easy for users
39// to work with shortcuts, either by providing informational strings
40// for display purposes or by allowing shortcuts to be configured.
41type Shortcut struct {
42	gobject.Object
43}
44
45var xShortcutGLibType func() types.GType
46
47func ShortcutGLibType() types.GType {
48	return xShortcutGLibType()
49}
50
51func ShortcutNewFromInternalPtr(ptr uintptr) *Shortcut {
52	cls := &Shortcut{}
53	cls.Ptr = ptr
54	return cls
55}
56
57var xNewShortcut func(uintptr, uintptr) uintptr
58
59// Creates a new `GtkShortcut` that is triggered by
60// @trigger and then activates @action.
61func NewShortcut(TriggerVar *ShortcutTrigger, ActionVar *ShortcutAction) *Shortcut {
62	var cls *Shortcut
63
64	cret := xNewShortcut(TriggerVar.GoPointer(), ActionVar.GoPointer())
65
66	if cret == 0 {
67		return nil
68	}
69	cls = &Shortcut{}
70	cls.Ptr = cret
71	return cls
72}
73
74var xNewShortcutWithArguments func(uintptr, uintptr, uintptr, ...interface{}) uintptr
75
76// Creates a new `GtkShortcut` that is triggered by @trigger and then activates
77// @action with arguments given by @format_string.
78func NewShortcutWithArguments(TriggerVar *ShortcutTrigger, ActionVar *ShortcutAction, FormatStringVar *string, varArgs ...interface{}) *Shortcut {
79	var cls *Shortcut
80
81	FormatStringVarPtr := core.GStrdupNullable(FormatStringVar)
82	defer core.GFreeNullable(FormatStringVarPtr)
83
84	cret := xNewShortcutWithArguments(TriggerVar.GoPointer(), ActionVar.GoPointer(), FormatStringVarPtr, varArgs...)
85
86	if cret == 0 {
87		return nil
88	}
89	cls = &Shortcut{}
90	cls.Ptr = cret
91	return cls
92}
93
94var xShortcutGetAction func(uintptr) uintptr
95
96// Gets the action that is activated by this shortcut.
97func (x *Shortcut) GetAction() *ShortcutAction {
98	var cls *ShortcutAction
99
100	cret := xShortcutGetAction(x.GoPointer())
101
102	if cret == 0 {
103		return nil
104	}
105	gobject.IncreaseRef(cret)
106	cls = &ShortcutAction{}
107	cls.Ptr = cret
108	return cls
109}
110
111var xShortcutGetArguments func(uintptr) *glib.Variant
112
113// Gets the arguments that are passed when activating the shortcut.
114func (x *Shortcut) GetArguments() *glib.Variant {
115
116	cret := xShortcutGetArguments(x.GoPointer())
117	return cret
118}
119
120var xShortcutGetTrigger func(uintptr) uintptr
121
122// Gets the trigger used to trigger @self.
123func (x *Shortcut) GetTrigger() *ShortcutTrigger {
124	var cls *ShortcutTrigger
125
126	cret := xShortcutGetTrigger(x.GoPointer())
127
128	if cret == 0 {
129		return nil
130	}
131	gobject.IncreaseRef(cret)
132	cls = &ShortcutTrigger{}
133	cls.Ptr = cret
134	return cls
135}
136
137var xShortcutSetAction func(uintptr, uintptr)
138
139// Sets the new action for @self to be @action.
140func (x *Shortcut) SetAction(ActionVar *ShortcutAction) {
141
142	xShortcutSetAction(x.GoPointer(), ActionVar.GoPointer())
143
144}
145
146var xShortcutSetArguments func(uintptr, *glib.Variant)
147
148// Sets the arguments to pass when activating the shortcut.
149func (x *Shortcut) SetArguments(ArgsVar *glib.Variant) {
150
151	xShortcutSetArguments(x.GoPointer(), ArgsVar)
152
153}
154
155var xShortcutSetTrigger func(uintptr, uintptr)
156
157// Sets the new trigger for @self to be @trigger.
158func (x *Shortcut) SetTrigger(TriggerVar *ShortcutTrigger) {
159
160	xShortcutSetTrigger(x.GoPointer(), TriggerVar.GoPointer())
161
162}
163
164func (c *Shortcut) GoPointer() uintptr {
165	if c == nil {
166		return 0
167	}
168	return c.Ptr
169}
170
171func (c *Shortcut) SetGoPointer(ptr uintptr) {
172	c.Ptr = ptr
173}
174
175// SetPropertyArguments sets the "arguments" property.
176// Arguments passed to activation.
177func (x *Shortcut) SetPropertyArguments(value uintptr) {
178	var v gobject.Value
179	v.Init(gobject.TypePointerVal)
180	v.SetPointer(value)
181	x.SetProperty("arguments", &v)
182}
183
184// GetPropertyArguments gets the "arguments" property.
185// Arguments passed to activation.
186func (x *Shortcut) GetPropertyArguments() uintptr {
187	var v gobject.Value
188	x.GetProperty("arguments", &v)
189	return v.GetPointer()
190}
191
192func init() {
193	core.SetPackageName("GTK", "gtk4")
194	core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"})
195	var libs []uintptr
196	for _, libPath := range core.GetPaths("GTK") {
197		lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
198		if err != nil {
199			panic(err)
200		}
201		libs = append(libs, lib)
202	}
203
204	core.PuregoSafeRegister(&xShortcutGLibType, libs, "gtk_shortcut_get_type")
205
206	core.PuregoSafeRegister(&xNewShortcut, libs, "gtk_shortcut_new")
207	core.PuregoSafeRegister(&xNewShortcutWithArguments, libs, "gtk_shortcut_new_with_arguments")
208
209	core.PuregoSafeRegister(&xShortcutGetAction, libs, "gtk_shortcut_get_action")
210	core.PuregoSafeRegister(&xShortcutGetArguments, libs, "gtk_shortcut_get_arguments")
211	core.PuregoSafeRegister(&xShortcutGetTrigger, libs, "gtk_shortcut_get_trigger")
212	core.PuregoSafeRegister(&xShortcutSetAction, libs, "gtk_shortcut_set_action")
213	core.PuregoSafeRegister(&xShortcutSetArguments, libs, "gtk_shortcut_set_arguments")
214	core.PuregoSafeRegister(&xShortcutSetTrigger, libs, "gtk_shortcut_set_trigger")
215
216}

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 102

↑↓ moveenter openesc close