hx

package
v0.0.0-...-e0dd9a7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2016 License: BSD-3-Clause, MIT Imports: 1 Imported by: 8

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func Call

func Call(ifLogic, target string, nargs int, args ...interface{})

func CallBool

func CallBool(ifLogic, target string, nargs int, args ...interface{}) bool

func CallDynamic

func CallDynamic(ifLogic, target string, nargs int, args ...interface{}) uintptr

func CallFloat

func CallFloat(ifLogic, target string, nargs int, args ...interface{}) float64

func CallIface

func CallIface(ifLogic, resTyp, target string, nargs int, args ...interface{}) interface{}

func CallInt

func CallInt(ifLogic, target string, nargs int, args ...interface{}) int

func CallString

func CallString(ifLogic, target string, nargs int, args ...interface{}) string

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 CodeBool

func CodeBool(ifLogic, code string, args ...interface{}) bool

CodeBool - same as Code() but returns a bool.

func CodeDynamic

func CodeDynamic(ifLogic, code string, args ...interface{}) uintptr

CodeDynamic - same as Code() but returns a Dynamic (modeled as Haxe Dynamic in TARDIS Go, so can hold any Haxe object).

func CodeFloat

func CodeFloat(ifLogic, code string, args ...interface{}) float64

CodeFloat - same as Code() but returns a float64.

func CodeIface

func CodeIface(ifLogic, resTyp, code string, args ...interface{}) interface{}

CodeIface - same as Code() but returns an interface.

func CodeInt

func CodeInt(ifLogic, code string, args ...interface{}) int

CodeInt - same as Code() but returns an int.

func CodeString

func CodeString(ifLogic, code string, args ...interface{}) string

CodeString - same as Code() but returns a string.

func Complex

func Complex(x uintptr) complex128

Complex provides a cast from haxe Dynamic type

func FgetBool

func FgetBool(ifLogic string, object uintptr, haxeType string, name string) bool

func FgetDynamic

func FgetDynamic(ifLogic string, object uintptr, haxeType string, name string) uintptr

func FgetFloat

func FgetFloat(ifLogic string, object uintptr, haxeType string, name string) float64

func FgetIface

func FgetIface(ifLogic, resTyp string, object uintptr, haxeType string, name string) interface{}

func FgetInt

func FgetInt(ifLogic string, object uintptr, haxeType string, name string) int

func FgetString

func FgetString(ifLogic string, object uintptr, haxeType string, name string) string

func FsetBool

func FsetBool(ifLogic string, object uintptr, haxeType string, name string, val bool)

func FsetDynamic

func FsetDynamic(ifLogic string, object uintptr, haxeType string, name string, val uintptr)

func FsetFloat

func FsetFloat(ifLogic string, object uintptr, haxeType string, name string, val float64)

func FsetIface

func FsetIface(ifLogic, resTyp string, object uintptr, haxeType string, name string, val interface{})

func FsetInt

func FsetInt(ifLogic string, object uintptr, haxeType string, name string, val int)

func FsetString

func FsetString(ifLogic string, object uintptr, haxeType string, name string, val string)

func GetBool

func GetBool(ifLogic, name string) bool

func GetDynamic

func GetDynamic(ifLogic, name string) uintptr

func GetFloat

func GetFloat(ifLogic, name string) float64

func GetIface

func GetIface(ifLogic, resTyp, name string) interface{}

func GetInt

func GetInt(ifLogic, name string) int

func GetString

func GetString(ifLogic, name string) string

func Int64

func Int64(x uintptr) int64

Int64 provides a cast from haxe Dynamic type

func IsNull

func IsNull(x uintptr) bool

IsNull returns if the haxe Dynamic variable is null

func Malloc

func Malloc(size uintptr) unsafe.Pointer

Malloc allocates a memory Object and returns an unsafe pointer to it

func Meth

func Meth(ifLogic string, object uintptr, haxeType string, method string, nargs int, args ...interface{})

func MethBool

func MethBool(ifLogic string, object uintptr, haxeType string, method string, nargs int, args ...interface{}) bool

func MethDynamic

func MethDynamic(ifLogic string, object uintptr, haxeType string, method string, nargs int, args ...interface{}) uintptr

func MethFloat

func MethFloat(ifLogic string, object uintptr, haxeType string, method string, nargs int, args ...interface{}) float64

func MethIface

func MethIface(ifLogic string, resTyp uintptr, object interface{}, haxeType string, nargs int, method string, args ...interface{}) interface{}

func MethInt

func MethInt(ifLogic string, object uintptr, haxeType string, method string, nargs int, args ...interface{}) int

func MethString

func MethString(ifLogic string, object uintptr, haxeType string, method string, nargs int, args ...interface{}) string

func New

func New(ifLogic, target string, nargs int, args ...interface{}) uintptr

func Null

func Null() uintptr

Null returns a haxe Dynamic null value

func Resource

func Resource(s string) []byte

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 SetBool

func SetBool(ifLogic, name string, val bool)

func SetDynamic

func SetDynamic(ifLogic, name string, val uintptr)

func SetFloat

func SetFloat(ifLogic, name string, val float64)

func SetIface

func SetIface(ifLogic, resTyp, name string, val interface{})

func SetInt

func SetInt(ifLogic, name string, val int)

func SetString

func SetString(ifLogic, name string, val string)

func Source

func Source(classname, contents string)

Source places the contents into a classname.hx file in the haxe output directory at compile time.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL