diff options
author | Dees Troy <dees_troy@teamw.in> | 2014-02-07 19:39:53 +0100 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit> | 2014-02-07 19:39:53 +0100 |
commit | e492e27d77ad0c033fc0f55d7a5ffe18752ac7bd (patch) | |
tree | a8f5b7c167c0f365dec2735c11717e09c781a9b7 /gui/pages.cpp | |
parent | Merge "Expansion of vibrate options" into android-4.4 (diff) | |
parent | Implement mouse cursor (diff) | |
download | android_bootable_recovery-e492e27d77ad0c033fc0f55d7a5ffe18752ac7bd.tar android_bootable_recovery-e492e27d77ad0c033fc0f55d7a5ffe18752ac7bd.tar.gz android_bootable_recovery-e492e27d77ad0c033fc0f55d7a5ffe18752ac7bd.tar.bz2 android_bootable_recovery-e492e27d77ad0c033fc0f55d7a5ffe18752ac7bd.tar.lz android_bootable_recovery-e492e27d77ad0c033fc0f55d7a5ffe18752ac7bd.tar.xz android_bootable_recovery-e492e27d77ad0c033fc0f55d7a5ffe18752ac7bd.tar.zst android_bootable_recovery-e492e27d77ad0c033fc0f55d7a5ffe18752ac7bd.zip |
Diffstat (limited to 'gui/pages.cpp')
-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) |