From a13d74fc95324c4318fcc95956b07fe593669412 Mon Sep 17 00:00:00 2001 From: Dees_Troy Date: Sun, 24 Mar 2013 08:54:55 -0500 Subject: Add partition list GUI element Add partition list GUI element and update backup, restore, mount, storage selection, and wipe sections of GUI and partition manager code to reflect the new GUI element. Update ORS engine to handle new backup and restore setup. Fix a bug with decrypt. Add 1080x1920 layout. Change-Id: Iaa2f44cb707167e66f935452f076ba00e68a2aa4 --- gui/objects.hpp | 106 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) (limited to 'gui/objects.hpp') diff --git a/gui/objects.hpp b/gui/objects.hpp index 3a39fe565..973c3cfe9 100644 --- a/gui/objects.hpp +++ b/gui/objects.hpp @@ -1,3 +1,20 @@ +/* + Copyright 2013 bigbiff/Dees_Troy TeamWin + This file is part of TWRP/TeamWin Recovery Project. + + TWRP is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + TWRP is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with TWRP. If not, see . +*/ // objects.h - Base classes for object manager of GUI #ifndef _OBJECTS_HEADER @@ -17,6 +34,7 @@ using namespace rapidxml; #include "../data.hpp" #include "resources.hpp" #include "pages.hpp" +#include "../partitions.hpp" class RenderObject { @@ -357,6 +375,8 @@ protected: bool mRendered; bool hasHighlightColor; bool renderHighlight; + bool hasFill; + COLOR mFillColor; COLOR mHighlightColor; }; @@ -586,6 +606,92 @@ protected: int touchDebounce; }; +class GUIPartitionList : public RenderObject, public ActionObject +{ +public: + GUIPartitionList(xml_node<>* node); + virtual ~GUIPartitionList(); + +public: + // Render - Render the full object to the GL surface + // Return 0 on success, <0 on error + virtual int Render(void); + + // Update - Update any UI component animations (called <= 30 FPS) + // Return 0 if nothing to update, 1 on success and contiue, >1 if full render required, and <0 on error + virtual int Update(void); + + // NotifyTouch - Notify of a touch event + // Return 0 on success, >0 to ignore remainder of touch, and <0 on error + virtual int NotifyTouch(TOUCH_STATE state, int x, int y); + + // NotifyVarChange - Notify of a variable change + virtual int NotifyVarChange(std::string varName, std::string value); + + // SetPos - Update the position of the render object + // Return 0 on success, <0 on error + virtual int SetRenderPos(int x, int y, int w = 0, int h = 0); + + // SetPageFocus - Notify when a page gains or loses focus + virtual void SetPageFocus(int inFocus); + +protected: + +protected: + virtual int GetSelection(int x, int y); + virtual void MatchList(void); + +protected: + std::vector mList; + std::string ListType; + std::string mVariable; + std::string selectedList; + std::string currentValue; + std::string mHeaderText; + std::string mLastValue; + int actualLineHeight; + int mStart; + int startY; + int mSeparatorH, mHeaderSeparatorH; + int mLineSpacing; + int mUpdate; + int mBackgroundX, mBackgroundY, mBackgroundW, mBackgroundH, mHeaderH; + int mFastScrollW; + int mFastScrollLineW; + int mFastScrollRectW; + int mFastScrollRectH; + int mFastScrollRectX; + int mFastScrollRectY; + int mIconWidth, mIconHeight, mSelectedIconWidth, mSelectedIconHeight, mUnselectedIconWidth, mUnselectedIconHeight, mHeaderIconHeight, mHeaderIconWidth; + int scrollingSpeed; + int scrollingY; + static int mSortOrder; + unsigned mFontHeight; + unsigned mLineHeight; + Resource* mHeaderIcon; + Resource* mIconSelected; + Resource* mIconUnselected; + Resource* mBackground; + Resource* mFont; + COLOR mBackgroundColor; + COLOR mFontColor; + COLOR mHeaderBackgroundColor; + COLOR mHeaderFontColor; + COLOR mSeparatorColor; + COLOR mHeaderSeparatorColor; + COLOR mFastScrollLineColor; + COLOR mFastScrollRectColor; + bool hasHighlightColor; + bool hasFontHighlightColor; + bool isHighlighted; + COLOR mHighlightColor; + COLOR mFontHighlightColor; + int mHeaderIsStatic; + int startSelection; + int touchDebounce; + bool updateList; +}; + // GUIAnimation - Used for animations class GUIAnimation : public RenderObject { -- cgit v1.2.3