2015-11-27 00:33:07 -08:00
|
|
|
// Copyright 2015 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2+
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QEvent>
|
|
|
|
#include <QWidget>
|
|
|
|
|
2018-04-29 13:35:43 +02:00
|
|
|
class QMouseEvent;
|
2017-07-04 10:58:27 -04:00
|
|
|
class QTimer;
|
|
|
|
|
2015-11-27 00:33:07 -08:00
|
|
|
class RenderWidget final : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2015-12-21 19:46:03 -08:00
|
|
|
explicit RenderWidget(QWidget* parent = nullptr);
|
2015-11-27 00:33:07 -08:00
|
|
|
|
2017-07-13 12:55:50 -07:00
|
|
|
bool event(QEvent* event) override;
|
2018-03-21 20:53:37 +01:00
|
|
|
void showFullScreen();
|
2019-04-22 20:29:04 -07:00
|
|
|
QPaintEngine* paintEngine() const override;
|
2015-11-27 00:33:07 -08:00
|
|
|
|
|
|
|
signals:
|
|
|
|
void EscapePressed();
|
|
|
|
void Closed();
|
|
|
|
void HandleChanged(void* handle);
|
|
|
|
void StateChanged(bool fullscreen);
|
2018-01-26 16:23:24 +10:00
|
|
|
void SizeChanged(int new_width, int new_height);
|
2018-06-08 20:47:15 +02:00
|
|
|
void FocusChanged(bool focus);
|
2017-05-31 23:49:21 -07:00
|
|
|
|
|
|
|
private:
|
2017-07-04 10:58:27 -04:00
|
|
|
void HandleCursorTimer();
|
2017-05-31 23:49:21 -07:00
|
|
|
void OnHideCursorChanged();
|
2018-04-22 10:56:15 +02:00
|
|
|
void OnKeepOnTopChanged(bool top);
|
2018-10-10 21:41:52 +10:00
|
|
|
void PassEventToImGui(const QEvent* event);
|
|
|
|
void SetImGuiKeyMap();
|
2018-09-21 22:26:26 -04:00
|
|
|
void dragEnterEvent(QDragEnterEvent* event) override;
|
|
|
|
void dropEvent(QDropEvent* event) override;
|
2017-07-04 10:58:27 -04:00
|
|
|
|
|
|
|
static constexpr int MOUSE_HIDE_DELAY = 3000;
|
|
|
|
QTimer* m_mouse_timer;
|
2019-03-09 10:25:41 -06:00
|
|
|
QPoint m_last_mouse{};
|
2015-11-27 00:33:07 -08:00
|
|
|
};
|