diff options
author | Vojtech Bocek <vbocek@gmail.com> | 2014-01-29 18:37:19 +0100 |
---|---|---|
committer | Ethan Yonker <dees_troy@teamw.in> | 2014-02-07 19:37:13 +0100 |
commit | 1fc30fc77b5588c4b651085c21003aceb4ec5083 (patch) | |
tree | e8f522b1aa1150095bc0e440039c1a5b8205ab0c /gui/pages.cpp | |
parent | Expansion of vibrate options (diff) | |
download | android_bootable_recovery-1fc30fc77b5588c4b651085c21003aceb4ec5083.tar android_bootable_recovery-1fc30fc77b5588c4b651085c21003aceb4ec5083.tar.gz android_bootable_recovery-1fc30fc77b5588c4b651085c21003aceb4ec5083.tar.bz2 android_bootable_recovery-1fc30fc77b5588c4b651085c21003aceb4ec5083.tar.lz android_bootable_recovery-1fc30fc77b5588c4b651085c21003aceb4ec5083.tar.xz android_bootable_recovery-1fc30fc77b5588c4b651085c21003aceb4ec5083.tar.zst android_bootable_recovery-1fc30fc77b5588c4b651085c21003aceb4ec5083.zip |
Diffstat (limited to '')
-rw-r--r-- | gui/pages.cpp | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/gui/pages.cpp b/gui/pages.cpp index d662f18f8..dc9edc798 100644 --- a/gui/pages.cpp +++ b/gui/pages.cpp @@ -54,6 +54,7 @@ extern blanktimer blankTimer; std::map<std::string, PageSet*> PageManager::mPageSets; PageSet* PageManager::mCurrentSet; PageSet* PageManager::mBaseSet = NULL; +MouseCursor *PageManager::mMouseCursor = NULL; // Helper routine to convert a string to a color declaration int ConvertStrToColor(std::string str, COLOR* color) @@ -550,6 +551,11 @@ int PageSet::Load(ZipArchive* package) if (child) LoadVariables(child); + LOGINFO("Loading mouse cursor...\n"); + child = parent->first_node("mousecursor"); + if(child) + PageManager::LoadCursorData(child); + LOGINFO("Loading pages...\n"); // This may be NULL if no templates are present templates = parent->first_node("templates"); @@ -849,6 +855,9 @@ int PageManager::ReloadPackage(std::string name, std::string package) if (iter == mPageSets.end()) return -1; + if(mMouseCursor) + mMouseCursor->ResetData(gr_fb_width(), gr_fb_height()); + PageSet* set = (*iter).second; mPageSets.erase(iter); @@ -924,7 +933,25 @@ int PageManager::IsCurrentPage(Page* page) int PageManager::Render(void) { - return (mCurrentSet ? mCurrentSet->Render() : -1); + int res = (mCurrentSet ? mCurrentSet->Render() : -1); + if(mMouseCursor) + mMouseCursor->Render(); + return res; +} + +MouseCursor *PageManager::GetMouseCursor() +{ + if(!mMouseCursor) + mMouseCursor = new MouseCursor(gr_fb_width(), gr_fb_height()); + return mMouseCursor; +} + +void PageManager::LoadCursorData(xml_node<>* node) +{ + if(!mMouseCursor) + mMouseCursor = new MouseCursor(gr_fb_width(), gr_fb_height()); + + mMouseCursor->LoadData(node); } int PageManager::Update(void) @@ -933,7 +960,16 @@ int PageManager::Update(void) if(blankTimer.IsScreenOff()) return 0; #endif - return (mCurrentSet ? mCurrentSet->Update() : -1); + + int res = (mCurrentSet ? mCurrentSet->Update() : -1); + + if(mMouseCursor) + { + int c_res = mMouseCursor->Update(); + if(c_res > res) + res = c_res; + } + return res; } int PageManager::NotifyTouch(TOUCH_STATE state, int x, int y) |