cli

package
v0.2.0-preview.1 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package cli provides language bindings for Java and Objective-C (Swift).

Index

Constants

View Source
const (
	PrimitiveEmpty     = int(rendering.PrimitiveEmpty)
	PrimitivePoint     = int(rendering.PrimitivePoint)
	PrimitiveLine      = int(rendering.PrimitiveLine)
	PrimitiveRectangle = int(rendering.PrimitiveRectangle)
	PrimitiveEllipse   = int(rendering.PrimitiveEllipse)
	PrimitiveTriangle  = int(rendering.PrimitiveTriangle)
	PrimitiveText      = int(rendering.PrimitiveText)
	PrimitiveImage     = int(rendering.PrimitiveImage)
	PrimitiveBezier    = int(rendering.PrimitiveBezier)
	PrimitiveGlyph     = int(rendering.PrimitiveGlyph)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CallbackHandler

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

func NewCallbackHandler

func NewCallbackHandler(handler frontend.CallbackHandler) *CallbackHandler

func (*CallbackHandler) HandleCallback

func (h *CallbackHandler) HandleCallback(code int, data string)

type Context

type Context struct {
	ScreenSize *Vector3
}

type ExecDelegate

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

func NewExecDelegate

func NewExecDelegate(delegate func()) *ExecDelegate

func (*ExecDelegate) Execute

func (e *ExecDelegate) Execute()

type FrontendDelegate

type FrontendDelegate interface {
	Init()
	Run()
	Reset()
	GetAppData() []byte
	CommencePanic(reason, msg string)
	GetContext() *Context
	SetCallback(handler *CallbackHandler)
	ExecuteOnMainThread(delegate *ExecDelegate)
	ExecuteOnRenderingThread(delegate *ExecDelegate)
}

type FrontendWrap

type FrontendWrap struct {
}

type GeometryPrimitiveData

type GeometryPrimitiveData struct {
	GeometryType int
	TlPositionN  *Vector3
	BrPositionN  *Vector3
	FillColorN   *Vector4
	StrokeColorN *Vector4
	StrokeWeight int
	CornerRadius int
}

type ImagePrimitiveData

type ImagePrimitiveData struct {
	TlPositionN *Vector3
	BrPositionN *Vector3
	ImageUrl    string
}

type NativeFeatureDelegate

type NativeFeatureDelegate interface {
	OnInvoke(string) string
}

NativeFeatureDelegate is a redeclaration of frontend.FeatureDelegate to be exported into the CLI. Can be used to implement a feature in native code. The OnInvoke method takes in and returns string instead of interface{} (unlike the original interface) due to the gobind type restrictions.

type NativeFeatureDelegateWrap

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

NativeFeatureDelegateWrap is a wrap around NativeFeatureDelegate implementing the frontend.FeatureDelegate, so native feature can be passed to the engine.

func NewNativeFeatureDelegateWrap

func NewNativeFeatureDelegateWrap(delegate NativeFeatureDelegate) *NativeFeatureDelegateWrap

NewNativeFeatureDelegateWrap creates a new instance of the NativeFeatureDelegateWrap with the specified NativeFeatureDelegate.

func (*NativeFeatureDelegateWrap) OnInvoke

func (f *NativeFeatureDelegateWrap) OnInvoke(data interface{}) interface{}

OnInvoke implements the frontend.FeatureDelegate interface.

type PrimitiveRendererDelegate

type PrimitiveRendererDelegate interface {
	OnStart()
	OnSetPrimitive(ctx *PrimitiveRenderingContext)
	OnRender(ctx *PrimitiveRenderingContext)
	OnRemovePrimitive(ctx *PrimitiveRenderingContext)
	OnStop()
}

type PrimitiveRendererDelegateWrap

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

func NewPrimitiveRendererDelegateWrap

func NewPrimitiveRendererDelegateWrap(delegate PrimitiveRendererDelegate) *PrimitiveRendererDelegateWrap

func (*PrimitiveRendererDelegateWrap) OnRemovePrimitive

func (*PrimitiveRendererDelegateWrap) OnRender

func (*PrimitiveRendererDelegateWrap) OnSetPrimitive

func (*PrimitiveRendererDelegateWrap) OnStart

func (p *PrimitiveRendererDelegateWrap) OnStart()

func (*PrimitiveRendererDelegateWrap) OnStop

func (p *PrimitiveRendererDelegateWrap) OnStop()

type PrimitiveRenderingContext

type PrimitiveRenderingContext struct {
	GeometryPrimitiveData *GeometryPrimitiveData
	ImagePrimitiveData    *ImagePrimitiveData
	TextPrimitiveData     *TextPrimitiveData
	PrimitiveKind         int
	State                 interface{}
	Redraw                bool
	PrimitiveId           int
}

type RendererDelegate

type RendererDelegate interface {
	rendering.RendererDelegate
}

type ResourceManagerDelegate

type ResourceManagerDelegate interface {
	ReadFile(path string) ([]byte, error)
}

type ResourceManagerImpl

type ResourceManagerImpl struct {
	*frontend.ResourceManagerImpl
	// contains filtered or unexported fields
}

func NewResourceManagerImpl

func NewResourceManagerImpl(delegate ResourceManagerDelegate) *ResourceManagerImpl

func (*ResourceManagerImpl) ReadFile

func (r *ResourceManagerImpl) ReadFile(id a.ResId) ([]byte, error)

type TextPrimitiveData

type TextPrimitiveData struct {
	Text       string
	TlPosition *Vector3
	Size       *Vector3
	TextColorN *Vector4
}

type Vector2

type Vector2 struct {
	X, Y float32
}

func NewVector2

func NewVector2(x, y float32) *Vector2

type Vector3

type Vector3 struct {
	X, Y, Z float32
}

func NewVector3

func NewVector3(x, y, z float32) *Vector3

func NewVector3FromAVector3

func NewVector3FromAVector3(vector3 a.Vector3) *Vector3

func Vector3Ndc

func Vector3Ndc(v *Vector3, size *Vector3) *Vector3

type Vector4

type Vector4 struct {
	X, Y, Z, W float32
}

func NewVector4

func NewVector4(x, y, z, w float32) *Vector4

func NewVector4FromAVector4

func NewVector4FromAVector4(vector4 a.Vector4) *Vector4

Jump to

Keyboard shortcuts

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