v0.2.1 c0399be

gtkgesturepan.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 GesturePanClass struct {
17	_ structs.HostLayout
18}
19
20func (x *GesturePanClass) GoPointer() uintptr {
21	return uintptr(unsafe.Pointer(x))
22}
23
24// Recognizes pan gestures.
25//
26// These are drags that are locked to happen along one axis. The axis
27// that a `GtkGesturePan` handles is defined at construct time, and
28// can be changed through [method@Gtk.GesturePan.set_orientation].
29//
30// When the gesture starts to be recognized, `GtkGesturePan` will
31// attempt to determine as early as possible whether the sequence
32// is moving in the expected direction, and denying the sequence if
33// this does not happen.
34//
35// Once a panning gesture along the expected axis is recognized,
36// the [signal@Gtk.GesturePan::pan] signal will be emitted as input
37// events are received, containing the offset in the given axis.
38type GesturePan struct {
39	GestureDrag
40}
41
42var xGesturePanGLibType func() types.GType
43
44func GesturePanGLibType() types.GType {
45	return xGesturePanGLibType()
46}
47
48func GesturePanNewFromInternalPtr(ptr uintptr) *GesturePan {
49	cls := &GesturePan{}
50	cls.Ptr = ptr
51	return cls
52}
53
54var xNewGesturePan func(Orientation) uintptr
55
56// Returns a newly created `GtkGesture` that recognizes pan gestures.
57func NewGesturePan(OrientationVar Orientation) *GesturePan {
58	var cls *GesturePan
59
60	cret := xNewGesturePan(OrientationVar)
61
62	if cret == 0 {
63		return nil
64	}
65	cls = &GesturePan{}
66	cls.Ptr = cret
67	return cls
68}
69
70var xGesturePanGetOrientation func(uintptr) Orientation
71
72// Returns the orientation of the pan gestures that this @gesture expects.
73func (x *GesturePan) GetOrientation() Orientation {
74
75	cret := xGesturePanGetOrientation(x.GoPointer())
76	return cret
77}
78
79var xGesturePanSetOrientation func(uintptr, Orientation)
80
81// Sets the orientation to be expected on pan gestures.
82func (x *GesturePan) SetOrientation(OrientationVar Orientation) {
83
84	xGesturePanSetOrientation(x.GoPointer(), OrientationVar)
85
86}
87
88func (c *GesturePan) GoPointer() uintptr {
89	if c == nil {
90		return 0
91	}
92	return c.Ptr
93}
94
95func (c *GesturePan) SetGoPointer(ptr uintptr) {
96	c.Ptr = ptr
97}
98
99// Emitted once a panning gesture along the expected axis is detected.
100func (x *GesturePan) ConnectPan(cb *func(GesturePan, PanDirection, float64)) uint {
101	cbPtr := uintptr(unsafe.Pointer(cb))
102	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
103		handlerID := gobject.SignalConnect(x.GoPointer(), "pan", cbRefPtr)
104		glib.SaveHandlerMapping(handlerID, cbPtr)
105		return handlerID
106	}
107
108	fcb := func(clsPtr uintptr, DirectionVarp PanDirection, OffsetVarp float64) {
109		fa := GesturePan{}
110		fa.Ptr = clsPtr
111		cbFn := *cb
112
113		cbFn(fa, DirectionVarp, OffsetVarp)
114
115	}
116	cbRefPtr := purego.NewCallback(fcb)
117	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
118	handlerID := gobject.SignalConnect(x.GoPointer(), "pan", cbRefPtr)
119	glib.SaveHandlerMapping(handlerID, cbPtr)
120	return handlerID
121}
122
123func init() {
124	core.SetPackageName("GTK", "gtk4")
125	core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"})
126	var libs []uintptr
127	for _, libPath := range core.GetPaths("GTK") {
128		lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
129		if err != nil {
130			panic(err)
131		}
132		libs = append(libs, lib)
133	}
134
135	core.PuregoSafeRegister(&xGesturePanGLibType, libs, "gtk_gesture_pan_get_type")
136
137	core.PuregoSafeRegister(&xNewGesturePan, libs, "gtk_gesture_pan_new")
138
139	core.PuregoSafeRegister(&xGesturePanGetOrientation, libs, "gtk_gesture_pan_get_orientation")
140	core.PuregoSafeRegister(&xGesturePanSetOrientation, libs, "gtk_gesture_pan_set_orientation")
141
142}

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