v0.2.1 c0399be

gtkgesturerotate.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 GestureRotateClass struct {
17	_ structs.HostLayout
18}
19
20func (x *GestureRotateClass) GoPointer() uintptr {
21	return uintptr(unsafe.Pointer(x))
22}
23
24// Recognizes 2-finger rotation gestures.
25//
26// Whenever the angle between both handled sequences changes, the
27// [signal@Gtk.GestureRotate::angle-changed] signal is emitted.
28type GestureRotate struct {
29	Gesture
30}
31
32var xGestureRotateGLibType func() types.GType
33
34func GestureRotateGLibType() types.GType {
35	return xGestureRotateGLibType()
36}
37
38func GestureRotateNewFromInternalPtr(ptr uintptr) *GestureRotate {
39	cls := &GestureRotate{}
40	cls.Ptr = ptr
41	return cls
42}
43
44var xNewGestureRotate func() uintptr
45
46// Returns a newly created `GtkGesture` that recognizes 2-touch
47// rotation gestures.
48func NewGestureRotate() *GestureRotate {
49	var cls *GestureRotate
50
51	cret := xNewGestureRotate()
52
53	if cret == 0 {
54		return nil
55	}
56	cls = &GestureRotate{}
57	cls.Ptr = cret
58	return cls
59}
60
61var xGestureRotateGetAngleDelta func(uintptr) float64
62
63// Gets the angle delta in radians.
64//
65// If @gesture is active, this function returns the angle difference
66// in radians since the gesture was first recognized. If @gesture is
67// not active, 0 is returned.
68func (x *GestureRotate) GetAngleDelta() float64 {
69
70	cret := xGestureRotateGetAngleDelta(x.GoPointer())
71	return cret
72}
73
74func (c *GestureRotate) GoPointer() uintptr {
75	if c == nil {
76		return 0
77	}
78	return c.Ptr
79}
80
81func (c *GestureRotate) SetGoPointer(ptr uintptr) {
82	c.Ptr = ptr
83}
84
85// Emitted when the angle between both tracked points changes.
86func (x *GestureRotate) ConnectAngleChanged(cb *func(GestureRotate, float64, float64)) uint {
87	cbPtr := uintptr(unsafe.Pointer(cb))
88	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
89		handlerID := gobject.SignalConnect(x.GoPointer(), "angle-changed", cbRefPtr)
90		glib.SaveHandlerMapping(handlerID, cbPtr)
91		return handlerID
92	}
93
94	fcb := func(clsPtr uintptr, AngleVarp float64, AngleDeltaVarp float64) {
95		fa := GestureRotate{}
96		fa.Ptr = clsPtr
97		cbFn := *cb
98
99		cbFn(fa, AngleVarp, AngleDeltaVarp)
100
101	}
102	cbRefPtr := purego.NewCallback(fcb)
103	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
104	handlerID := gobject.SignalConnect(x.GoPointer(), "angle-changed", cbRefPtr)
105	glib.SaveHandlerMapping(handlerID, cbPtr)
106	return handlerID
107}
108
109func init() {
110	core.SetPackageName("GTK", "gtk4")
111	core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"})
112	var libs []uintptr
113	for _, libPath := range core.GetPaths("GTK") {
114		lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
115		if err != nil {
116			panic(err)
117		}
118		libs = append(libs, lib)
119	}
120
121	core.PuregoSafeRegister(&xGestureRotateGLibType, libs, "gtk_gesture_rotate_get_type")
122
123	core.PuregoSafeRegister(&xNewGestureRotate, libs, "gtk_gesture_rotate_new")
124
125	core.PuregoSafeRegister(&xGestureRotateGetAngleDelta, libs, "gtk_gesture_rotate_get_angle_delta")
126
127}

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