2015-05-24 07:55:12 +03:00
|
|
|
// Copyright 2009 Dolphin Emulator Project
|
2015-05-18 02:08:10 +03:00
|
|
|
// Licensed under GPLv2+
|
2013-04-18 06:43:35 +03:00
|
|
|
// Refer to the license.txt file included.
|
2009-09-01 02:09:50 +03:00
|
|
|
|
2014-02-10 20:54:46 +02:00
|
|
|
#pragma once
|
2010-08-03 06:20:44 +03:00
|
|
|
|
2014-02-23 00:36:30 +02:00
|
|
|
#include <mutex>
|
2009-09-01 02:09:50 +03:00
|
|
|
#include <queue>
|
2014-02-23 00:36:30 +02:00
|
|
|
#include <utility>
|
|
|
|
#include <vector>
|
|
|
|
#include <wx/font.h>
|
|
|
|
#include <wx/panel.h>
|
2015-03-01 03:25:50 +02:00
|
|
|
#include <wx/timer.h>
|
2009-09-01 02:09:50 +03:00
|
|
|
|
2014-09-08 04:06:58 +03:00
|
|
|
#include "Common/CommonTypes.h"
|
2014-06-06 02:29:54 +03:00
|
|
|
#include "Common/Logging/LogManager.h"
|
2014-02-23 00:36:30 +02:00
|
|
|
|
|
|
|
class CFrame;
|
|
|
|
class wxBoxSizer;
|
|
|
|
class wxCheckBox;
|
|
|
|
class wxChoice;
|
|
|
|
class wxTextCtrl;
|
2014-02-17 12:18:15 +02:00
|
|
|
|
2009-09-01 02:09:50 +03:00
|
|
|
// Uses multiple inheritance - only sane because LogListener is a pure virtual interface.
|
2009-09-08 00:37:27 +03:00
|
|
|
class CLogWindow : public wxPanel, LogListener
|
2009-09-01 02:09:50 +03:00
|
|
|
{
|
|
|
|
public:
|
2014-11-09 02:26:20 +02:00
|
|
|
CLogWindow(CFrame* parent,
|
2009-09-01 05:41:48 +03:00
|
|
|
wxWindowID id = wxID_ANY,
|
2010-07-22 05:05:28 +03:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxTAB_TRAVERSAL,
|
2011-01-05 06:35:46 +02:00
|
|
|
const wxString& name = _("Log")
|
2010-07-22 05:05:28 +03:00
|
|
|
);
|
2009-09-01 02:09:50 +03:00
|
|
|
~CLogWindow();
|
|
|
|
|
|
|
|
void SaveSettings();
|
2014-03-08 02:54:44 +02:00
|
|
|
void Log(LogTypes::LOG_LEVELS, const char *text) override;
|
2009-09-01 02:09:50 +03:00
|
|
|
|
2010-07-28 01:12:19 +03:00
|
|
|
int x, y, winpos;
|
|
|
|
|
2009-09-01 02:09:50 +03:00
|
|
|
private:
|
2014-11-09 02:26:20 +02:00
|
|
|
CFrame* Parent;
|
2009-09-04 01:52:58 +03:00
|
|
|
wxFont DefaultFont, MonoSpaceFont;
|
2010-08-03 06:20:44 +03:00
|
|
|
std::vector<wxFont> LogFont;
|
2015-03-01 03:25:50 +02:00
|
|
|
wxTimer m_LogTimer;
|
2014-11-09 02:26:20 +02:00
|
|
|
LogManager* m_LogManager;
|
2009-09-01 02:09:50 +03:00
|
|
|
std::queue<std::pair<u8, wxString> > msgQueue;
|
2015-03-16 07:11:18 +02:00
|
|
|
bool m_writeFile, m_writeWindow, m_LogAccess;
|
2009-09-04 01:52:58 +03:00
|
|
|
|
|
|
|
// Controls
|
2014-11-09 02:26:20 +02:00
|
|
|
wxBoxSizer* sBottom;
|
|
|
|
wxTextCtrl* m_Log;
|
|
|
|
wxTextCtrl* m_cmdline;
|
|
|
|
wxChoice* m_FontChoice;
|
|
|
|
wxCheckBox* m_WrapLine;
|
|
|
|
wxButton* m_clear_log_btn;
|
2009-09-01 02:09:50 +03:00
|
|
|
|
2011-03-05 08:11:26 +02:00
|
|
|
std::mutex m_LogSection;
|
2009-09-01 02:09:50 +03:00
|
|
|
|
2014-11-09 02:26:20 +02:00
|
|
|
wxTextCtrl* CreateTextCtrl(wxPanel* parent, wxWindowID id, long Style);
|
2009-09-01 02:09:50 +03:00
|
|
|
void CreateGUIControls();
|
2011-03-04 00:47:48 +02:00
|
|
|
void PopulateBottom();
|
|
|
|
void UnPopulateBottom();
|
2009-09-01 02:09:50 +03:00
|
|
|
void OnClose(wxCloseEvent& event);
|
2011-02-18 14:34:24 +02:00
|
|
|
void OnFontChange(wxCommandEvent& event);
|
|
|
|
void OnWrapLineCheck(wxCommandEvent& event);
|
2009-09-01 02:09:50 +03:00
|
|
|
void OnClear(wxCommandEvent& event);
|
|
|
|
void OnLogTimer(wxTimerEvent& WXUNUSED(event));
|
|
|
|
void UpdateLog();
|
|
|
|
};
|