Code::Blocks
SVN r11506
|
The entry point singleton for working with projects. More...
#include <projectmanager.h>
Public Member Functions | |
cbProjectManagerUI & | GetUI () |
void | SetUI (cbProjectManagerUI *ui) |
const FilesGroupsAndMasks * | GetFilesGroupsAndMasks () const |
FilesGroupsAndMasks * | GetFilesGroupsAndMasks () |
wxString | GetDefaultPath () |
Retrieve the default path for new projects. More... | |
void | SetDefaultPath (const wxString &path) |
Set the default path for new projects. More... | |
bool | IsProjectStillOpen (cbProject *project) |
Is this a valid project? (i.e. More... | |
cbProject * | GetActiveProject () |
Retrieve the active project. More... | |
ProjectsArray * | GetProjects () |
Retrieve an array of all the opened projects. More... | |
cbProject * | IsOpen (const wxString &filename) |
Check if a project is open based on the project's filename. More... | |
void | SetProject (cbProject *project, bool refresh=true) |
Set the active project. More... | |
cbProject * | LoadProject (const wxString &filename, bool activateIt=true) |
Load a project from disk. More... | |
void | ReloadProject (cbProject *project) |
Reloads a project and tries to keep everything the same (project order, dependencies, active project) More... | |
bool | SaveProject (cbProject *project) |
Save a project to disk. More... | |
bool | SaveProjectAs (cbProject *project) |
Save a project to disk, asking for a filename. More... | |
bool | SaveActiveProject () |
Save the active project to disk. More... | |
bool | SaveActiveProjectAs () |
Save the active project to disk, asking for a filename. More... | |
bool | SaveAllProjects () |
Saves all projects to disk. More... | |
bool | CloseProject (cbProject *project, bool dontsave=false, bool refresh=true) |
Close a project. More... | |
bool | CloseActiveProject (bool dontsave=false) |
Close the active project. More... | |
bool | CloseAllProjects (bool dontsave=false) |
Close all projects. More... | |
cbProject * | NewProject (const wxString &filename=wxEmptyString) |
Create a new empty project. More... | |
int | AddFileToProject (const wxString &filename, cbProject *project=nullptr, int target=-1) |
Add a file to a project. More... | |
int | AddFileToProject (const wxString &filename, cbProject *project, wxArrayInt &targets) |
Add a file to a project. More... | |
int | AddMultipleFilesToProject (const wxArrayString &filelist, cbProject *project, int target=-1) |
Add multiple files to a project. More... | |
int | AddMultipleFilesToProject (const wxArrayString &filelist, cbProject *project, wxArrayInt &targets) |
Add multiple files to a project. More... | |
void | RemoveFileFromProject (ProjectFile *pfile, cbProject *project) |
Remove a file from a project. More... | |
bool | LoadWorkspace (const wxString &filename=DEFAULT_WORKSPACE) |
Load a workspace. More... | |
bool | SaveWorkspace () |
Save the open workspace. More... | |
bool | SaveWorkspaceAs (const wxString &filename) |
Save the open workspace under a different filename. More... | |
bool | CloseWorkspace () |
Close the workspace. More... | |
bool | IsLoadingProject () |
Check if the project manager is loading a project. More... | |
bool | IsLoadingWorkspace () |
Check if the project manager is loading a workspace. More... | |
bool | IsLoading () |
Check if the project manager is loading a project/workspace. More... | |
bool | IsClosingProject () |
Check if the project manager is closing a project. More... | |
bool | IsClosingWorkspace () |
Check if the project manager is closing a workspace. More... | |
bool | IsLoadingOrClosing () |
Check if the project manager is loading/closing a project/workspace. More... | |
cbWorkspace * | GetWorkspace () |
Get the current workspace filename. More... | |
bool | AddProjectDependency (cbProject *base, cbProject *dependsOn) |
Adds a project as a dependency of another project. More... | |
void | RemoveProjectDependency (cbProject *base, cbProject *doesNotDependOn) |
Removes a project dependency. More... | |
void | ClearProjectDependencies (cbProject *base) |
Removes all dependencies from project base . More... | |
void | RemoveProjectFromAllDependencies (cbProject *base) |
Removes the project base from being a dependency of any other project. More... | |
const ProjectsArray * | GetDependenciesForProject (cbProject *base) |
Get the array of projects base depends on. More... | |
bool | CausesCircularDependency (cbProject *base, cbProject *dependsOn) |
Checks for circular dependencies between base and dependsOn . More... | |
void | WorkspaceChanged () |
Sends message to the plugins that the workspace has been changed. More... | |
bool | BeginLoadingProject () |
Begins the project loading process. More... | |
void | EndLoadingProject (cbProject *project) |
Ends the project loading process. More... | |
bool | BeginLoadingWorkspace () |
Begins the workspace loading process. More... | |
void | EndLoadingWorkspace () |
Ends the workspace loading process. More... | |
ProjectManager & | operator= (cb_unused const ProjectManager &rhs) |
void | SetIsRunning (cbPlugin *plugin) |
This method should be called when the applications is started by a plugin. More... | |
cbPlugin * | GetIsRunning () const |
Return a pointer to the plugin which is running the application. More... | |
cbProject * | FindProjectForFile (const wxString &file, ProjectFile **resultFile, bool isRelative, bool isUnixFilename) |
Return the project which has the file in it, also return the pointer to the ProjectFile object. More... | |
Static Public Member Functions | |
static bool | CanShutdown () |
Can the app shutdown? (actually: is ProjectManager busy at the moment?) More... | |
static bool | IsBusy () |
For use with plugins. More... | |
Static Public Member Functions inherited from Mgr< ProjectManager > | |
static bool | Valid () |
static ProjectManager * | Get () |
static void | Free () |
Private Member Functions | |
ProjectManager (cb_unused const ProjectManager &rhs) | |
ProjectManager () | |
~ProjectManager () override | |
void | OnAppDoneStartup (CodeBlocksEvent &event) |
int | DoAddFileToProject (const wxString &filename, cbProject *project, wxArrayInt &targets) |
Private Attributes | |
cbProjectManagerUI * | m_ui |
cbProject * | m_pActiveProject |
cbProject * | m_pProjectToActivate |
ProjectsArray * | m_pProjects |
DepsMap | m_ProjectDeps |
cbWorkspace * | m_pWorkspace |
FilesGroupsAndMasks * | m_pFileGroups |
bool | m_IsLoadingProject |
bool | m_IsLoadingWorkspace |
bool | m_IsClosingProject |
bool | m_IsClosingWorkspace |
wxString | m_InitialDir |
bool | m_CanSendWorkspaceChanged |
cbPlugin * | m_RunningPlugin |
Static Private Attributes | |
static bool | s_CanShutdown = true |
Friends | |
class | Mgr< ProjectManager > |
class | Manager |
Additional Inherited Members | |
Protected Member Functions inherited from Mgr< ProjectManager > | |
Mgr () | |
virtual | ~Mgr () |
The entry point singleton for working with projects.
This is the project manager class. It handles all open projects and workspaces. It is through this class that you make requests about projects, like open a project, save it, set the active project (if more than one are opened), etc. To access a project, you must retrieve it from this class.
As all managers, this is a singleton class which you retrieve by asking the global Manager singleton. E.g. Manager::Get()->GetProjectManager()
Definition at line 142 of file projectmanager.h.
|
private |
|
private |
Definition at line 75 of file projectmanager.cpp.
References _T, cbEVT_APP_STARTUP_DONE, Manager::Get(), Manager::GetAppWindow(), wxFileName::GetCwd(), m_InitialDir, m_pActiveProject, m_pFileGroups, m_pProjects, m_pProjectToActivate, OnAppDoneStartup(), and Manager::RegisterEventSink().
|
overrideprivate |
Definition at line 104 of file projectmanager.cpp.
References m_pFileGroups, m_pProjects, m_pWorkspace, and m_ui.
int ProjectManager::AddFileToProject | ( | const wxString & | filename, |
cbProject * | project = nullptr , |
||
int | target = -1 |
||
) |
Add a file to a project.
This function comes in two versions. This version, expects a single build target index for the added file to belong to.
filename | The file to add to the project. |
project | The project to add this file to. If NULL, the active project is used. |
target | The index of the project's build target to add this file. |
Definition at line 711 of file projectmanager.cpp.
References GetActiveProject().
Referenced by Wiz::CopyFiles(), MainFrame::OnFileNewWhat(), Wiz::RunProjectWizard(), and EditorManager::SwapActiveHeaderSource().
int ProjectManager::AddFileToProject | ( | const wxString & | filename, |
cbProject * | project, | ||
wxArrayInt & | targets | ||
) |
Add a file to a project.
This function comes in two versions. This version, expects an array of build target indices for the added file to belong to.
filename | The file to add to the project. |
project | The project to add this file to. If NULL, the active project is used. |
targets | The array of the project's build targets indices to add this file. |
Definition at line 723 of file projectmanager.cpp.
References cbEVT_PROJECT_FILE_ADDED, DoAddFileToProject(), Manager::Get(), GetActiveProject(), Manager::GetPluginManager(), and PluginManager::NotifyPlugins().
int ProjectManager::AddMultipleFilesToProject | ( | const wxArrayString & | filelist, |
cbProject * | project, | ||
int | target = -1 |
||
) |
Add multiple files to a project.
This function comes in two versions. This version, expects a single build target index for the added files to belong to.
filelist | The files to add to the project. |
project | The project to add these files to. If NULL, the active project is used. |
target | The index of the project's build target to add these files. |
Definition at line 739 of file projectmanager.cpp.
References GetActiveProject().
Referenced by ProjectManagerUI::OnAddFilesToProjectRecursively(), and ProjectManagerUI::OnAddFileToProject().
int ProjectManager::AddMultipleFilesToProject | ( | const wxArrayString & | filelist, |
cbProject * | project, | ||
wxArrayInt & | targets | ||
) |
Add multiple files to a project.
This function comes in two versions. This version, expects an array of build target indices for the added files to belong to.
filelist | The files to add to the project. |
project | The project to add this file to. If NULL, the active project is used. |
targets | The array of the project's build targets indices to add this file. |
Definition at line 751 of file projectmanager.cpp.
References _(), wxArrayString::Add(), cbProject::BeginAddFiles(), cbEVT_PROJECT_FILE_ADDED, DoAddFileToProject(), cbProject::EndAddFiles(), Manager::Get(), GetActiveProject(), Manager::GetAppFrame(), wxArrayString::GetCount(), Manager::GetPluginManager(), and PluginManager::NotifyPlugins().
Adds a project as a dependency of another project.
Projects inside workspaces allow you to set dependencies between them. When project A depends on project B, this means that before building project A, project B will be built because it obviously generates code that project A depends upon.
base | The project to set a dependency for. |
dependsOn | the project that must be built before base project. |
Definition at line 811 of file projectmanager.cpp.
References _T, CausesCircularDependency(), LogManager::DebugLog(), F(), Manager::Get(), Manager::GetLogManager(), CompileTargetBase::GetTitle(), m_ProjectDeps, m_pWorkspace, cbWorkspace::SetModified(), wxString::wx_str(), and wxNOT_FOUND.
Referenced by WorkspaceLoader::Open(), ScriptBindings::RegisterBindings(), and ReloadProject().
bool ProjectManager::BeginLoadingProject | ( | ) |
Begins the project loading process.
Only to be used by code that needs it (e.g. project importers).
Definition at line 983 of file projectmanager.cpp.
References _(), _T, cbMessageBox(), Manager::Get(), m_IsLoadingProject, and s_CanShutdown.
Referenced by LoadProject(), and NewProject().
bool ProjectManager::BeginLoadingWorkspace | ( | ) |
Begins the workspace loading process.
Only to be used by code that needs it (e.g. workspace importers).
Definition at line 1053 of file projectmanager.cpp.
References cbProjectManagerUI::BeginLoadingWorkspace(), CloseWorkspace(), m_IsLoadingWorkspace, and m_ui.
Referenced by LoadWorkspace().
|
inlinestatic |
Can the app shutdown? (actually: is ProjectManager busy at the moment?)
Definition at line 157 of file projectmanager.h.
Referenced by MainFrame::OnApplicationClose(), MainFrame::OnFileCloseProject(), and MainFrame::OnFileMenuUpdateUI().
Checks for circular dependencies between base
and dependsOn
.
Definition at line 787 of file projectmanager.cpp.
References GetDependenciesForProject().
Referenced by AddProjectDependency().
void ProjectManager::ClearProjectDependencies | ( | cbProject * | base | ) |
Removes all dependencies from project base
.
base | The project to remove all dependencies from. |
Definition at line 865 of file projectmanager.cpp.
References _T, LogManager::DebugLog(), Manager::Get(), Manager::GetLogManager(), CompileTargetBase::GetTitle(), m_ProjectDeps, m_pWorkspace, and cbWorkspace::SetModified().
Referenced by CloseProject(), ScriptBindings::RegisterBindings(), and ProjectDepsDlg::SaveList().
bool ProjectManager::CloseActiveProject | ( | bool | dontsave = false | ) |
Close the active project.
Same as CloseProject(GetActiveProject()).
Definition at line 472 of file projectmanager.cpp.
References CloseProject(), m_pActiveProject, m_pProjects, and SetProject().
Referenced by MainFrame::OnFileCloseProject(), and ScriptBindings::RegisterBindings().
bool ProjectManager::CloseAllProjects | ( | bool | dontsave = false | ) |
Close all projects.
Definition at line 385 of file projectmanager.cpp.
References CloseProject(), cbProjectManagerUI::FreezeTree(), Manager::IsAppShuttingDown(), wxString::IsEmpty(), m_InitialDir, m_IsClosingProject, m_pProjects, m_ui, cbProjectManagerUI::QueryCloseAllProjects(), cbProjectManagerUI::RebuildTree(), wxFileName::SetCwd(), cbProjectManagerUI::UnfreezeTree(), and WorkspaceChanged().
Referenced by CloseWorkspace(), and ScriptBindings::RegisterBindings().
bool ProjectManager::CloseProject | ( | cbProject * | project, |
bool | dontsave = false , |
||
bool | refresh = true |
||
) |
Close a project.
project | A pointer to the project to close. |
dontsave | Force not (!) saving the project on close. |
refresh | Force a refresh of the project tree after closing a project. |
Definition at line 419 of file projectmanager.cpp.
References cbEVT_PROJECT_CLOSE, ClearProjectDependencies(), cbProject::CloseAllFiles(), Manager::Get(), cbProject::GetCurrentlyCompilingTarget(), Manager::GetEditorManager(), Manager::GetPluginManager(), wxString::IsEmpty(), m_InitialDir, m_IsClosingProject, m_pActiveProject, m_pProjects, m_pWorkspace, m_ui, PluginManager::NotifyPlugins(), cbProjectManagerUI::QueryCloseProject(), cbProjectManagerUI::RemoveProject(), RemoveProjectFromAllDependencies(), cbProject::SaveLayout(), wxFileName::SetCwd(), cbWorkspace::SetModified(), SetProject(), EditorManager::UpdateProjectFiles(), WorkspaceChanged(), and wxNOT_FOUND.
Referenced by CloseActiveProject(), CloseAllProjects(), ProjectManagerUI::OnCloseProject(), ScriptBindings::RegisterBindings(), and ReloadProject().
bool ProjectManager::CloseWorkspace | ( | ) |
Close the workspace.
Definition at line 587 of file projectmanager.cpp.
References cbEVT_WORKSPACE_CLOSING_BEGIN, cbEVT_WORKSPACE_CLOSING_COMPLETE, CloseAllProjects(), cbProjectManagerUI::CloseWorkspace(), Manager::Get(), Manager::GetPluginManager(), Manager::IsBatchBuild(), m_IsClosingWorkspace, m_pWorkspace, m_ui, PluginManager::NotifyPlugins(), cbProjectManagerUI::QueryCloseWorkspace(), and WorkspaceChanged().
Referenced by BeginLoadingWorkspace(), MainFrame::DoCloseCurrentWorkspace(), EndLoadingWorkspace(), ProjectManagerUI::OnCloseWorkspace(), and ScriptBindings::RegisterBindings().
|
private |
Definition at line 670 of file projectmanager.cpp.
References ProjectFile::AddBuildTarget(), cbProject::AddFile(), cbProjectManagerUI::AskForMultiBuildTargetIndex(), CompileTargetBase::GetBasePath(), cbProject::GetBuildTarget(), cbProject::GetBuildTargetsCount(), wxFileName::GetFullPath(), CompileTargetBase::GetTitle(), m_ui, wxFileName::MakeRelativeTo(), wxFileName::Normalize(), wxPATH_NORM_ABSOLUTE, and wxPATH_NORM_DOTS.
Referenced by AddFileToProject(), and AddMultipleFilesToProject().
void ProjectManager::EndLoadingProject | ( | cbProject * | project | ) |
Ends the project loading process.
Only to be used by code that needs it (e.g. project importers).
project | The loaded project. |
Definition at line 1002 of file projectmanager.cpp.
References UserVariableManager::Arrogate(), cbEVT_PROJECT_OPEN, cbProjectManagerUI::FinishLoadingProject(), Manager::Get(), cbProject::GetShowNotesOnLoad(), Manager::GetUserVariableManager(), cbProject::LoadLayout(), m_IsLoadingProject, m_IsLoadingWorkspace, m_pFileGroups, m_pProjects, m_pWorkspace, m_ui, Manager::ProcessEvent(), s_CanShutdown, cbWorkspace::SetModified(), cbProject::ShowNotes(), and WorkspaceChanged().
Referenced by LoadProject(), and NewProject().
void ProjectManager::EndLoadingWorkspace | ( | ) |
Ends the workspace loading process.
Only to be used by code that needs it (e.g. workspace importers).
Definition at line 1070 of file projectmanager.cpp.
References _(), UserVariableManager::Arrogate(), cbEVT_PROJECT_OPEN, cbMessageBox(), CloseWorkspace(), cbProjectManagerUI::FinishLoadingWorkspace(), wxString::Format(), Manager::Get(), cbProject::GetNotes(), Manager::GetPluginManager(), cbProject::GetShowNotesOnLoad(), cbWorkspace::GetTitle(), Manager::GetUserVariableManager(), wxString::IsEmpty(), cbWorkspace::IsOK(), m_IsLoadingWorkspace, m_pActiveProject, m_pProjects, m_pProjectToActivate, m_pWorkspace, m_ui, PluginManager::NotifyPlugins(), SetProject(), cbProject::ShowNotes(), WorkspaceChanged(), wxICON_QUESTION, wxID_YES, and wxYES_NO.
Referenced by LoadWorkspace().
cbProject * ProjectManager::FindProjectForFile | ( | const wxString & | file, |
ProjectFile ** | resultFile, | ||
bool | isRelative, | ||
bool | isUnixFilename | ||
) |
Return the project which has the file in it, also return the pointer to the ProjectFile object.
Definition at line 1147 of file projectmanager.cpp.
References cbProject::GetFileByFilename(), and m_pProjects.
Referenced by DebuggerState::AddBreakpoint(), EditorManager::CheckForExternallyModifiedFiles(), EditorManager::Open(), EditorBase::SetTitle(), and cbAuiNotebook::UniqueIdFromTooltip().
|
inline |
Retrieve the active project.
Most of the times, this is the function you 'll be calling in ProjectManager.
Definition at line 177 of file projectmanager.h.
Referenced by AddFileToProject(), AddMultipleFilesToProject(), CompilerGCC::AskForActiveProject(), ProjectManagerUI::AskForBuildTargetIndex(), ProjectManagerUI::AskForMultiBuildTargetIndex(), CodeBlocksApp::BatchJob(), EditorManager::CollectDefines(), DebuggerGDB::Debug(), CompilerErrors::DoGotoError(), cbEditor::DoInitializations(), CodeCompletion::DoParseOpenedProjectAndActiveEditor(), MainFrame::DoUpdateAppTitle(), FilePathPanel::FilePathPanel(), FindReplaceDlg::FindReplaceDlg(), DebuggerManager::FindTargetsDebugger(), NativeParser::GetCurrentProject(), MainFrame::GetEditorDescription(), NativeParser::GetProjectByFilename(), FindReplaceDlg::GetTarget(), CompilerGCC::IsValidTarget(), ProjectManagerUI::OnAddFilesToProjectRecursively(), ProjectManagerUI::OnAddFileToProject(), EditorManager::OnAddFileToProject(), FilePathPanel::OnbtnBrowseClick(), ProjectManagerUI::OnCloseProject(), cbEditor::OnContextMenuEntry(), ProjectManagerUI::OnExecParameters(), MainFrame::OnFileMenuUpdateUI(), MainFrame::OnFileNewWhat(), MainFrame::OnFileSaveProject(), MainFrame::OnFileSaveProjectAs(), ProjectManagerUI::OnGotoFile(), ProjectManagerUI::OnKeyDown(), WizBuildTargetPanel::OnPageChanging(), NativeParser::OnParsingOneByOneTimer(), CompilerGCC::OnProjectActivated(), ProjectManagerUI::OnProjectFileActivated(), ProjectManagerUI::OnProperties(), ProjectManagerUI::OnRightClick(), DisassemblyDlg::OnSave(), FindReplaceDlg::OnSelectTarget(), ProjectManagerUI::OnSetActiveProject(), DebuggerMenuHandler::OnUpdateUI(), DebuggerToolbarHandler::OnUpdateUI(), ProjectManagerUI::OnUpdateUI(), CompilerGCC::OnUpdateUI(), CodeCompletion::OnWorkspaceChanged(), ProjectManagerUI::RebuildTree(), ScriptBindings::RegisterBindings(), MacrosManager::ReplaceMacros(), Wiz::RunTargetWizard(), WorkspaceLoader::SaveLayout(), FilePathPanel::SetAddToProject(), ProjectManagerUI::ShowMenu(), EditorManager::SwapActiveHeaderSource(), cbDebuggerPlugin::SyncEditor(), and cbDebuggerPlugin::ToolMenuEnabled().
wxString ProjectManager::GetDefaultPath | ( | ) |
Retrieve the default path for new projects.
Definition at line 138 of file projectmanager.cpp.
References _T, wxString::Append(), Manager::Get(), Manager::GetConfigManager(), wxString::IsEmpty(), wxString::Last(), ConfigManager::Read(), and wxEmptyString.
Referenced by WizProjectPathPanel::OnPageChanged(), and ScriptBindings::RegisterBindings().
const ProjectsArray * ProjectManager::GetDependenciesForProject | ( | cbProject * | base | ) |
Get the array of projects base
depends on.
base | The project to get its dependencies. |
base
. Definition at line 922 of file projectmanager.cpp.
References m_ProjectDeps.
Referenced by CompilerGCC::CalculateProjectDependencies(), CausesCircularDependency(), ProjectDepsDlg::FillList(), ScriptBindings::RegisterBindings(), and WorkspaceLoader::Save().
|
inline |
Definition at line 153 of file projectmanager.h.
Referenced by ProjectManagerUI::FinishLoadingProject(), ProjectManagerUI::OnAddFilesToProjectRecursively(), ProjectManagerUI::OnViewFileMasks(), and ProjectManagerUI::RebuildTree().
|
inline |
Definition at line 154 of file projectmanager.h.
cbPlugin * ProjectManager::GetIsRunning | ( | ) | const |
Return a pointer to the plugin which is running the application.
Definition at line 1142 of file projectmanager.cpp.
References m_RunningPlugin.
Referenced by CompilerGCC::BuildModuleMenu(), CompilerGCC::KillProcess(), CompilerGCC::NotifyJobDone(), cbDebuggerPlugin::OnCompilerFinished(), DebuggerMenuHandler::OnRunToCursor(), DebuggerMenuHandler::OnStart(), DebuggerMenuHandler::OnStep(), DebuggerMenuHandler::OnUpdateUI(), DebuggerToolbarHandler::OnUpdateUI(), ProjectManagerUI::OnUpdateUI(), and CompilerGCC::OnUpdateUI().
|
inline |
Retrieve an array of all the opened projects.
This is a standard wxArray containing pointers to projects. Using this array you can iterate through all the opened projects.
Definition at line 183 of file projectmanager.h.
References DEFAULT_WORKSPACE, and wxEmptyString.
Referenced by CompilerGCC::CalculateProjectDependencies(), CompilerGCC::CalculateWorkspaceDependencies(), ProjectManagerUI::CheckForExternallyModifiedProjects(), cbProject::CreateUniqueFilename(), DebuggerGDB::DoDebug(), CompilerGCC::DoWorkspaceBuild(), ProjectDepsDlg::FillList(), FindReplace::FindInFiles(), FindReplaceDlg::FindReplaceDlg(), NativeParser::GetProjectByFilename(), ProjectManagerUI::MoveProjectDown(), ProjectManagerUI::MoveProjectUp(), ProjectManagerUI::OnCloseProject(), ProjectManagerUI::OnFindFile(), ProjectManagerUI::OnGotoFile(), NativeParser::OnParsingOneByOneTimer(), CodeCompletion::OnProjectSavedTimer(), FindReplaceDlg::OnSearchProject(), ProjectManagerUI::OnSetActiveProject(), CompilerGCC::PreprocessJob(), ProjectDepsDlg::ProjectDepsDlg(), ScriptBindings::ProjectManager_GetProject(), ScriptBindings::ProjectManager_GetProjectCount(), ProjectManagerUI::QueryCloseAllProjects(), ProjectManagerUI::RebuildTree(), FindReplace::ReplaceInFiles(), CompilerGCC::ResetBuildState(), WorkspaceLoader::Save(), ProjectDepsDlg::SaveList(), MainFrame::ShowHideStartPage(), and ProjectManagerUI::ShowMenu().
|
inline |
Definition at line 150 of file projectmanager.h.
Referenced by ProjectManagerUI::CheckForExternallyModifiedProjects(), NativeParser::CreateClassBrowser(), CompilerGCC::DoSwitchProjectTemporarily(), ProjectFileOptionsDlg::EndModal(), TemplateManager::NewProjectFromUserTemplate(), EditorManager::OnAddFileToProject(), cbEditor::OnContextMenuEntry(), ProjectOptionsDlg::OnCreateImportFileClick(), CompilerGCC::OnProjectCompilerOptions(), ProjectOptionsDlg::OnProjectDepsClick(), EditorManager::OnRemoveFileFromProject(), CodeCompletion::OnSelectedFileReparse(), EditorManager::OnShowFileInTree(), ScriptBindings::ProjectManager_RebuildTree(), NativeParser::RemoveClassBrowser(), NativeParser::ReparseSelectedProject(), Wiz::RunProjectWizard(), ProjectFile::SetFileState(), and EditorManager::SwapActiveHeaderSource().
cbWorkspace * ProjectManager::GetWorkspace | ( | ) |
Get the current workspace filename.
Definition at line 535 of file projectmanager.cpp.
References _(), _T, m_pWorkspace, cbWorkspace::SetModified(), and cbWorkspace::SetTitle().
Referenced by MacrosManager::ClearProjectKeys(), CompilerGCC::DoRecreateTargetMenu(), CompilerGCC::InitBuildLog(), WorkspaceLoader::LoadLayout(), ProjectManagerUI::MoveProjectDown(), ProjectManagerUI::MoveProjectUp(), ProjectManagerUI::OnCloseWorkspace(), MainFrame::OnFileMenuUpdateUI(), MainFrame::OnFileOpenDefWorkspace(), MainFrame::OnFileSaveAll(), MainFrame::OnFileSaveWorkspace(), MainFrame::OnFileSaveWorkspaceAs(), ProjectManagerUI::OnFindFile(), ProjectManagerUI::OnProjectFileActivated(), ProjectManagerUI::OnRenameWorkspace(), ProjectManagerUI::OnRightClick(), ProjectManagerUI::OnSaveAsWorkspace(), ProjectManagerUI::OnSaveWorkspace(), CompilerGCC::OnSelectTarget(), ProjectManagerUI::QueryCloseWorkspace(), ProjectManagerUI::RebuildTree(), WorkspaceLoader::SaveLayout(), SaveWorkspace(), SaveWorkspaceAs(), and ProjectManagerUI::ShowMenu().
|
static |
For use with plugins.
Checks whether files in the project MAY be processed. This function has been made static for your convenience :)
Definition at line 627 of file projectmanager.cpp.
References Manager::Get(), Manager::GetProjectManager(), Manager::IsAppShuttingDown(), and IsLoadingOrClosing().
Referenced by CodeCompletion::OnEditorActivated(), CodeCompletion::OnEditorSave(), CodeCompletion::OnProjectActivated(), CodeCompletion::OnReparsingTimer(), cbEditor::OnScintillaEvent(), CodeCompletion::OnToolbarTimer(), and WorkspaceChanged().
bool ProjectManager::IsClosingProject | ( | ) |
Check if the project manager is closing a project.
Definition at line 659 of file projectmanager.cpp.
References m_IsClosingProject.
bool ProjectManager::IsClosingWorkspace | ( | ) |
Check if the project manager is closing a workspace.
Definition at line 664 of file projectmanager.cpp.
References m_IsClosingWorkspace.
bool ProjectManager::IsLoading | ( | ) |
Check if the project manager is loading a project/workspace.
Definition at line 654 of file projectmanager.cpp.
References m_IsLoadingProject, and m_IsLoadingWorkspace.
Referenced by EditorManager::Open(), and UserVariableManager::Replace().
bool ProjectManager::IsLoadingOrClosing | ( | ) |
Check if the project manager is loading/closing a project/workspace.
Definition at line 639 of file projectmanager.cpp.
References m_IsClosingProject, m_IsClosingWorkspace, m_IsLoadingProject, and m_IsLoadingWorkspace.
Referenced by IsBusy().
bool ProjectManager::IsLoadingProject | ( | ) |
Check if the project manager is loading a project.
Definition at line 644 of file projectmanager.cpp.
References m_IsLoadingProject.
Referenced by ProjectManagerUI::OnCloseProject(), and ProjectManagerUI::OnSaveProject().
bool ProjectManager::IsLoadingWorkspace | ( | ) |
Check if the project manager is loading a workspace.
Definition at line 649 of file projectmanager.cpp.
References m_IsLoadingWorkspace.
Check if a project is open based on the project's filename.
filename | The project's filename. Must be an absolute path. |
Definition at line 187 of file projectmanager.cpp.
References CompileTargetBase::GetFilename(), wxString::IsEmpty(), wxString::Lower(), m_pProjects, wxString::Matches(), and realpath().
Referenced by WorkspaceLoader::LoadLayout(), LoadProject(), NewProject(), WorkspaceLoader::Open(), MainFrame::OpenGeneric(), and ScriptBindings::RegisterBindings().
bool ProjectManager::IsProjectStillOpen | ( | cbProject * | project | ) |
Is this a valid project? (i.e.
is it still open?)
project | The project to check its validity. |
Definition at line 151 of file projectmanager.cpp.
References m_pProjects.
Load a project from disk.
This function, internally, uses IsOpen() so that the same project can't be loaded twice.
filename | The project file's filename. |
activateIt | Active the project after loading. |
Definition at line 213 of file projectmanager.cpp.
References BeginLoadingProject(), EndLoadingProject(), FileTypeOf(), ftCodeBlocksProject, Manager::Get(), PluginManager::GetMIMEHandlerForFile(), Manager::GetPluginManager(), cbProject::IsLoaded(), IsOpen(), m_IsLoadingWorkspace, m_pProjectToActivate, cbMimePlugin::OpenFile(), SetProject(), and wxFileExists().
Referenced by MainFrame::DoOpenProject(), TemplateManager::NewProjectFromUserTemplate(), WorkspaceLoader::Open(), ScriptBindings::RegisterBindings(), and ReloadProject().
bool ProjectManager::LoadWorkspace | ( | const wxString & | filename = DEFAULT_WORKSPACE | ) |
Load a workspace.
filename | The workspace to open. |
Definition at line 547 of file projectmanager.cpp.
References BeginLoadingWorkspace(), cbEVT_WORKSPACE_LOADING_COMPLETE, EndLoadingWorkspace(), Manager::Get(), Manager::GetPluginManager(), cbWorkspace::IsOK(), m_pActiveProject, m_pProjects, m_pWorkspace, PluginManager::NotifyPlugins(), and SetProject().
Referenced by MainFrame::OnFileOpenDefWorkspace(), CodeBlocksApp::OnInit(), MainFrame::OpenGeneric(), and ScriptBindings::RegisterBindings().
cbProject * ProjectManager::NewProject | ( | const wxString & | filename = wxEmptyString | ) |
Create a new empty project.
filename | the project's filename |
Definition at line 357 of file projectmanager.cpp.
References _(), BeginLoadingProject(), cbMessageBox(), EndLoadingProject(), wxString::IsEmpty(), IsOpen(), m_IsLoadingWorkspace, SetProject(), wxFileExists(), wxICON_QUESTION, wxICON_WARNING, wxID_YES, wxRemoveFile(), and wxYES_NO.
Referenced by ScriptBindings::RegisterBindings(), and Wiz::RunProjectWizard().
|
private |
Definition at line 932 of file projectmanager.cpp.
References m_CanSendWorkspaceChanged.
Referenced by ProjectManager().
|
inline |
Definition at line 432 of file projectmanager.h.
void ProjectManager::ReloadProject | ( | cbProject * | project | ) |
Reloads a project and tries to keep everything the same (project order, dependencies, active project)
project | the project that will be reloaded, the pointer will be invalid after the call. |
Definition at line 284 of file projectmanager.cpp.
References AddProjectDependency(), CloseProject(), cbProjectManagerUI::FreezeTree(), CompileTargetBase::GetFilename(), cbWorkspace::GetModified(), LoadProject(), m_pActiveProject, m_pProjects, m_ProjectDeps, m_pWorkspace, m_ui, cbProjectManagerUI::RebuildTree(), cbWorkspace::SetModified(), cbProjectManagerUI::UnfreezeTree(), wxEmptyString, and wxNOT_FOUND.
Referenced by ProjectManagerUI::CheckForExternallyModifiedProjects().
void ProjectManager::RemoveFileFromProject | ( | ProjectFile * | pfile, |
cbProject * | project | ||
) |
Remove a file from a project.
pfile | The file to remove from the project. |
project | The project to remove this file from. If NULL, the active project is used. |
Definition at line 955 of file projectmanager.cpp.
References _(), _T, ProjectFile::AutoGeneratedBy(), cbEVT_PROJECT_FILE_REMOVED, cbMessageBox(), LogManager::DebugLog(), ProjectFile::file, Manager::Get(), wxFileName::GetFullPath(), Manager::GetLogManager(), ProjectFile::GetParentProject(), Manager::GetPluginManager(), CompileTargetBase::GetTitle(), PluginManager::NotifyPlugins(), cbProject::RemoveFile(), and CodeBlocksEvent::SetProject().
Referenced by cbEditor::OnContextMenuEntry(), ProjectManagerUI::OnRemoveFileFromProject(), EditorManager::OnRemoveFileFromProject(), and ProjectManagerUI::RemoveFilesRecursively().
Removes a project dependency.
base | The project to remove a dependency from. |
doesNotDependOn | The project that is to stop being a dependency of project base . |
Definition at line 842 of file projectmanager.cpp.
References _T, LogManager::DebugLog(), F(), Manager::Get(), Manager::GetLogManager(), CompileTargetBase::GetTitle(), m_ProjectDeps, m_pWorkspace, cbWorkspace::SetModified(), and wxString::wx_str().
Referenced by ScriptBindings::RegisterBindings().
void ProjectManager::RemoveProjectFromAllDependencies | ( | cbProject * | base | ) |
Removes the project base
from being a dependency of any other project.
base | The project to remove from all dependencies. |
Definition at line 881 of file projectmanager.cpp.
References _T, LogManager::DebugLog(), F(), Manager::Get(), Manager::GetLogManager(), CompileTargetBase::GetTitle(), m_ProjectDeps, m_pWorkspace, cbWorkspace::SetModified(), wxString::wx_str(), and wxNOT_FOUND.
Referenced by CloseProject(), and ScriptBindings::RegisterBindings().
bool ProjectManager::SaveActiveProject | ( | ) |
Save the active project to disk.
Same as SaveProject(GetActiveProject()).
Definition at line 506 of file projectmanager.cpp.
References m_pActiveProject, and SaveProject().
Referenced by MainFrame::OnFileSaveProject(), and ScriptBindings::RegisterBindings().
bool ProjectManager::SaveActiveProjectAs | ( | ) |
Save the active project to disk, asking for a filename.
Same as SaveProjectAs(GetActiveProject()).
Definition at line 511 of file projectmanager.cpp.
References m_pActiveProject, and SaveProjectAs().
Referenced by MainFrame::OnFileSaveProjectAs(), and ScriptBindings::RegisterBindings().
bool ProjectManager::SaveAllProjects | ( | ) |
Saves all projects to disk.
Definition at line 516 of file projectmanager.cpp.
References cbProjectManagerUI::FreezeTree(), cbProject::GetModified(), m_pProjects, m_ui, SaveProject(), and cbProjectManagerUI::UnfreezeTree().
Referenced by MainFrame::OnFileSaveAll(), and ScriptBindings::RegisterBindings().
bool ProjectManager::SaveProject | ( | cbProject * | project | ) |
Save a project to disk.
project | A pointer to the project to save. |
Definition at line 481 of file projectmanager.cpp.
References m_ui, cbProjectManagerUI::RebuildTree(), and cbProject::Save().
Referenced by ProjectManagerUI::OnSaveProject(), ScriptBindings::RegisterBindings(), SaveActiveProject(), and SaveAllProjects().
bool ProjectManager::SaveProjectAs | ( | cbProject * | project | ) |
Save a project to disk, asking for a filename.
project | A pointer to the project to save. |
Definition at line 493 of file projectmanager.cpp.
References m_ui, cbProjectManagerUI::RebuildTree(), and cbProject::SaveAs().
Referenced by ScriptBindings::RegisterBindings(), and SaveActiveProjectAs().
bool ProjectManager::SaveWorkspace | ( | ) |
Save the open workspace.
Definition at line 577 of file projectmanager.cpp.
References GetWorkspace(), and cbWorkspace::Save().
Referenced by MainFrame::OnFileSaveAll(), MainFrame::OnFileSaveWorkspace(), ProjectManagerUI::OnSaveWorkspace(), ProjectManagerUI::QueryCloseWorkspace(), and ScriptBindings::RegisterBindings().
bool ProjectManager::SaveWorkspaceAs | ( | const wxString & | filename | ) |
Save the open workspace under a different filename.
filename | The workspace to save. |
Definition at line 582 of file projectmanager.cpp.
References GetWorkspace(), and cbWorkspace::SaveAs().
Referenced by MainFrame::OnFileSaveWorkspaceAs(), ProjectManagerUI::OnSaveAsWorkspace(), and ScriptBindings::RegisterBindings().
void ProjectManager::SetDefaultPath | ( | const wxString & | path | ) |
Set the default path for new projects.
Definition at line 146 of file projectmanager.cpp.
References _T, Manager::Get(), Manager::GetConfigManager(), and ConfigManager::Write().
Referenced by WizProjectPathPanel::OnPageChanging(), and ScriptBindings::RegisterBindings().
void ProjectManager::SetIsRunning | ( | cbPlugin * | plugin | ) |
This method should be called when the applications is started by a plugin.
There is only one plugin which could be running the application. Running means that plugin has started the executable and it is waiting for it to finish.
Definition at line 1137 of file projectmanager.cpp.
References m_RunningPlugin.
Referenced by CompilerGCC::KillProcess(), cbDebuggerPlugin::MarkAsStopped(), CompilerGCC::NotifyJobDone(), cbDebuggerPlugin::OnCompilerFinished(), DebuggerMenuHandler::OnRunToCursor(), DebuggerMenuHandler::OnStart(), DebuggerMenuHandler::OnStep(), and CompilerGCC::Run().
void ProjectManager::SetProject | ( | cbProject * | project, |
bool | refresh = true |
||
) |
Set the active project.
Use this function if you want to change the active project.
project | A pointer to the new active project. |
refresh | If true, refresh the project manager's tree, else do not refresh it. |
Definition at line 162 of file projectmanager.cpp.
References cbWorkspace::ActiveProjectChanged(), cbEVT_PROJECT_ACTIVATE, Manager::Get(), Manager::GetPluginManager(), m_pActiveProject, m_pWorkspace, m_ui, PluginManager::NotifyPlugins(), and cbProjectManagerUI::UpdateActiveProject().
Referenced by CloseActiveProject(), CloseProject(), CompilerGCC::DoSwitchProjectTemporarily(), EndLoadingWorkspace(), WorkspaceLoader::LoadLayout(), LoadProject(), LoadWorkspace(), NewProject(), ProjectManagerUI::OnCloseProject(), ProjectManagerUI::OnFindFile(), cbDebuggerPlugin::OnProjectActivated(), ProjectManagerUI::OnProjectFileActivated(), ProjectManagerUI::OnProperties(), ProjectManagerUI::OnSetActiveProject(), MainFrame::OpenGeneric(), CompilerGCC::PrepareCompileFile(), and ScriptBindings::RegisterBindings().
void ProjectManager::SetUI | ( | cbProjectManagerUI * | ui | ) |
Definition at line 132 of file projectmanager.cpp.
References m_ui.
void ProjectManager::WorkspaceChanged | ( | ) |
Sends message to the plugins that the workspace has been changed.
Definition at line 941 of file projectmanager.cpp.
References cbEVT_WORKSPACE_CHANGED, Manager::Get(), Manager::GetEditorManager(), EditorManager::GetNotebook(), Manager::GetPluginManager(), IsBusy(), m_CanSendWorkspaceChanged, cbAuiNotebook::MinimizeFreeSpace(), and PluginManager::NotifyPlugins().
Referenced by CloseAllProjects(), CloseProject(), CloseWorkspace(), EndLoadingProject(), EndLoadingWorkspace(), and CodeBlocksApp::OnInit().
|
friend |
Definition at line 147 of file projectmanager.h.
|
friend |
Definition at line 146 of file projectmanager.h.
|
private |
Definition at line 470 of file projectmanager.h.
Referenced by OnAppDoneStartup(), and WorkspaceChanged().
|
private |
Definition at line 469 of file projectmanager.h.
Referenced by CloseAllProjects(), CloseProject(), and ProjectManager().
|
private |
Definition at line 467 of file projectmanager.h.
Referenced by CloseAllProjects(), CloseProject(), IsClosingProject(), and IsLoadingOrClosing().
|
private |
Definition at line 468 of file projectmanager.h.
Referenced by CloseWorkspace(), IsClosingWorkspace(), and IsLoadingOrClosing().
|
private |
Definition at line 465 of file projectmanager.h.
Referenced by BeginLoadingProject(), EndLoadingProject(), IsLoading(), IsLoadingOrClosing(), and IsLoadingProject().
|
private |
Definition at line 466 of file projectmanager.h.
Referenced by BeginLoadingWorkspace(), EndLoadingProject(), EndLoadingWorkspace(), IsLoading(), IsLoadingOrClosing(), IsLoadingWorkspace(), LoadProject(), and NewProject().
|
private |
Definition at line 459 of file projectmanager.h.
Referenced by CloseActiveProject(), CloseProject(), EndLoadingWorkspace(), LoadWorkspace(), ProjectManager(), ReloadProject(), SaveActiveProject(), SaveActiveProjectAs(), and SetProject().
|
private |
Definition at line 464 of file projectmanager.h.
Referenced by EndLoadingProject(), ProjectManager(), and ~ProjectManager().
|
private |
Definition at line 461 of file projectmanager.h.
Referenced by CloseActiveProject(), CloseAllProjects(), CloseProject(), EndLoadingProject(), EndLoadingWorkspace(), FindProjectForFile(), IsOpen(), IsProjectStillOpen(), LoadWorkspace(), ProjectManager(), ReloadProject(), SaveAllProjects(), and ~ProjectManager().
|
private |
Definition at line 460 of file projectmanager.h.
Referenced by EndLoadingWorkspace(), LoadProject(), and ProjectManager().
|
private |
Definition at line 462 of file projectmanager.h.
Referenced by AddProjectDependency(), ClearProjectDependencies(), GetDependenciesForProject(), ReloadProject(), RemoveProjectDependency(), and RemoveProjectFromAllDependencies().
|
private |
Definition at line 463 of file projectmanager.h.
Referenced by AddProjectDependency(), ClearProjectDependencies(), CloseProject(), CloseWorkspace(), EndLoadingProject(), EndLoadingWorkspace(), GetWorkspace(), LoadWorkspace(), ReloadProject(), RemoveProjectDependency(), RemoveProjectFromAllDependencies(), SetProject(), and ~ProjectManager().
|
private |
Definition at line 471 of file projectmanager.h.
Referenced by GetIsRunning(), and SetIsRunning().
|
private |
Definition at line 458 of file projectmanager.h.
Referenced by BeginLoadingWorkspace(), CloseAllProjects(), CloseProject(), CloseWorkspace(), DoAddFileToProject(), EndLoadingProject(), EndLoadingWorkspace(), ReloadProject(), SaveAllProjects(), SaveProject(), SaveProjectAs(), SetProject(), SetUI(), and ~ProjectManager().
|
staticprivate |
Definition at line 144 of file projectmanager.h.
Referenced by BeginLoadingProject(), and EndLoadingProject().