v0.2.1 c0399be

gtkgesturedrag.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 GestureDragClass struct {
17	_ structs.HostLayout
18}
19
20func (x *GestureDragClass) GoPointer() uintptr {
21	return uintptr(unsafe.Pointer(x))
22}
23
24// Recognizes drag gestures.
25//
26// The drag operation itself can be tracked throughout the
27// [signal@Gtk.GestureDrag::drag-begin],
28// [signal@Gtk.GestureDrag::drag-update] and
29// [signal@Gtk.GestureDrag::drag-end] signals, and the relevant
30// coordinates can be extracted through
31// [method@Gtk.GestureDrag.get_offset] and
32// [method@Gtk.GestureDrag.get_start_point].
33type GestureDrag struct {
34	GestureSingle
35}
36
37var xGestureDragGLibType func() types.GType
38
39func GestureDragGLibType() types.GType {
40	return xGestureDragGLibType()
41}
42
43func GestureDragNewFromInternalPtr(ptr uintptr) *GestureDrag {
44	cls := &GestureDrag{}
45	cls.Ptr = ptr
46	return cls
47}
48
49var xNewGestureDrag func() uintptr
50
51// Returns a newly created `GtkGesture` that recognizes drags.
52func NewGestureDrag() *GestureDrag {
53	var cls *GestureDrag
54
55	cret := xNewGestureDrag()
56
57	if cret == 0 {
58		return nil
59	}
60	cls = &GestureDrag{}
61	cls.Ptr = cret
62	return cls
63}
64
65var xGestureDragGetOffset func(uintptr, *float64, *float64) bool
66
67// Gets the offset from the start point.
68//
69// If the @gesture is active, this function returns %TRUE and
70// fills in @x and @y with the coordinates of the current point,
71// as an offset to the starting drag point.
72func (x *GestureDrag) GetOffset(XVar *float64, YVar *float64) bool {
73
74	cret := xGestureDragGetOffset(x.GoPointer(), XVar, YVar)
75	return cret
76}
77
78var xGestureDragGetStartPoint func(uintptr, *float64, *float64) bool
79
80// Gets the point where the drag started.
81//
82// If the @gesture is active, this function returns %TRUE
83// and fills in @x and @y with the drag start coordinates,
84// in widget-relative coordinates.
85func (x *GestureDrag) GetStartPoint(XVar *float64, YVar *float64) bool {
86
87	cret := xGestureDragGetStartPoint(x.GoPointer(), XVar, YVar)
88	return cret
89}
90
91func (c *GestureDrag) GoPointer() uintptr {
92	if c == nil {
93		return 0
94	}
95	return c.Ptr
96}
97
98func (c *GestureDrag) SetGoPointer(ptr uintptr) {
99	c.Ptr = ptr
100}
101
102// Emitted whenever dragging starts.
103func (x *GestureDrag) ConnectDragBegin(cb *func(GestureDrag, float64, float64)) uint {
104	cbPtr := uintptr(unsafe.Pointer(cb))
105	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
106		handlerID := gobject.SignalConnect(x.GoPointer(), "drag-begin", cbRefPtr)
107		glib.SaveHandlerMapping(handlerID, cbPtr)
108		return handlerID
109	}
110
111	fcb := func(clsPtr uintptr, StartXVarp float64, StartYVarp float64) {
112		fa := GestureDrag{}
113		fa.Ptr = clsPtr
114		cbFn := *cb
115
116		cbFn(fa, StartXVarp, StartYVarp)
117
118	}
119	cbRefPtr := purego.NewCallback(fcb)
120	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
121	handlerID := gobject.SignalConnect(x.GoPointer(), "drag-begin", cbRefPtr)
122	glib.SaveHandlerMapping(handlerID, cbPtr)
123	return handlerID
124}
125
126// Emitted whenever the dragging is finished.
127func (x *GestureDrag) ConnectDragEnd(cb *func(GestureDrag, float64, float64)) uint {
128	cbPtr := uintptr(unsafe.Pointer(cb))
129	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
130		handlerID := gobject.SignalConnect(x.GoPointer(), "drag-end", cbRefPtr)
131		glib.SaveHandlerMapping(handlerID, cbPtr)
132		return handlerID
133	}
134
135	fcb := func(clsPtr uintptr, OffsetXVarp float64, OffsetYVarp float64) {
136		fa := GestureDrag{}
137		fa.Ptr = clsPtr
138		cbFn := *cb
139
140		cbFn(fa, OffsetXVarp, OffsetYVarp)
141
142	}
143	cbRefPtr := purego.NewCallback(fcb)
144	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
145	handlerID := gobject.SignalConnect(x.GoPointer(), "drag-end", cbRefPtr)
146	glib.SaveHandlerMapping(handlerID, cbPtr)
147	return handlerID
148}
149
150// Emitted whenever the dragging point moves.
151func (x *GestureDrag) ConnectDragUpdate(cb *func(GestureDrag, float64, float64)) uint {
152	cbPtr := uintptr(unsafe.Pointer(cb))
153	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
154		handlerID := gobject.SignalConnect(x.GoPointer(), "drag-update", cbRefPtr)
155		glib.SaveHandlerMapping(handlerID, cbPtr)
156		return handlerID
157	}
158
159	fcb := func(clsPtr uintptr, OffsetXVarp float64, OffsetYVarp float64) {
160		fa := GestureDrag{}
161		fa.Ptr = clsPtr
162		cbFn := *cb
163
164		cbFn(fa, OffsetXVarp, OffsetYVarp)
165
166	}
167	cbRefPtr := purego.NewCallback(fcb)
168	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
169	handlerID := gobject.SignalConnect(x.GoPointer(), "drag-update", cbRefPtr)
170	glib.SaveHandlerMapping(handlerID, cbPtr)
171	return handlerID
172}
173
174func init() {
175	core.SetPackageName("GTK", "gtk4")
176	core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"})
177	var libs []uintptr
178	for _, libPath := range core.GetPaths("GTK") {
179		lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
180		if err != nil {
181			panic(err)
182		}
183		libs = append(libs, lib)
184	}
185
186	core.PuregoSafeRegister(&xGestureDragGLibType, libs, "gtk_gesture_drag_get_type")
187
188	core.PuregoSafeRegister(&xNewGestureDrag, libs, "gtk_gesture_drag_new")
189
190	core.PuregoSafeRegister(&xGestureDragGetOffset, libs, "gtk_gesture_drag_get_offset")
191	core.PuregoSafeRegister(&xGestureDragGetStartPoint, libs, "gtk_gesture_drag_get_start_point")
192
193}

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