summaryrefslogtreecommitdiffstats
path: root/gui/objects.hpp
diff options
context:
space:
mode:
authorthat <github@that.at>2014-12-30 11:30:13 +0100
committerthat <github@that.at>2014-12-30 11:30:13 +0100
commit3f7b1aced8fd10d24a9850c6fd65fc819e744ddd (patch)
tree6f54c044e8aa0ef3ae4751646cc5f55d284e433c /gui/objects.hpp
parenttwrp-functions: remove unused functions (diff)
downloadandroid_bootable_recovery-3f7b1aced8fd10d24a9850c6fd65fc819e744ddd.tar
android_bootable_recovery-3f7b1aced8fd10d24a9850c6fd65fc819e744ddd.tar.gz
android_bootable_recovery-3f7b1aced8fd10d24a9850c6fd65fc819e744ddd.tar.bz2
android_bootable_recovery-3f7b1aced8fd10d24a9850c6fd65fc819e744ddd.tar.lz
android_bootable_recovery-3f7b1aced8fd10d24a9850c6fd65fc819e744ddd.tar.xz
android_bootable_recovery-3f7b1aced8fd10d24a9850c6fd65fc819e744ddd.tar.zst
android_bootable_recovery-3f7b1aced8fd10d24a9850c6fd65fc819e744ddd.zip
Diffstat (limited to '')
-rw-r--r--gui/objects.hpp73
1 files changed, 68 insertions, 5 deletions
diff --git a/gui/objects.hpp b/gui/objects.hpp
index 310ba4e26..3f12ea7f7 100644
--- a/gui/objects.hpp
+++ b/gui/objects.hpp
@@ -264,7 +264,8 @@ public:
virtual int NotifyTouch(TOUCH_STATE state, int x, int y);
virtual int NotifyKey(int key, bool down);
virtual int NotifyVarChange(const std::string& varName, const std::string& value);
- virtual int doActions();
+
+ int doActions();
protected:
class Action
@@ -279,14 +280,76 @@ protected:
protected:
int getKeyByName(std::string key);
- virtual int doAction(Action action, int isThreaded = 0);
- static void* thread_start(void *cookie);
+ int doAction(Action action);
void simulate_progress_bar(void);
- int flash_zip(std::string filename, std::string pageName, const int simulate, int* wipe_cache);
+ int flash_zip(std::string filename, std::string pageName, int* wipe_cache);
void operation_start(const string operation_name);
- void operation_end(const int operation_status, const int simulate);
+ void operation_end(const int operation_status);
static void* command_thread(void *cookie);
time_t Start;
+
+ // map action name to function pointer
+ typedef int (GUIAction::*execFunction)(std::string);
+ typedef std::map<std::string, execFunction> mapFunc;
+ static mapFunc mf;
+
+ // GUI actions
+ int reboot(std::string arg);
+ int home(std::string arg);
+ int key(std::string arg);
+ int page(std::string arg);
+ int reload(std::string arg);
+ int readBackup(std::string arg);
+ int set(std::string arg);
+ int clear(std::string arg);
+ int mount(std::string arg);
+ int unmount(std::string arg);
+ int restoredefaultsettings(std::string arg);
+ int copylog(std::string arg);
+ int compute(std::string arg);
+ int setguitimezone(std::string arg);
+ int overlay(std::string arg);
+ int queuezip(std::string arg);
+ int cancelzip(std::string arg);
+ int queueclear(std::string arg);
+ int sleep(std::string arg);
+ int appenddatetobackupname(std::string arg);
+ int generatebackupname(std::string arg);
+ int checkpartitionlist(std::string arg);
+ int getpartitiondetails(std::string arg);
+ int screenshot(std::string arg);
+ int setbrightness(std::string arg);
+
+ // threaded actions
+ int fileexists(std::string arg);
+ int flash(std::string arg);
+ int wipe(std::string arg);
+ int refreshsizes(std::string arg);
+ int nandroid(std::string arg);
+ int fixpermissions(std::string arg);
+ int dd(std::string arg);
+ int partitionsd(std::string arg);
+ int installhtcdumlock(std::string arg);
+ int htcdumlockrestoreboot(std::string arg);
+ int htcdumlockreflashrecovery(std::string arg);
+ int cmd(std::string arg);
+ int terminalcommand(std::string arg);
+ int killterminal(std::string arg);
+ int reinjecttwrp(std::string arg);
+ int checkbackupname(std::string arg);
+ int decrypt(std::string arg);
+ int adbsideload(std::string arg);
+ int adbsideloadcancel(std::string arg);
+ int openrecoveryscript(std::string arg);
+ int installsu(std::string arg);
+ int fixsu(std::string arg);
+ int decrypt_backup(std::string arg);
+ int repair(std::string arg);
+ int changefilesystem(std::string arg);
+ int startmtp(std::string arg);
+ int stopmtp(std::string arg);
+
+ int simulate;
};
class GUIConsole : public GUIObject, public RenderObject, public ActionObject