mirror of
https://github.com/XITRIX/Moonlight-Switch.git
synced 2026-05-30 11:46:51 +00:00
61 lines
1.6 KiB
C++
61 lines
1.6 KiB
C++
//
|
|
// streaming_view.hpp
|
|
// Moonlight
|
|
//
|
|
// Created by Даниил Виноградов on 27.05.2021.
|
|
//
|
|
|
|
#pragma once
|
|
|
|
#include "gestures/fingers_gesture_recognizer.hpp"
|
|
#include "keyboard_view.hpp"
|
|
#include "loading_overlay.hpp"
|
|
#include <Settings.hpp>
|
|
#include <borealis.hpp>
|
|
#include <optional>
|
|
#include "GameStreamClient.hpp"
|
|
#include "MoonlightSession.hpp"
|
|
#include "two_finger_scroll_recognizer.hpp"
|
|
|
|
class StreamingView : public brls::Box {
|
|
public:
|
|
StreamingView(const Host& host, const AppInfo& app);
|
|
~StreamingView();
|
|
|
|
void draw(NVGcontext* vg, float x, float y, float width, float height,
|
|
brls::Style style, brls::FrameContext* ctx) override;
|
|
void onFocusGained() override;
|
|
void onFocusLost() override;
|
|
void onLayout() override;
|
|
|
|
void terminate(bool terminateApp);
|
|
|
|
bool draw_stats = false;
|
|
|
|
Host getHost() { return host; }
|
|
|
|
AppInfo getApp() { return app; }
|
|
|
|
private:
|
|
Host host;
|
|
AppInfo app;
|
|
MoonlightSession* session = nullptr;
|
|
LoadingOverlay* loader = nullptr;
|
|
Box* keyboardHolder = nullptr;
|
|
KeyboardView* keyboard = nullptr;
|
|
bool blocked = false;
|
|
bool terminated = false;
|
|
bool tempInputLock = false;
|
|
brls::Event<brls::KeyState>::Subscription keysSubscription;
|
|
int touchScrollCounter = 0;
|
|
size_t bottombarDelayTask = -1;
|
|
bool m_use_hdr = false;
|
|
TwoFingerScrollGestureRecognizer* scrollTouchRecognizer = nullptr;
|
|
|
|
void handleInput();
|
|
void handleOverlayCombo();
|
|
void handleMouseInputCombo();
|
|
void addKeyboard();
|
|
void removeKeyboard();
|
|
};
|