v0.2.1 c0399be

gboxed.go RawHistoryFolder

1// Package gobject was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package gobject
3
4import (
5	"unsafe"
6
7	"github.com/ebitengine/purego"
8
9	"github.com/bnema/puregotk/pkg/core"
10	"github.com/bnema/puregotk/v4/glib"
11	"github.com/bnema/puregotk/v4/gobject/types"
12)
13
14// This function is provided by the user and should produce a copy
15// of the passed in boxed structure.
16type BoxedCopyFunc func(uintptr) uintptr
17
18// This function is provided by the user and should free the boxed
19// structure passed.
20type BoxedFreeFunc func(uintptr)
21
22var xBoxedCopy func(types.GType, uintptr) uintptr
23
24// Provide a copy of a boxed structure @src_boxed which is of type @boxed_type.
25func BoxedCopy(BoxedTypeVar types.GType, SrcBoxedVar uintptr) uintptr {
26
27	cret := xBoxedCopy(BoxedTypeVar, SrcBoxedVar)
28	return cret
29}
30
31var xBoxedFree func(types.GType, uintptr)
32
33// Free the boxed structure @boxed which is of type @boxed_type.
34func BoxedFree(BoxedTypeVar types.GType, BoxedVar uintptr) {
35
36	xBoxedFree(BoxedTypeVar, BoxedVar)
37
38}
39
40var xBoxedTypeRegisterStatic func(string, uintptr, uintptr) types.GType
41
42// This function creates a new %G_TYPE_BOXED derived type id for a new
43// boxed type with name @name.
44//
45// Boxed type handling functions have to be provided to copy and free
46// opaque boxed structures of this type.
47//
48// For the general case, it is recommended to use G_DEFINE_BOXED_TYPE()
49// instead of calling g_boxed_type_register_static() directly. The macro
50// will create the appropriate `*_get_type()` function for the boxed type.
51func BoxedTypeRegisterStatic(NameVar string, BoxedCopyVar *BoxedCopyFunc, BoxedFreeVar *BoxedFreeFunc) types.GType {
52
53	var BoxedCopyVarRef uintptr
54	if BoxedCopyVar != nil {
55		BoxedCopyVarPtr := uintptr(unsafe.Pointer(BoxedCopyVar))
56		if cbRefPtr, ok := glib.GetCallback(BoxedCopyVarPtr); ok {
57			BoxedCopyVarRef = cbRefPtr
58		} else {
59			fcb := func(arg0 uintptr) uintptr {
60				cbFn := *BoxedCopyVar
61				return cbFn(arg0)
62			}
63			BoxedCopyVarRef = purego.NewCallback(fcb)
64			glib.SaveCallbackWithClosure(BoxedCopyVarPtr, BoxedCopyVarRef, BoxedCopyVar)
65		}
66	}
67
68	var BoxedFreeVarRef uintptr
69	if BoxedFreeVar != nil {
70		BoxedFreeVarPtr := uintptr(unsafe.Pointer(BoxedFreeVar))
71		if cbRefPtr, ok := glib.GetCallback(BoxedFreeVarPtr); ok {
72			BoxedFreeVarRef = cbRefPtr
73		} else {
74			fcb := func(arg0 uintptr) {
75				cbFn := *BoxedFreeVar
76				cbFn(arg0)
77			}
78			BoxedFreeVarRef = purego.NewCallback(fcb)
79			glib.SaveCallbackWithClosure(BoxedFreeVarPtr, BoxedFreeVarRef, BoxedFreeVar)
80		}
81	}
82
83	cret := xBoxedTypeRegisterStatic(NameVar, BoxedCopyVarRef, BoxedFreeVarRef)
84	return cret
85}
86
87func init() {
88	core.SetPackageName("GOBJECT", "gobject-2.0")
89	core.SetSharedLibraries("GOBJECT", []string{"libgobject-2.0.so.0"})
90	var libs []uintptr
91	for _, libPath := range core.GetPaths("GOBJECT") {
92		lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
93		if err != nil {
94			panic(err)
95		}
96		libs = append(libs, lib)
97	}
98
99	core.PuregoSafeRegister(&xBoxedCopy, libs, "g_boxed_copy")
100	core.PuregoSafeRegister(&xBoxedFree, libs, "g_boxed_free")
101	core.PuregoSafeRegister(&xBoxedTypeRegisterStatic, libs, "g_boxed_type_register_static")
102
103}

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