summaryrefslogtreecommitdiffstats
path: root/gui/pages.hpp (unfollow)
Commit message (Collapse)AuthorFilesLines
2017-01-18Add missing license headersMatt Mower1-0/+18
Change-Id: I7f807a2f140068181524d8e868d029b4d94c70e8
2016-03-29gui: rewrite theme loading codethat1-6/+8
- Reduce code duplication for parsing of include files - Fix crash when styles and templates from included files are referenced - Fix bug with path concatenation if more than one file is included Change-Id: I06cd720188df272180fb359097afd73a85952fa8
2016-02-03sort languages by display valueXuefer1-0/+5
Change-Id: I79d58fd680dd04161b89d42fed04a86a931defd3 Signed-off-by: Xuefer <xuefer@gmail.com>
2016-01-25gui: use XML-based page for splash screen instead of a static jpgthat1-1/+0
For devices with an unusual aspect ratio, stretching a bitmap to the screen resolution is sub-optimal. So let's reuse our XML engine that allows assembling the splash screen from individual parts. The splash page is loaded from a separate XML file for quick loading. Change-Id: I2d3dad26e42fcefaf563dacdf0ffa61f209dada1
2016-01-23Update mStartPage to make language selection work on other pagesEthan Yonker1-0/+1
We should offer language selection on any start page such as decrypt or system read only. However, if the mStartPage variable was not being updated properly so selecting a different language was dumping the user back on either the decrypt prompt or the system read only page. This patch set fixes the problem and places the user back on the proper page when they choose a new language. Change-Id: I5153d3b9525d8c93d3863f4b17ecf55b5209e3c7
2016-01-21Ensure that a base language is loaded before custom themeEthan Yonker1-1/+1
Main goal of this patch is to improve error handling when a custom theme does not contain a valid theme version. We were getting a message saying that the theme_ver_err resource did not exist as well as an error saying that the package had failed to load. Now we properly get a single error message about the theme version. Change-Id: I361ef2d139220bbeaf2e856be919dc3a50ae4299
2016-01-07gui: add keyboard support for Ctrl layer and more special keysthat1-3/+3
- rename NotifyKeyboard to NotifyCharInput - input: handle arrow keys in NotifyKey with standard KEY_* codes - fix page handler to return 0 from NotifyKey if key was handled - fix GUIAction::NotifyKey to not swallow all keys - change home button code from KEY_HOME to KEY_HOMEPAGE (to avoid collision with Home/End, conforms to Android 3.0+) Change-Id: Ib138afa492df8d0c1975415e8b5334c8778ccc90
2015-12-29get rid of console thread for OpenRecoveryScriptthat1-4/+2
- CLI commands run in a threaded action "twcmd" - Console is displayed via "singleaction_page" - move ORS execution code from GUI action to OpenRecoveryScript class - remove unused function gui_changePackage - don't change PageManager package in home action - fix that /tmp/openrecoveryscript was not deleted after execution Change-Id: Ic688c0b04647ce09e9db979b0bc5123f47cf4f70
2015-12-19Multiple Language SupportEthan Yonker1-2/+19
This is similar to https://gerrit.omnirom.org/#/c/14014 A lot of the features built in the older patch set have been split out into separate patches, most of which have already been merged. The remaining functionality here should all be directly related to language selection and loading. We always load English as a base before loading other languages over the top of the base. The idea is that if another language is missing a translation, then we will still display the English. Maybe still to do: read the /cache/recovery/last_locale file and load a language based on that. For me, this file contains just: en_US We probably won't bother with region specific translations so we would have to look at either trimming off the _US or using some other method like perhaps a symlink or a combination of the two. Thanks to _that for twmsg.cpp class Change-Id: I9647a22e47883a3ddd2de1da51f64aab7c328f74
2015-11-09Move reloading of theme outside of the action threadEthan Yonker1-5/+6
Reloading the GUI while the GUI is running and rendering is very dangerous as we may be deleting GUI resources before or while we are trying to render those same items. This change will allow us to safely load new resources and delete the old ones. Fixed a double free situation that was causing a crash on every other theme reload. Clear parsed xml documents when we are done loading the theme instead of keeping them in memory for the life of the theme to help save a little memory. Store starting page so that if we request a reload, we can enter the theme at the same starting point, which may come in handy if we allow for language selection on alternate starting pages such as the decrypt prompt or the system read only prompt. Change-Id: I45a7e3fb3daeefac56d70f8d4936938eb1244b99
2015-10-16Use unified LoadFileToBuffer functionEthan Yonker1-0/+1
Create a single function for loading xml files to a memory buffer to reduce code duplication. Change-Id: I0ff64463072118f61a2eb8052f74019715020253
2015-07-13gui: allow specifying object type in element namethat1-2/+2
e.g. '<button ...>' instead of '<object type="button" ...>' Also get rid of default parameters to make things more explicit. Change-Id: Ie4d1231b725aeb6cbf0041622c9780c86cf8e1c1
2015-03-19Allow multiple overlaysEthan Yonker1-1/+1
This effectively allows us to support popup dialogs and the like. Change-Id: Iafb3fa60ed635287cb59dce118f74dc8f2a4e60a
2015-03-11gui: type safe resources part 2that1-3/+2
- separate collections for fonts, images, animations - no more ugly casts - fix crash if main ui.xml did not define any resources but include did - don't stop loading resources if one "type" attribute is missing Change-Id: I70c1c9ca66ca65d9fba1ba3eded34f3d8a07488e
2015-02-21GUI: Support styles in xml to reduce xml file sizeEthan Yonker1-0/+4
Also allow sliders to have their own text label instead of requiring a whole separate text object for the label in the xml. Change-Id: I6e314efb4bb454d496555ff7e003d743063a1308
2015-02-15gui: make resources type safethat1-2/+5
- add string, int, color and resource loading helpers - use typed resource classes, and some cleanup in loading code - remove abstract GetResource() to enforce type safe access - add height and width query methods to resources and use them - minor cleanup - simplify LoadPlacement Change-Id: I9b81785109a80b3806ad6b50cba4d893b87b0db1
2015-01-12Fix some crashes during theme (re)loadingVojtech Bocek1-0/+1
Change-Id: I01405fbe86a48ae79f2cbe633b89f2dcfb1ef266 Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
2015-01-11gui: simplify blanktimerthat1-0/+12
- get rid of separate thread, check timer in rendering thread instead - use an enum for the blanking state instead of magic integers - move #ifdefs for TW_NO_SCREEN_TIMEOUT inside blanktimer class - move some #includes and enum TOUCH_STATE to pages.hpp Change-Id: Id4b104e3680dc5db41d8ba85e32d722cf4086299
2014-12-10Use one mizip for allEthan Yonker1-4/+0
The new minzip did not compile in older trees due to needing mmap64. For older trees we will just use mmap instead. Remove all files and code pertaining to minzipold. Updater should now build properly in older trees as well. Eliminate use of PLATFORM_VERSION in favor of PLATFORM_SDK_VERSION which should be more consistent and reliable. Change-Id: I38d2b604a73d1b17a2072c7d60e990b81ece0c10
2014-08-09Add command line capabilitiesEthan Yonker1-1/+2
Allows sending openrecoveryscript commands to TWRP via shell. This may be handy for visually impaired users, for various one click utilities to drive TWRP commands from a computer, for using TWRP when a catastrophic hardware failure like a shattered screen prevents you from being able to use touch, or even on devices like a TV stick where touch and USB mouse input is unavailable. This patch also includes a few minor changes to openrecoveryscript including proper support for rebooting via the script and for decrypting the device via the command line. Change-Id: I796ad168efdd2da9c25334ac93d1079daaa7b0bc
2014-07-28Allow ui.xml to include additional xml files to readEthan Yonker1-3/+5
Use common portrait and landscape xml files based on resolution defined by the device. Change-Id: Iec528f9d846d49857ff98de1ac201e25dbb60339
2014-04-16Add support for actions triggered by key combinationVojtech Bocek1-3/+7
Change-Id: I9dfa7de40229f00412d63fc9c1eb3a809a6eb2e6 Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
2014-02-12Properly delete all GUIObjects and pages on theme reloadVojtech Bocek1-3/+4
Signed-off-by: Vojtech Bocek <vbocek@gmail.com> Change-Id: I8df41877f8f4439a434becfd47a9914b50649b34
2014-02-07Implement mouse cursorVojtech Bocek1-0/+5
Signed-off-by: Vojtech Bocek <vbocek@gmail.com> Change-Id: I66d6db7b3ed9cca50b469d125b36224332e06913
2013-09-10Kang in older minzip for building in CM9 & CM7Dees Troy1-0/+6
CM7 and CM9 do not have libselinux needed in the newer minzip.
2013-08-24Unify indentation and little clean-up in TWRP filesVojtech Bocek1-64/+64
Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
2012-12-18Fix defines on pages.hpp to not collide with pages.hDees_Troy1-4/+3
2012-09-05TWRP-ify AOSP codeDees_Troy1-0/+137
Pull in most TWRP sources Stub out partition management code Make it compile -- probably will not boot Kind of a mess but have to start somewhere