piv

package
v2.0.0-dev0.0.14 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2023 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package piv provides the PiView object for the full GUI view of the interactive parser (pi) system.

Index

Constants

This section is empty.

Variables

View Source
var PiViewType = gti.AddType(&gti.Type{
	Name:       "goki.dev/gide/v2/piv.PiView",
	ShortName:  "piv.PiView",
	IDName:     "pi-view",
	Doc:        "PiView provides the interactive GUI view for constructing and testing the\nlexer and parser",
	Directives: gti.Directives{},
	Fields: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{
		{"Parser", &gti.Field{Name: "Parser", Type: "goki.dev/pi/v2/pi.Parser", LocalType: "pi.Parser", Doc: "the parser we are viewing", Directives: gti.Directives{}, Tag: ""}},
		{"Prefs", &gti.Field{Name: "Prefs", Type: "goki.dev/gide/v2/piv.ProjPrefs", LocalType: "ProjPrefs", Doc: "project preferences -- this IS the project file", Directives: gti.Directives{}, Tag: ""}},
		{"Changed", &gti.Field{Name: "Changed", Type: "bool", LocalType: "bool", Doc: "has the root changed?  we receive update signals from root for changes", Directives: gti.Directives{}, Tag: "json:\"-\""}},
		{"FileState", &gti.Field{Name: "FileState", Type: "goki.dev/pi/v2/pi.FileState", LocalType: "pi.FileState", Doc: "our own dedicated filestate for controlled parsing", Directives: gti.Directives{}, Tag: "json:\"-\""}},
		{"TestBuf", &gti.Field{Name: "TestBuf", Type: "goki.dev/gi/v2/texteditor.Buf", LocalType: "texteditor.Buf", Doc: "test file buffer", Directives: gti.Directives{}, Tag: "json:\"-\""}},
		{"OutBuf", &gti.Field{Name: "OutBuf", Type: "goki.dev/gi/v2/texteditor.Buf", LocalType: "texteditor.Buf", Doc: "output buffer -- shows all errors, tracing", Directives: gti.Directives{}, Tag: "json:\"-\""}},
		{"LexBuf", &gti.Field{Name: "LexBuf", Type: "goki.dev/gi/v2/texteditor.Buf", LocalType: "texteditor.Buf", Doc: "buffer of lexified tokens", Directives: gti.Directives{}, Tag: "json:\"-\""}},
		{"ParseBuf", &gti.Field{Name: "ParseBuf", Type: "goki.dev/gi/v2/texteditor.Buf", LocalType: "texteditor.Buf", Doc: "buffer of parse info", Directives: gti.Directives{}, Tag: "json:\"-\""}},
		{"KeySeq1", &gti.Field{Name: "KeySeq1", Type: "goki.dev/goosi/events/key.Chord", LocalType: "key.Chord", Doc: "first key in sequence if needs2 key pressed", Directives: gti.Directives{}, Tag: ""}},
		{"OutMonRunning", &gti.Field{Name: "OutMonRunning", Type: "bool", LocalType: "bool", Doc: "is the output monitor running?", Directives: gti.Directives{}, Tag: "json:\"-\""}},
		{"OutMonMu", &gti.Field{Name: "OutMonMu", Type: "sync.Mutex", LocalType: "sync.Mutex", Doc: "mutex for updating, checking output monitor run status", Directives: gti.Directives{}, Tag: "json:\"-\""}},
	}),
	Embeds: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{
		{"Frame", &gti.Field{Name: "Frame", Type: "goki.dev/gi/v2/gi.Frame", LocalType: "gi.Frame", Doc: "", Directives: gti.Directives{}, Tag: ""}},
	}),
	Methods:  ordmap.Make([]ordmap.KeyVal[string, *gti.Method]{}),
	Instance: &PiView{},
})

PiViewType is the gti.Type for [PiView]

View Source
var SavedPaths gi.FilePaths

SavedPaths is a slice of strings that are file paths

View Source
var SavedPathsFileName = "gopi_saved_paths.toml"

SavedPathsFileName is the name of the saved file paths file in GoPi prefs directory

Functions

func InitPrefs

func InitPrefs()

InitPrefs is the overall init at startup for PiView project

func OpenPaths

func OpenPaths()

OpenPaths loads the active SavedPaths from prefs dir

func SavePaths

func SavePaths()

SavePaths saves the active SavedPaths to prefs dir

Types

type ProjPrefs

type ProjPrefs struct {

	// filename for project (i.e, these preference)
	ProjFile gi.FileName

	// filename for parser
	ParserFile gi.FileName

	// the file for testing
	TestFile gi.FileName

	// the options for tracing parsing
	TraceOpts parse.TraceOpts
}

ProjPrefs are the preferences for saving for a project -- this IS the project file

func (*ProjPrefs) Open

func (pf *ProjPrefs) Open(filename gi.FileName) error

Open open from file

func (*ProjPrefs) Save

func (pf *ProjPrefs) Save(filename gi.FileName) error

Save save to file

Jump to

Keyboard shortcuts

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