1 // Copyright (c) 2013- PPSSPP Project. 2 3 // This program is free software: you can redistribute it and/or modify 4 // it under the terms of the GNU General Public License as published by 5 // the Free Software Foundation, version 2.0 or later versions. 6 7 // This program is distributed in the hope that it will be useful, 8 // but WITHOUT ANY WARRANTY; without even the implied warranty of 9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 // GNU General Public License 2.0 for more details. 11 12 // A copy of the GPL 2.0 should have been included with the program. 13 // If not, see http://www.gnu.org/licenses/ 14 15 // Official git repository and contact information can be found at 16 // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. 17 18 #pragma once 19 20 #include "Common/UI/View.h" 21 #include "Common/UI/ViewGroup.h" 22 #include "MiscScreens.h" 23 #include <vector> 24 25 class DragDropDisplay; 26 27 class DisplayLayoutScreen : public UIDialogScreenWithBackground { 28 public: 29 DisplayLayoutScreen(); 30 virtual void CreateViews() override; 31 virtual bool touch(const TouchInput &touch) override; 32 virtual void dialogFinished(const Screen *dialog, DialogResult result) override; 33 virtual void onFinish(DialogResult reason) override; 34 virtual void resized() override; tag()35 std::string tag() const override { return "display layout screen"; } 36 37 protected: 38 virtual UI::EventReturn OnCenter(UI::EventParams &e); 39 virtual UI::EventReturn OnZoomTypeChange(UI::EventParams &e); 40 41 private: 42 DragDropDisplay *displayRepresentation_ = nullptr; 43 UI::ChoiceStrip *mode_ = nullptr; 44 bool dragging_ = false; 45 bool bRotated_ = false; 46 bool stickToEdgeX_ = false; 47 bool stickToEdgeY_ = false; 48 // Touch down state for drag to resize etc 49 float startY_ = 0.0f; 50 float startScale_ = 1.0f; 51 int offsetTouchX_ = 0; 52 int offsetTouchY_ = 0; 53 54 }; 55