summaryrefslogtreecommitdiffstats
path: root/gui/pages.cpp
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2014-12-12 23:59:10 +0100
committerDees Troy <dees_troy@teamw.in>2015-01-09 23:37:04 +0100
commit751a85e759fd2d43d7e150b560ae4890978eaeda (patch)
tree32b54ad14ad9c88b329f5cae8a3f0e2f053ed8db /gui/pages.cpp
parentAdd locking to DataManager, remove unused C parts (diff)
downloadandroid_bootable_recovery-751a85e759fd2d43d7e150b560ae4890978eaeda.tar
android_bootable_recovery-751a85e759fd2d43d7e150b560ae4890978eaeda.tar.gz
android_bootable_recovery-751a85e759fd2d43d7e150b560ae4890978eaeda.tar.bz2
android_bootable_recovery-751a85e759fd2d43d7e150b560ae4890978eaeda.tar.lz
android_bootable_recovery-751a85e759fd2d43d7e150b560ae4890978eaeda.tar.xz
android_bootable_recovery-751a85e759fd2d43d7e150b560ae4890978eaeda.tar.zst
android_bootable_recovery-751a85e759fd2d43d7e150b560ae4890978eaeda.zip
Diffstat (limited to '')
-rw-r--r--gui/pages.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/gui/pages.cpp b/gui/pages.cpp
index bea39e902..a1a6346a4 100644
--- a/gui/pages.cpp
+++ b/gui/pages.cpp
@@ -60,6 +60,9 @@ PageSet* PageManager::mBaseSet = NULL;
MouseCursor *PageManager::mMouseCursor = NULL;
HardwareKeyboard *PageManager::mHardwareKeyboard = NULL;
+int tw_x_offset = 0;
+int tw_y_offset = 0;
+
// Helper routine to convert a string to a color declaration
int ConvertStrToColor(std::string str, COLOR* color)
{
@@ -115,6 +118,7 @@ bool LoadPlacement(xml_node<>* node, int* x, int* y, int* w /* = NULL */, int* h
value = node->first_attribute("x")->value();
DataManager::GetValue(value, value);
*x = atol(value.c_str());
+ *x += tw_x_offset;
}
if (node->first_attribute("y"))
@@ -122,6 +126,7 @@ bool LoadPlacement(xml_node<>* node, int* x, int* y, int* w /* = NULL */, int* h
value = node->first_attribute("y")->value();
DataManager::GetValue(value, value);
*y = atol(value.c_str());
+ *y += tw_y_offset;
}
if (w && node->first_attribute("w"))
@@ -785,6 +790,16 @@ int PageSet::LoadVariables(xml_node<>* vars)
persist = child->first_attribute("persist");
if(name && value)
{
+ if (strcmp(name->value(), "tw_x_offset") == 0) {
+ tw_x_offset = atoi(value->value());
+ child = child->next_sibling("variable");
+ continue;
+ }
+ if (strcmp(name->value(), "tw_y_offset") == 0) {
+ tw_y_offset = atoi(value->value());
+ child = child->next_sibling("variable");
+ continue;
+ }
p = persist ? atoi(persist->value()) : 0;
string temp = value->value();
string valstr = gui_parse_text(temp);
@@ -928,6 +943,8 @@ int PageManager::LoadPackage(std::string name, std::string package, std::string
if (package.size() > 4 && package.substr(package.size() - 4) != ".zip")
{
LOGINFO("Load XML directly\n");
+ tw_x_offset = TW_X_OFFSET;
+ tw_y_offset = TW_Y_OFFSET;
// We can try to load the XML directly...
struct stat st;
if(stat(package.c_str(),&st) != 0)
@@ -948,6 +965,8 @@ int PageManager::LoadPackage(std::string name, std::string package, std::string
else
{
LOGINFO("Loading zip theme\n");
+ tw_x_offset = 0;
+ tw_y_offset = 0;
if (!TWFunc::Path_Exists(package))
return -1;
if (sysMapFile(package.c_str(), &map) != 0) {