1 #ifndef MAINWINDOW_H
2 #define MAINWINDOW_H
3 
4 #include <QMainWindow>
5 
6 class QEmulatorScreen;
7 class QKeyboardView;
8 class QConsoleView;
9 class QDebugView;
10 class QDisasmView;
11 class QMemoryView;
12 class QLabel;
13 
14 namespace Ui
15 {
16     class MainWindow;
17 }
18 
19 class MainWindow : public QMainWindow
20 {
21     Q_OBJECT
22 public:
23     MainWindow(QWidget *parent = nullptr);
24     ~MainWindow();
25 
26 public:
27     void UpdateMenu();
28     void UpdateAllViews();
29     void redrawDebugView();
30     void redrawDisasmView();
31     void updateWindowText();
32     void setCurrentProc(bool okProc);
33     void restoreSettings();
34     void showUptime(int uptimeMillisec);
35     void showFps(double framesPerSecond);
36 
37 public:
38     void saveStateImage(const QString& filename);
39     void loadStateImage(const QString& filename);
40     void saveScreenshot(const QString& filename);
41     bool attachFloppy(int slot, const QString& filename);
42     void detachFloppy(int slot);
43     bool attachCartridge(int slot, const QString& filename);
44     void detachCartridge(int slot);
45     bool attachHardDrive(int slot, const QString& filename);
46     void detachHardDrive(int slot);
47 
48 public slots:
49     void saveStateImage();
50     void loadStateImage();
51     void saveScreenshot();
52     void saveScreenshotAs();
53     void screenshotToClipboard();
54     void screenTextToClipboard();
55     void helpAbout();
56     void emulatorFrame();
57     void emulatorRun();
58     void emulatorReset();
59     void emulatorFloppy0();
60     void emulatorFloppy1();
61     void emulatorFloppy2();
62     void emulatorFloppy3();
63     void emulatorCartridge1();
64     void emulatorCartridge2();
65     void emulatorHardDrive1();
66     void emulatorHardDrive2();
67     void debugConsoleView();
68     void debugDebugView();
69     void debugDisasmView();
70     void debugMemoryView();
71     void debugStepInto();
72     void debugStepOver();
73     void viewKeyboard();
74     void viewRgbScreen();
75     void viewGrbScreen();
76     void viewGrayscaleScreen();
77     void viewSizeRegular();
78     void viewSizeUpscaled();
79     void viewSizeDoubleInterlaced();
80     void viewSizeDouble();
81     void viewSizeUpscaled3();
82     void viewSizeUpscaled175();
83     void viewSizeUpscaled4();
84     void viewSizeUpscaled5();
85     void soundEnabled();
86     void scriptRun();
87     void consolePrint(const QString&);
88 
89 protected:
90     void changeEvent(QEvent *e);
91     void closeEvent(QCloseEvent *);
92 
93 private:
94     Ui::MainWindow *ui;
95 
96     QEmulatorScreen *m_screen;
97     QKeyboardView *m_keyboard;
98     QConsoleView *m_console;
99     QDockWidget* m_dockConsole;
100     QDebugView *m_debug;
101     QDockWidget* m_dockDebug;
102     QDisasmView *m_disasm;
103     QDockWidget* m_dockDisasm;
104     QMemoryView * m_memory;
105     QDockWidget* m_dockMemory;
106 
107     QLabel* m_statusLabelInfo;
108     QLabel* m_statusLabelFrames;
109     QLabel* m_statusLabelUptime;
110 
111     void emulatorCartridge(int slot);
112     void emulatorHardDrive(int slot);
113     void emulatorFloppy(int slot);
114 };
115 
116 #endif // MAINWINDOW_H
117