summaryrefslogtreecommitdiffstats
path: root/gui/pages.cpp (unfollow)
Commit message (Collapse)AuthorFilesLines
2017-06-17twrpDigest refactorbigbiff bigbiff1-1/+1
This patch is to refactor twrpDigest using polymorphism and inheritance to use the same call patterns for creating and reading a digest. Now a library. Use SHA2 from libcrypto. SHA2 is default if device has libcrypto. Change string MD5 everywhere to use digest or Digest instead. Updated string tags to digest. Translation will be required. Switch out digest code into a driver class from partitionmanager. SHA2 is better for digest creation due to decreased collision space compared to MD5 and SHA1. See https://en.wikipedia.org/wiki/SHA-2 Change-Id: I74b5546789990b12aa4ce2e389d25f80a3fe213f
2017-03-01gui: preserve order of gui_print vs gui_msgthat1-8/+1
- rename __gui_print to internal_gui_print (__* is reserved for compiler) - translate outstanding messages in internal_gui_print - add locking because background thread could print while we render - minor cleanup Change-Id: Ib687d2cfb4763ad08ad4d4b76daf5b129d61d2e2
2017-01-18gui: bump theme version to 2that1-1/+3
Commit 9472ba1d introduced new behavior for KEY_POWER which needs a corresponding change in the theme to call the setbacklight action whenever the power button is pressed. Change-Id: Iacd46436b04aba1ecb1adbb684c56c3ef994bfe0
2017-01-18Whitespace cleanupMatt Mower1-11/+11
Change-Id: I93c65973679894bb8587da4b38b410d38036b8bd
2017-01-11Support theme width and height offsetsJames Christopher Adduono1-5/+22
Current use condition is LG V20, where the secondary screen is actually just a corner chunk of the main screen. In this case, we need to shift the UI down some pixels in order to see it all, but just using Y offsets resulted in losing the rest of the GUI below. Example in BoardConfig.mk: # Shift TWRP off the secondary screen TW_Y_OFFSET := 160 TW_H_OFFSET := -160 Change-Id: I5a06638ba0d05e5b9fd8a6245c630d6ea3394f78
2016-11-30Improve backup & wipe exclusion handlingEthan Yonker1-0/+1
Rename twrpDU.* to exclude.* Remove global variable for du and replace with partition specific variables. Use separate exclusion lists for backups and wiping. Clean up some includes Fix some parenthesis in twrp.cpp that I messed up. Note: twrpTarMain command line utility compiles but probably does not work correctly yet due to not properly setting part_settings Change-Id: Idec9c3e6a8782ba53f3420fa79ba33394f4f85fb
2016-03-31Stop loading languages for the splash screenEthan Yonker1-2/+4
We don't translate anything for the splash screen currently so this will slightly reduce startup times and prevent the code from running when it's not needed. Change-Id: I8a8e8be5247d8e8b148db578c12bce5d370123a8
2016-03-29gui: rewrite theme loading codethat1-202/+175
- 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/+3
Change-Id: I79d58fd680dd04161b89d42fed04a86a931defd3 Signed-off-by: Xuefer <xuefer@gmail.com>
2016-01-27Update minuitwrp graphics in line with latest minuiEthan Yonker1-1/+1
Note: events.cpp is still old code renamed to cpp to make it easier to call functions like gr_fb_width(). I had to modify AOSP fbdev code to provide a separate memory surface for drawing to as drawing directly to the framebuffer resulted in rendering taking about 5 times longer. I also modified AOSP adf code to provide a separate memory surface for drawing for the same performance reasons. The Nexus 9 supports adf graphics. Overlay graphics work on at least one device. Overlay provides a separate memory buffer already so performance is good. I do not have a drm device yet that I know of. I made some attempt to update the drm code to determine the correct pixel format based on the drm graphics format, but what is available in pixel flinger and what is available in drm do not line up all that well. Reports are that the Pixel C is using drm graphics, but performance is slow, likely due to the use of a mmap instead of a memory buffyer. Change-Id: Ibd45bccca6ac2cb826037aa9b2aa5065cf683eed
2016-01-25gui: use XML-based page for splash screen instead of a static jpgthat1-7/+2
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/+4
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-22Fix (Auto Generate) handling for backup namesEthan Yonker1-2/+4
Change-Id: I29f3823d03c005fb55a0e0a98818d40bd1eb039d
2016-01-21Ensure that a base language is loaded before custom themeEthan Yonker1-9/+13
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-16Add theme version checkingEthan Yonker1-2/+21
Add a themeversion value to the ui.xml details section. Check this value against a define during early theme loading. If we are loading a custom theme, then reject the custom theme if the version does not match (or not defined) and load the stock theme. If it is the stock theme, show a warning but continue loading. Also fix an issue with changing overlays. Not sure how it ever worked before, but it works now. TLDR: Use the stock theme if the custom theme version does not match. Change-Id: I0277cbe035cbec7e16b6327500762dadf9c1c5c8
2016-01-07gui: add terminal emulatorthat1-0/+8
Emulates enough of a VT-100 to run busybox vi. Change-Id: I99c829c6c9de2246194ecb8b8b3cdf4ac34a0606
2016-01-07gui: add keyboard support for Ctrl layer and more special keysthat1-20/+10
- 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-18/+10
- 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-6/+178
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-21/+63
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-11-05gui: fix default styles if object type is in element namethat1-8/+8
Change-Id: I4bc46d1772fee2ec77d95732fa3f69c267c2c34e
2015-10-26GUI TextBoxEthan Yonker1-0/+7
Allows the GUI to create a scrollable text box for long text that may not all fit on the screen. Also includes code to allow the console to wrap on spaces and other such characters instead of wrapping in the middle of a word. To see an example of how to add a text box to the XML, see: https://gerrit.omnirom.org/#/c/14183/ Change-Id: Ifd139172ede290046b58ea3fe526e2e06da1d4ef
2015-10-16Allow text to scale to fitEthan Yonker1-2/+2
Change-Id: Iacd4bb78f551b51d092ecde09521b5541e7dadcd
2015-10-16Use unified LoadFileToBuffer functionEthan Yonker1-79/+80
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-25/+17
e.g. '<button ...>' instead of '<object type="button" ...>' Also get rid of default parameters to make things more explicit. Change-Id: Ie4d1231b725aeb6cbf0041622c9780c86cf8e1c1
2015-05-18GUI: Prevent duplicate page overlaysMatt Mower1-0/+11
If a page is requested for overlay, ensure it doesn't already exist in the stack of existing overlays. If it does, erase the existing page and push_back the new one. Change-Id: I9feeea06cf7aad2e08a8c3bc567aaa761db2c3bc
2015-03-19Allow multiple overlaysEthan Yonker1-19/+50
This effectively allows us to support popup dialogs and the like. Change-Id: Iafb3fa60ed635287cb59dce118f74dc8f2a4e60a
2015-03-13Add UI for entering pattern for device decryptionVojtech Bocek1-0/+7
Change-Id: Ia2d3268a96423e9ca3846500c57e674c4f8fa60b Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
2015-03-11gui: type safe resources part 2that1-20/+9
- 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-03-05gui: kinetic scrolling for consolethat1-0/+3
- Rebase console on ScrollList - Add fastscroll bar to console - ScrollList now has a mode that ignores selections - Increase kinetic scrolling speed for lists showing many items Change-Id: I6298d717d2e403f3e85e2c633d53c4284a066012
2015-02-21GUI: Support styles in xml to reduce xml file sizeEthan Yonker1-3/+87
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-33/+75
- 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-02-10Scale the GUI to fit the screenEthan Yonker1-0/+56
With this patch set, if needed, we scale the images during early boot. TTF support is needed to properly scale the font. No font scaling is done on the old style fixed width font used in the console. Special thanks to _that for figuring out the scaling and blending function calls to make this possible. Change-Id: If2f79bef16d6db2e1298bfc3d00c9bcca2bee37a
2015-01-22Use /twres instead of /res for theme resourcesDees Troy1-3/+4
AOSP and other ROM trees now do a rm -rf of the res folder during the ramdisk creation process that removes the TWRP resources. Using /twres instead of /res works around this issue making TWRP more compatible with AOSP and other build trees. Change-Id: I0d4c7e06ca381ac5aa0069b6f2b8c47f7dec49e7
2015-01-12Fix some crashes during theme (re)loadingVojtech Bocek1-11/+25
Change-Id: I01405fbe86a48ae79f2cbe633b89f2dcfb1ef266 Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
2015-01-11gui: simplify blanktimerthat1-8/+1
- 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
2015-01-09Allow for X and Y offsets in GUIEthan Yonker1-0/+19
These can be used to center a lower resolution theme onto a higher resolution screen. May be useful for Nexus 9 unless or until we decide to do a 1536x2048 theme or on devices like the Moto 360 and LG G Watch R. The build flags will only affect the stock theme. If a custom theme wishes to apply an offset, it can be done by setting tw_x_offset and / or tw_y_offset in the variables section of the XML. Change-Id: I2390769ed861b96a4a3bb8a0f06d9021ec91b6b9
2014-12-10Use one mizip for allEthan Yonker1-18/+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-12-02 Make the android-5.0 branch compile in 4.4 to 4.1Ethan Yonker1-0/+18
Migrate previous minzip to minzipold replacing the existing minzipold. This will break compatibility with trees that do not support selinux (ICS and older). Migrate former verifier files to verifierold. Add fuse.h to recovery source because older trees do not have it. Add LOCAL_MODULE_TAGS where needed for 4.1 tree. Change-Id: Iade57cb2b0115af7fce9f56aa98636b1744a1ef4
2014-11-08Make custom themes work againEthan Yonker1-3/+24
Change-Id: Ib9ad011428603979f7dd8a2708989feb9b13e075
2014-11-07Disable custom theme and fix png loadingEthan Yonker1-1/+1
We will have to update the zip handling later. Now at least TWRP boots up to the GUI. Change-Id: I4182896eb095cab52fb0f1c9c20b6605e35677b9
2014-08-09Add command line capabilitiesEthan Yonker1-0/+10
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-08-07Allow using variables and addition/subtraction in variablesEthan Yonker1-1/+26
Change-Id: I1acba95302e414e1a471d27474508a7c48df0328
2014-07-28Allow ui.xml to include additional xml files to readEthan Yonker1-21/+153
Use common portrait and landscape xml files based on resolution defined by the device. Change-Id: Iec528f9d846d49857ff98de1ac201e25dbb60339
2014-06-04Whitespace and minor code cleanupMatt Mower1-7/+7
This is by no means comprehensive, but is quite a bit better already. Change-Id: Ibc8654a5dfb0eec39cbd0b64bdb52bb4fbfe2f7e
2014-04-16Add support for actions triggered by key combinationVojtech Bocek1-12/+21
Change-Id: I9dfa7de40229f00412d63fc9c1eb3a809a6eb2e6 Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
2014-02-12Cache results of GUIObject::isConditionTrue()Vojtech Bocek1-7/+5
Signed-off-by: Vojtech Bocek <vbocek@gmail.com> Change-Id: Ia50f7c365b2dc0a65ee046bb42972e3594264878
2014-02-12Properly delete all GUIObjects and pages on theme reloadVojtech Bocek1-0/+27
Signed-off-by: Vojtech Bocek <vbocek@gmail.com> Change-Id: I8df41877f8f4439a434becfd47a9914b50649b34
2014-02-07Implement mouse cursorVojtech Bocek1-2/+38
Signed-off-by: Vojtech Bocek <vbocek@gmail.com> Change-Id: I66d6db7b3ed9cca50b469d125b36224332e06913
2013-12-07Add support for persistent variables in theme's <variables> sectionVojtech Bocek1-5/+10
* Add support for variables with persist="1", which will cause them saved into settings file and reloaded on next boot. * This is handy for theme makers, who can use this to implement "theme settings". Signed-off-by: Vojtech Bocek <vbocek@gmail.com> Change-Id: I6415979011b38cbb15dec9909c445b02da6eadc0
2013-10-24Update licenses to all matchDees Troy1-0/+1
Change-Id: I3be70a897e563658736b2dec3a9ea2697b69b225
2013-10-22Update licenses to all matchDees Troy1-0/+1
2013-08-25Add a TW_NO_TIMEOUT optionRicardo Gomez1-1/+6
Change-Id: Ifb3a5bd9f1e6c2e9810c90b0aec198e91d5956fc
2013-08-24Unify indentation and little clean-up in TWRP filesVojtech Bocek1-582/+609
Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
2013-06-08Do not render the GUI when the blanktimer turns off the display.gordon13371-0/+5
Normally, when the display has been turned off by blanktimer, the GUI actually still renders the GUI elements (eg. progressbar while doing backup/restore/etc.) This patch will check whenever the display is turned off, and if it is turned off simply dont render. This avoids heating up the device and will save battery.
2013-04-04Add new SliderValue GUI widgetVojtech Bocek1-0/+6
Signed-off-by: Vojtech Bocek <vbocek@gmail.com> Change-Id: Ic5d44314f501341140dd7059d1cb753341f5844c
2013-04-04Move all AOSP code out of recovery binaryDees_Troy1-27/+26
Improves license compatibility between GPL and Apache Change-Id: I2b165aa575bb6213af6b07936f99610c113443f0
2013-03-30Add partition list GUI elementDees_Troy1-1/+24
Add partition list GUI element and update backup, restore, mount, storage selection, and wipe sections of GUI and partition manager code to reflect the new GUI element. Update ORS engine to handle new backup and restore setup. Fix a bug with decrypt. Add 1080x1920 layout. Change-Id: Iaa2f44cb707167e66f935452f076ba00e68a2aa4
2012-10-20Add keyboard key highlightDees_Troy1-11/+18
2012-09-05TWRP-ify AOSP codeDees_Troy1-0/+892
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