2021-11-25 10:20:56 +01:00
|
|
|
#ifndef QT_MAINWINDOW_HPP
|
|
|
|
|
#define QT_MAINWINDOW_HPP
|
|
|
|
|
|
|
|
|
|
#include <QMainWindow>
|
|
|
|
|
#include <QLabel>
|
2021-11-30 22:06:41 +01:00
|
|
|
#include <QEvent>
|
2021-12-05 15:57:46 +06:00
|
|
|
#include <QFocusEvent>
|
2021-11-25 10:20:56 +01:00
|
|
|
|
2021-12-03 11:38:00 +01:00
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
|
|
class MediaMenu;
|
|
|
|
|
|
2021-11-25 10:20:56 +01:00
|
|
|
namespace Ui {
|
|
|
|
|
class MainWindow;
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-30 22:06:41 +01:00
|
|
|
class MachineStatus;
|
|
|
|
|
|
2021-11-25 10:20:56 +01:00
|
|
|
class MainWindow : public QMainWindow
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
explicit MainWindow(QWidget *parent = nullptr);
|
|
|
|
|
~MainWindow();
|
2021-11-29 17:25:31 +01:00
|
|
|
|
|
|
|
|
void showMessage(const QString& header, const QString& message);
|
2021-12-01 15:55:41 +06:00
|
|
|
void setTitle(const wchar_t* title);
|
|
|
|
|
void getTitle(wchar_t* title);
|
2021-12-02 00:47:02 +06:00
|
|
|
void blitToWidget(int x, int y, int w, int h);
|
2021-11-25 10:20:56 +01:00
|
|
|
signals:
|
|
|
|
|
void paint(const QImage& image);
|
|
|
|
|
void resizeContents(int w, int h);
|
|
|
|
|
void pollMouse();
|
2021-12-03 11:38:00 +01:00
|
|
|
void statusBarMessage(const QString& msg);
|
2021-11-28 20:49:05 +01:00
|
|
|
void updateStatusBarPanes();
|
|
|
|
|
void updateStatusBarActivity(int tag, bool active);
|
|
|
|
|
void updateStatusBarEmpty(int tag, bool empty);
|
2021-11-25 10:20:56 +01:00
|
|
|
|
|
|
|
|
void setFullscreen(bool state);
|
|
|
|
|
void setMouseCapture(bool state);
|
|
|
|
|
|
2021-11-29 17:25:31 +01:00
|
|
|
void showMessageForNonQtThread(const QString& header, const QString& message);
|
2021-12-01 15:55:41 +06:00
|
|
|
void setTitleForNonQtThread(const wchar_t* title);
|
|
|
|
|
void getTitleForNonQtThread(wchar_t* title);
|
2021-11-25 10:20:56 +01:00
|
|
|
private slots:
|
|
|
|
|
void on_actionFullscreen_triggered();
|
|
|
|
|
void on_actionSettings_triggered();
|
|
|
|
|
void on_actionExit_triggered();
|
|
|
|
|
void on_actionPause_triggered();
|
|
|
|
|
void on_actionCtrl_Alt_Del_triggered();
|
|
|
|
|
void on_actionCtrl_Alt_Esc_triggered();
|
|
|
|
|
void on_actionHard_Reset_triggered();
|
|
|
|
|
void on_actionRight_CTRL_is_left_ALT_triggered();
|
|
|
|
|
void on_actionKeyboard_requires_capture_triggered();
|
2021-12-04 21:33:04 +01:00
|
|
|
void on_actionHardware_Renderer_OpenGL_ES_triggered();
|
|
|
|
|
void on_actionHardware_Renderer_OpenGL_triggered();
|
|
|
|
|
void on_actionSoftware_Renderer_triggered();
|
2021-12-06 21:26:17 +01:00
|
|
|
void on_actionResizable_window_triggered(bool checked);
|
2021-12-06 21:45:40 +01:00
|
|
|
void on_actionInverted_VGA_monitor_triggered();
|
2021-12-06 21:58:41 +01:00
|
|
|
void on_action0_5x_triggered();
|
|
|
|
|
void on_action1x_triggered();
|
|
|
|
|
void on_action1_5x_triggered();
|
|
|
|
|
void on_action2x_triggered();
|
2021-12-06 22:02:18 +01:00
|
|
|
void on_actionLinear_triggered();
|
|
|
|
|
void on_actionNearest_triggered();
|
2021-12-07 13:47:42 +01:00
|
|
|
void on_actionFullScreen_int_triggered();
|
|
|
|
|
void on_actionFullScreen_keepRatio_triggered();
|
|
|
|
|
void on_actionFullScreen_43_triggered();
|
|
|
|
|
void on_actionFullScreen_stretch_triggered();
|
2021-12-08 15:12:21 +01:00
|
|
|
void on_actionWhite_monitor_triggered();
|
|
|
|
|
void on_actionGreen_monitor_triggered();
|
|
|
|
|
void on_actionAmber_monitor_triggered();
|
|
|
|
|
void on_actionRGB_Grayscale_triggered();
|
|
|
|
|
void on_actionRGB_Color_triggered();
|
2021-12-08 15:17:33 +01:00
|
|
|
void on_actionAverage_triggered();
|
|
|
|
|
void on_actionBT709_HDTV_triggered();
|
|
|
|
|
void on_actionBT601_NTSC_PAL_triggered();
|
2021-11-25 10:20:56 +01:00
|
|
|
|
2021-12-03 11:38:00 +01:00
|
|
|
void refreshMediaMenu();
|
2021-11-29 19:03:00 +01:00
|
|
|
void showMessage_(const QString& header, const QString& message);
|
2021-12-01 15:55:41 +06:00
|
|
|
void setTitle_(const wchar_t* title);
|
|
|
|
|
void getTitle_(wchar_t* title);
|
2021-11-30 16:26:49 +06:00
|
|
|
protected:
|
|
|
|
|
void keyPressEvent(QKeyEvent* event) override;
|
|
|
|
|
void keyReleaseEvent(QKeyEvent* event) override;
|
2021-12-05 15:57:46 +06:00
|
|
|
void focusInEvent(QFocusEvent* event) override;
|
|
|
|
|
void focusOutEvent(QFocusEvent* event) override;
|
|
|
|
|
bool eventFilter(QObject* receiver, QEvent* event) override;
|
2021-12-04 21:33:04 +01:00
|
|
|
|
2021-11-25 10:20:56 +01:00
|
|
|
private:
|
|
|
|
|
Ui::MainWindow *ui;
|
2021-11-30 22:06:41 +01:00
|
|
|
std::unique_ptr<MachineStatus> status;
|
2021-12-03 11:38:00 +01:00
|
|
|
std::shared_ptr<MediaMenu> mm;
|
2021-11-25 10:20:56 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // QT_MAINWINDOW_HPP
|