v0.2.1 c0399be

gloadableicon.go RawHistoryFolder

1// Package gio was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package gio
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/types"
13)
14
15// Interface for icons that can be loaded as a stream.
16type LoadableIconIface struct {
17	_ structs.HostLayout
18
19	GIface uintptr
20
21	xLoad uintptr
22
23	xLoadAsync uintptr
24
25	xLoadFinish uintptr
26}
27
28func (x *LoadableIconIface) GoPointer() uintptr {
29	return uintptr(unsafe.Pointer(x))
30}
31
32// OverrideLoad sets the "load" callback function.
33// Loads an icon.
34func (x *LoadableIconIface) OverrideLoad(cb func(LoadableIcon, int, *string, *Cancellable) *InputStream) {
35	if cb == nil {
36		x.xLoad = 0
37	} else {
38		x.xLoad = purego.NewCallback(func(IconVarp uintptr, SizeVarp int, TypeVarp *string, CancellableVarp uintptr) uintptr {
39			ret := cb(&LoadableIconBase{Ptr: IconVarp}, SizeVarp, TypeVarp, CancellableNewFromInternalPtr(CancellableVarp))
40			if ret == nil {
41				return 0
42			}
43			return ret.GoPointer()
44		})
45	}
46}
47
48// GetLoad gets the "load" callback function.
49// Loads an icon.
50func (x *LoadableIconIface) GetLoad() func(LoadableIcon, int, *string, *Cancellable) *InputStream {
51	if x.xLoad == 0 {
52		return nil
53	}
54	var rawCallback func(IconVarp uintptr, SizeVarp int, TypeVarp *string, CancellableVarp uintptr) uintptr
55	purego.RegisterFunc(&rawCallback, x.xLoad)
56	return func(IconVar LoadableIcon, SizeVar int, TypeVar *string, CancellableVar *Cancellable) *InputStream {
57		rawRet := rawCallback(IconVar.GoPointer(), SizeVar, TypeVar, CancellableVar.GoPointer())
58		if rawRet == 0 {
59			return nil
60		}
61		ret := &InputStream{}
62		ret.Ptr = rawRet
63		return ret
64	}
65}
66
67// OverrideLoadAsync sets the "load_async" callback function.
68// Loads an icon asynchronously.
69func (x *LoadableIconIface) OverrideLoadAsync(cb func(LoadableIcon, int, *Cancellable, *AsyncReadyCallback, uintptr)) {
70	if cb == nil {
71		x.xLoadAsync = 0
72	} else {
73		x.xLoadAsync = purego.NewCallback(func(IconVarp uintptr, SizeVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) {
74			cb(&LoadableIconBase{Ptr: IconVarp}, SizeVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp)
75		})
76	}
77}
78
79// GetLoadAsync gets the "load_async" callback function.
80// Loads an icon asynchronously.
81func (x *LoadableIconIface) GetLoadAsync() func(LoadableIcon, int, *Cancellable, *AsyncReadyCallback, uintptr) {
82	if x.xLoadAsync == 0 {
83		return nil
84	}
85	var rawCallback func(IconVarp uintptr, SizeVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr)
86	purego.RegisterFunc(&rawCallback, x.xLoadAsync)
87	return func(IconVar LoadableIcon, SizeVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) {
88		rawCallback(IconVar.GoPointer(), SizeVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar)
89	}
90}
91
92// OverrideLoadFinish sets the "load_finish" callback function.
93// Finishes an asynchronous icon load.
94func (x *LoadableIconIface) OverrideLoadFinish(cb func(LoadableIcon, AsyncResult, *string) *InputStream) {
95	if cb == nil {
96		x.xLoadFinish = 0
97	} else {
98		x.xLoadFinish = purego.NewCallback(func(IconVarp uintptr, ResVarp uintptr, TypeVarp *string) uintptr {
99			ret := cb(&LoadableIconBase{Ptr: IconVarp}, &AsyncResultBase{Ptr: ResVarp}, TypeVarp)
100			if ret == nil {
101				return 0
102			}
103			return ret.GoPointer()
104		})
105	}
106}
107
108// GetLoadFinish gets the "load_finish" callback function.
109// Finishes an asynchronous icon load.
110func (x *LoadableIconIface) GetLoadFinish() func(LoadableIcon, AsyncResult, *string) *InputStream {
111	if x.xLoadFinish == 0 {
112		return nil
113	}
114	var rawCallback func(IconVarp uintptr, ResVarp uintptr, TypeVarp *string) uintptr
115	purego.RegisterFunc(&rawCallback, x.xLoadFinish)
116	return func(IconVar LoadableIcon, ResVar AsyncResult, TypeVar *string) *InputStream {
117		rawRet := rawCallback(IconVar.GoPointer(), ResVar.GoPointer(), TypeVar)
118		if rawRet == 0 {
119			return nil
120		}
121		ret := &InputStream{}
122		ret.Ptr = rawRet
123		return ret
124	}
125}
126
127// `GLoadableIcon` extends the [iface@Gio.Icon] interface and adds the ability
128// to load icons from streams.
129type LoadableIcon interface {
130	GoPointer() uintptr
131	SetGoPointer(uintptr)
132	Load(SizeVar int, TypeVar *string, CancellableVar *Cancellable) (*InputStream, error)
133	LoadAsync(SizeVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr)
134	LoadFinish(ResVar AsyncResult, TypeVar *string) (*InputStream, error)
135}
136
137var xLoadableIconGLibType func() types.GType
138
139func LoadableIconGLibType() types.GType {
140	return xLoadableIconGLibType()
141}
142
143type LoadableIconBase struct {
144	Ptr uintptr
145}
146
147func (x *LoadableIconBase) GoPointer() uintptr {
148	if x == nil {
149		return 0
150	}
151	return x.Ptr
152}
153
154func (x *LoadableIconBase) SetGoPointer(ptr uintptr) {
155	x.Ptr = ptr
156}
157
158// Loads a loadable icon. For the asynchronous version of this function,
159// see g_loadable_icon_load_async().
160func (x *LoadableIconBase) Load(SizeVar int, TypeVar *string, CancellableVar *Cancellable) (*InputStream, error) {
161	var cls *InputStream
162	var cerr *glib.Error
163
164	cret := XGLoadableIconLoad(x.GoPointer(), SizeVar, TypeVar, CancellableVar.GoPointer(), &cerr)
165
166	if cret == 0 {
167		return nil, cerr
168	}
169	cls = &InputStream{}
170	cls.Ptr = cret
171	if cerr == nil {
172		return cls, nil
173	}
174	return cls, cerr
175
176}
177
178// Loads an icon asynchronously. To finish this function, see
179// g_loadable_icon_load_finish(). For the synchronous, blocking
180// version of this function, see g_loadable_icon_load().
181func (x *LoadableIconBase) LoadAsync(SizeVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) {
182
183	XGLoadableIconLoadAsync(x.GoPointer(), SizeVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar)
184
185}
186
187// Finishes an asynchronous icon load started in g_loadable_icon_load_async().
188func (x *LoadableIconBase) LoadFinish(ResVar AsyncResult, TypeVar *string) (*InputStream, error) {
189	var cls *InputStream
190	var cerr *glib.Error
191
192	cret := XGLoadableIconLoadFinish(x.GoPointer(), ResVar.GoPointer(), TypeVar, &cerr)
193
194	if cret == 0 {
195		return nil, cerr
196	}
197	cls = &InputStream{}
198	cls.Ptr = cret
199	if cerr == nil {
200		return cls, nil
201	}
202	return cls, cerr
203
204}
205
206var XGLoadableIconLoad func(uintptr, int, *string, uintptr, **glib.Error) uintptr
207var XGLoadableIconLoadAsync func(uintptr, int, uintptr, uintptr, uintptr)
208var XGLoadableIconLoadFinish func(uintptr, uintptr, *string, **glib.Error) uintptr
209
210func init() {
211	core.SetPackageName("GIO", "gio-2.0")
212	core.SetSharedLibraries("GIO", []string{"libgio-2.0.so.0"})
213	var libs []uintptr
214	for _, libPath := range core.GetPaths("GIO") {
215		lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
216		if err != nil {
217			panic(err)
218		}
219		libs = append(libs, lib)
220	}
221
222	core.PuregoSafeRegister(&xLoadableIconGLibType, libs, "g_loadable_icon_get_type")
223
224	core.PuregoSafeRegister(&XGLoadableIconLoad, libs, "g_loadable_icon_load")
225	core.PuregoSafeRegister(&XGLoadableIconLoadAsync, libs, "g_loadable_icon_load_async")
226	core.PuregoSafeRegister(&XGLoadableIconLoadFinish, libs, "g_loadable_icon_load_finish")
227
228}

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