v0.2.1 c0399be

gtkgestureclick.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 GestureClickClass struct {
17	_ structs.HostLayout
18}
19
20func (x *GestureClickClass) GoPointer() uintptr {
21	return uintptr(unsafe.Pointer(x))
22}
23
24// Recognizes click gestures.
25//
26// It is able to recognize multiple clicks on a nearby zone, which
27// can be listened for through the [signal@Gtk.GestureClick::pressed]
28// signal. Whenever time or distance between clicks exceed the GTK
29// defaults, [signal@Gtk.GestureClick::stopped] is emitted, and the
30// click counter is reset.
31type GestureClick struct {
32	GestureSingle
33}
34
35var xGestureClickGLibType func() types.GType
36
37func GestureClickGLibType() types.GType {
38	return xGestureClickGLibType()
39}
40
41func GestureClickNewFromInternalPtr(ptr uintptr) *GestureClick {
42	cls := &GestureClick{}
43	cls.Ptr = ptr
44	return cls
45}
46
47var xNewGestureClick func() uintptr
48
49// Returns a newly created `GtkGesture` that recognizes
50// single and multiple presses.
51func NewGestureClick() *GestureClick {
52	var cls *GestureClick
53
54	cret := xNewGestureClick()
55
56	if cret == 0 {
57		return nil
58	}
59	cls = &GestureClick{}
60	cls.Ptr = cret
61	return cls
62}
63
64func (c *GestureClick) GoPointer() uintptr {
65	if c == nil {
66		return 0
67	}
68	return c.Ptr
69}
70
71func (c *GestureClick) SetGoPointer(ptr uintptr) {
72	c.Ptr = ptr
73}
74
75// Emitted whenever a button or touch press happens.
76func (x *GestureClick) ConnectPressed(cb *func(GestureClick, int, float64, float64)) uint {
77	cbPtr := uintptr(unsafe.Pointer(cb))
78	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
79		handlerID := gobject.SignalConnect(x.GoPointer(), "pressed", cbRefPtr)
80		glib.SaveHandlerMapping(handlerID, cbPtr)
81		return handlerID
82	}
83
84	fcb := func(clsPtr uintptr, NPressVarp int, XVarp float64, YVarp float64) {
85		fa := GestureClick{}
86		fa.Ptr = clsPtr
87		cbFn := *cb
88
89		cbFn(fa, NPressVarp, XVarp, YVarp)
90
91	}
92	cbRefPtr := purego.NewCallback(fcb)
93	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
94	handlerID := gobject.SignalConnect(x.GoPointer(), "pressed", cbRefPtr)
95	glib.SaveHandlerMapping(handlerID, cbPtr)
96	return handlerID
97}
98
99// Emitted when a button or touch is released.
100//
101// @n_press will report the number of press that is paired to
102// this event, note that [signal@Gtk.GestureClick::stopped] may
103// have been emitted between the press and its release, @n_press
104// will only start over at the next press.
105func (x *GestureClick) ConnectReleased(cb *func(GestureClick, int, float64, float64)) uint {
106	cbPtr := uintptr(unsafe.Pointer(cb))
107	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
108		handlerID := gobject.SignalConnect(x.GoPointer(), "released", cbRefPtr)
109		glib.SaveHandlerMapping(handlerID, cbPtr)
110		return handlerID
111	}
112
113	fcb := func(clsPtr uintptr, NPressVarp int, XVarp float64, YVarp float64) {
114		fa := GestureClick{}
115		fa.Ptr = clsPtr
116		cbFn := *cb
117
118		cbFn(fa, NPressVarp, XVarp, YVarp)
119
120	}
121	cbRefPtr := purego.NewCallback(fcb)
122	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
123	handlerID := gobject.SignalConnect(x.GoPointer(), "released", cbRefPtr)
124	glib.SaveHandlerMapping(handlerID, cbPtr)
125	return handlerID
126}
127
128// Emitted whenever any time/distance threshold has been exceeded.
129func (x *GestureClick) ConnectStopped(cb *func(GestureClick)) uint {
130	cbPtr := uintptr(unsafe.Pointer(cb))
131	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
132		handlerID := gobject.SignalConnect(x.GoPointer(), "stopped", cbRefPtr)
133		glib.SaveHandlerMapping(handlerID, cbPtr)
134		return handlerID
135	}
136
137	fcb := func(clsPtr uintptr) {
138		fa := GestureClick{}
139		fa.Ptr = clsPtr
140		cbFn := *cb
141
142		cbFn(fa)
143
144	}
145	cbRefPtr := purego.NewCallback(fcb)
146	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
147	handlerID := gobject.SignalConnect(x.GoPointer(), "stopped", cbRefPtr)
148	glib.SaveHandlerMapping(handlerID, cbPtr)
149	return handlerID
150}
151
152// Emitted whenever the gesture receives a release
153// event that had no previous corresponding press.
154//
155// Due to implicit grabs, this can only happen on situations
156// where input is grabbed elsewhere mid-press or the pressed
157// widget voluntarily relinquishes its implicit grab.
158func (x *GestureClick) ConnectUnpairedRelease(cb *func(GestureClick, float64, float64, uint, uintptr)) uint {
159	cbPtr := uintptr(unsafe.Pointer(cb))
160	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
161		handlerID := gobject.SignalConnect(x.GoPointer(), "unpaired-release", cbRefPtr)
162		glib.SaveHandlerMapping(handlerID, cbPtr)
163		return handlerID
164	}
165
166	fcb := func(clsPtr uintptr, XVarp float64, YVarp float64, ButtonVarp uint, SequenceVarp uintptr) {
167		fa := GestureClick{}
168		fa.Ptr = clsPtr
169		cbFn := *cb
170
171		cbFn(fa, XVarp, YVarp, ButtonVarp, SequenceVarp)
172
173	}
174	cbRefPtr := purego.NewCallback(fcb)
175	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
176	handlerID := gobject.SignalConnect(x.GoPointer(), "unpaired-release", cbRefPtr)
177	glib.SaveHandlerMapping(handlerID, cbPtr)
178	return handlerID
179}
180
181func init() {
182	core.SetPackageName("GTK", "gtk4")
183	core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"})
184	var libs []uintptr
185	for _, libPath := range core.GetPaths("GTK") {
186		lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
187		if err != nil {
188			panic(err)
189		}
190		libs = append(libs, lib)
191	}
192
193	core.PuregoSafeRegister(&xGestureClickGLibType, libs, "gtk_gesture_click_get_type")
194
195	core.PuregoSafeRegister(&xNewGestureClick, libs, "gtk_gesture_click_new")
196
197}

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