NFScene

package
v0.0.0-...-ebec9a8 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Overlays = make(map[string]*NFOverlay)
View Source
var SceneMap = map[string]string{}

SceneMap is a map of scene names to their paths for easy access

Functions

func AddOverlay

func AddOverlay(overlay ...*NFOverlay) error

func Register

func Register(name, path string) error

Register registers a scene with the SceneMap

func RegisterAll

func RegisterAll(path string) error

RegisterAll registers all scenes by walking both the embedded and local filesystems

This function is heavy and should only be called once at the start of the program, For adding scenes after the program has started use Register instead

Like most NFFS functions this function only functions in the local directory and the embedded filesystems

Types

type NFOverlay

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

func NewNFOverlay

func NewNFOverlay(name string, layout *NFLayout.Layout) *NFOverlay

func (*NFOverlay) Hide

func (o *NFOverlay) Hide(window fyne.Window, updateScenes ...*SceneStack)

func (*NFOverlay) Layout

func (o *NFOverlay) Layout() *NFLayout.Layout

func (*NFOverlay) Name

func (o *NFOverlay) Name() string

func (*NFOverlay) SetLayout

func (o *NFOverlay) SetLayout(layout *NFLayout.Layout)

func (*NFOverlay) SetName

func (o *NFOverlay) SetName(name string)

func (*NFOverlay) SetVisible

func (o *NFOverlay) SetVisible(visible bool, window fyne.Window, updateScenes ...*SceneStack)

func (*NFOverlay) Show

func (o *NFOverlay) Show(window fyne.Window, updateScenes ...*SceneStack)

func (*NFOverlay) Visible

func (o *NFOverlay) Visible() bool

type Scene

type Scene struct {
	Name      string                 `json:"Name"`
	UUID      uuid.UUID              `json:"UUID"`
	Layout    *NFLayout.Layout       `json:"Layout"`
	Functions []*NFFunction.Function `json:"Functions"` // List of functions that are children of the scene for action based execution
	Args      *NFData.NFInterfaceMap `json:"Args"`
}

Scene is the struct that holds all the information about a scene

func Get

func Get(name string, config ...NFFS.Configuration) (*Scene, error)

Get gets a scene from the SceneMap loading it from the filesystem

func Load

func Load(path string) (*Scene, error)

func New

func New(name string, layout *NFLayout.Layout, args *NFData.NFInterfaceMap) *Scene

New creates a new scene with the given name, layout, and arguments

func (*Scene) AddChild

func (scene *Scene) AddChild(newChild NFObjects.NFRendered)

func (*Scene) AddFunction

func (scene *Scene) AddFunction(newFunction NFObjects.NFObject)

func (*Scene) CheckArgs

func (scene *Scene) CheckArgs() error

func (*Scene) DeleteByID

func (scene *Scene) DeleteByID(ID uuid.UUID, search bool) error

func (*Scene) DeleteChild

func (scene *Scene) DeleteChild(childID uuid.UUID, search bool) error

func (*Scene) DeleteFunction

func (scene *Scene) DeleteFunction(functionID uuid.UUID, search bool) error

func (*Scene) FetchAll

func (scene *Scene) FetchAll() (map[uuid.UUID][]NFObjects.NFObject, int)

func (*Scene) FetchAllChildren

func (scene *Scene) FetchAllChildren() (map[uuid.UUID][]NFObjects.NFObject, int)

func (*Scene) FetchAllFunctions

func (scene *Scene) FetchAllFunctions() (map[uuid.UUID][]NFObjects.NFObject, int)

func (*Scene) FetchChildren

func (scene *Scene) FetchChildren(children map[uuid.UUID][]NFObjects.NFObject) int

func (*Scene) FetchChildrenAndFunctions

func (scene *Scene) FetchChildrenAndFunctions(childrenAndFunctions map[uuid.UUID][]NFObjects.NFObject) int

func (*Scene) FetchFunctions

func (scene *Scene) FetchFunctions(functions map[uuid.UUID][]NFObjects.NFObject) int

func (*Scene) FetchIDs

func (scene *Scene) FetchIDs() []uuid.UUID

func (*Scene) GetArgs

func (scene *Scene) GetArgs() *NFData.NFInterfaceMap

func (*Scene) GetByID

func (scene *Scene) GetByID(ID uuid.UUID) NFObjects.NFObject

func (*Scene) GetChildByID

func (scene *Scene) GetChildByID(childID uuid.UUID) NFObjects.NFObject

func (*Scene) GetFunctionByID

func (scene *Scene) GetFunctionByID(functionID uuid.UUID) NFObjects.NFObject

func (*Scene) GetFunctions

func (scene *Scene) GetFunctions() []NFObjects.NFObject

func (*Scene) GetID

func (scene *Scene) GetID() uuid.UUID

func (*Scene) GetName

func (scene *Scene) GetName() string

func (*Scene) GetType

func (scene *Scene) GetType() string

func (*Scene) MakeId

func (scene *Scene) MakeId()

func (*Scene) Parse

func (scene *Scene) Parse(window fyne.Window) (*SceneStack, error)

Parse parses a scene and returns a fyne.CanvasObject that can be added to the window

func (*Scene) ParseAndLoad

func (scene *Scene) ParseAndLoad(window fyne.Window) (*SceneStack, error)

ParseAndLoad runs Parse before loading the scene in to active scene data

func (*Scene) RunAction

func (scene *Scene) RunAction(action string, window fyne.Window, newValues *NFData.NFInterfaceMap) (*NFData.NFInterfaceMap, error)

func (*Scene) RunAllActions

func (scene *Scene) RunAllActions(action string, window fyne.Window, newValues *NFData.NFInterfaceMap) (int, []*NFData.NFInterfaceMap, error)

func (*Scene) Save

func (scene *Scene) Save(path string) error

func (*Scene) SetArgs

func (scene *Scene) SetArgs(args *NFData.NFInterfaceMap)

func (*Scene) SetName

func (scene *Scene) SetName(newName string)

func (*Scene) SetType

func (scene *Scene) SetType(t string)

func (*Scene) Validate

func (scene *Scene) Validate() error

type SceneStack

type SceneStack struct {
	widget.BaseWidget
	// contains filtered or unexported fields
}

func NewSceneStack

func NewSceneStack(window fyne.Window, scene fyne.CanvasObject) *SceneStack

func (*SceneStack) CreateRenderer

func (s *SceneStack) CreateRenderer() fyne.WidgetRenderer

func (*SceneStack) RefreshOverlays

func (s *SceneStack) RefreshOverlays(window fyne.Window)

type StackRenderer

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

func (*StackRenderer) Destroy

func (s *StackRenderer) Destroy()

func (*StackRenderer) Layout

func (s *StackRenderer) Layout(size fyne.Size)

func (*StackRenderer) MinSize

func (s *StackRenderer) MinSize() fyne.Size

func (*StackRenderer) Objects

func (s *StackRenderer) Objects() []fyne.CanvasObject

func (*StackRenderer) Refresh

func (s *StackRenderer) Refresh()

Jump to

Keyboard shortcuts

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