v0.2.2 9100209

gunixcredentialsmessage.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/gobject"
12	"github.com/bnema/puregotk/v4/gobject/types"
13)
14
15// Class structure for #GUnixCredentialsMessage.
16type UnixCredentialsMessageClass struct {
17	_ structs.HostLayout
18
19	ParentClass SocketControlMessageClass
20
21	xGReserved1 uintptr
22
23	xGReserved2 uintptr
24}
25
26func (x *UnixCredentialsMessageClass) GoPointer() uintptr {
27	return uintptr(unsafe.Pointer(x))
28}
29
30// OverrideGReserved1 sets the "_g_reserved1" callback function.
31func (x *UnixCredentialsMessageClass) OverrideGReserved1(cb func()) {
32	if cb == nil {
33		x.xGReserved1 = 0
34	} else {
35		x.xGReserved1 = purego.NewCallback(func() {
36			cb()
37		})
38	}
39}
40
41// GetGReserved1 gets the "_g_reserved1" callback function.
42func (x *UnixCredentialsMessageClass) GetGReserved1() func() {
43	if x.xGReserved1 == 0 {
44		return nil
45	}
46	var rawCallback func()
47	purego.RegisterFunc(&rawCallback, x.xGReserved1)
48	return func() {
49		rawCallback()
50	}
51}
52
53// OverrideGReserved2 sets the "_g_reserved2" callback function.
54func (x *UnixCredentialsMessageClass) OverrideGReserved2(cb func()) {
55	if cb == nil {
56		x.xGReserved2 = 0
57	} else {
58		x.xGReserved2 = purego.NewCallback(func() {
59			cb()
60		})
61	}
62}
63
64// GetGReserved2 gets the "_g_reserved2" callback function.
65func (x *UnixCredentialsMessageClass) GetGReserved2() func() {
66	if x.xGReserved2 == 0 {
67		return nil
68	}
69	var rawCallback func()
70	purego.RegisterFunc(&rawCallback, x.xGReserved2)
71	return func() {
72		rawCallback()
73	}
74}
75
76type UnixCredentialsMessagePrivate struct {
77	_ structs.HostLayout
78}
79
80func (x *UnixCredentialsMessagePrivate) GoPointer() uintptr {
81	return uintptr(unsafe.Pointer(x))
82}
83
84// This [class@Gio.SocketControlMessage] contains a [class@Gio.Credentials]
85// instance.  It may be sent using [method@Gio.Socket.send_message] and received
86// using [method@Gio.Socket.receive_message] over UNIX sockets (ie: sockets in
87// the `G_SOCKET_FAMILY_UNIX` family).
88//
89// For an easier way to send and receive credentials over
90// stream-oriented UNIX sockets, see
91// [method@Gio.UnixConnection.send_credentials] and
92// [method@Gio.UnixConnection.receive_credentials]. To receive credentials of
93// a foreign process connected to a socket, use
94// [method@Gio.Socket.get_credentials].
95//
96// Since GLib 2.72, `GUnixCredentialMessage` is available on all platforms. It
97// requires underlying system support (such as Windows 10 with `AF_UNIX`) at run
98// time.
99//
100// Before GLib 2.72, `<gio/gunixcredentialsmessage.h>` belonged to the UNIX-specific
101// GIO interfaces, thus you had to use the `gio-unix-2.0.pc` pkg-config file
102// when using it. This is no longer necessary since GLib 2.72.
103type UnixCredentialsMessage struct {
104	SocketControlMessage
105}
106
107var xUnixCredentialsMessageGLibType func() types.GType
108
109func UnixCredentialsMessageGLibType() types.GType {
110	return xUnixCredentialsMessageGLibType()
111}
112
113func UnixCredentialsMessageNewFromInternalPtr(ptr uintptr) *UnixCredentialsMessage {
114	cls := &UnixCredentialsMessage{}
115	cls.Ptr = ptr
116	return cls
117}
118
119var xNewUnixCredentialsMessage func() uintptr
120
121// Creates a new #GUnixCredentialsMessage with credentials matching the current processes.
122func NewUnixCredentialsMessage() *UnixCredentialsMessage {
123	var cls *UnixCredentialsMessage
124
125	cret := xNewUnixCredentialsMessage()
126
127	if cret == 0 {
128		return nil
129	}
130	cls = &UnixCredentialsMessage{}
131	cls.Ptr = cret
132	return cls
133}
134
135var xNewUnixCredentialsMessageWithCredentials func(uintptr) uintptr
136
137// Creates a new #GUnixCredentialsMessage holding @credentials.
138func NewUnixCredentialsMessageWithCredentials(CredentialsVar *Credentials) *UnixCredentialsMessage {
139	var cls *UnixCredentialsMessage
140
141	cret := xNewUnixCredentialsMessageWithCredentials(CredentialsVar.GoPointer())
142
143	if cret == 0 {
144		return nil
145	}
146	cls = &UnixCredentialsMessage{}
147	cls.Ptr = cret
148	return cls
149}
150
151var xUnixCredentialsMessageGetCredentials func(uintptr) uintptr
152
153// Gets the credentials stored in @message.
154func (x *UnixCredentialsMessage) GetCredentials() *Credentials {
155	var cls *Credentials
156
157	cret := xUnixCredentialsMessageGetCredentials(x.GoPointer())
158
159	if cret == 0 {
160		return nil
161	}
162	gobject.IncreaseRef(cret)
163	cls = &Credentials{}
164	cls.Ptr = cret
165	return cls
166}
167
168func (c *UnixCredentialsMessage) GoPointer() uintptr {
169	if c == nil {
170		return 0
171	}
172	return c.Ptr
173}
174
175func (c *UnixCredentialsMessage) SetGoPointer(ptr uintptr) {
176	c.Ptr = ptr
177}
178
179var xUnixCredentialsMessageIsSupported func() bool
180
181// Checks if passing #GCredentials on a #GSocket is supported on this platform.
182func UnixCredentialsMessageIsSupported() bool {
183
184	cret := xUnixCredentialsMessageIsSupported()
185	return cret
186}
187
188func init() {
189	core.SetPackageName("GIO", "gio-2.0")
190	core.SetSharedLibraries("GIO", []string{"libgio-2.0.so.0"})
191	var libs []uintptr
192	for _, libPath := range core.GetPaths("GIO") {
193		lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
194		if err != nil {
195			panic(err)
196		}
197		libs = append(libs, lib)
198	}
199
200	core.PuregoSafeRegister(&xUnixCredentialsMessageGLibType, libs, "g_unix_credentials_message_get_type")
201
202	core.PuregoSafeRegister(&xNewUnixCredentialsMessage, libs, "g_unix_credentials_message_new")
203	core.PuregoSafeRegister(&xNewUnixCredentialsMessageWithCredentials, libs, "g_unix_credentials_message_new_with_credentials")
204
205	core.PuregoSafeRegister(&xUnixCredentialsMessageGetCredentials, libs, "g_unix_credentials_message_get_credentials")
206
207	core.PuregoSafeRegister(&xUnixCredentialsMessageIsSupported, libs, "g_unix_credentials_message_is_supported")
208
209}

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