v0.2.2 9100209

gconverteroutputstream.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"
13	"github.com/bnema/puregotk/v4/gobject/types"
14)
15
16type ConverterOutputStreamClass struct {
17	_ structs.HostLayout
18
19	ParentClass FilterOutputStreamClass
20
21	xGReserved1 uintptr
22
23	xGReserved2 uintptr
24
25	xGReserved3 uintptr
26
27	xGReserved4 uintptr
28
29	xGReserved5 uintptr
30}
31
32func (x *ConverterOutputStreamClass) GoPointer() uintptr {
33	return uintptr(unsafe.Pointer(x))
34}
35
36// OverrideGReserved1 sets the "_g_reserved1" callback function.
37func (x *ConverterOutputStreamClass) OverrideGReserved1(cb func()) {
38	if cb == nil {
39		x.xGReserved1 = 0
40	} else {
41		x.xGReserved1 = purego.NewCallback(func() {
42			cb()
43		})
44	}
45}
46
47// GetGReserved1 gets the "_g_reserved1" callback function.
48func (x *ConverterOutputStreamClass) GetGReserved1() func() {
49	if x.xGReserved1 == 0 {
50		return nil
51	}
52	var rawCallback func()
53	purego.RegisterFunc(&rawCallback, x.xGReserved1)
54	return func() {
55		rawCallback()
56	}
57}
58
59// OverrideGReserved2 sets the "_g_reserved2" callback function.
60func (x *ConverterOutputStreamClass) OverrideGReserved2(cb func()) {
61	if cb == nil {
62		x.xGReserved2 = 0
63	} else {
64		x.xGReserved2 = purego.NewCallback(func() {
65			cb()
66		})
67	}
68}
69
70// GetGReserved2 gets the "_g_reserved2" callback function.
71func (x *ConverterOutputStreamClass) GetGReserved2() func() {
72	if x.xGReserved2 == 0 {
73		return nil
74	}
75	var rawCallback func()
76	purego.RegisterFunc(&rawCallback, x.xGReserved2)
77	return func() {
78		rawCallback()
79	}
80}
81
82// OverrideGReserved3 sets the "_g_reserved3" callback function.
83func (x *ConverterOutputStreamClass) OverrideGReserved3(cb func()) {
84	if cb == nil {
85		x.xGReserved3 = 0
86	} else {
87		x.xGReserved3 = purego.NewCallback(func() {
88			cb()
89		})
90	}
91}
92
93// GetGReserved3 gets the "_g_reserved3" callback function.
94func (x *ConverterOutputStreamClass) GetGReserved3() func() {
95	if x.xGReserved3 == 0 {
96		return nil
97	}
98	var rawCallback func()
99	purego.RegisterFunc(&rawCallback, x.xGReserved3)
100	return func() {
101		rawCallback()
102	}
103}
104
105// OverrideGReserved4 sets the "_g_reserved4" callback function.
106func (x *ConverterOutputStreamClass) OverrideGReserved4(cb func()) {
107	if cb == nil {
108		x.xGReserved4 = 0
109	} else {
110		x.xGReserved4 = purego.NewCallback(func() {
111			cb()
112		})
113	}
114}
115
116// GetGReserved4 gets the "_g_reserved4" callback function.
117func (x *ConverterOutputStreamClass) GetGReserved4() func() {
118	if x.xGReserved4 == 0 {
119		return nil
120	}
121	var rawCallback func()
122	purego.RegisterFunc(&rawCallback, x.xGReserved4)
123	return func() {
124		rawCallback()
125	}
126}
127
128// OverrideGReserved5 sets the "_g_reserved5" callback function.
129func (x *ConverterOutputStreamClass) OverrideGReserved5(cb func()) {
130	if cb == nil {
131		x.xGReserved5 = 0
132	} else {
133		x.xGReserved5 = purego.NewCallback(func() {
134			cb()
135		})
136	}
137}
138
139// GetGReserved5 gets the "_g_reserved5" callback function.
140func (x *ConverterOutputStreamClass) GetGReserved5() func() {
141	if x.xGReserved5 == 0 {
142		return nil
143	}
144	var rawCallback func()
145	purego.RegisterFunc(&rawCallback, x.xGReserved5)
146	return func() {
147		rawCallback()
148	}
149}
150
151type ConverterOutputStreamPrivate struct {
152	_ structs.HostLayout
153}
154
155func (x *ConverterOutputStreamPrivate) GoPointer() uintptr {
156	return uintptr(unsafe.Pointer(x))
157}
158
159// Converter output stream implements [class@Gio.OutputStream] and allows
160// conversion of data of various types during reading.
161//
162// As of GLib 2.34, `GConverterOutputStream` implements
163// [iface@Gio.PollableOutputStream].
164type ConverterOutputStream struct {
165	FilterOutputStream
166}
167
168var xConverterOutputStreamGLibType func() types.GType
169
170func ConverterOutputStreamGLibType() types.GType {
171	return xConverterOutputStreamGLibType()
172}
173
174func ConverterOutputStreamNewFromInternalPtr(ptr uintptr) *ConverterOutputStream {
175	cls := &ConverterOutputStream{}
176	cls.Ptr = ptr
177	return cls
178}
179
180var xNewConverterOutputStream func(uintptr, uintptr) uintptr
181
182// Creates a new converter output stream for the @base_stream.
183func NewConverterOutputStream(BaseStreamVar *OutputStream, ConverterVar Converter) *ConverterOutputStream {
184	var cls *ConverterOutputStream
185
186	cret := xNewConverterOutputStream(BaseStreamVar.GoPointer(), ConverterVar.GoPointer())
187
188	if cret == 0 {
189		return nil
190	}
191	cls = &ConverterOutputStream{}
192	cls.Ptr = cret
193	return cls
194}
195
196var xConverterOutputStreamGetConverter func(uintptr) uintptr
197
198// Gets the #GConverter that is used by @converter_stream.
199func (x *ConverterOutputStream) GetConverter() *ConverterBase {
200	var cls *ConverterBase
201
202	cret := xConverterOutputStreamGetConverter(x.GoPointer())
203
204	if cret == 0 {
205		return nil
206	}
207	gobject.IncreaseRef(cret)
208	cls = &ConverterBase{}
209	cls.Ptr = cret
210	return cls
211}
212
213func (c *ConverterOutputStream) GoPointer() uintptr {
214	if c == nil {
215		return 0
216	}
217	return c.Ptr
218}
219
220func (c *ConverterOutputStream) SetGoPointer(ptr uintptr) {
221	c.Ptr = ptr
222}
223
224// Checks if @stream is actually pollable. Some classes may implement
225// #GPollableOutputStream but have only certain instances of that
226// class be pollable. If this method returns %FALSE, then the behavior
227// of other #GPollableOutputStream methods is undefined.
228//
229// For any given stream, the value returned by this method is constant;
230// a stream cannot switch from pollable to non-pollable or vice versa.
231func (x *ConverterOutputStream) CanPoll() bool {
232
233	cret := XGPollableOutputStreamCanPoll(x.GoPointer())
234	return cret
235}
236
237// Creates a #GSource that triggers when @stream can be written, or
238// @cancellable is triggered or an error occurs. The callback on the
239// source is of the #GPollableSourceFunc type.
240//
241// As with g_pollable_output_stream_is_writable(), it is possible that
242// the stream may not actually be writable even after the source
243// triggers, so you should use g_pollable_output_stream_write_nonblocking()
244// rather than g_output_stream_write() from the callback.
245//
246// The behaviour of this method is undefined if
247// g_pollable_output_stream_can_poll() returns %FALSE for @stream.
248func (x *ConverterOutputStream) CreateSource(CancellableVar *Cancellable) *glib.Source {
249
250	cret := XGPollableOutputStreamCreateSource(x.GoPointer(), CancellableVar.GoPointer())
251	return cret
252}
253
254// Checks if @stream can be written.
255//
256// Note that some stream types may not be able to implement this 100%
257// reliably, and it is possible that a call to g_output_stream_write()
258// after this returns %TRUE would still block. To guarantee
259// non-blocking behavior, you should always use
260// g_pollable_output_stream_write_nonblocking(), which will return a
261// %G_IO_ERROR_WOULD_BLOCK error rather than blocking.
262//
263// The behaviour of this method is undefined if
264// g_pollable_output_stream_can_poll() returns %FALSE for @stream.
265func (x *ConverterOutputStream) IsWritable() bool {
266
267	cret := XGPollableOutputStreamIsWritable(x.GoPointer())
268	return cret
269}
270
271// Attempts to write up to @count bytes from @buffer to @stream, as
272// with g_output_stream_write(). If @stream is not currently writable,
273// this will immediately return %G_IO_ERROR_WOULD_BLOCK, and you can
274// use g_pollable_output_stream_create_source() to create a #GSource
275// that will be triggered when @stream is writable.
276//
277// Note that since this method never blocks, you cannot actually
278// use @cancellable to cancel it. However, it will return an error
279// if @cancellable has already been cancelled when you call, which
280// may happen if you call this method after a source triggers due
281// to having been cancelled.
282//
283// Also note that if %G_IO_ERROR_WOULD_BLOCK is returned some underlying
284// transports like D/TLS require that you re-send the same @buffer and
285// @count in the next write call.
286//
287// The behaviour of this method is undefined if
288// g_pollable_output_stream_can_poll() returns %FALSE for @stream.
289func (x *ConverterOutputStream) WriteNonblocking(BufferVar []byte, CountVar uint, CancellableVar *Cancellable) (int, error) {
290	var cerr *glib.Error
291
292	cret := XGPollableOutputStreamWriteNonblocking(x.GoPointer(), BufferVar, CountVar, CancellableVar.GoPointer(), &cerr)
293	if cerr == nil {
294		return cret, nil
295	}
296	return cret, cerr
297
298}
299
300// Attempts to write the bytes contained in the @n_vectors @vectors to @stream,
301// as with g_output_stream_writev(). If @stream is not currently writable,
302// this will immediately return %@G_POLLABLE_RETURN_WOULD_BLOCK, and you can
303// use g_pollable_output_stream_create_source() to create a #GSource
304// that will be triggered when @stream is writable. @error will *not* be
305// set in that case.
306//
307// Note that since this method never blocks, you cannot actually
308// use @cancellable to cancel it. However, it will return an error
309// if @cancellable has already been cancelled when you call, which
310// may happen if you call this method after a source triggers due
311// to having been cancelled.
312//
313// Also note that if %G_POLLABLE_RETURN_WOULD_BLOCK is returned some underlying
314// transports like D/TLS require that you re-send the same @vectors and
315// @n_vectors in the next write call.
316//
317// The behaviour of this method is undefined if
318// g_pollable_output_stream_can_poll() returns %FALSE for @stream.
319func (x *ConverterOutputStream) WritevNonblocking(VectorsVar []OutputVector, NVectorsVar uint, BytesWrittenVar *uint, CancellableVar *Cancellable) (PollableReturn, error) {
320	var cerr *glib.Error
321
322	cret := XGPollableOutputStreamWritevNonblocking(x.GoPointer(), VectorsVar, NVectorsVar, BytesWrittenVar, CancellableVar.GoPointer(), &cerr)
323	if cerr == nil {
324		return cret, nil
325	}
326	return cret, cerr
327
328}
329
330func init() {
331	core.SetPackageName("GIO", "gio-2.0")
332	core.SetSharedLibraries("GIO", []string{"libgio-2.0.so.0"})
333	var libs []uintptr
334	for _, libPath := range core.GetPaths("GIO") {
335		lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
336		if err != nil {
337			panic(err)
338		}
339		libs = append(libs, lib)
340	}
341
342	core.PuregoSafeRegister(&xConverterOutputStreamGLibType, libs, "g_converter_output_stream_get_type")
343
344	core.PuregoSafeRegister(&xNewConverterOutputStream, libs, "g_converter_output_stream_new")
345
346	core.PuregoSafeRegister(&xConverterOutputStreamGetConverter, libs, "g_converter_output_stream_get_converter")
347
348}

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