CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
Path: blob/master/UWP/App.h
Views: 1401
#pragma once12#include <set>34#include "pch.h"5#include "Common/DeviceResources.h"6#include "PPSSPP_UWPMain.h"78namespace UWP {9struct Touch {10bool inUse = false;11unsigned uid;12};1314class TouchMapper {15public:16int TouchId(unsigned touch) {17for (int touchIx = 0; touchIx < maxTouches; touchIx++)18if (touches[touchIx].inUse && touches[touchIx].uid == touch)19return touchIx;20return -1;21}2223int AddNewTouch(unsigned touch) {24for (int touchIx = 0; touchIx < maxTouches; touchIx++) {25if (!touches[touchIx].inUse) {26touches[touchIx].inUse = true;27touches[touchIx].uid = touch;28return touchIx;29}30}31return -1;32}3334int RemoveTouch(unsigned touch) {35for (int touchIx = 0; touchIx < maxTouches; touchIx++) {36if (touches[touchIx].inUse && touches[touchIx].uid == touch) {37touches[touchIx].inUse = false;38return touchIx;39}40}41return -1;42}4344private:45enum { maxTouches = 11 };46Touch touches[maxTouches]{};47};4849enum class HardwareButton {50BACK,51};5253// Main entry point for our app. Connects the app with the Windows shell and handles application lifecycle events.54ref class App sealed : public Windows::ApplicationModel::Core::IFrameworkView {55public:56App();5758// IFrameworkView Methods.59virtual void Initialize(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView);60virtual void SetWindow(Windows::UI::Core::CoreWindow^ window);61virtual void Load(Platform::String^ entryPoint);62virtual void Run();63virtual void Uninitialize();6465bool HasBackButton();6667protected:68// Application lifecycle event handlers.69void OnActivated(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView, Windows::ApplicationModel::Activation::IActivatedEventArgs^ args);70void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ args);71void OnResuming(Platform::Object^ sender, Platform::Object^ args);7273// Window event handlers.74void OnWindowSizeChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::WindowSizeChangedEventArgs^ args);75void OnVisibilityChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ args);76void OnWindowClosed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::CoreWindowEventArgs^ args);7778// DisplayInformation event handlers.79void OnDpiChanged(Windows::Graphics::Display::DisplayInformation^ sender, Platform::Object^ args);80void OnOrientationChanged(Windows::Graphics::Display::DisplayInformation^ sender, Platform::Object^ args);81void OnDisplayContentsInvalidated(Windows::Graphics::Display::DisplayInformation^ sender, Platform::Object^ args);8283// Input84void OnKeyDown(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::KeyEventArgs^ args);85void OnKeyUp(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::KeyEventArgs^ args);86void OnCharacterReceived(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::CharacterReceivedEventArgs^ args);8788void OnPointerMoved(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);89void OnPointerEntered(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);90void OnPointerExited(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);91void OnPointerPressed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);92void OnPointerReleased(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);93void OnPointerCaptureLost(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);94void OnPointerWheelChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);9596void App_BackRequested(Platform::Object^ sender, Windows::UI::Core::BackRequestedEventArgs^ e);97void InitialPPSSPP();9899private:100std::shared_ptr<DX::DeviceResources> m_deviceResources;101std::set<HardwareButton> m_hardwareButtons;102std::unique_ptr<PPSSPP_UWPMain> m_main;103bool m_windowClosed;104bool m_windowVisible;105106bool m_isPhone = false;107TouchMapper touchMap_;108};109}110111ref class Direct3DApplicationSource sealed : Windows::ApplicationModel::Core::IFrameworkViewSource112{113public:114virtual Windows::ApplicationModel::Core::IFrameworkView^ CreateView();115};116117118