Documentation ¶
Overview ¶
Package glib provides Go bindings for GLib, only imlementing the necessary functions for the goxis project.
Index ¶
- type CompareDataFunc
- type GMainLoop
- type List
- func (v *List) Append(data uintptr) *List
- func (v *List) Data() interface{}
- func (v *List) DataWrapper(fn func(unsafe.Pointer) interface{})
- func (v *List) First() *List
- func (v *List) Foreach(fn func(item interface{}))
- func (v *List) Free()
- func (v *List) FreeFull(fn func(item interface{}))
- func (v *List) Insert(data uintptr, position int) *List
- func (v *List) Last() *List
- func (v *List) Length() uint
- func (v *List) Native() uintptr
- func (v *List) Next() *List
- func (v *List) Nth(n uint) *List
- func (v *List) NthData(n uint) interface{}
- func (v *List) Prepend(data uintptr) *List
- func (v *List) Previous() *List
- func (v *List) Reverse() *List
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CompareDataFunc ¶
CompareDataFunc is a representation of GCompareDataFunc
type GMainLoop ¶
GMainLoop is a representation of GLib's GMainLoop structure, encapsulating the functionality of a main event loop. A GMainLoop is a loop that processes events for a context.
func NewMainLoop ¶
func NewMainLoop() *GMainLoop
NewMainLoop creates and returns a new GMainLoop. This function creates a new event loop object with a reference count of 1. The loop is set to not automatically quit upon the termination of its last source, allowing for manual control.
https://docs.gtk.org/glib/ctor.MainLoop.new.html
Returns:
- *GMainLoop: A pointer to the newly created GMainLoop.
func (*GMainLoop) Quit ¶
func (g *GMainLoop) Quit()
Quit stops the GMainLoop, causing Start to return. It is safe to call this function from any thread. The function decreases the reference count of the GMainLoop object and frees it if this was the last reference. After calling Quit, the GMainLoop should not be used anymore.
func (*GMainLoop) Run ¶
func (g *GMainLoop) Run()
Run begins the execution of the GMainLoop. This function locks the current OS thread, runs the event loop, and processes events for the context until Quit is called. It's important to manage concurrency and ensure that Start is called from the appropriate execution context, as it will lock the calling thread.
type List ¶
type List struct {
// contains filtered or unexported fields
}
List is a representation of Glib's GList. Copied from https://github.com/gotk3/gotk3/blob/master/glib/list.go
func (*List) Data ¶
func (v *List) Data() interface{}
Data acts the same as data struct field, but passes retrieved value before returning through wrap function, set by DataWrapper(). If no wrap function is set, it returns raw unsafe.Pointer.
func (*List) DataWrapper ¶
DataWapper sets wrap functions, which is called during NthData() and Data(). It's used to cast raw C data into appropriate Go structures and types every time that data is retreived.
func (*List) Foreach ¶
func (v *List) Foreach(fn func(item interface{}))
Foreach acts the same as g_list_foreach(). No user_data argument is implemented because of Go clojure capabilities.
func (*List) FreeFull ¶
func (v *List) FreeFull(fn func(item interface{}))
FreeFull acts the same as g_list_free_full(). Calling list.FreeFull(fn) is equivalent to calling list.Foreach(fn) and list.Free() sequentially.
func (*List) NthData ¶
NthData acts the same as g_list_nth_data(), but passes retrieved value before returning through wrap function, set by DataWrapper(). If no wrap function is set, it returns raw unsafe.Pointer.