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 getTitle(wchar_t* title);
|
2021-12-02 00:47:02 +06:00
|
|
|
void blitToWidget(int x, int y, int w, int h);
|
2021-12-12 01:16:27 +06:00
|
|
|
QSize getRenderWidgetSize();
|
2021-12-09 20:59:50 +02:00
|
|
|
void setSendKeyboardInput(bool enabled);
|
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-12-14 00:31:55 +06:00
|
|
|
void updateStatusBarTip(int tag);
|
2021-12-12 01:16:27 +06:00
|
|
|
void updateMenuResizeOptions();
|
|
|
|
|
void updateWindowRememberOption();
|
2021-11-25 10:20:56 +01:00
|
|
|
|
2021-12-14 20:30:09 +01:00
|
|
|
void setTitle(const QString& title);
|
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 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-12-09 16:27:53 +06:00
|
|
|
void on_actionDocumentation_triggered();
|
|
|
|
|
void on_actionAbout_86Box_triggered();
|
|
|
|
|
void on_actionAbout_Qt_triggered();
|
2021-12-09 11:55:28 +01:00
|
|
|
void on_actionForce_4_3_display_ratio_triggered();
|
|
|
|
|
void on_actionChange_contrast_for_monochrome_display_triggered();
|
|
|
|
|
void on_actionCGA_PCjr_Tandy_EGA_S_VGA_overscan_triggered();
|
2021-12-12 01:16:27 +06:00
|
|
|
void on_actionRemember_size_and_position_triggered();
|
|
|
|
|
void on_actionSpecify_dimensions_triggered();
|
|
|
|
|
void on_actionHiDPI_scaling_triggered();
|
|
|
|
|
void on_actionHide_status_bar_triggered();
|
2022-01-09 17:00:16 +02:00
|
|
|
void on_actionHide_tool_bar_triggered();
|
2021-12-12 01:16:27 +06:00
|
|
|
void on_actionUpdate_status_bar_icons_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 getTitle_(wchar_t* title);
|
2021-12-12 01:16:27 +06:00
|
|
|
void on_actionTake_screenshot_triggered();
|
|
|
|
|
|
2021-12-12 16:22:35 +06:00
|
|
|
void on_actionSound_gain_triggered();
|
|
|
|
|
|
2021-12-27 16:32:03 +06:00
|
|
|
void on_actionOpenGL_3_0_Core_triggered();
|
|
|
|
|
|
2021-12-28 16:47:10 +06:00
|
|
|
void on_actionPreferences_triggered();
|
|
|
|
|
|
2022-01-09 01:04:59 +06:00
|
|
|
void on_actionEnable_Discord_integration_triggered(bool checked);
|
|
|
|
|
|
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-12 01:16:27 +06:00
|
|
|
void showEvent(QShowEvent* event) override;
|
|
|
|
|
void closeEvent(QCloseEvent* 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-12-09 20:59:50 +02:00
|
|
|
|
|
|
|
|
/* If main window should send keyboard input */
|
|
|
|
|
bool send_keyboard_input = true;
|
2021-12-24 01:57:26 +06:00
|
|
|
bool shownonce = false;
|
|
|
|
|
|
|
|
|
|
friend class SpecifyDimensions;
|
2021-12-28 16:47:10 +06:00
|
|
|
friend class ProgSettings;
|
2021-11-25 10:20:56 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // QT_MAINWINDOW_HPP
|