v0.2.2 9100209

gdbuserror.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)
13
14// Struct used in [func@Gio.DBusError.register_error_domain].
15type DBusErrorEntry struct {
16	_ structs.HostLayout
17
18	ErrorCode int32
19
20	DbusErrorName uintptr
21}
22
23func (x *DBusErrorEntry) GoPointer() uintptr {
24	return uintptr(unsafe.Pointer(x))
25}
26
27var xDbusErrorEncodeGerror func(*glib.Error) string
28
29// Creates a D-Bus error name to use for @error.
30//
31// If @error matches a registered error (see
32// [func@Gio.DBusError.register_error]), the corresponding D-Bus error name
33// will be returned.
34//
35// Otherwise the a name of the form
36// `org.gtk.GDBus.UnmappedGError.Quark._ESCAPED_QUARK_NAME.Code_ERROR_CODE`
37// will be used. This allows other GDBus applications to map the error
38// on the wire back to a [type@GLib.Error] using
39// [func@Gio.DBusError.new_for_dbus_error].
40//
41// This function is typically only used in object mappings to put a
42// [type@GLib.Error] on the wire. Regular applications should not use it.
43func DbusErrorEncodeGerror(ErrorVar *glib.Error) string {
44
45	cret := xDbusErrorEncodeGerror(ErrorVar)
46	return cret
47}
48
49var xDbusErrorGetRemoteError func(*glib.Error) string
50
51// Gets the D-Bus error name used for @error, if any.
52//
53// This function is guaranteed to return a D-Bus error name for all
54// [type@GLib.Error]s returned from functions handling remote method calls
55// (for example, [method@Gio.DBusConnection.call_finish]) unless
56// [func@Gio.DBusError.strip_remote_error] has already been used on @error.
57func DbusErrorGetRemoteError(ErrorVar *glib.Error) string {
58
59	cret := xDbusErrorGetRemoteError(ErrorVar)
60	return cret
61}
62
63var xDbusErrorIsRemoteError func(*glib.Error) bool
64
65// Checks if @error represents an error received via D-Bus from a remote peer.
66//
67// If so, use [func@Gio.DBusError.get_remote_error] to get the name of the error.
68func DbusErrorIsRemoteError(ErrorVar *glib.Error) bool {
69
70	cret := xDbusErrorIsRemoteError(ErrorVar)
71	return cret
72}
73
74var xDbusErrorNewForDbusError func(string, string) *glib.Error
75
76// Creates a [type@GLib.Error] based on the contents of @dbus_error_name and
77// @dbus_error_message.
78//
79// Errors registered with [func@Gio.DBusError.register_error] will be looked
80// up using @dbus_error_name and if a match is found, the error domain
81// and code is used. Applications can use [func@Gio.DBusError.get_remote_error]
82// to recover @dbus_error_name.
83//
84// If a match against a registered error is not found and the D-Bus
85// error name is in a form as returned by [func@Gio.DBusError.encode_gerror]
86// the error domain and code encoded in the name is used to
87// create the [type@GLib.Error]. Also, @dbus_error_name is added to the error
88// message such that it can be recovered with
89// [func@Gio.DBusError.get_remote_error].
90//
91// Otherwise, a [type@GLib.Error] with the error code
92// [error@Gio.IOErrorEnum.DBUS_ERROR]
93// in the [error@Gio.IOErrorEnum] error domain is returned. Also, @dbus_error_name is
94// added to the error message such that it can be recovered with
95// [func@Gio.DBusError.get_remote_error].
96//
97// In all three cases, @dbus_error_name can always be recovered from the
98// returned [type@GLib.Error] using the [func@Gio.DBusError.get_remote_error]
99// function (unless [func@Gio.DBusError.strip_remote_error] hasn’t been used on
100// the returned error).
101//
102// This function is typically only used in object mappings to prepare
103// [type@GLib.Error] instances for applications. Regular applications should not
104// use it.
105func DbusErrorNewForDbusError(DbusErrorNameVar string, DbusErrorMessageVar string) *glib.Error {
106
107	cret := xDbusErrorNewForDbusError(DbusErrorNameVar, DbusErrorMessageVar)
108	return cret
109}
110
111var xDbusErrorRegisterError func(glib.Quark, int, string) bool
112
113// Creates an association mapping between @dbus_error_name and
114// [type@GLib.Error]s specified by @error_domain and @error_code.
115//
116// This is typically done in the function that returns the [type@GLib.Quark] for
117// an error domain.
118func DbusErrorRegisterError(ErrorDomainVar glib.Quark, ErrorCodeVar int, DbusErrorNameVar string) bool {
119
120	cret := xDbusErrorRegisterError(ErrorDomainVar, ErrorCodeVar, DbusErrorNameVar)
121	return cret
122}
123
124var xDbusErrorRegisterErrorDomain func(string, uint, []DBusErrorEntry, uint)
125
126// Helper function for associating a [type@GLib.Error] error domain with D-Bus
127// error names.
128//
129// While @quark_volatile has a `volatile` qualifier, this is a historical
130// artifact and the argument passed to it should not be `volatile`.
131func DbusErrorRegisterErrorDomain(ErrorDomainQuarkNameVar string, QuarkVolatileVar uint, EntriesVar []DBusErrorEntry, NumEntriesVar uint) {
132
133	xDbusErrorRegisterErrorDomain(ErrorDomainQuarkNameVar, QuarkVolatileVar, EntriesVar, NumEntriesVar)
134
135}
136
137var xDbusErrorStripRemoteError func(*glib.Error) bool
138
139// Looks for extra information in the error message used to recover
140// the D-Bus error name and strips it if found.
141//
142// If stripped, the
143// message field in @error will correspond exactly to what was
144// received on the wire.
145//
146// This is typically used when presenting errors to the end user.
147func DbusErrorStripRemoteError(ErrorVar *glib.Error) bool {
148
149	cret := xDbusErrorStripRemoteError(ErrorVar)
150	return cret
151}
152
153var xDbusErrorUnregisterError func(glib.Quark, int, string) bool
154
155// Destroys an association previously set up with
156// [func@Gio.DBusError.register_error].
157func DbusErrorUnregisterError(ErrorDomainVar glib.Quark, ErrorCodeVar int, DbusErrorNameVar string) bool {
158
159	cret := xDbusErrorUnregisterError(ErrorDomainVar, ErrorCodeVar, DbusErrorNameVar)
160	return cret
161}
162
163func init() {
164	core.SetPackageName("GIO", "gio-2.0")
165	core.SetSharedLibraries("GIO", []string{"libgio-2.0.so.0"})
166	var libs []uintptr
167	for _, libPath := range core.GetPaths("GIO") {
168		lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
169		if err != nil {
170			panic(err)
171		}
172		libs = append(libs, lib)
173	}
174
175	core.PuregoSafeRegister(&xDbusErrorEncodeGerror, libs, "g_dbus_error_encode_gerror")
176	core.PuregoSafeRegister(&xDbusErrorGetRemoteError, libs, "g_dbus_error_get_remote_error")
177	core.PuregoSafeRegister(&xDbusErrorIsRemoteError, libs, "g_dbus_error_is_remote_error")
178	core.PuregoSafeRegister(&xDbusErrorNewForDbusError, libs, "g_dbus_error_new_for_dbus_error")
179	core.PuregoSafeRegister(&xDbusErrorRegisterError, libs, "g_dbus_error_register_error")
180	core.PuregoSafeRegister(&xDbusErrorRegisterErrorDomain, libs, "g_dbus_error_register_error_domain")
181	core.PuregoSafeRegister(&xDbusErrorStripRemoteError, libs, "g_dbus_error_strip_remote_error")
182	core.PuregoSafeRegister(&xDbusErrorUnregisterError, libs, "g_dbus_error_unregister_error")
183
184}

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