|
WSF
|
A WSF 'project'. Manages WSF sources files in a WSF project. More...
#include <Project.hpp>
Inherits QObject, and UtReferenceTracked.
Public Types | |
| typedef UtCallbackN< void()> | ParseCompleteCallback |
Public Slots | |
| void | ShowStartupFileDialog () |
Signals | |
| void | ParseUpdatedFull () |
| void | EventPipeRunConfigurationChanged () |
| void | Closed () |
Public Member Functions | |
| Project (ProjectWorkspace *aWorkspacePtr) | |
| Project (const Project &)=delete | |
| Project (Project &&)=default | |
| Project & | operator= (const Project &)=delete |
| Project & | operator= (Project &&)=default |
| ~Project () override | |
| QString | Name () const |
| TextSourceCache & | GetSourceCache () |
| void | AddComponent (const std::string &aName, std::unique_ptr< ProjectComponent > aComponent) |
| ProjectComponent * | FindComponent (const std::string &aName) |
| const UtPath & | ProjectDirectory () const |
| bool | SetProjectLocation (const UtPath &aProjDirPath, const UtPath &aProjFilePath) |
| bool | SetProjectDirectory (const UtPath &aPath) |
| bool | SetProjectFilePath (const UtPath &aPath) |
| long long | GetMinimumSequenceNumber () |
| AttributeSet * | FindOptions (const WsfPProxyNode &aNode) |
| AttributeSet * | FindOptions (const WsfPProxyPath &aPath) |
| AttributeSet * | GetOptions (const WsfPProxyNode &aNode) |
| std::vector< UtPath > | MapSearchPath () const |
| Paths to be searched for map data relating to this project. | |
| RevisionStore & | GetRevisionStore () |
| void | GotoRange (const UtTextDocumentRange &aRange) |
| Editor * | GotoFile (UtTextDocument *aSourcePtr, bool aRecordLocation=false) |
| Editor * | GotoFile (const std::string &aFilePath, bool aRecordLocation=true) |
| void | WaitForParsing () |
| Waits until the parsing thread is complete. This should only be called from the main thread. | |
| void | SaveAll (bool aSkipProject=true) |
| void | TriggerReparse () |
| void | InvalidateScenario (bool aInvalidateProxy=false) |
| void | FindIncludes (TextSource *aSourcePtr) |
| bool | SourceReloaded (TextSource *aSourcePtr) |
| ProjectWorkspace * | GetWorkspace () const |
| const std::string & | GetMapItemsXML () const |
| void | SetMapItemsXML (const std::string &aXml) |
| const std::vector< UtPath > & | GetStartupFiles () |
| void | SetStartupFiles (const std::vector< UtPath > &aMainFiles) |
| const std::vector< UtPath > & | GetProjectDirectories () const |
| bool | AddProjectDirectory (const UtPath &aPath) |
| void | RemoveProjectDirectory (const UtPath &aPath) |
| bool | IsDirectoryInProject (const UtPath &aPath) const |
| void | ShowSettings () |
| void | SetWorkingDirectory (const UtPath &aPath) |
| WsfExe * | GetExe () const |
| void | SetExe (WsfExe *aExePtr, bool aEmit) |
| void | SetCommandLineArgs (const QString &aArgs) |
| void | ExeUpdated (WsfExe *aExePtr) |
| void | WaitForAllParsing () |
| ParseResults * | TakeParseResults () |
| bool | IncludesFile (TextSource *aSourcePtr) |
| bool | IncludesStartupFile (TextSource *aSourcePtr) |
| void | GiveParseResults () |
| void | ProxyReady (std::unique_ptr< WsfPProxy > aProxy, std::unique_ptr< ProxyHash > aProxyHashPtr) |
| void | ExportProjectAction () |
| ParseWorker * | GetParseWorker () |
| void | InitParseResults () |
| ParseCompleteCallback * | ExecuteWhenParseComplete (ParseCompleteCallback *aCallbackPtr) |
| const UtPath & | WorkingDirectory () const |
| bool | ParseIsUpToDate () const |
| double | GetLastGrammarParseTime () const noexcept |
| double | GetLastInputParseTime () const noexcept |
| double | GetLastProxyDeserializeTime () const noexcept |
| double | GetLastProxyMergeGUI_Time () const noexcept |
| QString | GetCommandLineArgs () const |
| ParseResults * | GetParseResults () |
| ParseResultsTiny * | TinyParseResults () |
| ParseResults * | WaitForParseResults () const |
| void | ToXML (XML_Context &aContext) const |
| bool | FromXML (XML_Context &aContext) |
| bool | FromXML_StartupFile (XML_Context &aContext) |
| bool | SaveAs () |
| bool | SaveProject () |
| bool | ProjectFilePath (UtPath &aFilePath) const |
| bool | CloseProject (bool aForce=false) |
| CacheSourceProvider * | SourceProvider () const |
| WsfPProxy * | Proxy () const |
| void | HandleProxyNodeMoved (const WsfPProxyNode &, const WsfPProxyNode &) |
| void | AddProjectDirectoryBrowse () |
| void | ShowRevisionManager () |
| bool | OpenFile (const std::string &aFilePath) |
| bool | OpenFileInTextEditor (const std::string &aFilePath) |
| QString | GetCmdLineArgs () const |
| void | OpenAction () |
| void | BuildUpContextMenu (QMenu &aMenu) |
| void | UpdateProxyEpoch (const wizard::ProxyChange &aProxyChange) |
| void | UpdateProxyEpoch () |
| UtCalendar | GetStartDateTime () const |
Static Public Member Functions | |
| static Project * | Instance () |
| static QString | GetDefaultCommandLineArgs () |
Public Attributes | |
| UtCallbackListN< void(bool)> | ParseUpdated |
| Called whenever a parse is complete, as many as once per source modification. | |
| UtCallbackListN< void(bool)> | ParseUpdatedDeferred |
| UtCallbackListN< void()> | MainFileListChange |
Static Public Attributes | |
| static UtCallbackListN< void(Project *)> | ProjectClosing |
| static UtCallbackListN< void(Project *)> | RegisterComponents |
Friends | |
| class | ParseWorker |
| class | ProjectWorkspace |
| class | ProjectParseThread |
A WSF 'project'. Manages WSF sources files in a WSF project.
| typedef UtCallbackN<void()> wizard::Project::ParseCompleteCallback |
|
explicit |
References ExeUpdated(), wizard::WsfExe::ExeUpdated, GetDefaultCommandLineArgs(), GetSourceCache(), gProjectPtr, InitParseResults(), ParseWorker, RegisterComponents, and SetWorkingDirectory().
Referenced by operator=(), operator=(), Project(), and Project().
|
delete |
References Project().
|
default |
References Project().
|
override |
References gProjectPtr, and wizSignals.
| void wizard::Project::AddComponent | ( | const std::string & | aName, |
| std::unique_ptr< ProjectComponent > | aComponent ) |
Referenced by operator=().
| bool wizard::Project::AddProjectDirectory | ( | const UtPath & | aPath | ) |
References wizSignals.
Referenced by AddProjectDirectoryBrowse().
| void wizard::Project::AddProjectDirectoryBrowse | ( | ) |
References AddProjectDirectory().
| void wizard::Project::BuildUpContextMenu | ( | QMenu & | aMenu | ) |
|
signal |
References ShowStartupFileDialog().
Referenced by CloseProject().
| bool wizard::Project::CloseProject | ( | bool | aForce = false | ) |
References Closed(), GetParseResults(), ProjectClosing, and Proxy().
|
signal |
| wizard::Project::ParseCompleteCallback * wizard::Project::ExecuteWhenParseComplete | ( | ParseCompleteCallback * | aCallbackPtr | ) |
References ParseIsUpToDate().
Referenced by wizard::AutoCompletePopup::UpdateAutocomplete().
| void wizard::Project::ExeUpdated | ( | WsfExe * | aExePtr | ) |
References GetExe(), InitParseResults(), and InvalidateScenario().
Referenced by Project().
| void wizard::Project::ExportProjectAction | ( | ) |
References wizard::ExportFiles::ExportProject(), and WaitForParseResults().
| wizard::ProjectComponent * wizard::Project::FindComponent | ( | const std::string & | aName | ) |
Referenced by operator=().
| void wizard::Project::FindIncludes | ( | TextSource * | aSourcePtr | ) |
References wizard::ParseResults::FindIncludes(), and WaitForParseResults().
| wizard::AttributeSet * wizard::Project::FindOptions | ( | const WsfPProxyNode & | aNode | ) |
References wizard::AttributeSet::FindChild(), WsfPProxyNode::GetStablePath(), and WsfPProxyPath::size().
Referenced by FindOptions(), and HandleProxyNodeMoved().
| wizard::AttributeSet * wizard::Project::FindOptions | ( | const WsfPProxyPath & | aPath | ) |
References FindOptions(), GetParseResults(), and Proxy().
| bool wizard::Project::FromXML | ( | XML_Context & | aContext | ) |
| bool wizard::Project::FromXML_StartupFile | ( | XML_Context & | aContext | ) |
References wizard::XML_Context::GetReader().
Referenced by FromXML().
|
inline |
|
inline |
Referenced by wizard::ProjectSettingsDialog::Open().
|
static |
Referenced by wizard::ProjectSettingsDialog::ClearCommandLine(), FromXML(), and Project().
| wizard::WsfExe * wizard::Project::GetExe | ( | ) | const |
|
inlinenoexcept |
Get the time the WsfParseDefinitions spent parsing the WsfGrammar
|
inlinenoexcept |
Get the time the WsfParser spent parsing the input files
|
inlinenoexcept |
Get the time the WsfPProxyDeserialize spent deserializing the parse tree
|
inlinenoexcept |
Get the time the ProxyMerge spent merging the old and new WsfPProxys/Wizard spent updating its GUIs
|
inline |
| long long wizard::Project::GetMinimumSequenceNumber | ( | ) |
References wizard::ParseResultsTiny::mSequenceNumber, and TinyParseResults().
| wizard::AttributeSet * wizard::Project::GetOptions | ( | const WsfPProxyNode & | aNode | ) |
References wizard::AttributeSet::Child(), WsfPProxyNode::GetStablePath(), and WsfPProxyPath::size().
|
inline |
Referenced by CloseProject(), FindOptions(), wizard::InputContext::GetContext(), wizard::EditAssist::MakeAssistant(), wizard::RenameFileDialog::OkClick(), ProxyReady(), wizard::DragAndDrop::ReadProxyNodeListMime(), wizard::ProjectParseThread::SetTask(), wizard::RenameFileDialog::UpdateList(), and UpdateProxyEpoch().
|
inline |
References ParseWorker.
Referenced by wizard::ProjectParseThread::SetTask().
|
inline |
| wizard::RevisionStore & wizard::Project::GetRevisionStore | ( | ) |
Referenced by wizard::Editor::AcceptsClose(), and MapSearchPath().
| wizard::TextSourceCache & wizard::Project::GetSourceCache | ( | ) |
|
inline |
| const std::vector< UtPath > & wizard::Project::GetStartupFiles | ( | ) |
Referenced by FromXML(), wizard::Editor::GetShortName(), wizard::RenameFileDialog::OkClick(), and ShowStartupFileDialog().
|
inline |
| void wizard::Project::GiveParseResults | ( | ) |
Referenced by wizard::ProjectWorkspace::customEvent().
| wizard::Editor * wizard::Project::GotoFile | ( | const std::string & | aFilePath, |
| bool | aRecordLocation = true ) |
| wizard::Editor * wizard::Project::GotoFile | ( | UtTextDocument * | aSourcePtr, |
| bool | aRecordLocation = false ) |
Open the file and make it active.
| aSourcePtr | The source to open / activate. |
| aRecordLocation | If true, records the location for forward/backward navigation. |
Referenced by wizard::EditorHelpers::FindStartCursor(), FromXML(), wizard::Platform::GetAttributeDocumentRange(), wizard::Platform::GetEditRanges(), wizard::Environment::LoadScenario(), wizard::RenameFileDialog::OkClick(), OpenAction(), OpenFileInTextEditor(), wizard::EditAssist::ProcessUrl(), wizard::Platform::RemovePlatformFromEditor(), and wizard::EditorHelpers::ReplaceTextInEditor().
| void wizard::Project::GotoRange | ( | const UtTextDocumentRange & | aRange | ) |
| void wizard::Project::HandleProxyNodeMoved | ( | const WsfPProxyNode & | aSrc, |
| const WsfPProxyNode & | aDest ) |
| bool wizard::Project::IncludesFile | ( | TextSource * | aSourcePtr | ) |
References wizard::ParseResultsTiny::IncludesFile().
| bool wizard::Project::IncludesStartupFile | ( | TextSource * | aSourcePtr | ) |
| void wizard::Project::InitParseResults | ( | ) |
Referenced by ExeUpdated(), and Project().
|
static |
References gProjectPtr.
Referenced by wizard::Editor::AcceptsClose(), wizard::Signals::applyProxy(), wizard::RevisionStore::Backup(), wizard::ProjectWorkspace::CreateA_NewFile(), wizard::Util::CreateNewFile(), wizard::CreatePlatformDialog::CreatePlatform(), wizard::CreateTypeDialog::CreateTypeDialog(), wizard::WsfExecution::DebugSettingsString(), wizard::EditorHelpers::FindStartCursor(), wizard::Platform::GetAttributeDocumentRange(), wizard::Platform::GetEditRanges(), wizard::Editor::GetShortName(), wizard::Platform::GotoDefinition(), wizard::RenameFileDialog::OkClick(), wizard::RevisionStore::Open(), wizard::ContextMenuActions::OpenFileInProject::OpenFileInProject(), operator=(), wizard::PointOfInterestPropertiesWidget::PopulateFiles(), wizard::EditAssist::ProcessUrl(), wizard::RevisionStore::QueueAllProjectFiles(), wizard::DragAndDrop::ReadProxyNodeListMime(), wizard::WsfExeManager::Refresh(), wizard::WsfExeManager::Remove(), wizard::Platform::RemovePlatformFromEditor(), wizard::EditorHelpers::ReplaceTextInEditor(), wizard::RevisionStore::Restore(), wizard::Signals::revertVisualModeChanges(), and wizard::ProjectWorkspace::StartExecution().
| void wizard::Project::InvalidateScenario | ( | bool | aInvalidateProxy = false | ) |
References TakeParseResults(), and wizSignals.
Referenced by ExeUpdated(), wizard::WsfExeManager::Refresh(), SetExe(), SetStartupFiles(), SetWorkingDirectory(), and TriggerReparse().
| bool wizard::Project::IsDirectoryInProject | ( | const UtPath & | aPath | ) | const |
Referenced by BuildUpContextMenu().
| std::vector< UtPath > wizard::Project::MapSearchPath | ( | ) | const |
Paths to be searched for map data relating to this project.
References GetRevisionStore().
| QString wizard::Project::Name | ( | ) | const |
Referenced by operator=().
| void wizard::Project::OpenAction | ( | ) |
References GotoFile().
| bool wizard::Project::OpenFile | ( | const std::string & | aFilePath | ) |
References GetWorkspace(), wizard::Util::IsNonTextFile(), OpenFileInTextEditor(), and wizSignals.
Referenced by wizard::EditAssist::ProcessUrl().
| bool wizard::Project::OpenFileInTextEditor | ( | const std::string & | aFilePath | ) |
References GetWorkspace(), GotoFile(), and wizard::Util::IsNonTextFile().
Referenced by OpenFile().
References AddComponent(), FindComponent(), GetSourceCache(), Instance(), Name(), and Project().
|
inline |
Referenced by ExecuteWhenParseComplete(), and wizard::SyntaxTips::UpdateSuggestions().
|
signal |
|
inline |
Returns the directory WSF is expected to run from. This is important for finding includes with relative paths.
Referenced by wizard::ProjectSettingsDialog::Open(), ShowStartupFileDialog(), ToXML(), and wizard::RenameFileDialog::UpdateList().
| bool wizard::Project::ProjectFilePath | ( | UtPath & | aFilePath | ) | const |
| WsfPProxy * wizard::Project::Proxy | ( | ) | const |
Referenced by CloseProject(), FindOptions(), and wizard::Signals::revertVisualModeChanges().
| void wizard::Project::ProxyReady | ( | std::unique_ptr< WsfPProxy > | aProxy, |
| std::unique_ptr< ProxyHash > | aProxyHashPtr ) |
References wizard::Undo::ClearProxyChanges(), WsfPProxyPath::FromStringList(), GetParseResults(), wizard::ParseResultsProxyData::GetProxyHash(), GetWorkspace(), wizard::ParseResultsProxyData::GiveProxy(), wizard::Undo::Instance(), WsfPProxy::mHasModifications, wizard::ParseResultsProxyData::Proxy(), wizard::ParseResultsProxyData::ProxyRoot(), wizard::ParseResultsProxyData::SwapProxy(), UpdateProxyEpoch(), and wizard::WatchProxy().
Referenced by wizard::ProjectWorkspace::customEvent().
| void wizard::Project::RemoveProjectDirectory | ( | const UtPath & | aPath | ) |
References wizSignals.
| void wizard::Project::SaveAll | ( | bool | aSkipProject = true | ) |
References GetSourceCache(), and SaveProject().
Referenced by SaveProject().
| bool wizard::Project::SaveAs | ( | ) |
References SaveProject(), and SetProjectFilePath().
Referenced by SaveProject().
| bool wizard::Project::SaveProject | ( | ) |
| void wizard::Project::SetCommandLineArgs | ( | const QString & | aArgs | ) |
Referenced by wizard::ProjectSettingsDialog::OkClick().
| void wizard::Project::SetExe | ( | WsfExe * | aExePtr, |
| bool | aEmit ) |
References wizard::WsfExe::GetPath(), InvalidateScenario(), wizExeMgr, and wizSignals.
Referenced by FromXML(), and wizard::WsfExeManager::Remove().
|
inline |
| bool wizard::Project::SetProjectDirectory | ( | const UtPath & | aPath | ) |
References SetProjectLocation().
Referenced by wizard::Environment::LoadScenario(), and wizard::ProjectSettingsDialog::OkClick().
| bool wizard::Project::SetProjectFilePath | ( | const UtPath & | aPath | ) |
References SetProjectLocation().
Referenced by SaveAs().
| bool wizard::Project::SetProjectLocation | ( | const UtPath & | aProjDirPath, |
| const UtPath & | aProjFilePath ) |
References wizard::BackupPrefObject::Enabled(), wizard::Name, SetWorkingDirectory(), and wizSignals.
Referenced by FromXML(), wizard::ProjectWorkspace::NewProject(), SetProjectDirectory(), and SetProjectFilePath().
| void wizard::Project::SetStartupFiles | ( | const std::vector< UtPath > & | aMainFiles | ) |
References InvalidateScenario(), and wizSignals.
Referenced by wizard::Environment::LoadScenario(), wizard::RenameFileDialog::OkClick(), wizard::RevisionStore::Restore(), and ShowStartupFileDialog().
| void wizard::Project::SetWorkingDirectory | ( | const UtPath & | aPath | ) |
References InvalidateScenario().
Referenced by FromXML(), wizard::ProjectSettingsDialog::OkClick(), Project(), wizard::RevisionStore::Restore(), and SetProjectLocation().
| void wizard::Project::ShowRevisionManager | ( | ) |
References WorkingDirectory().
| void wizard::Project::ShowSettings | ( | ) |
References wizEnv.
|
slot |
References GetStartupFiles(), ProjectDirectory(), SetStartupFiles(), and wizard::StartupFilesDialog::startupFiles().
Referenced by Closed(), and wizard::ProjectSettingsDialog::Open().
|
inline |
| bool wizard::Project::SourceReloaded | ( | TextSource * | aSourcePtr | ) |
Called when a project item has been reloaded. This method should return 'true' when the source needs to be parsed
References wizard::ParseResultsTiny::IncludesFile(), and TinyParseResults().
| wizard::ParseResults * wizard::Project::TakeParseResults | ( | ) |
References wizSignals.
Referenced by InvalidateScenario(), and wizard::ProjectParseThread::SetTask().
|
inline |
Referenced by BuildUpContextMenu(), GetMinimumSequenceNumber(), wizard::Platform::GotoDefinition(), and SourceReloaded().
| void wizard::Project::ToXML | ( | XML_Context & | aContext | ) | const |
| void wizard::Project::TriggerReparse | ( | ) |
References InvalidateScenario().
Referenced by wizard::RevisionStore::Restore().
| void wizard::Project::UpdateProxyEpoch | ( | ) |
References WsfPProxyValue::GetAttr(), WsfPProxyValue::GetBoolValue(), WsfPProxyValue::GetIntegerValue(), GetParseResults(), WsfPProxyNode::GetValue(), WsfProxy::BasicValueT< T, PROXY_TYPE_ID >::GetValue(), WsfPProxyValue::IsUnset(), WsfPProxyNode::IsValid(), WsfPProxyValue::ValueToString(), and wizSignals.
| void wizard::Project::UpdateProxyEpoch | ( | const wizard::ProxyChange & | aProxyChange | ) |
References UpdateProxyEpoch().
Referenced by ProxyReady(), and UpdateProxyEpoch().
| void wizard::Project::WaitForAllParsing | ( | ) |
References GetWorkspace(), and WaitForParseResults().
Referenced by wizard::RevisionStore::Backup().
| wizard::ParseResults * wizard::Project::WaitForParseResults | ( | ) | const |
| void wizard::Project::WaitForParsing | ( | ) |
Waits until the parsing thread is complete. This should only be called from the main thread.
Referenced by wizard::RenameFileDialog::UpdateList().
| const UtPath & wizard::Project::WorkingDirectory | ( | ) | const |
|
friend |
References ParseWorker.
Referenced by GetParseWorker(), ParseWorker, Project(), and ProjectParseThread.
|
friend |
References ParseWorker, ProjectParseThread, and ProjectWorkspace.
Referenced by ProjectParseThread.
|
friend |
References ProjectWorkspace.
Referenced by GetWorkspace(), ProjectParseThread, and ProjectWorkspace.
| UtCallbackListN<void()> wizard::Project::MainFileListChange |
| UtCallbackListN<void(bool)> wizard::Project::ParseUpdated |
Called whenever a parse is complete, as many as once per source modification.
| UtCallbackListN<void(bool)> wizard::Project::ParseUpdatedDeferred |
Called after a short period of delay after editing when the parse is complete. This should be used if more expensive computations are required
Referenced by wizard::RevisionStore::Open().
|
static |
Referenced by CloseProject().
|
static |
Referenced by Project().