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/UI/DevScreens.h
Views: 1401
// Copyright (c) 2013- PPSSPP Project.12// This program is free software: you can redistribute it and/or modify3// it under the terms of the GNU General Public License as published by4// the Free Software Foundation, version 2.0 or later versions.56// This program is distributed in the hope that it will be useful,7// but WITHOUT ANY WARRANTY; without even the implied warranty of8// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the9// GNU General Public License 2.0 for more details.1011// A copy of the GPL 2.0 should have been included with the program.12// If not, see http://www.gnu.org/licenses/1314// Official git repository and contact information can be found at15// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.1617#pragma once1819#include <memory>20#include <string>21#include <vector>2223#include "Common/Data/Text/I18n.h"24#include "Common/Net/HTTPClient.h"25#include "Common/UI/UIScreen.h"26#include "UI/TabbedDialogScreen.h"27#include "UI/MiscScreens.h"28#include "GPU/Common/ShaderCommon.h"2930class DevMenuScreen : public PopupScreen {31public:32DevMenuScreen(const Path &gamePath, I18NCat cat) : PopupScreen(T(cat, "Dev Tools")), gamePath_(gamePath) {}3334const char *tag() const override { return "DevMenu"; }3536void CreatePopupContents(UI::ViewGroup *parent) override;37void dialogFinished(const Screen *dialog, DialogResult result) override;3839protected:40UI::EventReturn OnLogView(UI::EventParams &e);41UI::EventReturn OnLogConfig(UI::EventParams &e);42UI::EventReturn OnJitCompare(UI::EventParams &e);43UI::EventReturn OnShaderView(UI::EventParams &e);44UI::EventReturn OnDeveloperTools(UI::EventParams &e);45UI::EventReturn OnResetLimitedLogging(UI::EventParams &e);4647private:48Path gamePath_;49};5051class JitDebugScreen : public UIDialogScreenWithBackground {52public:53JitDebugScreen() {}54void CreateViews() override;5556const char *tag() const override { return "JitDebug"; }5758private:59UI::EventReturn OnEnableAll(UI::EventParams &e);60UI::EventReturn OnDisableAll(UI::EventParams &e);61};6263class LogConfigScreen : public UIDialogScreenWithBackground {64public:65LogConfigScreen() {}66void CreateViews() override;6768const char *tag() const override { return "LogConfig"; }6970private:71UI::EventReturn OnToggleAll(UI::EventParams &e);72UI::EventReturn OnEnableAll(UI::EventParams &e);73UI::EventReturn OnDisableAll(UI::EventParams &e);74UI::EventReturn OnLogLevel(UI::EventParams &e);75UI::EventReturn OnLogLevelChange(UI::EventParams &e);76};7778class LogScreen : public UIDialogScreenWithBackground {79public:80void CreateViews() override;81void update() override;8283const char *tag() const override { return "Log"; }8485private:86void UpdateLog();87UI::EventReturn OnSubmit(UI::EventParams &e);8889UI::TextEdit *cmdLine_ = nullptr;90UI::LinearLayout *vert_ = nullptr;91UI::ScrollView *scroll_ = nullptr;92bool toBottom_ = false;93};9495class LogLevelScreen : public UI::ListPopupScreen {96public:97LogLevelScreen(std::string_view title);9899const char *tag() const override { return "LogLevel"; }100101private:102void OnCompleted(DialogResult result) override;103};104105class SystemInfoScreen : public TabbedUIDialogScreenWithGameBackground {106public:107SystemInfoScreen(const Path &filename) : TabbedUIDialogScreenWithGameBackground(filename) {}108109const char *tag() const override { return "SystemInfo"; }110111void CreateTabs() override;112void update() override;113114protected:115bool ShowSearchControls() const override { return false; }116void CreateInternalsTab(UI::ViewGroup *internals);117};118119class GPIGPOScreen : public PopupScreen {120public:121GPIGPOScreen(std::string_view title) : PopupScreen(title, "OK") {}122const char *tag() const override { return "GPIGPO"; }123124protected:125void CreatePopupContents(UI::ViewGroup *parent) override;126};127128class ShaderListScreen : public UIDialogScreenWithBackground {129public:130void CreateViews() override;131132const char *tag() const override { return "ShaderList"; }133134private:135int ListShaders(DebugShaderType shaderType, UI::LinearLayout *view);136137UI::EventReturn OnShaderClick(UI::EventParams &e);138139UI::TabHolder *tabs_;140};141142class ShaderViewScreen : public UIDialogScreenWithBackground {143public:144ShaderViewScreen(std::string id, DebugShaderType type)145: id_(id), type_(type) {}146147void CreateViews() override;148bool key(const KeyInput &ki) override;149150const char *tag() const override { return "ShaderView"; }151152private:153std::string id_;154DebugShaderType type_;155};156157class FrameDumpTestScreen : public UIDialogScreenWithBackground {158public:159FrameDumpTestScreen();160~FrameDumpTestScreen();161162void CreateViews() override;163void update() override;164165const char *tag() const override { return "FrameDumpTest"; }166167private:168UI::EventReturn OnLoadDump(UI::EventParams &e);169170std::vector<std::string> files_;171std::shared_ptr<http::Request> listing_;172std::shared_ptr<http::Request> dumpDownload_;173};174175class TouchTestScreen : public UIDialogScreenWithGameBackground {176public:177TouchTestScreen(const Path &gamePath) : UIDialogScreenWithGameBackground(gamePath) {178for (int i = 0; i < MAX_TOUCH_POINTS; i++) {179touches_[i].id = -1;180}181}182183void touch(const TouchInput &touch) override;184void DrawForeground(UIContext &dc) override;185186bool key(const KeyInput &key) override;187void axis(const AxisInput &axis) override;188189const char *tag() const override { return "TouchTest"; }190191protected:192struct TrackedTouch {193int id;194float x;195float y;196};197enum {198MAX_TOUCH_POINTS = 10,199};200TrackedTouch touches_[MAX_TOUCH_POINTS]{};201202std::vector<std::string> keyEventLog_;203204UI::TextView *lastKeyEvents_ = nullptr;205206double lastFrameTime_ = 0.0;207208void CreateViews() override;209void UpdateLogView();210211UI::EventReturn OnImmersiveModeChange(UI::EventParams &e);212UI::EventReturn OnRenderingBackend(UI::EventParams &e);213UI::EventReturn OnRecreateActivity(UI::EventParams &e);214};215216void DrawProfile(UIContext &ui);217218void AddOverlayList(UI::ViewGroup *items, ScreenManager *screenManager);219220221