summaryrefslogtreecommitdiffstats
path: root/gui/objects.hpp (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Support theme width and height offsetsJames Christopher Adduono2017-01-111-0/+6
| | | | | | | | | | | | | | | 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
* Add TWRP app install via TWRP recoveryEthan Yonker2016-12-161-0/+2
| | | | | | | | | Note: I will have to add a build flag for excluding the app later for watches and maybe Android TV. I will also have to add support in the tablet and watch layouts later. I will merge this for the initial roll out to select devices and finish up later. Change-Id: Ia4ce5522fae542afa1539b10c0691315392a19ab
* Add boot slot supportEthan Yonker2016-12-131-0/+1
| | | | Change-Id: I7eaf80e327985f53791f90fbdebad022a9650d31
* GUI: Add countdown & cancel to install auto-rebootMatt Mower2016-08-191-0/+1
| | | | | | | Provide a countdown from 5 sec for the automated reboot after install. Include a cancel button to interrupt the process. Change-Id: Ib5e1447918adfde45eba361c088800812b690890
* gui: don't mix up display value with actual valueSultan Qasim Khan2016-04-041-4/+3
| | | | | | | | | In the case of password entry, the two differ. Password entry was broken by the earlier commit entitled "Improve input box text handling" because it started using the displayValue as the actual value, even in cases where they differ because of a mask value. Change-Id: Iaf5a67e1d928f34595962a1f1b80eebb64e8b493
* Improve input box text handlingEthan Yonker2016-03-291-6/+8
| | | | Change-Id: I79cfaac1adf85d1ee5514bf5266930823c1a15ff
* gui: remove unused struct translate_later_structthat2016-02-031-9/+0
| | | | Change-Id: I663f327585b4037eba62508a1f6484ca152bf3c5
* Replace fix permissions with fix contexts for emulated storageEthan Yonker2016-01-291-0/+1
| | | | | | | | | | Fix permissions rarely fixed anything on more recent versions of Android and usually made things worse. Instead we will replace it with a more dumbed down option that should fix contexts on /data/media with a few improvements to ensure that contexts get fixed for multiple users and on adopted storage. Change-Id: If5523781936a0b04196e2ad871cae767ebae2583
* Make listbox translation workEthan Yonker2016-01-181-0/+1
| | | | Change-Id: I446f4499a43e6348a2b95846f3e5ea86967abbdc
* gui: add terminal emulatorthat2016-01-071-0/+38
| | | | | | Emulates enough of a VT-100 to run busybox vi. Change-Id: I99c829c6c9de2246194ecb8b8b3cdf4ac34a0606
* gui: add keyboard support for Ctrl layer and more special keysthat2016-01-071-22/+22
| | | | | | | | | | | - 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
* gui: PatternPassword: allow any N*N gridAleksa Sarai2016-01-021-3/+8
| | | | | | | | | | Rather than only supporting a 3x3 grid, allow for multiple grid sizes (using the CyanogenMod method of generating passphrases for non-3x3 grids). Also fix the detection of touches, as the old code was far too sensitive for larger grids (and also didn't make much sense). Change-Id: I343ef654e6d29ce0cb790a28281be7c7c9b171d9 Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
* get rid of console thread for OpenRecoveryScriptthat2015-12-291-0/+1
| | | | | | | | | | | - 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
* Multiple Language SupportEthan Yonker2015-12-191-0/+11
| | | | | | | | | | | | | | | | | | | | | | | 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
* GUI TextBoxEthan Yonker2015-10-261-1/+28
| | | | | | | | | | | | 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
* Fix a bunch of warningsEthan Yonker2015-10-251-5/+5
| | | | | | Mostly adding __unused where needed. Change-Id: Ia4f675b9b360782728c361ed1699db0cc277c3a5
* Allow text to scale to fitEthan Yonker2015-10-161-12/+4
| | | | Change-Id: Iacd4bb78f551b51d092ecde09521b5541e7dadcd
* gui: support conditions for listbox itemsthat2015-10-161-2/+4
| | | | Change-Id: Iea189ac53ec3d7c1bea83da7b77684778b1c0f46
* gui: extract methods for condition list handlingthat2015-10-161-2/+4
| | | | | | This is a preparation for list item conditions. Change-Id: Iec731d1986a53b0362c534adf504dfe8db87d3f0
* Allow listbox to have a list of check boxesEthan Yonker2015-10-161-0/+2
| | | | | | | | | For an example of how to implement a list of check boxes, see: http://bit.ly/1Giacw2 https://gerrit.omnirom.org/#/c/14284/2/ Change-Id: I0752a084625f4a0ef8cc6d99597f2fb9aa2ab9e0
* gui: allow listbox to be used as menu and as read-only listthat2015-07-141-0/+1
| | | | | | | | | | | | | | | | Also enable string insertion for list items. Example how to make a menu item: <listitem name="Lights on!"> <action> <action function="setbrightness">255</action> </action> </listitem> If no <data> element and no actions on any items exist, the list is read only and no item selection is possible. Change-Id: Ib2668a982df2514484d44faa0396dd17550f39f3
* gui: keyboard: support longpress label offset, code cleanupthat2015-07-141-1/+4
| | | | | | | | | | | | To position the longpress label: <longpress font="..." textcolor="..." x="5" y="0"/> x and y is the distance from the upper right corner. - extract method GUIKeyboard::DrawKey - clean up handling of currently pressed key - integrate key highlighting into main key drawing loops Change-Id: I80ccf2975d30cffa2a48627a74ab3693c84e4fa4
* [WIP] gui: software drawn keyboard (code only)that2015-06-201-1/+21
| | | | Change-Id: I9f05c85f8d43ab012228a78b79220a27876a299d
* Add resize2fs and ability to run resize2fs via GUIEthan Yonker2015-05-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Note: Only works on ext2/3/4 partitions. Only tested on ext4. We can use this in some cases to resize the data partition if an incorrect fstab caused recovery to not reserve the 16KB for a crypto footer. Sometimes the BoardConfig for a custom ROM does not have the correct size for the system partition and if the ROM flashes a raw system image, that image will not take up the full block device. Running resize2fs can fix the size and may allow more room in the system partition for customizations like busybox or a larger gapps package. Sometimes flashing a factory image may flash userdata with an image with a file system that does not take up the full size of the block device (e.g. factory images for the Nexus 6 will flash userdata with a ~24GB userdata image, wasting ~30GB of space). Using resize2fs we can easily fix this issue without having to do a full format data. Change-Id: I631f5c6f567bbc6a9241e5dd95f1e435820a1b13
* Mount system as read-only by defaultEthan Yonker2015-05-271-0/+2
| | | | | | | | | | | | | | Mounting system as rw can prevent future OTA updates. The purpose of this patch set is to prevent TWRP from mounting sytem as rw on the first boot. Device maintainers should update their twrp.fstab files on these devices to include an additional line: /system_image emmc /dev/block/../system This line will allow TWRP to create a raw system image backup to ensure that the user can return to an original state for future OTA updates. Change-Id: I8929d85bc3a5b96cc564bc7f734b58d5612ec833
* gui: keyboard: introduce struct Layout and simplify caps handlingthat2015-03-151-10/+13
| | | | | | | | Also minor cleanups: - move array limits from #defines to a protected enum - zero fill layouts in ctor Change-Id: I8fe0f8465ebc646ad3bf3cc3f8490dbdd384f43d
* gui: keyboard: add HitTestKey method, minor simplificationsthat2015-03-141-7/+7
| | | | Change-Id: I6cd0251dd9d933e6ebef977a553be7473e2d7034
* gui: keyboard doesn't need its own actionthat2015-03-141-1/+0
| | | | | | | This was questionable design and is unused anyway. Also reduced a few redundant #includes. Change-Id: I65bb01120e6072c5695755920242f6f9d73c816e
* Add UI for entering pattern for device decryptionVojtech Bocek2015-03-131-0/+52
| | | | | Change-Id: Ia2d3268a96423e9ca3846500c57e674c4f8fa60b Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
* gui: support string resourcesthat2015-03-111-3/+0
| | | | | | | | | | | | | | | storing strings in a map (for fast lookup) in resource manager To define a string resource in <resources>: <string name="foo">Hello</string> To use a string, e.g.: <text>%@foo%</text> Not yet done: language-specific resources (should be solved not only for strings, but for all kinds of resources - e.g. for localized images) Change-Id: I3ba5cf5298c09e0d28a83973e9662f179271b33f
* gui: kinetic scrolling for consolethat2015-03-051-61/+51
| | | | | | | | | - 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
* gui: introduce virtual RenderItem method in ScrollListthat2015-03-051-7/+8
| | | | | | | | - so derived lists can draw whatever they want (multi-line etc.) - replace GetListItem with RenderItem - minor cleanup Change-Id: I062e0a354f1c18ce0a5232b7542c4987b480e232
* gui: don't truncate values to 0 after scalingthat2015-02-231-1/+0
| | | | | | Avoids invisible lines (e.g. input cursor) when scaling down. Change-Id: I595e8bdb2fa468c30f104867ad77be2423ec287f
* gui: proportional scrollbarsthat2015-02-211-2/+7
| | | | | | | | | - Attribute "recth" in the <fastscroll> element is now the *minimum* height for the scrollbar. - Dragging the scrollbar moves the list. - Touching outside the scrollbar jumps to the relative position. Change-Id: Ic1f20b5ec68cf49e5be56be34f0c58c0f474618b
* GUI: Support styles in xml to reduce xml file sizeEthan Yonker2015-02-211-1/+6
| | | | | | | 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
* gui: support scrollable lists without headersthat2015-02-151-5/+4
| | | | | | | | | If the <header> element doesn't exist, the header is not drawn. - minuitwrp: add function for clipping all drawing to a rectangle ...and another one to cancel it. Change-Id: If0f688a5debee6ebd9c457999fe571705a42c5cc
* gui: make resources type safethat2015-02-151-42/+44
| | | | | | | | | | | - 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
* Retain and display previous selection for image flashingEthan Yonker2015-02-151-1/+1
| | | | Change-Id: Ib9963d8d393cf4428e43a3d6552d98ae67c1d7bf
* gui: fix console lockup when scrollingthat2015-02-061-5/+5
| | | | | | Apparently fixing all the signed/unsigned warnings was good. :) Change-Id: I62faa23179e8b2436fe0d24d2152af341cd42fe9
* Unify scrollable list codeEthan Yonker2015-02-051-165/+130
| | | | | | | | | | The goal of this patch set is to eliminate the code duplication caused by copy/paste of the code in the file selector, listbox, and partition list GUI elements. Those classes will now utilize a single GUIScrollList class that will handle rendering and scrolling. Change-Id: I0cb98ab36cf47178296034293435225658c779cd
* gui: simplify code in GUIKeyboardthat2015-02-011-5/+5
| | | | | | | | - merge duplicated code into new ParseKey method - convert some unsigned int to int to avoid warnings - add local variable for current key in NotifyTouch to reduce clutter Change-Id: I98ddbaca50d487c97ab6e98938df91ef03b9aed5
* gui: fix hardware keyboardthat2015-02-011-4/+9
| | | | | | | | | | - Power+voldown works again for taking screenshots - Right shift key isn't stuck until users presses "s" - Don't use DataManager for local variables - Simplify handling of Shift keys - Clean up #includes a bit Change-Id: Iff0453107beaa336a9c04422b43e92225fdbe069
* gui: run cancel action in another threadthat2015-01-301-20/+3
| | | | | | | | | | | Some actions did not have an operation_end where needed especially when dealing with cancel actions. Cancel actions now do not run operation_start or operation_end and let the original action handle the operation_end so that the GUI waits until the original action acutally cancels. Change-Id: I28e6260abb058acb982cecd108c09fc89e0ffeed
* gui: fix IsInRegionthat2015-01-291-3/+3
| | | | | | | | (0,0) was inside the region of "locationless" action objects, leading to all kinds of strange behavior when clicking in the upper left corner. Change-Id: I222db4ff499f3c30605b05267f005accb2e0dc99
* Add cancel backup capability.bigbiff2015-01-271-0/+1
| | | | | | | | | | | This will stop the iteration of the partition objects, kill the current twrpTar thread and remove the backup directory. Implement TWAtomicInt class to give us a wrapper that automatically uses mutexes before the read and write to help ensure that the reads and writes will be atomic based on documentation. Change-Id: I645b22bc980a292e9c7202acb24ffd22ebe68c63
* Allow for X and Y offsets in GUIEthan Yonker2015-01-091-0/+7
| | | | | | | | | | | | | | 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
* Improve GUI handling of zip flashingEthan Yonker2015-01-091-1/+1
| | | | | | | | | | | - change the page sooner so that users cannot activate the slider twice - improve GUI messaging if a zip requests a cache wipe - move update of the file count to the end so it is less visible to the user (e.g. during a cache wipe the counter should not read 0) Change-Id: I5d478f07effe61ca37f3521a77c9e9243a9cb692
* Allow flashing of images via the GUIEthan Yonker2015-01-091-0/+1
| | | | | | | | | | | - Use the Images... button in the lower right of the zip install page - Unify image flashing functions between restore and image flash - boot and recovery partitions are flashable by default - use fstab flag flashimg=1 or 0 to override defaults - file system partitions are currently not flashable Change-Id: I822dc446030543c55d2153e219d67a1292374ffc
* gui: fix action threading if background thread is busythat2015-01-091-2/+1
| | | | | | | | | | When the background thread is already running and we have at least one threaded action in the list, we should not run any non-threaded actions before ignoring the threaded action and following ones - it might cause invalid state variables to be set. Run or ignore the whole list in the background thread instead. Change-Id: Ie634105b80f038893898a21539886bd757eb47ce
* Run some actions in a separate threadthat2015-01-091-4/+25
| | | | | | | | | Some actions need to be threaded so we will run those in a separate thread and deny requests to thread more actions if new requests come in while a thread is already running. Change-Id: I966c538e67860a6d8fe556e5a2eb7f7d1a987e74 Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
* Thread openrecoveryscript action to properly display action pageEthan Yonker2015-01-051-0/+1
| | | | | | | | | The action page fails to display properly during ORS processing unless we thread the ORS action. Based upon the work done in this patch set by _that: https://gerrit.omnirom.org/#/c/11226 Change-Id: I6dac790ac26d9b3a02df778516fea011d67aea70
* fix adb sideloadthat2015-01-041-0/+2
| | | | | | | | | | - "Cancel" button handling requires another thread - simplify handling of child pid - merge duplicated code for reinjecting TWRP after installation - fix error that showed on host PC after sideload finished - fix problem where adbd sometimes does not stop correctly Change-Id: I536877f024b606756c6a3289c6ddfdba423a60d6
* gui: Move action functions to function pointer map.that2014-12-301-5/+68
| | | | | | | | | | | | | | | | This allows the functions to be more readable and make doActions readable. Patch set 5: gui: remove threading in GUIAction Multiple actions were started in another thread that was joined immediately after starting it, so the input thread was blocked anyway. Selected single actions were started in their own thread, but this caused bugs like being able to install the same package twice in parallel by quickly swiping the slider twice. Change-Id: I28adadaedd032efc7bff3aaa48e659627aa3a3b3
* Use one mizip for allEthan Yonker2014-12-101-8/+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
* Add possibility to use images as background or handle of slidevalueVojtech Bocek2014-08-071-1/+5
| | | | | | | | | | * Add tag <resource background="x" handle="y" handlehover="z" /> to the slidervalue object. * All images are optional, e.g. you can use just handle or just background image or no images whatsoever Change-Id: Ie0fee92965c6e883c4e532732756008dcc9e385e Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
* Color in the consoleEthan Yonker2014-07-091-0/+1
| | | | | | | | Allow each gui_print command to specify a color Change LOGERR to use the error color Theme should specify colors for error, warning, and highlight Change-Id: Ie8ece34111f604e25fcb79e5b731cd4e61038ff9
* Add support for actions triggered by key combinationVojtech Bocek2014-04-161-3/+9
| | | | | Change-Id: I9dfa7de40229f00412d63fc9c1eb3a809a6eb2e6 Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
* Add word wrap to console output and fix scrolling in consoleDees Troy2014-02-261-1/+3
| | | | Change-Id: Ibcf89952ee1391350c715f1ec82cf0cdb9b0ca7d
* Add capslock support to keyboardEthan Yonker2014-02-171-1/+9
| | | | Change-Id: I4be3849ff0485536575395d798aa5edbe12651a7
* Cache results of GUIObject::isConditionTrue()Vojtech Bocek2014-02-121-13/+19
| | | | | | Signed-off-by: Vojtech Bocek <vbocek@gmail.com> Change-Id: Ia50f7c365b2dc0a65ee046bb42972e3594264878
* Conditional -> GUIObject and make all gui objects children of GUIObjectVojtech Bocek2014-02-121-18/+19
| | | | | | Signed-off-by: Vojtech Bocek <vbocek@gmail.com> Change-Id: Ic0a7d6354dabe5919b83942f2f1aa0715625e522
* Implement mouse cursorVojtech Bocek2014-02-071-0/+25
| | | | | | Signed-off-by: Vojtech Bocek <vbocek@gmail.com> Change-Id: I66d6db7b3ed9cca50b469d125b36224332e06913
* Add haptic feedbackSamer Diab (S.a.M.e.R_d)2014-02-061-0/+2
| | | | Change-Id: I15d723f73c0b0bb4a40645d1c3f4c1c616f36998
* Update licenses to all matchDees Troy2013-10-221-1/+2
|
* Add conditions support to GUIImageVojtech Bocek2013-10-111-1/+1
| | | | Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
* Pull ROM info from build.prop for backup namesDees Troy2013-09-121-0/+1
| | | | Change-Id: I7847fca22b5d4f0a35da41625b15bd677a1e9768
* Kang in older minzip for building in CM9 & CM7Dees Troy2013-09-101-0/+4
| | | | CM7 and CM9 do not have libselinux needed in the newer minzip.
* Unify indentation and little clean-up in TWRP filesVojtech Bocek2013-08-241-410/+405
| | | | Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
* Add new SliderValue GUI widgetVojtech Bocek2013-04-041-0/+66
| | | | | | Signed-off-by: Vojtech Bocek <vbocek@gmail.com> Change-Id: Ic5d44314f501341140dd7059d1cb753341f5844c
* Add partition list GUI elementDees_Troy2013-03-301-0/+106
| | | | | | | | | | | | 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
* Remove mutex from file seselectorDees_Troy2013-03-111-1/+0
| | | | | | | | | | mutex would, in some rare cases fail to lock and cause a freeze of the GUI. Also restored some code that was removed before and should not have been removed to fix a bug with folder selection where you select the same file or folder twice (e.g. select a backup on the restore page, press back, then select that backup again.)
* More file selector fixesDees_Troy2013-03-041-0/+1
| | | | | | | | Fix a freeze that occurs when you move or delete a file in the file manager Make file sort buttons work again Change-Id: Ifcb68edf3c29c475946d538748729485d0840842
* Fix file selector crashDees_Troy2013-02-281-0/+1
| | | | | | | | Sometimes a var change event came in while the file selector was being rendered. Changes to the mFolderList or mFileList vectors sometimes resulted in a crash. This patch set moves the GetFileList call to the Render function to prevent the vectors from changing while the render is taking place.
* Copy fast scroll feature to listboxDees_Troy2013-02-271-0/+8
|
* Add fast scroll bar to fileselectorVojtech Bocek2013-02-271-0/+8
| | | | | | | Also fix build problems with libblkid in CM7 Signed-off-by: Vojtech Bocek <vbocek@gmail.com> Change-Id: I1cd4573e25b247171e4bd8cc05b70543f897a454
* Update listbox codeDees_Troy2013-02-151-2/+22
|
* Add highlight to file selectorDees_Troy2013-02-151-0/+6
|
* Add button highlightDees_Troy2013-02-151-0/+3
|
* Add keyboard key highlightDees_Troy2012-10-201-0/+2
|
* Add ability for buttons to have highlights on touchDees_Troy2012-10-191-0/+9
|
* Zip install works againDees_Troy2012-09-111-1/+1
|
* TWRP-ify AOSP codeDees_Troy2012-09-051-0/+753
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