00001 /*-------------------------------------------------------------------- 00002 * cg_viewer.h 00003 * 00004 * The "cg_viewer" class displays the call graph of the current file set. 00005 * 00006 */ 00007 00008 #ifndef CG_VIEWER_H 00009 #define CG_VIEWER_H 00010 00011 #include "base_viewer.h" 00012 #include "sbrowser_cg/sbrowser_cg.h" 00013 00014 class cg_viewer : public graph_base_viewer { 00015 typedef graph_base_viewer inherited; 00016 00017 int num_nodes; 00018 gnode** nodes; 00019 bool show_external_procs; 00020 cg* current_cg; 00021 00022 void show_cg( cg* callgraph ); 00023 00024 virtual void show( vnode* vn ); 00025 virtual void create_proc_menu(); 00026 virtual void create_view_menu(); 00027 00028 static void do_show_external_procs( event& e, cg_viewer* viewer ); 00029 00030 public: 00031 cg_viewer(); 00032 ~cg_viewer(); 00033 00034 virtual char* class_name(void) { return "Callgraph Viewer"; } 00035 virtual void handle_event(event &e); 00036 00037 virtual void create_window(); 00038 00039 virtual void clear(); 00040 virtual void init(); 00041 00042 virtual void select(ProcedureDefinition* proc); 00043 00044 virtual void set_binding( binding* b ); 00045 00046 static window* constructor() { 00047 return new cg_viewer; 00048 } 00049 00050 }; 00051 00052 #endif