summaryrefslogtreecommitdiffstats
path: root/gui/objects.hpp
diff options
context:
space:
mode:
authorVojtech Bocek <vbocek@gmail.com>2013-04-01 22:11:33 +0200
committerDees_Troy <dees_troy@teamw.in>2013-04-04 20:59:08 +0200
commit85932344cd9a84d8586b4f9839855c730c8e8ebc (patch)
treeced1604b4e8baf7b711ebc4f30c3f15ead4ff67a /gui/objects.hpp
parentMove all AOSP code out of recovery binary (diff)
downloadandroid_bootable_recovery-85932344cd9a84d8586b4f9839855c730c8e8ebc.tar
android_bootable_recovery-85932344cd9a84d8586b4f9839855c730c8e8ebc.tar.gz
android_bootable_recovery-85932344cd9a84d8586b4f9839855c730c8e8ebc.tar.bz2
android_bootable_recovery-85932344cd9a84d8586b4f9839855c730c8e8ebc.tar.lz
android_bootable_recovery-85932344cd9a84d8586b4f9839855c730c8e8ebc.tar.xz
android_bootable_recovery-85932344cd9a84d8586b4f9839855c730c8e8ebc.tar.zst
android_bootable_recovery-85932344cd9a84d8586b4f9839855c730c8e8ebc.zip
Diffstat (limited to 'gui/objects.hpp')
-rw-r--r--gui/objects.hpp66
1 files changed, 66 insertions, 0 deletions
diff --git a/gui/objects.hpp b/gui/objects.hpp
index 973c3cfe9..ff5429a9c 100644
--- a/gui/objects.hpp
+++ b/gui/objects.hpp
@@ -909,6 +909,72 @@ public:
virtual int KeyRepeat(void);
};
+class GUISliderValue: public RenderObject, public ActionObject, public Conditional
+{
+public:
+ GUISliderValue(xml_node<>* node);
+ virtual ~GUISliderValue();
+
+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);
+
+ // 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);
+
+ // 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);
+
+ // Notify of a variable change
+ virtual int NotifyVarChange(std::string varName, std::string value);
+
+ // SetPageFocus - Notify when a page gains or loses focus
+ virtual void SetPageFocus(int inFocus);
+
+protected:
+ int measureText(const std::string& str);
+ int valueFromPct(float pct);
+ float pctFromValue(int value);
+ void loadValue(bool force = false);
+
+ std::string mVariable;
+ int mMax;
+ int mMin;
+ int mValue;
+ char *mValueStr;
+ float mValuePct;
+ std::string mMaxStr;
+ std::string mMinStr;
+ Resource *mFont;
+ GUIText* mLabel;
+ int mLabelW;
+ COLOR mTextColor;
+ COLOR mLineColor;
+ COLOR mSliderColor;
+ bool mShowRange;
+ bool mShowCurr;
+ int mLineX;
+ int mLineY;
+ int mLineH;
+ int mLinePadding;
+ int mPadding;
+ int mSliderY;
+ int mSliderW;
+ int mSliderH;
+ bool mRendered;
+ int mFontHeight;
+ GUIAction *mAction;
+ bool mChangeOnDrag;
+ int lineW;
+};
+
// Helper APIs
bool LoadPlacement(xml_node<>* node, int* x, int* y, int* w = NULL, int* h = NULL, RenderObject::Placement* placement = NULL);