diff options
author | Vojtech Bocek <vbocek@gmail.com> | 2015-03-05 23:21:49 +0100 |
---|---|---|
committer | Ethan Yonker <dees_troy@teamw.in> | 2015-03-13 18:12:58 +0100 |
commit | 7e11ac5d3c345f0f1227a070a1c10eee885bcfce (patch) | |
tree | 499c77e9b8e549bc941837b081552da4c4ab2303 /gui/objects.hpp | |
parent | Allow touch to use a key code to sync touch events (diff) | |
download | android_bootable_recovery-7e11ac5d3c345f0f1227a070a1c10eee885bcfce.tar android_bootable_recovery-7e11ac5d3c345f0f1227a070a1c10eee885bcfce.tar.gz android_bootable_recovery-7e11ac5d3c345f0f1227a070a1c10eee885bcfce.tar.bz2 android_bootable_recovery-7e11ac5d3c345f0f1227a070a1c10eee885bcfce.tar.lz android_bootable_recovery-7e11ac5d3c345f0f1227a070a1c10eee885bcfce.tar.xz android_bootable_recovery-7e11ac5d3c345f0f1227a070a1c10eee885bcfce.tar.zst android_bootable_recovery-7e11ac5d3c345f0f1227a070a1c10eee885bcfce.zip |
Diffstat (limited to '')
-rw-r--r-- | gui/objects.hpp | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/gui/objects.hpp b/gui/objects.hpp index 261141134..d26b0c2ed 100644 --- a/gui/objects.hpp +++ b/gui/objects.hpp @@ -1058,6 +1058,58 @@ private: bool m_present; }; +class GUIPatternPassword : public GUIObject, public RenderObject, public ActionObject +{ +public: + GUIPatternPassword(xml_node<>* node); + virtual ~GUIPatternPassword(); + +public: + virtual int Render(void); + virtual int Update(void); + virtual int NotifyTouch(TOUCH_STATE state, int x, int y); + virtual int SetRenderPos(int x, int y, int w = 0, int h = 0); + +protected: + void CalculateDotPositions(); + void ResetActiveDots(); + void ConnectDot(int dot_idx); + void ConnectIntermediateDots(int dot_idx); + int InDot(int x, int y); + bool DotUsed(int dot_idx); + static bool IsInRect(int x, int y, int rx, int ry, int rw, int rh); + void PatternDrawn(); + + struct Dot { + int x; + int y; + bool active; + }; + + Dot mDots[9]; + int mConnectedDots[9]; + size_t mConnectedDotsLen; + int mCurLineX; + int mCurLineY; + bool mTrackingTouch; + bool mNeedRender; + + COLOR mDotColor; + COLOR mActiveDotColor; + COLOR mLineColor; + ImageResource *mDotImage; + ImageResource *mActiveDotImage; + gr_surface mDotCircle; + gr_surface mActiveDotCircle; + int mDotRadius; + int mLineWidth; + + std::string mPassVar; + GUIAction *mAction; + int mUpdate; +}; + + // Helper APIs xml_node<>* FindNode(xml_node<>* parent, const char* nodename, int depth = 0); std::string LoadAttrString(xml_node<>* element, const char* attrname, const char* defaultvalue = ""); |