summaryrefslogtreecommitdiffstats
path: root/gui/objects.hpp
diff options
context:
space:
mode:
authorVojtech Bocek <vbocek@gmail.com>2014-02-08 02:05:33 +0100
committerVojtech Bocek <vbocek@gmail.com>2014-02-12 19:19:32 +0100
commit072205626caec16f3028a9b698e792e525848581 (patch)
treed262f85a3f58a7a86181dcadc24d6c352928f3f2 /gui/objects.hpp
parentProperly delete all GUIObjects and pages on theme reload (diff)
downloadandroid_bootable_recovery-072205626caec16f3028a9b698e792e525848581.tar
android_bootable_recovery-072205626caec16f3028a9b698e792e525848581.tar.gz
android_bootable_recovery-072205626caec16f3028a9b698e792e525848581.tar.bz2
android_bootable_recovery-072205626caec16f3028a9b698e792e525848581.tar.lz
android_bootable_recovery-072205626caec16f3028a9b698e792e525848581.tar.xz
android_bootable_recovery-072205626caec16f3028a9b698e792e525848581.tar.zst
android_bootable_recovery-072205626caec16f3028a9b698e792e525848581.zip
Diffstat (limited to '')
-rw-r--r--gui/objects.hpp32
1 files changed, 19 insertions, 13 deletions
diff --git a/gui/objects.hpp b/gui/objects.hpp
index 42dfb1f09..472d23b42 100644
--- a/gui/objects.hpp
+++ b/gui/objects.hpp
@@ -114,10 +114,6 @@ public:
// Return 0 if this object handles the request, 1 if not
virtual int IsInRegion(int x, int y) { return ((x < mActionX || x > mActionX + mActionW || y < mActionY || y > mActionY + mActionH) ? 0 : 1); }
- // NotifyVarChange - Notify of a variable change
- // Returns 0 on success, <0 on error
- virtual int NotifyVarChange(std::string varName, std::string value) { return 0; }
-
protected:
int mActionX, mActionY, mActionW, mActionH;
};
@@ -132,16 +128,24 @@ public:
bool IsConditionVariable(std::string var);
bool isConditionTrue();
bool isConditionValid();
- void NotifyPageSet();
+
+ // NotifyVarChange - Notify of a variable change
+ // Returns 0 on success, <0 on error
+ virtual int NotifyVarChange(const std::string& varName, const std::string& value);
protected:
class Condition
{
public:
+ Condition() {
+ mLastResult = true;
+ }
+
std::string mVar1;
std::string mVar2;
std::string mCompareOp;
std::string mLastVal;
+ bool mLastResult;
};
std::vector<Condition> mConditions;
@@ -149,6 +153,8 @@ protected:
protected:
bool isMounted(std::string vol);
bool isConditionTrue(Condition* condition);
+
+ bool mConditionsResult;
};
class InputObject
@@ -189,7 +195,7 @@ public:
virtual int GetCurrentBounds(int& w, int& h);
// Notify of a variable change
- virtual int NotifyVarChange(std::string varName, std::string value);
+ virtual int NotifyVarChange(const std::string& varName, const std::string& value);
// Set maximum width in pixels
virtual int SetMaxWidth(unsigned width);
@@ -264,7 +270,7 @@ public:
public:
virtual int NotifyTouch(TOUCH_STATE state, int x, int y);
virtual int NotifyKey(int key);
- virtual int NotifyVarChange(std::string varName, std::string value);
+ virtual int NotifyVarChange(const std::string& varName, const std::string& value);
virtual int doActions();
protected:
@@ -441,7 +447,7 @@ public:
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);
+ virtual int NotifyVarChange(const std::string& varName, const std::string& value);
// SetPos - Update the position of the render object
// Return 0 on success, <0 on error
@@ -545,7 +551,7 @@ public:
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);
+ virtual int NotifyVarChange(const std::string& varName, const std::string& value);
// SetPos - Update the position of the render object
// Return 0 on success, <0 on error
@@ -633,7 +639,7 @@ public:
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);
+ virtual int NotifyVarChange(const std::string& varName, const std::string& value);
// SetPos - Update the position of the render object
// Return 0 on success, <0 on error
@@ -737,7 +743,7 @@ public:
// NotifyVarChange - Notify of a variable change
// Returns 0 on success, <0 on error
- virtual int NotifyVarChange(std::string varName, std::string value);
+ virtual int NotifyVarChange(const std::string& varName, const std::string& value);
protected:
Resource* mEmptyBar;
@@ -854,7 +860,7 @@ public:
virtual int Update(void);
// Notify of a variable change
- virtual int NotifyVarChange(std::string varName, std::string value);
+ virtual int NotifyVarChange(const std::string& varName, const std::string& value);
// NotifyTouch - Notify of a touch event
// Return 0 on success, >0 to ignore remainder of touch, and <0 on error
@@ -937,7 +943,7 @@ public:
virtual int NotifyTouch(TOUCH_STATE state, int x, int y);
// Notify of a variable change
- virtual int NotifyVarChange(std::string varName, std::string value);
+ virtual int NotifyVarChange(const std::string& varName, const std::string& value);
// SetPageFocus - Notify when a page gains or loses focus
virtual void SetPageFocus(int inFocus);