File: callgraph.h

package info (click to toggle)
codelite 14.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 112,816 kB
  • sloc: cpp: 483,662; ansic: 150,144; php: 9,569; lex: 4,186; python: 3,417; yacc: 2,820; sh: 1,147; makefile: 52; xml: 13
file content (149 lines) | stat: -rw-r--r-- 4,881 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//
// copyright            : (C) 2014 Eran Ifrah
// file name            : callgraph.h
//
// -------------------------------------------------------------------------
// A
//              _____           _      _     _ _
//             /  __ \         | |    | |   (_) |
//             | /  \/ ___   __| | ___| |    _| |_ ___
//             | |    / _ \ / _  |/ _ \ |   | | __/ _ )
//             | \__/\ (_) | (_| |  __/ |___| | ||  __/
//              \____/\___/ \__,_|\___\_____/_|\__\___|
//
//                                                  F i l e
//
//    This program is free software; you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation; either version 2 of the License, or
//    (at your option) any later version.
//
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////

/***************************************************************
 * Name:      callgraph.h
 * Purpose:   Header to create plugin
 * Author:    Vaclav Sprucek
 * Created:   2012-03-04
 * Copyright: Vaclav Sprucek
 * License:   wxWidgets license (www.wxwidgets.org)
 * Notes:
 **************************************************************/

#ifndef __CallGraph__
#define __CallGraph__

#include "plugin.h"
//
#include <wx/wx.h>
#include <wx/process.h>
#include <wx/stream.h>
#include "confcallgraph.h"
#include "gprofparser.h"
#include "dotwriter.h"
#include "static.h"

// forward references
class wxFileOutputStream;
class wxTextOutputStream;

/**
 * @class CallGraph
 * @brief Class define structure for plugin interface.
 */
class CallGraph : public IPlugin
{
public:
    /**
     * @brief Defautl constructor.
     * @param manager
     */
    CallGraph(IManager* manager);
    /**
     * @brief Defautl destructor.
     */
    ~CallGraph();
    //--------------------------------------------
    // Abstract methods
    //--------------------------------------------
    /**
     * @brief Function create tool bar menu and sets icon of plugin Call graph.
     * @param parent
     * @return
     */
    virtual void CreateToolBar(clToolBar* toolbar);
    /**
     * @brief Function create plugin menu for Call graph used in menu Plugins of Codelite.
     * @param pluginsMenu
     */
    virtual void CreatePluginMenu(wxMenu* pluginsMenu);

    /**
     * @brief Function unplug the plugin from CodeLite IDE.
     */
    virtual void UnPlug();

    virtual void HookPopupMenu(wxMenu* menu, MenuType type);

    /**
     * @brief Return string with value path for external application gprof which is stored in configuration data.
     * @return Path to 'gprof' tool
     */
    wxString GetGprofPath();
    /**
     * @brief Return string with value path for external application dot which is stored in configuration data.
     * @return Path to 'dot' tool
     */
    wxString GetDotPath();

    wxFileOutputStream* m_LogFile;

    void LogFn(wxString s);

protected:
    void MessageBox(const wxString& msg, unsigned long icon_mask);
    wxString LocateApp(const wxString& app_name);

    /**
     * @brief Function create and open About dialog Call graph plugin.
     * @param event Reference to event class
     */
    void OnAbout(wxCommandEvent& event);
    /**
     * @brief Function create new tab page and insert picture with call graph and table with function of the project.
     * @param event Reference to event class
     */
    void OnShowCallGraph(wxCommandEvent& event);
    /**
     * @brief Handle function to open dialog with settings for Call graph plugin.
     * @param event Reference to event class
     */
    void OnSettings(wxCommandEvent& event);

    /**
     * @brief Create custom plugin's popup menu.
     * @return Plugin's popup menu
     */
    wxMenu* CreateProjectPopMenu();
    /**
     * @brief Pointer cgWnd type wxScrolledWindow used in tab page for display call graph picture.
     */
    wxScrolledWindow* cgWnd; // pointer cgWnd type wxScrolledWindow used in tab page for display call graph picture
                             /**
                              * @brief Pointer m_pInputStream type wxInputStream returned from gprof application.
                              */
    // wxInputStream *m_pInputStream; // pointer m_pInputStream type wxInputStream returned from gprof application
    /**
     * @brief Object confData type ConfCallGraph with stored configuration data.
     */
    ConfCallGraph confData; // object confData type ConfCallGraph with stored configuration data

    // wxString        m_ProfiledBinFullName;
};

extern CallGraph* thePlugin;

#endif // CallGraph