v0.2.1 c0399be

gsocketcontrolmessage.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 #GSocketControlMessage.
16type SocketControlMessageClass struct {
17	_ structs.HostLayout
18
19	ParentClass gobject.ObjectClass
20
21	xGetSize uintptr
22
23	xGetLevel uintptr
24
25	xGetType uintptr
26
27	xSerialize uintptr
28
29	xDeserialize uintptr
30
31	xGReserved1 uintptr
32
33	xGReserved2 uintptr
34
35	xGReserved3 uintptr
36
37	xGReserved4 uintptr
38
39	xGReserved5 uintptr
40}
41
42func (x *SocketControlMessageClass) GoPointer() uintptr {
43	return uintptr(unsafe.Pointer(x))
44}
45
46// OverrideGetSize sets the "get_size" callback function.
47// gets the size of the message.
48func (x *SocketControlMessageClass) OverrideGetSize(cb func(*SocketControlMessage) uint) {
49	if cb == nil {
50		x.xGetSize = 0
51	} else {
52		x.xGetSize = purego.NewCallback(func(MessageVarp uintptr) uint {
53			return cb(SocketControlMessageNewFromInternalPtr(MessageVarp))
54		})
55	}
56}
57
58// GetGetSize gets the "get_size" callback function.
59// gets the size of the message.
60func (x *SocketControlMessageClass) GetGetSize() func(*SocketControlMessage) uint {
61	if x.xGetSize == 0 {
62		return nil
63	}
64	var rawCallback func(MessageVarp uintptr) uint
65	purego.RegisterFunc(&rawCallback, x.xGetSize)
66	return func(MessageVar *SocketControlMessage) uint {
67		return rawCallback(MessageVar.GoPointer())
68	}
69}
70
71// OverrideGetLevel sets the "get_level" callback function.
72// gets the protocol of the message.
73func (x *SocketControlMessageClass) OverrideGetLevel(cb func(*SocketControlMessage) int) {
74	if cb == nil {
75		x.xGetLevel = 0
76	} else {
77		x.xGetLevel = purego.NewCallback(func(MessageVarp uintptr) int {
78			return cb(SocketControlMessageNewFromInternalPtr(MessageVarp))
79		})
80	}
81}
82
83// GetGetLevel gets the "get_level" callback function.
84// gets the protocol of the message.
85func (x *SocketControlMessageClass) GetGetLevel() func(*SocketControlMessage) int {
86	if x.xGetLevel == 0 {
87		return nil
88	}
89	var rawCallback func(MessageVarp uintptr) int
90	purego.RegisterFunc(&rawCallback, x.xGetLevel)
91	return func(MessageVar *SocketControlMessage) int {
92		return rawCallback(MessageVar.GoPointer())
93	}
94}
95
96// OverrideGetType sets the "get_type" callback function.
97// gets the protocol specific type of the message.
98func (x *SocketControlMessageClass) OverrideGetType(cb func(*SocketControlMessage) int) {
99	if cb == nil {
100		x.xGetType = 0
101	} else {
102		x.xGetType = purego.NewCallback(func(MessageVarp uintptr) int {
103			return cb(SocketControlMessageNewFromInternalPtr(MessageVarp))
104		})
105	}
106}
107
108// GetGetType gets the "get_type" callback function.
109// gets the protocol specific type of the message.
110func (x *SocketControlMessageClass) GetGetType() func(*SocketControlMessage) int {
111	if x.xGetType == 0 {
112		return nil
113	}
114	var rawCallback func(MessageVarp uintptr) int
115	purego.RegisterFunc(&rawCallback, x.xGetType)
116	return func(MessageVar *SocketControlMessage) int {
117		return rawCallback(MessageVar.GoPointer())
118	}
119}
120
121// OverrideSerialize sets the "serialize" callback function.
122// Writes out the message data.
123func (x *SocketControlMessageClass) OverrideSerialize(cb func(*SocketControlMessage, uintptr)) {
124	if cb == nil {
125		x.xSerialize = 0
126	} else {
127		x.xSerialize = purego.NewCallback(func(MessageVarp uintptr, DataVarp uintptr) {
128			cb(SocketControlMessageNewFromInternalPtr(MessageVarp), DataVarp)
129		})
130	}
131}
132
133// GetSerialize gets the "serialize" callback function.
134// Writes out the message data.
135func (x *SocketControlMessageClass) GetSerialize() func(*SocketControlMessage, uintptr) {
136	if x.xSerialize == 0 {
137		return nil
138	}
139	var rawCallback func(MessageVarp uintptr, DataVarp uintptr)
140	purego.RegisterFunc(&rawCallback, x.xSerialize)
141	return func(MessageVar *SocketControlMessage, DataVar uintptr) {
142		rawCallback(MessageVar.GoPointer(), DataVar)
143	}
144}
145
146// OverrideDeserialize sets the "deserialize" callback function.
147// Tries to deserialize a message.
148func (x *SocketControlMessageClass) OverrideDeserialize(cb func(int, int, uint, uintptr) *SocketControlMessage) {
149	if cb == nil {
150		x.xDeserialize = 0
151	} else {
152		x.xDeserialize = purego.NewCallback(func(LevelVarp int, TypeVarp int, SizeVarp uint, DataVarp uintptr) uintptr {
153			ret := cb(LevelVarp, TypeVarp, SizeVarp, DataVarp)
154			if ret == nil {
155				return 0
156			}
157			return ret.GoPointer()
158		})
159	}
160}
161
162// GetDeserialize gets the "deserialize" callback function.
163// Tries to deserialize a message.
164func (x *SocketControlMessageClass) GetDeserialize() func(int, int, uint, uintptr) *SocketControlMessage {
165	if x.xDeserialize == 0 {
166		return nil
167	}
168	var rawCallback func(LevelVarp int, TypeVarp int, SizeVarp uint, DataVarp uintptr) uintptr
169	purego.RegisterFunc(&rawCallback, x.xDeserialize)
170	return func(LevelVar int, TypeVar int, SizeVar uint, DataVar uintptr) *SocketControlMessage {
171		rawRet := rawCallback(LevelVar, TypeVar, SizeVar, DataVar)
172		if rawRet == 0 {
173			return nil
174		}
175		ret := &SocketControlMessage{}
176		ret.Ptr = rawRet
177		return ret
178	}
179}
180
181// OverrideGReserved1 sets the "_g_reserved1" callback function.
182func (x *SocketControlMessageClass) OverrideGReserved1(cb func()) {
183	if cb == nil {
184		x.xGReserved1 = 0
185	} else {
186		x.xGReserved1 = purego.NewCallback(func() {
187			cb()
188		})
189	}
190}
191
192// GetGReserved1 gets the "_g_reserved1" callback function.
193func (x *SocketControlMessageClass) GetGReserved1() func() {
194	if x.xGReserved1 == 0 {
195		return nil
196	}
197	var rawCallback func()
198	purego.RegisterFunc(&rawCallback, x.xGReserved1)
199	return func() {
200		rawCallback()
201	}
202}
203
204// OverrideGReserved2 sets the "_g_reserved2" callback function.
205func (x *SocketControlMessageClass) OverrideGReserved2(cb func()) {
206	if cb == nil {
207		x.xGReserved2 = 0
208	} else {
209		x.xGReserved2 = purego.NewCallback(func() {
210			cb()
211		})
212	}
213}
214
215// GetGReserved2 gets the "_g_reserved2" callback function.
216func (x *SocketControlMessageClass) GetGReserved2() func() {
217	if x.xGReserved2 == 0 {
218		return nil
219	}
220	var rawCallback func()
221	purego.RegisterFunc(&rawCallback, x.xGReserved2)
222	return func() {
223		rawCallback()
224	}
225}
226
227// OverrideGReserved3 sets the "_g_reserved3" callback function.
228func (x *SocketControlMessageClass) OverrideGReserved3(cb func()) {
229	if cb == nil {
230		x.xGReserved3 = 0
231	} else {
232		x.xGReserved3 = purego.NewCallback(func() {
233			cb()
234		})
235	}
236}
237
238// GetGReserved3 gets the "_g_reserved3" callback function.
239func (x *SocketControlMessageClass) GetGReserved3() func() {
240	if x.xGReserved3 == 0 {
241		return nil
242	}
243	var rawCallback func()
244	purego.RegisterFunc(&rawCallback, x.xGReserved3)
245	return func() {
246		rawCallback()
247	}
248}
249
250// OverrideGReserved4 sets the "_g_reserved4" callback function.
251func (x *SocketControlMessageClass) OverrideGReserved4(cb func()) {
252	if cb == nil {
253		x.xGReserved4 = 0
254	} else {
255		x.xGReserved4 = purego.NewCallback(func() {
256			cb()
257		})
258	}
259}
260
261// GetGReserved4 gets the "_g_reserved4" callback function.
262func (x *SocketControlMessageClass) GetGReserved4() func() {
263	if x.xGReserved4 == 0 {
264		return nil
265	}
266	var rawCallback func()
267	purego.RegisterFunc(&rawCallback, x.xGReserved4)
268	return func() {
269		rawCallback()
270	}
271}
272
273// OverrideGReserved5 sets the "_g_reserved5" callback function.
274func (x *SocketControlMessageClass) OverrideGReserved5(cb func()) {
275	if cb == nil {
276		x.xGReserved5 = 0
277	} else {
278		x.xGReserved5 = purego.NewCallback(func() {
279			cb()
280		})
281	}
282}
283
284// GetGReserved5 gets the "_g_reserved5" callback function.
285func (x *SocketControlMessageClass) GetGReserved5() func() {
286	if x.xGReserved5 == 0 {
287		return nil
288	}
289	var rawCallback func()
290	purego.RegisterFunc(&rawCallback, x.xGReserved5)
291	return func() {
292		rawCallback()
293	}
294}
295
296type SocketControlMessagePrivate struct {
297	_ structs.HostLayout
298}
299
300func (x *SocketControlMessagePrivate) GoPointer() uintptr {
301	return uintptr(unsafe.Pointer(x))
302}
303
304// A `GSocketControlMessage` is a special-purpose utility message that
305// can be sent to or received from a [class@Gio.Socket]. These types of
306// messages are often called ‘ancillary data’.
307//
308// The message can represent some sort of special instruction to or
309// information from the socket or can represent a special kind of
310// transfer to the peer (for example, sending a file descriptor over
311// a UNIX socket).
312//
313// These messages are sent with [method@Gio.Socket.send_message] and received
314// with [method@Gio.Socket.receive_message].
315//
316// To extend the set of control message that can be sent, subclass this
317// class and override the `get_size`, `get_level`, `get_type` and `serialize`
318// methods.
319//
320// To extend the set of control messages that can be received, subclass
321// this class and implement the `deserialize` method. Also, make sure your
322// class is registered with the [type@GObject.Type] type system before calling
323// [method@Gio.Socket.receive_message] to read such a message.
324type SocketControlMessage struct {
325	gobject.Object
326}
327
328var xSocketControlMessageGLibType func() types.GType
329
330func SocketControlMessageGLibType() types.GType {
331	return xSocketControlMessageGLibType()
332}
333
334func SocketControlMessageNewFromInternalPtr(ptr uintptr) *SocketControlMessage {
335	cls := &SocketControlMessage{}
336	cls.Ptr = ptr
337	return cls
338}
339
340var xSocketControlMessageGetLevel func(uintptr) int
341
342// Returns the "level" (i.e. the originating protocol) of the control message.
343// This is often SOL_SOCKET.
344func (x *SocketControlMessage) GetLevel() int {
345
346	cret := xSocketControlMessageGetLevel(x.GoPointer())
347	return cret
348}
349
350var xSocketControlMessageGetMsgType func(uintptr) int
351
352// Returns the protocol specific type of the control message.
353// For instance, for UNIX fd passing this would be SCM_RIGHTS.
354func (x *SocketControlMessage) GetMsgType() int {
355
356	cret := xSocketControlMessageGetMsgType(x.GoPointer())
357	return cret
358}
359
360var xSocketControlMessageGetSize func(uintptr) uint
361
362// Returns the space required for the control message, not including
363// headers or alignment.
364func (x *SocketControlMessage) GetSize() uint {
365
366	cret := xSocketControlMessageGetSize(x.GoPointer())
367	return cret
368}
369
370var xSocketControlMessageSerialize func(uintptr, uintptr)
371
372// Converts the data in the message to bytes placed in the
373// message.
374//
375// @data is guaranteed to have enough space to fit the size
376// returned by g_socket_control_message_get_size() on this
377// object.
378func (x *SocketControlMessage) Serialize(DataVar uintptr) {
379
380	xSocketControlMessageSerialize(x.GoPointer(), DataVar)
381
382}
383
384func (c *SocketControlMessage) GoPointer() uintptr {
385	if c == nil {
386		return 0
387	}
388	return c.Ptr
389}
390
391func (c *SocketControlMessage) SetGoPointer(ptr uintptr) {
392	c.Ptr = ptr
393}
394
395var xSocketControlMessageDeserialize func(int, int, uint, uintptr) uintptr
396
397// Tries to deserialize a socket control message of a given
398// @level and @type. This will ask all known (to GType) subclasses
399// of #GSocketControlMessage if they can understand this kind
400// of message and if so deserialize it into a #GSocketControlMessage.
401//
402// If there is no implementation for this kind of control message, %NULL
403// will be returned.
404func SocketControlMessageDeserialize(LevelVar int, TypeVar int, SizeVar uint, DataVar uintptr) *SocketControlMessage {
405	var cls *SocketControlMessage
406
407	cret := xSocketControlMessageDeserialize(LevelVar, TypeVar, SizeVar, DataVar)
408
409	if cret == 0 {
410		return nil
411	}
412	cls = &SocketControlMessage{}
413	cls.Ptr = cret
414	return cls
415}
416
417func init() {
418	core.SetPackageName("GIO", "gio-2.0")
419	core.SetSharedLibraries("GIO", []string{"libgio-2.0.so.0"})
420	var libs []uintptr
421	for _, libPath := range core.GetPaths("GIO") {
422		lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
423		if err != nil {
424			panic(err)
425		}
426		libs = append(libs, lib)
427	}
428
429	core.PuregoSafeRegister(&xSocketControlMessageGLibType, libs, "g_socket_control_message_get_type")
430
431	core.PuregoSafeRegister(&xSocketControlMessageGetLevel, libs, "g_socket_control_message_get_level")
432	core.PuregoSafeRegister(&xSocketControlMessageGetMsgType, libs, "g_socket_control_message_get_msg_type")
433	core.PuregoSafeRegister(&xSocketControlMessageGetSize, libs, "g_socket_control_message_get_size")
434	core.PuregoSafeRegister(&xSocketControlMessageSerialize, libs, "g_socket_control_message_serialize")
435
436	core.PuregoSafeRegister(&xSocketControlMessageDeserialize, libs, "g_socket_control_message_deserialize")
437
438}

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