v0.2.1 c0399be

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

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