Duckstation/src/duckstation-qt/qtdisplaywidget.h

50 lines
1.2 KiB
C
Raw Normal View History

#pragma once
#include "common/types.h"
#include <QtWidgets/QWidget>
class QKeyEvent;
2020-01-02 09:14:16 +00:00
class QResizeEvent;
class HostDisplay;
class QtHostInterface;
class QtDisplayWidget : public QWidget
{
Q_OBJECT
public:
QtDisplayWidget(QtHostInterface* host_interface, QWidget* parent);
virtual ~QtDisplayWidget();
virtual HostDisplay* getHostDisplayInterface();
virtual bool hasDeviceContext() const;
virtual bool createDeviceContext(QThread* worker_thread, bool debug_device);
virtual bool initializeDeviceContext(bool debug_device);
virtual void destroyDeviceContext();
2020-01-02 09:14:16 +00:00
// this comes back on the emu thread
virtual void windowResized(s32 new_window_width, s32 new_window_height);
virtual QPaintEngine* paintEngine() const override;
2020-01-02 09:14:16 +00:00
Q_SIGNALS:
void windowResizedEvent(int width, int height);
void windowRestoredEvent();
2020-01-02 09:14:16 +00:00
protected:
qreal getDevicePixelRatioFromScreen() const;
int getScaledWindowWidth() const;
int getScaledWindowHeight() const;
virtual bool createImGuiContext();
virtual void destroyImGuiContext();
virtual bool createDeviceResources();
virtual void destroyDeviceResources();
virtual bool event(QEvent* event) override;
QtHostInterface* m_host_interface;
};