~registry/dolphin-emu/triforce

« back to all changes in this revision

Viewing changes to Source/Core/DolphinWX/Src/LogWindow.h

  • Committer: Sérgio Benjamim
  • Date: 2015-02-13 05:54:40 UTC
  • Revision ID: sergio_br2@yahoo.com.br-20150213055440-ey2rt3sjpy27km78
Dolphin Triforce branch from code.google, commit b957980 (4.0-315).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright 2013 Dolphin Emulator Project
 
2
// Licensed under GPLv2
 
3
// Refer to the license.txt file included.
 
4
 
 
5
#ifndef LOGWINDOW_H_
 
6
#define LOGWINDOW_H_
 
7
 
 
8
#include "LogManager.h"
 
9
#include "Frame.h"
 
10
#include "Thread.h"
 
11
#include <queue>
 
12
 
 
13
enum
 
14
{
 
15
        IDM_LOG,
 
16
        IDM_CLEARLOG,
 
17
        IDM_TOGGLEALL,
 
18
        IDM_WRAPLINE,
 
19
        IDTM_UPDATELOG,
 
20
        IDM_FONT,
 
21
        IDM_SUBMITCMD
 
22
};
 
23
 
 
24
class wxTextCtrl;
 
25
class wxCheckListBox;
 
26
class wxString;
 
27
class CFrame;
 
28
 
 
29
// Uses multiple inheritance - only sane because LogListener is a pure virtual interface.
 
30
class CLogWindow : public wxPanel, LogListener
 
31
{
 
32
public:
 
33
        CLogWindow(CFrame *parent,
 
34
                wxWindowID id = wxID_ANY,
 
35
                const wxPoint& pos = wxDefaultPosition,
 
36
                const wxSize& size = wxDefaultSize,
 
37
                long style = wxTAB_TRAVERSAL,
 
38
                const wxString& name = _("Log")
 
39
                );
 
40
        ~CLogWindow();
 
41
 
 
42
        void SaveSettings();
 
43
        void Log(LogTypes::LOG_LEVELS, const char *text);
 
44
 
 
45
        int x, y, winpos;
 
46
 
 
47
private:
 
48
        CFrame *Parent;
 
49
        wxFont DefaultFont, MonoSpaceFont;
 
50
        std::vector<wxFont> LogFont;
 
51
        wxTimer *m_LogTimer;
 
52
        bool m_ignoreLogTimer;
 
53
        LogManager *m_LogManager;
 
54
        std::queue<std::pair<u8, wxString> > msgQueue;
 
55
        bool m_writeFile, m_writeConsole, m_writeWindow, m_writeDebugger, m_LogAccess;
 
56
 
 
57
        // Controls
 
58
        wxBoxSizer *sBottom;
 
59
        wxTextCtrl *m_Log, *m_cmdline;
 
60
        wxChoice *m_FontChoice;
 
61
        wxCheckBox *m_WrapLine;
 
62
 
 
63
        std::mutex m_LogSection;
 
64
 
 
65
        DECLARE_EVENT_TABLE()
 
66
 
 
67
        wxTextCtrl * CreateTextCtrl(wxPanel* parent, wxWindowID id, long Style);
 
68
        void CreateGUIControls();
 
69
        void PopulateBottom();
 
70
        void UnPopulateBottom();
 
71
        void OnClose(wxCloseEvent& event);
 
72
        void OnSubmit(wxCommandEvent& event);
 
73
        void OnFontChange(wxCommandEvent& event);
 
74
        void OnWrapLineCheck(wxCommandEvent& event);
 
75
        void OnClear(wxCommandEvent& event);
 
76
        void OnLogTimer(wxTimerEvent& WXUNUSED(event));
 
77
        void UpdateLog();
 
78
 
 
79
        // LogListener
 
80
        const char *getName() const { return "LogWindow"; }
 
81
};
 
82
 
 
83
#endif /*LOGWINDOW_H_*/