dolphin/Source/Core/DolphinQt2/RenderWidget.h

43 lines
878 B
C
Raw Normal View History

2015-11-27 01:33:07 -07:00
// Copyright 2015 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
#pragma once
2018-04-29 05:35:43 -06:00
#include <array>
2015-11-27 01:33:07 -07:00
#include <QEvent>
#include <QWidget>
2018-04-29 05:35:43 -06:00
class QMouseEvent;
class QTimer;
2015-11-27 01:33:07 -07:00
class RenderWidget final : public QWidget
{
Q_OBJECT
2015-11-27 01:33:07 -07:00
public:
explicit RenderWidget(QWidget* parent = nullptr);
2015-11-27 01:33:07 -07:00
bool event(QEvent* event) override;
2018-03-21 13:53:37 -06:00
void showFullScreen();
2015-11-27 01:33:07 -07:00
signals:
void EscapePressed();
void Closed();
void HandleChanged(void* handle);
void StateChanged(bool fullscreen);
void SizeChanged(int new_width, int new_height);
2017-06-01 00:49:21 -06:00
private:
void HandleCursorTimer();
2017-06-01 00:49:21 -06:00
void OnHideCursorChanged();
2018-04-22 02:56:15 -06:00
void OnKeepOnTopChanged(bool top);
void SetFillBackground(bool fill);
2018-04-29 05:35:43 -06:00
void OnFreeLookMouseMove(QMouseEvent* event);
static constexpr int MOUSE_HIDE_DELAY = 3000;
QTimer* m_mouse_timer;
2018-04-29 05:35:43 -06:00
std::array<float, 2> m_last_mouse{};
2015-11-27 01:33:07 -07:00
};