v0.2.1 c0399be

gtkgesturelongpress.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 GestureLongPressClass struct {
17	_ structs.HostLayout
18}
19
20func (x *GestureLongPressClass) GoPointer() uintptr {
21	return uintptr(unsafe.Pointer(x))
22}
23
24// Recognizes long press gestures.
25//
26// This gesture is also known as “Press and Hold”.
27//
28// When the timeout is exceeded, the gesture is triggering the
29// [signal@Gtk.GestureLongPress::pressed] signal.
30//
31// If the touchpoint is lifted before the timeout passes, or if
32// it drifts too far of the initial press point, the
33// [signal@Gtk.GestureLongPress::cancelled] signal will be emitted.
34//
35// How long the timeout is before the ::pressed signal gets emitted is
36// determined by the [property@Gtk.Settings:gtk-long-press-time] setting.
37// It can be modified by the [property@Gtk.GestureLongPress:delay-factor]
38// property.
39type GestureLongPress struct {
40	GestureSingle
41}
42
43var xGestureLongPressGLibType func() types.GType
44
45func GestureLongPressGLibType() types.GType {
46	return xGestureLongPressGLibType()
47}
48
49func GestureLongPressNewFromInternalPtr(ptr uintptr) *GestureLongPress {
50	cls := &GestureLongPress{}
51	cls.Ptr = ptr
52	return cls
53}
54
55var xNewGestureLongPress func() uintptr
56
57// Returns a newly created `GtkGesture` that recognizes long presses.
58func NewGestureLongPress() *GestureLongPress {
59	var cls *GestureLongPress
60
61	cret := xNewGestureLongPress()
62
63	if cret == 0 {
64		return nil
65	}
66	cls = &GestureLongPress{}
67	cls.Ptr = cret
68	return cls
69}
70
71var xGestureLongPressGetDelayFactor func(uintptr) float64
72
73// Returns the delay factor.
74func (x *GestureLongPress) GetDelayFactor() float64 {
75
76	cret := xGestureLongPressGetDelayFactor(x.GoPointer())
77	return cret
78}
79
80var xGestureLongPressSetDelayFactor func(uintptr, float64)
81
82// Applies the given delay factor.
83//
84// The default long press time will be multiplied by this value.
85// Valid values are in the range [0.5..2.0].
86func (x *GestureLongPress) SetDelayFactor(DelayFactorVar float64) {
87
88	xGestureLongPressSetDelayFactor(x.GoPointer(), DelayFactorVar)
89
90}
91
92func (c *GestureLongPress) GoPointer() uintptr {
93	if c == nil {
94		return 0
95	}
96	return c.Ptr
97}
98
99func (c *GestureLongPress) SetGoPointer(ptr uintptr) {
100	c.Ptr = ptr
101}
102
103// SetPropertyDelayFactor sets the "delay-factor" property.
104// Factor by which to modify the default timeout.
105func (x *GestureLongPress) SetPropertyDelayFactor(value float64) {
106	var v gobject.Value
107	v.Init(gobject.TypeDoubleVal)
108	v.SetDouble(value)
109	x.SetProperty("delay-factor", &v)
110}
111
112// GetPropertyDelayFactor gets the "delay-factor" property.
113// Factor by which to modify the default timeout.
114func (x *GestureLongPress) GetPropertyDelayFactor() float64 {
115	var v gobject.Value
116	x.GetProperty("delay-factor", &v)
117	return v.GetDouble()
118}
119
120// Emitted whenever a press moved too far, or was released
121// before [signal@Gtk.GestureLongPress::pressed] happened.
122func (x *GestureLongPress) ConnectCancelled(cb *func(GestureLongPress)) uint {
123	cbPtr := uintptr(unsafe.Pointer(cb))
124	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
125		handlerID := gobject.SignalConnect(x.GoPointer(), "cancelled", cbRefPtr)
126		glib.SaveHandlerMapping(handlerID, cbPtr)
127		return handlerID
128	}
129
130	fcb := func(clsPtr uintptr) {
131		fa := GestureLongPress{}
132		fa.Ptr = clsPtr
133		cbFn := *cb
134
135		cbFn(fa)
136
137	}
138	cbRefPtr := purego.NewCallback(fcb)
139	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
140	handlerID := gobject.SignalConnect(x.GoPointer(), "cancelled", cbRefPtr)
141	glib.SaveHandlerMapping(handlerID, cbPtr)
142	return handlerID
143}
144
145// Emitted whenever a press goes unmoved/unreleased longer than
146// what the GTK defaults tell.
147func (x *GestureLongPress) ConnectPressed(cb *func(GestureLongPress, float64, float64)) uint {
148	cbPtr := uintptr(unsafe.Pointer(cb))
149	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
150		handlerID := gobject.SignalConnect(x.GoPointer(), "pressed", cbRefPtr)
151		glib.SaveHandlerMapping(handlerID, cbPtr)
152		return handlerID
153	}
154
155	fcb := func(clsPtr uintptr, XVarp float64, YVarp float64) {
156		fa := GestureLongPress{}
157		fa.Ptr = clsPtr
158		cbFn := *cb
159
160		cbFn(fa, XVarp, YVarp)
161
162	}
163	cbRefPtr := purego.NewCallback(fcb)
164	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
165	handlerID := gobject.SignalConnect(x.GoPointer(), "pressed", cbRefPtr)
166	glib.SaveHandlerMapping(handlerID, cbPtr)
167	return handlerID
168}
169
170func init() {
171	core.SetPackageName("GTK", "gtk4")
172	core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"})
173	var libs []uintptr
174	for _, libPath := range core.GetPaths("GTK") {
175		lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
176		if err != nil {
177			panic(err)
178		}
179		libs = append(libs, lib)
180	}
181
182	core.PuregoSafeRegister(&xGestureLongPressGLibType, libs, "gtk_gesture_long_press_get_type")
183
184	core.PuregoSafeRegister(&xNewGestureLongPress, libs, "gtk_gesture_long_press_new")
185
186	core.PuregoSafeRegister(&xGestureLongPressGetDelayFactor, libs, "gtk_gesture_long_press_get_delay_factor")
187	core.PuregoSafeRegister(&xGestureLongPressSetDelayFactor, libs, "gtk_gesture_long_press_set_delay_factor")
188
189}

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