dolphin/Source/Core/DolphinQt/RenderWidget.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

55 lines
1.5 KiB
C
Raw Normal View History

2015-11-27 01:33:07 -07:00
// Copyright 2015 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
2015-11-27 01:33:07 -07:00
#pragma once
#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
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();
QPaintEngine* paintEngine() const override;
bool IsCursorLocked() const { return m_cursor_locked; }
void SetCursorLockedOnNextActivation(bool locked = true);
void SetWaitingForMessageBox(bool waiting_for_message_box);
void SetCursorLocked(bool locked, bool follow_aspect_ratio = true);
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);
void FocusChanged(bool focus);
2017-06-01 00:49:21 -06:00
private:
void HandleCursorTimer();
2017-06-01 00:49:21 -06:00
void OnHideCursorChanged();
void OnNeverHideCursorChanged();
void OnLockCursorChanged();
2018-04-22 02:56:15 -06:00
void OnKeepOnTopChanged(bool top);
void UpdateCursor();
2018-10-10 05:41:52 -06:00
void PassEventToImGui(const QEvent* event);
void SetImGuiKeyMap();
void dragEnterEvent(QDragEnterEvent* event) override;
void dropEvent(QDropEvent* event) override;
static constexpr int MOUSE_HIDE_DELAY = 3000;
QTimer* m_mouse_timer;
QPoint m_last_mouse{};
bool m_cursor_locked = false;
bool m_lock_cursor_on_next_activation = false;
bool m_dont_lock_cursor_on_show = false;
bool m_waiting_for_message_box = false;
2015-11-27 01:33:07 -07:00
};