Lots more work on making the frame aui stuff functional.
[dolphin.git] / Source / Core / DebuggerWX / Src / CodeWindow.h
blobb1fea2b1b0f085ad8d4382e3b23df03077bb1059
1 // Copyright (C) 2003 Dolphin Project.
3 // This program is free software: you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation, version 2.0.
7 // This program is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 // GNU General Public License 2.0 for more details.
12 // A copy of the GPL 2.0 should have been included with the program.
13 // If not, see http://www.gnu.org/licenses/
15 // Official SVN repository and contact information can be found at
16 // http://code.google.com/p/dolphin-emu/
19 #ifndef CODEWINDOW_H_
20 #define CODEWINDOW_H_
22 #include <wx/dialog.h>
23 #include <wx/textctrl.h>
24 #include <wx/listbox.h>
25 #include <wx/artprov.h>
27 #include "Thread.h"
28 #include "CoreParameter.h"
30 // GUI global
31 #include "../../DolphinWX/Src/Globals.h"
32 #include "../../DolphinWX/Src/Frame.h"
34 class CFrame;
35 class CRegisterWindow;
36 class CBreakPointWindow;
37 class CMemoryWindow;
38 class CJitWindow;
39 class CCodeView;
41 class CCodeWindow
42 : public wxPanel
44 public:
46 CCodeWindow(const SCoreStartupParameter& _LocalCoreStartupParameter,
47 CFrame * parent,
48 wxWindowID id = wxID_ANY,
49 const wxPoint& pos = wxDefaultPosition,
50 const wxSize& size = wxDefaultSize,
51 long style = wxTAB_TRAVERSAL,
52 const wxString& name = wxT("Code")
55 ~CCodeWindow();
56 void Load();
57 void Save();
59 // Parent interaction
60 CFrame *Parent;
61 wxMenuBar * GetMenuBar();
62 wxAuiToolBar * GetToolBar();
63 int GetNootebookAffiliation(wxString);
64 wxBitmap m_Bitmaps[ToolbarDebugBitmapMax];
66 bool UseInterpreter();
67 bool BootToPause();
68 bool AutomaticStart();
69 bool JITNoBlockCache();
70 bool JITBlockLinking();
71 void JumpToAddress(u32 _Address);
73 void Update();
74 void NotifyMapLoaded();
75 void CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParameter, wxMenuBar * pMenuBar);
76 void CreateMenuView(wxMenuBar * pMenuBar, wxMenu*);
77 void CreateMenuOptions(wxMenuBar * pMenuBar, wxMenu*);
78 void CreateMenuSymbols();
79 void RecreateToolbar(wxAuiToolBar*);
80 void PopulateToolbar(wxAuiToolBar* toolBar);
81 void UpdateButtonStates();
82 void OpenPages();
83 void UpdateManager();
85 // Menu bar
86 // -------------------
87 void OnCPUMode(wxCommandEvent& event); // CPU Mode menu
88 void OnJITOff(wxCommandEvent& event);
90 void OnToggleWindow(wxCommandEvent& event);
91 void ToggleCodeWindow(bool bShow);
92 void ToggleRegisterWindow(bool bShow);
93 void ToggleBreakPointWindow(bool bShow);
94 void ToggleMemoryWindow(bool bShow);
95 void ToggleJitWindow(bool bShow);
96 void ToggleDLLWindow(int Id, bool bShow);
98 void OnChangeFont(wxCommandEvent& event);
100 void OnCodeStep(wxCommandEvent& event);
101 void OnAddrBoxChange(wxCommandEvent& event);
102 void OnSymbolsMenu(wxCommandEvent& event);
103 void OnJitMenu(wxCommandEvent& event);
104 void OnProfilerMenu(wxCommandEvent& event);
106 // Sub dialogs
107 wxMenuBar* pMenuBar;
108 CRegisterWindow* m_RegisterWindow;
109 CBreakPointWindow* m_BreakpointWindow;
110 CMemoryWindow* m_MemoryWindow;
111 CJitWindow* m_JitWindow;
113 // Settings
114 bool bAutomaticStart; bool bBootToPause;
115 int iLogWindow;
116 int iConsoleWindow;
117 bool bCodeWindow; int iCodeWindow;
118 bool bRegisterWindow; int iRegisterWindow;
119 bool bBreakpointWindow; int iBreakpointWindow;
120 bool bMemoryWindow; int iMemoryWindow;
121 bool bJitWindow; int iJitWindow;
122 bool bSoundWindow; int iSoundWindow;
123 bool bVideoWindow; int iVideoWindow;
125 private:
127 enum
129 // Debugger GUI Objects
130 ID_CODEVIEW,
131 ID_CALLSTACKLIST,
132 ID_CALLERSLIST,
133 ID_CALLSLIST,
134 ID_SYMBOLLIST
137 void OnSymbolListChange(wxCommandEvent& event);
138 void OnSymbolListContextMenu(wxContextMenuEvent& event);
139 void OnCallstackListChange(wxCommandEvent& event);
140 void OnCallersListChange(wxCommandEvent& event);
141 void OnCallsListChange(wxCommandEvent& event);
142 void OnCodeViewChange(wxCommandEvent &event);
143 void SingleCPUStep();
144 void OnHostMessage(wxCommandEvent& event);
146 void UpdateLists();
147 void UpdateCallstack();
148 void OnStatusBar(wxMenuEvent& event); void OnStatusBar_(wxUpdateUIEvent& event);
149 void DoTip(wxString text);
150 void OnKeyDown(wxKeyEvent& event);
152 void InitBitmaps();
153 void CreateGUIControls(const SCoreStartupParameter& _LocalCoreStartupParameter);
155 wxMenuItem* jitblocklinking, *jitnoblockcache, *jitoff;
156 wxMenuItem* jitlsoff, *jitlslxzoff, *jitlslwzoff, *jitlslbzxoff;
157 wxMenuItem* jitlspoff;
158 wxMenuItem* jitlsfoff;
159 wxMenuItem* jitfpoff;
160 wxMenuItem* jitioff;
161 wxMenuItem* jitpoff;
162 wxMenuItem* jitsroff;
164 std::string fontDesc;
166 CCodeView* codeview;
167 wxListBox* callstack;
168 wxListBox* symbols;
169 wxListBox* callers;
170 wxListBox* calls;
171 Common::Event sync_event;
173 DECLARE_EVENT_TABLE()
176 #endif /*CODEWINDOW_*/