Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1:/tmp/cvs-serv7638 Modified Files: AnyEdit.cpp AnyEdit.dsp AnyEdit.h AnyEditView.cpp AnyEditView.h ChangeLog.txt MainFrm.cpp MainFrm.h Misc.cpp Misc.h NewProject.cpp NewWorkspace.cpp ProjectTree.cpp ProjectTree.h ToolPref.cpp WorkspaceBar.cpp WorkspaceBar.h Added Files: pugxml.h Log Message: - Rewrote project view handling.. project file format has changed to a XML based format - Have integrated PugXML parser into AnyEdit for handling project files. In future may handle syntax files also - Cleaned up code involving CString [Returning and taking param] --- NEW FILE: pugxml.h --- //pugxml.h /////////////////////////////////////////////////////////////////////////////// // // Pug XML Parser - Version 1.0002 // -------------------------------------------------------- // Copyright (C) 2003, by Kristen Wegner (kr...@ti...) // Released into the Public Domain. Use at your own risk. // See pugxml.xml for further information, history, etc. // Contributions by Neville Franks (rea...@ge...). // /////////////////////////////////////////////////////////////////////////////// #if !defined(_PUGXML_) #define _PUGXML_ #pragma once //#define PUGOPT_MEMFIL //Uncomment to enable memory-mapped file parsing support. //#define PUGOPT_NONSEG //Uncomment to enable non-destructive (non-segmenting) parsing support. [...3878 lines suppressed...] # endif //!PUGAPI_VERSION_MAJOR # pragma message("pugxml.h(44) : Value of PUGAPI_INTERNAL_VERSION_MAJOR.") # else //defined(PUGAPI_VERSION_MAJOR) # if !defined(PUGAPI_VERSION_MINOR) || (PUGAPI_VERSION_MINOR != PUGAPI_INTERNAL_VERSION_MINOR) # pragma message("Note: The Pug XML library API minor version does not match your implementation.") # pragma message("Note: Your implementation may not run correctly with this minor version.") # pragma message("Note: Read pugxml.xml for transition instructions.") # ifndef PUGAPI_VERSION_MINOR # pragma message("Note: Add #define PUGAPI_VERSION_MINOR X in your implementation, where X is:") # else //PUGAPI_VERSION_MINOR # pragma message("Note: Update #define PUGAPI_VERSION_MINOR X in your implementation, where X is:") # endif //!PUGAPI_VERSION_MINOR # pragma message("pugxml.h(45) : Value of PUGAPI_INTERNAL_VERSION_MINOR.") # endif //!defined(PUGAPI_VERSION_MINOR) # endif //!defined(PUGAPI_VERSION_MAJOR) #endif //!defined(PUGAPI_VARIANT) #endif //!defined(_PUGXML_) Index: AnyEdit.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEdit.cpp,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** AnyEdit.cpp 25 Nov 2003 15:05:55 -0000 1.34 --- AnyEdit.cpp 28 Nov 2003 13:20:36 -0000 1.35 *************** *** 224,228 **** //check for leaks ! //_CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF ); --- 224,228 ---- //check for leaks ! _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF ); *************** *** 437,441 **** //Delete all the files in the temp folder ! CString pat = GetAppPath()+"temp\\"; CStringArray farr; msc.GetFilesInFolder(pat,"*.*",farr); --- 437,442 ---- //Delete all the files in the temp folder ! CString pat = GetAppPath(); ! pat+="temp\\"; CStringArray farr; msc.GetFilesInFolder(pat,"*.*",farr); *************** *** 533,537 **** } ! CString CAnyEditApp::GetAppPath() { /*TCHAR filName[_MAX_PATH]; --- 534,538 ---- } ! LPCSTR CAnyEditApp::GetAppPath() { /*TCHAR filName[_MAX_PATH]; *************** *** 793,801 **** CString strTitle; strTitle= titl; dlg.m_ofn.lpstrFilter = szFilter ; dlg.m_ofn.lpstrTitle = strTitle; ! dlg.m_ofn.lpstrFile = fileName.GetBuffer(_MAX_PATH); dlg.m_ofn.hwndOwner = AfxGetMainWnd()->m_hWnd; ! if (dlg.DoModal() == IDOK) { --- 794,804 ---- CString strTitle; strTitle= titl; + dlg.m_ofn.lpstrFilter = szFilter ; dlg.m_ofn.lpstrTitle = strTitle; ! dlg.m_ofn.lpstrFile = fileName.GetBuffer(3000); ! dlg.m_ofn.nMaxFile = 3000; dlg.m_ofn.hwndOwner = AfxGetMainWnd()->m_hWnd; ! if (dlg.DoModal() == IDOK) { *************** *** 880,883 **** --- 883,887 ---- else { + GetCurrentProjectFiles(originalFiles); //here I take all files that belong to that project CString paramPath; *************** *** 889,893 **** POSITION pos = pDocTemplate->GetFirstDocPosition(); ! CString originPath; while(pos!=NULL) { --- 893,897 ---- POSITION pos = pDocTemplate->GetFirstDocPosition(); ! while(pos!=NULL) { *************** *** 898,902 **** { tempDoc = (CAnyEditDoc *)doct; ! CString tempStr = tempDoc->GetPathName(); CMainFrame* pFrame=(CMainFrame*)m_pMainWnd; if ( (pFrame!=NULL) && --- 902,906 ---- { tempDoc = (CAnyEditDoc *)doct; ! CString tempStr((LPCSTR)tempDoc->GetPathName()); CMainFrame* pFrame=(CMainFrame*)m_pMainWnd; if ( (pFrame!=NULL) && *************** *** 906,910 **** if (tempDoc->IsModified()) { ! originPath=tempDoc->GetPathName(); tmpCopyPath=paramPath; char doc_path[_MAX_FNAME]; --- 910,914 ---- if (tempDoc->IsModified()) { ! CString originPath((LPCSTR)tempDoc->GetPathName()); tmpCopyPath=paramPath; char doc_path[_MAX_FNAME]; *************** *** 1020,1024 **** } ! CString CAnyEditApp::GetCurrentExt() { CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd; --- 1024,1028 ---- } ! LPCSTR CAnyEditApp::GetCurrentExt() { CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd; *************** *** 1067,1071 **** } ! CLanguage * CAnyEditApp::GetLanguage(CString ext) { --- 1071,1075 ---- } ! CLanguage * CAnyEditApp::GetLanguage(LPCSTR ext) { *************** *** 1084,1088 **** } ! CString CAnyEditApp::SetScintillaLanguage(CString ext, CScintilla *scintilla) { --- 1088,1092 ---- } ! LPCSTR CAnyEditApp::SetScintillaLanguage(LPCSTR ext, CScintilla *scintilla) { *************** *** 1111,1115 **** ! CObject * CAnyEditApp::LoadLanguage(CString langpos) { --- 1115,1119 ---- ! CObject * CAnyEditApp::LoadLanguage(LPCSTR langpos) { *************** *** 1172,1176 **** } ! void CAnyEditApp::OpenBrowserWindow(CString url) { POSITION pos = CWinApp::GetFirstDocTemplatePosition(); --- 1176,1180 ---- } ! void CAnyEditApp::OpenBrowserWindow(LPCSTR url) { POSITION pos = CWinApp::GetFirstDocTemplatePosition(); *************** *** 1223,1227 **** } ! CString CAnyEditApp::GetCurDocPath() { //LPCSTR retS = curDocPath.GetBuffer(curDocPath.GetLength()); --- 1227,1231 ---- } ! LPCSTR CAnyEditApp::GetCurDocPath() { //LPCSTR retS = curDocPath.GetBuffer(curDocPath.GetLength()); *************** *** 1230,1234 **** } ! CString CAnyEditApp::GetCompFilePathFromLang(LPCSTR lang) { CHAR tempStr[1024]; --- 1234,1238 ---- } ! LPCSTR CAnyEditApp::GetCompFilePathFromLang(LPCSTR lang) { CHAR tempStr[1024]; *************** *** 1283,1292 **** ! CString CAnyEditApp::GetCurrentProject() { return ((CMainFrame*)m_pMainWnd)->GetCurrentProject(); } ! CString CAnyEditApp::GetCurrentWorkspace() { return ((CMainFrame*)m_pMainWnd)->GetCurrentWorkspace(); --- 1287,1296 ---- ! LPCSTR CAnyEditApp::GetCurrentProject() { return ((CMainFrame*)m_pMainWnd)->GetCurrentProject(); } ! LPCSTR CAnyEditApp::GetCurrentWorkspace() { return ((CMainFrame*)m_pMainWnd)->GetCurrentWorkspace(); *************** *** 1299,1306 **** } ! void CAnyEditApp::SaveModifiedFileOfAProject(CString filePath) { //if filePath is Empty this function will save all files belonging to current project that have been modified! //if filePath is not empty this function will save only the document that corresponds to that path! if (filePath.IsEmpty()) { --- 1303,1311 ---- } ! void CAnyEditApp::SaveModifiedFileOfAProject(LPCSTR filePat) { //if filePath is Empty this function will save all files belonging to current project that have been modified! //if filePath is not empty this function will save only the document that corresponds to that path! + CString filePath = filePat; if (filePath.IsEmpty()) { *************** *** 1371,1375 **** } ! BOOL CAnyEditApp::IsFileInCurrentProject(CString fileName) { //to use like that if ( IsFileInCurrentProject(theApp.GetCurDocPath()) ) --- 1376,1380 ---- } ! BOOL CAnyEditApp::IsFileInCurrentProject(LPCSTR fileName) { //to use like that if ( IsFileInCurrentProject(theApp.GetCurDocPath()) ) Index: AnyEdit.dsp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEdit.dsp,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** AnyEdit.dsp 25 Nov 2003 15:05:56 -0000 1.26 --- AnyEdit.dsp 28 Nov 2003 13:20:36 -0000 1.27 *************** *** 1140,1143 **** --- 1140,1147 ---- # Begin Source File + SOURCE=.\pugxml.h + # End Source File + # Begin Source File + SOURCE=.\SeException.h # End Source File Index: AnyEdit.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEdit.h,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** AnyEdit.h 25 Nov 2003 15:05:56 -0000 1.28 --- AnyEdit.h 28 Nov 2003 13:20:36 -0000 1.29 *************** *** 43,51 **** void TerminateClassViewThread(); void GotoFileAndLine(int lineNo,CString& fileName); ! BOOL IsFileInCurrentProject(CString fileName); ! void SaveModifiedFileOfAProject(CString filePath); void GetCurrentProjectFiles(CStringArray& repository); ! CString GetCurrentWorkspace(); ! CString GetCurrentProject(); BOOL CanStartParserThread(); void RefreshParserThread(CWinThread* pNewThread); --- 43,51 ---- void TerminateClassViewThread(); void GotoFileAndLine(int lineNo,CString& fileName); ! BOOL IsFileInCurrentProject(LPCSTR fileName); ! void SaveModifiedFileOfAProject(LPCSTR filePath); void GetCurrentProjectFiles(CStringArray& repository); ! LPCSTR GetCurrentWorkspace(); ! LPCSTR GetCurrentProject(); BOOL CanStartParserThread(); void RefreshParserThread(CWinThread* pNewThread); *************** *** 53,60 **** void OpenStartupPage(); void OpenPreferences(); ! void OpenBrowserWindow(CString url); ! CObject * LoadLanguage(CString langpos); ! CString SetScintillaLanguage(CString ext, CScintilla *scintilla); ! CLanguage * GetLanguage(CString ext); void LoadLanguageExtensions(); void ApplyOtherDefaults(CScintilla * scintilla); --- 53,60 ---- void OpenStartupPage(); void OpenPreferences(); ! void OpenBrowserWindow(LPCSTR url); ! CObject * LoadLanguage(LPCSTR langpos); ! LPCSTR SetScintillaLanguage(LPCSTR ext, CScintilla *scintilla); ! CLanguage * GetLanguage(LPCSTR ext); void LoadLanguageExtensions(); void ApplyOtherDefaults(CScintilla * scintilla); *************** *** 73,77 **** BOOL IsLangPresent(LPCSTR lang); void SetAppPath(LPCSTR appPath); ! CString GetAppPath(); BOOL m_bTabFlatBorders; BOOL OnViewDoubleClick (int iViewId); --- 73,77 ---- BOOL IsLangPresent(LPCSTR lang); void SetAppPath(LPCSTR appPath); ! LPCSTR GetAppPath(); BOOL m_bTabFlatBorders; BOOL OnViewDoubleClick (int iViewId); *************** *** 88,98 **** void AddOutputLine(LPCSTR str); void SetSelectedLine(int i); ! CString GetCurrentExt(); BOOL DoPromptFileName(CString &fileName, LPCSTR titl, DWORD lFlags,BOOL bOpen,LPCSTR fil=_T("")); void EscapeFromChildFrm(); void SetCurDocPath(LPCSTR str); ! CString GetCurDocPath(); void ResetClassView(LPCSTR str,BOOL parseForProject); ! CString GetCompFilePathFromLang(LPCSTR lang); BOOL LockTagList(); void UnlockTagList(); --- 88,98 ---- void AddOutputLine(LPCSTR str); void SetSelectedLine(int i); ! LPCSTR GetCurrentExt(); BOOL DoPromptFileName(CString &fileName, LPCSTR titl, DWORD lFlags,BOOL bOpen,LPCSTR fil=_T("")); void EscapeFromChildFrm(); void SetCurDocPath(LPCSTR str); ! LPCSTR GetCurDocPath(); void ResetClassView(LPCSTR str,BOOL parseForProject); ! LPCSTR GetCompFilePathFromLang(LPCSTR lang); BOOL LockTagList(); void UnlockTagList(); Index: AnyEditView.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEditView.cpp,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** AnyEditView.cpp 25 Nov 2003 15:05:56 -0000 1.36 --- AnyEditView.cpp 28 Nov 2003 13:20:36 -0000 1.37 *************** *** 371,375 **** } ! CString CAnyEditView::GetCurrentExtension() { return DocExt; --- 371,375 ---- } ! LPCSTR CAnyEditView::GetCurrentExtension() { return DocExt; *************** *** 1073,1077 **** ! CString CAnyEditView::GetInputValues(LPCSTR curLine) { CString inpLine = curLine; --- 1073,1077 ---- ! LPCSTR CAnyEditView::GetInputValues(LPCSTR curLine) { CString inpLine = curLine; *************** *** 1098,1102 **** { ! if(theApp.GetCurDocPath() != CurDocPath) { KillTimer(PARSER_TIMER); --- 1098,1103 ---- { ! CString cpath = theApp.GetCurDocPath(); ! if(cpath.Compare(CurDocPath)!=0) { KillTimer(PARSER_TIMER); *************** *** 1104,1108 **** } - if((EnableParsing) && (theApp.CanStartParserThread())) { --- 1105,1108 ---- *************** *** 1136,1140 **** } ! theApp.SetCurDocPath(GetDocument()->GetPathName()); } --- 1136,1140 ---- } ! theApp.SetCurDocPath(CurDocPath.GetBuffer(CurDocPath.GetLength())); } *************** *** 1160,1164 **** void CAnyEditView::OnSetFocus(CWnd* pOldWnd) { ! CView::OnSetFocus(pOldWnd); m_Scintilla.SetFocus(); --- 1160,1164 ---- void CAnyEditView::OnSetFocus(CWnd* pOldWnd) { ! CView::OnSetFocus(pOldWnd); m_Scintilla.SetFocus(); *************** *** 1236,1242 **** } - CString prevpath = theApp.GetCurDocPath(); ! if(prevpath == CurDocPath) { if(EnableParsing) --- 1236,1241 ---- } CString prevpath = theApp.GetCurDocPath(); ! if(prevpath.Compare(CurDocPath)==0) { if(EnableParsing) *************** *** 1250,1254 **** else { ! theApp.SetCurDocPath(CurDocPath); if (EnableParsing) { --- 1249,1253 ---- else { ! theApp.SetCurDocPath(CurDocPath.GetBuffer(CurDocPath.GetLength())); if (EnableParsing) { *************** *** 1275,1279 **** if ( (pDoc!=NULL) && (pDoc->IsKindOf(RUNTIME_CLASS(CAnyEditDoc))) ) { ! int rev = CurDocPath.ReverseFind('\\'); if(rev==-1) return; --- 1274,1279 ---- if ( (pDoc!=NULL) && (pDoc->IsKindOf(RUNTIME_CLASS(CAnyEditDoc))) ) { ! CString tpath = CurDocPath; ! int rev = tpath.ReverseFind('\\'); if(rev==-1) return; *************** *** 1281,1287 **** docpath += "temp\\"; CString filnam ;//= "temp\\"; ! filnam+= CurDocPath.Right(CurDocPath.GetLength()-rev-1); BOOL parseForProject=true; ! if (!theApp.IsFileInCurrentProject(CurDocPath)) { //I mean that if file is in current project, I will write its copy in theApp.ResetClassView docpath+= filnam; --- 1281,1288 ---- docpath += "temp\\"; CString filnam ;//= "temp\\"; ! filnam+= tpath.Right(tpath.GetLength()-rev-1); BOOL parseForProject=true; ! //The function is called below in that manner, else it wont work ! if (!theApp.IsFileInCurrentProject(tpath.GetBuffer(tpath.GetLength()))) { //I mean that if file is in current project, I will write its copy in theApp.ResetClassView docpath+= filnam; Index: AnyEditView.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEditView.h,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** AnyEditView.h 25 Nov 2003 15:05:56 -0000 1.19 --- AnyEditView.h 28 Nov 2003 13:20:37 -0000 1.20 *************** *** 72,76 **** void SetLineStyle(int linenumber,int style=0,COLORREF color=RGB(0,0,0)); void ResetLineStyle(int linenumber=-1); ! CString GetInputValues(LPCSTR curline); void InsertStringArray(CStringArray &arr); void JustOpenedFile(); --- 72,76 ---- void SetLineStyle(int linenumber,int style=0,COLORREF color=RGB(0,0,0)); void ResetLineStyle(int linenumber=-1); ! LPCSTR GetInputValues(LPCSTR curline); void InsertStringArray(CStringArray &arr); void JustOpenedFile(); *************** *** 79,83 **** void OnModified(); void HandleNotification(LPARAM lParam); ! CString GetCurrentExtension(); void SetAccessTime(); virtual ~CAnyEditView(); --- 79,83 ---- void OnModified(); void HandleNotification(LPARAM lParam); ! LPCSTR GetCurrentExtension(); void SetAccessTime(); virtual ~CAnyEditView(); Index: ChangeLog.txt =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/ChangeLog.txt,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** ChangeLog.txt 25 Nov 2003 15:05:56 -0000 1.32 --- ChangeLog.txt 28 Nov 2003 13:20:37 -0000 1.33 *************** *** 2,6 **** ============ ! Beta 2.0 -------- 1) Fixed setting focus problem on ctrl+tab [#765240] --- 2,6 ---- ============ ! Beta 2.0 [Tester's Release 2] -------- 1) Fixed setting focus problem on ctrl+tab [#765240] *************** *** 50,53 **** --- 50,54 ---- 43) File modification check now handles file deletion properly. [#799171] 44) Added global option in preferences to view whitespaces. + 45) Rewrote project-view, Project file format has changed to XML based format Index: MainFrm.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/MainFrm.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** MainFrm.cpp 25 Nov 2003 15:05:56 -0000 1.28 --- MainFrm.cpp 28 Nov 2003 13:20:37 -0000 1.29 *************** *** 1453,1462 **** } ! CString CMainFrame::GetCurrentProject() { return m_wndWorkSpace.GetCurrentProject(); } ! CString CMainFrame::GetCurrentWorkspace() { return m_wndWorkSpace.GetCurrentWorkspace(); --- 1453,1462 ---- } ! LPCSTR CMainFrame::GetCurrentProject() { return m_wndWorkSpace.GetCurrentProject(); } ! LPCSTR CMainFrame::GetCurrentWorkspace() { return m_wndWorkSpace.GetCurrentWorkspace(); *************** *** 1468,1472 **** } ! BOOL CMainFrame::IsFileInCurrentProject(CString fileName) { //to use like that if ( IsFileInCurrentProject(theApp.GetCurDocPath()) ) --- 1468,1472 ---- } ! BOOL CMainFrame::IsFileInCurrentProject(LPCSTR fileName) { //to use like that if ( IsFileInCurrentProject(theApp.GetCurDocPath()) ) Index: MainFrm.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/MainFrm.h,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** MainFrm.h 11 Aug 2003 04:03:19 -0000 1.20 --- MainFrm.h 28 Nov 2003 13:20:37 -0000 1.21 *************** *** 64,71 **** CTagList * GetCurrentTagList(); void GetTagsNearest(LPCSTR word, CStringArray &arr); ! BOOL IsFileInCurrentProject(CString fileName); void GetCurrentProjectFiles(CStringArray& repository); ! CString GetCurrentWorkspace(); ! CString GetCurrentProject(); void UpdateStatus(int lineno=-1,int colno=-1,int filetype=0,int overwrite=0,int readfile=0); void ShowPreferences(); --- 64,71 ---- CTagList * GetCurrentTagList(); void GetTagsNearest(LPCSTR word, CStringArray &arr); ! BOOL IsFileInCurrentProject(LPCSTR fileName); void GetCurrentProjectFiles(CStringArray& repository); ! LPCSTR GetCurrentWorkspace(); ! LPCSTR GetCurrentProject(); void UpdateStatus(int lineno=-1,int colno=-1,int filetype=0,int overwrite=0,int readfile=0); void ShowPreferences(); Index: Misc.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/Misc.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Misc.cpp 8 May 2003 12:00:56 -0000 1.4 --- Misc.cpp 28 Nov 2003 13:20:37 -0000 1.5 *************** *** 325,329 **** } ! void CMisc::WriteStringToFile(CString str, LPCSTR filPath) { TRY{ --- 325,329 ---- } ! BOOL CMisc::WriteStringToFile(CString str, LPCSTR filPath) { TRY{ *************** *** 335,339 **** --- 335,341 ---- }CATCH(CFileException, e) { + return FALSE; } END_CATCH + return TRUE; } Index: Misc.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/Misc.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Misc.h 8 May 2003 12:00:56 -0000 1.2 --- Misc.h 28 Nov 2003 13:20:37 -0000 1.3 *************** *** 15,19 **** { public: ! void WriteStringToFile(CString str,LPCSTR filPath); BOOL IsFileReadOnly(LPCSTR filPath); CMisc(); --- 15,19 ---- { public: ! BOOL WriteStringToFile(CString str,LPCSTR filPath); BOOL IsFileReadOnly(LPCSTR filPath); CMisc(); Index: NewProject.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/NewProject.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** NewProject.cpp 8 May 2003 12:00:56 -0000 1.5 --- NewProject.cpp 28 Nov 2003 13:20:37 -0000 1.6 *************** *** 149,162 **** int y=filArray.GetSize(); ! CString prefix = _T("FILE|./"); ! for(int i=0;i<y;i++) { tempStr = filArray.GetAt(i); tempStr = CreateProjectFile(tempStr); - tempStr += _T("|ROOT"); tempStr = prefix + tempStr; filArray.SetAt(i,tempStr); } ! if(!msc.WriteArrayToFile(filArray,proFile)) return FALSE; else --- 149,174 ---- int y=filArray.GetSize(); ! CString prefix = _T("./"); ! for(int i=0;i<y;i++) { tempStr = filArray.GetAt(i); tempStr = CreateProjectFile(tempStr); tempStr = prefix + tempStr; filArray.SetAt(i,tempStr); } ! ! m_filName.GetWindowText(tempStr); ! CString filetowrite = "<project pname=\""; ! filetowrite+= tempStr; ! filetowrite+= "\" >\n"; ! //<file fname="./AnyEdit.dsp" part="true"/> ! for(i=0;i<filArray.GetSize();i++) ! { ! filetowrite+="\t<file fname=\""; ! filetowrite+=filArray[i]+"\" part=\"true\" />\n"; ! } ! filetowrite+= "</project>\n"; ! ! if(!msc.WriteStringToFile(filetowrite,proFile)) return FALSE; else *************** *** 179,189 **** { CStringArray wArr; CString str = _T("./"); str+= proFileBaseName+_T(".aep"); ! wArr.Add(str); ! wArr.Add(_T("201")); ! str = msc.GetParentFolderForFile(proFile); str+= proFileBaseName + _T(".aew"); ! msc.WriteArrayToFile(wArr,str); theApp.LoadWorkspaceFile(str); } --- 191,203 ---- { CStringArray wArr; + CString wfile = "<workspace wname=\""; + wfile+=proFileBaseName + "\">\n"; CString str = _T("./"); str+= proFileBaseName+_T(".aep"); ! wfile+="\t<project pfile=\""; ! wfile+=str+"\" part=\"true\"/>\n</workspace>"; ! str = msc.GetParentFolderForFile(proFile); str+= proFileBaseName + _T(".aew"); ! msc.WriteStringToFile(wfile,str); theApp.LoadWorkspaceFile(str); } *************** *** 213,219 **** msc.WriteArrayToFile(filArr,finalPath); - theApp.OpenDocumentFile(finalPath); - theApp.SetCursorStartPoint(); - return newfileName; } --- 227,230 ---- Index: NewWorkspace.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/NewWorkspace.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** NewWorkspace.cpp 8 May 2003 12:00:56 -0000 1.4 --- NewWorkspace.cpp 28 Nov 2003 13:20:37 -0000 1.5 *************** *** 78,83 **** } ! CStringArray filArr; ! filArr.Add(_T("0")); CString broStr; CMisc msc; --- 78,83 ---- } ! CString wfile = "<workspace wname=\""; ! CString broStr; CMisc msc; *************** *** 88,92 **** broStr+= _T("\\"); broStr+= filName+ _T(".aew"); ! msc.WriteArrayToFile(filArr,broStr); theApp.LoadWorkspaceFile(broStr); --- 88,93 ---- broStr+= _T("\\"); broStr+= filName+ _T(".aew"); ! wfile+= filName + "\"/>"; ! msc.WriteStringToFile(wfile,broStr); theApp.LoadWorkspaceFile(broStr); Index: ProjectTree.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/ProjectTree.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ProjectTree.cpp 21 Nov 2003 13:53:00 -0000 1.8 --- ProjectTree.cpp 28 Nov 2003 13:20:37 -0000 1.9 *************** *** 26,29 **** --- 26,33 ---- // ProjectTree.cpp : implementation file // + #include <iostream> + #include <strstream> + #include <STRSTREA.H> + #include "stdafx.h" *************** [...1747 lines suppressed...] ! else return FALSE; } ! void CProjectTree::AddFileUnderProject(LPCSTR proj,LPCSTR filename) { ! if(!m_bIsLoaded)return; ! HTREEITEM rootitem = GetRootItem(); ! HTREEITEM pitem = GetChildItem(rootitem); ! while(pitem) ! { ! if(GetItemText(pitem)==proj) ! { ! AddFile(filename,pitem); ! } ! ! pitem = GetNextItem(pitem,TVGN_NEXT); ! } } + Index: ProjectTree.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/ProjectTree.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ProjectTree.h 8 May 2003 12:00:56 -0000 1.5 --- ProjectTree.h 28 Nov 2003 13:20:37 -0000 1.6 *************** *** 7,14 **** --- 7,74 ---- // ProjectTree.h : header file // + #define PUGAPI_VARIANT 0x58475550 //The Pug XML library variant we are using in this implementation. + #define PUGAPI_VERSION_MAJOR 1 //The Pug XML library major version we are using in this implementation. + #define PUGAPI_VERSION_MINOR 2 //The Pug XML library minor version we are using in this implementation. + + #include "stdlib.h" + #include "pugxml.h" #include "Misc.h" + #include <stack> + #include <ostream> + #include <strstream> + + using namespace std; + using namespace pug; ///////////////////////////////////////////////////////////////////////////// // CProjectTree window + enum project_item_types + { + ITEM_WORKSPACE, + ITEM_PROJECT, + ITEM_FOLDER, + ITEM_FILE + }; + + enum file_path_type + { + PATH_FULL, + PATH_PARTIAL + }; + + enum project_image_types + { + IMG_WORKSPACE, + IMG_OFOLDER, + IMG_FILE, + IMG_PROJECT, + IMG_FOLDER, + IMG_INVALID + }; + + class ProjectItem + { + public: + ProjectItem() + { + } + + ProjectItem(LPCSTR itemname, LPCSTR filepath,LPCSTR parentpath,int itype,int iimage ) + { + if(itemname) ItemName = itemname; + if(filepath) FilePath = filepath; + if(parentpath) parent_path = parentpath; + type = itype; + item_image = iimage; + changed=FALSE; + } + + int type; + BOOL changed; + CString ItemName; + CString FilePath; + int item_image; + CString parent_path; + }; class CProjectTree : public CTreeCtrl *************** *** 26,36 **** protected: - int a[5]; - CMap<int,int,CString,CString> tmap; CMisc msc; - int activeProInt; - HTREEITEM wRoot; BOOL m_bIsLoaded; ! CString curWName; // Operations public: --- 86,94 ---- protected: CMisc msc; BOOL m_bIsLoaded; ! stack<HTREEITEM> iStack; ! HTREEITEM m_ActiveProject; ! // Operations public: *************** *** 43,55 **** // Implementation public: ! BOOL IsFileInCurrentProject(CString fileName); void GetCurrentProjectFiles(CStringArray &repository,HTREEITEM hItem=NULL); ! CString GetCurrentWorkspace(); ! CString GetCurrentProject(); virtual ~CProjectTree(); void SetFolderImages(); int GetTreeItemType(HTREEITEM hItem); BOOL LoadWorkspaceFile(LPCSTR filPath); ! BOOL SaveCurrentWorkspace(); void CloseWorkspace(); BOOL IsWorkspaceLoaded(); --- 101,113 ---- // Implementation public: ! BOOL IsFileInCurrentProject(LPCSTR fileName); void GetCurrentProjectFiles(CStringArray &repository,HTREEITEM hItem=NULL); ! LPCSTR GetCurrentWorkspace(); ! LPCSTR GetCurrentProject(); virtual ~CProjectTree(); void SetFolderImages(); int GetTreeItemType(HTREEITEM hItem); BOOL LoadWorkspaceFile(LPCSTR filPath); ! BOOL SaveCurrentWorkspace(BOOL cchange=FALSE); void CloseWorkspace(); BOOL IsWorkspaceLoaded(); *************** *** 57,93 **** BOOL AddFile(LPCSTR filpath,HTREEITEM hItem); HTREEITEM GetProjectItemForString(LPCSTR itemText); ! BOOL LoadProjectFile(LPCSTR filPath); protected: ! int GetFreeProject(); ! int GetNextProjectInt(int proNum); ! HTREEITEM AddProject(LPCSTR projName); ! BOOL ParseLineAndAddToProject(LPCSTR str,HTREEITEM projItem); ! HTREEITEM GetItemForFolderInProject(LPCSTR str,HTREEITEM hItem); ! BOOL IsStringInProject(LPCSTR str,int proNum); void ShowOpenDialogForFiles(); ! void AddNewFolder(); ! int GetProjectNumFromRange(int num); ! void SetActiveProject(int num); int GetNumberOfProjects(); ! int GetNumberOfItemsUnderProject(int pfol,HTREEITEM hItem); ! void DeleteItemsUnderProject(HTREEITEM hItem); ! HTREEITEM GetProjectItemFromNum(int num); ! CString GetProjectFullPathFromItem(HTREEITEM hItem); ! CString GetWorkspacePath(); ! void ResetProjectCount(); ! //to save a project file ! BOOL SaveWSProjectToFile(HTREEITEM proItem); ! void GetProjectStructIntoArray(HTREEITEM proItem,HTREEITEM elderItem,CStringArray &arr,int insAt,LPCSTR pStr); ! BOOL IsBrotherItem(HTREEITEM elder,HTREEITEM younger); ! CString GetProjectStringForItem(HTREEITEM hItem,LPCSTR pStr); //dragdrop ops BOOL IsChildNodeOf(HTREEITEM hitemChild, HTREEITEM hitemSuspectedParent); BOOL TransferItem(HTREEITEM hitemDrag, HTREEITEM hitemDrop); BOOL CanBeDropped(HTREEITEM hdrag,HTREEITEM hdrop); - //others - CString GetMapValue(int mapKey); // Generated message map functions --- 115,149 ---- BOOL AddFile(LPCSTR filpath,HTREEITEM hItem); HTREEITEM GetProjectItemForString(LPCSTR itemText); ! BOOL LoadProjectFile(LPCSTR filPath,BOOL path=FALSE); ! void AddFileUnderProject(LPCSTR projectname, LPCSTR filepath); protected: ! //New Implementation added functions ! BOOL DoesItemContainType(HTREEITEM hItem, int type, LPCSTR name,BOOL fname=FALSE); ! BOOL DoesProjectContainFile(HTREEITEM pitem, LPCSTR filename); ! void UpdateWorkspaceEntry(); ! BOOL AddProjectItemFromXmlNode(xml_node * node,LPCSTR fname); ! BOOL AddProjectFromXmlNode(xml_node * node,LPCSTR fname); ! BOOL AddFolderFromXmlNode(xml_node * node); ! BOOL AddFileFromXmlNode(xml_node * node); ! void SetActiveProject(CString &pfname,BOOL first=FALSE); void ShowOpenDialogForFiles(); ! void AddNewFolder(); int GetNumberOfProjects(); ! int GetNumberOfItemsUnderProject(int pfol,HTREEITEM hItem); ! HTREEITEM GetProjectItemForItem(HTREEITEM hItem); ! void SetDirty(HTREEITEM hItem); ! //to save a project file ! void SaveItemAsElement(HTREEITEM hItem,xml_node * node); ! BOOL SaveWSProjectToFile(HTREEITEM proItem,BOOL checkchange=FALSE); + //Delete resources... + void DeleteTreeResourcesFromItem(HTREEITEM hItem); + //dragdrop ops BOOL IsChildNodeOf(HTREEITEM hitemChild, HTREEITEM hitemSuspectedParent); BOOL TransferItem(HTREEITEM hitemDrag, HTREEITEM hitemDrop); BOOL CanBeDropped(HTREEITEM hdrag,HTREEITEM hdrop); // Generated message map functions Index: ToolPref.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/ToolPref.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ToolPref.cpp 25 Nov 2003 15:05:56 -0000 1.5 --- ToolPref.cpp 28 Nov 2003 13:20:37 -0000 1.6 *************** *** 546,550 **** { m_ErrParserPredefinedList.ResetContent(); ! CFile cf(theApp.GetAppPath()+"ErrParsers\\manifest.ini",CFile::modeRead); CArchive arIn(&cf,CArchive::load); CString tmpFileLine; --- 546,551 ---- { m_ErrParserPredefinedList.ResetContent(); ! CString str = theApp.GetAppPath(); ! CFile cf(str+"ErrParsers\\manifest.ini",CFile::modeRead); CArchive arIn(&cf,CArchive::load); CString tmpFileLine; Index: WorkspaceBar.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/WorkspaceBar.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** WorkspaceBar.cpp 21 Nov 2003 13:53:00 -0000 1.22 --- WorkspaceBar.cpp 28 Nov 2003 13:20:38 -0000 1.23 *************** *** 251,255 **** void CWorkspaceBar::FillProjectView() { ! m_wndProjectView.InsertItem(_T("No WorkSpace Loaded"),5,5); } --- 251,255 ---- void CWorkspaceBar::FillProjectView() { ! m_wndProjectView.InsertItem(_T("No WorkSpace Loaded"),5,5); } *************** *** 277,281 **** { m_wndProjectView.CloseWorkspace(); - FillProjectView(); } --- 277,280 ---- *************** *** 292,297 **** void CWorkspaceBar::AddFileUnderProject(LPCSTR proText,LPCSTR filPath) { ! HTREEITEM hItem = m_wndProjectView.GetProjectItemForString(proText); ! m_wndProjectView.AddFile(filPath,hItem); } --- 291,295 ---- void CWorkspaceBar::AddFileUnderProject(LPCSTR proText,LPCSTR filPath) { ! m_wndProjectView.AddFileUnderProject(proText,filPath); } *************** *** 422,427 **** xx[acnt-1] = NULL; //This is necessary according to standards maina(acnt-1,xx); //Call to the main function of ctags ... ! for(i=0;i<acnt-1;i++) { --- 420,428 ---- xx[acnt-1] = NULL; //This is necessary according to standards + CTime t = CTime::GetCurrentTime(); + TRACE("Beginning tag gen : %s\n",t.Format("%H:%M:%S")); maina(acnt-1,xx); //Call to the main function of ctags ... ! CTime t1 = CTime::GetCurrentTime(); ! TRACE("Ending tag gen : %s\n",t1.Format("%H:%M:%S")); for(i=0;i<acnt-1;i++) { *************** *** 473,482 **** } ! CString CWorkspaceBar::GetCurrentProject() { return m_wndProjectView.GetCurrentProject(); } ! CString CWorkspaceBar::GetCurrentWorkspace() { return m_wndProjectView.GetCurrentWorkspace(); --- 474,483 ---- } ! LPCSTR CWorkspaceBar::GetCurrentProject() { return m_wndProjectView.GetCurrentProject(); } ! LPCSTR CWorkspaceBar::GetCurrentWorkspace() { return m_wndProjectView.GetCurrentWorkspace(); *************** *** 488,492 **** } ! BOOL CWorkspaceBar::IsFileInCurrentProject(CString fileName) { return m_wndProjectView.IsFileInCurrentProject(fileName); --- 489,493 ---- } ! BOOL CWorkspaceBar::IsFileInCurrentProject(LPCSTR fileName) { return m_wndProjectView.IsFileInCurrentProject(fileName); Index: WorkspaceBar.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/WorkspaceBar.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** WorkspaceBar.h 11 Aug 2003 04:03:19 -0000 1.17 --- WorkspaceBar.h 28 Nov 2003 13:20:38 -0000 1.18 *************** *** 84,91 **** CTagList * GetCurrentTagList(); void GetTagsNearest(LPCSTR word,CStringArray &arr); ! BOOL IsFileInCurrentProject(CString fileName); void GetCurrentProjectFiles(CStringArray& repository); ! CString GetCurrentWorkspace(); ! CString GetCurrentProject(); void ReturnItemsForCodeList(CStringArray &arr); virtual ~CWorkspaceBar(); --- 84,91 ---- CTagList * GetCurrentTagList(); void GetTagsNearest(LPCSTR word,CStringArray &arr); ! BOOL IsFileInCurrentProject(LPCSTR fileName); void GetCurrentProjectFiles(CStringArray& repository); ! LPCSTR GetCurrentWorkspace(); ! LPCSTR GetCurrentProject(); void ReturnItemsForCodeList(CStringArray &arr); virtual ~CWorkspaceBar(); |