00001 #ifndef SYMBOL_VIEWER_HEADER_INCLUDED_p 00002 #define SYMBOL_VIEWER_HEADER_INCLUDED_p 00003 // 00004 // Copyright 2011, Lowell Boggs Jr. 00005 // 00006 // This file or directory, containing source code for a computer program, 00007 // is Copyrighted by Lowell Boggs, Jr. 987 Regency Drive, Lewisville 00008 // TX (USA), 75067. You may use, copy, modify, and distribute this 00009 // source file without charge or obligation so long as you agree to 00010 // the following: 00011 // 00012 // 1. You must indemnify Lowell Boggs against any and all financial 00013 // obligations caused by its use, misuse, function, or malfunction. 00014 // Further, you acknowledge that there is no warranty of any kind, 00015 // whatsoever. 00016 // 00017 // 2. You agree not to attempt to patent any portion of this original 00018 // work -- though you may attempt to patent your own extensions to 00019 // it if you so choose. 00020 // 00021 // 3. You keep this copyright notice with the file and all copies 00022 // of the file and do not change it anyway except language translation. 00023 // 00024 // You are responsible for enforcing your own compliance with these 00025 // conditions and may not use this source file if you cannot agree to the 00026 // above terms and conditions. 00027 00028 #include <cxxtls/treeviewer.h> 00029 #include <cxxtls/cpptagdb.h> 00030 00031 //--------------------------------------------------------------------------------- 00032 //--------------------------------------------------------------------------------- 00033 //--------------------------------------------------------------------------------- 00034 00035 using namespace std; 00036 00037 namespace cxxtls 00038 { 00039 00040 //--------------------------------------------------------------------------------- 00041 00042 struct SymbolViewerNodeInformation 00043 : public TreeViewerNodeInfo 00046 { 00047 string filename_; 00048 int lineNumber_; 00049 00050 00051 SymbolViewerNodeInformation(string file, int line) 00052 : filename_(file) 00053 , lineNumber_(line) 00054 { 00055 } 00056 00057 ~SymbolViewerNodeInformation() 00058 { 00059 } 00060 00061 bool operator() (ViewerManager*vm, CursorWindow::viewport *vp, int command, FileName const &); 00062 00063 00064 }; 00065 00066 //--------------------------------------------------------------------------------- 00067 00068 class SymbolViewer 00069 : public TreeViewer 00072 { 00073 FileName databaseName_; 00074 00075 CppTagDB::Info database_; 00076 00077 public: 00078 00079 SymbolViewer(ViewerManager *vm, std::string databaseFilename); 00098 00099 void addChild(TreeViewerNode &parent, CppTagDB::SymbolInfo const &); 00100 00101 static Viewer* app(ViewerManager*vm, std::string &fullname); 00107 00108 00109 void helpHeader(std::list<std::string> &help_text); 00112 00113 }; 00114 00115 00116 00117 00118 00119 //--------------------------------------------------------------------------------- 00120 //--------------------------------------------------------------------------------- 00121 00122 } // namespace cxxtls 00123 #endif