Documentation ¶
Overview ¶
Package hx provides pseudo-functions to interface to Haxe code, TARDIS Go re-writes these functions as Haxe. It follows that these functions act more like macros than functions, so some parameters must be constant strings.
This package provides untyped access to Haxe, which is far from ideal. The next stage of development will be to provide a typed Go overlay - the gohaxelib approach (as yet incomplete). The final stage will be to use Haxe types directly...
Index ¶
- func Call(ifLogic, target string, nargs int, args ...interface{})
- func CallBool(ifLogic, target string, nargs int, args ...interface{}) bool
- func CallDynamic(ifLogic, target string, nargs int, args ...interface{}) uintptr
- func CallFloat(ifLogic, target string, nargs int, args ...interface{}) float64
- func CallIface(ifLogic, resTyp, target string, nargs int, args ...interface{}) interface{}
- func CallInt(ifLogic, target string, nargs int, args ...interface{}) int
- func CallString(ifLogic, target string, nargs int, args ...interface{}) string
- func CallbackFunc(function interface{}) interface{}
- func Code(ifLogic, code string, args ...interface{})
- func CodeBool(ifLogic, code string, args ...interface{}) bool
- func CodeDynamic(ifLogic, code string, args ...interface{}) uintptr
- func CodeFloat(ifLogic, code string, args ...interface{}) float64
- func CodeIface(ifLogic, resTyp, code string, args ...interface{}) interface{}
- func CodeInt(ifLogic, code string, args ...interface{}) int
- func CodeString(ifLogic, code string, args ...interface{}) string
- func Complex(x uintptr) complex128
- func FgetBool(ifLogic string, object uintptr, haxeType string, name string) bool
- func FgetDynamic(ifLogic string, object uintptr, haxeType string, name string) uintptr
- func FgetFloat(ifLogic string, object uintptr, haxeType string, name string) float64
- func FgetIface(ifLogic, resTyp string, object uintptr, haxeType string, name string) interface{}
- func FgetInt(ifLogic string, object uintptr, haxeType string, name string) int
- func FgetString(ifLogic string, object uintptr, haxeType string, name string) string
- func FsetBool(ifLogic string, object uintptr, haxeType string, name string, val bool)
- func FsetDynamic(ifLogic string, object uintptr, haxeType string, name string, val uintptr)
- func FsetFloat(ifLogic string, object uintptr, haxeType string, name string, val float64)
- func FsetIface(ifLogic, resTyp string, object uintptr, haxeType string, name string, ...)
- func FsetInt(ifLogic string, object uintptr, haxeType string, name string, val int)
- func FsetString(ifLogic string, object uintptr, haxeType string, name string, val string)
- func GetBool(ifLogic, name string) bool
- func GetDynamic(ifLogic, name string) uintptr
- func GetFloat(ifLogic, name string) float64
- func GetIface(ifLogic, resTyp, name string) interface{}
- func GetInt(ifLogic, name string) int
- func GetString(ifLogic, name string) string
- func Int64(x uintptr) int64
- func IsNull(x uintptr) bool
- func Malloc(size uintptr) unsafe.Pointer
- func Meth(ifLogic string, object uintptr, haxeType string, method string, nargs int, ...)
- func MethBool(ifLogic string, object uintptr, haxeType string, method string, nargs int, ...) bool
- func MethDynamic(ifLogic string, object uintptr, haxeType string, method string, nargs int, ...) uintptr
- func MethFloat(ifLogic string, object uintptr, haxeType string, method string, nargs int, ...) float64
- func MethIface(ifLogic string, resTyp uintptr, object interface{}, haxeType string, nargs int, ...) interface{}
- func MethInt(ifLogic string, object uintptr, haxeType string, method string, nargs int, ...) int
- func MethString(ifLogic string, object uintptr, haxeType string, method string, nargs int, ...) string
- func New(ifLogic, target string, nargs int, args ...interface{}) uintptr
- func Null() uintptr
- func Resource(s string) []byte
- func SetBool(ifLogic, name string, val bool)
- func SetDynamic(ifLogic, name string, val uintptr)
- func SetFloat(ifLogic, name string, val float64)
- func SetIface(ifLogic, resTyp, name string, val interface{})
- func SetInt(ifLogic, name string, val int)
- func SetString(ifLogic, name string, val string)
- func Source(classname, contents string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CallDynamic ¶
func CallString ¶
func CallbackFunc ¶
func CallbackFunc(function interface{}) interface{}
CallbackFunc returns the Haxe-callable form of a Go function, or if passed a string value, it gives the actual name of a Haxe function e.g. "Scheduler.timerEventHandler"
func Code ¶
func Code(ifLogic, code string, args ...interface{})
Code inserts the given constant Haxe code at this point. This is not suitable for the casual programmer. ifLogic = a constant string giving the logic for wrapping Haxe complie time condition, ignored if "": #if (ifLogic) ... #end resTyp = a constant string giving the Go name of the type of the data to be returned as an interface. "" if nothing is returned. NOTE: the returned values are not converted from Haxe format, e.g. String values will not be converted back to UTF-8 on UTF-16 targets. code = must be a constant string containing a well-formed Haxe statement, probably terminated with a ";". args = whatever aguments are passed (as interfaces), typical haxe code to access the value of an argument is "_a[3].val". Try the Go code:
hx.Code("","trace('HAXE trace:',_a.itemAddr(0).load().val,_a.itemAddr(1).load().val);", 42,43)
func CodeDynamic ¶
CodeDynamic - same as Code() but returns a Dynamic (modeled as Haxe Dynamic in TARDIS Go, so can hold any Haxe object).
func CodeIface ¶
func CodeIface(ifLogic, resTyp, code string, args ...interface{}) interface{}
CodeIface - same as Code() but returns an interface.
func CodeString ¶
CodeString - same as Code() but returns a string.
func FgetDynamic ¶
func FgetString ¶
func FsetDynamic ¶
func FsetString ¶
func GetDynamic ¶
func MethDynamic ¶
func MethString ¶
func Resource ¶
Resource loads a file resource that was added through the -resource host/file/path/a.dat@/target/file/path/b.dat haxe command line parameter; if the file resource does not exist, an empty slice is returned.
func SetDynamic ¶
Types ¶
This section is empty.