v0.2.1 c0399be

more.go RawHistoryFolder

1package gobject
2
3import (
4	"reflect"
5	"unsafe"
6
7	"github.com/bnema/puregotk/v4/glib"
8)
9
10type Ptr interface {
11	GoPointer() uintptr
12	SetGoPointer(uintptr)
13}
14
15func ConvertPtr(a interface{}) *uintptr {
16	if a == nil || (reflect.ValueOf(a).Kind() == reflect.Ptr && reflect.ValueOf(a).IsNil()) {
17		return nil
18	}
19	ptr := reflect.ValueOf(a).Elem()
20	v, ok := ptr.Interface().(Ptr)
21	if !ok {
22		panic("not valid")
23	}
24	g := v.GoPointer()
25	return &g
26}
27
28func IncreaseRef(a uintptr) {
29	xObjectRefSink(a)
30}
31
32func SignalConnect(a uintptr, b string, c uintptr) uint {
33	return xSignalConnectData(a, b, c, 0, 0, 0)
34}
35
36func (o Object) Cast(v Ptr) {
37	v.SetGoPointer(o.GoPointer())
38}
39
40func (o Object) ConnectSignal(signal string, cb *func()) uint {
41	cbPtr := uintptr(unsafe.Pointer(cb))
42	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
43		handlerID := SignalConnect(o.GoPointer(), signal, cbRefPtr)
44		glib.SaveHandlerMapping(handlerID, cbPtr)
45		return handlerID
46	}
47
48	cbRefPtr := glib.NewCallback(cb)
49	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
50	handlerID := SignalConnect(o.GoPointer(), signal, cbRefPtr)
51	glib.SaveHandlerMapping(handlerID, cbPtr)
52	return handlerID
53}
54
55func (o Object) DisconnectSignal(handler uint) {
56	SignalHandlerDisconnect(&o, handler)
57	glib.RemoveCallbackByHandler(handler)
58}
59
60// types
61const (
62	TypeInvalidVal           Type = 0
63	TypeNoneVal                   = 1 << 2
64	TypeInterfaceVal              = 2 << 2
65	TypeCharVal                   = 3 << 2
66	TypeUcharVal                  = 4 << 2
67	TypeBooleanVal                = 5 << 2
68	TypeIntVal                    = 6 << 2
69	TypeUintVal                   = 7 << 2
70	TypeLongVal                   = 8 << 2
71	TypeUlongVal                  = 9 << 2
72	TypeInt64Val                  = 10 << 2
73	TypeUint64Val                 = 11 << 2
74	TypeEnumVal                   = 12 << 2
75	TypeFlagsVal                  = 13 << 2
76	TypeFloatVal                  = 14 << 2
77	TypeDoubleVal                 = 15 << 2
78	TypeStringVal                 = 16 << 2
79	TypePointerVal                = 17 << 2
80	TypeBoxedVal                  = 18 << 2
81	TypeParamVal                  = 19 << 2
82	TypeObjectVal                 = 20 << 2
83	TypeReservedGLibLastVal       = 31 << 2
84	TypeReservedBseFirstVal       = 32 << 2
85	TypeReservedBseLastVal        = 48 << 2
86	TypeReservedUserFirstVal      = 49 << 2
87)

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