25#include "UtCalendar.hpp"
26#include "UtCallback.hpp"
27#include "UtCallbackHolder.hpp"
29#include "UtReferenceTracked.hpp"
30#include "UtWallClock.hpp"
39class UtTextDocumentRange;
88 void AddComponent(
const std::string& aName, std::unique_ptr<ProjectComponent> aComponent);
95 bool SetProjectLocation(
const UtPath& aProjDirPath,
const UtPath& aProjFilePath);
96 bool SetProjectDirectory(
const UtPath& aPath);
97 bool SetProjectFilePath(
const UtPath& aPath);
98 long long GetMinimumSequenceNumber();
120 void GotoRange(
const UtTextDocumentRange& aRange);
121 Editor*
GotoFile(UtTextDocument* aSourcePtr,
bool aRecordLocation =
false);
122 Editor*
GotoFile(
const std::string& aFilePath,
bool aRecordLocation =
true);
125 void SaveAll(
bool aSkipProject =
true);
137 const std::vector<UtPath>& GetStartupFiles();
138 void SetStartupFiles(
const std::vector<UtPath>& aMainFiles);
142 bool AddProjectDirectory(
const UtPath& aPath);
143 void RemoveProjectDirectory(
const UtPath& aPath);
144 bool IsDirectoryInProject(
const UtPath& aPath)
const;
146 void SetWorkingDirectory(
const UtPath& aPath);
148 void SetExe(
WsfExe* aExePtr,
bool aEmit);
149 void SetCommandLineArgs(
const QString& aArgs);
150 static QString GetDefaultCommandLineArgs();
151 void ExeUpdated(
WsfExe* aExePtr);
152 void WaitForAllParsing();
155 bool IncludesStartupFile(
TextSource* aSourcePtr);
156 void GiveParseResults();
157 void ProxyReady(std::unique_ptr<WsfPProxy> aProxy, std::unique_ptr<ProxyHash> aProxyHashPtr);
158 void ExportProjectAction();
160 void InitParseResults();
161 ParseCompleteCallback* ExecuteWhenParseComplete(ParseCompleteCallback* aCallbackPtr);
162 const UtPath& WorkingDirectory()
const;
185 bool ProjectFilePath(UtPath& aFilePath)
const;
186 bool CloseProject(
bool aForce =
false);
190 void AddProjectDirectoryBrowse();
191 void ShowRevisionManager();
192 bool OpenFile(
const std::string& aFilePath);
193 bool OpenFileInTextEditor(
const std::string& aFilePath);
197 void BuildUpContextMenu(QMenu& aMenu);
200 void UpdateProxyEpoch();
212 std::string GetXmlText()
const;
215 void WriteStartDocument(UtQtXmlWriter& aWriter)
const;
216 void WriteEndDocument(UtQtXmlWriter& aWriter)
const;
218 void P_CompleteGrammarParsing() noexcept;
220 void P_GrammarParsingStarted() noexcept;
222 void P_CompleteInputParsing() noexcept;
224 void P_InputParsingStarted() noexcept;
226 void P_CompleteProxyDeserialize() noexcept;
228 void P_NotifyParseUpdated() noexcept;
230 void P_ProxyDeserializeStarted() noexcept;
232 void P_CompleteProxyMergeGUI() noexcept;
234 void P_ProxyMergeGUI_Started() noexcept;
239 void P_ParsingAborted() noexcept;
244 void P_CompleteAllParsing() noexcept;
245 bool RequestClose(
bool aForce = false);
246 QAction* GoToLocationAction(const UtTextDocumentRange& aRange);
247 void DeferUpdate(
bool aFullyReparsed);
249 void CleanUpFileList();
251 QString ConstructTitle();
256 UtPath mProjectDirectory;
257 std::vector<UtPath> mProjectDirectories;
258 std::vector<UtPath> mStartupFiles;
263 UtCallbackHolder mUtCallbacks;
268 UtPath mProjectFilePath;
269 std::
string mLoadedXML;
274 std::
string mMapItemsXML;
276 UtCallbackListN<
void()> OneTimeParseComplete;
277 UtPath mWorkingDirectory;
278 std::
string mExePath;
279 QString mCmdLineArgs;
284 ComponentMap mComponents;
323 volatile
bool mParsingAllComplete;
327 bool mEpochListenerSetup{
false};
333 double mLastGrammarParseTime{0.0};
335 bool mGrammarParsingComplete{
false};
337 double mLastInputParseTime{0.0};
339 bool mInputParsingComplete{
false};
341 bool mProxyDeserializeComplete{
false};
343 double mLastProxyDeserializeTime{0.0};
345 bool mProxyMergeGUI_Complete{
false};
347 double mLastProxyMergeGUI_Time{0.0};
349 UtWallClock mParseTimer;
Q_DECLARE_METATYPE(wizard::ProjectWorkspace *)
#define VI_EXPORT
Definition ViExport.hpp:38
Definition WsfPProxyNode.hpp:60
Represents a path or unique key to a value in the proxy.
Definition WsfPProxyPath.hpp:64
Definition WsfPProxy.hpp:32
Definition AttributeSet.hpp:32
Provides sources to the WsfParser from the TextSourceCache instead of the files directly.
Definition TextSourceCache.hpp:57
Defines a subset of parse results which stay valid while computing the new parse results.
Definition ParseResults.hpp:118
Provides access to the results of parsing the WSF inputs.
Definition ParseResults.hpp:147
Definition ParseWorker.hpp:50
Definition ProjectComponent.hpp:21
Thread for parsing the WSF source in the background.
Definition ProjectParseThread.hpp:23
Definition ProjectWorkspace.hpp:48
A WSF 'project'. Manages WSF sources files in a WSF project.
Definition Project.hpp:66
UtCallbackListN< void()> MainFileListChange
Definition Project.hpp:116
static UtCallbackListN< void(Project *)> ProjectClosing
Definition Project.hpp:117
Project(const Project &)=delete
RevisionStore & GetRevisionStore()
Definition Project.cpp:1510
const std::string & GetMapItemsXML() const
Definition Project.hpp:134
UtCalendar GetStartDateTime() const
Definition Project.hpp:201
QString GetCmdLineArgs() const
Definition Project.hpp:194
void EventPipeRunConfigurationChanged()
void AddComponent(const std::string &aName, std::unique_ptr< ProjectComponent > aComponent)
Definition Project.cpp:1634
double GetLastInputParseTime() const noexcept
Definition Project.hpp:169
Editor * GotoFile(UtTextDocument *aSourcePtr, bool aRecordLocation=false)
Definition Project.cpp:182
QString Name() const
Definition Project.cpp:116
static Project * Instance()
Definition Project.cpp:111
Project(Project &&)=default
friend class ProjectParseThread
Definition Project.hpp:253
UtCallbackListN< void(bool)> ParseUpdatedDeferred
Definition Project.hpp:114
void GotoRange(const UtTextDocumentRange &aRange)
Definition Project.cpp:162
void ShowStartupFileDialog()
Definition Project.cpp:1265
bool SourceReloaded(TextSource *aSourcePtr)
Definition Project.cpp:145
void TriggerReparse()
Definition Project.cpp:329
const UtPath & ProjectDirectory() const
Definition Project.hpp:94
const std::vector< UtPath > & GetProjectDirectories() const
Definition Project.hpp:139
static UtCallbackListN< void(Project *)> RegisterComponents
Definition Project.hpp:118
ParseResultsTiny * TinyParseResults()
Definition Project.hpp:178
QString GetCommandLineArgs() const
Definition Project.hpp:176
friend class ProjectWorkspace
Definition Project.hpp:71
ProjectComponent * FindComponent(const std::string &aName)
Definition Project.cpp:1624
ProjectWorkspace * GetWorkspace() const
Definition Project.hpp:132
ParseResults * GetParseResults()
Definition Project.hpp:177
UtCallbackN< void()> ParseCompleteCallback
Definition Project.hpp:73
friend class ParseWorker
Definition Project.hpp:70
std::vector< UtPath > MapSearchPath() const
Paths to be searched for map data relating to this project.
TextSourceCache & GetSourceCache()
Definition Project.cpp:1362
double GetLastProxyMergeGUI_Time() const noexcept
Definition Project.hpp:175
void WaitForParsing()
Waits until the parsing thread is complete. This should only be called from the main thread.
Definition Project.cpp:157
void InvalidateScenario(bool aInvalidateProxy=false)
Definition Project.cpp:334
Project & operator=(Project &&)=default
double GetLastProxyDeserializeTime() const noexcept
Definition Project.hpp:172
Project(ProjectWorkspace *aWorkspacePtr)
Definition Project.cpp:81
UtCallbackListN< void(bool)> ParseUpdated
Called whenever a parse is complete, as many as once per source modification.
Definition Project.hpp:110
CacheSourceProvider * SourceProvider() const
Definition Project.hpp:187
void SetMapItemsXML(const std::string &aXml)
Definition Project.hpp:135
void SaveAll(bool aSkipProject=true)
Definition Project.cpp:300
Project & operator=(const Project &)=delete
bool ParseIsUpToDate() const
Definition Project.hpp:163
ParseWorker * GetParseWorker()
Definition Project.hpp:159
void FindIncludes(TextSource *aSourcePtr)
Definition Project.cpp:412
double GetLastGrammarParseTime() const noexcept
Definition Project.hpp:166
Records a change to proxy data.
Definition ProxyChange.hpp:21
Definition ProxyMerge.hpp:56
A high-level interface into the Change History database.
Definition RevisionStore.hpp:38
Definition TerrainMonitor.hpp:25
Definition TextSourceCache.hpp:35
Definition TextSource.hpp:48
Definition XML_Context.hpp:58
Template specialization for wsf::comm::Address. Allows usage of Address in std::unordered_map/set.
Definition WsfCommAddress.hpp:185