diff options
Diffstat (limited to 'gui')
38 files changed, 1242 insertions, 49 deletions
diff --git a/gui/Android.mk b/gui/Android.mk index ac0b2037c..29d99f7f8 100644 --- a/gui/Android.mk +++ b/gui/Android.mk @@ -22,7 +22,8 @@ LOCAL_SRC_FILES := \ keyboard.cpp \ input.cpp \ blanktimer.cpp \ - partitionlist.cpp + partitionlist.cpp \ + mousecursor.cpp ifneq ($(TWRP_CUSTOM_KEYBOARD),) LOCAL_SRC_FILES += $(TWRP_CUSTOM_KEYBOARD) diff --git a/gui/action.cpp b/gui/action.cpp index 5536c82b1..9c785d169 100644 --- a/gui/action.cpp +++ b/gui/action.cpp @@ -314,6 +314,7 @@ void* GUIAction::thread_start(void *cookie) void GUIAction::operation_start(const string operation_name) { + time(&Start); DataManager::SetValue(TW_ACTION_BUSY, 1); DataManager::SetValue("ui_progress", 0); DataManager::SetValue("tw_operation", operation_name); @@ -323,6 +324,7 @@ void GUIAction::operation_start(const string operation_name) void GUIAction::operation_end(const int operation_status, const int simulate) { + time_t Stop; int simulate_fail; DataManager::SetValue("ui_progress", 100); if (simulate) { @@ -344,6 +346,9 @@ void GUIAction::operation_end(const int operation_status, const int simulate) #ifndef TW_NO_SCREEN_TIMEOUT blankTimer.resetTimerAndUnblank(); #endif + time(&Stop); + if ((int) difftime(Stop, Start) > 10) + DataManager::Vibrate("tw_action_vibrate"); } int GUIAction::doAction(Action action, int isThreaded /* = 0 */) @@ -920,6 +925,7 @@ int GUIAction::doAction(Action action, int isThreaded /* = 0 */) else { operation_end(1, simulate); return -1; + } DataManager::SetValue(TW_BACKUP_NAME, "(Auto Generate)"); } else if (arg == "restore") { diff --git a/gui/button.cpp b/gui/button.cpp index be52c277e..b14e6754c 100644 --- a/gui/button.cpp +++ b/gui/button.cpp @@ -30,6 +30,7 @@ #include <time.h> #include <unistd.h> #include <stdlib.h> +#include "../data.hpp" #include <string> @@ -280,6 +281,7 @@ int GUIButton::NotifyTouch(TOUCH_STATE state, int x, int y) } else { if (last_state == 0) { last_state = 1; + DataManager::Vibrate("tw_button_vibrate"); if (mButtonLabel != NULL) mButtonLabel->isHighlighted = true; if (mButtonImg != NULL) diff --git a/gui/devices/1024x600/res/images/cursor.png b/gui/devices/1024x600/res/images/cursor.png Binary files differnew file mode 100644 index 000000000..32c8ae1ca --- /dev/null +++ b/gui/devices/1024x600/res/images/cursor.png diff --git a/gui/devices/1024x600/res/ui.xml b/gui/devices/1024x600/res/ui.xml index 569a5bd1f..4597fb3a3 100755 --- a/gui/devices/1024x600/res/ui.xml +++ b/gui/devices/1024x600/res/ui.xml @@ -38,6 +38,7 @@ <resource name="keyboard2" type="image" filename="keyboard2" /> <resource name="keyboard3" type="image" filename="keyboard3" /> <resource name="keyboard4" type="image" filename="keyboard4" /> + <resource name="cursor" type="image" filename="cursor" /> </resources> <variables> @@ -205,6 +206,12 @@ <variable name="slidervalue_sliderh" value="50" /> </variables> + <mousecursor> + <placement w="15" h="15" /> + <background color="#FFFF00FF" resource="cursor" /> + <speed multiplier="2" /> + </mousecursor> + <templates> <template name="header"> <background color="#000000FF" /> @@ -2430,20 +2437,29 @@ <object type="button"> <highlight color="%highlight_color%" /> - <placement x="%col4_x%" y="%row2_y%" /> + <placement x="%col2_x%" y="%row2_y%" /> <font resource="font" color="%button_text_color%" /> - <text>Screen</text> + <text>Restore Defaults</text> <image resource="main_button" /> - <action function="page">screen</action> + <action function="restoredefaultsettings"></action> </object> <object type="button"> <highlight color="%highlight_color%" /> - <placement x="%col_center_x%" y="%slider_y%" /> + <placement x="%col3_x%" y="%row2_y%" /> <font resource="font" color="%button_text_color%" /> - <text>Restore Defaults</text> + <text>Vibration Duration</text> <image resource="main_button" /> - <action function="restoredefaultsettings"></action> + <action function="page">Vibrate</action> + </object> + + <object type="button"> + <highlight color="%highlight_color%" /> + <placement x="%col4_x%" y="%row2_y%" /> + <font resource="font" color="%button_text_color%" /> + <text>Screen</text> + <image resource="main_button" /> + <action function="page">screen</action> </object> <object type="action"> @@ -2652,6 +2668,52 @@ <object type="template" name="footer" /> </page> + <page name="Vibrate"> + <object type="template" name="header" /> + + <object type="text" color="%text_color%"> + <font resource="font" /> + <placement x="%center_x%" y="%row1_text_y%" placement="5" /> + <text>Vibration Settings :</text> + </object> + + <object type="slidervalue"> + <placement x="slidervalue_x" y="%row3_text_y%" w="%slidervalue_w%" /> + <font resource="font" color="%text_color%" /> + <text>Button Vibration:</text> + <data variable="tw_button_vibrate" min="0" max="300" /> + <colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" /> + </object> + + <object type="slidervalue"> + <placement x="slidervalue_x" y="%row7_text_y%" w="%slidervalue_w%" /> + <font resource="font" color="%text_color%" /> + <text>Keyboard Vibration:</text> + <data variable="tw_keyboard_vibrate" min="0" max="300" /> + <colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" /> + </object> + + <object type="slidervalue"> + <placement x="slidervalue_x" y="%row11_text_y%" w="%slidervalue_w%" /> + <font resource="font" color="%text_color%" /> + <text>Action Vibration:</text> + <data variable="tw_action_vibrate" min="0" max="500" /> + <colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" /> + </object> + + <object type="action"> + <touch key="home" /> + <action function="page">main</action> + </object> + + <object type="action"> + <touch key="back" /> + <action function="page">settings</action> + </object> + + <object type="template" name="footer" /> + </page> + <page name="advanced"> <object type="template" name="header" /> diff --git a/gui/devices/1024x768/res/images/cursor.png b/gui/devices/1024x768/res/images/cursor.png Binary files differnew file mode 100644 index 000000000..32c8ae1ca --- /dev/null +++ b/gui/devices/1024x768/res/images/cursor.png diff --git a/gui/devices/1024x768/res/ui.xml b/gui/devices/1024x768/res/ui.xml index 6f8797a74..84f470298 100644 --- a/gui/devices/1024x768/res/ui.xml +++ b/gui/devices/1024x768/res/ui.xml @@ -38,6 +38,7 @@ <resource name="keyboard2" type="image" filename="keyboard2" /> <resource name="keyboard3" type="image" filename="keyboard3" /> <resource name="keyboard4" type="image" filename="keyboard4" /> + <resource name="cursor" type="image" filename="cursor" /> </resources> <variables> @@ -205,6 +206,12 @@ <variable name="slidervalue_sliderh" value="50" /> </variables> + <mousecursor> + <placement w="15" h="15" /> + <background color="#FFFF00FF" resource="cursor" /> + <speed multiplier="2" /> + </mousecursor> + <templates> <template name="header"> <background color="#000000FF" /> @@ -2430,20 +2437,29 @@ <object type="button"> <highlight color="%highlight_color%" /> - <placement x="%col4_x%" y="%row2_y%" /> + <placement x="%col2_x%" y="%row2_y%" /> <font resource="font" color="%button_text_color%" /> - <text>Screen</text> + <text>Restore Defaults</text> <image resource="main_button" /> - <action function="page">screen</action> + <action function="restoredefaultsettings"></action> </object> <object type="button"> <highlight color="%highlight_color%" /> - <placement x="%col_center_x%" y="%slider_y%" /> + <placement x="%col3_x%" y="%row2_y%" /> <font resource="font" color="%button_text_color%" /> - <text>Restore Defaults</text> + <text>Vibration Duration</text> <image resource="main_button" /> - <action function="restoredefaultsettings"></action> + <action function="page">Vibrate</action> + </object> + + <object type="button"> + <highlight color="%highlight_color%" /> + <placement x="%col4_x%" y="%row2_y%" /> + <font resource="font" color="%button_text_color%" /> + <text>Screen</text> + <image resource="main_button" /> + <action function="page">screen</action> </object> <object type="action"> @@ -2652,6 +2668,52 @@ <object type="template" name="footer" /> </page> + <page name="Vibrate"> + <object type="template" name="header" /> + + <object type="text" color="%text_color%"> + <font resource="font" /> + <placement x="%center_x%" y="%row1_text_y%" placement="5" /> + <text>Vibration Settings :</text> + </object> + + <object type="slidervalue"> + <placement x="slidervalue_x" y="%row3_text_y%" w="%slidervalue_w%" /> + <font resource="font" color="%text_color%" /> + <text>Button Vibration:</text> + <data variable="tw_button_vibrate" min="0" max="300" /> + <colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" /> + </object> + + <object type="slidervalue"> + <placement x="slidervalue_x" y="%row7_text_y%" w="%slidervalue_w%" /> + <font resource="font" color="%text_color%" /> + <text>Keyboard Vibration:</text> + <data variable="tw_keyboard_vibrate" min="0" max="300" /> + <colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" /> + </object> + + <object type="slidervalue"> + <placement x="slidervalue_x" y="%row11_text_y%" w="%slidervalue_w%" /> + <font resource="font" color="%text_color%" /> + <text>Action Vibration:</text> + <data variable="tw_action_vibrate" min="0" max="500" /> + <colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" /> + </object> + + <object type="action"> + <touch key="home" /> + <action function="page">main</action> + </object> + + <object type="action"> + <touch key="back" /> + <action function="page">settings</action> + </object> + + <object type="template" name="footer" /> + </page> + <page name="advanced"> <object type="template" name="header" /> diff --git a/gui/devices/1080x1920/res/images/cursor.png b/gui/devices/1080x1920/res/images/cursor.png Binary files differnew file mode 100644 index 000000000..32c8ae1ca --- /dev/null +++ b/gui/devices/1080x1920/res/images/cursor.png diff --git a/gui/devices/1080x1920/res/ui.xml b/gui/devices/1080x1920/res/ui.xml index beaf37325..3ab69a6ed 100644 --- a/gui/devices/1080x1920/res/ui.xml +++ b/gui/devices/1080x1920/res/ui.xml @@ -39,6 +39,7 @@ <resource name="keyboard2" type="image" filename="keyboard2" /> <resource name="keyboard3" type="image" filename="keyboard3" /> <resource name="keyboard4" type="image" filename="keyboard4" /> + <resource name="cursor" type="image" filename="cursor" /> </resources> <variables> @@ -191,6 +192,12 @@ <variable name="slidervalue_sliderh" value="90" /> </variables> + <mousecursor> + <placement w="15" h="15" /> + <background color="#FFFF00FF" resource="cursor" /> + <speed multiplier="2.5" /> + </mousecursor> + <templates> <template name="header"> <background color="#000000FF" /> @@ -2456,7 +2463,16 @@ </object> <object type="button"> - <placement x="%col_center_x%" y="%row4_y%" /> + <highlight color="%highlight_color%" /> + <placement x="%col2_x%" y="%row4_y%" /> + <font resource="font" color="%button_text_color%" /> + <text>Vibration Duration</text> + <image resource="main_button" /> + <action function="page">Vibrate</action> + </object> + + <object type="button"> + <placement x="%col_x%" y="%row4_y%" /> <font resource="font" color="%button_text_color%" /> <text>Restore Defaults</text> <image resource="main_button" /> @@ -2663,6 +2679,52 @@ <object type="template" name="footer" /> </page> + <page name="Vibrate"> + <object type="template" name="header" /> + + <object type="text" color="%text_color%"> + <font resource="font" /> + <placement x="%center_x%" y="%row1_header_y%" placement="5" /> + <text>Vibration Settings :</text> + </object> + + <object type="slidervalue"> + <placement x="col1_x" y="%row4_text_y%" w="%slidervalue_w%" /> + <font resource="font" color="%text_color%" /> + <text>Button Vibration:</text> + <data variable="tw_button_vibrate" min="0" max="300" /> + <colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" /> + </object> + + <object type="slidervalue"> + <placement x="col1_x" y="%row8_text_y%" w="%slidervalue_w%" /> + <font resource="font" color="%text_color%" /> + <text>Keyboard Vibration:</text> + <data variable="tw_keyboard_vibrate" min="0" max="300" /> + <colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" /> + </object> + + <object type="slidervalue"> + <placement x="col1_x" y="%row12_text_y%" w="%slidervalue_w%" /> + <font resource="font" color="%text_color%" /> + <text>Action Vibration:</text> + <data variable="tw_action_vibrate" min="0" max="500" /> + <colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" /> + </object> + + <object type="action"> + <touch key="home" /> + <action function="page">main</action> + </object> + + <object type="action"> + <touch key="back" /> + <action function="page">settings</action> + </object> + + <object type="template" name="footer" /> + </page> + <page name="advanced"> <object type="template" name="header" /> diff --git a/gui/devices/1200x1920/res/images/cursor.png b/gui/devices/1200x1920/res/images/cursor.png Binary files differnew file mode 100644 index 000000000..32c8ae1ca --- /dev/null +++ b/gui/devices/1200x1920/res/images/cursor.png diff --git a/gui/devices/1200x1920/res/ui.xml b/gui/devices/1200x1920/res/ui.xml index a83c30bb7..5aedca8b1 100644 --- a/gui/devices/1200x1920/res/ui.xml +++ b/gui/devices/1200x1920/res/ui.xml @@ -39,6 +39,7 @@ <resource name="keyboard2" type="image" filename="keyboard2" /> <resource name="keyboard3" type="image" filename="keyboard3" /> <resource name="keyboard4" type="image" filename="keyboard4" /> + <resource name="cursor" type="image" filename="cursor" /> </resources> <variables> @@ -194,6 +195,12 @@ <variable name="slidervalue_sliderh" value="90" /> </variables> + <mousecursor> + <placement w="15" h="15" /> + <background color="#FFFF00FF" resource="cursor" /> + <speed multiplier="2.5" /> + </mousecursor> + <templates> <template name="header"> <background color="#000000FF" /> @@ -2459,7 +2466,16 @@ </object> <object type="button"> - <placement x="%col_center_x%" y="%row4_y%" /> + <highlight color="%highlight_color%" /> + <placement x="%col2_x%" y="%row4_y%" /> + <font resource="font" color="%button_text_color%" /> + <text>Vibration Duration</text> + <image resource="main_button" /> + <action function="page">Vibrate</action> + </object> + + <object type="button"> + <placement x="%col_x%" y="%row4_y%" /> <font resource="font" color="%button_text_color%" /> <text>Restore Defaults</text> <image resource="main_button" /> @@ -2666,6 +2682,52 @@ <object type="template" name="footer" /> </page> + <page name="Vibrate"> + <object type="template" name="header" /> + + <object type="text" color="%text_color%"> + <font resource="font" /> + <placement x="%center_x%" y="%row1_header_y%" placement="5" /> + <text>Vibration Settings :</text> + </object> + + <object type="slidervalue"> + <placement x="col1_x" y="%row4_text_y%" w="%slidervalue_w%" /> + <font resource="font" color="%text_color%" /> + <text>Button Vibration:</text> + <data variable="tw_button_vibrate" min="0" max="300" /> + <colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" /> + </object> + + <object type="slidervalue"> + <placement x="col1_x" y="%row8_text_y%" w="%slidervalue_w%" /> + <font resource="font" color="%text_color%" /> + <text>Keyboard Vibration:</text> + <data variable="tw_keyboard_vibrate" min="0" max="300" /> + <colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" /> + </object> + + <object type="slidervalue"> + <placement x="col1_x" y="%row12_text_y%" w="%slidervalue_w%" /> + <font resource="font" color="%text_color%" /> + <text>Action Vibration:</text> + <data variable="tw_action_vibrate" min="0" max="500" /> + <colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" /> + </object> + + <object type="action"> + <touch key="home" /> + <action function="page">main</action> + </object> + + <object type="action"> + <touch key="back" /> + <action function="page">settings</action> + </object> + + <object type="template" name="footer" /> + </page> + <page name="advanced"> <object type="template" name="header" /> diff --git a/gui/devices/1280x800/res/images/cursor.png b/gui/devices/1280x800/res/images/cursor.png Binary files differnew file mode 100644 index 000000000..32c8ae1ca --- /dev/null +++ b/gui/devices/1280x800/res/images/cursor.png diff --git a/gui/devices/1280x800/res/ui.xml b/gui/devices/1280x800/res/ui.xml index 115a391eb..c7d914893 100644 --- a/gui/devices/1280x800/res/ui.xml +++ b/gui/devices/1280x800/res/ui.xml @@ -38,6 +38,7 @@ <resource name="keyboard2" type="image" filename="keyboard2" /> <resource name="keyboard3" type="image" filename="keyboard3" /> <resource name="keyboard4" type="image" filename="keyboard4" /> + <resource name="cursor" type="image" filename="cursor" /> </resources> <variables> @@ -205,6 +206,12 @@ <variable name="slidervalue_sliderh" value="60" /> </variables> + <mousecursor> + <placement w="15" h="15" /> + <background color="#FFFF00FF" resource="cursor" /> + <speed multiplier="2" /> + </mousecursor> + <templates> <template name="header"> <background color="#000000FF" /> @@ -2430,20 +2437,29 @@ <object type="button"> <highlight color="%highlight_color%" /> - <placement x="%col4_x%" y="%row2_y%" /> + <placement x="%col2_x%" y="%row2_y%" /> <font resource="font" color="%button_text_color%" /> - <text>Screen</text> + <text>Restore Defaults</text> <image resource="main_button" /> - <action function="page">screen</action> + <action function="restoredefaultsettings"></action> </object> <object type="button"> <highlight color="%highlight_color%" /> - <placement x="%col_center_x%" y="%slider_y%" /> + <placement x="%col3_x%" y="%row2_y%" /> <font resource="font" color="%button_text_color%" /> - <text>Restore Defaults</text> + <text>Vibration Duration</text> <image resource="main_button" /> - <action function="restoredefaultsettings"></action> + <action function="page">Vibrate</action> + </object> + + <object type="button"> + <highlight color="%highlight_color%" /> + <placement x="%col4_x%" y="%row2_y%" /> + <font resource="font" color="%button_text_color%" /> + <text>Screen</text> + <image resource="main_button" /> + <action function="page">screen</action> </object> <object type="action"> @@ -2652,6 +2668,52 @@ <object type="template" name="footer" /> </page> + <page name="Vibrate"> + <object type="template" name="header" /> + + <object type="text" color="%text_color%"> + <font resource="font" /> + <placement x="%center_x%" y="%row1_text_y%" placement="5" /> + <text>Vibration Settings :</text> + </object> + + <object type="slidervalue"> + <placement x="slidervalue_x" y="%row3_text_y%" w="%slidervalue_w%" /> + <font resource="font" color="%text_color%" /> + <text>Button Vibration:</text> + <data variable="tw_button_vibrate" min="0" max="300" /> + <colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" /> + </object> + + <object type="slidervalue"> + <placement x="slidervalue_x" y="%row7_text_y%" w="%slidervalue_w%" /> + <font resource="font" color="%text_color%" /> + <text>Keyboard Vibration:</text> + <data variable="tw_keyboard_vibrate" min="0" max="300" /> + <colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" /> + </object> + + <object type="slidervalue"> + <placement x="slidervalue_x" y="%row11_text_y%" w="%slidervalue_w%" /> + <font resource="font" color="%text_color%" /> + <text>Action Vibration:</text> + <data variable="tw_action_vibrate" min="0" max="500" /> + <colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" /> + </object> + + <object type="action"> + <touch key="home" /> + <action function="page">main</action> + </object> + + <object type="action"> + <touch key="back" /> + <action function="page">settings</action> + </object> + + <object type="template" name="footer" /> + </page> + <page name="advanced"> <object type="template" name="header" /> diff --git a/gui/devices/1920x1200/res/images/cursor.png b/gui/devices/1920x1200/res/images/cursor.png Binary files differnew file mode 100644 index 000000000..32c8ae1ca --- /dev/null +++ b/gui/devices/1920x1200/res/images/cursor.png diff --git a/gui/devices/1920x1200/res/ui.xml b/gui/devices/1920x1200/res/ui.xml index fb615c135..dbd6a0b2d 100644 --- a/gui/devices/1920x1200/res/ui.xml +++ b/gui/devices/1920x1200/res/ui.xml @@ -38,6 +38,7 @@ <resource name="keyboard2" type="image" filename="keyboard2" /> <resource name="keyboard3" type="image" filename="keyboard3" /> <resource name="keyboard4" type="image" filename="keyboard4" /> + <resource name="cursor" type="image" filename="cursor" /> </resources> <variables> @@ -205,6 +206,12 @@ <variable name="slidervalue_sliderh" value="80" /> </variables> + <mousecursor> + <placement w="15" h="15" /> + <background color="#FFFF00FF" resource="cursor" /> + <speed multiplier="2.5" /> + </mousecursor> + <templates> <template name="header"> <background color="#000000FF" /> @@ -2430,20 +2437,29 @@ <object type="button"> <highlight color="%highlight_color%" /> - <placement x="%col4_x%" y="%row2_y%" /> + <placement x="%col2_x%" y="%row2_y%" /> <font resource="font" color="%button_text_color%" /> - <text>Screen</text> + <text>Restore Defaults</text> <image resource="main_button" /> - <action function="page">screen</action> + <action function="restoredefaultsettings"></action> </object> <object type="button"> <highlight color="%highlight_color%" /> - <placement x="%col_center_x%" y="%slider_y%" /> + <placement x="%col3_x%" y="%row2_y%" /> <font resource="font" color="%button_text_color%" /> - <text>Restore Defaults</text> + <text>Vibration Duration</text> <image resource="main_button" /> - <action function="restoredefaultsettings"></action> + <action function="page">Vibrate</action> + </object> + + <object type="button"> + <highlight color="%highlight_color%" /> + <placement x="%col4_x%" y="%row2_y%" /> + <font resource="font" color="%button_text_color%" /> + <text>Screen</text> + <image resource="main_button" /> + <action function="page">screen</action> </object> <object type="action"> @@ -2652,6 +2668,52 @@ <object type="template" name="footer" /> </page> + <page name="Vibrate"> + <object type="template" name="header" /> + + <object type="text" color="%text_color%"> + <font resource="font" /> + <placement x="%center_x%" y="%row1_text_y%" placement="5" /> + <text>Vibration Settings :</text> + </object> + + <object type="slidervalue"> + <placement x="slidervalue_x" y="%row3_text_y%" w="%slidervalue_w%" /> + <font resource="font" color="%text_color%" /> + <text>Button Vibration:</text> + <data variable="tw_button_vibrate" min="0" max="300" /> + <colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" /> + </object> + + <object type="slidervalue"> + <placement x="slidervalue_x" y="%row7_text_y%" w="%slidervalue_w%" /> + <font resource="font" color="%text_color%" /> + <text>Keyboard Vibration:</text> + <data variable="tw_keyboard_vibrate" min="0" max="300" /> + <colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" /> + </object> + + <object type="slidervalue"> + <placement x="slidervalue_x" y="%row11_text_y%" w="%slidervalue_w%" /> + <font resource="font" color="%text_color%" /> + <text>Action Vibration:</text> + <data variable="tw_action_vibrate" min="0" max="500" /> + <colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" /> + </object> + + <object type="action"> + <touch key="home" /> + <action function="page">main</action> + </object> + + <object type="action"> + <touch key="back" /> + <action function="page">settings</action> + </object> + + <object type="template" name="footer" /> + </page> + <page name="advanced"> <object type="template" name="header" /> diff --git a/gui/devices/2560x1600/res/images/cursor.png b/gui/devices/2560x1600/res/images/cursor.png Binary files differnew file mode 100644 index 000000000..32c8ae1ca --- /dev/null +++ b/gui/devices/2560x1600/res/images/cursor.png diff --git a/gui/devices/2560x1600/res/ui.xml b/gui/devices/2560x1600/res/ui.xml index 9ce330a44..0a501afc0 100644 --- a/gui/devices/2560x1600/res/ui.xml +++ b/gui/devices/2560x1600/res/ui.xml @@ -38,6 +38,7 @@ <resource name="keyboard2" type="image" filename="keyboard2" /> <resource name="keyboard3" type="image" filename="keyboard3" /> <resource name="keyboard4" type="image" filename="keyboard4" /> + <resource name="cursor" type="image" filename="cursor" /> </resources> <variables> @@ -205,6 +206,12 @@ <variable name="slidervalue_sliderh" value="90" /> </variables> + <mousecursor> + <placement w="15" h="15" /> + <background color="#FFFF00FF" resource="cursor" /> + <speed multiplier="2.5" /> + </mousecursor> + <templates> <template name="header"> <background color="#000000FF" /> @@ -2430,20 +2437,29 @@ <object type="button"> <highlight color="%highlight_color%" /> - <placement x="%col4_x%" y="%row2_y%" /> + <placement x="%col2_x%" y="%row2_y%" /> <font resource="font" color="%button_text_color%" /> - <text>Screen</text> + <text>Restore Defaults</text> <image resource="main_button" /> - <action function="page">screen</action> + <action function="restoredefaultsettings"></action> </object> <object type="button"> <highlight color="%highlight_color%" /> - <placement x="%col_center_x%" y="%slider_y%" /> + <placement x="%col3_x%" y="%row2_y%" /> <font resource="font" color="%button_text_color%" /> - <text>Restore Defaults</text> + <text>Vibration Duration</text> <image resource="main_button" /> - <action function="restoredefaultsettings"></action> + <action function="page">Vibrate</action> + </object> + + <object type="button"> + <highlight color="%highlight_color%" /> + <placement x="%col4_x%" y="%row2_y%" /> + <font resource="font" color="%button_text_color%" /> + <text>Screen</text> + <image resource="main_button" /> + <action function="page">screen</action> </object> <object type="action"> @@ -2652,6 +2668,52 @@ <object type="template" name="footer" /> </page> + <page name="Vibrate"> + <object type="template" name="header" /> + + <object type="text" color="%text_color%"> + <font resource="font" /> + <placement x="%center_x%" y="%row1_text_y%" placement="5" /> + <text>Vibration Settings :</text> + </object> + + <object type="slidervalue"> + <placement x="slidervalue_x" y="%row3_text_y%" w="%slidervalue_w%" /> + <font resource="font" color="%text_color%" /> + <text>Button Vibration:</text> + <data variable="tw_button_vibrate" min="0" max="300" /> + <colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" /> + </object> + + <object type="slidervalue"> + <placement x="slidervalue_x" y="%row7_text_y%" w="%slidervalue_w%" /> + <font resource="font" color="%text_color%" /> + <text>Keyboard Vibration:</text> + <data variable="tw_keyboard_vibrate" min="0" max="300" /> + <colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" /> + </object> + + <object type="slidervalue"> + <placement x="slidervalue_x" y="%row11_text_y%" w="%slidervalue_w%" /> + <font resource="font" color="%text_color%" /> + <text>Action Vibration:</text> + <data variable="tw_action_vibrate" min="0" max="500" /> + <colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" /> + </object> + + <object type="action"> + <touch key="home" /> + <action function="page">main</action> + </object> + + <object type="action"> + <touch key="back" /> + <action function="page">settings</action> + </object> + + <object type="template" name="footer" /> + </page> + <page name="advanced"> <object type="template" name="header" /> diff --git a/gui/devices/320x480/res/images/cursor.png b/gui/devices/320x480/res/images/cursor.png Binary files differnew file mode 100644 index 000000000..32c8ae1ca --- /dev/null +++ b/gui/devices/320x480/res/images/cursor.png diff --git a/gui/devices/320x480/res/ui.xml b/gui/devices/320x480/res/ui.xml index dbee885a7..3c3b73d26 100644 --- a/gui/devices/320x480/res/ui.xml +++ b/gui/devices/320x480/res/ui.xml @@ -39,6 +39,7 @@ <resource name="keyboard2" type="image" filename="keyboard2" /> <resource name="keyboard3" type="image" filename="keyboard3" /> <resource name="keyboard4" type="image" filename="keyboard4" /> + <resource name="cursor" type="image" filename="cursor" /> </resources> <variables> @@ -186,6 +187,12 @@ <variable name="slidervalue_sliderh" value="20" /> </variables> + <mousecursor> + <placement w="15" h="15" /> + <background color="#FFFF00FF" resource="cursor" /> + <speed multiplier="1" /> + </mousecursor> + <templates> <template name="header"> <background color="#000000FF" /> @@ -2443,7 +2450,16 @@ </object> <object type="button"> - <placement x="%col_center_x%" y="%row4_y%" /> + <highlight color="%highlight_color%" /> + <placement x="%col2_x%" y="%row4_y%" /> + <font resource="font" color="%button_text_color%" /> + <text>Vibration Duration</text> + <image resource="main_button" /> + <action function="page">Vibrate</action> + </object> + + <object type="button"> + <placement x="%col_x%" y="%row4_y%" /> <font resource="font" color="%button_text_color%" /> <text>Restore Defaults</text> <image resource="main_button" /> @@ -2650,6 +2666,52 @@ <object type="template" name="footer" /> </page> + <page name="Vibrate"> + <object type="template" name="header" /> + + <object type="text" color="%text_color%"> + <font resource="font" /> + <placement x="%center_x%" y="%row1_header_y%" placement="5" /> + <text>Vibration Settings :</text> + </object> + + <object type="slidervalue"> + <placement x="col1_x" y="%row4_text_y%" w="%slidervalue_w%" /> + <font resource="font" color="%text_color%" /> + <text>Button Vibration:</text> + <data variable="tw_button_vibrate" min="0" max="300" /> + <colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" /> + </object> + + <object type="slidervalue"> + <placement x="col1_x" y="%row8_text_y%" w="%slidervalue_w%" /> + <font resource="font" color="%text_color%" /> + <text>Keyboard Vibration:</text> + <data variable="tw_keyboard_vibrate" min="0" max="300" /> + <colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" /> + </object> + + <object type="slidervalue"> + <placement x="col1_x" y="%row12_text_y%" w="%slidervalue_w%" /> + <font resource="font" color="%text_color%" /> + <text>Action Vibration:</text> + <data variable="tw_action_vibrate" min="0" max="500" /> + <colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" /> + </object> + + <object type="action"> + <touch key="home" /> + <action function="page">main</action> + </object> + + <object type="action"> + <touch key="back" /> + <action function="page">settings</action> + </object> + + <object type="template" name="footer" /> + </page> + <page name="advanced"> <object type="template" name="header" /> diff --git a/gui/devices/480x800/res/images/cursor.png b/gui/devices/480x800/res/images/cursor.png Binary files differnew file mode 100644 index 000000000..32c8ae1ca --- /dev/null +++ b/gui/devices/480x800/res/images/cursor.png diff --git a/gui/devices/480x800/res/ui.xml b/gui/devices/480x800/res/ui.xml index bb90e70b4..32c90d936 100644 --- a/gui/devices/480x800/res/ui.xml +++ b/gui/devices/480x800/res/ui.xml @@ -39,6 +39,7 @@ <resource name="keyboard2" type="image" filename="keyboard2" /> <resource name="keyboard3" type="image" filename="keyboard3" /> <resource name="keyboard4" type="image" filename="keyboard4" /> + <resource name="cursor" type="image" filename="cursor" /> </resources> <variables> @@ -186,6 +187,12 @@ <variable name="slidervalue_sliderh" value="40" /> </variables> + <mousecursor> + <placement w="15" h="15" /> + <background color="#FFFF00FF" resource="cursor" /> + <speed multiplier="1.5" /> + </mousecursor> + <templates> <template name="header"> <background color="%backgroundcolor%" /> @@ -2443,7 +2450,16 @@ </object> <object type="button"> - <placement x="%col_center_x%" y="%row4_y%" /> + <highlight color="%highlight_color%" /> + <placement x="%col2_x%" y="%row4_y%" /> + <font resource="font" color="%button_text_color%" /> + <text>Vibration Duration</text> + <image resource="main_button" /> + <action function="page">Vibrate</action> + </object> + + <object type="button"> + <placement x="%col_x%" y="%row4_y%" /> <font resource="font" color="%button_text_color%" /> <text>Restore Defaults</text> <image resource="main_button" /> @@ -2650,6 +2666,52 @@ <object type="template" name="footer" /> </page> + <page name="Vibrate"> + <object type="template" name="header" /> + + <object type="text" color="%text_color%"> + <font resource="font" /> + <placement x="%center_x%" y="%row1_header_y%" placement="5" /> + <text>Vibration Settings :</text> + </object> + + <object type="slidervalue"> + <placement x="col1_x" y="%row4_text_y%" w="%slidervalue_w%" /> + <font resource="font" color="%text_color%" /> + <text>Button Vibration:</text> + <data variable="tw_button_vibrate" min="0" max="300" /> + <colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" /> + </object> + + <object type="slidervalue"> + <placement x="col1_x" y="%row8_text_y%" w="%slidervalue_w%" /> + <font resource="font" color="%text_color%" /> + <text>Keyboard Vibration:</text> + <data variable="tw_keyboard_vibrate" min="0" max="300" /> + <colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" /> + </object> + + <object type="slidervalue"> + <placement x="col1_x" y="%row12_text_y%" w="%slidervalue_w%" /> + <font resource="font" color="%text_color%" /> + <text>Action Vibration:</text> + <data variable="tw_action_vibrate" min="0" max="500" /> + <colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" /> + </object> + + <object type="action"> + <touch key="home" /> + <action function="page">main</action> + </object> + + <object type="action"> + <touch key="back" /> + <action function="page">settings</action> + </object> + + <object type="template" name="footer" /> + </page> + <page name="advanced"> <object type="template" name="header" /> diff --git a/gui/devices/480x854/res/images/cursor.png b/gui/devices/480x854/res/images/cursor.png Binary files differnew file mode 100644 index 000000000..32c8ae1ca --- /dev/null +++ b/gui/devices/480x854/res/images/cursor.png diff --git a/gui/devices/480x854/res/ui.xml b/gui/devices/480x854/res/ui.xml index 08c3ddcfe..a8357703c 100644 --- a/gui/devices/480x854/res/ui.xml +++ b/gui/devices/480x854/res/ui.xml @@ -39,6 +39,7 @@ <resource name="keyboard2" type="image" filename="keyboard2" /> <resource name="keyboard3" type="image" filename="keyboard3" /> <resource name="keyboard4" type="image" filename="keyboard4" /> + <resource name="cursor" type="image" filename="cursor" /> </resources> <variables> @@ -185,6 +186,12 @@ <variable name="slidervalue_sliderh" value="40" /> </variables> + <mousecursor> + <placement w="15" h="15" /> + <background color="#FFFF00FF" resource="cursor" /> + <speed multiplier="1.5" /> + </mousecursor> + <templates> <template name="header"> <background color="%backgroundcolor%" /> @@ -2442,7 +2449,16 @@ </object> <object type="button"> - <placement x="%col_center_x%" y="%row4_y%" /> + <highlight color="%highlight_color%" /> + <placement x="%col2_x%" y="%row4_y%" /> + <font resource="font" color="%button_text_color%" /> + <text>Vibration Duration</text> + <image resource="main_button" /> + <action function="page">Vibrate</action> + </object> + + <object type="button"> + <placement x="%col_x%" y="%row4_y%" /> <font resource="font" color="%button_text_color%" /> <text>Restore Defaults</text> <image resource="main_button" /> @@ -2649,6 +2665,52 @@ <object type="template" name="footer" /> </page> + <page name="Vibrate"> + <object type="template" name="header" /> + + <object type="text" color="%text_color%"> + <font resource="font" /> + <placement x="%center_x%" y="%row1_header_y%" placement="5" /> + <text>Vibration Settings :</text> + </object> + + <object type="slidervalue"> + <placement x="col1_x" y="%row4_text_y%" w="%slidervalue_w%" /> + <font resource="font" color="%text_color%" /> + <text>Button Vibration:</text> + <data variable="tw_button_vibrate" min="0" max="300" /> + <colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" /> + </object> + + <object type="slidervalue"> + <placement x="col1_x" y="%row8_text_y%" w="%slidervalue_w%" /> + <font resource="font" color="%text_color%" /> + <text>Keyboard Vibration:</text> + <data variable="tw_keyboard_vibrate" min="0" max="300" /> + <colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" /> + </object> + + <object type="slidervalue"> + <placement x="col1_x" y="%row12_text_y%" w="%slidervalue_w%" /> + <font resource="font" color="%text_color%" /> + <text>Action Vibration:</text> + <data variable="tw_action_vibrate" min="0" max="500" /> + <colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" /> + </object> + + <object type="action"> + <touch key="home" /> + <action function="page">main</action> + </object> + + <object type="action"> + <touch key="back" /> + <action function="page">settings</action> + </object> + + <object type="template" name="footer" /> + </page> + <page name="advanced"> <object type="template" name="header" /> diff --git a/gui/devices/540x960/res/images/cursor.png b/gui/devices/540x960/res/images/cursor.png Binary files differnew file mode 100644 index 000000000..32c8ae1ca --- /dev/null +++ b/gui/devices/540x960/res/images/cursor.png diff --git a/gui/devices/540x960/res/ui.xml b/gui/devices/540x960/res/ui.xml index e03704eef..0a43bebc2 100644 --- a/gui/devices/540x960/res/ui.xml +++ b/gui/devices/540x960/res/ui.xml @@ -39,6 +39,7 @@ <resource name="keyboard2" type="image" filename="keyboard2" /> <resource name="keyboard3" type="image" filename="keyboard3" /> <resource name="keyboard4" type="image" filename="keyboard4" /> + <resource name="cursor" type="image" filename="cursor" /> </resources> <variables> @@ -186,6 +187,12 @@ <variable name="slidervalue_sliderh" value="45" /> </variables> + <mousecursor> + <placement w="15" h="15" /> + <background color="#FFFF00FF" resource="cursor" /> + <speed multiplier="1.5" /> + </mousecursor> + <templates> <template name="header"> <background color="#000000FF" /> @@ -2443,7 +2450,16 @@ </object> <object type="button"> - <placement x="%col_center_x%" y="%row4_y%" /> + <highlight color="%highlight_color%" /> + <placement x="%col2_x%" y="%row4_y%" /> + <font resource="font" color="%button_text_color%" /> + <text>Vibration Duration</text> + <image resource="main_button" /> + <action function="page">Vibrate</action> + </object> + + <object type="button"> + <placement x="%col_x%" y="%row4_y%" /> <font resource="font" color="%button_text_color%" /> <text>Restore Defaults</text> <image resource="main_button" /> @@ -2650,6 +2666,52 @@ <object type="template" name="footer" /> </page> + <page name="Vibrate"> + <object type="template" name="header" /> + + <object type="text" color="%text_color%"> + <font resource="font" /> + <placement x="%center_x%" y="%row1_header_y%" placement="5" /> + <text>Vibration Settings :</text> + </object> + + <object type="slidervalue"> + <placement x="col1_x" y="%row4_text_y%" w="%slidervalue_w%" /> + <font resource="font" color="%text_color%" /> + <text>Button Vibration:</text> + <data variable="tw_button_vibrate" min="0" max="300" /> + <colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" /> + </object> + + <object type="slidervalue"> + <placement x="col1_x" y="%row8_text_y%" w="%slidervalue_w%" /> + <font resource="font" color="%text_color%" /> + <text>Keyboard Vibration:</text> + <data variable="tw_keyboard_vibrate" min="0" max="300" /> + <colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" /> + </object> + + <object type="slidervalue"> + <placement x="col1_x" y="%row12_text_y%" w="%slidervalue_w%" /> + <font resource="font" color="%text_color%" /> + <text>Action Vibration:</text> + <data variable="tw_action_vibrate" min="0" max="500" /> + <colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" /> + </object> + + <object type="action"> + <touch key="home" /> + <action function="page">main</action> + </object> + + <object type="action"> + <touch key="back" /> + <action function="page">settings</action> + </object> + + <object type="template" name="footer" /> + </page> + <page name="advanced"> <object type="template" name="header" /> diff --git a/gui/devices/720x1280/res/images/cursor.png b/gui/devices/720x1280/res/images/cursor.png Binary files differnew file mode 100644 index 000000000..32c8ae1ca --- /dev/null +++ b/gui/devices/720x1280/res/images/cursor.png diff --git a/gui/devices/720x1280/res/ui.xml b/gui/devices/720x1280/res/ui.xml index c9a4c0a69..37003da45 100644 --- a/gui/devices/720x1280/res/ui.xml +++ b/gui/devices/720x1280/res/ui.xml @@ -39,6 +39,7 @@ <resource name="keyboard2" type="image" filename="keyboard2" /> <resource name="keyboard3" type="image" filename="keyboard3" /> <resource name="keyboard4" type="image" filename="keyboard4" /> + <resource name="cursor" type="image" filename="cursor" /> </resources> <variables> @@ -191,6 +192,12 @@ <variable name="slidervalue_sliderh" value="60" /> </variables> + <mousecursor> + <placement w="15" h="15" /> + <background color="#FFFF00FF" resource="cursor" /> + <speed multiplier="2" /> + </mousecursor> + <templates> <template name="header"> <background color="#000000FF" /> @@ -2456,7 +2463,16 @@ </object> <object type="button"> - <placement x="%col_center_x%" y="%row4_y%" /> + <highlight color="%highlight_color%" /> + <placement x="%col2_x%" y="%row4_y%" /> + <font resource="font" color="%button_text_color%" /> + <text>Vibration Duration</text> + <image resource="main_button" /> + <action function="page">Vibrate</action> + </object> + + <object type="button"> + <placement x="%col_x%" y="%row4_y%" /> <font resource="font" color="%button_text_color%" /> <text>Restore Defaults</text> <image resource="main_button" /> @@ -2663,6 +2679,52 @@ <object type="template" name="footer" /> </page> + <page name="Vibrate"> + <object type="template" name="header" /> + + <object type="text" color="%text_color%"> + <font resource="font" /> + <placement x="%center_x%" y="%row1_header_y%" placement="5" /> + <text>Vibration Settings :</text> + </object> + + <object type="slidervalue"> + <placement x="col1_x" y="%row4_text_y%" w="%slidervalue_w%" /> + <font resource="font" color="%text_color%" /> + <text>Button Vibration:</text> + <data variable="tw_button_vibrate" min="0" max="300" /> + <colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" /> + </object> + + <object type="slidervalue"> + <placement x="col1_x" y="%row8_text_y%" w="%slidervalue_w%" /> + <font resource="font" color="%text_color%" /> + <text>Keyboard Vibration:</text> + <data variable="tw_keyboard_vibrate" min="0" max="300" /> + <colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" /> + </object> + + <object type="slidervalue"> + <placement x="col1_x" y="%row12_text_y%" w="%slidervalue_w%" /> + <font resource="font" color="%text_color%" /> + <text>Action Vibration:</text> + <data variable="tw_action_vibrate" min="0" max="500" /> + <colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" /> + </object> + + <object type="action"> + <touch key="home" /> + <action function="page">main</action> + </object> + + <object type="action"> + <touch key="back" /> + <action function="page">settings</action> + </object> + + <object type="template" name="footer" /> + </page> + <page name="advanced"> <object type="template" name="header" /> diff --git a/gui/devices/800x1280/res/images/cursor.png b/gui/devices/800x1280/res/images/cursor.png Binary files differnew file mode 100644 index 000000000..32c8ae1ca --- /dev/null +++ b/gui/devices/800x1280/res/images/cursor.png diff --git a/gui/devices/800x1280/res/ui.xml b/gui/devices/800x1280/res/ui.xml index 9b7a06315..31006e6fa 100755 --- a/gui/devices/800x1280/res/ui.xml +++ b/gui/devices/800x1280/res/ui.xml @@ -39,6 +39,7 @@ <resource name="keyboard2" type="image" filename="keyboard2" /> <resource name="keyboard3" type="image" filename="keyboard3" /> <resource name="keyboard4" type="image" filename="keyboard4" /> + <resource name="cursor" type="image" filename="cursor" /> </resources> <variables> @@ -187,6 +188,12 @@ <variable name="slidervalue_sliderh" value="60" /> </variables> + <mousecursor> + <placement w="15" h="15" /> + <background color="#FFFF00FF" resource="cursor" /> + <speed multiplier="2.5" /> + </mousecursor> + <templates> <template name="header"> <background color="#000000FF" /> @@ -2444,7 +2451,16 @@ </object> <object type="button"> - <placement x="%col_center_x%" y="%row4_y%" /> + <highlight color="%highlight_color%" /> + <placement x="%col2_x%" y="%row4_y%" /> + <font resource="font" color="%button_text_color%" /> + <text>Vibration Duration</text> + <image resource="main_button" /> + <action function="page">Vibrate</action> + </object> + + <object type="button"> + <placement x="%col_x%" y="%row4_y%" /> <font resource="font" color="%button_text_color%" /> <text>Restore Defaults</text> <image resource="main_button" /> @@ -2651,6 +2667,52 @@ <object type="template" name="footer" /> </page> + <page name="Vibrate"> + <object type="template" name="header" /> + + <object type="text" color="%text_color%"> + <font resource="font" /> + <placement x="%center_x%" y="%row1_header_y%" placement="5" /> + <text>Vibration Settings :</text> + </object> + + <object type="slidervalue"> + <placement x="col1_x" y="%row4_text_y%" w="%slidervalue_w%" /> + <font resource="font" color="%text_color%" /> + <text>Button Vibration:</text> + <data variable="tw_button_vibrate" min="0" max="300" /> + <colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" /> + </object> + + <object type="slidervalue"> + <placement x="col1_x" y="%row8_text_y%" w="%slidervalue_w%" /> + <font resource="font" color="%text_color%" /> + <text>Keyboard Vibration:</text> + <data variable="tw_keyboard_vibrate" min="0" max="300" /> + <colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" /> + </object> + + <object type="slidervalue"> + <placement x="col1_x" y="%row12_text_y%" w="%slidervalue_w%" /> + <font resource="font" color="%text_color%" /> + <text>Action Vibration:</text> + <data variable="tw_action_vibrate" min="0" max="500" /> + <colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" /> + </object> + + <object type="action"> + <touch key="home" /> + <action function="page">main</action> + </object> + + <object type="action"> + <touch key="back" /> + <action function="page">settings</action> + </object> + + <object type="template" name="footer" /> + </page> + <page name="advanced"> <object type="template" name="header" /> diff --git a/gui/devices/800x480/res/images/cursor.png b/gui/devices/800x480/res/images/cursor.png Binary files differnew file mode 100644 index 000000000..32c8ae1ca --- /dev/null +++ b/gui/devices/800x480/res/images/cursor.png diff --git a/gui/devices/800x480/res/ui.xml b/gui/devices/800x480/res/ui.xml index 9c391b33e..8f881d779 100755 --- a/gui/devices/800x480/res/ui.xml +++ b/gui/devices/800x480/res/ui.xml @@ -38,6 +38,7 @@ <resource name="keyboard2" type="image" filename="keyboard2" /> <resource name="keyboard3" type="image" filename="keyboard3" /> <resource name="keyboard4" type="image" filename="keyboard4" /> + <resource name="cursor" type="image" filename="cursor" /> </resources> <variables> @@ -205,6 +206,12 @@ <variable name="slidervalue_sliderh" value="40" /> </variables> + <mousecursor> + <placement w="15" h="15" /> + <background color="#FFFF00FF" resource="cursor" /> + <speed multiplier="1.5" /> + </mousecursor> + <templates> <template name="header"> <background color="#000000FF" /> @@ -2438,20 +2445,29 @@ <object type="button"> <highlight color="%highlight_color%" /> - <placement x="%col4_x%" y="%row2_y%" /> + <placement x="%col2_x%" y="%row2_y%" /> <font resource="font" color="%button_text_color%" /> - <text>Screen</text> + <text>Restore Defaults</text> <image resource="main_button" /> - <action function="page">screen</action> + <action function="restoredefaultsettings"></action> </object> <object type="button"> <highlight color="%highlight_color%" /> - <placement x="%col_center_x%" y="%slider_y%" /> + <placement x="%col3_x%" y="%row2_y%" /> <font resource="font" color="%button_text_color%" /> - <text>Restore Defaults</text> + <text>Vibration Duration</text> <image resource="main_button" /> - <action function="restoredefaultsettings"></action> + <action function="page">Vibrate</action> + </object> + + <object type="button"> + <highlight color="%highlight_color%" /> + <placement x="%col4_x%" y="%row2_y%" /> + <font resource="font" color="%button_text_color%" /> + <text>Screen</text> + <image resource="main_button" /> + <action function="page">screen</action> </object> <object type="action"> @@ -2660,6 +2676,52 @@ <object type="template" name="footer" /> </page> + <page name="Vibrate"> + <object type="template" name="header" /> + + <object type="text" color="%text_color%"> + <font resource="font" /> + <placement x="%center_x%" y="%row1_text_y%" placement="5" /> + <text>Vibration Settings :</text> + </object> + + <object type="slidervalue"> + <placement x="slidervalue_x" y="%row3_text_y%" w="%slidervalue_w%" /> + <font resource="font" color="%text_color%" /> + <text>Button Vibration:</text> + <data variable="tw_button_vibrate" min="0" max="300" /> + <colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" /> + </object> + + <object type="slidervalue"> + <placement x="slidervalue_x" y="%row7_text_y%" w="%slidervalue_w%" /> + <font resource="font" color="%text_color%" /> + <text>Keyboard Vibration:</text> + <data variable="tw_keyboard_vibrate" min="0" max="300" /> + <colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" /> + </object> + + <object type="slidervalue"> + <placement x="slidervalue_x" y="%row11_text_y%" w="%slidervalue_w%" /> + <font resource="font" color="%text_color%" /> + <text>Action Vibration:</text> + <data variable="tw_action_vibrate" min="0" max="500" /> + <colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" /> + </object> + + <object type="action"> + <touch key="home" /> + <action function="page">main</action> + </object> + + <object type="action"> + <touch key="back" /> + <action function="page">settings</action> + </object> + + <object type="template" name="footer" /> + </page> + <page name="advanced"> <object type="template" name="header" /> diff --git a/gui/gui.cpp b/gui/gui.cpp index e9efc1db9..912899f07 100644 --- a/gui/gui.cpp +++ b/gui/gui.cpp @@ -57,6 +57,9 @@ extern "C" #include "blanktimer.hpp" #endif +// Enable to print render time of each frame to the log file +//#define PRINT_RENDER_TIME 1 + const static int CURTAIN_FADE = 32; using namespace rapidxml; @@ -186,6 +189,7 @@ static void * input_thread(void *cookie) static struct timeval touchStart; HardwareKeyboard kb; string seconds; + MouseCursor *cursor = PageManager::GetMouseCursor(); #ifndef TW_NO_SCREEN_TIMEOUT //start screen timeout threads @@ -329,7 +333,47 @@ static void * input_thread(void *cookie) #ifdef _EVENT_LOGGING LOGERR("TOUCH_KEY: %d\n", ev.code); #endif - if (ev.value != 0) + // Left mouse button + if(ev.code == BTN_LEFT) + { + if(ev.value == 1) + { + cursor->GetPos(x, y); + + if (PageManager::NotifyTouch(TOUCH_START, x, y) > 0) + state = 1; + drag = 1; + touch_and_hold = 1; + dontwait = 1; + key_repeat = 0; + gettimeofday(&touchStart, NULL); + } + else if(drag == 1) + { + if (state == 0) + { + cursor->GetPos(x, y); + + PageManager::NotifyTouch(TOUCH_RELEASE, x, y); + + touch_and_hold = 0; + touch_repeat = 0; + if (!key_repeat) + dontwait = 0; + } + state = 0; + drag = 0; + } + } + // side mouse button, often used for "back" function + else if(ev.code == BTN_SIDE) + { + if(ev.value == 1) + kb.KeyDown(KEY_BACK); + else + kb.KeyUp(KEY_BACK); + } + else if (ev.value != 0) { // This is a key press if (kb.KeyDown(ev.code)) @@ -367,6 +411,26 @@ static void * input_thread(void *cookie) #endif } } + else if(ev.type == EV_REL) + { +#ifdef _EVENT_LOGGING + LOGERR("EV_REL %d %d\n", ev.code, ev.value); +#endif + if(ev.code == REL_X) + cursor->Move(ev.value, 0); + else if(ev.code == REL_Y) + cursor->Move(0, ev.value); + + if(drag == 1) { + cursor->GetPos(x, y); +#ifdef _EVENT_LOGGING + LOGERR("TOUCH_DRAG: %d, %d\n", x, y); +#endif + if (PageManager::NotifyTouch(TOUCH_DRAG, x, y) > 0) + state = 1; + key_repeat = 0; + } + } } return NULL; } @@ -423,6 +487,11 @@ static int runPages(void) DataManager::SetValue("tw_loaded", 1); +#ifdef PRINT_RENDER_TIME + timespec start, end; + int32_t render_t, flip_t; +#endif + for (;;) { loopTimer(); @@ -432,11 +501,30 @@ static int runPages(void) int ret; ret = PageManager::Update(); + +#ifndef PRINT_RENDER_TIME if (ret > 1) PageManager::Render(); if (ret > 0) flip(); +#else + if (ret > 1) + { + clock_gettime(CLOCK_MONOTONIC, &start); + PageManager::Render(); + clock_gettime(CLOCK_MONOTONIC, &end); + render_t = TWFunc::timespec_diff_ms(start, end); + + flip(); + clock_gettime(CLOCK_MONOTONIC, &start); + flip_t = TWFunc::timespec_diff_ms(end, start); + + LOGINFO("Render(): %u ms, flip(): %u ms, total: %u ms\n", render_t, flip_t, render_t+flip_t); + } + else if(ret == 1) + flip(); +#endif } else { diff --git a/gui/keyboard.cpp b/gui/keyboard.cpp index 95cdbf1c8..36106c7c1 100644 --- a/gui/keyboard.cpp +++ b/gui/keyboard.cpp @@ -30,6 +30,7 @@ #include <time.h> #include <unistd.h> #include <stdlib.h> +#include "../data.hpp" #include <string> @@ -475,6 +476,7 @@ int GUIKeyboard::NotifyTouch(TOUCH_STATE state, int x, int y) startSelection = 0; break; } else if (state == TOUCH_RELEASE && was_held == 0) { + DataManager::Vibrate("tw_keyboard_vibrate"); if ((int)keyboard_keys[currentLayout - 1][rowIndex][indexx].key < KEYBOARD_SPECIAL_KEYS && (int)keyboard_keys[currentLayout - 1][rowIndex][indexx].key > 0) { // Regular key PageManager::NotifyKeyboard(keyboard_keys[currentLayout - 1][rowIndex][indexx].key); @@ -500,6 +502,7 @@ int GUIKeyboard::NotifyTouch(TOUCH_STATE state, int x, int y) PageManager::NotifyKeyboard(keyboard_keys[currentLayout - 1][rowIndex][indexx].key); } else if ((int)keyboard_keys[currentLayout - 1][rowIndex][indexx].longpresskey < KEYBOARD_SPECIAL_KEYS && (int)keyboard_keys[currentLayout - 1][rowIndex][indexx].longpresskey > 0) { // Long Press Key + DataManager::Vibrate("tw_keyboard_vibrate"); PageManager::NotifyKeyboard(keyboard_keys[currentLayout - 1][rowIndex][indexx].longpresskey); } } else if (state == TOUCH_REPEAT) { diff --git a/gui/mousecursor.cpp b/gui/mousecursor.cpp new file mode 100644 index 000000000..1c22356f9 --- /dev/null +++ b/gui/mousecursor.cpp @@ -0,0 +1,154 @@ +#include <stdarg.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <fcntl.h> +#include <sys/reboot.h> +#include <sys/stat.h> +#include <sys/time.h> +#include <sys/mman.h> +#include <sys/types.h> +#include <sys/ioctl.h> +#include <time.h> +#include <unistd.h> +#include <stdlib.h> + +#include <string> + +extern "C" { +#include "../twcommon.h" +#include "../minuitwrp/minui.h" +} + +#include "rapidxml.hpp" +#include "objects.hpp" + +MouseCursor::MouseCursor(int resX, int resY) +{ + ResetData(resX, resY); +} + +MouseCursor::~MouseCursor() +{ +} + +void MouseCursor::ResetData(int resX, int resY) +{ + m_resX = resX; + m_resY = resY; + m_moved = false; + m_speedMultiplier = 2.5f; + m_image = NULL; + m_present = false; + + ConvertStrToColor("red", &m_color); + + SetRenderPos(resX/2, resY/2, 10, 10); +} + +void MouseCursor::LoadData(xml_node<>* node) +{ + xml_attribute<>* attr; + xml_node<>* child; + + child = node->first_node("placement"); + if(child) + LoadPlacement(child, &mRenderX, &mRenderY, &mRenderW, &mRenderH); + + child = node->first_node("background"); + if(child) + { + attr = child->first_attribute("color"); + if(attr) + ConvertStrToColor(attr->value(), &m_color); + + attr = child->first_attribute("resource"); + if(attr) + { + m_image = PageManager::FindResource(attr->value()); + if(m_image) + { + mRenderW = gr_get_width(m_image->GetResource()); + mRenderH = gr_get_height(m_image->GetResource()); + } + } + } + + child = node->first_node("speed"); + if(child) + { + attr = child->first_attribute("multiplier"); + if(attr) + m_speedMultiplier = atof(attr->value()); + } +} + +int MouseCursor::Render(void) +{ + if(!m_present) + return 0; + + if(m_image) + { + gr_blit(m_image->GetResource(), 0, 0, mRenderW, mRenderH, mRenderX, mRenderY); + } + else + { + gr_color(m_color.red, m_color.green, m_color.blue, m_color.alpha); + gr_fill(mRenderX, mRenderY, mRenderW, mRenderH); + } + return 0; +} + +int MouseCursor::Update(void) +{ + if(m_present != ev_has_mouse()) + { + m_present = ev_has_mouse(); + if(m_present) + SetRenderPos(m_resX/2, m_resY/2); + return 2; + } + + if(m_present && m_moved) + { + m_moved = false; + return 2; + } + return 0; +} + +int MouseCursor::SetRenderPos(int x, int y, int w, int h) +{ + if(x == mRenderX && y == mRenderY) + m_moved = true; + + return RenderObject::SetRenderPos(x, y, w, h); +} + +void MouseCursor::Move(int deltaX, int deltaY) +{ + if(deltaX != 0) + { + mRenderX += deltaX*m_speedMultiplier; + mRenderX = (std::min)(mRenderX, m_resX); + mRenderX = (std::max)(mRenderX, 0); + + m_moved = true; + } + + if(deltaY != 0) + { + mRenderY += deltaY*m_speedMultiplier; + mRenderY = (std::min)(mRenderY, m_resY); + mRenderY = (std::max)(mRenderY, 0); + + m_moved = true; + } +} + +void MouseCursor::GetPos(int& x, int& y) +{ + x = mRenderX; + y = mRenderY; +} diff --git a/gui/objects.hpp b/gui/objects.hpp index e7bb2a0ee..e8110b016 100644 --- a/gui/objects.hpp +++ b/gui/objects.hpp @@ -25,6 +25,7 @@ #include <vector> #include <string> #include <map> +#include <time.h> extern "C" { #ifdef HAVE_SELINUX @@ -285,6 +286,7 @@ protected: void operation_start(const string operation_name); void operation_end(const int operation_status, const int simulate); static void* command_thread(void *cookie); + time_t Start; }; class GUIConsole : public RenderObject, public ActionObject @@ -976,6 +978,31 @@ protected: int lineW; }; +class MouseCursor : public RenderObject +{ +public: + MouseCursor(int posX, int posY); + virtual ~MouseCursor(); + + virtual int Render(void); + virtual int Update(void); + virtual int SetRenderPos(int x, int y, int w = 0, int h = 0); + + void Move(int deltaX, int deltaY); + void GetPos(int& x, int& y); + void LoadData(xml_node<>* node); + void ResetData(int resX, int resY); + +private: + int m_resX; + int m_resY; + bool m_moved; + float m_speedMultiplier; + COLOR m_color; + Resource *m_image; + bool m_present; +}; + // Helper APIs bool LoadPlacement(xml_node<>* node, int* x, int* y, int* w = NULL, int* h = NULL, RenderObject::Placement* placement = NULL); 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) diff --git a/gui/pages.hpp b/gui/pages.hpp index a37cdb9f2..2a2ef2c32 100644 --- a/gui/pages.hpp +++ b/gui/pages.hpp @@ -28,6 +28,7 @@ class ResourceManager; class RenderObject; class ActionObject; class InputObject; +class MouseCursor; class Page { @@ -130,6 +131,9 @@ public: static int SetKeyBoardFocus(int inFocus); static int NotifyVarChange(std::string varName, std::string value); + static MouseCursor *GetMouseCursor(); + static void LoadCursorData(xml_node<>* node); + protected: static PageSet* FindPackage(std::string name); @@ -137,6 +141,7 @@ protected: static std::map<std::string, PageSet*> mPageSets; static PageSet* mCurrentSet; static PageSet* mBaseSet; + static MouseCursor *mMouseCursor; }; #endif // _PAGES_HEADER_HPP diff --git a/gui/slider.cpp b/gui/slider.cpp index b46d156f6..af0c542de 100644 --- a/gui/slider.cpp +++ b/gui/slider.cpp @@ -15,6 +15,7 @@ #include <time.h> #include <unistd.h> #include <stdlib.h> +#include "../data.hpp" #include <string> @@ -156,8 +157,10 @@ int GUISlider::NotifyTouch(TOUCH_STATE state, int x, int y) if (!dragging) return 0; - if (sCurTouchX >= mRenderX + mRenderW - sTouchW) + if (sCurTouchX >= mRenderX + mRenderW - sTouchW) { + DataManager::Vibrate("tw_button_vibrate"); sAction->doActions(); + } sCurTouchX = mRenderX; dragging = false; |