Documentation ¶
Index ¶
- Variables
- func ContainerName(blockType string) string
- func DescribeQuark(q Quark) block.Dict
- func MutatorName(blockType string) string
- func PaletteQuarks(quarks Quarks) (ret []string)
- func RegisterQuarks(p block.Project, qs Quarks) (err error)
- func RemoveAtoms(b block.Inputs)
- type AtomizedInput
- type Atomizer
- type BlockMutations
- func (m *BlockMutations) AddMutation(inputName string, arch Mutation)
- func (m *BlockMutations) DescribeContainer(containerName string) (ret block.Dict)
- func (m *BlockMutations) GetMutation(n string) (ret Mutation, okay bool)
- func (m *BlockMutations) Mutates() bool
- func (m *BlockMutations) Preregister(blockType string, p block.Project) (err error)
- func (m *BlockMutations) Quarks(paletteOnly bool) (ret Quark, okay bool)
- type MutatedBlock
- func (mb *MutatedBlock) ContainerName() string
- func (mb *MutatedBlock) CreateFromMui(muiContainer block.Shape) (err error)
- func (mb *MutatedBlock) CreateMui(mui block.Workspace) (ret block.Shape, err error)
- func (mb *MutatedBlock) GetMutatedInput(inputName string) (ret *MutatedInput, okay bool)
- func (mb *MutatedBlock) LoadMutation(els *dom.BlockMutation) (err error)
- func (mb *MutatedBlock) SaveConnections(muiContainer block.Shape) Storage
- func (mb *MutatedBlock) SaveMutation() (ret dom.BlockMutation)
- type MutatedBlocks
- type MutatedInput
- type Mutation
- type Mutator
- func (a *Mutator) Compose(main, mui block.Shape) (err error)
- func (a *Mutator) Decompose(main block.Shape, popup block.Workspace) (block.Shape, error)
- func (a *Mutator) DomToMutation(main block.Shape, str string) (err error)
- func (a *Mutator) MutationToDom(main block.Shape) (ret string, err error)
- func (a *Mutator) PostMixin(b block.Shape) (err error)
- func (a *Mutator) Quarks() (ret []string)
- func (a *Mutator) SaveConnections(main, mui block.Shape) (err error)
- type Quark
- type Quarks
- type Storage
- type Store
Constants ¶
This section is empty.
Variables ¶
var Trace bool = true
Functions ¶
func ContainerName ¶
func DescribeQuark ¶
make blockly compatible description of the quark's mui block
func MutatorName ¶
func PaletteQuarks ¶
return a list of blocks used in a palette; exludes the fixed block if any.
func RemoveAtoms ¶
Types ¶
type AtomizedInput ¶
func (*AtomizedInput) String ¶
func (a *AtomizedInput) String() string
type Atomizer ¶
type Atomizer interface { // return choices for the passed (pre-registered) enum. GetPairs(string) []enum.Pair // lookup the limits of the passed block type GetTerms(string) (block.Limits, error) // lookup the limits of the passed block type GetStatements(string) (block.Limits, error) // a work in progress: interfaces arent registered to blockly // so they cant be found by type name; we need typename tho for loading from xml. GetTermsByType(r.Type) block.Limits GetStatementsByType(r.Type) block.Limits }
interface for creating, listening to atom expansion
type BlockMutations ¶
type BlockMutations struct { Inputs []string // ordered input names (b/c golang maps are unordered) Mutations map[string]Mutation // input name to mutation info interface }
descriptions of the mutable inputs for a given type of block.
func (*BlockMutations) AddMutation ¶
func (m *BlockMutations) AddMutation(inputName string, arch Mutation)
func (*BlockMutations) DescribeContainer ¶
func (m *BlockMutations) DescribeContainer(containerName string) (ret block.Dict)
produce a description of the mui container. each input in the container represents a mutable input in the workspace block.
func (*BlockMutations) GetMutation ¶
func (m *BlockMutations) GetMutation(n string) (ret Mutation, okay bool)
return the mutation description for the passed input name.
func (*BlockMutations) Mutates ¶
func (m *BlockMutations) Mutates() bool
does this block type have any mutations?
func (*BlockMutations) Preregister ¶
func (m *BlockMutations) Preregister(blockType string, p block.Project) (err error)
register the mui container and all of its mui blocks with blockly
type MutatedBlock ¶
type MutatedBlock struct {
// contains filtered or unexported fields
}
each mutable workspace block contains one or more mutable inputs containing a list of atoms and connections to existing workspace blocks.
func (*MutatedBlock) ContainerName ¶
func (mb *MutatedBlock) ContainerName() string
func (*MutatedBlock) CreateFromMui ¶
func (mb *MutatedBlock) CreateFromMui(muiContainer block.Shape) (err error)
aka. compose -- turn the mui into new workspace inputs adds new inputs to target, returns the atoms for those inputs
func (*MutatedBlock) GetMutatedInput ¶
func (mb *MutatedBlock) GetMutatedInput(inputName string) (ret *MutatedInput, okay bool)
returns a MutatedInput if the named input was mutable.
func (*MutatedBlock) LoadMutation ¶
func (mb *MutatedBlock) LoadMutation(els *dom.BlockMutation) (err error)
LoadMutation, creating workspace inputs based on the recorded mutation
func (*MutatedBlock) SaveConnections ¶
func (mb *MutatedBlock) SaveConnections(muiContainer block.Shape) Storage
SaveConnections happens before any mui transformation
func (*MutatedBlock) SaveMutation ¶
func (mb *MutatedBlock) SaveMutation() (ret dom.BlockMutation)
serialize the mutation to xml friendly data
type MutatedBlocks ¶
type MutatedBlocks struct {
// contains filtered or unexported fields
}
maps workspace blocks to user edited mutation data. shared across every Mutator.
func NewMutatedBlocks ¶
func NewMutatedBlocks() *MutatedBlocks
create a new of mutable blocks. these blocks are editable by the user using the mutation ui.
func (*MutatedBlocks) CreateMutatedBlock ¶
func (mbs *MutatedBlocks) CreateMutatedBlock(main block.Shape, arch *BlockMutations, atomizer Atomizer) (ret *MutatedBlock)
func (*MutatedBlocks) GetMutatedBlock ¶
func (mbs *MutatedBlocks) GetMutatedBlock(main block.Shape) (*MutatedBlock, bool)
func (*MutatedBlocks) OnDelete ¶
func (mbs *MutatedBlocks) OnDelete(wsId, blockId string)
type MutatedInput ¶
type MutatedInput struct { InputName string // mutation that created us. Arch Mutation // list atoms created by the user Atoms []*AtomizedInput }
type Mutation ¶
type Mutation interface { // name of the original mutation type ( in blockly friendly format ) Name() string // quarks which can directly attach to the mutation's input Limits() block.Limits // returns an optional fixed-in-place first quark FirstBlock() (Quark, bool) // all quarks (mui bock types) available for this mutation Quarks(paletteOnly bool) (Quark, bool) }
the description of a single input's mutation
type Mutator ¶
type Mutator struct {
// contains filtered or unexported fields
}
instance data for mutations implements block.Mutator
func NewMutator ¶
func NewMutator(arch *BlockMutations, db Atomizer, mbs *MutatedBlocks) *Mutator
func (*Mutator) Compose ¶
create workspace inputs from the atoms the user selected and arranged in the mui popup
func (*Mutator) DomToMutation ¶
func (*Mutator) MutationToDom ¶
type Quark ¶
type Quark interface { // type name without including owner mutation Name() string // type name scoped to the owner mutation BlockType() string // mui block display name Label() string // the quark (names) this can connect to LimitsOfNext() block.Limits // expand this quark into a bundle of workspace items (fields and inputs) // item names are prefixed with "scope" to make them unique. Atomize(scope string, atomizer Atomizer) (block.Args, error) // next quark in the mutation NextQuark() (Quark, bool) }
Quark - a block in a mutation ui palette. supports iteration to the next quark in the palette.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
FIX: storing fields
func (*Store) Connections ¶
func (s *Store) Connections() []block.Connection