1 // Copyright (c) 2012- 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/Render/TextureAtlas.h" 21 #include "Common/Render/DrawBuffer.h" 22 #include "Common/UI/View.h" 23 #include "Common/UI/ViewGroup.h" 24 25 class MultiTouchDisplay : public UI::View { 26 public: MultiTouchDisplay(ImageID img,float scale,UI::LayoutParams * layoutParams)27 MultiTouchDisplay(ImageID img, float scale, UI::LayoutParams *layoutParams) 28 : UI::View(layoutParams), pointerDownMask_(0), scale_(scale), img_(img), angle_(0.0f), flipImageH_(false) { 29 } 30 virtual void Touch(const TouchInput &input) override; 31 virtual void Draw(UIContext &dc) override; 32 virtual void GetContentDimensions(const UIContext &dc, float &w, float &h) const override; 33 // chainable FlipImageH(bool flip)34 MultiTouchDisplay *FlipImageH(bool flip) { flipImageH_ = flip; return this; } SetAngle(float angle)35 MultiTouchDisplay *SetAngle(float angle) { angle_ = angle; return this; } 36 37 protected: 38 uint32_t pointerDownMask_; 39 float scale_; 40 41 private: 42 ImageID img_; 43 float angle_; 44 bool flipImageH_; 45 }; 46 47 class PSPDisplay : public MultiTouchDisplay { 48 public: PSPDisplay(ImageID img,float scale,UI::LayoutParams * layoutParams)49 PSPDisplay(ImageID img, float scale, UI::LayoutParams *layoutParams) 50 : MultiTouchDisplay(img, scale, layoutParams) { 51 } 52 }; 53 54