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/
20 #include "Main.h" // for wxGetApp
21 #include "LogManager.h"
23 #include "DebuggerUIUtil.h"
25 #include "IniFile.h" // Common
51 // Uses multiple inheritance - only sane because LogListener is a pure virtual interface.
52 class CLogWindow
: public wxPanel
, LogListener
55 CLogWindow(CFrame
*parent
,
56 wxWindowID id
= wxID_ANY
,
57 const wxPoint
& pos
= wxDefaultPosition
,
58 const wxSize
& size
= wxDefaultSize
,
59 long style
= wxTAB_TRAVERSAL
,
60 const wxString
& name
= wxT("Log")
67 void Log(LogTypes::LOG_LEVELS
, const char *text
);
71 wxFont DefaultFont
, MonoSpaceFont
;
72 std::vector
<wxFont
> Font
;
74 FileLogListener
*m_fileLog
;
75 ConsoleListener
*m_console
;
76 LogManager
*m_LogManager
;
77 std::queue
<std::pair
<u8
, wxString
> > msgQueue
;
78 bool m_writeFile
, m_writeConsole
, m_writeWindow
, m_LogAccess
;
81 wxBoxSizer
*sUber
, *sLeft
, *sRight
, *sRightBottom
;
82 wxTextCtrl
*m_Log
, *m_cmdline
;
83 wxChoice
* m_FontChoice
;
84 wxCheckBox
*m_writeFileCB
, *m_writeConsoleCB
, *m_writeWindowCB
;
85 wxCheckListBox
* m_checks
;
86 wxRadioBox
*m_verbosity
;
88 Common::CriticalSection m_LogSection
;
94 wxTextCtrl
* CreateTextCtrl(wxPanel
* parent
, wxWindowID id
= wxID_ANY
, long Style
= NULL
);
95 void CreateGUIControls();
96 void PopulateRight(); void UnPopulateRight();
97 void OnClose(wxCloseEvent
& event
);
98 void OnSubmit(wxCommandEvent
& event
);
99 void OnOptionsCheck(wxCommandEvent
& event
);
100 void OnLogCheck(wxCommandEvent
& event
);
101 void OnClear(wxCommandEvent
& event
);
102 void OnToggleAll(wxCommandEvent
& event
);
103 void OnLogTimer(wxTimerEvent
& WXUNUSED(event
));
105 void ToggleLog(int _logType
, bool enable
);
110 const char *getName() const { return "LogWindow"; }
113 #endif /*LOGWINDOW_H_*/