|
From: Emilien K. <cur...@us...> - 2005-09-29 17:05:12
|
Update of /cvsroot/wxdevcenter/wxDevCenter/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22512/src Modified Files: Tag: modularisation MDIFrame.cpp FileSystemStandard.cpp Config.cpp MainFrame.cpp Frame.cpp Application.cpp Removed Files: Tag: modularisation Module.cpp Log Message: Change module to plugin. --- Module.cpp DELETED --- Index: MainFrame.cpp =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/src/MainFrame.cpp,v retrieving revision 1.22.2.3 retrieving revision 1.22.2.4 diff -C2 -d -r1.22.2.3 -r1.22.2.4 *** MainFrame.cpp 24 Sep 2005 12:45:44 -0000 1.22.2.3 --- MainFrame.cpp 29 Sep 2005 17:05:00 -0000 1.22.2.4 *************** *** 23,27 **** ! #include <wxDevCenterModule.h> #include <wxDevCenter/MainFrame.h> --- 23,27 ---- ! #include <wxDevCenterPlugin.h> #include <wxDevCenter/MainFrame.h> *************** *** 34,38 **** #include <wxDevCenter/Layout.h> #include <wxDevCenter/ArtProvider.h> - #include <wxDevCenter/Module.h> --- 34,37 ---- *************** *** 52,57 **** #define WXDC_VIEWMENU_INSERT_AFTER 1 ! WXDC_IMPLEMENT_MODULE_CLASS(MainFrame, TopFrame, TopFrame) BEGIN_EVENT_TABLE(MainFrame, TopFrame) --- 51,57 ---- #define WXDC_VIEWMENU_INSERT_AFTER 1 + TopFrameTemplate MainFrameTemplate(CLASSINFO(MainFrame)); ! IMPLEMENT_DYNAMIC_CLASS(MainFrame, TopFrame) BEGIN_EVENT_TABLE(MainFrame, TopFrame) *************** *** 148,155 **** void MainFrame::OnClose(wxCloseEvent &event) { ! if(!Application::GetApp().GetDocManager().CloseAllDocuments()) event.Veto(); - else - Destroy(); } --- 148,153 ---- void MainFrame::OnClose(wxCloseEvent &event) { ! if(!Destroy(false)) event.Veto(); } Index: Config.cpp =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/src/Config.cpp,v retrieving revision 1.11.2.2 retrieving revision 1.11.2.3 diff -C2 -d -r1.11.2.2 -r1.11.2.3 *** Config.cpp 24 Sep 2005 11:44:20 -0000 1.11.2.2 --- Config.cpp 29 Sep 2005 17:05:00 -0000 1.11.2.3 *************** *** 27,30 **** --- 27,31 ---- #include <wx/fileconf.h> #include <wx/filefn.h> + #include <wx/tokenzr.h> using namespace wxDevCenter; *************** *** 120,132 **** } - // Retourne le chemin racine des modules. - wxString Config::GetModulePath(long lStackIndex) - { - if(lStackIndex>=0l && lStackIndex<(long)m_strModulePath.GetCount()) - return m_strModulePath[lStackIndex]; - else - return wxT(""); - } - // Retourne le chemin racine des données (images, icones, etc). wxString Config::GetDataPath(long lStackIndex) --- 121,124 ---- *************** *** 174,187 **** } - // Ajoute un chemin sur la pile des chemins des modules. - void Config::AddModulePath(wxString strPath) - { - m_strModulePath.Insert(strPath, 0); - } - // Ajoute un chemin sur la pile des chemins de stockage de données. void Config::AddDataPath(wxString strPath) { ! m_strDataPath.Insert(strPath, 0); } --- 166,178 ---- } // Ajoute un chemin sur la pile des chemins de stockage de données. void Config::AddDataPath(wxString strPath) { ! wxStringTokenizer tkz(strPath, wxT("&;")); ! while ( tkz.HasMoreTokens() ) ! { ! wxString token = tkz.GetNextToken(); ! m_strDataPath.Insert(token, 0); ! } } *************** *** 189,193 **** void Config::AddFeaturesPath(wxString strPath) { ! m_strFeaturesPath.Insert(strPath, 0); } --- 180,189 ---- void Config::AddFeaturesPath(wxString strPath) { ! wxStringTokenizer tkz(strPath, wxT("&;")); ! while ( tkz.HasMoreTokens() ) ! { ! wxString token = tkz.GetNextToken(); ! m_strFeaturesPath.Insert(token, 0); ! } } *************** *** 195,199 **** void Config::AddPluginsPath(wxString strPath) { ! m_strPluginsPath.Insert(strPath, 0); } --- 191,200 ---- void Config::AddPluginsPath(wxString strPath) { ! wxStringTokenizer tkz(strPath, wxT("&;")); ! while ( tkz.HasMoreTokens() ) ! { ! wxString token = tkz.GetNextToken(); ! m_strPluginsPath.Insert(token, 0); ! } } *************** *** 201,205 **** void Config::AddGlobalConfPath(wxString strPath) { ! m_strConfPath.Insert(strPath, 0); } --- 202,211 ---- void Config::AddGlobalConfPath(wxString strPath) { ! wxStringTokenizer tkz(strPath, wxT("&;")); ! while ( tkz.HasMoreTokens() ) ! { ! wxString token = tkz.GetNextToken(); ! m_strConfPath.Insert(token, 0); ! } } *************** *** 207,211 **** void Config::AddUserConfPath(wxString strPath) { ! m_strUserConfPath.Insert(strPath, 0); } --- 213,222 ---- void Config::AddUserConfPath(wxString strPath) { ! wxStringTokenizer tkz(strPath, wxT("&;")); ! while ( tkz.HasMoreTokens() ) ! { ! wxString token = tkz.GetNextToken(); ! m_strUserConfPath.Insert(token, 0); ! } } *************** *** 220,228 **** wxLogDebug(wxT("Installation path : %s"), GetInstallPath().GetData()); - wxLogDebug(wxT("Module path :")); - l = 0; - while(str=GetModulePath(l++), !str.IsEmpty()) - wxLogDebug(wxT(" - %s"), str.GetData()); - wxLogDebug(wxT("Data path :")); l = 0; --- 231,234 ---- Index: Frame.cpp =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/src/Frame.cpp,v retrieving revision 1.12.2.3 retrieving revision 1.12.2.4 diff -C2 -d -r1.12.2.3 -r1.12.2.4 *** Frame.cpp 24 Sep 2005 12:45:44 -0000 1.12.2.3 --- Frame.cpp 29 Sep 2005 17:05:01 -0000 1.12.2.4 *************** *** 65,74 **** ////////////////////////////////////////////////////////////////////// ! WXDC_IMPLEMENT_MODULE_BASE_CLASS(TopFrame, wxFrame) ! BEGIN_EVENT_TABLE(wxDevCenter::TopFrame, wxFrame) END_EVENT_TABLE() TopFrame::TopFrame(): wxFrame(), m_pViewFrame(NULL) --- 65,75 ---- ////////////////////////////////////////////////////////////////////// ! IMPLEMENT_ABSTRACT_CLASS(TopFrame, wxFrame) ! BEGIN_EVENT_TABLE(TopFrame, wxFrame) END_EVENT_TABLE() TopFrame::TopFrame(): + Element(), wxFrame(), m_pViewFrame(NULL) *************** *** 85,88 **** --- 86,122 ---- } + bool TopFrame::Initialize() + { + Element::Initialize(); + return true; + } + + void TopFrame::Finalize() + { + Element::Finalize(); + } + + bool TopFrame::Destroy(bool bForce) + { + // Do not call Element::Finalize because use of wxFrame::Destroy() + + bool bClose = Application::GetApp().GetDocManager().CloseAllDocuments(); + + if(bForce || bClose) + { + WorkBarManager::GetManager().UnregisterFrame(this); + Element::Destroy(bForce); + return wxFrame::Destroy(); + } + else + return false; + } + + bool TopFrame::CanDestroy() + { + Element::CanDestroy(); + return Application::GetApp().GetDocManager().CloseAllDocuments(); + } + // Surcharge le procédé d'exécution des évènements. *************** *** 106,116 **** - // Surcharge du processus de destruction. - bool TopFrame::Destroy() - { - WorkBarManager::GetManager().UnregisterFrame(this); - return wxFrame::Destroy(); - } - // Retourne le layout attaché à la fenetre. wxDevCenter::Layout TopFrame::GetLayout() --- 140,143 ---- *************** *** 121,124 **** --- 148,162 ---- ////////////////////////////////////////////////////////////////////// + // TopFrameManager + ////////////////////////////////////////////////////////////////////// + + TopFrameManager TopFrameManager::s_TopFrameManager; + + TopFrameTemplate::TopFrameTemplate(wxClassInfo* pClassInfo):ObjectTemplate<TopFrame>(pClassInfo, wxT("Test"), wxT("")) + { + TopFrameManager::GetManager().RegisterTemplate(this); + } + + ////////////////////////////////////////////////////////////////////// // ViewFrame ////////////////////////////////////////////////////////////////////// Index: Application.cpp =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/src/Application.cpp,v retrieving revision 1.37.2.3 retrieving revision 1.37.2.4 diff -C2 -d -r1.37.2.3 -r1.37.2.4 *** Application.cpp 24 Sep 2005 12:45:44 -0000 1.37.2.3 --- Application.cpp 29 Sep 2005 17:05:01 -0000 1.37.2.4 *************** *** 27,31 **** #include <wxDevCenter/AboutBox.h> #include <wxDevCenter/Config.h> - #include <wxDevCenter/Module.h> #include <wxDevCenter/FileSystem.h> #include <wxDevCenter/FileSystemStandard.h> --- 27,30 ---- *************** *** 39,42 **** --- 38,42 ---- #include <wxDevCenter/WorkBar.h> + #include <wx/dir.h> #include <wx/dynlib.h> *************** *** 82,87 **** wxArtProvider::PushProvider(new ArtProvider); - // Charge les modules. - // Module::LoadModules(); // Initialise les gestionnaires --- 82,85 ---- *************** *** 89,92 **** --- 87,91 ---- m_ProjectManager.Initialize(); WorkBarManager::GetManager().Initialize(); + TopFrameManager::GetManager().Initialize(); // Charge les plugins : phase de tests *************** *** 95,98 **** --- 94,98 ---- m_PluginLoader.Initialize(); + // Crée la config utilisateur. Config::GetConfig().CreateUserProfile(); *************** *** 102,116 **** // Initialise le gestionnaire de systèmes de fichiers ! m_pStandardFileSystem = FileSystemStandard::CreateFileSystemStandard(); ! FileSystemManager::GetManager().Register(m_pStandardFileSystem, true); // Initialise les menus par défaut. InitCommandGroups(); - Module::DumpClasses(); - // Crée la fenetre principale ! ! m_pTopFrame = TopFrame::CreateTopFrame(); if(m_pTopFrame==NULL) { --- 102,113 ---- // Initialise le gestionnaire de systèmes de fichiers ! // m_pStandardFileSystem = FileSystemStandard::CreateFileSystemStandard(); ! // FileSystemManager::GetManager().Register(m_pStandardFileSystem, true); // Initialise les menus par défaut. InitCommandGroups(); // Crée la fenetre principale ! m_pTopFrame = (TopFrame*) TopFrameManager::GetManager().CreateTopFrame(); if(m_pTopFrame==NULL) { *************** *** 434,438 **** wxApp::OnInitCmdLine(parser); - parser.AddOption(wxT("APm"), wxT("addpath-module"), WXDC_CMDLINE_ADDPATH_MODULE, wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_MULTIPLE); parser.AddOption(wxT("APd"), wxT("addpath-data"), WXDC_CMDLINE_ADDPATH_DATA, wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_MULTIPLE); parser.AddOption(wxT("APf"), wxT("addpath-features"), WXDC_CMDLINE_ADDPATH_FEATURES, wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_MULTIPLE); --- 431,434 ---- *************** *** 449,454 **** wxString str; - if(parser.Found(wxT("APm"), (wxString*)&str)) - Config::GetConfig().AddModulePath(str); if(parser.Found(wxT("APd"), (wxString*)&str)) Config::GetConfig().AddDataPath(str); --- 445,448 ---- Index: MDIFrame.cpp =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/src/MDIFrame.cpp,v retrieving revision 1.8.2.1 retrieving revision 1.8.2.2 diff -C2 -d -r1.8.2.1 -r1.8.2.2 *** MDIFrame.cpp 24 Sep 2005 11:44:20 -0000 1.8.2.1 --- MDIFrame.cpp 29 Sep 2005 17:05:00 -0000 1.8.2.2 *************** *** 23,27 **** ! #include <wxDevCenterModule.h> #include <wxDevCenter/MDIFrame.h> --- 23,27 ---- ! #include <wxDevCenterPlugin.h> #include <wxDevCenter/MDIFrame.h> Index: FileSystemStandard.cpp =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/src/FileSystemStandard.cpp,v retrieving revision 1.19.2.2 retrieving revision 1.19.2.3 diff -C2 -d -r1.19.2.2 -r1.19.2.3 *** FileSystemStandard.cpp 24 Sep 2005 11:44:20 -0000 1.19.2.2 --- FileSystemStandard.cpp 29 Sep 2005 17:05:00 -0000 1.19.2.3 *************** *** 36,41 **** ////////////////////////////////////////////////////////////////////// // Standard file system ! WXDC_IMPLEMENT_MODULE_BASE_CLASS(FileSystemStandard, FileSystem) bool FileSystemStandard::CreateDirectory(FilePath strDir) --- 36,54 ---- ////////////////////////////////////////////////////////////////////// // Standard file system ! IMPLEMENT_ABSTRACT_CLASS(FileSystemStandard, FileSystem) + bool FileSystemStandard::Initialize() + { + if(FileSystem::Initialize()) + return FileSystemManager::GetManager().Register(this, true); + else + return false; + } + + void FileSystemStandard::Finalize() + { + FileSystemManager::GetManager().Unregister(this); + FileSystem::Finalize(); + } bool FileSystemStandard::CreateDirectory(FilePath strDir) |