2013-04-18 05:43:35 +02:00
|
|
|
// Copyright 2013 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2
|
|
|
|
// Refer to the license.txt file included.
|
2009-09-01 01:09:50 +02:00
|
|
|
|
|
|
|
#ifndef LOGWINDOW_H_
|
|
|
|
#define LOGWINDOW_H_
|
2010-08-03 05:20:44 +02:00
|
|
|
|
2009-09-01 01:09:50 +02:00
|
|
|
#include "LogManager.h"
|
2009-09-02 14:09:51 +02:00
|
|
|
#include "Frame.h"
|
2009-09-01 01:09:50 +02:00
|
|
|
#include "Thread.h"
|
|
|
|
#include <queue>
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
2010-07-28 00:12:19 +02:00
|
|
|
IDM_LOG,
|
|
|
|
IDM_CLEARLOG,
|
|
|
|
IDM_TOGGLEALL,
|
2009-09-02 14:09:51 +02:00
|
|
|
IDM_WRAPLINE,
|
2009-09-01 01:09:50 +02:00
|
|
|
IDTM_UPDATELOG,
|
2009-09-02 14:09:51 +02:00
|
|
|
IDM_FONT,
|
2010-07-28 00:12:19 +02:00
|
|
|
IDM_SUBMITCMD
|
2009-09-01 01:09:50 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class wxTextCtrl;
|
|
|
|
class wxCheckListBox;
|
|
|
|
class wxString;
|
2009-09-02 14:09:51 +02:00
|
|
|
class CFrame;
|
2009-09-01 01:09:50 +02:00
|
|
|
|
|
|
|
// Uses multiple inheritance - only sane because LogListener is a pure virtual interface.
|
2009-09-07 23:37:27 +02:00
|
|
|
class CLogWindow : public wxPanel, LogListener
|
2009-09-01 01:09:50 +02:00
|
|
|
{
|
|
|
|
public:
|
2009-09-02 14:09:51 +02:00
|
|
|
CLogWindow(CFrame *parent,
|
2009-09-01 04:41:48 +02:00
|
|
|
wxWindowID id = wxID_ANY,
|
2010-07-22 04:05:28 +02:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxTAB_TRAVERSAL,
|
2011-01-05 05:35:46 +01:00
|
|
|
const wxString& name = _("Log")
|
2010-07-22 04:05:28 +02:00
|
|
|
);
|
2009-09-01 01:09:50 +02:00
|
|
|
~CLogWindow();
|
|
|
|
|
|
|
|
void SaveSettings();
|
2010-12-14 18:52:01 +01:00
|
|
|
void Log(LogTypes::LOG_LEVELS, const char *text);
|
2009-09-01 01:09:50 +02:00
|
|
|
|
2010-07-28 00:12:19 +02:00
|
|
|
int x, y, winpos;
|
|
|
|
|
2009-09-01 01:09:50 +02:00
|
|
|
private:
|
2009-09-02 14:09:51 +02:00
|
|
|
CFrame *Parent;
|
2009-09-04 00:52:58 +02:00
|
|
|
wxFont DefaultFont, MonoSpaceFont;
|
2010-08-03 05:20:44 +02:00
|
|
|
std::vector<wxFont> LogFont;
|
2009-09-02 14:09:51 +02:00
|
|
|
wxTimer *m_LogTimer;
|
2011-12-31 05:51:17 +01:00
|
|
|
bool m_ignoreLogTimer;
|
2009-09-02 14:09:51 +02:00
|
|
|
LogManager *m_LogManager;
|
2009-09-01 01:09:50 +02:00
|
|
|
std::queue<std::pair<u8, wxString> > msgQueue;
|
2011-12-23 18:55:17 +01:00
|
|
|
bool m_writeFile, m_writeConsole, m_writeWindow, m_writeDebugger, m_LogAccess;
|
2009-09-04 00:52:58 +02:00
|
|
|
|
|
|
|
// Controls
|
2011-02-18 13:34:24 +01:00
|
|
|
wxBoxSizer *sBottom;
|
2009-09-04 00:52:58 +02:00
|
|
|
wxTextCtrl *m_Log, *m_cmdline;
|
2011-02-19 05:43:51 +01:00
|
|
|
wxChoice *m_FontChoice;
|
|
|
|
wxCheckBox *m_WrapLine;
|
2009-09-01 01:09:50 +02:00
|
|
|
|
2011-03-05 07:11:26 +01:00
|
|
|
std::mutex m_LogSection;
|
2009-09-01 01:09:50 +02:00
|
|
|
|
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
|
2013-07-06 04:39:18 +02:00
|
|
|
wxTextCtrl * CreateTextCtrl(wxPanel* parent, wxWindowID id, long Style);
|
2009-09-01 01:09:50 +02:00
|
|
|
void CreateGUIControls();
|
2011-03-03 23:47:48 +01:00
|
|
|
void PopulateBottom();
|
|
|
|
void UnPopulateBottom();
|
2009-09-01 01:09:50 +02:00
|
|
|
void OnClose(wxCloseEvent& event);
|
|
|
|
void OnSubmit(wxCommandEvent& event);
|
2011-02-18 13:34:24 +01:00
|
|
|
void OnFontChange(wxCommandEvent& event);
|
|
|
|
void OnWrapLineCheck(wxCommandEvent& event);
|
2009-09-01 01:09:50 +02:00
|
|
|
void OnClear(wxCommandEvent& event);
|
|
|
|
void OnLogTimer(wxTimerEvent& WXUNUSED(event));
|
|
|
|
void UpdateLog();
|
|
|
|
|
|
|
|
// LogListener
|
|
|
|
const char *getName() const { return "LogWindow"; }
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /*LOGWINDOW_H_*/
|