package girepository

import "github.com/diamondburned/gotk4/pkg/core/girepository"

Packagee girepository provides convenient bindings around libgirepository's C API. It is handwritten, so the API surface is very abstracted and is kept to the bare minimum. As such, it is not a 1:1 binding.

Index

Constants

const (
	LoadFlagLazy = LoadFlags(C.G_IREPOSITORY_LOAD_FLAG_LAZY)
)

LoadFlags constants.

Functions

func Require

func Require(namespace, version string, flags LoadFlags)

Require forces the namespace to be loaded if it isn't already. If namespace is not loaded, this function will search for a ".typelib" file using the repository search path. In addition, a version version of namespace may be specified. If version is not specified, the latest will be used.

Types

type Argument

type Argument C.GIArgument

Argument is a type to a GIArgument union.

func (Argument) String

func (a Argument) String() string

type Info

type Info struct {
	// contains filtered or unexported fields
}

func Find

func Find(namespace, name string) *Info

Find finds name from the given namespace.

func MustFind

func MustFind(namespace, name string) *Info

MustFind finds or panics.

func (*Info) InvokeClassMethod

func (i *Info) InvokeClassMethod(name string, in, out []Argument) Argument

InvokeClassMethod invokes the method of this ClassInfo with the given name.

func (*Info) InvokeFunction

func (i *Info) InvokeFunction(in, out []Argument) Argument

InvokeFunction invokes this BaseInfo as a FunctionInfo.

func (*Info) InvokeIfaceMethod

func (i *Info) InvokeIfaceMethod(name string, in, out []Argument) Argument

InvokeIfaceMethod invokes the method of this InterfaceInfo with the given name.

func (*Info) InvokeRecordMethod

func (i *Info) InvokeRecordMethod(name string, in, out []Argument) Argument

InvokeRecordMethod invokes the method of this StructInfo with the given name.

func (*Info) RegisteredGType

func (i *Info) RegisteredGType() coreglib.Type

RegisteredGType returns the GType of the type belonging to this Info.

func (*Info) String

func (i *Info) String() string

String formats the type Info as a string describing its name.

func (*Info) StructFieldOffset

func (i *Info) StructFieldOffset(name string) uintptr

StructFieldOffset gets the offset of the field for the record that is i.

type LoadFlags

type LoadFlags C.GIRepositoryLoadFlags

LoadFlags are flags that control how a typelib is loaded.

Source Files

girepository.go

Version
v0.3.1 (latest)
Published
Jul 31, 2024
Platform
linux/amd64
Imports
9 packages
Last checked
1 month ago

Tools for package owners.