Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CGoTail ¶
func CGoTail(gen types.FileGenerator, g *gir.CallableAttrs) (string, error)
CGoTail generates the CGo function tail for the given callable.
func CallbackArg ¶
CallbackArg formats the callback variable name for the given variable index.
func CallbackPreamble ¶
func CallbackPreamble(g *Generator, sect *pen.BlockSection) (string, bool)
CallbackPreamble writes the preamble for the Go callback function. It uses the Closure parameter to find the Go function on the heap and casts it to the right type. The returned name is always "fn".
Types ¶
type Generator ¶
type Generator struct { *gir.CallableAttrs Parent interface{} GoName string GoTail string CGoName string CGoTail string Block string Preamble func(g *Generator, sect *pen.BlockSection) (call string, ok bool) Closure *int Destroy *int // TODO: why is this unused? Conv *typeconv.Converter Results []typeconv.ValueConverted // contains filtered or unexported fields }
Generator generates a callback in Go.
func NewGenerator ¶
func NewGenerator(gen types.FileGenerator) Generator
NewGenerator creates a new Generator instance.
Click to show internal directories.
Click to hide internal directories.