diff --git a/.clang-format b/.clang-format index 335adde5d..73dfe5479 100644 --- a/.clang-format +++ b/.clang-format @@ -134,7 +134,7 @@ SpacesInCStyleCastParentheses: false SpacesInParentheses: false SpacesInSquareBrackets: false SpaceBeforeSquareBrackets: false -Standard: c++14 +Standard: c++17 StatementMacros: - Q_UNUSED - QT_REQUIRE_VERSION diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c0757c58..3af834783 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,8 +11,8 @@ ### Detailed list of changes * Added alternative emulators support where additional emulators can be defined in es_systems.xml and be selected system-wide or per game via the user interface -* Populated the bundled es_systems.xml files with alternative emulator entries for must RetroArch cores -* Added a virtual keyboard partly based on code from batocera-emulationstation +* Populated the bundled es_systems.xml files with alternative emulator entries for most RetroArch cores +* Added a virtual keyboard, partly based on code from batocera-emulationstation * Added the ability to make complementary game system customizations without having to replace the entire bundled es_systems.xml file * Added support for an optional \ tag for es_systems.xml that can be used to override the default \ systems sorting * Improved the gamelist filter screen to not allow filtering of values where there is no actual data to filter, e.g. Favorites for a system with no favorite games @@ -20,7 +20,11 @@ * Added the ability to filter on blank/unknown values for Genre, Player, Developer, Publisher and Alternative emulator. * Added a filter for "Alternative emulator" and sorted the filters in the same order as the metadata editor fields * Added a menu option to change the application exit key combination +* Lowered the minimum supported screen resolution from 640x480 to 224x224 to support arcade cabinet displays such as those running at 384x224 and 224x384 * Expanded the themeable options for "helpsystem" to support custom button graphics, dimmed text and icon colors, upper/lower/camel case and custom spacing +* Made the scrolling speed of ScrollableContainer more consistent across various screen resolutions and display aspect ratios +* Made the game name and description stop scrolling when running the media viewer, the screensaver or when running in the background while a game is launched +* Added notification popups when plugging in or removing controllers * Added support for using the left and right trigger buttons in the help prompts * Removed the "Choose" entry from the help prompts in the gamelist view * Changed the "Toggle screensaver" help entry in the system view to simply "Screensaver" @@ -31,14 +35,21 @@ * Added a blinking cursor to TextEditComponent * Changed the filter description "Text filter (game name)" to "Game name" * Added support for multi-select total count and exclusive multi-select to OptionListComponent +* Added support for key repeat to OptionListComponent, making it possible to cycle through the options by holding the left or right button +* Added key repeat for the "Jump to" and "Sort games by" selectors on the game options menu +* Added key repeat when editing the "Release date" entry in the metadata editor (DateTimeEditComponent) * Achieved a massive speed improvement for OptionListComponent by not resizing each added MenuComponent row (most notable in the filter GUI) +* Made multiple optimizations to the GUI components by removing lots of unnecessary function calls for sizing, placement, opacity changes etc. +* Simplified the logic for info popups and prepared the code for the future "multiple popups" feature * Added support for a new type of "flat style" button to ButtonComponent * Added support for correctly navigating arbitrarily sized ComponentGrid entries, i.e. those spanning multiple cells * Bundled the bold font version of Fontfabric Akrobat +* Added RapidJSON as a Git subtree * Added the GLM (OpenGL Mathematics) library as a Git subtree * Replaced all built-in matrix and vector data types and functions with GLM library equivalents * Replaced some additional math functions and moved the remaining built-in functions to a math utility namespace * Added a function to generate MD5 hashes +* Made an optimization for SVG graphics to avoid a lot of unnecessary re-rasterizations * Moved the "complex" mode functionality from GuiComplexTextEditPopup into GuiTextEditPopup and removed the source files for the former * Replaced the String::Utils::trim function with better code and removed some inline text trimming throughout the application * Increased the warning level for Clang/LLVM and GCC by adding -Wall, -Wpedantic and some additional flags @@ -49,16 +60,22 @@ ### Bug fixes -* When multi-scraping in interactive mode with "Auto-accept single game matches" enabled, the game name could not be refined if there were no games found -* When multi-scraping in interactive mode, the game counter was not decreased when skipping games, making it impossible to skip the final games in the queue -* When multi-scraping in interactive mode, "No games found" results could be accepted using the "A" button +* Setting a really small font size in a theme would crash the application +* When scraping in interactive mode with "Auto-accept single game matches" enabled, the game name could not be refined if there were no games found +* When scraping in interactive mode, the game counter was not decreased when skipping games, making it impossible to skip the final games in the queue +* When scraping in interactive mode, "No games found" results could be accepted using the "A" button * When scraping in interactive mode, any refining done using the "Y" button shortcut would not be shown when doing another refine using the "Refine search" button +* Under some circumstances ScrollableContainer (used for the game descriptions) would contain a partially rendered bottom line +* If the TextListComponent height was not evenly dividable by the font height + line spacing, a partial bottom row would get rendered +* The line spacing for TextListComponent was incorrectly calculated for some resolutions such as 2560x1440 * Removing games from custom collections did not remove their filter index entries * Input consisting of only whitespace characters would get accepted by TextEditComponent which led to various strange behaviors * Leading and trailing whitespace characters would not get trimmed from the collection name when creating a new custom collection * Leading and trailing whitespace characters would get included in scraper search refines and TheGamesDB searches * Game name (text) filters were matching the system names for collection systems if the "Show system names in collections" setting was enabled * Brackets such as () and [] were filtered from game names in collection systems if the "Show system names in collections" setting was enabled +* Help prompts were missing for the "Rating" and "Release date" fields in the metadata editor +* There was some strange behavior in DateTimeEditComponent when changing the date all the way down to 1970-01-01 * When navigating menus, the separator lines and menu components did not align properly and moved up and down slightly * When scrolling in menus, pressing other buttons than "Up" or "Down" did not stop the scrolling which caused all sorts of weird behavior * With the menu scale-up effect enabled and entering a submenu before the parent menu was completely scaled up, the parent would get stuck at a semi-scaled size diff --git a/CMake/Packages/FindRapidJSON.cmake b/CMake/Packages/FindRapidJSON.cmake deleted file mode 100644 index 609c3727b..000000000 --- a/CMake/Packages/FindRapidJSON.cmake +++ /dev/null @@ -1,28 +0,0 @@ - -# Find the RapidJSON parsing library. -# -# Sets the usual variables expected for find_package scripts: -# -# RAPIDJSON_INCLUDE_DIR - header location -# RAPIDJSON_FOUND - true if RAPIDJSON was found. - -include(FindPkgMacros) - -if (NOT WIN32) - find_package(PkgConfig) - pkg_check_modules(RAPIDJSON REQUIRED RapidJSON>=1.0.0) -endif (NOT WIN32) - -if (WIN32) - find_path(RAPIDJSON_INCLUDE_DIR rapidjson/rapidjson.h) - -# Support the REQUIRED and QUIET arguments, and set RAPIDJSON_FOUND if found. -include (FindPackageHandleStandardArgs) - -find_package_handle_standard_args(RAPIDJSON DEFAULT_MSG RAPIDJSON_INCLUDE_DIR) - -if (NOT RAPIDJSON_INCLUDE_DIR) - message(FATAL_ERROR "RapidJSON include files not found!") -endif() - -endif (WIN32) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1c8ff03b2..08e7418a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -90,7 +90,6 @@ if(NOT WIN32) find_package(FreeImage REQUIRED) find_package(Freetype REQUIRED) find_package(Pugixml REQUIRED) - find_package(RapidJSON REQUIRED) find_package(SDL2 REQUIRED) if(VLC_PLAYER) find_package(VLC REQUIRED) @@ -243,11 +242,11 @@ set(COMMON_INCLUDE_DIRS ${CURL_INCLUDE_DIR} ${FreeImage_INCLUDE_DIRS} ${FREETYPE_INCLUDE_DIRS} ${PUGIXML_INCLUDE_DIRS} - ${RAPIDJSON_INCLUDE_DIRS} ${SDL2_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/external/CImg ${CMAKE_CURRENT_SOURCE_DIR}/external/glm ${CMAKE_CURRENT_SOURCE_DIR}/external/nanosvg/src + ${CMAKE_CURRENT_SOURCE_DIR}/external/rapidjson/include ${CMAKE_CURRENT_SOURCE_DIR}/es-core/src) if(VLC_PLAYER) set(COMMON_INCLUDE_DIRS ${COMMON_INCLUDE_DIRS} ${VLC_INCLUDE_DIR}) diff --git a/INSTALL-DEV.md b/INSTALL-DEV.md index f3af62b19..cd33d350f 100644 --- a/INSTALL-DEV.md +++ b/INSTALL-DEV.md @@ -27,7 +27,7 @@ There are some dependencies that need to be fulfilled in order to build ES-DE. T All of the required packages can be installed with apt-get: ``` -sudo apt-get install build-essential clang-format git cmake libsdl2-dev libavcodec-dev libavfilter-dev libavformat-dev libavutil-dev libfreeimage-dev libfreetype6-dev libcurl4-openssl-dev libpugixml-dev rapidjson-dev libasound2-dev libgl1-mesa-dev +sudo apt-get install build-essential clang-format git cmake libsdl2-dev libavcodec-dev libavfilter-dev libavformat-dev libavutil-dev libfreeimage-dev libfreetype6-dev libcurl4-openssl-dev libpugixml-dev libasound2-dev libgl1-mesa-dev ``` If building with the optional VLC video player, the following packages are also needed: @@ -39,7 +39,7 @@ sudo apt-get install vlc libvlc-dev Use dnf to install all the required packages: ``` -sudo dnf install gcc-c++ clang-tools-extra cmake SDL2-devel ffmpeg-devel freeimage-devel freetype-devel curl-devel pugixml-devel rapidjson-devel alsa-lib-devel mesa-libGL-devel +sudo dnf install gcc-c++ clang-tools-extra cmake SDL2-devel ffmpeg-devel freeimage-devel freetype-devel curl-devel pugixml-devel alsa-lib-devel mesa-libGL-devel ``` If building with the VLC video player, add the RPM Fusion repository. @@ -56,7 +56,7 @@ sudo dnf install vlc vlc-devel Use pacman to install all the required packages: ``` -sudo pacman -S gcc clang make cmake pkgconf sdl2 ffmpeg freeimage freetype2 pugixml rapidjson +sudo pacman -S gcc clang make cmake pkgconf sdl2 ffmpeg freeimage freetype2 pugixml ``` If building with the optional VLC video player, the following package is also needed: @@ -70,7 +70,7 @@ Note: The Raspberry Pi 4 is the minimum recommended model to use with ES-DE. As All of the required packages can be installed with apt-get: ``` -sudo apt-get install clang-format cmake libsdl2-dev libavcodec-dev libavfilter-dev libavformat-dev libavutil-dev libfreeimage-dev libcurl4-gnutls-dev libpugixml-dev rapidjson-dev +sudo apt-get install clang-format cmake libsdl2-dev libavcodec-dev libavfilter-dev libavformat-dev libavutil-dev libfreeimage-dev libcurl4-gnutls-dev libpugixml-dev ``` If building with the optional VLC video player, the following packages are also needed: @@ -87,7 +87,7 @@ sudo apt-get install libcec-dev libp8-platform-dev Use pkg to install the dependencies: ``` -pkg install git pkgconf cmake sdl2 ffmpeg freeimage pugixml rapidjson +pkg install git pkgconf cmake sdl2 ffmpeg freeimage pugixml ``` If building with the optional VLC video player, the following package is also needed: @@ -101,7 +101,7 @@ Clang/LLVM and cURL should already be included in the base OS installation. Use pkgin to install the dependencies: ``` -pkgin install clang git cmake pkgconf SDL2 ffmpeg4 freeimage pugixml rapidjson +pkgin install clang git cmake pkgconf SDL2 ffmpeg4 freeimage pugixml ``` If building with the optional VLC video player, the following package is also needed: @@ -125,16 +125,6 @@ pkg_add vlc In the same manner as for FreeBSD, Clang/LLVM and cURL should already be installed by default. -RapidJSON is not part of the OpenBSD ports/package collection as of v6.8, so you need to compile it yourself. At the time of writing, the latest release v1.1.0 does not compile on OpenBSD, so you need to use the latest available code from the master branch: - -``` -git clone https://github.com/Tencent/rapidjson.git -cd rapidjson -cmake . -make -make install -``` - Pugixml does exist in the package collection but somehow this version is not properly detected by CMake, so you need to compile this manually as well: ``` @@ -440,7 +430,7 @@ Be aware that Homebrew can be really slow, especially when it compiles packages Install the required tools and dependencies: ``` -brew install clang-format cmake pkg-config nasm fdk-aac libvpx sdl2 freeimage freetype pugixml rapidjson +brew install clang-format cmake pkg-config nasm fdk-aac libvpx sdl2 freeimage freetype pugixml ``` If building with the optional VLC video player, then run this as well: @@ -870,18 +860,6 @@ cmake -G "MinGW Makefiles" -DBUILD_SHARED_LIBS=ON . make ``` -[RapidJSON](http://rapidjson.org) - -For RapidJSON you don't need to compile anything, you just need the include files. - -At the time of writing, the latest release v1.1.0 generates some compiler warnings on Windows, but this can be avoided by using the latest available code from the master branch: - -``` -git clone git://github.com/Tencent/rapidjson.git -``` - - - **Clone the ES-DE repository:** This works the same as on Unix or macOS, just run the following: @@ -903,7 +881,7 @@ As there is no standardized include directory structure in Windows, you need to Make a directory in your build environment tree, for instance under `C:\Programming\include` -Copy the include files for cURL, FFmpeg, FreeImage, FreeType, GLEW, pugixml, RapidJSON, SDL2 and optionally VLC to this directory. +Copy the include files for cURL, FFmpeg, FreeImage, FreeType, GLEW, pugixml, SDL2 and optionally VLC to this directory. You may need to create the SDL2 directory manually and copy the header files there. @@ -924,7 +902,6 @@ libavformat/ libavutil/ pugiconfig.hpp pugixml.hpp -rapidjson/ SDL2/ vlc/ (only if building with the VLC video player) ``` diff --git a/THEMES-DEV.md b/THEMES-DEV.md index fc6c82f57..2cf350600 100644 --- a/THEMES-DEV.md +++ b/THEMES-DEV.md @@ -1,83 +1,90 @@ # EmulationStation Desktop Edition (ES-DE) v1.2 (development version) - Themes -**Note:** If creating theme sets specifically for ES-DE, please add `-DE` to the theme name, as in `rbsimple-DE`. Because the ES-DE theme support has already deviated somehow from the RetroPie EmulationStation fork and will continue to deviate further in the future, the theme set will likely not be backwards compatible. It would be confusing and annoying for a user that downloads and attempts to use an ES-DE theme set in another EmulationStation fork only to get crashes, error messages or corrupted graphics. At least the -DE extension is a visual indicator that it's an ES-DE specific theme set. +**Note:** This document is only relevant for the current ES-DE development version, if you would like to see the documentation for the latest stable release, refer to [THEMES.md](THEMES.md) instead. -Also note that this document is only relevant for the current ES-DE development version, if you would like to see the documentation for the latest stable release, refer to [THEMES.md](THEMES.md) instead. +If creating theme sets specifically for ES-DE, please add `-DE` to the theme name, as in `rbsimple-DE`. Because the ES-DE theme support has already deviated somehow from the RetroPie EmulationStation fork and will continue to deviate further in the future, the theme set will likely not be backwards compatible. It would be confusing and annoying for a user that downloads and attempts to use an ES-DE theme set in another EmulationStation fork only to get crashes, error messages or corrupted graphics. At least the -DE extension is a visual indicator that it's an ES-DE specific theme set. -ES-DE allows each system to have its own "theme." A theme is a collection **views** that define some **elements**, each with their own **properties**. +Table of contents: -The first place ES-DE will check for a theme is in the system's `` folder, for a theme.xml file: -* `[SYSTEM_PATH]/theme.xml` +[[_TOC_]] -If that file doesn't exist, ES-DE will try to find the theme in the current **theme set**. Theme sets are just a collection of individual system themes arranged in the "themes" folder under some name. A theme set can provide a default theme that will be used if there is no matching system theme. Here's an example: +## Introduction + +ES-DE allows the grouping of themes for multiple game systems into a **theme set**. Each theme is a collection of **views** that define some **elements**, each with their own **properties**. + +Every game system has its own subdirectory within the theme set directory structure, and these are defined in the systems configuration file `es_systems.xml` either via the optional `` tag, or otherwise via the mandatory `` tag. When ES-DE populates a system on startup it will look for a file named `theme.xml` in each such directory. + +By placing a theme.xml file directly in the root of the theme set directory, that file will be processed as a default if there is no game-specific theme.xml file available. + +In the example below, we have a theme set named `mythemeset-DE` which includes the `snes` and `nes` systems. Assuming you have some games installed for these systems, the files `mythemeset-DE/nes/theme.xml` and `mythemeset-DE/snes/theme.xml` will be processed on startup. If there are no games available for a system, its theme.xml file will be skipped. + +The directory structure of our example theme set could look something like the following: ``` ... themes/ - my_theme_set/ - snes/ - theme.xml - my_cool_background.jpg + mythemeset-DE/ + core/ + font.ttf + bold_font.ttf + frame.png nes/ theme.xml - my_other_super_cool_background.jpg + background.jpg + logo.svg + logo_video.svg - common_resources/ - my_font.ttf - - theme.xml (Default theme) - another_theme_set/ snes/ theme.xml - some_resource.svg + background.jpg + logo.svg + logo_video.svg + + fonts.xml + theme.xml ``` -The theme set system makes it easy for users to try different themes and allows distributions to include multiple theme options. Users can change the currently active theme set in the "UI Settings" menu. The option is only visible if at least one theme set exists. +The theme set approach makes it easy for users to install different themes and choose between them from the _UI Settings_ menu. -There are two places ES-DE can load theme sets from: -* `[HOME]/.emulationstation/themes/[CURRENT_THEME_SET]/[SYSTEM_THEME]/theme.xml` -* `[INSTALLATION PATH]/themes/[CURRENT_THEME_SET]/[SYSTEM_THEME]/theme.xml` +There are two places that ES-DE can load theme sets from: +* `[HOME]/.emulationstation/themes/[THEME_SET]/` +* `[INSTALLATION PATH]/themes/[THEME_SET]/` An example installation path would be: \ -`/usr/share/emulationstation/themes/[CURRENT_THEME_SET]/[SYSTEM_THEME]/theme.xml` +`/usr/share/emulationstation/themes/rbsimple-DE/` -`[SYSTEM_THEME]` is the `` tag for the system, as defined in `es_systems.cfg`. If the `` tag is not set, ES-DE will use the system's ``. +If a theme set with the same name exists in both locations, the one in the home directory will be loaded and the other one will be skipped. -If both files happen to exist, ES-DE will pick the first one (the one located in the home directory). +## Simple example -Again, the `[CURRENT_THEME_SET]` value is set in the "UI Settings" menu. If it has not been set yet or the previously selected theme set is missing, the first available theme set will be used as the default. - -# Simple Example - -Here is a very simple theme that changes the description text's color: +Here is a very simple theme that changes the color of the game description text: ```xml - 7 00FF00 - + 0.5 0.5 0.5 0.5 0.8 0.8 - ./my_art/my_awesome_image.jpg + ./core/frame.png ``` -# How it works +## How it works -Everything must be inside a `` tag. +All configuration must be contained within a `` tag pair. -**The `` tag *must* be specified**. This is the version of the theming system the theme was designed for. +The `` tag **must** be specified. This is the version of the theming system the theme was designed for. The current version is 7. -A *view* can be thought of as a particular "screen" within EmulationStation. Views are defined like this: +A _view_ can be thought of as a particular "screen" within ES-DE. Views are defined like this: ```xml @@ -85,63 +92,61 @@ A *view* can be thought of as a particular "screen" within EmulationStation. Vie ``` - - -An *element* is a particular visual element, such as an image or a piece of text. You can either modify an element that already exists for a particular view (as is done in the "description" example), like this: +An *element* is a particular visual element, such as an image or a piece of text. You can modify an element that already exists for a particular view, as was done for the "description" example: ```xml - - ... define properties here ... - + + ... define properties here ... + ``` -Or, you can create your own elements by adding `extra="true"` (as is done in the "my_image" example) like this: +Or you can create your own elements by adding `extra="true"`, as was done for the "frame" example: ```xml - - ... define properties here ... - + + ... define properties here ... + ``` -"Extra" elements will be drawn in the order they are defined (so define backgrounds first!). When they get drawn relative to the pre-existing elements depends on the view. Make sure "extra" element names do not clash with existing element names! An easy way to protect against this is to just start all your extra element names with some prefix like "e_". +"Extra" elements will be drawn in the order they are defined (so make sure to define backgrounds first). In what order they get drawn relative to the pre-existing elements depends on the view. Make sure "extra" element names do not clash with existing element names. An easy way to protect against this is to start all your extra element names with a prefix such as "e_". -*Properties* control how a particular *element* looks - for example, its position, size, image path, etc. The type of the property determines what kinds of values you can use. You can read about the types below in the "Reference" section. Properties are defined like this: +*Properties* control how a particular *element* looks - for example its position, size, image path etc. The type of the property determines what kinds of values you can use. You can read about the types below in the "Reference" section. Properties are defined like this: ```xml - ValueHere +ValueHere ``` -# Advanced Features +## Advanced features -It is recommended that if you are writing a theme you launch EmulationStation with the `--debug` and `--windowed` switches. This way you can read error messages without having to check the log file. You can also reload the current gamelist view and system view with `Ctrl-R` if `--debug` is specified. +If you are writing a theme it's recommended to launch ES-DE with the `--debug` flag from a terminal window. If on Unix you can also pass the `--windowed` and `--resolution` flags to avoid having the application window fill the entire screen. On macOS and Windows you only need to pass the `--resolution` flag to accomplish this. By doing so, you can read error messages directly in the terminal window without having to open the log file. You can also reload the current gamelist view and system view with `Ctrl-R` if the `--debug` flag has been set. -### The `` tag +### The \ tag -You can include theme files within theme files, similar to `#include` in C (though the internal mechanism is different, the effect is the same). Example: +You can include theme files within theme files, for example: -`~/.emulationstation/all_themes.xml`: +`~/.emulationstation/themes/mythemeset-DE/fonts.xml`: ```xml - 7 - ./all_themes/myfont.ttf + ./core/font.ttf + 0.035 00FF00 ``` -`~/.emulationstation/snes/theme.xml`: +`~/.emulationstation/themes/mythemeset-DE/snes/theme.xml`: ```xml 7 - ./../all_themes.xml + ./../fonts.xml FF0000 @@ -150,84 +155,77 @@ You can include theme files within theme files, similar to `#include` in C (thou ``` -Is equivalent to this `snes/theme.xml`: +The above is equivalent to the following: ```xml 7 - ./all_themes/myfont.ttf + ./core/font.ttf + 0.035 FF0000 ``` -Notice that properties that were not specified got merged (``) and the `snes/theme.xml` could overwrite the included files' values (``). Also notice the included file still needed the `` tag. +Note that properties can get merged. In the above example the `` tag from `fonts.xml` got overwritten by the equivalent tag in `snes/theme.xml`. This happens because that tag was effectively declared after the first `` tag. Be aware that the included file also needs the `` tag. ### Theming multiple views simultaneously -Sometimes you want to apply the same properties to the same elements across multiple views. The `name` attribute actually works as a list (delimited by any characters of `\t\r\n ,` - that is, whitespace and commas). So, for example, to easily apply the same header to the basic, grid, and system views: +Sometimes you want to apply the same properties to the same elements across multiple views. The `name` attribute actually works as a list (delimited by any characters of `\t\r\n ,` - that is, whitespace and commas). So for example, to apply the same logo to the basic and detailed views you could write the following: ```xml - 7 - + - ./snes_art/snes_header.png + ./snes/logo.svg - + - ./snes_art/snes_header_detailed.png + ./snes/logo_video.svg ``` -This is equivalent to: -```xml +The above is equivalent to: +```xml 7 - ./snes_art/snes_header.png + ./snes/logo.svg - ./snes_art/snes_header_detailed.png + ./snes/logo.svg - + - ./snes_art/snes_header.png + ./snes/logo_video.svg - - - ./snes_art/snes_header.png - - - ... and any other view that might try to look up "logo" ... ``` ### Theming multiple elements simultaneously -You can theme multiple elements *of the same type* simultaneously. The `name` attribute actually works as a list (delimited by any characters of `\t\r\n ,` - that is, whitespace and commas), just like it does for views, as long as the elements have the same type. This is useful if you want to, say, apply the same color to all the metadata labels: +You can theme multiple elements *of the same type* simultaneously. The `name` attribute actually works as a list (delimited by any characters of `\t\r\n ,` - that is, whitespace and commas). This is useful if you want to, say, apply the same color to all the metadata labels: ```xml - 7 - + 48474D @@ -238,7 +236,6 @@ You can theme multiple elements *of the same type* simultaneously. The `name` a Which is equivalent to: ```xml - 7 @@ -270,20 +267,16 @@ Which is equivalent to: ``` -Just remember, *this only works if the elements have the same type!* - -### Element rendering order with z-index - -You can now change the order in which elements are rendered by setting `zIndex` values. Default values correspond to the default rendering order while allowing elements to easily be shifted without having to set `zIndex` values for every element. Elements will be rendered in order from smallest z-index to largest. +Just remember, _this only works if the elements have the same type._ -#### Navigation sounds +### Navigation sounds -The navigation sounds are configured globally per theme set, so it needs to be defined as a feature and with the view set to the special 'all' category. +Navigation sounds are configured globally per theme set, so it needs to be defined as a feature and with the view set to the special "all" category. It's recommended to put these elements in a separate file and include it from the main theme file (e.g. `./navigationsounds.xml`). There are seven different navigation sounds that can be configured. The names as well as the element structure should be self-explanatory based on the example below. -Starting EmulationStation with the --debug flag will provide feedback on whether any navigation sound elements were read from the theme set. If no navigation sound is provided by the theme, ES-DE will use the bundled navigation sound file as a fallback. This is done per sound, so the theme could provide for example one or two custom sound files while using the bundled ES-DE sounds for the other samples. +Starting ES-DE with the --debug flag will provide feedback on whether any navigation sound elements were read from the theme set. If no navigation sounds are provided by the theme, ES-DE will use the bundled navigation sounds as a fallback. This is done per sound file, so the theme could provide for example one or two custom sounds while using the bundled ES-DE sounds for the rest. Example debug output: ``` @@ -297,7 +290,6 @@ Jul 12 11:28:58 Debug: Sound::getFromTheme(): Tag not found, using fallback sou Example `navigationsounds.xml`, to be included from the main theme file: ```xml - 7 @@ -328,14 +320,18 @@ Example `navigationsounds.xml`, to be included from the main theme file: ``` -#### Defaults +### Element rendering order using zIndex -##### system +You can change the order in which elements are rendered by setting their `zIndex` values. All elements have a default value so you only need to define it for the ones you wish to explicitly change. Elements will be rendered in order from smallest to largest values. + +Below are the default zIndex values per element type: + +#### system * Extra Elements `extra="true"` - 10 * `carousel name="systemcarousel"` - 40 * `text name="systemInfo"` - 50 -##### basic, detailed, grid, video +#### basic, detailed, video, grid * `image name="background"` - 0 * Extra Elements `extra="true"` - 10 * `textlist name="gamelist"` - 20 @@ -366,25 +362,27 @@ Example `navigationsounds.xml`, to be included from the main theme file: * `text name="md_description"` * `text name="md_name"` * System Logo/Text - 50 - * `text name="logoText"` * `image name="logo"` + * `text name="logoText"` + * `image name="logoPlaceholderImage"` + * `text name="logoPlaceholderText"` * Gamelist information - 50 * `text name="gamelistInfo"` ### Theme variables Theme variables can be used to simplify theme construction. There are 2 types of variables available. -* System Variables -* Theme Defined Variables +* System variables +* Theme defined variables -#### System Variables +#### System variables -System variables are system specific and are derived from the values in es_systems.cfg. +System variables are system specific and are derived from the values in es_systems.xml. * `system.name` * `system.fullName` * `system.theme` -#### Theme Defined Variables +#### Theme defined variables Variables can also be defined in the theme. ``` @@ -406,9 +404,32 @@ or to specify only a portion of the value of a theme property: ```` -# Reference +## Reference + +### Views, their elements, and themeable properties + +#### system + +* `helpsystem name="help"` - ALL + - The help system style for this view. +* `carousel name="systemcarousel"` - ALL + - The system logo carousel +* `image name="logo"` - PATH | COLOR + - A logo image, to be displayed in the system logo carousel. +* `image name="logoPlaceholderImage"` - ALL + - A logo image, to be displayed system name in the system logo carousel when no logo is available. Set the position + to `0.5 0.5` to center the image. +* `text name="logoPlaceholderText"` - ALL + - Logo text, to be displayed system name in the system logo carousel when no logo is available. The logo text is + displayed on top of `logoPlaceholderImage`. Set the position to `0.5 0.5` to center the text. +* `text name="logoText"` - FONT_PATH | COLOR | FORCE_UPPERCASE | LINE_SPACING | TEXT + - **Deprecated:** A logo text, to be displayed system name in the system logo carousel when no logo is available. + Ignored when `logoPlaceholderImage` or `logoPlaceholderText` are set. +* `text name="systemInfo"` - ALL + - Displays details of the system currently selected in the carousel. +* You can use extra elements (elements with `extra="true"`) to add your own backgrounds, etc. They will be displayed + behind the carousel, and scroll relative to the carousel. -## Views, their elements, and themeable properties: #### basic * `helpsystem name="help"` - ALL @@ -422,7 +443,6 @@ or to specify only a portion of the value of a theme property: * `textlist name="gamelist"` - ALL - The gamelist. `primaryColor` is for games, `secondaryColor` is for folders. Centered by default. ---- #### detailed * `helpsystem name="help"` - ALL @@ -438,8 +458,8 @@ or to specify only a portion of the value of a theme property: * `text name="gamelistInfo"` - ALL - Displays the game count (all games as well as favorites), any applied filters, and a folder icon if a folder has been entered. If this text is left aligned, the folder icon will be placed to the right of the other information, and if it's right aligned, the folder icon will be placed to the left. Left aligned by default. -* Metadata - * Labels +- Metadata + - Labels * `text name="md_lbl_rating"` - ALL * `text name="md_lbl_releasedate"` - ALL * `text name="md_lbl_developer"` - ALL @@ -450,8 +470,7 @@ or to specify only a portion of the value of a theme property: * `text name="md_lbl_playcount"` - ALL * Values - * All values will follow to the right of their labels if a position isn't specified. - + - _All values will follow to the right of their labels if a position isn't specified._ * `image name="md_image"` - POSITION | SIZE | Z_INDEX - Path is the "image" metadata for the currently selected game. * `rating name="md_rating"` - ALL @@ -477,6 +496,7 @@ or to specify only a portion of the value of a theme property: * `text name="md_name"` - ALL - The "name" metadata (the game name). Unlike the others metadata fields, the name is positioned offscreen by default + #### video * `helpsystem name="help"` - ALL - The help system style for this view. @@ -491,8 +511,8 @@ or to specify only a portion of the value of a theme property: * `text name="gamelistInfo"` - ALL - Displays the game count (all games as well as favorites), any applied filters, and a folder icon if a folder has been entered. If this text is left aligned, the folder icon will be placed to the right of the other information, and if it's right aligned, the folder icon will be placed to the left. Left aligned by default. -* Metadata - * Labels +- Metadata + - Labels * `text name="md_lbl_rating"` - ALL * `text name="md_lbl_releasedate"` - ALL * `text name="md_lbl_developer"` - ALL @@ -503,8 +523,7 @@ or to specify only a portion of the value of a theme property: * `text name="md_lbl_playcount"` - ALL * Values - * All values will follow to the right of their labels if a position isn't specified. - + - _All values will follow to the right of their labels if a position isn't specified._ * `image name="md_image"` - POSITION | SIZE | Z_INDEX - Path is the "image" metadata for the currently selected game. * `image name="md_marquee"` - POSITION | SIZE | Z_INDEX @@ -534,7 +553,6 @@ or to specify only a portion of the value of a theme property: * `text name="md_name"` - ALL - The "name" metadata (the game name). Unlike the others metadata fields, the name is positioned offscreen by default ---- #### grid * `helpsystem name="help"` - ALL @@ -554,8 +572,8 @@ or to specify only a portion of the value of a theme property: * `text name="gamelistInfo"` - ALL - Displays the game count (all games as well as favorites), any applied filters, and a folder icon if a folder has been entered. If this text is left aligned, the folder icon will be placed to the right of the other information, and if it's right aligned, the folder icon will be placed to the left. Left aligned by default. -* Metadata - * Labels +- Metadata + - Labels * `text name="md_lbl_rating"` - ALL * `text name="md_lbl_releasedate"` - ALL * `text name="md_lbl_developer"` - ALL @@ -566,8 +584,7 @@ or to specify only a portion of the value of a theme property: * `text name="md_lbl_playcount"` - ALL * Values - * All values will follow to the right of their labels if a position isn't specified. - + - _All values will follow to the right of their labels if a position isn't specified._ * `rating name="md_rating"` - ALL - The "rating" metadata. * `datetime name="md_releasedate"` - ALL @@ -591,23 +608,8 @@ or to specify only a portion of the value of a theme property: * `text name="md_name"` - ALL - The "name" metadata (the game name). Unlike the others metadata fields, the name is positioned offscreen by default ---- -#### system -* `helpsystem name="help"` - ALL - - The help system style for this view. -* `carousel name="systemcarousel"` -ALL - - The system logo carousel -* `image name="logo"` - PATH | COLOR - - A logo image, to be displayed in the system logo carousel. -* `text name="logoText"` - FONT_PATH | COLOR | FORCE_UPPERCASE | LINE_SPACING | TEXT - - A logo text, to be displayed system name in the system logo carousel when no logo is available. -* `text name="systemInfo"` - ALL - - Displays details of the system currently selected in the carousel. -* You can use extra elements (elements with `extra="true"`) to add your own backgrounds, etc. They will be displayed behind the carousel, and scroll relative to the carousel. - - -## Types of properties: +### Types of properties * NORMALIZED_PAIR - two decimals, in the range [0..1], delimited by a space. For example, `0.25 0.5`. Most commonly used for position (x and y coordinates) and size (width and height). * NORMALIZED_RECT - four decimals, in the range [0..1], delimited by a space. For example, `0.25 0.5 0.10 0.30`. Most commonly used for padding to store top, left, bottom and right coordinates. @@ -618,7 +620,7 @@ or to specify only a portion of the value of a theme property: * STRING - a string of text. -## Types of elements and their properties: +### Types of elements and their properties Common to almost all elements is a `pos` and `size` property of the NORMALIZED_PAIR type. They are normalized in terms of their "parent" object's size; 99% of the time, this is just the size of the screen. In this case, `0 0` would correspond to the top left corner, and `1 1` the bottom right corner (a positive Y value points further down). `pos` almost always refers to the top left corner of your element. You *can* use numbers outside of the [0..1] range if you want to place an element partially or completely off-screen. @@ -803,7 +805,7 @@ Can be created as an extra. * `zIndex` - type: FLOAT. - z-index value for component. Components will be rendered in order of z-index value from low to high. -EmulationStation borrows the concept of "nine patches" from Android (or "9-Slices"). Currently the implementation is very simple and hard-coded to only use 48x48px images (16x16px for each "patch"). Check the `data/resources` directory for some examples (button.png, frame.png). +ES-DE borrows the concept of "nine patches" from Android (or "9-Slices"). Currently the implementation is very simple and hard-coded to only use 48x48px images (16x16px for each "patch"). Check the `data/resources` directory for some examples (button.png, frame.png). #### rating @@ -992,7 +994,9 @@ EmulationStation borrows the concept of "nine patches" from Android (or "9-Slice The help system is a special element that displays a context-sensitive list of actions the user can take at any time. You should try and keep the position constant throughout every screen. Keep in mind the "default" settings (including position) are used whenever the user opens a menu. -To see some examples of EmulationStation themes, the following resources are recommended: +## Example theme sets + +To see some example EmulationStation themes, the following resources are recommended: https://aloshi.com/emulationstation#themes diff --git a/THEMES.md b/THEMES.md index 32d86757b..062cfe412 100644 --- a/THEMES.md +++ b/THEMES.md @@ -40,7 +40,7 @@ There are two places ES-DE can load theme sets from: An example installation path would be: \ `/usr/share/emulationstation/themes/[CURRENT_THEME_SET]/[SYSTEM_THEME]/theme.xml` -`[SYSTEM_THEME]` is the `` tag for the system, as defined in `es_systems.cfg`. If the `` tag is not set, ES-DE will use the system's ``. +`[SYSTEM_THEME]` is the `` tag for the system, as defined in `es_systems.xml`. If the `` tag is not set, ES-DE will use the system's ``. If both files happen to exist, ES-DE will pick the first one (the one located in the home directory). @@ -74,7 +74,7 @@ Everything must be inside a `` tag. **The `` tag *must* be specified**. This is the version of the theming system the theme was designed for. The current version is 6. -A *view* can be thought of as a particular "screen" within EmulationStation. Views are defined like this: +A *view* can be thought of as a particular "screen" within ES-DE. Views are defined like this: ```xml @@ -112,7 +112,7 @@ Or, you can create your own elements by adding `extra="true"` (as is done in the # Advanced Features -It is recommended that if you are writing a theme you launch EmulationStation with the `--debug` and `--windowed` switches. This way you can read error messages without having to check the log file. You can also reload the current gamelist view and system view with `Ctrl-R` if `--debug` is specified. +It is recommended that if you are writing a theme you launch ES-DE with the `--debug` and `--windowed` switches. This way you can read error messages without having to check the log file. You can also reload the current gamelist view and system view with `Ctrl-R` if `--debug` is specified. ### The `` tag @@ -279,7 +279,7 @@ The navigation sounds are configured globally per theme set, so it needs to be d It's recommended to put these elements in a separate file and include it from the main theme file (e.g. `./navigationsounds.xml`). There are seven different navigation sounds that can be configured. The names as well as the element structure should be self-explanatory based on the example below. -Starting EmulationStation with the --debug flag will provide feedback on whether any navigation sound elements were read from the theme set. If no navigation sound is provided by the theme, ES-DE will use the bundled navigation sound file as a fallback. This is done per sound, so the theme could provide for example one or two custom sound files while using the bundled ES-DE sounds for the other samples. +Starting ES-DE with the --debug flag will provide feedback on whether any navigation sound elements were read from the theme set. If no navigation sound is provided by the theme, ES-DE will use the bundled navigation sound file as a fallback. This is done per sound, so the theme could provide for example one or two custom sound files while using the bundled ES-DE sounds for the other samples. Example debug output: ``` @@ -375,7 +375,7 @@ Theme variables can be used to simplify theme construction. There are 2 types o #### System Variables -System variables are system specific and are derived from the values in es_systems.cfg. +System variables are system specific and are derived from the values in es_systems.xml. * `system.name` * `system.fullName` * `system.theme` @@ -793,7 +793,7 @@ Can be created as an extra. * `zIndex` - type: FLOAT. - z-index value for component. Components will be rendered in order of z-index value from low to high. -EmulationStation borrows the concept of "nine patches" from Android (or "9-Slices"). Currently the implementation is very simple and hard-coded to only use 48x48px images (16x16px for each "patch"). Check the `data/resources` directory for some examples (button.png, frame.png). +ES-DE borrows the concept of "nine patches" from Android (or "9-Slices"). Currently the implementation is very simple and hard-coded to only use 48x48px images (16x16px for each "patch"). Check the `data/resources` directory for some examples (button.png, frame.png). #### rating diff --git a/es-app/CMakeLists.txt b/es-app/CMakeLists.txt index 9f4dbe7e1..3055f9479 100644 --- a/es-app/CMakeLists.txt +++ b/es-app/CMakeLists.txt @@ -30,7 +30,6 @@ set(ES_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiGamelistFilter.h ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiGamelistOptions.h ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiGameScraper.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiInfoPopup.h ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiLaunchScreen.h ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiMediaViewerOptions.h ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiMenu.h @@ -81,7 +80,6 @@ set(ES_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiGamelistFilter.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiGamelistOptions.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiGameScraper.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiInfoPopup.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiLaunchScreen.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiMenu.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiMediaViewerOptions.cpp diff --git a/es-app/src/CollectionSystemsManager.cpp b/es-app/src/CollectionSystemsManager.cpp index 43999865f..d6a7f90ec 100644 --- a/es-app/src/CollectionSystemsManager.cpp +++ b/es-app/src/CollectionSystemsManager.cpp @@ -27,7 +27,7 @@ #include "Settings.h" #include "SystemData.h" #include "ThemeData.h" -#include "guis/GuiInfoPopup.h" +#include "Window.h" #include "utils/FileSystemUtil.h" #include "utils/StringUtil.h" #include "utils/TimeUtil.h" @@ -385,14 +385,12 @@ void CollectionSystemsManager::updateCollectionSystem(FileData* file, Collection parentRootFolder->sort(parentRootFolder->getSortTypeFromString( parentRootFolder->getSortTypeString()), mFavoritesSorting); - GuiInfoPopup* s = new GuiInfoPopup( - mWindow, + mWindow->queueInfoPopup( "DISABLED '" + Utils::String::toUpper( Utils::String::removeParenthesis(file->getName())) + "' IN '" + Utils::String::toUpper(sysData.system->getName()) + "'", 4000); - mWindow->setInfoPopup(s); } else { ViewController::get()->getGameListView(curSys).get()->remove(collectionEntry, @@ -621,24 +619,18 @@ void CollectionSystemsManager::setEditMode(std::string collectionName, bool show mEditingCollectionSystemData = sysData; if (showPopup) { - GuiInfoPopup* s = new GuiInfoPopup(mWindow, - "EDITING '" + Utils::String::toUpper(collectionName) + - "' COLLECTION, ADD/REMOVE GAMES WITH 'Y'", - 10000); - - mWindow->setInfoPopup(s); + mWindow->queueInfoPopup("EDITING '" + Utils::String::toUpper(collectionName) + + "' COLLECTION, ADD/REMOVE GAMES WITH 'Y'", + 10000); } } void CollectionSystemsManager::exitEditMode(bool showPopup) { if (showPopup) { - GuiInfoPopup* s = new GuiInfoPopup( - mWindow, - "FINISHED EDITING '" + Utils::String::toUpper(mEditingCollection) + "' COLLECTION", - 4000); - - mWindow->setInfoPopup(s); + mWindow->queueInfoPopup("FINISHED EDITING '" + Utils::String::toUpper(mEditingCollection) + + "' COLLECTION", + 4000); } mIsEditingCustom = false; @@ -669,7 +661,6 @@ bool CollectionSystemsManager::inCustomCollection(const std::string& collectionN bool CollectionSystemsManager::toggleGameInCollection(FileData* file) { if (file->getType() == GAME) { - GuiInfoPopup* s; bool adding = true; std::string name = file->getName(); std::string sysName = mEditingCollection; @@ -743,20 +734,17 @@ bool CollectionSystemsManager::toggleGameInCollection(FileData* file) mAutoCollectionSystemsData["favorites"].system); } if (adding) { - s = new GuiInfoPopup( - mWindow, + mWindow->queueInfoPopup( "ADDED '" + Utils::String::toUpper(Utils::String::removeParenthesis(name)) + "' TO '" + Utils::String::toUpper(sysName) + "'", 4000); } else { - s = new GuiInfoPopup( - mWindow, + mWindow->queueInfoPopup( "REMOVED '" + Utils::String::toUpper(Utils::String::removeParenthesis(name)) + "' FROM '" + Utils::String::toUpper(sysName) + "'", 4000); } - mWindow->setInfoPopup(s); return true; } return false; @@ -952,9 +940,8 @@ void CollectionSystemsManager::deleteCustomCollection(std::string collectionName "configuration file '" << configFile << "'."; - GuiInfoPopup* s = new GuiInfoPopup( - mWindow, "DELETED COLLECTION '" + Utils::String::toUpper(collectionName) + "'", 5000); - mWindow->setInfoPopup(s); + mWindow->queueInfoPopup( + "DELETED COLLECTION '" + Utils::String::toUpper(collectionName) + "'", 5000); } else { LOG(LogError) << "Attempted to delete custom collection '" + collectionName + "' " + diff --git a/es-app/src/FileData.cpp b/es-app/src/FileData.cpp index 8b441da80..cc205a940 100644 --- a/es-app/src/FileData.cpp +++ b/es-app/src/FileData.cpp @@ -20,7 +20,6 @@ #include "Scripting.h" #include "SystemData.h" #include "Window.h" -#include "guis/GuiInfoPopup.h" #include "utils/FileSystemUtil.h" #include "utils/StringUtil.h" #include "utils/TimeUtil.h" @@ -856,9 +855,8 @@ void FileData::launchGame(Window* window) LOG(LogError) << "Raw emulator launch command:"; LOG(LogError) << commandRaw; - GuiInfoPopup* s = new GuiInfoPopup( - window, "ERROR: MISSING EMULATOR CONFIGURATION FOR '" + emulatorEntry + "'", 6000); - window->setInfoPopup(s); + window->queueInfoPopup("ERROR: MISSING EMULATOR CONFIGURATION FOR '" + emulatorEntry + "'", + 6000); return; } else if (binaryPath.empty()) { @@ -866,11 +864,8 @@ void FileData::launchGame(Window* window) LOG(LogError) << "Raw emulator launch command:"; LOG(LogError) << commandRaw; - GuiInfoPopup* s = new GuiInfoPopup(window, - "ERROR: COULDN'T FIND EMULATOR, HAS IT " - "BEEN PROPERLY INSTALLED?", - 6000); - window->setInfoPopup(s); + window->queueInfoPopup("ERROR: COULDN'T FIND EMULATOR, HAS IT BEEN PROPERLY INSTALLED?", + 6000); return; } else { @@ -914,12 +909,10 @@ void FileData::launchGame(Window* window) LOG(LogError) << "Raw emulator launch command:"; LOG(LogError) << commandRaw; - GuiInfoPopup* s = new GuiInfoPopup( - window, + window->queueInfoPopup( "ERROR: COULDN'T FIND EMULATOR CORE FILE '" + Utils::String::toUpper(Utils::FileSystem::getFileName(coreFile)) + "'", 6000); - window->setInfoPopup(s); return; } else { @@ -937,11 +930,7 @@ void FileData::launchGame(Window* window) LOG(LogError) << "Raw emulator launch command:"; LOG(LogError) << commandRaw; - GuiInfoPopup* s = new GuiInfoPopup(window, - "ERROR: INVALID ENTRY IN SYSTEMS " - "CONFIGURATION FILE", - 6000); - window->setInfoPopup(s); + window->queueInfoPopup("ERROR: INVALID ENTRY IN SYSTEMS CONFIGURATION FILE", 6000); return; } } @@ -953,9 +942,7 @@ void FileData::launchGame(Window* window) LOG(LogError) << "Raw emulator launch command:"; LOG(LogError) << commandRaw; - GuiInfoPopup* s = new GuiInfoPopup( - window, "ERROR: MISSING CORE CONFIGURATION FOR '" + coreEntry + "'", 6000); - window->setInfoPopup(s); + window->queueInfoPopup("ERROR: MISSING CORE CONFIGURATION FOR '" + coreEntry + "'", 6000); return; } @@ -1024,11 +1011,7 @@ void FileData::launchGame(Window* window) LOG(LogError) << "Raw emulator launch command:"; LOG(LogError) << commandRaw; - GuiInfoPopup* s = new GuiInfoPopup(window, - "ERROR: INVALID ENTRY IN SYSTEMS " - "CONFIGURATION FILE", - 6000); - window->setInfoPopup(s); + window->queueInfoPopup("ERROR: INVALID ENTRY IN SYSTEMS CONFIGURATION FILE", 6000); return; } } @@ -1041,12 +1024,10 @@ void FileData::launchGame(Window* window) << "Tried to find the core file using these paths as defined by es_find_rules.xml:"; LOG(LogError) << Utils::String::vectorToDelimitedString(emulatorCorePaths, ", "); - GuiInfoPopup* s = - new GuiInfoPopup(window, - "ERROR: COULDN'T FIND EMULATOR CORE FILE '" + - Utils::String::toUpper(coreName.substr(0, coreName.size()) + "'"), - 6000); - window->setInfoPopup(s); + window->queueInfoPopup( + "ERROR: COULDN'T FIND EMULATOR CORE FILE '" + + Utils::String::toUpper(coreName.substr(0, coreName.size()) + "'"), + 6000); return; } @@ -1087,12 +1068,10 @@ void FileData::launchGame(Window* window) if (returnValue != 0) { LOG(LogWarning) << "...launch terminated with nonzero return value " << returnValue; - GuiInfoPopup* s = new GuiInfoPopup( - window, - "ERROR LAUNCHING GAME '" + Utils::String::toUpper(metadata.get("name")) + - "' (ERROR CODE " + Utils::String::toUpper(std::to_string(returnValue) + ")"), - 6000); - window->setInfoPopup(s); + window->queueInfoPopup("ERROR LAUNCHING GAME '" + + Utils::String::toUpper(metadata.get("name")) + "' (ERROR CODE " + + Utils::String::toUpper(std::to_string(returnValue) + ")"), + 6000); } else { // Stop showing the game launch notification. @@ -1120,8 +1099,10 @@ void FileData::launchGame(Window* window) Scripting::fireEvent("game-end", romPath, getSourceFileData()->metadata.get("name")); - // Re-enable the text scrolling that was disabled in ViewController on game launch. - window->setAllowTextScrolling(true); + // Unless we're running in the background while the game is launched, re-enable the text + // scrolling that was disabled in ViewController. + if (!ViewController::get()->runInBackground(mSystem)) + window->setAllowTextScrolling(true); // Update number of times the game has been launched. FileData* gameToUpdate = getSourceFileData(); diff --git a/es-app/src/guis/GuiGamelistOptions.cpp b/es-app/src/guis/GuiGamelistOptions.cpp index b7cbbd1cb..7c457c4a5 100644 --- a/es-app/src/guis/GuiGamelistOptions.cpp +++ b/es-app/src/guis/GuiGamelistOptions.cpp @@ -99,6 +99,10 @@ GuiGamelistOptions::GuiGamelistOptions(Window* window, SystemData* system) mJumpToLetterList = std::make_shared(mWindow, getHelpStyle(), "JUMP TO...", false); + // Enable key repeat so that the left or right button can be held to cycle through + // the letters. + mJumpToLetterList->setKeyRepeat(true, 650, 200); + // Populate the quick selector. for (unsigned int i = 0; i < mFirstLetterIndex.size(); i++) { mJumpToLetterList->add(mFirstLetterIndex[i], mFirstLetterIndex[i], 0); @@ -128,10 +132,15 @@ GuiGamelistOptions::GuiGamelistOptions(Window* window, SystemData* system) for (unsigned int i = 0; i < numSortTypes; i++) { const FileData::SortType& sort = FileSorts::SortTypes.at(i); if (sort.description == sortType) - mListSort->add(sort.description, &sort, 1); + mListSort->add(sort.description, &sort, true); else - mListSort->add(sort.description, &sort, 0); + mListSort->add(sort.description, &sort, false); } + + // Enable key repeat so that the left or right button can be held to cycle through + // the sort options. + mListSort->setKeyRepeat(true, 650, 400); + // Don't show the sort type option if the gamelist type is recent/last played. if (system->getName() != "recent") mMenu.addWithLabel("SORT GAMES BY", mListSort); diff --git a/es-app/src/guis/GuiMenu.cpp b/es-app/src/guis/GuiMenu.cpp index 63090620b..74f707d68 100644 --- a/es-app/src/guis/GuiMenu.cpp +++ b/es-app/src/guis/GuiMenu.cpp @@ -102,31 +102,15 @@ void GuiMenu::openUIOptions() auto startup_system = std::make_shared>( mWindow, getHelpStyle(), "GAMELIST ON STARTUP", false); startup_system->add("NONE", "", Settings::getInstance()->getString("StartupSystem") == ""); - float dotsSize = Font::get(FONT_SIZE_MEDIUM)->sizeText("...").x; - for (auto it = SystemData::sSystemVector.cbegin(); it != SystemData::sSystemVector.cend(); - it++) { + for (auto it = SystemData::sSystemVector.cbegin(); // Line break. + it != SystemData::sSystemVector.cend(); it++) { if ((*it)->getName() != "retropie") { // If required, abbreviate the system name so it doesn't overlap the setting name. - std::string abbreviatedString = - Font::get(FONT_SIZE_MEDIUM)->getTextMaxWidth((*it)->getFullName(), mSize.x * 0.47f); - float sizeDifference = Font::get(FONT_SIZE_MEDIUM)->sizeText((*it)->getFullName()).x - - Font::get(FONT_SIZE_MEDIUM)->sizeText(abbreviatedString).x; - if (sizeDifference > 0.0f) { - // It doesn't make sense to abbreviate if the number of pixels removed by - // the abbreviation is less or equal to the size of the three dots that - // would be appended to the string. - if (sizeDifference <= dotsSize) { - abbreviatedString = (*it)->getFullName(); - } - else { - if (abbreviatedString.back() == ' ') - abbreviatedString.pop_back(); - abbreviatedString += "..."; - } - } - startup_system->add(abbreviatedString, (*it)->getName(), + float maxNameLength = mSize.x * 0.48f; + startup_system->add((*it)->getFullName(), (*it)->getName(), Settings::getInstance()->getString("StartupSystem") == - (*it)->getName()); + (*it)->getName(), + maxNameLength); } } s->addWithLabel("GAMELIST ON STARTUP", startup_system); @@ -190,8 +174,11 @@ void GuiMenu::openUIOptions() selectedSet = themeSets.cbegin(); auto theme_set = std::make_shared>(mWindow, getHelpStyle(), "THEME SET", false); - for (auto it = themeSets.cbegin(); it != themeSets.cend(); it++) - theme_set->add(it->first, it->first, it == selectedSet); + for (auto it = themeSets.cbegin(); it != themeSets.cend(); it++) { + // If required, abbreviate the theme set name so it doesn't overlap the setting name. + float maxNameLength = mSize.x * 0.62f; + theme_set->add(it->first, it->first, it == selectedSet, maxNameLength); + } s->addWithLabel("THEME SET", theme_set); s->addSaveFunc([this, theme_set, s] { if (theme_set->getSelected() != Settings::getInstance()->getString("ThemeSet")) { @@ -522,6 +509,18 @@ void GuiMenu::openUIOptions() } }); + // Enable menu scroll indicators. + auto scroll_indicators = std::make_shared(mWindow); + scroll_indicators->setState(Settings::getInstance()->getBool("ScrollIndicators")); + s->addWithLabel("ENABLE MENU SCROLL INDICATORS", scroll_indicators); + s->addSaveFunc([scroll_indicators, s] { + if (scroll_indicators->getState() != Settings::getInstance()->getBool("ScrollIndicators")) { + Settings::getInstance()->setBool("ScrollIndicators", scroll_indicators->getState()); + s->setNeedsSaving(); + s->setInvalidateCachedBackground(); + } + }); + // Enable the 'Y' button for tagging games as favorites. auto favorites_add_button = std::make_shared(mWindow); favorites_add_button->setState(Settings::getInstance()->getBool("FavoritesAddButton")); diff --git a/es-app/src/guis/GuiMetaDataEd.cpp b/es-app/src/guis/GuiMetaDataEd.cpp index 1c73698ab..ced319e6c 100644 --- a/es-app/src/guis/GuiMetaDataEd.cpp +++ b/es-app/src/guis/GuiMetaDataEd.cpp @@ -31,6 +31,8 @@ #include "utils/StringUtil.h" #include "views/ViewController.h" +#define TITLE_HEIGHT (mTitle->getFont()->getLetterHeight() + Renderer::getScreenHeight() * 0.060f) + GuiMetaDataEd::GuiMetaDataEd(Window* window, MetaDataList* md, const std::vector& mdd, @@ -39,25 +41,24 @@ GuiMetaDataEd::GuiMetaDataEd(Window* window, std::function saveCallback, std::function clearGameFunc, std::function deleteGameFunc) - : GuiComponent(window) - , mBackground(window, ":/graphics/frame.svg") - , mGrid(window, glm::ivec2{1, 3}) - , mScraperParams(scraperParams) - , mMetaDataDecl(mdd) - , mMetaData(md) - , mSavedCallback(saveCallback) - , mClearGameFunc(clearGameFunc) - , mDeleteGameFunc(deleteGameFunc) - , mMediaFilesUpdated(false) - , mInvalidEmulatorEntry(false) + : GuiComponent{window} + , mBackground{window, ":/graphics/frame.svg"} + , mGrid{window, glm::ivec2{3, 6}} + , mScraperParams{scraperParams} + , mMetaDataDecl{mdd} + , mMetaData{md} + , mSavedCallback{saveCallback} + , mClearGameFunc{clearGameFunc} + , mDeleteGameFunc{deleteGameFunc} + , mMediaFilesUpdated{false} + , mInvalidEmulatorEntry{false} { addChild(&mBackground); addChild(&mGrid); - mHeaderGrid = std::make_shared(mWindow, glm::ivec2{1, 5}); - mTitle = std::make_shared(mWindow, "EDIT METADATA", Font::get(FONT_SIZE_LARGE), 0x555555FF, ALIGN_CENTER); + mGrid.setEntry(mTitle, glm::ivec2{0, 0}, false, true, glm::ivec2{3, 2}); // Extract possible subfolders from the path. std::string folderPath = @@ -81,13 +82,25 @@ GuiMetaDataEd::GuiMetaDataEd(Window* window, (scraperParams.game->getType() == FOLDER ? " " + ViewController::FOLDER_CHAR : ""), Font::get(FONT_SIZE_SMALL), 0x777777FF, ALIGN_CENTER, glm::vec3{}, glm::vec2{}, 0x00000000, 0.05f); - mHeaderGrid->setEntry(mTitle, glm::ivec2{0, 1}, false, true); - mHeaderGrid->setEntry(mSubtitle, glm::ivec2{0, 3}, false, true); - mGrid.setEntry(mHeaderGrid, glm::ivec2{0, 0}, false, true); + mGrid.setEntry(mSubtitle, glm::ivec2{0, 2}, false, true, glm::ivec2{3, 1}); mList = std::make_shared(mWindow); - mGrid.setEntry(mList, glm::ivec2{0, 1}, true, true); + mGrid.setEntry(mList, glm::ivec2{0, 4}, true, true, glm::ivec2{3, 1}); + + // Set up scroll indicators. + mScrollUp = std::make_shared(mWindow); + mScrollDown = std::make_shared(mWindow); + mScrollIndicator = std::make_shared(mList, mScrollUp, mScrollDown); + + mScrollUp->setResize(0.0f, mTitle->getFont()->getLetterHeight() / 2.0f); + mScrollUp->setOrigin(0.0f, -0.35f); + + mScrollDown->setResize(0.0f, mTitle->getFont()->getLetterHeight() / 2.0f); + mScrollDown->setOrigin(0.0f, 0.35f); + + mGrid.setEntry(mScrollUp, glm::ivec2{2, 0}, false, false, glm::ivec2{1, 1}); + mGrid.setEntry(mScrollDown, glm::ivec2{2, 1}, false, false, glm::ivec2{1, 1}); // Populate list. for (auto iter = mdd.cbegin(); iter != mdd.cend(); iter++) { @@ -143,10 +156,6 @@ GuiMetaDataEd::GuiMetaDataEd(Window* window, ed->setSize(0.0f, height); row.addElement(ed, false, true); - auto ratingSpacer = std::make_shared(mWindow); - ratingSpacer->setSize(Renderer::getScreenWidth() * 0.001f, 0.0f); - row.addElement(ratingSpacer, false); - // Pass input to the actual RatingComponent instead of the spacer. row.input_handler = std::bind(&GuiComponent::input, ed.get(), std::placeholders::_1, std::placeholders::_2); @@ -162,10 +171,6 @@ GuiMetaDataEd::GuiMetaDataEd(Window* window, ed->setChangedColor(TEXTCOLOR_USERMARKED); row.addElement(ed, false); - auto dateSpacer = std::make_shared(mWindow); - dateSpacer->setSize(Renderer::getScreenWidth() * 0.0035f, 0.0f); - row.addElement(dateSpacer, false); - // Pass input to the actual DateTimeEditComponent instead of the spacer. row.input_handler = std::bind(&GuiComponent::input, ed.get(), std::placeholders::_1, std::placeholders::_2); @@ -253,9 +258,8 @@ GuiMetaDataEd::GuiMetaDataEd(Window* window, label = entry.second; std::shared_ptr labelText = - std::make_shared(mWindow, label, - Font::get(FONT_SIZE_MEDIUM), - 0x777777FF, ALIGN_CENTER); + std::make_shared( + mWindow, label, Font::get(FONT_SIZE_MEDIUM), 0x777777FF); if (scraperParams.system->getAlternativeEmulator() == "" && scraperParams.system->getSystemEnvData() @@ -300,7 +304,7 @@ GuiMetaDataEd::GuiMetaDataEd(Window* window, // ratio value is the 16:9 reference. float aspectValue = 1.778f / Renderer::getScreenAspectRatio(); - float maxWidthModifier = glm::clamp(0.70f * aspectValue, 0.50f, 0.92f); + float maxWidthModifier = glm::clamp(0.64f * aspectValue, 0.42f, 0.92f); float maxWidth = static_cast(Renderer::getScreenWidth()) * maxWidthModifier; @@ -472,58 +476,38 @@ GuiMetaDataEd::GuiMetaDataEd(Window* window, } mButtons = makeButtonGrid(mWindow, buttons); - mGrid.setEntry(mButtons, glm::ivec2{0, 2}, true, false); + mGrid.setEntry(mButtons, glm::ivec2{0, 5}, true, false, glm::ivec2{3, 1}); // Resize + center. float width = static_cast(std::min(static_cast(Renderer::getScreenHeight() * 1.05f), static_cast(Renderer::getScreenWidth() * 0.90f))); - setSize(width, Renderer::getScreenHeight() * 0.83f); - setPosition((Renderer::getScreenWidth() - mSize.x) / 2.0f, - (Renderer::getScreenHeight() - mSize.y) / 2.0f); + + // Set height explicitly to ten rows for the component list. + float height = mList->getRowHeight(0) * 10.0f + mTitle->getSize().y + mSubtitle->getSize().y + + mButtons->getSize().y; + + setSize(width, height); } void GuiMetaDataEd::onSizeChanged() { - mGrid.setSize(mSize); - - const float titleHeight = mTitle->getFont()->getLetterHeight(); - const float subtitleHeight = mSubtitle->getFont()->getLetterHeight(); const float titleSubtitleSpacing = mSize.y * 0.03f; - mGrid.setRowHeightPerc( - 0, (titleHeight + titleSubtitleSpacing + subtitleHeight + TITLE_VERT_PADDING) / mSize.y); - mGrid.setRowHeightPerc(2, mButtons->getSize().y / mSize.y); + mGrid.setRowHeightPerc(0, TITLE_HEIGHT / mSize.y / 2.0f); + mGrid.setRowHeightPerc(1, TITLE_HEIGHT / mSize.y / 2.0f); + mGrid.setRowHeightPerc(2, titleSubtitleSpacing / mSize.y); + mGrid.setRowHeightPerc(3, (titleSubtitleSpacing * 1.2f) / mSize.y); + mGrid.setRowHeightPerc(4, ((mList->getRowHeight(0) * 10.0f) + 2.0f) / mSize.y); - // Snap list size to the row height to prevent a fraction of a row from being displayed. - float listHeight = 0.0f; - float listSize = mList->getSize().y; - int i = 0; - while (i < mList->size()) { - // Add the separator height to the row height so that it also gets properly rendered. - float rowHeight = mList->getRowHeight(i) + Renderer::getScreenHeightModifier(); - if (listHeight + rowHeight < listSize) - listHeight += rowHeight; - else - break; - i++; - } + mGrid.setColWidthPerc(0, 0.07f); + mGrid.setColWidthPerc(2, 0.07f); - // Adjust the size of the list and window. - float heightAdjustment = listSize - listHeight; - mList->setSize(mList->getSize().x, listHeight); - glm::vec2 newWindowSize{mSize}; - newWindowSize.y -= heightAdjustment; - mBackground.fitTo(newWindowSize, glm::vec3{}, glm::vec2{-32.0f, -32.0f}); + mGrid.setSize(mSize); + mBackground.fitTo(mSize, glm::vec3{}, glm::vec2{-32.0f, -32.0f}); - // Move the buttons up as well to make the layout align correctly after the resize. - glm::vec3 newButtonPos{mButtons->getPosition()}; - newButtonPos.y -= heightAdjustment; - mButtons->setPosition(newButtonPos); - - mHeaderGrid->setRowHeightPerc(1, titleHeight / mHeaderGrid->getSize().y); - mHeaderGrid->setRowHeightPerc(2, titleSubtitleSpacing / mHeaderGrid->getSize().y); - mHeaderGrid->setRowHeightPerc(3, subtitleHeight / mHeaderGrid->getSize().y); + setPosition((Renderer::getScreenWidth() - mSize.x) / 2.0f, + (Renderer::getScreenHeight() - mSize.y) / 2.0f); } void GuiMetaDataEd::save() @@ -560,9 +544,9 @@ void GuiMetaDataEd::save() // If hidden games are not shown and the hide flag was set for the entry, then write the // metadata immediately regardless of the SaveGamelistsMode setting. Otherwise the file - // will never be written as the game will be filtered from the gamelist. This solution is not - // really good as the gamelist will be written twice, but it's a very special and hopefully - // rare situation. + // will never be written as the game will be filtered from the gamelist. This solution is + // not really good as the gamelist will be written twice, but it's a very special and + // hopefully rare situation. if (hideGameWhileHidden) updateGamelist(mScraperParams.system); diff --git a/es-app/src/guis/GuiMetaDataEd.h b/es-app/src/guis/GuiMetaDataEd.h index 91d781996..ec1793145 100644 --- a/es-app/src/guis/GuiMetaDataEd.h +++ b/es-app/src/guis/GuiMetaDataEd.h @@ -15,6 +15,7 @@ #include "MetaData.h" #include "components/ComponentGrid.h" #include "components/NinePatchComponent.h" +#include "components/ScrollIndicatorComponent.h" #include "guis/GuiSettings.h" #include "scrapers/Scraper.h" @@ -49,6 +50,9 @@ private: ComponentGrid mGrid; std::shared_ptr mTitle; + std::shared_ptr mScrollUp; + std::shared_ptr mScrollDown; + std::shared_ptr mScrollIndicator; std::shared_ptr mSubtitle; std::shared_ptr mHeaderGrid; std::shared_ptr mList; diff --git a/es-app/src/guis/GuiScraperSearch.cpp b/es-app/src/guis/GuiScraperSearch.cpp index cb3ed5ba7..340eb81e2 100644 --- a/es-app/src/guis/GuiScraperSearch.cpp +++ b/es-app/src/guis/GuiScraperSearch.cpp @@ -71,9 +71,9 @@ GuiScraperSearch::GuiScraperSearch(Window* window, SearchType type, unsigned int // Adjust the game description text scrolling parameters depending on the search type. if (mSearchType == NEVER_AUTO_ACCEPT) - mDescContainer->setScrollParameters(3000, 3000, 85); + mDescContainer->setScrollParameters(3000.0f, 3000.0f, 0.8f); else - mDescContainer->setScrollParameters(6000, 3000, 85); + mDescContainer->setScrollParameters(6000.0f, 3000.0f, 0.8f); mResultDesc = std::make_shared(mWindow, "Result desc", Font::get(FONT_SIZE_SMALL), 0x777777FF); diff --git a/es-app/src/main.cpp b/es-app/src/main.cpp index 46f9d9cea..be86c130f 100644 --- a/es-app/src/main.cpp +++ b/es-app/src/main.cpp @@ -232,7 +232,7 @@ bool parseArgs(int argc, char* argv[]) } int width = atoi(argv[i + 1]); int height = atoi(argv[i + 2]); - if (width < 640 || height < 480 || width > 7680 || height > 4320 || + if (width < 224 || height < 224 || width > 7680 || height > 4320 || height < width / 4 || width < height / 2) { std::cerr << "Error: Unsupported resolution " << width << "x" << height << " supplied.\n"; diff --git a/es-app/src/scrapers/GamesDBJSONScraper.cpp b/es-app/src/scrapers/GamesDBJSONScraper.cpp index 327bbef30..12a4b7047 100644 --- a/es-app/src/scrapers/GamesDBJSONScraper.cpp +++ b/es-app/src/scrapers/GamesDBJSONScraper.cpp @@ -23,11 +23,12 @@ #include "utils/StringUtil.h" #include "utils/TimeUtil.h" +#include "rapidjson/document.h" +#include "rapidjson/error/en.h" + #include #include #include -#include -#include using namespace PlatformIds; using namespace rapidjson; diff --git a/es-app/src/scrapers/GamesDBJSONScraperResources.cpp b/es-app/src/scrapers/GamesDBJSONScraperResources.cpp index 64929712d..9001a2613 100644 --- a/es-app/src/scrapers/GamesDBJSONScraperResources.cpp +++ b/es-app/src/scrapers/GamesDBJSONScraperResources.cpp @@ -21,11 +21,12 @@ #include "Log.h" #include "utils/FileSystemUtil.h" +#include "rapidjson/document.h" +#include "rapidjson/error/en.h" + #include #include #include -#include -#include #include using namespace rapidjson; diff --git a/es-app/src/views/SystemView.cpp b/es-app/src/views/SystemView.cpp index 8159bacbd..230db28da 100644 --- a/es-app/src/views/SystemView.cpp +++ b/es-app/src/views/SystemView.cpp @@ -68,6 +68,10 @@ void SystemView::populate() e.name = (*it)->getName(); e.object = *it; + // Component offset. + glm::vec3 offsetLogo = {0.0f, 0.0f, 0.0f}; + glm::vec3 offsetLogoPlaceholderText = {0.0f, 0.0f, 0.0f}; + // Make logo. const ThemeData::ThemeElement* logoElem = theme->getElement("system", "logo", "image"); if (logoElem) { @@ -84,25 +88,83 @@ void SystemView::populate() e.data.logo = std::shared_ptr(logo); } } - if (!e.data.logo) { - // No logo in theme; use text. - TextComponent* text = - new TextComponent(mWindow, (*it)->getName(), Font::get(FONT_SIZE_LARGE), - 0x000000FF, ALIGN_CENTER); - text->setSize(mCarousel.logoSize * mCarousel.logoScale); - text->applyTheme((*it)->getTheme(), "system", "logoText", - ThemeFlags::FONT_PATH | ThemeFlags::FONT_SIZE | ThemeFlags::COLOR | - ThemeFlags::FORCE_UPPERCASE | ThemeFlags::LINE_SPACING | - ThemeFlags::TEXT); - e.data.logo = std::shared_ptr(text); - if (mCarousel.type == VERTICAL || mCarousel.type == VERTICAL_WHEEL) { - text->setHorizontalAlignment(mCarousel.logoAlignment); - text->setVerticalAlignment(ALIGN_CENTER); + if (!e.data.logo) { + // No logo in theme; use placeholder. + + glm::vec2 resolution = glm::vec2{static_cast(Renderer::getScreenWidth()), + static_cast(Renderer::getScreenHeight())}; + glm::vec3 center = {resolution.x / 2.0f, resolution.y / 2.0f, 1.0f}; + glm::vec2 scale{getParent() ? getParent()->getSize() : resolution}; + + // Placeholder Image. + const ThemeData::ThemeElement* logoElem = + theme->getElement("system", "logoPlaceholderImage", "image"); + if (logoElem) { + auto path = logoElem->get("path"); + std::string defaultPath = + logoElem->has("default") ? logoElem->get("default") : ""; + if ((!path.empty() && ResourceManager::getInstance()->fileExists(path)) || + (!defaultPath.empty() && + ResourceManager::getInstance()->fileExists(defaultPath))) { + ImageComponent* logo = new ImageComponent(mWindow, false, false); + logo->applyTheme(theme, "system", "logoPlaceholderImage", ThemeFlags::ALL); + if (!logoElem->has("size")) + logo->setMaxSize(mCarousel.logoSize * mCarousel.logoScale); + offsetLogo = logo->getPosition() - center; + logo->setRotateByTargetSize(true); + e.data.logo = std::shared_ptr(logo); + } + } + + // Placeholder Text. + const ThemeData::ThemeElement* logoPlaceholderText = + theme->getElement("system", "logoPlaceholderText", "text"); + if (logoPlaceholderText) { + // Element 'logoPlaceholderText' found in theme: place text + auto* text = + new TextComponent(mWindow, (*it)->getName(), Font::get(FONT_SIZE_LARGE), + 0x000000FF, ALIGN_CENTER); + text->setSize(mCarousel.logoSize * mCarousel.logoScale); + if (mCarousel.type == VERTICAL || mCarousel.type == VERTICAL_WHEEL) { + text->setHorizontalAlignment(mCarousel.logoAlignment); + text->setVerticalAlignment(ALIGN_CENTER); + } + else { + text->setHorizontalAlignment(ALIGN_CENTER); + text->setVerticalAlignment(mCarousel.logoAlignment); + } + text->applyTheme((*it)->getTheme(), "system", "logoPlaceholderText", + ThemeFlags::ALL); + if (!e.data.logo) { + e.data.logo = std::shared_ptr(text); + offsetLogo = text->getPosition() - center; + } + else { + e.data.logoPlaceholderText = std::shared_ptr(text); + offsetLogoPlaceholderText = text->getPosition() - center; + } } else { - text->setHorizontalAlignment(ALIGN_CENTER); - text->setVerticalAlignment(mCarousel.logoAlignment); + // Fallback to legacy centered placeholder text. + TextComponent* text = + new TextComponent(mWindow, (*it)->getName(), Font::get(FONT_SIZE_LARGE), + 0x000000FF, ALIGN_CENTER); + text->setSize(mCarousel.logoSize * mCarousel.logoScale); + text->applyTheme((*it)->getTheme(), "system", "logoText", + ThemeFlags::FONT_PATH | ThemeFlags::FONT_SIZE | + ThemeFlags::COLOR | ThemeFlags::FORCE_UPPERCASE | + ThemeFlags::LINE_SPACING | ThemeFlags::TEXT); + e.data.logo = std::shared_ptr(text); + + if (mCarousel.type == VERTICAL || mCarousel.type == VERTICAL_WHEEL) { + text->setHorizontalAlignment(mCarousel.logoAlignment); + text->setVerticalAlignment(ALIGN_CENTER); + } + else { + text->setHorizontalAlignment(ALIGN_CENTER); + text->setVerticalAlignment(mCarousel.logoAlignment); + } } } @@ -124,7 +186,11 @@ void SystemView::populate() } glm::vec2 denormalized{mCarousel.logoSize * e.data.logo->getOrigin()}; - e.data.logo->setPosition(denormalized.x, denormalized.y, 0.0f); + glm::vec3 v = {denormalized.x, denormalized.y, 0.0f}; + e.data.logo->setPosition(v + offsetLogo); + if (e.data.logoPlaceholderText) + e.data.logoPlaceholderText->setPosition( + v + offsetLogoPlaceholderText); // e.data.logo->getPosition() + // Make background extras. e.data.backgroundExtras = ThemeData::makeExtras((*it)->getTheme(), "system", mWindow); @@ -590,6 +656,17 @@ void SystemView::renderCarousel(const glm::mat4& trans) comp->setScale(scale); comp->setOpacity(static_cast(opacity)); comp->render(logoTrans); + + if (mEntries.at(index).data.logoPlaceholderText) { + const std::shared_ptr& comp = mEntries.at(index).data.logoPlaceholderText; + if (mCarousel.type == VERTICAL_WHEEL || mCarousel.type == HORIZONTAL_WHEEL) { + comp->setRotationDegrees(mCarousel.logoRotation * distance); + comp->setRotationOrigin(mCarousel.logoRotationOrigin); + } + comp->setScale(scale); + comp->setOpacity(static_cast(opacity)); + comp->render(logoTrans); + } } Renderer::popClipRect(); } diff --git a/es-app/src/views/SystemView.h b/es-app/src/views/SystemView.h index 6e590c971..5e5cff547 100644 --- a/es-app/src/views/SystemView.h +++ b/es-app/src/views/SystemView.h @@ -29,6 +29,7 @@ enum CarouselType : unsigned int { struct SystemViewData { std::shared_ptr logo; + std::shared_ptr logoPlaceholderText; std::vector backgroundExtras; }; diff --git a/es-app/src/views/ViewController.cpp b/es-app/src/views/ViewController.cpp index 21e5c355d..5daa8fdc9 100644 --- a/es-app/src/views/ViewController.cpp +++ b/es-app/src/views/ViewController.cpp @@ -24,7 +24,6 @@ #include "animations/Animation.h" #include "animations/LambdaAnimation.h" #include "animations/MoveCameraAnimation.h" -#include "guis/GuiInfoPopup.h" #include "guis/GuiMenu.h" #include "guis/GuiTextEditKeyboardPopup.h" #include "guis/GuiTextEditPopup.h" @@ -700,10 +699,8 @@ void ViewController::launch(FileData* game) if (durationString == "disabled") { // If the game launch screen has been set as disabled, show a simple info popup // notification instead. - GuiInfoPopup* s = new GuiInfoPopup( - mWindow, "LAUNCHING GAME '" + Utils::String::toUpper(game->metadata.get("name") + "'"), - 10000); - mWindow->setInfoPopup(s); + mWindow->queueInfoPopup( + "LAUNCHING GAME '" + Utils::String::toUpper(game->metadata.get("name") + "'"), 10000); duration = 1700; } else if (durationString == "brief") { @@ -849,9 +846,12 @@ bool ViewController::input(InputConfig* config, Input input) // background while a game is launched. If we're in this state and then register some // input, it means that the user is back in ES-DE. Therefore unset the game launch flag // and update all the GUI components. This will re-enable the video player and let the - // screensaver start on schedule again. - if (mWindow->getGameLaunchedState()) + // screensaver start on schedule again. Also re-enable scrolling for TextListComponent + // and ScrollableContainer. + if (mWindow->getGameLaunchedState()) { + mWindow->setAllowTextScrolling(true); mWindow->unsetLaunchedGame(); + } // Open the main menu. if (!(UIModeController::getInstance()->isUIModeKid() && diff --git a/es-app/src/views/gamelist/ISimpleGameListView.cpp b/es-app/src/views/gamelist/ISimpleGameListView.cpp index f84013582..ebe1fed30 100644 --- a/es-app/src/views/gamelist/ISimpleGameListView.cpp +++ b/es-app/src/views/gamelist/ISimpleGameListView.cpp @@ -13,7 +13,7 @@ #include "Settings.h" #include "Sound.h" #include "SystemData.h" -#include "guis/GuiInfoPopup.h" +#include "Window.h" #include "utils/StringUtil.h" #include "views/UIModeController.h" #include "views/ViewController.h" @@ -27,7 +27,7 @@ ISimpleGameListView::ISimpleGameListView(Window* window, FileData* root) , mBackground(window) , mRandomGame(nullptr) { - mHeaderText.setText("Logo Text"); + mHeaderText.setText("Logo Text", false); mHeaderText.setSize(mSize.x, 0.0f); mHeaderText.setPosition(0.0f, 0.0f); mHeaderText.setHorizontalAlignment(ALIGN_CENTER); @@ -273,18 +273,13 @@ bool ISimpleGameListView::input(InputConfig* config, Input input) mRoot->getSystem()->isGameSystem() && getCursor()->getType() != PLACEHOLDER && getCursor()->getParent()->getPath() == "collections") { NavigationSounds::getInstance()->playThemeNavigationSound(FAVORITESOUND); - GuiInfoPopup* s; - s = new GuiInfoPopup(mWindow, "CAN'T ADD CUSTOM COLLECTIONS TO CUSTOM COLLECTIONS", - 4000); - mWindow->setInfoPopup(s); + mWindow->queueInfoPopup("CAN'T ADD CUSTOM COLLECTIONS TO CUSTOM COLLECTIONS", 4000); } // Notify the user if attempting to add a placeholder to a custom collection. if (CollectionSystemsManager::get()->isEditing() && mRoot->getSystem()->isGameSystem() && getCursor()->getType() == PLACEHOLDER) { NavigationSounds::getInstance()->playThemeNavigationSound(FAVORITESOUND); - GuiInfoPopup* s; - s = new GuiInfoPopup(mWindow, "CAN'T ADD PLACEHOLDERS TO CUSTOM COLLECTIONS", 4000); - mWindow->setInfoPopup(s); + mWindow->queueInfoPopup("CAN'T ADD PLACEHOLDERS TO CUSTOM COLLECTIONS", 4000); } else if (mRoot->getSystem()->isGameSystem() && getCursor()->getType() != PLACEHOLDER && getCursor()->getParent()->getPath() != "collections") { @@ -394,17 +389,14 @@ bool ISimpleGameListView::input(InputConfig* config, Input input) // so it makes more sense to handle it here than to add the function to // CollectionSystemsManager. if (entryToUpdate->getType() == FOLDER) { - GuiInfoPopup* s; if (isEditing) { - s = new GuiInfoPopup(mWindow, "CAN'T ADD FOLDERS TO CUSTOM COLLECTIONS", - 4000); + mWindow->queueInfoPopup("CAN'T ADD FOLDERS TO CUSTOM COLLECTIONS", 4000); } else { MetaDataList* md = &entryToUpdate->getSourceFileData()->metadata; if (md->get("favorite") == "false") { md->set("favorite", "true"); - s = new GuiInfoPopup( - mWindow, + mWindow->queueInfoPopup( "MARKED FOLDER '" + Utils::String::toUpper(Utils::String::removeParenthesis( entryToUpdate->getName())) + @@ -413,8 +405,7 @@ bool ISimpleGameListView::input(InputConfig* config, Input input) } else { md->set("favorite", "false"); - s = new GuiInfoPopup( - mWindow, + mWindow->queueInfoPopup( "REMOVED FAVORITE MARKING FOR FOLDER '" + Utils::String::toUpper(Utils::String::removeParenthesis( entryToUpdate->getName())) + @@ -423,7 +414,6 @@ bool ISimpleGameListView::input(InputConfig* config, Input input) } } - mWindow->setInfoPopup(s); entryToUpdate->getSourceFileData()->getSystem()->onMetaDataSavePoint(); getCursor()->getParent()->sort( @@ -445,11 +435,9 @@ bool ISimpleGameListView::input(InputConfig* config, Input input) return true; } else if (isEditing && entryToUpdate->metadata.get("nogamecount") == "true") { - GuiInfoPopup* s = new GuiInfoPopup(mWindow, - "CAN'T ADD ENTRIES THAT ARE NOT COUNTED " - "AS GAMES TO CUSTOM COLLECTIONS", - 4000); - mWindow->setInfoPopup(s); + mWindow->queueInfoPopup("CAN'T ADD ENTRIES THAT ARE NOT COUNTED " + "AS GAMES TO CUSTOM COLLECTIONS", + 4000); } else if (CollectionSystemsManager::get()->toggleGameInCollection(entryToUpdate)) { // As the toggling of the game destroyed this object, we need to get the view diff --git a/es-core/CMakeLists.txt b/es-core/CMakeLists.txt index 92a164761..6949f2a32 100644 --- a/es-core/CMakeLists.txt +++ b/es-core/CMakeLists.txt @@ -52,6 +52,7 @@ set(CORE_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/src/components/OptionListComponent.h ${CMAKE_CURRENT_SOURCE_DIR}/src/components/RatingComponent.h ${CMAKE_CURRENT_SOURCE_DIR}/src/components/ScrollableContainer.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/ScrollIndicatorComponent.h ${CMAKE_CURRENT_SOURCE_DIR}/src/components/SliderComponent.h ${CMAKE_CURRENT_SOURCE_DIR}/src/components/SwitchComponent.h ${CMAKE_CURRENT_SOURCE_DIR}/src/components/TextComponent.h @@ -63,6 +64,7 @@ set(CORE_HEADERS # GUIs ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiDetectDevice.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiInfoPopup.h ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiInputConfig.h ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiMsgBox.h ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiTextEditKeyboardPopup.h @@ -135,6 +137,7 @@ set(CORE_SOURCES # GUIs ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiDetectDevice.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiInfoPopup.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiInputConfig.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiMsgBox.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiTextEditKeyboardPopup.cpp diff --git a/es-core/src/CECInput.cpp b/es-core/src/CECInput.cpp index e794118bd..d725079fb 100644 --- a/es-core/src/CECInput.cpp +++ b/es-core/src/CECInput.cpp @@ -114,7 +114,7 @@ CECInput::CECInput() callbacks.keyPress = &onKeyPress; callbacks.logMessage = &onLogMessage; - sprintf(config.strDeviceName, "RetroPie ES"); + sprintf(config.strDeviceName, "ES-DE"); config.clientVersion = CEC::LIBCEC_VERSION_CURRENT; config.bActivateSource = 0; config.callbacks = &callbacks; diff --git a/es-core/src/GuiComponent.cpp b/es-core/src/GuiComponent.cpp index 5075fc311..d4d605ec9 100644 --- a/es-core/src/GuiComponent.cpp +++ b/es-core/src/GuiComponent.cpp @@ -95,18 +95,27 @@ void GuiComponent::renderChildren(const glm::mat4& transform) const void GuiComponent::setPosition(float x, float y, float z) { + if (mPosition.x == x && mPosition.y == y && mPosition.z == z) + return; + mPosition = glm::vec3{x, y, z}; onPositionChanged(); } void GuiComponent::setOrigin(float x, float y) { + if (mOrigin.x == x && mOrigin.y == y) + return; + mOrigin = glm::vec2{x, y}; onOriginChanged(); } void GuiComponent::setSize(float w, float h) { + if (mSize.x == w && mSize.y == h) + return; + mSize = glm::vec2{w, h}; onSizeChanged(); } @@ -166,6 +175,9 @@ int GuiComponent::getChildIndex() const void GuiComponent::setOpacity(unsigned char opacity) { + if (mOpacity == opacity) + return; + mOpacity = opacity; for (auto it = mChildren.cbegin(); it != mChildren.cend(); it++) (*it)->setOpacity(opacity); diff --git a/es-core/src/GuiComponent.h b/es-core/src/GuiComponent.h index 322efab40..17ce415b2 100644 --- a/es-core/src/GuiComponent.h +++ b/es-core/src/GuiComponent.h @@ -161,6 +161,7 @@ public: virtual void setOpacity(unsigned char opacity); virtual unsigned int getColor() const { return mColor; } virtual unsigned int getColorShift() const { return mColorShift; } + virtual float getLineSpacing() { return 0.0f; } virtual void setColor(unsigned int color) { mColor = color; @@ -191,7 +192,7 @@ public: virtual void setHiddenValue(const std::string& value) {} // Used to set the parameters for ScrollableContainer. - virtual void setScrollParameters(float, float, int) {} + virtual void setScrollParameters(float, float, float) {} virtual void onFocusGained() {} virtual void onFocusLost() {} diff --git a/es-core/src/InputManager.cpp b/es-core/src/InputManager.cpp index d69433ca4..501d9ab96 100644 --- a/es-core/src/InputManager.cpp +++ b/es-core/src/InputManager.cpp @@ -112,7 +112,7 @@ void InputManager::init() numJoysticks--; for (int i = 0; i < numJoysticks; i++) - addControllerByDeviceIndex(i); + addControllerByDeviceIndex(nullptr, i); SDL_USER_CECBUTTONDOWN = SDL_RegisterEvents(2); SDL_USER_CECBUTTONUP = SDL_USER_CECBUTTONDOWN + 1; @@ -482,11 +482,11 @@ bool InputManager::parseEvent(const SDL_Event& event, Window* window) break; } case SDL_CONTROLLERDEVICEADDED: { - addControllerByDeviceIndex(event.cdevice.which); + addControllerByDeviceIndex(window, event.cdevice.which); return true; } case SDL_CONTROLLERDEVICEREMOVED: { - removeControllerByJoystickID(event.cdevice.which); + removeControllerByJoystickID(window, event.cdevice.which); return false; } } @@ -621,7 +621,7 @@ void InputManager::loadDefaultControllerConfig(SDL_JoystickID deviceIndex) // clang-format on } -void InputManager::addControllerByDeviceIndex(int deviceIndex) +void InputManager::addControllerByDeviceIndex(Window* window, int deviceIndex) { // Open joystick and add it to our list. SDL_GameController* controller = SDL_GameControllerOpen(deviceIndex); @@ -652,6 +652,14 @@ void InputManager::addControllerByDeviceIndex(int deviceIndex) << ", instance ID: " << joyID << ", device index: " << deviceIndex << ")"; } + if (window != nullptr) { + window->queueInfoPopup( + "ADDED INPUT DEVICE '" + + Utils::String::toUpper(std::string(SDL_GameControllerName(mControllers[joyID]))) + + "'", + 4000); + } + int numAxes = SDL_JoystickNumAxes(joy); int numButtons = SDL_JoystickNumButtons(joy); @@ -662,7 +670,7 @@ void InputManager::addControllerByDeviceIndex(int deviceIndex) mPrevButtonValues[std::make_pair(joyID, button)] = -1; } -void InputManager::removeControllerByJoystickID(SDL_JoystickID joyID) +void InputManager::removeControllerByJoystickID(Window* window, SDL_JoystickID joyID) { assert(joyID != -1); @@ -673,6 +681,14 @@ void InputManager::removeControllerByJoystickID(SDL_JoystickID joyID) LOG(LogInfo) << "Removed controller \"" << SDL_GameControllerName(mControllers[joyID]) << "\" (GUID: " << guid << ", instance ID: " << joyID << ")"; + if (window != nullptr) { + window->queueInfoPopup( + "REMOVED INPUT DEVICE '" + + Utils::String::toUpper(std::string(SDL_GameControllerName(mControllers[joyID]))) + + "'", + 4000); + } + // Delete mPrevAxisValues for the device. int axisEntries = static_cast(mPrevAxisValues.size()); for (int i = 0; i < axisEntries; i++) { diff --git a/es-core/src/InputManager.h b/es-core/src/InputManager.h index 5bdc89ea2..9cf9835f9 100644 --- a/es-core/src/InputManager.h +++ b/es-core/src/InputManager.h @@ -61,8 +61,8 @@ private: void loadDefaultKBConfig(); void loadDefaultControllerConfig(SDL_JoystickID deviceIndex); - void addControllerByDeviceIndex(int deviceIndex); - void removeControllerByJoystickID(SDL_JoystickID joyID); + void addControllerByDeviceIndex(Window* window, int deviceIndex); + void removeControllerByJoystickID(Window* window, SDL_JoystickID joyID); static InputManager* sInstance; static const int DEADZONE_TRIGGERS = 18000; diff --git a/es-core/src/Settings.cpp b/es-core/src/Settings.cpp index 49926b01b..a69705ea9 100644 --- a/es-core/src/Settings.cpp +++ b/es-core/src/Settings.cpp @@ -181,6 +181,7 @@ void Settings::setDefaults() mBoolMap["SpecialCharsASCII"] = {false, false}; mBoolMap["ListScrollOverlay"] = {false, false}; mBoolMap["VirtualKeyboard"] = {true, true}; + mBoolMap["ScrollIndicators"] = {false, false}; mBoolMap["FavoritesAddButton"] = {true, true}; mBoolMap["RandomAddButton"] = {false, false}; mBoolMap["GamelistFilters"] = {true, true}; diff --git a/es-core/src/ThemeData.cpp b/es-core/src/ThemeData.cpp index 0b35a30e3..2ea154635 100644 --- a/es-core/src/ThemeData.cpp +++ b/es-core/src/ThemeData.cpp @@ -698,8 +698,22 @@ std::string ThemeData::getThemeFromCurrentSet(const std::string& system) std::map::const_iterator set = themeSets.find(Settings::getInstance()->getString("ThemeSet")); if (set == themeSets.cend()) { - // Currently configured theme set is missing, so just pick the first available set. - set = themeSets.cbegin(); + // Currently configured theme set is missing, attempt to load the default theme set + // rbsimple-DE instead, and if that's also missing then pick the first available set. + bool defaultSetFound = true; + + set = themeSets.find("rbsimple-DE"); + + if (set == themeSets.cend()) { + set = themeSets.cbegin(); + defaultSetFound = false; + } + + LOG(LogWarning) << "Configured theme set \"" + << Settings::getInstance()->getString("ThemeSet") + << "\" does not exist, loading" << (defaultSetFound ? " default " : " ") + << "theme set \"" << set->first << "\" instead"; + Settings::getInstance()->setString("ThemeSet", set->first); } diff --git a/es-core/src/Window.cpp b/es-core/src/Window.cpp index f23d9f96d..0943e8f04 100644 --- a/es-core/src/Window.cpp +++ b/es-core/src/Window.cpp @@ -11,6 +11,7 @@ #include "components/HelpComponent.h" #include "components/ImageComponent.h" +#include "guis/GuiInfoPopup.h" #if defined(BUILD_VLC_PLAYER) #include "components/VideoVlcComponent.h" #endif @@ -338,6 +339,24 @@ void Window::update(int deltaTime) mTimeSinceLastInput += deltaTime; + // If there is a popup notification queued, then display it. + if (mInfoPopupQueue.size() > 0) { + bool popupIsRunning = false; + + // If uncommenting the following, new popups will not be displayed until the one + // currently shown has reached its display duration. This will be used later when + // support for multiple GuiInfoPopup notifications is implemented. + // if (mInfoPopup != nullptr && mInfoPopup->isRunning()) + // popupIsRunning = true; + + if (!popupIsRunning) { + delete mInfoPopup; + mInfoPopup = new GuiInfoPopup(this, mInfoPopupQueue.front().first, + mInfoPopupQueue.front().second); + mInfoPopupQueue.pop(); + } + } + if (peekGui()) peekGui()->update(deltaTime); @@ -544,13 +563,13 @@ void Window::render() startScreensaver(); } + if (mInfoPopup) + mInfoPopup->render(trans); + // Always call the screensaver render function regardless of whether the screensaver is active // or not because it may perform a fade on transition. renderScreensaver(); - if (!mRenderScreensaver && mInfoPopup) - mInfoPopup->render(trans); - if (mTimeSinceLastInput >= screensaverTimer && screensaverTimer != 0) { if (!isProcessing() && mAllowSleep && (!mScreensaver)) { // Go to sleep. @@ -689,16 +708,13 @@ void Window::reloadHelpPrompts() } } -void Window::setInfoPopup(InfoPopup* infoPopup) -{ - delete mInfoPopup; - mInfoPopup = infoPopup; -} - void Window::stopInfoPopup() { if (mInfoPopup) mInfoPopup->stop(); + + if (mInfoPopupQueue.size() > 0) + std::queue>().swap(mInfoPopupQueue); } void Window::startScreensaver() @@ -708,7 +724,7 @@ void Window::startScreensaver() for (auto it = mGuiStack.cbegin(); it != mGuiStack.cend(); it++) (*it)->onScreensaverActivate(); - stopInfoPopup(); + setAllowTextScrolling(false); mScreensaver->startScreensaver(true); mRenderScreensaver = true; } @@ -719,6 +735,7 @@ bool Window::stopScreensaver() if (mScreensaver && mRenderScreensaver) { mScreensaver->stopScreensaver(); mRenderScreensaver = false; + setAllowTextScrolling(true); // Tell the GUI components the screensaver has stopped. for (auto it = mGuiStack.cbegin(); it != mGuiStack.cend(); it++) { @@ -743,15 +760,19 @@ void Window::renderScreensaver() void Window::startMediaViewer(FileData* game) { if (mMediaViewer) { - if (mMediaViewer->startMediaViewer(game)) + if (mMediaViewer->startMediaViewer(game)) { + setAllowTextScrolling(false); mRenderMediaViewer = true; + } } } void Window::stopMediaViewer() { - if (mMediaViewer) + if (mMediaViewer) { mMediaViewer->stopMediaViewer(); + setAllowTextScrolling(true); + } mRenderMediaViewer = false; } diff --git a/es-core/src/Window.h b/es-core/src/Window.h index 5b65a1801..d02ac3f31 100644 --- a/es-core/src/Window.h +++ b/es-core/src/Window.h @@ -18,10 +18,12 @@ #include #include +#include class FileData; class Font; class GuiComponent; +class GuiInfoPopup; class HelpComponent; class ImageComponent; class InputConfig; @@ -73,14 +75,6 @@ public: virtual void render(const glm::mat4& parentTrans) = 0; }; - class InfoPopup - { - public: - virtual void render(const glm::mat4& parentTrans) = 0; - virtual void stop() = 0; - virtual ~InfoPopup() {} - }; - Window(); ~Window(); @@ -113,7 +107,11 @@ public: void setHelpPrompts(const std::vector& prompts, const HelpStyle& style); void reloadHelpPrompts(); - void setInfoPopup(InfoPopup* infoPopup); + // GuiInfoPopup notifications. + void queueInfoPopup(const std::string& message, const int& duration) + { + mInfoPopupQueue.emplace(std::make_pair(message, duration)); + } void stopInfoPopup(); void startScreensaver(); @@ -165,7 +163,9 @@ private: Screensaver* mScreensaver; MediaViewer* mMediaViewer; GuiLaunchScreen* mLaunchScreen; - InfoPopup* mInfoPopup; + GuiInfoPopup* mInfoPopup; + + std::queue> mInfoPopupQueue; std::string mListScrollText; std::shared_ptr mListScrollFont; diff --git a/es-core/src/components/ComponentGrid.cpp b/es-core/src/components/ComponentGrid.cpp index bd6012d12..fd87cd10d 100644 --- a/es-core/src/components/ComponentGrid.cpp +++ b/es-core/src/components/ComponentGrid.cpp @@ -138,7 +138,7 @@ void ComponentGrid::updateCellComponent(const GridEntry& cell) for (int y = cell.pos.y; y < cell.pos.y + cell.dim.y; y++) size.y += getRowHeight(y); - if (cell.resize) + if (cell.resize && size != glm::vec2{} && cell.component->getSize() != size) cell.component->setSize(size); // Find top left corner. diff --git a/es-core/src/components/ComponentList.cpp b/es-core/src/components/ComponentList.cpp index db6e65fff..c829399ee 100644 --- a/es-core/src/components/ComponentList.cpp +++ b/es-core/src/components/ComponentList.cpp @@ -11,17 +11,19 @@ #define TOTAL_HORIZONTAL_PADDING_PX 20.0f ComponentList::ComponentList(Window* window) - : IList(window, LIST_SCROLL_STYLE_SLOW, LIST_NEVER_LOOP) + : IList{window, LIST_SCROLL_STYLE_SLOW, LIST_NEVER_LOOP} + , mFocused{false} + , mSetupCompleted{false} + , mBottomCameraOffset{false} + , mSelectorBarOffset{0.0f} + , mCameraOffset{0.0f} + , mScrollIndicatorStatus{SCROLL_NONE} { // Adjust the padding relative to the aspect ratio and screen resolution to make it look // coherent regardless of screen type. The 1.778 aspect ratio value is the 16:9 reference. - float aspectValue = 1.778f / Renderer::getScreenAspectRatio(); + float aspectValue{1.778f / Renderer::getScreenAspectRatio()}; mHorizontalPadding = TOTAL_HORIZONTAL_PADDING_PX * aspectValue * Renderer::getScreenWidthModifier(); - - mSelectorBarOffset = 0.0f; - mCameraOffset = 0.0f; - mFocused = false; } void ComponentList::addRow(const ComponentListRow& row, bool setCursorHere) @@ -113,6 +115,35 @@ bool ComponentList::input(InputConfig* config, Input input) void ComponentList::update(int deltaTime) { + const float totalHeight = getTotalRowHeight(); + + // Scroll indicator logic, used by ScrollIndicatorComponent. + bool scrollIndicatorChanged = false; + + if (totalHeight > mSize.y) { + if (mCameraOffset == 0) { + if (mScrollIndicatorStatus != SCROLL_DOWN) { + mScrollIndicatorStatus = SCROLL_DOWN; + scrollIndicatorChanged = true; + } + } + else if (mBottomCameraOffset) { + if (mScrollIndicatorStatus != SCROLL_UP) { + mScrollIndicatorStatus = SCROLL_UP; + scrollIndicatorChanged = true; + } + } + else if (mCameraOffset > 0) { + if (mScrollIndicatorStatus != SCROLL_UP_DOWN) { + mScrollIndicatorStatus = SCROLL_UP_DOWN; + scrollIndicatorChanged = true; + } + } + } + + if (scrollIndicatorChanged == true && mScrollIndicatorChangedCallback != nullptr) + mScrollIndicatorChangedCallback(mScrollIndicatorStatus); + listUpdate(deltaTime); if (size()) { @@ -125,6 +156,8 @@ void ComponentList::update(int deltaTime) void ComponentList::onCursorChanged(const CursorState& state) { + mSetupCompleted = true; + // Update the selector bar position. // In the future this might be animated. mSelectorBarOffset = 0; @@ -149,6 +182,8 @@ void ComponentList::onCursorChanged(const CursorState& state) void ComponentList::updateCameraOffset() { + float oldCameraOffset = mCameraOffset; + // Move the camera to scroll. const float totalHeight = getTotalRowHeight(); if (totalHeight > mSize.y) { @@ -160,11 +195,17 @@ void ComponentList::updateCameraOffset() unsigned int i = 0; while (mCameraOffset < target && i < mEntries.size()) { mCameraOffset += getRowHeight(mEntries.at(i).data); - if (mCameraOffset > totalHeight - mSize.y) + if (mCameraOffset > totalHeight - mSize.y) { + if (mSetupCompleted && mCameraOffset != oldCameraOffset) + mBottomCameraOffset = true; break; + } i++; } + if (mCameraOffset < oldCameraOffset) + mBottomCameraOffset = false; + if (mCameraOffset < 0.0f) mCameraOffset = 0.0f; } diff --git a/es-core/src/components/ComponentList.h b/es-core/src/components/ComponentList.h index c5dc392c1..9035cd881 100644 --- a/es-core/src/components/ComponentList.h +++ b/es-core/src/components/ComponentList.h @@ -61,6 +61,13 @@ class ComponentList : public IList public: ComponentList(Window* window); + enum ScrollIndicator { + SCROLL_NONE, // Replace with AllowShortEnumsOnASingleLine: false (clang-format >=11.0). + SCROLL_UP, + SCROLL_UP_DOWN, + SCROLL_DOWN + }; + void addRow(const ComponentListRow& row, bool setCursorHere = false); void textInput(const std::string& text) override; @@ -87,12 +94,19 @@ public: { return mCursorChangedCallback; } + void setScrollIndicatorChangedCallback( + const std::function& callback) + { + mScrollIndicatorChangedCallback = callback; + } protected: void onCursorChanged(const CursorState& state) override; private: bool mFocused; + bool mSetupCompleted; + bool mBottomCameraOffset; void updateCameraOffset(); void updateElementPosition(const ComponentListRow& row); @@ -105,6 +119,9 @@ private: float mCameraOffset; std::function mCursorChangedCallback; + std::function mScrollIndicatorChangedCallback; + + ScrollIndicator mScrollIndicatorStatus; }; #endif // ES_CORE_COMPONENTS_COMPONENT_LIST_H diff --git a/es-core/src/components/DateTimeEditComponent.cpp b/es-core/src/components/DateTimeEditComponent.cpp index 23b900aae..352932383 100644 --- a/es-core/src/components/DateTimeEditComponent.cpp +++ b/es-core/src/components/DateTimeEditComponent.cpp @@ -6,6 +6,9 @@ // Date and time edit component. // +#define KEY_REPEAT_START_DELAY 600 +#define KEY_REPEAT_SPEED 150 // Lower is faster. + #include "components/DateTimeEditComponent.h" #include "Settings.h" @@ -13,35 +16,43 @@ #include "utils/StringUtil.h" DateTimeEditComponent::DateTimeEditComponent(Window* window, bool alignRight, DisplayMode dispMode) - : GuiComponent(window) - , mEditing(false) - , mEditIndex(0) - , mDisplayMode(dispMode) - , mRelativeUpdateAccumulator(0) - , mColor(0x777777FF) - , mFont(Font::get(FONT_SIZE_SMALL, FONT_PATH_LIGHT)) - , mAlignRight(alignRight) - , mUppercase(false) - , mAutoSize(true) + : GuiComponent{window} + , mEditing{false} + , mEditIndex{0} + , mDisplayMode{dispMode} + , mKeyRepeatDir{0} + , mKeyRepeatTimer{0} + , mRelativeUpdateAccumulator{0} + , mColor{0x777777FF} + , mFont{Font::get(FONT_SIZE_SMALL, FONT_PATH_LIGHT)} + , mAlignRight{alignRight} + , mUppercase{false} + , mAutoSize{true} { updateTextCache(); } -void DateTimeEditComponent::setDisplayMode(DisplayMode mode) +void DateTimeEditComponent::onSizeChanged() { - mDisplayMode = mode; + mAutoSize = false; + updateTextCache(); +} + +void DateTimeEditComponent::setValue(const std::string& val) +{ + mTime = val; + mOriginalValue = val; updateTextCache(); } bool DateTimeEditComponent::input(InputConfig* config, Input input) { - if (input.value == 0) - return false; - - if (config->isMappedTo("a", input)) { + if (config->isMappedTo("a", input) && input.value) { if (mDisplayMode != DISP_RELATIVE_TO_NOW) // Don't allow editing for relative times. mEditing = !mEditing; + mKeyRepeatDir = 0; + // Change the color of the text to reflect the changes. if (mTime == mOriginalValue) setColor(mColorOriginalValue); @@ -54,86 +65,77 @@ bool DateTimeEditComponent::input(InputConfig* config, Input input) // Initialize to now if unset. if (mTime.getTime() == Utils::Time::DEFAULT_TIMEVALUE) { - mTime = Utils::Time::now(); + mTime = Utils::Time::stringToTime("19990101T0101"); updateTextCache(); } } + updateHelpPrompts(); return true; } if (mEditing) { - if (config->isMappedLike("lefttrigger", input) || - config->isMappedLike("righttrigger", input)) { + if ((config->isMappedLike("lefttrigger", input) || + config->isMappedLike("righttrigger", input))) { + mKeyRepeatDir = 0; return true; } - if (config->isMappedTo("b", input)) { + if (config->isMappedTo("y", input) && input.value) { mEditing = false; mTime = mTimeBeforeEdit; + mKeyRepeatDir = 0; updateTextCache(); + return false; + } + + if (config->isMappedTo("b", input) && input.value) { + mEditing = false; + mTime = mTimeBeforeEdit; + mKeyRepeatDir = 0; + updateTextCache(); + updateHelpPrompts(); return true; } - int incDir = 0; - if (config->isMappedLike("up", input) || config->isMappedLike("rightshoulder", input)) - incDir = 1; - else if (config->isMappedLike("down", input) || config->isMappedLike("leftshoulder", input)) - incDir = -1; - - if (incDir != 0) { - tm new_tm = mTime; - - // ISO 8601 date format. - if (mEditIndex == 0) { - new_tm.tm_year += incDir; - - if (new_tm.tm_year < 0) - new_tm.tm_year = 0; + if (config->isMappedLike("up", input) || config->isMappedLike("rightshoulder", input)) { + if (input.value) { + mKeyRepeatDir = 1; + mKeyRepeatTimer = -(KEY_REPEAT_START_DELAY - KEY_REPEAT_SPEED); + changeDate(); + return true; } - else if (mEditIndex == 1) { - new_tm.tm_mon += incDir; - - if (new_tm.tm_mon > 11) - new_tm.tm_mon = 0; - else if (new_tm.tm_mon < 0) - new_tm.tm_mon = 11; + else { + mKeyRepeatDir = 0; } - else if (mEditIndex == 2) { - const int days_in_month = - Utils::Time::daysInMonth(new_tm.tm_year + 1900, new_tm.tm_mon + 1); - new_tm.tm_mday += incDir; - - if (new_tm.tm_mday > days_in_month) - new_tm.tm_mday = 1; - else if (new_tm.tm_mday < 1) - new_tm.tm_mday = days_in_month; + } + else if (config->isMappedLike("down", input) || + config->isMappedLike("leftshoulder", input)) { + if (input.value) { + mKeyRepeatDir = -1; + mKeyRepeatTimer = -(KEY_REPEAT_START_DELAY - KEY_REPEAT_SPEED); + changeDate(); + return true; + } + else { + mKeyRepeatDir = 0; } - - // Validate day. - const int days_in_month = - Utils::Time::daysInMonth(new_tm.tm_year + 1900, new_tm.tm_mon + 1); - if (new_tm.tm_mday > days_in_month) - new_tm.tm_mday = days_in_month; - - mTime = new_tm; - - updateTextCache(); - return true; } - if (config->isMappedLike("right", input)) { + if (mTime != 0 && config->isMappedLike("right", input) && input.value) { mEditIndex++; if (mEditIndex >= static_cast(mCursorBoxes.size())) mEditIndex--; + mKeyRepeatDir = 0; return true; } - if (config->isMappedLike("left", input)) { + if (mTime != 0 && config->isMappedLike("left", input) && input.value) { mEditIndex--; if (mEditIndex < 0) mEditIndex++; + mKeyRepeatDir = 0; return true; } } @@ -143,6 +145,14 @@ bool DateTimeEditComponent::input(InputConfig* config, Input input) void DateTimeEditComponent::update(int deltaTime) { + if (mKeyRepeatDir != 0) { + mKeyRepeatTimer += deltaTime; + while (mKeyRepeatTimer >= KEY_REPEAT_SPEED) { + mKeyRepeatTimer -= KEY_REPEAT_SPEED; + changeDate(); + } + } + if (mDisplayMode == DISP_RELATIVE_TO_NOW) { mRelativeUpdateAccumulator += deltaTime; if (mRelativeUpdateAccumulator > 1000) { @@ -162,12 +172,8 @@ void DateTimeEditComponent::render(const glm::mat4& parentTrans) std::shared_ptr font = getFont(); float referenceSize; - if (mAlignRight) { - if (mTime != 0) - referenceSize = font->sizeText("ABCDEFG").x; - else - referenceSize = font->sizeText("ABCDEIJ").x; - } + if (mAlignRight) + referenceSize = std::round(mParent->getSize().x * 0.1045f); // Vertically center. glm::vec3 off{0.0f, (mSize.y - mTextCache->metrics.size.y) / 2.0f, 0.0f}; @@ -191,7 +197,7 @@ void DateTimeEditComponent::render(const glm::mat4& parentTrans) mTextCache->setColor((mColor & 0xFFFFFF00) | getOpacity()); font->renderTextCache(mTextCache.get()); - if (mEditing) { + if (mEditing && mTime != 0) { if (mEditIndex >= 0 && static_cast(mEditIndex) < mCursorBoxes.size()) Renderer::drawRect(mCursorBoxes[mEditIndex][0], mCursorBoxes[mEditIndex][1], mCursorBoxes[mEditIndex][2], mCursorBoxes[mEditIndex][3], @@ -200,13 +206,54 @@ void DateTimeEditComponent::render(const glm::mat4& parentTrans) } } -void DateTimeEditComponent::setValue(const std::string& val) +void DateTimeEditComponent::setDisplayMode(DisplayMode mode) { - mTime = val; - mOriginalValue = val; + mDisplayMode = mode; updateTextCache(); } +void DateTimeEditComponent::setColor(unsigned int color) +{ + mColor = color; + if (mTextCache) + mTextCache->setColor(color); +} + +void DateTimeEditComponent::setFont(std::shared_ptr font) +{ + mFont = font; + updateTextCache(); +} + +void DateTimeEditComponent::setUppercase(bool uppercase) +{ + mUppercase = uppercase; + updateTextCache(); +} + +std::vector DateTimeEditComponent::getHelpPrompts() +{ + std::vector prompts; + if (!mEditing) { + prompts.push_back(HelpPrompt("a", "edit date")); + } + else { + prompts.push_back(HelpPrompt("b", "cancel")); + prompts.push_back(HelpPrompt("a", "apply")); + prompts.push_back(HelpPrompt("left/right", "Y-M-D")); + prompts.push_back(HelpPrompt("up/down", "modify")); + } + return prompts; +} + +std::shared_ptr DateTimeEditComponent::getFont() const +{ + if (mFont) + return mFont; + + return Font::get(FONT_SIZE_MEDIUM); +} + std::string DateTimeEditComponent::getDisplayString(DisplayMode mode) const { // ISO 8601 date format. @@ -256,12 +303,44 @@ std::string DateTimeEditComponent::getDisplayString(DisplayMode mode) const return Utils::Time::timeToString(mTime, fmt); } -std::shared_ptr DateTimeEditComponent::getFont() const +void DateTimeEditComponent::changeDate() { - if (mFont) - return mFont; + tm new_tm = mTime; - return Font::get(FONT_SIZE_MEDIUM); + // ISO 8601 date format. + if (mEditIndex == 0) { + new_tm.tm_year += mKeyRepeatDir; + + if (new_tm.tm_year < 0) + new_tm.tm_year = 0; + } + else if (mEditIndex == 1) { + new_tm.tm_mon += mKeyRepeatDir; + + if (new_tm.tm_mon > 11) + new_tm.tm_mon = 0; + else if (new_tm.tm_mon < 0) + new_tm.tm_mon = 11; + } + else if (mEditIndex == 2) { + const int days_in_month = + Utils::Time::daysInMonth(new_tm.tm_year + 1900, new_tm.tm_mon + 1); + new_tm.tm_mday += mKeyRepeatDir; + + if (new_tm.tm_mday > days_in_month) + new_tm.tm_mday = 1; + else if (new_tm.tm_mday < 1) + new_tm.tm_mday = days_in_month; + } + + // Validate day. + const int days_in_month = Utils::Time::daysInMonth(new_tm.tm_year + 1900, new_tm.tm_mon + 1); + if (new_tm.tm_mday > days_in_month) + new_tm.tm_mday = days_in_month; + + mTime = new_tm; + + updateTextCache(); } void DateTimeEditComponent::updateTextCache() @@ -320,64 +399,3 @@ void DateTimeEditComponent::updateTextCache() // The logic for handling time for 'mode = DISP_DATE_TIME' is missing, but // nobody will use it anyway so it's not worthwhile implementing. } - -void DateTimeEditComponent::setColor(unsigned int color) -{ - mColor = color; - if (mTextCache) - mTextCache->setColor(color); -} - -void DateTimeEditComponent::setFont(std::shared_ptr font) -{ - mFont = font; - updateTextCache(); -} - -void DateTimeEditComponent::onSizeChanged() -{ - mAutoSize = false; - updateTextCache(); -} - -void DateTimeEditComponent::setUppercase(bool uppercase) -{ - mUppercase = uppercase; - updateTextCache(); -} - -void DateTimeEditComponent::applyTheme(const std::shared_ptr& theme, - const std::string& view, - const std::string& element, - unsigned int properties) -{ - const ThemeData::ThemeElement* elem = theme->getElement(view, element, "datetime"); - - if (!elem) - return; - - // We set mAutoSize BEFORE calling GuiComponent::applyTheme because it calls - // setSize(), which will call updateTextCache(), which will reset mSize if - // mAutoSize == true, ignoring the theme's value. - if (properties & ThemeFlags::SIZE) - mAutoSize = !elem->has("size"); - - GuiComponent::applyTheme(theme, view, element, properties); - - using namespace ThemeFlags; - - if (properties & COLOR && elem->has("color")) - setColor(elem->get("color")); - - if (properties & FORCE_UPPERCASE && elem->has("forceUppercase")) - setUppercase(elem->get("forceUppercase")); - - setFont(Font::getFromTheme(elem, properties, mFont)); -} - -std::vector DateTimeEditComponent::getHelpPrompts() -{ - std::vector prompts; - prompts.push_back(HelpPrompt("a", "edit date")); - return prompts; -} diff --git a/es-core/src/components/DateTimeEditComponent.h b/es-core/src/components/DateTimeEditComponent.h index a2c7ab58f..aa1d72457 100644 --- a/es-core/src/components/DateTimeEditComponent.h +++ b/es-core/src/components/DateTimeEditComponent.h @@ -28,14 +28,15 @@ public: bool alignRight = false, DisplayMode dispMode = DISP_DATE); + void onSizeChanged() override; + void setValue(const std::string& val) override; std::string getValue() const override { return mTime; } + unsigned int getColor() const override { return mColor; } bool input(InputConfig* config, Input input) override; void update(int deltaTime) override; - unsigned int getColor() const override { return mColor; } void render(const glm::mat4& parentTrans) override; - void onSizeChanged() override; // Set how the point in time will be displayed: // * DISP_DATE - only display the date. @@ -57,19 +58,14 @@ public: // Force text to be uppercase when in DISP_RELATIVE_TO_NOW mode. void setUppercase(bool uppercase); - virtual void applyTheme(const std::shared_ptr& theme, - const std::string& view, - const std::string& element, - unsigned int properties) override; - virtual std::vector getHelpPrompts() override; private: std::shared_ptr getFont() const override; - std::string getDisplayString(DisplayMode mode) const; DisplayMode getCurrentDisplayMode() const { return mDisplayMode; } + void changeDate(); void updateTextCache(); Utils::Time::DateTime mTime; @@ -79,6 +75,8 @@ private: int mEditIndex; DisplayMode mDisplayMode; + int mKeyRepeatDir; + int mKeyRepeatTimer; int mRelativeUpdateAccumulator; std::unique_ptr mTextCache; diff --git a/es-core/src/components/MenuComponent.cpp b/es-core/src/components/MenuComponent.cpp index 3d5b49e9d..4f8a2dbf9 100644 --- a/es-core/src/components/MenuComponent.cpp +++ b/es-core/src/components/MenuComponent.cpp @@ -14,14 +14,14 @@ #define BUTTON_GRID_VERT_PADDING 32.0f #define BUTTON_GRID_HORIZ_PADDING 10.0f -#define TITLE_HEIGHT (mTitle->getFont()->getLetterHeight() + TITLE_VERT_PADDING) +#define TITLE_HEIGHT (mTitle->getFont()->getLetterHeight() + Renderer::getScreenHeight() * 0.0637f) MenuComponent::MenuComponent(Window* window, std::string title, const std::shared_ptr& titleFont) : GuiComponent(window) , mBackground(window) - , mGrid(window, glm::ivec2{1, 3}) + , mGrid(window, glm::ivec2{3, 4}) , mNeedsSaving(false) { addChild(&mBackground); @@ -34,11 +34,25 @@ MenuComponent::MenuComponent(Window* window, mTitle->setHorizontalAlignment(ALIGN_CENTER); mTitle->setColor(0x555555FF); setTitle(title, titleFont); - mGrid.setEntry(mTitle, glm::ivec2{}, false); + mGrid.setEntry(mTitle, glm::ivec2{0, 0}, false, true, glm::ivec2{3, 2}); // Set up list which will never change (externally, anyway). mList = std::make_shared(mWindow); - mGrid.setEntry(mList, glm::ivec2{0, 1}, true); + mGrid.setEntry(mList, glm::ivec2{0, 2}, true, true, glm::ivec2{3, 1}); + + // Set up scroll indicators. + mScrollUp = std::make_shared(mWindow); + mScrollDown = std::make_shared(mWindow); + mScrollIndicator = std::make_shared(mList, mScrollUp, mScrollDown); + + mScrollUp->setResize(0.0f, mTitle->getFont()->getLetterHeight() / 2.0f); + mScrollUp->setOrigin(0.0f, -0.35f); + + mScrollDown->setResize(0.0f, mTitle->getFont()->getLetterHeight() / 2.0f); + mScrollDown->setOrigin(0.0f, 0.35f); + + mGrid.setEntry(mScrollUp, glm::ivec2{2, 0}, false, false, glm::ivec2{1, 1}); + mGrid.setEntry(mScrollDown, glm::ivec2{2, 1}, false, false, glm::ivec2{1, 1}); updateGrid(); updateSize(); @@ -109,8 +123,12 @@ void MenuComponent::onSizeChanged() mBackground.fitTo(mSize, glm::vec3{}, glm::vec2{-32.0f, -32.0f}); // Update grid row/column sizes. - mGrid.setRowHeightPerc(0, TITLE_HEIGHT / mSize.y); - mGrid.setRowHeightPerc(2, getButtonGridHeight() / mSize.y); + mGrid.setRowHeightPerc(0, TITLE_HEIGHT / mSize.y / 2.0f); + mGrid.setRowHeightPerc(1, TITLE_HEIGHT / mSize.y / 2.0f); + mGrid.setRowHeightPerc(3, getButtonGridHeight() / mSize.y); + + mGrid.setColWidthPerc(0, 0.07f); + mGrid.setColWidthPerc(2, 0.07f); mGrid.setSize(mSize); } @@ -134,7 +152,7 @@ void MenuComponent::updateGrid() if (mButtons.size()) { mButtonGrid = makeButtonGrid(mWindow, mButtons); - mGrid.setEntry(mButtonGrid, glm::ivec2{0, 2}, true, false); + mGrid.setEntry(mButtonGrid, glm::ivec2{0, 3}, true, false, glm::ivec2{3, 1}); } } diff --git a/es-core/src/components/MenuComponent.h b/es-core/src/components/MenuComponent.h index 2604ca837..f2c538c2a 100644 --- a/es-core/src/components/MenuComponent.h +++ b/es-core/src/components/MenuComponent.h @@ -12,13 +12,12 @@ #include "components/ComponentGrid.h" #include "components/ComponentList.h" #include "components/NinePatchComponent.h" +#include "components/ScrollIndicatorComponent.h" #include "components/TextComponent.h" #include "utils/StringUtil.h" #include -#define TITLE_VERT_PADDING (Renderer::getScreenHeight() * 0.0637f) - class ButtonComponent; class ImageComponent; @@ -87,6 +86,9 @@ private: ComponentGrid mGrid; std::shared_ptr mTitle; + std::shared_ptr mScrollUp; + std::shared_ptr mScrollDown; + std::shared_ptr mScrollIndicator; std::shared_ptr mList; std::shared_ptr mButtonGrid; std::vector> mButtons; diff --git a/es-core/src/components/OptionListComponent.h b/es-core/src/components/OptionListComponent.h index 25df35e61..c25812743 100644 --- a/es-core/src/components/OptionListComponent.h +++ b/es-core/src/components/OptionListComponent.h @@ -10,6 +10,9 @@ #ifndef ES_CORE_COMPONENTS_OPTION_LIST_COMPONENT_H #define ES_CORE_COMPONENTS_OPTION_LIST_COMPONENT_H +#define OPTIONLIST_REPEAT_START_DELAY 650 +#define OPTIONLIST_REPEAT_SPEED 250 // Lower is faster. + #define CHECKED_PATH ":/graphics/checkbox_checked.svg" #define UNCHECKED_PATH ":/graphics/checkbox_unchecked.svg" @@ -30,17 +33,22 @@ public: bool multiSelect = false, bool multiExclusiveSelect = false, bool multiShowTotal = false) - : GuiComponent(window) - , mHelpStyle(helpstyle) - , mMultiSelect(multiSelect) - , mMultiExclusiveSelect(multiExclusiveSelect) - , mMultiShowTotal(multiShowTotal) - , mName(name) - , mText(window) - , mLeftArrow(window) - , mRightArrow(window) + : GuiComponent{window} + , mHelpStyle{helpstyle} + , mMultiSelect{multiSelect} + , mMultiExclusiveSelect{multiExclusiveSelect} + , mMultiShowTotal{multiShowTotal} + , mKeyRepeat{false} + , mKeyRepeatDir{0} + , mKeyRepeatTimer{0} + , mKeyRepeatStartDelay{OPTIONLIST_REPEAT_START_DELAY} + , mKeyRepeatSpeed{OPTIONLIST_REPEAT_SPEED} + , mName{name} + , mText{window} + , mLeftArrow{window} + , mRightArrow{window} { - auto font = Font::get(FONT_SIZE_MEDIUM, FONT_PATH_LIGHT); + auto font{Font::get(FONT_SIZE_MEDIUM, FONT_PATH_LIGHT)}; mText.setFont(font); mText.setColor(0x777777FF); mText.setHorizontalAlignment(ALIGN_CENTER); @@ -88,16 +96,21 @@ public: bool input(InputConfig* config, Input input) override { - if (input.value != 0) { - if (config->isMappedTo("a", input)) { - // Ignore input if the component has been disabled. - if (!mEnabled) - return true; - open(); + if (config->isMappedTo("a", input) && input.value) { + // Ignore input if the component has been disabled. + if (!mEnabled) return true; - } - if (!mMultiSelect) { - if (config->isMappedLike("left", input)) { + mKeyRepeatDir = 0; + open(); + return true; + } + if (!mMultiSelect) { + if (config->isMappedLike("left", input)) { + if (input.value) { + if (mKeyRepeat) { + mKeyRepeatDir = -1; + mKeyRepeatTimer = -(mKeyRepeatStartDelay - mKeyRepeatSpeed); + } // Ignore input if the component has been disabled. if (!mEnabled) return true; @@ -112,7 +125,16 @@ public: onSelectedChanged(); return true; } - else if (config->isMappedLike("right", input)) { + else { + mKeyRepeatDir = 0; + } + } + else if (config->isMappedLike("right", input)) { + if (input.value) { + if (mKeyRepeat) { + mKeyRepeatDir = 1; + mKeyRepeatTimer = -(mKeyRepeatStartDelay - mKeyRepeatSpeed); + } // Ignore input if the component has been disabled. if (!mEnabled) return true; @@ -124,6 +146,12 @@ public: onSelectedChanged(); return true; } + else { + mKeyRepeatDir = 0; + } + } + else if (input.value) { + mKeyRepeatDir = 0; } } return GuiComponent::input(config, input); @@ -148,20 +176,22 @@ public: return selected.at(0); } - void add(const std::string& name, const T& obj, bool selected) + void add(const std::string& name, const T& obj, bool selected, float maxNameLength = 0.0f) { OptionListData e; e.name = name; e.object = obj; e.selected = selected; + e.maxNameLength = maxNameLength; mEntries.push_back(e); + onSelectedChanged(); } bool selectEntry(unsigned int entry) { - if (entry > mEntries.size()) { + if (mEntries.empty() || entry > mEntries.size()) { return false; } else { @@ -218,6 +248,45 @@ public: void setOverrideMultiText(const std::string& text) { mOverrideMultiText = text; } + void setKeyRepeat(bool state, + int delay = OPTIONLIST_REPEAT_START_DELAY, + int speed = OPTIONLIST_REPEAT_SPEED) + { + mKeyRepeat = state; + mKeyRepeatStartDelay = delay; + mKeyRepeatSpeed = speed; + } + + void update(int deltaTime) override + { + if (mKeyRepeat && mKeyRepeatDir != 0) { + mKeyRepeatTimer += deltaTime; + while (mKeyRepeatTimer >= mKeyRepeatSpeed) { + if (mKeyRepeatDir == -1) { + // Move selection to previous. + unsigned int i = getSelectedId(); + int next = static_cast(i) - 1; + if (next < 0) + next += static_cast(mEntries.size()); + mEntries.at(i).selected = false; + mEntries.at(next).selected = true; + onSelectedChanged(); + } + else { + // Move selection to next. + unsigned int i = getSelectedId(); + int next = (i + 1) % mEntries.size(); + mEntries.at(i).selected = false; + mEntries.at(next).selected = true; + onSelectedChanged(); + } + mKeyRepeatTimer -= mKeyRepeatSpeed; + } + } + + GuiComponent::update(deltaTime); + } + HelpStyle getHelpStyle() override { return mHelpStyle; } private: @@ -225,6 +294,7 @@ private: std::string name; T object; bool selected; + float maxNameLength; }; HelpStyle mHelpStyle; @@ -261,7 +331,37 @@ private: // Display the selected entry and left/right option arrows. for (auto it = mEntries.cbegin(); it != mEntries.cend(); it++) { if (it->selected) { - mText.setText(Utils::String::toUpper(it->name)); + if (it->maxNameLength > 0.0f && + Font::get(FONT_SIZE_MEDIUM)->sizeText(Utils::String::toUpper(it->name)).x > + it->maxNameLength) { + // A maximum length parameter has been passed and the "name" size surpasses + // this value, so abbreviate the string inside the arrows. + auto font = Font::get(FONT_SIZE_MEDIUM); + // Calculate with an extra dot to give some leeway. + float dotsSize = font->sizeText("....").x; + std::string abbreviatedString = font->getTextMaxWidth( + Utils::String::toUpper(it->name), it->maxNameLength); + float sizeDifference = font->sizeText(Utils::String::toUpper(it->name)).x - + font->sizeText(abbreviatedString).x; + if (sizeDifference > 0.0f) { + // It doesn't make sense to abbreviate if the number of pixels removed + // by the abbreviation is less or equal to the size of the three dots + // that would be appended to the string. + if (sizeDifference <= dotsSize) { + abbreviatedString = it->name; + } + else { + if (abbreviatedString.back() == ' ') + abbreviatedString.pop_back(); + abbreviatedString += "..."; + } + } + mText.setText(Utils::String::toUpper(abbreviatedString)); + } + else { + mText.setText(Utils::String::toUpper(it->name)); + } + mText.setSize(0.0f, mText.getSize().y); setSize(mText.getSize().x + mLeftArrow.getSize().x + mRightArrow.getSize().x + 24.0f * Renderer::getScreenWidthModifier(), @@ -272,6 +372,7 @@ private: } } } + onSizeChanged(); } std::vector getHelpPrompts() override @@ -287,9 +388,16 @@ private: bool mMultiSelect; bool mMultiExclusiveSelect; bool mMultiShowTotal; - std::string mOverrideMultiText; + bool mKeyRepeat; + int mKeyRepeatDir; + int mKeyRepeatTimer; + int mKeyRepeatStartDelay; + int mKeyRepeatSpeed; + + std::string mOverrideMultiText; std::string mName; + TextComponent mText; ImageComponent mLeftArrow; ImageComponent mRightArrow; diff --git a/es-core/src/components/ScrollIndicatorComponent.h b/es-core/src/components/ScrollIndicatorComponent.h new file mode 100644 index 000000000..4c0f5801c --- /dev/null +++ b/es-core/src/components/ScrollIndicatorComponent.h @@ -0,0 +1,151 @@ +// SPDX-License-Identifier: MIT +// +// EmulationStation Desktop Edition +// ScrollIndicatorComponent.h +// +// Visually indicates whether a menu can be scrolled (up, up/down or down). +// + +#ifndef ES_CORE_COMPONENTS_SCROLL_INDICATOR_COMPONENT_H +#define ES_CORE_COMPONENTS_SCROLL_INDICATOR_COMPONENT_H + +#define FADE_IN_TIME 90.0f + +#include "animations/LambdaAnimation.h" +#include "components/ComponentList.h" + +class ScrollIndicatorComponent +{ +public: + ScrollIndicatorComponent(std::shared_ptr componentList, + std::shared_ptr scrollUp, + std::shared_ptr scrollDown) + : mPreviousScrollState(ComponentList::SCROLL_NONE) + { + assert(componentList != nullptr && scrollUp != nullptr && scrollDown != nullptr); + + scrollUp->setImage(":/graphics/scroll_up.svg"); + scrollDown->setImage(":/graphics/scroll_down.svg"); + + scrollUp->setOpacity(0); + scrollDown->setOpacity(0); + + if (!Settings::getInstance()->getBool("ScrollIndicators")) { + // If the scroll indicators setting is disabled, then show a permanent down arrow + // symbol when the component list contains more entries than can fit on screen. + componentList.get()->setScrollIndicatorChangedCallback( + [scrollUp, scrollDown](ComponentList::ScrollIndicator state) { + if (state == ComponentList::SCROLL_UP || + state == ComponentList::SCROLL_UP_DOWN || + state == ComponentList::SCROLL_DOWN) { + scrollDown->setOpacity(255); + } + }); + } + else { + // If the scroll indicator setting is enabled, then also show the up and up/down + // combination and switch between these as the list is scrolled. + componentList.get()->setScrollIndicatorChangedCallback( + [this, scrollUp, scrollDown](ComponentList::ScrollIndicator state) { + float fadeInTime{FADE_IN_TIME}; + + bool upFadeIn = false; + bool upFadeOut = false; + bool downFadeIn = false; + bool downFadeOut = false; + + scrollUp->finishAnimation(0); + scrollDown->finishAnimation(0); + + if (state == ComponentList::SCROLL_UP && + mPreviousScrollState == ComponentList::SCROLL_NONE) { + scrollUp->setOpacity(255); + } + else if (state == ComponentList::SCROLL_UP && + mPreviousScrollState == ComponentList::SCROLL_UP_DOWN) { + downFadeOut = true; + } + else if (state == ComponentList::SCROLL_UP && + mPreviousScrollState == ComponentList::SCROLL_DOWN) { + upFadeIn = true; + fadeInTime *= 1.5f; + scrollDown->setOpacity(0); + } + else if (state == ComponentList::SCROLL_UP_DOWN && + mPreviousScrollState == ComponentList::SCROLL_NONE) { + scrollUp->setOpacity(255); + scrollDown->setOpacity(255); + } + else if (state == ComponentList::SCROLL_UP_DOWN && + mPreviousScrollState == ComponentList::SCROLL_DOWN) { + upFadeIn = true; + } + else if (state == ComponentList::SCROLL_UP_DOWN && + mPreviousScrollState == ComponentList::SCROLL_UP) { + downFadeIn = true; + } + else if (state == ComponentList::SCROLL_DOWN && + mPreviousScrollState == ComponentList::SCROLL_NONE) { + scrollDown->setOpacity(255); + } + else if (state == ComponentList::SCROLL_DOWN && + mPreviousScrollState == ComponentList::SCROLL_UP_DOWN) { + upFadeOut = true; + } + else if (state == ComponentList::SCROLL_DOWN && + mPreviousScrollState == ComponentList::SCROLL_UP) { + downFadeIn = true; + fadeInTime *= 1.5f; + scrollUp->setOpacity(0); + } + + if (upFadeIn) { + auto upFadeInFunc = [scrollUp](float t) { + scrollUp->setOpacity( + static_cast(glm::mix(0.0f, 1.0f, t) * 255)); + }; + scrollUp->setAnimation( + new LambdaAnimation(upFadeInFunc, static_cast(fadeInTime)), 0, + nullptr, false); + } + + if (upFadeOut) { + auto upFadeOutFunc = [scrollUp](float t) { + scrollUp->setOpacity( + static_cast(glm::mix(0.0f, 1.0f, t) * 255)); + }; + scrollUp->setAnimation( + new LambdaAnimation(upFadeOutFunc, static_cast(fadeInTime)), 0, + nullptr, true); + } + + if (downFadeIn) { + auto downFadeInFunc = [scrollDown](float t) { + scrollDown->setOpacity( + static_cast(glm::mix(0.0f, 1.0f, t) * 255)); + }; + scrollDown->setAnimation( + new LambdaAnimation(downFadeInFunc, static_cast(fadeInTime)), 0, + nullptr, false); + } + + if (downFadeOut) { + auto downFadeOutFunc = [scrollDown](float t) { + scrollDown->setOpacity( + static_cast(glm::mix(0.0f, 1.0f, t) * 255)); + }; + scrollDown->setAnimation( + new LambdaAnimation(downFadeOutFunc, static_cast(fadeInTime)), 0, + nullptr, true); + } + + mPreviousScrollState = state; + }); + } + } + +private: + ComponentList::ScrollIndicator mPreviousScrollState; +}; + +#endif // ES_CORE_COMPONENTS_SCROLL_INDICATOR_COMPONENT_H diff --git a/es-core/src/components/ScrollableContainer.cpp b/es-core/src/components/ScrollableContainer.cpp index a6b39cf7f..218b7cd3a 100644 --- a/es-core/src/components/ScrollableContainer.cpp +++ b/es-core/src/components/ScrollableContainer.cpp @@ -3,8 +3,8 @@ // EmulationStation Desktop Edition // ScrollableContainer.cpp // -// Area containing scrollable information, for example the game description -// text container in the detailed, video and grid views. +// Component containing scrollable information, used for the game +// description text in the scraper and gamelist views. // #include "components/ScrollableContainer.h" @@ -15,26 +15,18 @@ #include "resources/Font.h" ScrollableContainer::ScrollableContainer(Window* window) - : GuiComponent(window) - , mScrollPos({}) - , mScrollDir({}) - , mFontSize(0.0f) - , mAutoScrollDelay(0) - , mAutoScrollSpeed(0) - , mAutoScrollAccumulator(0) - , mAutoScrollResetAccumulator(0) + : GuiComponent{window} + , mScrollPos{0.0f, 0.0f} + , mScrollDir{0.0f, 0.0f} + , mAutoScrollDelay{0} + , mAutoScrollSpeed{0} + , mAutoScrollAccumulator{0} + , mAutoScrollResetAccumulator{0} + , mAdjustedAutoScrollSpeed{0} + , mUpdatedSize{false} { // Set the modifier to get equivalent scrolling speed regardless of screen resolution. mResolutionModifier = Renderer::getScreenHeightModifier(); - mSmallFontSize = static_cast(Font::get(FONT_SIZE_SMALL)->getSize()); - - // For narrower aspect ratios than 16:9 there is a need to set an additional compensation - // to get somehow consistent scrolling speeds. - float aspectCompensation = static_cast(Renderer::getScreenHeight()) / - static_cast(Renderer::getScreenWidth()) - - 0.5625f; - if (aspectCompensation > 0) - mResolutionModifier += aspectCompensation * 4.0f; mAutoScrollResetDelayConstant = AUTO_SCROLL_RESET_DELAY; mAutoScrollDelayConstant = AUTO_SCROLL_DELAY; @@ -46,9 +38,6 @@ void ScrollableContainer::setAutoScroll(bool autoScroll) if (autoScroll) { mScrollDir = glm::vec2{0.0f, 1.0f}; mAutoScrollDelay = static_cast(mAutoScrollDelayConstant); - mAutoScrollSpeed = mAutoScrollSpeedConstant; - mAutoScrollSpeed = - static_cast(static_cast(mAutoScrollSpeedConstant) / mResolutionModifier); reset(); } else { @@ -61,11 +50,11 @@ void ScrollableContainer::setAutoScroll(bool autoScroll) void ScrollableContainer::setScrollParameters(float autoScrollDelayConstant, float autoScrollResetDelayConstant, - int autoScrollSpeedConstant) + float autoScrollSpeedConstant) { - mAutoScrollResetDelayConstant = autoScrollResetDelayConstant; - mAutoScrollDelayConstant = autoScrollDelayConstant; - mAutoScrollSpeedConstant = autoScrollSpeedConstant; + mAutoScrollResetDelayConstant = glm::clamp(autoScrollResetDelayConstant, 1000.0f, 10000.0f); + mAutoScrollDelayConstant = glm::clamp(autoScrollDelayConstant, 1000.0f, 10000.0f); + mAutoScrollSpeedConstant = AUTO_SCROLL_SPEED / glm::clamp(autoScrollSpeedConstant, 0.1f, 10.0f); } void ScrollableContainer::reset() @@ -86,27 +75,48 @@ void ScrollableContainer::update(int deltaTime) return; } - const glm::vec2 contentSize{getContentSize()}; - int adjustedAutoScrollSpeed = mAutoScrollSpeed; + const glm::vec2 contentSize{mChildren.front()->getSize()}; + float rowModifier{1.0f}; - // Adjust the scrolling speed based on the width of the container. - float widthModifier = contentSize.x / static_cast(Renderer::getScreenWidth()); - adjustedAutoScrollSpeed = static_cast(adjustedAutoScrollSpeed * widthModifier); + float lineSpacing{mChildren.front()->getLineSpacing()}; + float combinedHeight{mChildren.front()->getFont()->getHeight(lineSpacing)}; - // Also adjust the scrolling speed based on the size of the font. - float fontSizeModifier = mSmallFontSize / mFontSize; - adjustedAutoScrollSpeed = - static_cast(adjustedAutoScrollSpeed * fontSizeModifier * fontSizeModifier); + // Resize container to font height boundary to avoid rendering a fraction of the last line. + if (!mUpdatedSize && contentSize.y > mSize.y) { + float numLines{mSize.y / combinedHeight}; + mSize.y = floorf(numLines) * combinedHeight; + mUpdatedSize = true; + } + else if (mUpdatedSize) { + // If there are less than 8 lines of text, accelerate the scrolling further. + float lines{mSize.y / combinedHeight}; + if (lines < 8.0f) + rowModifier = lines / 8.0f; + } - if (adjustedAutoScrollSpeed < 0) - adjustedAutoScrollSpeed = 1; + if (!mAdjustedAutoScrollSpeed) { + float fontSize{static_cast(mChildren.front()->getFont()->getSize())}; + float width{contentSize.x / (fontSize * 1.3f)}; - if (adjustedAutoScrollSpeed != 0) { + // Keep speed adjustments within reason. + float speedModifier{glm::clamp(width, 10.0f, 40.0f)}; + + speedModifier *= mAutoScrollSpeedConstant; + speedModifier /= mResolutionModifier; + mAdjustedAutoScrollSpeed = static_cast(speedModifier); + } + + if (mAdjustedAutoScrollSpeed < 0) + mAdjustedAutoScrollSpeed = 1; + + if (mAdjustedAutoScrollSpeed != 0) { mAutoScrollAccumulator += deltaTime; - while (mAutoScrollAccumulator >= adjustedAutoScrollSpeed) { + while (mAutoScrollAccumulator >= + static_cast(rowModifier * static_cast(mAdjustedAutoScrollSpeed))) { if (contentSize.y > mSize.y) mScrollPos += mScrollDir; - mAutoScrollAccumulator -= adjustedAutoScrollSpeed; + mAutoScrollAccumulator -= + static_cast(rowModifier * static_cast(mAdjustedAutoScrollSpeed)); } } @@ -171,20 +181,3 @@ void ScrollableContainer::render(const glm::mat4& parentTrans) GuiComponent::renderChildren(trans); Renderer::popClipRect(); } - -glm::vec2 ScrollableContainer::getContentSize() -{ - glm::vec2 max{}; - for (unsigned int i = 0; i < mChildren.size(); i++) { - glm::vec2 pos{mChildren.at(i)->getPosition().x, mChildren.at(i)->getPosition().y}; - glm::vec2 bottomRight{mChildren.at(i)->getSize() + pos}; - if (bottomRight.x > max.x) - max.x = bottomRight.x; - if (bottomRight.y > max.y) - max.y = bottomRight.y; - if (!mFontSize) - mFontSize = static_cast(mChildren.at(i)->getFont()->getSize()); - } - - return max; -} diff --git a/es-core/src/components/ScrollableContainer.h b/es-core/src/components/ScrollableContainer.h index 548d65b03..27b63f459 100644 --- a/es-core/src/components/ScrollableContainer.h +++ b/es-core/src/components/ScrollableContainer.h @@ -3,8 +3,8 @@ // EmulationStation Desktop Edition // ScrollableContainer.h // -// Area containing scrollable information, for example the game description -// text container in the detailed, video and grid views. +// Component containing scrollable information, used for the game +// description text in the scraper and gamelist views. // #ifndef ES_CORE_COMPONENTS_SCROLLABLE_CONTAINER_H @@ -15,7 +15,7 @@ // Time in ms before resetting to the top after we reach the bottom. #define AUTO_SCROLL_RESET_DELAY 7000.0f // Relative scrolling speed (lower is faster). -#define AUTO_SCROLL_SPEED 90 +#define AUTO_SCROLL_SPEED 4.0f #include "GuiComponent.h" @@ -30,31 +30,29 @@ public: void setAutoScroll(bool autoScroll); void setScrollParameters(float autoScrollDelayConstant, float autoScrollResetDelayConstant, - int autoScrollSpeedConstant) override; + float autoScrollSpeedConstant) override; void reset(); void update(int deltaTime) override; void render(const glm::mat4& parentTrans) override; private: - glm::vec2 getContentSize(); - glm::vec2 mScrollPos; glm::vec2 mScrollDir; - float mFontSize; - float mSmallFontSize; - float mAutoScrollResetDelayConstant; float mAutoScrollDelayConstant; - int mAutoScrollSpeedConstant; - + float mAutoScrollSpeedConstant; float mResolutionModifier; + int mAutoScrollDelay; int mAutoScrollSpeed; int mAutoScrollAccumulator; int mAutoScrollResetAccumulator; + int mAdjustedAutoScrollSpeed; + bool mAtEnd; + bool mUpdatedSize; }; #endif // ES_CORE_COMPONENTS_SCROLLABLE_CONTAINER_H diff --git a/es-core/src/components/TextComponent.cpp b/es-core/src/components/TextComponent.cpp index 2af422b19..ad4dda89f 100644 --- a/es-core/src/components/TextComponent.cpp +++ b/es-core/src/components/TextComponent.cpp @@ -53,7 +53,7 @@ TextComponent::TextComponent(Window* window, setFont(font); setColor(color); setBackgroundColor(bgcolor); - setText(text); + setText(text, false); setPosition(pos); setSize(size); } @@ -66,6 +66,9 @@ void TextComponent::onSizeChanged() void TextComponent::setFont(const std::shared_ptr& font) { + if (mFont == font) + return; + mFont = font; onTextChanged(); } @@ -103,10 +106,15 @@ void TextComponent::setOpacity(unsigned char opacity) GuiComponent::setOpacity(opacity); } -void TextComponent::setText(const std::string& text) +void TextComponent::setText(const std::string& text, bool update) { + if (mText == text) + return; + mText = text; - onTextChanged(); + + if (update) + onTextChanged(); } void TextComponent::setUppercase(bool uppercase) @@ -262,8 +270,6 @@ void TextComponent::setHorizontalAlignment(Alignment align) onTextChanged(); } -void TextComponent::setVerticalAlignment(Alignment align) { mVerticalAlignment = align; } - void TextComponent::setLineSpacing(float spacing) { mLineSpacing = spacing; diff --git a/es-core/src/components/TextComponent.h b/es-core/src/components/TextComponent.h index 58ac31f69..57a5561c5 100644 --- a/es-core/src/components/TextComponent.h +++ b/es-core/src/components/TextComponent.h @@ -38,12 +38,13 @@ public: void setFont(const std::shared_ptr& font); void setUppercase(bool uppercase); void onSizeChanged() override; - void setText(const std::string& text); + void setText(const std::string& text, bool update = true); void setHiddenText(const std::string& text) { mHiddenText = text; } void setColor(unsigned int color) override; void setHorizontalAlignment(Alignment align); - void setVerticalAlignment(Alignment align); + void setVerticalAlignment(Alignment align) { mVerticalAlignment = align; } void setLineSpacing(float spacing); + float getLineSpacing() override { return mLineSpacing; } void setNoTopMargin(bool margin); void setBackgroundColor(unsigned int color); void setRenderBackground(bool render) { mRenderBackground = render; } diff --git a/es-core/src/components/TextListComponent.h b/es-core/src/components/TextListComponent.h index 1af73a9e5..35174aed0 100644 --- a/es-core/src/components/TextListComponent.h +++ b/es-core/src/components/TextListComponent.h @@ -170,11 +170,19 @@ template void TextListComponent::render(const glm::mat4& parentT int startEntry{0}; float y{0.0f}; - const float entrySize{std::max(font->getHeight(1.0), static_cast(font->getSize())) * - mLineSpacing}; + const float entrySize{std::max(floorf(font->getHeight(1.0f)), + floorf(static_cast(font->getSize())) * mLineSpacing)}; + const float lineSpacingHeight{floorf(font->getHeight(mLineSpacing) - font->getHeight(1.0f))}; + + // This extra vertical margin is technically incorrect, but it adds a little extra leeway + // to avoid removing the last row on some older theme sets. There was a sizing bug in the + // RetroPie fork of EmulationStation and some theme authors set sizes that are just slightly + // too small for the last row to show up when the sizing calculation is done correctly. + const float extraMargin{(Renderer::getScreenHeightModifier() >= 1.0f ? 3.0f : 0.0f)}; // Number of entries that can fit on the screen simultaneously. - int screenCount = static_cast(mSize.y / entrySize + 0.5f); + int screenCount{ + static_cast(floorf((mSize.y + lineSpacingHeight / 2.0f + extraMargin) / entrySize))}; if (size() >= screenCount) { startEntry = mCursor - screenCount / 2; diff --git a/es-app/src/guis/GuiInfoPopup.cpp b/es-core/src/guis/GuiInfoPopup.cpp similarity index 100% rename from es-app/src/guis/GuiInfoPopup.cpp rename to es-core/src/guis/GuiInfoPopup.cpp diff --git a/es-app/src/guis/GuiInfoPopup.h b/es-core/src/guis/GuiInfoPopup.h similarity index 79% rename from es-app/src/guis/GuiInfoPopup.h rename to es-core/src/guis/GuiInfoPopup.h index 61b720ce4..67f1df084 100644 --- a/es-app/src/guis/GuiInfoPopup.h +++ b/es-core/src/guis/GuiInfoPopup.h @@ -15,14 +15,15 @@ class ComponentGrid; class NinePatchComponent; -class GuiInfoPopup : public GuiComponent, public Window::InfoPopup +class GuiInfoPopup : public GuiComponent { public: GuiInfoPopup(Window* window, std::string message, int duration); ~GuiInfoPopup(); - void render(const glm::mat4& parentTrans) override; - void stop() override { mRunning = false; } + void render(const glm::mat4& parentTrans); + void stop() { mRunning = false; } + bool isRunning() { return mRunning; } private: bool updateState(); diff --git a/es-core/src/guis/GuiTextEditKeyboardPopup.cpp b/es-core/src/guis/GuiTextEditKeyboardPopup.cpp index b3f46a3d3..a3ce28161 100644 --- a/es-core/src/guis/GuiTextEditKeyboardPopup.cpp +++ b/es-core/src/guis/GuiTextEditKeyboardPopup.cpp @@ -133,9 +133,6 @@ GuiTextEditKeyboardPopup::GuiTextEditKeyboardPopup( mText = std::make_shared(mWindow); mText->setValue(initValue); - if (!multiLine) - mText->setCursor(initValue.size()); - // Header. mGrid.setEntry(mTitle, glm::ivec2{0, 0}, false, true); @@ -289,6 +286,9 @@ GuiTextEditKeyboardPopup::GuiTextEditKeyboardPopup( setPosition((static_cast(Renderer::getScreenWidth()) - mSize.x) / 2.0f, (static_cast(Renderer::getScreenHeight()) - mSize.y) / 2.0f); } + + if (!multiLine) + mText->setCursor(initValue.size()); } void GuiTextEditKeyboardPopup::onSizeChanged() diff --git a/es-core/src/guis/GuiTextEditPopup.cpp b/es-core/src/guis/GuiTextEditPopup.cpp index 132d81056..71d13cb5e 100644 --- a/es-core/src/guis/GuiTextEditPopup.cpp +++ b/es-core/src/guis/GuiTextEditPopup.cpp @@ -102,7 +102,7 @@ GuiTextEditPopup::GuiTextEditPopup(Window* window, if (multiLine) textHeight *= 6.0f; - mText->setSize(0, textHeight); + mText->setSize(0.0f, textHeight); // Adapt width to the geometry of the display. The 1.778 aspect ratio is the 16:9 reference. float aspectValue = 1.778f / Renderer::getScreenAspectRatio(); diff --git a/es-core/src/resources/Font.cpp b/es-core/src/resources/Font.cpp index 5cdb52e53..aafd533db 100644 --- a/es-core/src/resources/Font.cpp +++ b/es-core/src/resources/Font.cpp @@ -79,7 +79,14 @@ Font::Font(int size, const std::string& path) : mSize(size) , mPath(path) { - assert(mSize > 0); + if (mSize < 9) { + mSize = 9; + LOG(LogWarning) << "Requested font size too small, changing to minimum supported size"; + } + else if (mSize > Renderer::getScreenHeight()) { + mSize = Renderer::getScreenHeight(); + LOG(LogWarning) << "Requested font size too large, changing to maximum supported size"; + } mMaxGlyphHeight = 0; @@ -274,8 +281,6 @@ FT_Face Font::getFaceForChar(unsigned int id) return mFaceCache.cbegin()->second->face; } -void Font::clearFaceCache() { mFaceCache.clear(); } - Font::Glyph* Font::getGlyph(unsigned int id) { // Is it already loaded? @@ -339,7 +344,6 @@ Font::Glyph* Font::getGlyph(unsigned int id) return &glyph; } -// Completely recreate the texture data for all textures based on mGlyphs information. void Font::rebuildTextures() { // Recreate OpenGL textures. @@ -441,7 +445,6 @@ float Font::getLetterHeight() return glyph->texSize.y * glyph->texture->textureSize.y; } -// Breaks up a normal string with newlines to make it fit xLen. std::string Font::wrapText(std::string text, float xLen) { std::string out; @@ -666,8 +669,6 @@ TextCache* Font::buildTextCache(const std::string& text, x += glyph->advance.x; } - // TextCache::CacheMetrics metrics = { sizeText(text, lineSpacing) }; - TextCache* cache = new TextCache(); cache->vertexLists.resize(vertMap.size()); cache->metrics = {sizeText(text, lineSpacing)}; diff --git a/es-core/src/resources/Font.h b/es-core/src/resources/Font.h index 30a24c872..50e830d22 100644 --- a/es-core/src/resources/Font.h +++ b/es-core/src/resources/Font.h @@ -141,6 +141,7 @@ private: virtual ~FontFace(); }; + // Completely recreate the texture data for all textures based on mGlyphs information. void rebuildTextures(); void unloadTextures(); @@ -152,7 +153,7 @@ private: std::map> mFaceCache; FT_Face getFaceForChar(unsigned int id); - void clearFaceCache(); + void clearFaceCache() { mFaceCache.clear(); } struct Glyph { FontTexture* texture; @@ -170,7 +171,7 @@ private: int mMaxGlyphHeight; - const int mSize; + int mSize; const std::string mPath; float getNewlineStartOffset(const std::string& text, diff --git a/es-core/src/resources/TextureData.cpp b/es-core/src/resources/TextureData.cpp index 924abd87f..70375c5b3 100644 --- a/es-core/src/resources/TextureData.cpp +++ b/es-core/src/resources/TextureData.cpp @@ -16,8 +16,9 @@ #include "renderers/Renderer.h" #include "resources/ResourceManager.h" -#include -#include +#include "nanosvg.h" +#include "nanosvgrast.h" + #include #define DPI 96 diff --git a/es-core/src/utils/CImgUtil.h b/es-core/src/utils/CImgUtil.h index 66e177d1d..ee3dd39ef 100644 --- a/es-core/src/utils/CImgUtil.h +++ b/es-core/src/utils/CImgUtil.h @@ -12,7 +12,8 @@ // Disable the CImg display capabilities. #define cimg_display 0 -#include +#include "CImg.h" + #include namespace Utils diff --git a/es-core/src/utils/FileSystemUtil.cpp b/es-core/src/utils/FileSystemUtil.cpp index c96ae9b4f..259ca41a7 100644 --- a/es-core/src/utils/FileSystemUtil.cpp +++ b/es-core/src/utils/FileSystemUtil.cpp @@ -8,7 +8,7 @@ // remove files etc. // -#if !defined(__APPLE__) +#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__) #define _FILE_OFFSET_BITS 64 #endif diff --git a/es-core/src/utils/MathUtil.h b/es-core/src/utils/MathUtil.h index 34fb84131..f89912321 100644 --- a/es-core/src/utils/MathUtil.h +++ b/es-core/src/utils/MathUtil.h @@ -10,9 +10,10 @@ #ifndef ES_CORE_UTILS_MATH_UTIL_H #define ES_CORE_UTILS_MATH_UTIL_H -#include -#include -#include +#include "glm/ext/matrix_clip_space.hpp" +#include "glm/ext/matrix_transform.hpp" +#include "glm/trigonometric.hpp" + #include namespace Utils diff --git a/external/rapidjson/.gitattributes b/external/rapidjson/.gitattributes new file mode 100644 index 000000000..6f598bb7f --- /dev/null +++ b/external/rapidjson/.gitattributes @@ -0,0 +1,22 @@ +# Set the default behavior, in case people don't have core.autocrlf set. +* text=auto + +# Explicitly declare text files you want to always be normalized and converted +# to native line endings on checkout. +*.cpp text +*.h text +*.txt text +*.md text +*.cmake text +*.svg text +*.dot text +*.yml text +*.in text +*.sh text +*.autopkg text +Dockerfile text + +# Denote all files that are truly binary and should not be modified. +*.png binary +*.jpg binary +*.json binary \ No newline at end of file diff --git a/external/rapidjson/.gitignore b/external/rapidjson/.gitignore new file mode 100644 index 000000000..5932e82c2 --- /dev/null +++ b/external/rapidjson/.gitignore @@ -0,0 +1,29 @@ +/bin/* +!/bin/data +!/bin/encodings +!/bin/jsonchecker +!/bin/types +!/bin/unittestschema +/build +/doc/html +/doc/doxygen_*.db +*.a + +# Temporary files created during CMake build +CMakeCache.txt +CMakeFiles +cmake_install.cmake +CTestTestfile.cmake +Makefile +RapidJSON*.cmake +RapidJSON.pc +Testing +/googletest +install_manifest.txt +Doxyfile +Doxyfile.zh-cn +DartConfiguration.tcl +*.nupkg + +# Files created by OS +*.DS_Store diff --git a/external/rapidjson/.gitmodules b/external/rapidjson/.gitmodules new file mode 100644 index 000000000..5e41f7c97 --- /dev/null +++ b/external/rapidjson/.gitmodules @@ -0,0 +1,3 @@ +[submodule "thirdparty/gtest"] + path = thirdparty/gtest + url = https://github.com/google/googletest.git diff --git a/external/rapidjson/.travis.yml b/external/rapidjson/.travis.yml new file mode 100644 index 000000000..17d8f03d6 --- /dev/null +++ b/external/rapidjson/.travis.yml @@ -0,0 +1,166 @@ +sudo: required +dist: xenial + +language: cpp +cache: + - ccache + +addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - cmake + - valgrind + - clang-8 +env: + global: + - USE_CCACHE=1 + - CCACHE_SLOPPINESS=pch_defines,time_macros + - CCACHE_COMPRESS=1 + - CCACHE_MAXSIZE=100M + - ARCH_FLAGS_x86='-m32' # #266: don't use SSE on 32-bit + - ARCH_FLAGS_x86_64='-msse4.2' # use SSE4.2 on 64-bit + - ARCH_FLAGS_aarch64='-march=armv8-a' + - GITHUB_REPO='Tencent/rapidjson' + - secure: "HrsaCb+N66EG1HR+LWH1u51SjaJyRwJEDzqJGYMB7LJ/bfqb9mWKF1fLvZGk46W5t7TVaXRDD5KHFx9DPWvKn4gRUVkwTHEy262ah5ORh8M6n/6VVVajeV/AYt2C0sswdkDBDO4Xq+xy5gdw3G8s1A4Inbm73pUh+6vx+7ltBbk=" + +matrix: + include: + # gcc + - env: CONF=release ARCH=x86 CXX11=ON CXX17=OFF MEMBERSMAP=OFF + compiler: gcc + arch: amd64 + - env: CONF=release ARCH=x86_64 CXX11=ON CXX17=OFF MEMBERSMAP=OFF + compiler: gcc + arch: amd64 + - env: CONF=release ARCH=x86_64 CXX11=ON CXX17=OFF MEMBERSMAP=ON + compiler: gcc + arch: amd64 + - env: CONF=debug ARCH=x86 CXX11=OFF CXX17=OFF MEMBERSMAP=OFF + compiler: gcc + arch: amd64 + - env: CONF=debug ARCH=x86_64 CXX11=OFF CXX17=OFF MEMBERSMAP=OFF + compiler: gcc + arch: amd64 + - env: CONF=debug ARCH=x86 CXX11=OFF CXX17=ON MEMBERSMAP=ON CXX_FLAGS='-D_GLIBCXX_DEBUG' + compiler: gcc + arch: amd64 + - env: CONF=debug ARCH=x86_64 CXX11=OFF CXX17=ON MEMBERSMAP=ON CXX_FLAGS='-D_GLIBCXX_DEBUG' + compiler: gcc + arch: amd64 + - env: CONF=release ARCH=aarch64 CXX11=ON CXX17=OFF MEMBERSMAP=OFF + compiler: gcc + arch: arm64 + - env: CONF=release ARCH=aarch64 CXX11=OFF CXX17=OFF MEMBERSMAP=OFF + compiler: gcc + arch: arm64 + - env: CONF=release ARCH=aarch64 CXX11=OFF CXX17=ON MEMBERSMAP=ON + compiler: gcc + arch: arm64 + # clang + - env: CONF=release ARCH=x86 CXX11=ON CXX17=OFF MEMBERSMAP=ON CCACHE_CPP2=yes + compiler: clang + arch: amd64 + - env: CONF=release ARCH=x86_64 CXX11=ON CXX17=OFF MEMBERSMAP=ON CCACHE_CPP2=yes + compiler: clang + arch: amd64 + - env: CONF=release ARCH=x86_64 CXX11=ON CXX17=OFF MEMBERSMAP=OFF CCACHE_CPP2=yes + compiler: clang + arch: amd64 + - env: CONF=debug ARCH=x86 CXX11=OFF CXX17=OFF MEMBERSMAP=ON CCACHE_CPP2=yes + compiler: clang + arch: amd64 + - env: CONF=debug ARCH=x86_64 CXX11=OFF CXX17=OFF MEMBERSMAP=ON CCACHE_CPP2=yes + compiler: clang + arch: amd64 + - env: CONF=debug ARCH=x86 CXX11=OFF CXX17=ON MEMBERSMAP=OFF CCACHE_CPP2=yes + compiler: clang + arch: amd64 + - env: CONF=debug ARCH=x86_64 CXX11=OFF CXX17=ON MEMBERSMAP=OFF CCACHE_CPP2=yes + compiler: clang + arch: amd64 + - env: CONF=debug ARCH=aarch64 CXX11=ON CXX17=OFF MEMBERSMAP=ON CCACHE_CPP2=yes + compiler: clang + arch: arm64 + - env: CONF=debug ARCH=aarch64 CXX11=OFF CXX17=OFF MEMBERSMAP=ON CCACHE_CPP2=yes + compiler: clang + arch: arm64 + - env: CONF=debug ARCH=aarch64 CXX11=OFF CXX17=ON MEMBERSMAP=OFF CCACHE_CPP2=yes + compiler: clang + arch: arm64 + # coverage report + - env: CONF=debug ARCH=x86 GCOV_FLAGS='--coverage' CXX_FLAGS='-O0' CXX11=OFF CXX17=OFF + compiler: gcc + arch: amd64 + cache: + - ccache + - pip + after_success: + - pip install --user cpp-coveralls + - coveralls -r .. --gcov-options '\-lp' -e thirdparty -e example -e test -e build/CMakeFiles -e include/rapidjson/msinttypes -e include/rapidjson/internal/meta.h -e include/rapidjson/error/en.h + - env: CONF=debug ARCH=x86_64 GCOV_FLAGS='--coverage' CXX_FLAGS='-O0' CXX11=ON CXX17=OFF MEMBERSMAP=ON + compiler: gcc + arch: amd64 + cache: + - ccache + - pip + after_success: + - pip install --user cpp-coveralls + - coveralls -r .. --gcov-options '\-lp' -e thirdparty -e example -e test -e build/CMakeFiles -e include/rapidjson/msinttypes -e include/rapidjson/internal/meta.h -e include/rapidjson/error/en.h + - env: CONF=debug ARCH=aarch64 GCOV_FLAGS='--coverage' CXX_FLAGS='-O0' CXX11=OFF CXX17=ON + compiler: gcc + arch: arm64 + cache: + - ccache + - pip + after_success: + - pip install --user cpp-coveralls + - coveralls -r .. --gcov-options '\-lp' -e thirdparty -e example -e test -e build/CMakeFiles -e include/rapidjson/msinttypes -e include/rapidjson/internal/meta.h -e include/rapidjson/error/en.h + - script: # Documentation task + - cd build + - cmake .. -DRAPIDJSON_HAS_STDSTRING=ON -DCMAKE_VERBOSE_MAKEFILE=ON + - make travis_doc + cache: false + addons: + apt: + packages: + - doxygen + +before_install: + - if [ "x86_64" = "$(arch)" ]; then sudo apt-get install -y g++-multilib libc6-dbg:i386 --allow-unauthenticated; fi + +before_script: + # travis provides clang-7 for amd64 and clang-3.8 for arm64 + # here use clang-8 to all architectures as clang-7 is not available for arm64 + - if [ -f /usr/bin/clang++-8 ]; then + sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-8 1000; + sudo update-alternatives --config clang++; + export PATH=/usr/bin:$PATH; + fi + - if [ "$CXX" = "clang++" ]; then export CCACHE_CPP2=yes; fi + - ccache -s + # hack to avoid Valgrind bug (https://bugs.kde.org/show_bug.cgi?id=326469), + # exposed by merging PR#163 (using -march=native) + # TODO: Since this bug is already fixed. Remove this when valgrind can be upgraded. + - sed -i "s/-march=native//" CMakeLists.txt + - mkdir build + +script: + - if [ "$CXX" = "clang++" ]; then export CXXFLAGS="-stdlib=libc++ ${CXXFLAGS}"; fi + - > + eval "ARCH_FLAGS=\${ARCH_FLAGS_${ARCH}}" ; + (cd build && cmake + -DRAPIDJSON_HAS_STDSTRING=ON + -DRAPIDJSON_USE_MEMBERSMAP=$MEMBERSMAP + -DRAPIDJSON_BUILD_CXX11=$CXX11 + -DRAPIDJSON_BUILD_CXX17=$CXX17 + -DCMAKE_VERBOSE_MAKEFILE=ON + -DCMAKE_BUILD_TYPE=$CONF + -DCMAKE_CXX_FLAGS="$ARCH_FLAGS $GCOV_FLAGS $CXX_FLAGS" + -DCMAKE_EXE_LINKER_FLAGS=$GCOV_FLAGS + ..) + - cd build + - make tests -j 2 + - make examples -j 2 + - ctest -j 2 -V `[ "$CONF" = "release" ] || echo "-E perftest"` diff --git a/external/rapidjson/CHANGELOG.md b/external/rapidjson/CHANGELOG.md new file mode 100644 index 000000000..1c580bd14 --- /dev/null +++ b/external/rapidjson/CHANGELOG.md @@ -0,0 +1,158 @@ +# Change Log +All notable changes to this project will be documented in this file. +This project adheres to [Semantic Versioning](http://semver.org/). + +## [Unreleased] + +## 1.1.0 - 2016-08-25 + +### Added +* Add GenericDocument ctor overload to specify JSON type (#369) +* Add FAQ (#372, #373, #374, #376) +* Add forward declaration header `fwd.h` +* Add @PlatformIO Library Registry manifest file (#400) +* Implement assignment operator for BigInteger (#404) +* Add comments support (#443) +* Adding coapp definition (#460) +* documenttest.cpp: EXPECT_THROW when checking empty allocator (470) +* GenericDocument: add implicit conversion to ParseResult (#480) +* Use with C++ linkage on Windows ARM (#485) +* Detect little endian for Microsoft ARM targets +* Check Nan/Inf when writing a double (#510) +* Add JSON Schema Implementation (#522) +* Add iostream wrapper (#530) +* Add Jsonx example for converting JSON into JSONx (a XML format) (#531) +* Add optional unresolvedTokenIndex parameter to Pointer::Get() (#532) +* Add encoding validation option for Writer/PrettyWriter (#534) +* Add Writer::SetMaxDecimalPlaces() (#536) +* Support {0, } and {0, m} in Regex (#539) +* Add Value::Get/SetFloat(), Value::IsLossLessFloat/Double() (#540) +* Add stream position check to reader unit tests (#541) +* Add Templated accessors and range-based for (#542) +* Add (Pretty)Writer::RawValue() (#543) +* Add Document::Parse(std::string), Document::Parse(const char*, size_t length) and related APIs. (#553) +* Add move constructor for GenericSchemaDocument (#554) +* Add VS2010 and VS2015 to AppVeyor CI (#555) +* Add parse-by-parts example (#556, #562) +* Support parse number as string (#564, #589) +* Add kFormatSingleLineArray for PrettyWriter (#577) +* Added optional support for trailing commas (#584) +* Added filterkey and filterkeydom examples (#615) +* Added npm docs (#639) +* Allow options for writing and parsing NaN/Infinity (#641) +* Add std::string overload to PrettyWriter::Key() when RAPIDJSON_HAS_STDSTRING is defined (#698) + +### Fixed +* Fix gcc/clang/vc warnings (#350, #394, #397, #444, #447, #473, #515, #582, #589, #595, #667) +* Fix documentation (#482, #511, #550, #557, #614, #635, #660) +* Fix emscripten alignment issue (#535) +* Fix missing allocator to uses of AddMember in document (#365) +* CMake will no longer complain that the minimum CMake version is not specified (#501) +* Make it usable with old VC8 (VS2005) (#383) +* Prohibit C++11 move from Document to Value (#391) +* Try to fix incorrect 64-bit alignment (#419) +* Check return of fwrite to avoid warn_unused_result build failures (#421) +* Fix UB in GenericDocument::ParseStream (#426) +* Keep Document value unchanged on parse error (#439) +* Add missing return statement (#450) +* Fix Document::Parse(const Ch*) for transcoding (#478) +* encodings.h: fix typo in preprocessor condition (#495) +* Custom Microsoft headers are necessary only for Visual Studio 2012 and lower (#559) +* Fix memory leak for invalid regex (26e69ffde95ba4773ab06db6457b78f308716f4b) +* Fix a bug in schema minimum/maximum keywords for 64-bit integer (e7149d665941068ccf8c565e77495521331cf390) +* Fix a crash bug in regex (#605) +* Fix schema "required" keyword cannot handle duplicated keys (#609) +* Fix cmake CMP0054 warning (#612) +* Added missing include guards in istreamwrapper.h and ostreamwrapper.h (#634) +* Fix undefined behaviour (#646) +* Fix buffer overrun using PutN (#673) +* Fix rapidjson::value::Get() may returns wrong data (#681) +* Add Flush() for all value types (#689) +* Handle malloc() fail in PoolAllocator (#691) +* Fix builds on x32 platform. #703 + +### Changed +* Clarify problematic JSON license (#392) +* Move Travis to container based infrastructure (#504, #558) +* Make whitespace array more compact (#513) +* Optimize Writer::WriteString() with SIMD (#544) +* x86-64 48-bit pointer optimization for GenericValue (#546) +* Define RAPIDJSON_HAS_CXX11_RVALUE_REFS directly in clang (#617) +* Make GenericSchemaDocument constructor explicit (#674) +* Optimize FindMember when use std::string (#690) + +## [1.0.2] - 2015-05-14 + +### Added +* Add Value::XXXMember(...) overloads for std::string (#335) + +### Fixed +* Include rapidjson.h for all internal/error headers. +* Parsing some numbers incorrectly in full-precision mode (`kFullPrecisionParseFlag`) (#342) +* Fix some numbers parsed incorrectly (#336) +* Fix alignment of 64bit platforms (#328) +* Fix MemoryPoolAllocator::Clear() to clear user-buffer (0691502573f1afd3341073dd24b12c3db20fbde4) + +### Changed +* CMakeLists for include as a thirdparty in projects (#334, #337) +* Change Document::ParseStream() to use stack allocator for Reader (ffbe38614732af8e0b3abdc8b50071f386a4a685) + +## [1.0.1] - 2015-04-25 + +### Added +* Changelog following [Keep a CHANGELOG](https://github.com/olivierlacan/keep-a-changelog) suggestions. + +### Fixed +* Parsing of some numbers (e.g. "1e-00011111111111") causing assertion (#314). +* Visual C++ 32-bit compilation error in `diyfp.h` (#317). + +## [1.0.0] - 2015-04-22 + +### Added +* 100% [Coverall](https://coveralls.io/r/Tencent/rapidjson?branch=master) coverage. +* Version macros (#311) + +### Fixed +* A bug in trimming long number sequence (4824f12efbf01af72b8cb6fc96fae7b097b73015). +* Double quote in unicode escape (#288). +* Negative zero roundtrip (double only) (#289). +* Standardize behavior of `memcpy()` and `malloc()` (0c5c1538dcfc7f160e5a4aa208ddf092c787be5a, #305, 0e8bbe5e3ef375e7f052f556878be0bd79e9062d). + +### Removed +* Remove an invalid `Document::ParseInsitu()` API (e7f1c6dd08b522cfcf9aed58a333bd9a0c0ccbeb). + +## 1.0-beta - 2015-04-8 + +### Added +* RFC 7159 (#101) +* Optional Iterative Parser (#76) +* Deep-copy values (#20) +* Error code and message (#27) +* ASCII Encoding (#70) +* `kParseStopWhenDoneFlag` (#83) +* `kParseFullPrecisionFlag` (881c91d696f06b7f302af6d04ec14dd08db66ceb) +* Add `Key()` to handler concept (#134) +* C++11 compatibility and support (#128) +* Optimized number-to-string and vice versa conversions (#137, #80) +* Short-String Optimization (#131) +* Local stream optimization by traits (#32) +* Travis & Appveyor Continuous Integration, with Valgrind verification (#24, #242) +* Redo all documentation (English, Simplified Chinese) + +### Changed +* Copyright ownership transferred to THL A29 Limited (a Tencent company). +* Migrating from Premake to CMAKE (#192) +* Resolve all warning reports + +### Removed +* Remove other JSON libraries for performance comparison (#180) + +## 0.11 - 2012-11-16 + +## 0.1 - 2011-11-18 + +[Unreleased]: https://github.com/Tencent/rapidjson/compare/v1.1.0...HEAD +[1.1.0]: https://github.com/Tencent/rapidjson/compare/v1.0.2...v1.1.0 +[1.0.2]: https://github.com/Tencent/rapidjson/compare/v1.0.1...v1.0.2 +[1.0.1]: https://github.com/Tencent/rapidjson/compare/v1.0.0...v1.0.1 +[1.0.0]: https://github.com/Tencent/rapidjson/compare/v1.0-beta...v1.0.0 diff --git a/external/rapidjson/CMakeLists.txt b/external/rapidjson/CMakeLists.txt new file mode 100644 index 000000000..dc2072a98 --- /dev/null +++ b/external/rapidjson/CMakeLists.txt @@ -0,0 +1,248 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) +if(POLICY CMP0025) + # detect Apple's Clang + cmake_policy(SET CMP0025 NEW) +endif() +if(POLICY CMP0054) + cmake_policy(SET CMP0054 NEW) +endif() + +SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules) + +set(LIB_MAJOR_VERSION "1") +set(LIB_MINOR_VERSION "1") +set(LIB_PATCH_VERSION "0") +set(LIB_VERSION_STRING "${LIB_MAJOR_VERSION}.${LIB_MINOR_VERSION}.${LIB_PATCH_VERSION}") + +if (CMAKE_VERSION VERSION_LESS 3.0) + PROJECT(RapidJSON CXX) +else() + cmake_policy(SET CMP0048 NEW) + PROJECT(RapidJSON VERSION "${LIB_VERSION_STRING}" LANGUAGES CXX) +endif() + +# compile in release with debug info mode by default +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE) +endif() + +# Build all binaries in a separate directory +SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) + +option(RAPIDJSON_BUILD_DOC "Build rapidjson documentation." ON) +option(RAPIDJSON_BUILD_EXAMPLES "Build rapidjson examples." ON) +option(RAPIDJSON_BUILD_TESTS "Build rapidjson perftests and unittests." ON) +option(RAPIDJSON_BUILD_THIRDPARTY_GTEST + "Use gtest installation in `thirdparty/gtest` by default if available" OFF) + +option(RAPIDJSON_BUILD_CXX11 "Build rapidjson with C++11" ON) +option(RAPIDJSON_BUILD_CXX17 "Build rapidjson with C++17" OFF) +if(RAPIDJSON_BUILD_CXX11) + set(CMAKE_CXX_STANDARD 11) + set(CMAKE_CXX_STANDARD_REQUIRED TRUE) +endif() + +option(RAPIDJSON_BUILD_ASAN "Build rapidjson with address sanitizer (gcc/clang)" OFF) +option(RAPIDJSON_BUILD_UBSAN "Build rapidjson with undefined behavior sanitizer (gcc/clang)" OFF) + +option(RAPIDJSON_ENABLE_INSTRUMENTATION_OPT "Build rapidjson with -march or -mcpu options" ON) + +option(RAPIDJSON_HAS_STDSTRING "" OFF) +if(RAPIDJSON_HAS_STDSTRING) + add_definitions(-DRAPIDJSON_HAS_STDSTRING) +endif() + +option(RAPIDJSON_USE_MEMBERSMAP "" OFF) +if(RAPIDJSON_USE_MEMBERSMAP) + add_definitions(-DRAPIDJSON_USE_MEMBERSMAP=1) +endif() + +find_program(CCACHE_FOUND ccache) +if(CCACHE_FOUND) + set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) + set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) + if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Qunused-arguments -fcolor-diagnostics") + endif() +endif(CCACHE_FOUND) + +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + if(RAPIDJSON_ENABLE_INSTRUMENTATION_OPT AND NOT CMAKE_CROSSCOMPILING) + if(CMAKE_SYSTEM_PROCESSOR STREQUAL "powerpc" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "ppc64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "ppc64le") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcpu=native") + else() + #FIXME: x86 is -march=native, but doesn't mean every arch is this option. To keep original project's compatibility, I leave this except POWER. + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native") + endif() + endif() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror") + set(EXTRA_CXX_FLAGS -Weffc++ -Wswitch-default -Wfloat-equal -Wconversion -Wsign-conversion) + if (RAPIDJSON_BUILD_CXX11 AND CMAKE_VERSION VERSION_LESS 3.1) + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.7.0") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") + else() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + endif() + elseif (RAPIDJSON_BUILD_CXX17 AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.0") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17") + endif() + if (RAPIDJSON_BUILD_ASAN) + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.8.0") + message(FATAL_ERROR "GCC < 4.8 doesn't support the address sanitizer") + else() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address") + endif() + endif() + if (RAPIDJSON_BUILD_UBSAN) + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.9.0") + message(FATAL_ERROR "GCC < 4.9 doesn't support the undefined behavior sanitizer") + else() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined") + endif() + endif() +elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + if(NOT CMAKE_CROSSCOMPILING) + if(CMAKE_SYSTEM_PROCESSOR STREQUAL "powerpc" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "ppc64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "ppc64le") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcpu=native") + else() + #FIXME: x86 is -march=native, but doesn't mean every arch is this option. To keep original project's compatibility, I leave this except POWER. + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native") + endif() + endif() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror -Wno-missing-field-initializers") + set(EXTRA_CXX_FLAGS -Weffc++ -Wswitch-default -Wfloat-equal -Wconversion -Wimplicit-fallthrough) + if (RAPIDJSON_BUILD_CXX11 AND CMAKE_VERSION VERSION_LESS 3.1) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + elseif (RAPIDJSON_BUILD_CXX17 AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.0") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17") + endif() + if (RAPIDJSON_BUILD_ASAN) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address") + endif() + if (RAPIDJSON_BUILD_UBSAN) + if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined-trap -fsanitize-undefined-trap-on-error") + else() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined") + endif() + endif() +elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + add_definitions(-D_CRT_SECURE_NO_WARNINGS=1) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc") + # CMake >= 3.10 should handle the above CMAKE_CXX_STANDARD fine, otherwise use /std:c++XX with MSVC >= 19.10 + if (RAPIDJSON_BUILD_CXX11 AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "19.10") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++11") + elseif (RAPIDJSON_BUILD_CXX17 AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "19.14") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++17") + endif() + # Always compile with /WX + if(CMAKE_CXX_FLAGS MATCHES "/WX-") + string(REGEX REPLACE "/WX-" "/WX" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + else() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX") + endif() +elseif (CMAKE_CXX_COMPILER_ID MATCHES "XL") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -qarch=auto") +endif() + +#add extra search paths for libraries and includes +SET(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "The directory the headers are installed in") +SET(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE STRING "Directory where lib will install") +SET(DOC_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/doc/${PROJECT_NAME}" CACHE PATH "Path to the documentation") + +IF(UNIX OR CYGWIN) + SET(_CMAKE_INSTALL_DIR "${LIB_INSTALL_DIR}/cmake/${PROJECT_NAME}") +ELSEIF(WIN32) + SET(_CMAKE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/cmake") +ENDIF() +SET(CMAKE_INSTALL_DIR "${_CMAKE_INSTALL_DIR}" CACHE PATH "The directory cmake files are installed in") + +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) + +if(RAPIDJSON_BUILD_DOC) + add_subdirectory(doc) +endif() + +add_custom_target(travis_doc) +add_custom_command(TARGET travis_doc + COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/travis-doxygen.sh) + +if(RAPIDJSON_BUILD_EXAMPLES) + add_subdirectory(example) +endif() + +if(RAPIDJSON_BUILD_TESTS) + if(MSVC11) + # required for VS2012 due to missing support for variadic templates + add_definitions(-D_VARIADIC_MAX=10) + endif(MSVC11) + add_subdirectory(test) + include(CTest) +endif() + +# pkg-config +IF (UNIX OR CYGWIN) + CONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.pc.in + ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc + @ONLY) + INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc + DESTINATION "${LIB_INSTALL_DIR}/pkgconfig" + COMPONENT pkgconfig) +ENDIF() + +install(FILES readme.md + DESTINATION "${DOC_INSTALL_DIR}" + COMPONENT doc) + +install(DIRECTORY include/rapidjson + DESTINATION "${INCLUDE_INSTALL_DIR}" + COMPONENT dev) + +install(DIRECTORY example/ + DESTINATION "${DOC_INSTALL_DIR}/examples" + COMPONENT examples + # Following patterns are for excluding the intermediate/object files + # from an install of in-source CMake build. + PATTERN "CMakeFiles" EXCLUDE + PATTERN "Makefile" EXCLUDE + PATTERN "cmake_install.cmake" EXCLUDE) + +# Provide config and version files to be used by other applications +# =============================== + +################################################################################ +# Export package for use from the build tree +EXPORT( PACKAGE ${PROJECT_NAME} ) + +# Create the RapidJSONConfig.cmake file for other cmake projects. +# ... for the build tree +SET( CONFIG_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) +SET( CONFIG_DIR ${CMAKE_CURRENT_BINARY_DIR}) +SET( ${PROJECT_NAME}_INCLUDE_DIR "\${${PROJECT_NAME}_SOURCE_DIR}/include" ) + +CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}Config.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake @ONLY ) +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}ConfigVersion.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake @ONLY) + +# ... for the install tree +SET( CMAKECONFIG_INSTALL_DIR ${LIB_INSTALL_DIR}/cmake/${PROJECT_NAME} ) +FILE( RELATIVE_PATH REL_INCLUDE_DIR + "${CMAKECONFIG_INSTALL_DIR}" + "${CMAKE_INSTALL_PREFIX}/include" ) + +SET( ${PROJECT_NAME}_INCLUDE_DIR "\${${PROJECT_NAME}_CMAKE_DIR}/${REL_INCLUDE_DIR}" ) +SET( CONFIG_SOURCE_DIR ) +SET( CONFIG_DIR ) +CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}Config.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PROJECT_NAME}Config.cmake @ONLY ) + +INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PROJECT_NAME}Config.cmake" + DESTINATION ${CMAKECONFIG_INSTALL_DIR} ) + +# Install files +INSTALL(FILES + ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake + ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake + DESTINATION "${CMAKE_INSTALL_DIR}" + COMPONENT dev) diff --git a/external/rapidjson/CMakeModules/FindGTestSrc.cmake b/external/rapidjson/CMakeModules/FindGTestSrc.cmake new file mode 100644 index 000000000..f3cb8c990 --- /dev/null +++ b/external/rapidjson/CMakeModules/FindGTestSrc.cmake @@ -0,0 +1,30 @@ + +SET(GTEST_SEARCH_PATH + "${GTEST_SOURCE_DIR}" + "${CMAKE_CURRENT_LIST_DIR}/../thirdparty/gtest/googletest") + +IF(UNIX) + IF(RAPIDJSON_BUILD_THIRDPARTY_GTEST) + LIST(APPEND GTEST_SEARCH_PATH "/usr/src/gtest") + ELSE() + LIST(INSERT GTEST_SEARCH_PATH 1 "/usr/src/gtest") + ENDIF() +ENDIF() + +FIND_PATH(GTEST_SOURCE_DIR + NAMES CMakeLists.txt src/gtest_main.cc + PATHS ${GTEST_SEARCH_PATH}) + + +# Debian installs gtest include directory in /usr/include, thus need to look +# for include directory separately from source directory. +FIND_PATH(GTEST_INCLUDE_DIR + NAMES gtest/gtest.h + PATH_SUFFIXES include + HINTS ${GTEST_SOURCE_DIR} + PATHS ${GTEST_SEARCH_PATH}) + +INCLUDE(FindPackageHandleStandardArgs) +find_package_handle_standard_args(GTestSrc DEFAULT_MSG + GTEST_SOURCE_DIR + GTEST_INCLUDE_DIR) diff --git a/external/rapidjson/RapidJSON.pc.in b/external/rapidjson/RapidJSON.pc.in new file mode 100644 index 000000000..6afb079f8 --- /dev/null +++ b/external/rapidjson/RapidJSON.pc.in @@ -0,0 +1,7 @@ +includedir=@INCLUDE_INSTALL_DIR@ + +Name: @PROJECT_NAME@ +Description: A fast JSON parser/generator for C++ with both SAX/DOM style API +Version: @LIB_VERSION_STRING@ +URL: https://github.com/Tencent/rapidjson +Cflags: -I${includedir} diff --git a/external/rapidjson/RapidJSONConfig.cmake.in b/external/rapidjson/RapidJSONConfig.cmake.in new file mode 100644 index 000000000..c25d31258 --- /dev/null +++ b/external/rapidjson/RapidJSONConfig.cmake.in @@ -0,0 +1,25 @@ +################################################################################ +# CMake minimum version required +cmake_minimum_required(VERSION 3.0) + +################################################################################ +# RapidJSON source dir +set( RapidJSON_SOURCE_DIR "@CONFIG_SOURCE_DIR@") + +################################################################################ +# RapidJSON build dir +set( RapidJSON_DIR "@CONFIG_DIR@") + +################################################################################ +# Compute paths +get_filename_component(RapidJSON_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) + +set( RapidJSON_INCLUDE_DIR "@RapidJSON_INCLUDE_DIR@" ) +set( RapidJSON_INCLUDE_DIRS "@RapidJSON_INCLUDE_DIR@" ) +message(STATUS "RapidJSON found. Headers: ${RapidJSON_INCLUDE_DIRS}") + +if(NOT TARGET rapidjson) + add_library(rapidjson INTERFACE IMPORTED) + set_property(TARGET rapidjson PROPERTY + INTERFACE_INCLUDE_DIRECTORIES ${RapidJSON_INCLUDE_DIRS}) +endif() diff --git a/external/rapidjson/RapidJSONConfigVersion.cmake.in b/external/rapidjson/RapidJSONConfigVersion.cmake.in new file mode 100644 index 000000000..25741fc09 --- /dev/null +++ b/external/rapidjson/RapidJSONConfigVersion.cmake.in @@ -0,0 +1,10 @@ +SET(PACKAGE_VERSION "@LIB_VERSION_STRING@") + +IF (PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION) + SET(PACKAGE_VERSION_EXACT "true") +ENDIF (PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION) +IF (NOT PACKAGE_FIND_VERSION VERSION_GREATER PACKAGE_VERSION) + SET(PACKAGE_VERSION_COMPATIBLE "true") +ELSE (NOT PACKAGE_FIND_VERSION VERSION_GREATER PACKAGE_VERSION) + SET(PACKAGE_VERSION_UNSUITABLE "true") +ENDIF (NOT PACKAGE_FIND_VERSION VERSION_GREATER PACKAGE_VERSION) diff --git a/external/rapidjson/appveyor.yml b/external/rapidjson/appveyor.yml new file mode 100644 index 000000000..4044ba664 --- /dev/null +++ b/external/rapidjson/appveyor.yml @@ -0,0 +1,102 @@ +version: 1.1.0.{build} + +configuration: +- Debug +- Release + +environment: + matrix: + # - VS_VERSION: 9 2008 + # VS_PLATFORM: win32 + # - VS_VERSION: 9 2008 + # VS_PLATFORM: x64 + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 + VS_VERSION: 10 2010 + VS_PLATFORM: win32 + CXX11: OFF + CXX17: OFF + MEMBERSMAP: OFF + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 + VS_VERSION: 10 2010 + VS_PLATFORM: x64 + CXX11: OFF + CXX17: OFF + MEMBERSMAP: ON + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 + VS_VERSION: 11 2012 + VS_PLATFORM: win32 + CXX11: OFF + CXX17: OFF + MEMBERSMAP: ON + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 + VS_VERSION: 11 2012 + VS_PLATFORM: x64 + CXX11: OFF + CXX17: OFF + MEMBERSMAP: OFF + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 + VS_VERSION: 12 2013 + VS_PLATFORM: win32 + CXX11: OFF + CXX17: OFF + MEMBERSMAP: OFF + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 + VS_VERSION: 12 2013 + VS_PLATFORM: x64 + CXX11: OFF + CXX17: OFF + MEMBERSMAP: ON + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + VS_VERSION: 14 2015 + VS_PLATFORM: win32 + CXX11: OFF + CXX17: OFF + MEMBERSMAP: ON + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + VS_VERSION: 14 2015 + VS_PLATFORM: x64 + CXX11: OFF + CXX17: OFF + MEMBERSMAP: OFF + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + VS_VERSION: 15 2017 + VS_PLATFORM: win32 + CXX11: OFF + CXX17: OFF + MEMBERSMAP: OFF + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + VS_VERSION: 15 2017 + VS_PLATFORM: x64 + CXX11: OFF + CXX17: OFF + MEMBERSMAP: ON + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + VS_VERSION: 15 2017 + VS_PLATFORM: x64 + CXX11: ON + CXX17: OFF + MEMBERSMAP: OFF + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + VS_VERSION: 15 2017 + VS_PLATFORM: x64 + CXX11: OFF + CXX17: ON + MEMBERSMAP: OFF + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 + VS_VERSION: 16 2019 + VS_PLATFORM: x64 + CXX11: OFF + CXX17: ON + MEMBERSMAP: ON + +before_build: +- git submodule update --init --recursive +- cmake -H. -BBuild/VS -G "Visual Studio %VS_VERSION%" -DCMAKE_GENERATOR_PLATFORM=%VS_PLATFORM% -DCMAKE_VERBOSE_MAKEFILE=ON -DBUILD_SHARED_LIBS=true -DRAPIDJSON_BUILD_CXX11=%CXX11% -DRAPIDJSON_BUILD_CXX17=%CXX17% -DRAPIDJSON_USE_MEMBERSMAP=%MEMBERSMAP% -Wno-dev + +build: + project: Build\VS\RapidJSON.sln + parallel: true + verbosity: minimal + +test_script: +- cd Build\VS && if %CONFIGURATION%==Debug (ctest --verbose -E perftest --build-config %CONFIGURATION%) else (ctest --verbose --build-config %CONFIGURATION%) diff --git a/external/rapidjson/bin/data/abcde.txt b/external/rapidjson/bin/data/abcde.txt new file mode 100644 index 000000000..6a8165460 --- /dev/null +++ b/external/rapidjson/bin/data/abcde.txt @@ -0,0 +1 @@ +abcde \ No newline at end of file diff --git a/external/rapidjson/bin/data/glossary.json b/external/rapidjson/bin/data/glossary.json new file mode 100644 index 000000000..d6e6ca150 Binary files /dev/null and b/external/rapidjson/bin/data/glossary.json differ diff --git a/external/rapidjson/bin/data/menu.json b/external/rapidjson/bin/data/menu.json new file mode 100644 index 000000000..539c3af20 Binary files /dev/null and b/external/rapidjson/bin/data/menu.json differ diff --git a/external/rapidjson/bin/data/readme.txt b/external/rapidjson/bin/data/readme.txt new file mode 100644 index 000000000..c53bfb8b7 --- /dev/null +++ b/external/rapidjson/bin/data/readme.txt @@ -0,0 +1 @@ +sample.json is obtained from http://code.google.com/p/json-test-suite/downloads/detail?name=sample.zip diff --git a/external/rapidjson/bin/data/sample.json b/external/rapidjson/bin/data/sample.json new file mode 100644 index 000000000..30930e765 Binary files /dev/null and b/external/rapidjson/bin/data/sample.json differ diff --git a/external/rapidjson/bin/data/webapp.json b/external/rapidjson/bin/data/webapp.json new file mode 100644 index 000000000..ee7b0f8ba Binary files /dev/null and b/external/rapidjson/bin/data/webapp.json differ diff --git a/external/rapidjson/bin/data/widget.json b/external/rapidjson/bin/data/widget.json new file mode 100644 index 000000000..32690e8b7 Binary files /dev/null and b/external/rapidjson/bin/data/widget.json differ diff --git a/external/rapidjson/bin/draft-04/schema b/external/rapidjson/bin/draft-04/schema new file mode 100644 index 000000000..85eb502a6 --- /dev/null +++ b/external/rapidjson/bin/draft-04/schema @@ -0,0 +1,150 @@ +{ + "id": "http://json-schema.org/draft-04/schema#", + "$schema": "http://json-schema.org/draft-04/schema#", + "description": "Core schema meta-schema", + "definitions": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": { "$ref": "#" } + }, + "positiveInteger": { + "type": "integer", + "minimum": 0 + }, + "positiveIntegerDefault0": { + "allOf": [ { "$ref": "#/definitions/positiveInteger" }, { "default": 0 } ] + }, + "simpleTypes": { + "enum": [ "array", "boolean", "integer", "null", "number", "object", "string" ] + }, + "stringArray": { + "type": "array", + "items": { "type": "string" }, + "minItems": 1, + "uniqueItems": true + } + }, + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uri" + }, + "$schema": { + "type": "string", + "format": "uri" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": {}, + "multipleOf": { + "type": "number", + "minimum": 0, + "exclusiveMinimum": true + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "boolean", + "default": false + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "boolean", + "default": false + }, + "maxLength": { "$ref": "#/definitions/positiveInteger" }, + "minLength": { "$ref": "#/definitions/positiveIntegerDefault0" }, + "pattern": { + "type": "string", + "format": "regex" + }, + "additionalItems": { + "anyOf": [ + { "type": "boolean" }, + { "$ref": "#" } + ], + "default": {} + }, + "items": { + "anyOf": [ + { "$ref": "#" }, + { "$ref": "#/definitions/schemaArray" } + ], + "default": {} + }, + "maxItems": { "$ref": "#/definitions/positiveInteger" }, + "minItems": { "$ref": "#/definitions/positiveIntegerDefault0" }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "maxProperties": { "$ref": "#/definitions/positiveInteger" }, + "minProperties": { "$ref": "#/definitions/positiveIntegerDefault0" }, + "required": { "$ref": "#/definitions/stringArray" }, + "additionalProperties": { + "anyOf": [ + { "type": "boolean" }, + { "$ref": "#" } + ], + "default": {} + }, + "definitions": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "default": {} + }, + "properties": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "default": {} + }, + "dependencies": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { "$ref": "#" }, + { "$ref": "#/definitions/stringArray" } + ] + } + }, + "enum": { + "type": "array", + "minItems": 1, + "uniqueItems": true + }, + "type": { + "anyOf": [ + { "$ref": "#/definitions/simpleTypes" }, + { + "type": "array", + "items": { "$ref": "#/definitions/simpleTypes" }, + "minItems": 1, + "uniqueItems": true + } + ] + }, + "allOf": { "$ref": "#/definitions/schemaArray" }, + "anyOf": { "$ref": "#/definitions/schemaArray" }, + "oneOf": { "$ref": "#/definitions/schemaArray" }, + "not": { "$ref": "#" } + }, + "dependencies": { + "exclusiveMaximum": [ "maximum" ], + "exclusiveMinimum": [ "minimum" ] + }, + "default": {} +} diff --git a/external/rapidjson/bin/encodings/utf16be.json b/external/rapidjson/bin/encodings/utf16be.json new file mode 100644 index 000000000..e46dbfb9d Binary files /dev/null and b/external/rapidjson/bin/encodings/utf16be.json differ diff --git a/external/rapidjson/bin/encodings/utf16bebom.json b/external/rapidjson/bin/encodings/utf16bebom.json new file mode 100644 index 000000000..0a23ae205 Binary files /dev/null and b/external/rapidjson/bin/encodings/utf16bebom.json differ diff --git a/external/rapidjson/bin/encodings/utf16le.json b/external/rapidjson/bin/encodings/utf16le.json new file mode 100644 index 000000000..92d504530 Binary files /dev/null and b/external/rapidjson/bin/encodings/utf16le.json differ diff --git a/external/rapidjson/bin/encodings/utf16lebom.json b/external/rapidjson/bin/encodings/utf16lebom.json new file mode 100644 index 000000000..eaba00132 Binary files /dev/null and b/external/rapidjson/bin/encodings/utf16lebom.json differ diff --git a/external/rapidjson/bin/encodings/utf32be.json b/external/rapidjson/bin/encodings/utf32be.json new file mode 100644 index 000000000..9cbb52227 Binary files /dev/null and b/external/rapidjson/bin/encodings/utf32be.json differ diff --git a/external/rapidjson/bin/encodings/utf32bebom.json b/external/rapidjson/bin/encodings/utf32bebom.json new file mode 100644 index 000000000..bde6a99ab Binary files /dev/null and b/external/rapidjson/bin/encodings/utf32bebom.json differ diff --git a/external/rapidjson/bin/encodings/utf32le.json b/external/rapidjson/bin/encodings/utf32le.json new file mode 100644 index 000000000..b00f290a6 Binary files /dev/null and b/external/rapidjson/bin/encodings/utf32le.json differ diff --git a/external/rapidjson/bin/encodings/utf32lebom.json b/external/rapidjson/bin/encodings/utf32lebom.json new file mode 100644 index 000000000..d3db39bf7 Binary files /dev/null and b/external/rapidjson/bin/encodings/utf32lebom.json differ diff --git a/external/rapidjson/bin/encodings/utf8.json b/external/rapidjson/bin/encodings/utf8.json new file mode 100644 index 000000000..c500c943f Binary files /dev/null and b/external/rapidjson/bin/encodings/utf8.json differ diff --git a/external/rapidjson/bin/encodings/utf8bom.json b/external/rapidjson/bin/encodings/utf8bom.json new file mode 100644 index 000000000..b9839fe2f Binary files /dev/null and b/external/rapidjson/bin/encodings/utf8bom.json differ diff --git a/external/rapidjson/bin/jsonchecker/fail1.json b/external/rapidjson/bin/jsonchecker/fail1.json new file mode 100644 index 000000000..6216b865f Binary files /dev/null and b/external/rapidjson/bin/jsonchecker/fail1.json differ diff --git a/external/rapidjson/bin/jsonchecker/fail10.json b/external/rapidjson/bin/jsonchecker/fail10.json new file mode 100644 index 000000000..5d8c0047b Binary files /dev/null and b/external/rapidjson/bin/jsonchecker/fail10.json differ diff --git a/external/rapidjson/bin/jsonchecker/fail11.json b/external/rapidjson/bin/jsonchecker/fail11.json new file mode 100644 index 000000000..76eb95b45 Binary files /dev/null and b/external/rapidjson/bin/jsonchecker/fail11.json differ diff --git a/external/rapidjson/bin/jsonchecker/fail12.json b/external/rapidjson/bin/jsonchecker/fail12.json new file mode 100644 index 000000000..77580a452 Binary files /dev/null and b/external/rapidjson/bin/jsonchecker/fail12.json differ diff --git a/external/rapidjson/bin/jsonchecker/fail13.json b/external/rapidjson/bin/jsonchecker/fail13.json new file mode 100644 index 000000000..379406b59 Binary files /dev/null and b/external/rapidjson/bin/jsonchecker/fail13.json differ diff --git a/external/rapidjson/bin/jsonchecker/fail14.json b/external/rapidjson/bin/jsonchecker/fail14.json new file mode 100644 index 000000000..0ed366b38 Binary files /dev/null and b/external/rapidjson/bin/jsonchecker/fail14.json differ diff --git a/external/rapidjson/bin/jsonchecker/fail15.json b/external/rapidjson/bin/jsonchecker/fail15.json new file mode 100644 index 000000000..fc8376b60 Binary files /dev/null and b/external/rapidjson/bin/jsonchecker/fail15.json differ diff --git a/external/rapidjson/bin/jsonchecker/fail16.json b/external/rapidjson/bin/jsonchecker/fail16.json new file mode 100644 index 000000000..3fe21d4b5 Binary files /dev/null and b/external/rapidjson/bin/jsonchecker/fail16.json differ diff --git a/external/rapidjson/bin/jsonchecker/fail17.json b/external/rapidjson/bin/jsonchecker/fail17.json new file mode 100644 index 000000000..62b9214ae Binary files /dev/null and b/external/rapidjson/bin/jsonchecker/fail17.json differ diff --git a/external/rapidjson/bin/jsonchecker/fail18.json b/external/rapidjson/bin/jsonchecker/fail18.json new file mode 100644 index 000000000..edac92716 Binary files /dev/null and b/external/rapidjson/bin/jsonchecker/fail18.json differ diff --git a/external/rapidjson/bin/jsonchecker/fail19.json b/external/rapidjson/bin/jsonchecker/fail19.json new file mode 100644 index 000000000..3b9c46fa9 Binary files /dev/null and b/external/rapidjson/bin/jsonchecker/fail19.json differ diff --git a/external/rapidjson/bin/jsonchecker/fail2.json b/external/rapidjson/bin/jsonchecker/fail2.json new file mode 100644 index 000000000..6b7c11e5a Binary files /dev/null and b/external/rapidjson/bin/jsonchecker/fail2.json differ diff --git a/external/rapidjson/bin/jsonchecker/fail20.json b/external/rapidjson/bin/jsonchecker/fail20.json new file mode 100644 index 000000000..27c1af3e7 Binary files /dev/null and b/external/rapidjson/bin/jsonchecker/fail20.json differ diff --git a/external/rapidjson/bin/jsonchecker/fail21.json b/external/rapidjson/bin/jsonchecker/fail21.json new file mode 100644 index 000000000..62474573b Binary files /dev/null and b/external/rapidjson/bin/jsonchecker/fail21.json differ diff --git a/external/rapidjson/bin/jsonchecker/fail22.json b/external/rapidjson/bin/jsonchecker/fail22.json new file mode 100644 index 000000000..a7752581b Binary files /dev/null and b/external/rapidjson/bin/jsonchecker/fail22.json differ diff --git a/external/rapidjson/bin/jsonchecker/fail23.json b/external/rapidjson/bin/jsonchecker/fail23.json new file mode 100644 index 000000000..494add1ca Binary files /dev/null and b/external/rapidjson/bin/jsonchecker/fail23.json differ diff --git a/external/rapidjson/bin/jsonchecker/fail24.json b/external/rapidjson/bin/jsonchecker/fail24.json new file mode 100644 index 000000000..caff239bf Binary files /dev/null and b/external/rapidjson/bin/jsonchecker/fail24.json differ diff --git a/external/rapidjson/bin/jsonchecker/fail25.json b/external/rapidjson/bin/jsonchecker/fail25.json new file mode 100644 index 000000000..8b7ad23e0 Binary files /dev/null and b/external/rapidjson/bin/jsonchecker/fail25.json differ diff --git a/external/rapidjson/bin/jsonchecker/fail26.json b/external/rapidjson/bin/jsonchecker/fail26.json new file mode 100644 index 000000000..845d26a6a Binary files /dev/null and b/external/rapidjson/bin/jsonchecker/fail26.json differ diff --git a/external/rapidjson/bin/jsonchecker/fail27.json b/external/rapidjson/bin/jsonchecker/fail27.json new file mode 100644 index 000000000..6b01a2ca4 Binary files /dev/null and b/external/rapidjson/bin/jsonchecker/fail27.json differ diff --git a/external/rapidjson/bin/jsonchecker/fail28.json b/external/rapidjson/bin/jsonchecker/fail28.json new file mode 100644 index 000000000..621a0101c Binary files /dev/null and b/external/rapidjson/bin/jsonchecker/fail28.json differ diff --git a/external/rapidjson/bin/jsonchecker/fail29.json b/external/rapidjson/bin/jsonchecker/fail29.json new file mode 100644 index 000000000..47ec421bb Binary files /dev/null and b/external/rapidjson/bin/jsonchecker/fail29.json differ diff --git a/external/rapidjson/bin/jsonchecker/fail3.json b/external/rapidjson/bin/jsonchecker/fail3.json new file mode 100644 index 000000000..168c81eb7 Binary files /dev/null and b/external/rapidjson/bin/jsonchecker/fail3.json differ diff --git a/external/rapidjson/bin/jsonchecker/fail30.json b/external/rapidjson/bin/jsonchecker/fail30.json new file mode 100644 index 000000000..8ab0bc4b8 Binary files /dev/null and b/external/rapidjson/bin/jsonchecker/fail30.json differ diff --git a/external/rapidjson/bin/jsonchecker/fail31.json b/external/rapidjson/bin/jsonchecker/fail31.json new file mode 100644 index 000000000..1cce602b5 Binary files /dev/null and b/external/rapidjson/bin/jsonchecker/fail31.json differ diff --git a/external/rapidjson/bin/jsonchecker/fail32.json b/external/rapidjson/bin/jsonchecker/fail32.json new file mode 100644 index 000000000..45cba7396 Binary files /dev/null and b/external/rapidjson/bin/jsonchecker/fail32.json differ diff --git a/external/rapidjson/bin/jsonchecker/fail33.json b/external/rapidjson/bin/jsonchecker/fail33.json new file mode 100644 index 000000000..ca5eb19dc Binary files /dev/null and b/external/rapidjson/bin/jsonchecker/fail33.json differ diff --git a/external/rapidjson/bin/jsonchecker/fail4.json b/external/rapidjson/bin/jsonchecker/fail4.json new file mode 100644 index 000000000..9de168bf3 Binary files /dev/null and b/external/rapidjson/bin/jsonchecker/fail4.json differ diff --git a/external/rapidjson/bin/jsonchecker/fail5.json b/external/rapidjson/bin/jsonchecker/fail5.json new file mode 100644 index 000000000..ddf3ce3d2 Binary files /dev/null and b/external/rapidjson/bin/jsonchecker/fail5.json differ diff --git a/external/rapidjson/bin/jsonchecker/fail6.json b/external/rapidjson/bin/jsonchecker/fail6.json new file mode 100644 index 000000000..ed91580e1 Binary files /dev/null and b/external/rapidjson/bin/jsonchecker/fail6.json differ diff --git a/external/rapidjson/bin/jsonchecker/fail7.json b/external/rapidjson/bin/jsonchecker/fail7.json new file mode 100644 index 000000000..8a96af3e4 Binary files /dev/null and b/external/rapidjson/bin/jsonchecker/fail7.json differ diff --git a/external/rapidjson/bin/jsonchecker/fail8.json b/external/rapidjson/bin/jsonchecker/fail8.json new file mode 100644 index 000000000..b28479c6e Binary files /dev/null and b/external/rapidjson/bin/jsonchecker/fail8.json differ diff --git a/external/rapidjson/bin/jsonchecker/fail9.json b/external/rapidjson/bin/jsonchecker/fail9.json new file mode 100644 index 000000000..5815574f3 Binary files /dev/null and b/external/rapidjson/bin/jsonchecker/fail9.json differ diff --git a/external/rapidjson/bin/jsonchecker/pass1.json b/external/rapidjson/bin/jsonchecker/pass1.json new file mode 100644 index 000000000..70e268543 Binary files /dev/null and b/external/rapidjson/bin/jsonchecker/pass1.json differ diff --git a/external/rapidjson/bin/jsonchecker/pass2.json b/external/rapidjson/bin/jsonchecker/pass2.json new file mode 100644 index 000000000..d3c63c7ad Binary files /dev/null and b/external/rapidjson/bin/jsonchecker/pass2.json differ diff --git a/external/rapidjson/bin/jsonchecker/pass3.json b/external/rapidjson/bin/jsonchecker/pass3.json new file mode 100644 index 000000000..4528d51f1 Binary files /dev/null and b/external/rapidjson/bin/jsonchecker/pass3.json differ diff --git a/external/rapidjson/bin/jsonchecker/readme.txt b/external/rapidjson/bin/jsonchecker/readme.txt new file mode 100644 index 000000000..321d89d99 --- /dev/null +++ b/external/rapidjson/bin/jsonchecker/readme.txt @@ -0,0 +1,3 @@ +Test suite from http://json.org/JSON_checker/. + +If the JSON_checker is working correctly, it must accept all of the pass*.json files and reject all of the fail*.json files. diff --git a/external/rapidjson/bin/jsonschema/.gitignore b/external/rapidjson/bin/jsonschema/.gitignore new file mode 100644 index 000000000..1333ed77b --- /dev/null +++ b/external/rapidjson/bin/jsonschema/.gitignore @@ -0,0 +1 @@ +TODO diff --git a/external/rapidjson/bin/jsonschema/.travis.yml b/external/rapidjson/bin/jsonschema/.travis.yml new file mode 100644 index 000000000..deecd6110 --- /dev/null +++ b/external/rapidjson/bin/jsonschema/.travis.yml @@ -0,0 +1,4 @@ +language: python +python: "2.7" +install: pip install jsonschema +script: bin/jsonschema_suite check diff --git a/external/rapidjson/bin/jsonschema/LICENSE b/external/rapidjson/bin/jsonschema/LICENSE new file mode 100644 index 000000000..c28adbadd --- /dev/null +++ b/external/rapidjson/bin/jsonschema/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2012 Julian Berman + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/external/rapidjson/bin/jsonschema/README.md b/external/rapidjson/bin/jsonschema/README.md new file mode 100644 index 000000000..6d9da9493 --- /dev/null +++ b/external/rapidjson/bin/jsonschema/README.md @@ -0,0 +1,148 @@ +JSON Schema Test Suite [![Build Status](https://travis-ci.org/json-schema/JSON-Schema-Test-Suite.png?branch=develop)](https://travis-ci.org/json-schema/JSON-Schema-Test-Suite) +====================== + +This repository contains a set of JSON objects that implementors of JSON Schema +validation libraries can use to test their validators. + +It is meant to be language agnostic and should require only a JSON parser. + +The conversion of the JSON objects into tests within your test framework of +choice is still the job of the validator implementor. + +Structure of a Test +------------------- + +If you're going to use this suite, you need to know how tests are laid out. The +tests are contained in the `tests` directory at the root of this repository. + +Inside that directory is a subdirectory for each draft or version of the +schema. We'll use `draft3` as an example. + +If you look inside the draft directory, there are a number of `.json` files, +which logically group a set of test cases together. Often the grouping is by +property under test, but not always, especially within optional test files +(discussed below). + +Inside each `.json` file is a single array containing objects. It's easiest to +illustrate the structure of these with an example: + +```json + { + "description": "the description of the test case", + "schema": {"the schema that should" : "be validated against"}, + "tests": [ + { + "description": "a specific test of a valid instance", + "data": "the instance", + "valid": true + }, + { + "description": "another specific test this time, invalid", + "data": 15, + "valid": false + } + ] + } +``` + +So a description, a schema, and some tests, where tests is an array containing +one or more objects with descriptions, data, and a boolean indicating whether +they should be valid or invalid. + +Coverage +-------- + +Draft 3 and 4 should have full coverage. If you see anything missing or think +there is a useful test missing, please send a pull request or open an issue. + +Who Uses the Test Suite +----------------------- + +This suite is being used by: + +### Coffeescript ### + +* [jsck](https://github.com/pandastrike/jsck) + +### Dart ### + +* [json_schema](https://github.com/patefacio/json_schema) + +### Erlang ### + +* [jesse](https://github.com/klarna/jesse) + +### Go ### + +* [gojsonschema](https://github.com/sigu-399/gojsonschema) +* [validate-json](https://github.com/cesanta/validate-json) + +### Haskell ### + +* [aeson-schema](https://github.com/timjb/aeson-schema) +* [hjsonschema](https://github.com/seagreen/hjsonschema) + +### Java ### + +* [json-schema-validator](https://github.com/fge/json-schema-validator) + +### JavaScript ### + +* [json-schema-benchmark](https://github.com/Muscula/json-schema-benchmark) +* [direct-schema](https://github.com/IreneKnapp/direct-schema) +* [is-my-json-valid](https://github.com/mafintosh/is-my-json-valid) +* [jassi](https://github.com/iclanzan/jassi) +* [JaySchema](https://github.com/natesilva/jayschema) +* [json-schema-valid](https://github.com/ericgj/json-schema-valid) +* [Jsonary](https://github.com/jsonary-js/jsonary) +* [jsonschema](https://github.com/tdegrunt/jsonschema) +* [request-validator](https://github.com/bugventure/request-validator) +* [skeemas](https://github.com/Prestaul/skeemas) +* [tv4](https://github.com/geraintluff/tv4) +* [z-schema](https://github.com/zaggino/z-schema) +* [jsen](https://github.com/bugventure/jsen) +* [ajv](https://github.com/epoberezkin/ajv) + +### Node.js ### + +The JSON Schema Test Suite is also available as an +[npm](https://www.npmjs.com/package/json-schema-test-suite) package. +Node-specific support is maintained on the [node branch](https://github.com/json-schema/JSON-Schema-Test-Suite/tree/node). +See [NODE-README.md](https://github.com/json-schema/JSON-Schema-Test-Suite/blob/node/NODE-README.md) +for more information. + +### .NET ### + +* [Newtonsoft.Json.Schema](https://github.com/JamesNK/Newtonsoft.Json.Schema) + +### PHP ### + +* [json-schema](https://github.com/justinrainbow/json-schema) + +### Python ### + +* [jsonschema](https://github.com/Julian/jsonschema) + +### Ruby ### + +* [json-schema](https://github.com/hoxworth/json-schema) + +### Rust ### + +* [valico](https://github.com/rustless/valico) + +### Swift ### + +* [JSONSchema](https://github.com/kylef/JSONSchema.swift) + +If you use it as well, please fork and send a pull request adding yourself to +the list :). + +Contributing +------------ + +If you see something missing or incorrect, a pull request is most welcome! + +There are some sanity checks in place for testing the test suite. You can run +them with `bin/jsonschema_suite check` or `tox`. They will be run automatically by +[Travis CI](https://travis-ci.org/) as well. diff --git a/external/rapidjson/bin/jsonschema/bin/jsonschema_suite b/external/rapidjson/bin/jsonschema/bin/jsonschema_suite new file mode 100755 index 000000000..96108c86b --- /dev/null +++ b/external/rapidjson/bin/jsonschema/bin/jsonschema_suite @@ -0,0 +1,283 @@ +#! /usr/bin/env python +from __future__ import print_function +import sys +import textwrap + +try: + import argparse +except ImportError: + print(textwrap.dedent(""" + The argparse library could not be imported. jsonschema_suite requires + either Python 2.7 or for you to install argparse. You can do so by + running `pip install argparse`, `easy_install argparse` or by + downloading argparse and running `python2.6 setup.py install`. + + See https://pypi.python.org/pypi/argparse for details. + """.strip("\n"))) + sys.exit(1) + +import errno +import fnmatch +import json +import os +import random +import shutil +import unittest +import warnings + +if getattr(unittest, "skipIf", None) is None: + unittest.skipIf = lambda cond, msg : lambda fn : fn + +try: + import jsonschema +except ImportError: + jsonschema = None +else: + validators = getattr( + jsonschema.validators, "validators", jsonschema.validators + ) + + +ROOT_DIR = os.path.join( + os.path.dirname(__file__), os.pardir).rstrip("__pycache__") +SUITE_ROOT_DIR = os.path.join(ROOT_DIR, "tests") + +REMOTES = { + "integer.json": {"type": "integer"}, + "subSchemas.json": { + "integer": {"type": "integer"}, + "refToInteger": {"$ref": "#/integer"}, + }, + "folder/folderInteger.json": {"type": "integer"} +} +REMOTES_DIR = os.path.join(ROOT_DIR, "remotes") + +TESTSUITE_SCHEMA = { + "$schema": "http://json-schema.org/draft-03/schema#", + "type": "array", + "items": { + "type": "object", + "properties": { + "description": {"type": "string", "required": True}, + "schema": {"required": True}, + "tests": { + "type": "array", + "items": { + "type": "object", + "properties": { + "description": {"type": "string", "required": True}, + "data": {"required": True}, + "valid": {"type": "boolean", "required": True} + }, + "additionalProperties": False + }, + "minItems": 1 + } + }, + "additionalProperties": False, + "minItems": 1 + } +} + + +def files(paths): + for path in paths: + with open(path) as test_file: + yield json.load(test_file) + + +def groups(paths): + for test_file in files(paths): + for group in test_file: + yield group + + +def cases(paths): + for test_group in groups(paths): + for test in test_group["tests"]: + test["schema"] = test_group["schema"] + yield test + + +def collect(root_dir): + for root, dirs, files in os.walk(root_dir): + for filename in fnmatch.filter(files, "*.json"): + yield os.path.join(root, filename) + + +class SanityTests(unittest.TestCase): + @classmethod + def setUpClass(cls): + print("Looking for tests in %s" % SUITE_ROOT_DIR) + cls.test_files = list(collect(SUITE_ROOT_DIR)) + print("Found %s test files" % len(cls.test_files)) + assert cls.test_files, "Didn't find the test files!" + + def test_all_files_are_valid_json(self): + for path in self.test_files: + with open(path) as test_file: + try: + json.load(test_file) + except ValueError as error: + self.fail("%s contains invalid JSON (%s)" % (path, error)) + + def test_all_descriptions_have_reasonable_length(self): + for case in cases(self.test_files): + descript = case["description"] + self.assertLess( + len(descript), + 60, + "%r is too long! (keep it to less than 60 chars)" % (descript,) + ) + + def test_all_descriptions_are_unique(self): + for group in groups(self.test_files): + descriptions = set(test["description"] for test in group["tests"]) + self.assertEqual( + len(descriptions), + len(group["tests"]), + "%r contains a duplicate description" % (group,) + ) + + @unittest.skipIf(jsonschema is None, "Validation library not present!") + def test_all_schemas_are_valid(self): + for schema in os.listdir(SUITE_ROOT_DIR): + schema_validator = validators.get(schema) + if schema_validator is not None: + test_files = collect(os.path.join(SUITE_ROOT_DIR, schema)) + for case in cases(test_files): + try: + schema_validator.check_schema(case["schema"]) + except jsonschema.SchemaError as error: + self.fail("%s contains an invalid schema (%s)" % + (case, error)) + else: + warnings.warn("No schema validator for %s" % schema) + + @unittest.skipIf(jsonschema is None, "Validation library not present!") + def test_suites_are_valid(self): + validator = jsonschema.Draft3Validator(TESTSUITE_SCHEMA) + for tests in files(self.test_files): + try: + validator.validate(tests) + except jsonschema.ValidationError as error: + self.fail(str(error)) + + def test_remote_schemas_are_updated(self): + for url, schema in REMOTES.items(): + filepath = os.path.join(REMOTES_DIR, url) + with open(filepath) as schema_file: + self.assertEqual(json.load(schema_file), schema) + + +def main(arguments): + if arguments.command == "check": + suite = unittest.TestLoader().loadTestsFromTestCase(SanityTests) + result = unittest.TextTestRunner(verbosity=2).run(suite) + sys.exit(not result.wasSuccessful()) + elif arguments.command == "flatten": + selected_cases = [case for case in cases(collect(arguments.version))] + + if arguments.randomize: + random.shuffle(selected_cases) + + json.dump(selected_cases, sys.stdout, indent=4, sort_keys=True) + elif arguments.command == "remotes": + json.dump(REMOTES, sys.stdout, indent=4, sort_keys=True) + elif arguments.command == "dump_remotes": + if arguments.update: + shutil.rmtree(arguments.out_dir, ignore_errors=True) + + try: + os.makedirs(arguments.out_dir) + except OSError as e: + if e.errno == errno.EEXIST: + print("%s already exists. Aborting." % arguments.out_dir) + sys.exit(1) + raise + + for url, schema in REMOTES.items(): + filepath = os.path.join(arguments.out_dir, url) + + try: + os.makedirs(os.path.dirname(filepath)) + except OSError as e: + if e.errno != errno.EEXIST: + raise + + with open(filepath, "wb") as out_file: + json.dump(schema, out_file, indent=4, sort_keys=True) + elif arguments.command == "serve": + try: + from flask import Flask, jsonify + except ImportError: + print(textwrap.dedent(""" + The Flask library is required to serve the remote schemas. + + You can install it by running `pip install Flask`. + + Alternatively, see the `jsonschema_suite remotes` or + `jsonschema_suite dump_remotes` commands to create static files + that can be served with your own web server. + """.strip("\n"))) + sys.exit(1) + + app = Flask(__name__) + + @app.route("/") + def serve_path(path): + if path in REMOTES: + return jsonify(REMOTES[path]) + return "Document does not exist.", 404 + + app.run(port=1234) + + +parser = argparse.ArgumentParser( + description="JSON Schema Test Suite utilities", +) +subparsers = parser.add_subparsers(help="utility commands", dest="command") + +check = subparsers.add_parser("check", help="Sanity check the test suite.") + +flatten = subparsers.add_parser( + "flatten", + help="Output a flattened file containing a selected version's test cases." +) +flatten.add_argument( + "--randomize", + action="store_true", + help="Randomize the order of the outputted cases.", +) +flatten.add_argument( + "version", help="The directory containing the version to output", +) + +remotes = subparsers.add_parser( + "remotes", + help="Output the expected URLs and their associated schemas for remote " + "ref tests as a JSON object." +) + +dump_remotes = subparsers.add_parser( + "dump_remotes", help="Dump the remote ref schemas into a file tree", +) +dump_remotes.add_argument( + "--update", + action="store_true", + help="Update the remotes in an existing directory.", +) +dump_remotes.add_argument( + "--out-dir", + default=REMOTES_DIR, + type=os.path.abspath, + help="The output directory to create as the root of the file tree", +) + +serve = subparsers.add_parser( + "serve", + help="Start a webserver to serve schemas used by remote ref tests." +) + +if __name__ == "__main__": + main(parser.parse_args()) diff --git a/external/rapidjson/bin/jsonschema/remotes/folder/folderInteger.json b/external/rapidjson/bin/jsonschema/remotes/folder/folderInteger.json new file mode 100644 index 000000000..dbe5c758e Binary files /dev/null and b/external/rapidjson/bin/jsonschema/remotes/folder/folderInteger.json differ diff --git a/external/rapidjson/bin/jsonschema/remotes/integer.json b/external/rapidjson/bin/jsonschema/remotes/integer.json new file mode 100644 index 000000000..dbe5c758e Binary files /dev/null and b/external/rapidjson/bin/jsonschema/remotes/integer.json differ diff --git a/external/rapidjson/bin/jsonschema/remotes/subSchemas.json b/external/rapidjson/bin/jsonschema/remotes/subSchemas.json new file mode 100644 index 000000000..8b6d8f842 Binary files /dev/null and b/external/rapidjson/bin/jsonschema/remotes/subSchemas.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft3/additionalItems.json b/external/rapidjson/bin/jsonschema/tests/draft3/additionalItems.json new file mode 100644 index 000000000..6d4bff51c Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft3/additionalItems.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft3/additionalProperties.json b/external/rapidjson/bin/jsonschema/tests/draft3/additionalProperties.json new file mode 100644 index 000000000..40831f9e9 Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft3/additionalProperties.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft3/default.json b/external/rapidjson/bin/jsonschema/tests/draft3/default.json new file mode 100644 index 000000000..17629779f Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft3/default.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft3/dependencies.json b/external/rapidjson/bin/jsonschema/tests/draft3/dependencies.json new file mode 100644 index 000000000..2f6ae489a Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft3/dependencies.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft3/disallow.json b/external/rapidjson/bin/jsonschema/tests/draft3/disallow.json new file mode 100644 index 000000000..a5c9d90cc Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft3/disallow.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft3/divisibleBy.json b/external/rapidjson/bin/jsonschema/tests/draft3/divisibleBy.json new file mode 100644 index 000000000..ef7cc1489 Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft3/divisibleBy.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft3/enum.json b/external/rapidjson/bin/jsonschema/tests/draft3/enum.json new file mode 100644 index 000000000..0c83f0804 Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft3/enum.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft3/extends.json b/external/rapidjson/bin/jsonschema/tests/draft3/extends.json new file mode 100644 index 000000000..909bce575 Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft3/extends.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft3/items.json b/external/rapidjson/bin/jsonschema/tests/draft3/items.json new file mode 100644 index 000000000..f5e18a138 Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft3/items.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft3/maxItems.json b/external/rapidjson/bin/jsonschema/tests/draft3/maxItems.json new file mode 100644 index 000000000..3b53a6b37 Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft3/maxItems.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft3/maxLength.json b/external/rapidjson/bin/jsonschema/tests/draft3/maxLength.json new file mode 100644 index 000000000..4de42bcab Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft3/maxLength.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft3/maximum.json b/external/rapidjson/bin/jsonschema/tests/draft3/maximum.json new file mode 100644 index 000000000..86c7b89c9 Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft3/maximum.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft3/minItems.json b/external/rapidjson/bin/jsonschema/tests/draft3/minItems.json new file mode 100644 index 000000000..ed5118815 Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft3/minItems.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft3/minLength.json b/external/rapidjson/bin/jsonschema/tests/draft3/minLength.json new file mode 100644 index 000000000..3f09158de Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft3/minLength.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft3/minimum.json b/external/rapidjson/bin/jsonschema/tests/draft3/minimum.json new file mode 100644 index 000000000..d5bf000bc Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft3/minimum.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft3/optional/bignum.json b/external/rapidjson/bin/jsonschema/tests/draft3/optional/bignum.json new file mode 100644 index 000000000..ccc7c17fe Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft3/optional/bignum.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft3/optional/format.json b/external/rapidjson/bin/jsonschema/tests/draft3/optional/format.json new file mode 100644 index 000000000..3ca7319dd Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft3/optional/format.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft3/optional/jsregex.json b/external/rapidjson/bin/jsonschema/tests/draft3/optional/jsregex.json new file mode 100644 index 000000000..03fe97724 Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft3/optional/jsregex.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft3/optional/zeroTerminatedFloats.json b/external/rapidjson/bin/jsonschema/tests/draft3/optional/zeroTerminatedFloats.json new file mode 100644 index 000000000..9b50ea277 Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft3/optional/zeroTerminatedFloats.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft3/pattern.json b/external/rapidjson/bin/jsonschema/tests/draft3/pattern.json new file mode 100644 index 000000000..25e729973 Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft3/pattern.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft3/patternProperties.json b/external/rapidjson/bin/jsonschema/tests/draft3/patternProperties.json new file mode 100644 index 000000000..18586e5da Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft3/patternProperties.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft3/properties.json b/external/rapidjson/bin/jsonschema/tests/draft3/properties.json new file mode 100644 index 000000000..cd1644dcd Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft3/properties.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft3/ref.json b/external/rapidjson/bin/jsonschema/tests/draft3/ref.json new file mode 100644 index 000000000..903ecb6bc Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft3/ref.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft3/refRemote.json b/external/rapidjson/bin/jsonschema/tests/draft3/refRemote.json new file mode 100644 index 000000000..4ca804732 Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft3/refRemote.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft3/required.json b/external/rapidjson/bin/jsonschema/tests/draft3/required.json new file mode 100644 index 000000000..aaaf02427 Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft3/required.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft3/type.json b/external/rapidjson/bin/jsonschema/tests/draft3/type.json new file mode 100644 index 000000000..337da1206 Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft3/type.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft3/uniqueItems.json b/external/rapidjson/bin/jsonschema/tests/draft3/uniqueItems.json new file mode 100644 index 000000000..c1f4ab99c Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft3/uniqueItems.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft4/additionalItems.json b/external/rapidjson/bin/jsonschema/tests/draft4/additionalItems.json new file mode 100644 index 000000000..521745c8d Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft4/additionalItems.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft4/additionalProperties.json b/external/rapidjson/bin/jsonschema/tests/draft4/additionalProperties.json new file mode 100644 index 000000000..40831f9e9 Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft4/additionalProperties.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft4/allOf.json b/external/rapidjson/bin/jsonschema/tests/draft4/allOf.json new file mode 100644 index 000000000..bbb5f89e4 Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft4/allOf.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft4/anyOf.json b/external/rapidjson/bin/jsonschema/tests/draft4/anyOf.json new file mode 100644 index 000000000..a58714afd Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft4/anyOf.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft4/default.json b/external/rapidjson/bin/jsonschema/tests/draft4/default.json new file mode 100644 index 000000000..17629779f Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft4/default.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft4/definitions.json b/external/rapidjson/bin/jsonschema/tests/draft4/definitions.json new file mode 100644 index 000000000..cf935a321 Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft4/definitions.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft4/dependencies.json b/external/rapidjson/bin/jsonschema/tests/draft4/dependencies.json new file mode 100644 index 000000000..7b9b16a7e Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft4/dependencies.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft4/enum.json b/external/rapidjson/bin/jsonschema/tests/draft4/enum.json new file mode 100644 index 000000000..f124436a7 Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft4/enum.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft4/items.json b/external/rapidjson/bin/jsonschema/tests/draft4/items.json new file mode 100644 index 000000000..f5e18a138 Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft4/items.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft4/maxItems.json b/external/rapidjson/bin/jsonschema/tests/draft4/maxItems.json new file mode 100644 index 000000000..3b53a6b37 Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft4/maxItems.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft4/maxLength.json b/external/rapidjson/bin/jsonschema/tests/draft4/maxLength.json new file mode 100644 index 000000000..811d35b25 Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft4/maxLength.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft4/maxProperties.json b/external/rapidjson/bin/jsonschema/tests/draft4/maxProperties.json new file mode 100644 index 000000000..d282446ad Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft4/maxProperties.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft4/maximum.json b/external/rapidjson/bin/jsonschema/tests/draft4/maximum.json new file mode 100644 index 000000000..86c7b89c9 Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft4/maximum.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft4/minItems.json b/external/rapidjson/bin/jsonschema/tests/draft4/minItems.json new file mode 100644 index 000000000..ed5118815 Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft4/minItems.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft4/minLength.json b/external/rapidjson/bin/jsonschema/tests/draft4/minLength.json new file mode 100644 index 000000000..3f09158de Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft4/minLength.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft4/minProperties.json b/external/rapidjson/bin/jsonschema/tests/draft4/minProperties.json new file mode 100644 index 000000000..a72c7d293 Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft4/minProperties.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft4/minimum.json b/external/rapidjson/bin/jsonschema/tests/draft4/minimum.json new file mode 100644 index 000000000..d5bf000bc Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft4/minimum.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft4/multipleOf.json b/external/rapidjson/bin/jsonschema/tests/draft4/multipleOf.json new file mode 100644 index 000000000..ca3b76180 Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft4/multipleOf.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft4/not.json b/external/rapidjson/bin/jsonschema/tests/draft4/not.json new file mode 100644 index 000000000..cbb7f46bf Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft4/not.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft4/oneOf.json b/external/rapidjson/bin/jsonschema/tests/draft4/oneOf.json new file mode 100644 index 000000000..1eaa4e479 Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft4/oneOf.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft4/optional/bignum.json b/external/rapidjson/bin/jsonschema/tests/draft4/optional/bignum.json new file mode 100644 index 000000000..ccc7c17fe Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft4/optional/bignum.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft4/optional/format.json b/external/rapidjson/bin/jsonschema/tests/draft4/optional/format.json new file mode 100644 index 000000000..aacfd1198 Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft4/optional/format.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft4/optional/zeroTerminatedFloats.json b/external/rapidjson/bin/jsonschema/tests/draft4/optional/zeroTerminatedFloats.json new file mode 100644 index 000000000..9b50ea277 Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft4/optional/zeroTerminatedFloats.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft4/pattern.json b/external/rapidjson/bin/jsonschema/tests/draft4/pattern.json new file mode 100644 index 000000000..25e729973 Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft4/pattern.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft4/patternProperties.json b/external/rapidjson/bin/jsonschema/tests/draft4/patternProperties.json new file mode 100644 index 000000000..18586e5da Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft4/patternProperties.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft4/properties.json b/external/rapidjson/bin/jsonschema/tests/draft4/properties.json new file mode 100644 index 000000000..cd1644dcd Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft4/properties.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft4/ref.json b/external/rapidjson/bin/jsonschema/tests/draft4/ref.json new file mode 100644 index 000000000..7e8055224 Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft4/ref.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft4/refRemote.json b/external/rapidjson/bin/jsonschema/tests/draft4/refRemote.json new file mode 100644 index 000000000..4ca804732 Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft4/refRemote.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft4/required.json b/external/rapidjson/bin/jsonschema/tests/draft4/required.json new file mode 100644 index 000000000..612f73f34 Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft4/required.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft4/type.json b/external/rapidjson/bin/jsonschema/tests/draft4/type.json new file mode 100644 index 000000000..db42a44d3 Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft4/type.json differ diff --git a/external/rapidjson/bin/jsonschema/tests/draft4/uniqueItems.json b/external/rapidjson/bin/jsonschema/tests/draft4/uniqueItems.json new file mode 100644 index 000000000..c1f4ab99c Binary files /dev/null and b/external/rapidjson/bin/jsonschema/tests/draft4/uniqueItems.json differ diff --git a/external/rapidjson/bin/jsonschema/tox.ini b/external/rapidjson/bin/jsonschema/tox.ini new file mode 100644 index 000000000..5301222a8 --- /dev/null +++ b/external/rapidjson/bin/jsonschema/tox.ini @@ -0,0 +1,8 @@ +[tox] +minversion = 1.6 +envlist = py27 +skipsdist = True + +[testenv] +deps = jsonschema +commands = {envpython} bin/jsonschema_suite check diff --git a/external/rapidjson/bin/types/alotofkeys.json b/external/rapidjson/bin/types/alotofkeys.json new file mode 100644 index 000000000..3fc052e34 Binary files /dev/null and b/external/rapidjson/bin/types/alotofkeys.json differ diff --git a/external/rapidjson/bin/types/booleans.json b/external/rapidjson/bin/types/booleans.json new file mode 100644 index 000000000..2dcbb5fe8 Binary files /dev/null and b/external/rapidjson/bin/types/booleans.json differ diff --git a/external/rapidjson/bin/types/floats.json b/external/rapidjson/bin/types/floats.json new file mode 100644 index 000000000..12b94a11d Binary files /dev/null and b/external/rapidjson/bin/types/floats.json differ diff --git a/external/rapidjson/bin/types/guids.json b/external/rapidjson/bin/types/guids.json new file mode 100644 index 000000000..9d7f5dbc8 Binary files /dev/null and b/external/rapidjson/bin/types/guids.json differ diff --git a/external/rapidjson/bin/types/integers.json b/external/rapidjson/bin/types/integers.json new file mode 100644 index 000000000..5dd05e097 Binary files /dev/null and b/external/rapidjson/bin/types/integers.json differ diff --git a/external/rapidjson/bin/types/mixed.json b/external/rapidjson/bin/types/mixed.json new file mode 100644 index 000000000..43e9a1d7b Binary files /dev/null and b/external/rapidjson/bin/types/mixed.json differ diff --git a/external/rapidjson/bin/types/nulls.json b/external/rapidjson/bin/types/nulls.json new file mode 100644 index 000000000..7a636ec87 Binary files /dev/null and b/external/rapidjson/bin/types/nulls.json differ diff --git a/external/rapidjson/bin/types/paragraphs.json b/external/rapidjson/bin/types/paragraphs.json new file mode 100644 index 000000000..8ab3e1c56 Binary files /dev/null and b/external/rapidjson/bin/types/paragraphs.json differ diff --git a/external/rapidjson/bin/types/readme.txt b/external/rapidjson/bin/types/readme.txt new file mode 100644 index 000000000..da1dae675 --- /dev/null +++ b/external/rapidjson/bin/types/readme.txt @@ -0,0 +1 @@ +Test data obtained from https://github.com/xpol/lua-rapidjson/tree/master/performance diff --git a/external/rapidjson/bin/unittestschema/address.json b/external/rapidjson/bin/unittestschema/address.json new file mode 100644 index 000000000..c3cf64261 Binary files /dev/null and b/external/rapidjson/bin/unittestschema/address.json differ diff --git a/external/rapidjson/bin/unittestschema/allOf_address.json b/external/rapidjson/bin/unittestschema/allOf_address.json new file mode 100644 index 000000000..fd501f66d Binary files /dev/null and b/external/rapidjson/bin/unittestschema/allOf_address.json differ diff --git a/external/rapidjson/bin/unittestschema/anyOf_address.json b/external/rapidjson/bin/unittestschema/anyOf_address.json new file mode 100644 index 000000000..5c90308f4 Binary files /dev/null and b/external/rapidjson/bin/unittestschema/anyOf_address.json differ diff --git a/external/rapidjson/bin/unittestschema/idandref.json b/external/rapidjson/bin/unittestschema/idandref.json new file mode 100644 index 000000000..ad485d29f Binary files /dev/null and b/external/rapidjson/bin/unittestschema/idandref.json differ diff --git a/external/rapidjson/bin/unittestschema/oneOf_address.json b/external/rapidjson/bin/unittestschema/oneOf_address.json new file mode 100644 index 000000000..a5baadd2a Binary files /dev/null and b/external/rapidjson/bin/unittestschema/oneOf_address.json differ diff --git a/external/rapidjson/contrib/natvis/LICENSE b/external/rapidjson/contrib/natvis/LICENSE new file mode 100644 index 000000000..f57da96cf --- /dev/null +++ b/external/rapidjson/contrib/natvis/LICENSE @@ -0,0 +1,45 @@ +The MIT License (MIT) + +Copyright (c) 2017 Bart Muzzin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +Derived from: + +The MIT License (MIT) + +Copyright (c) 2015 mojmir svoboda + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/external/rapidjson/contrib/natvis/README.md b/external/rapidjson/contrib/natvis/README.md new file mode 100644 index 000000000..9685c7f7c --- /dev/null +++ b/external/rapidjson/contrib/natvis/README.md @@ -0,0 +1,7 @@ +# rapidjson.natvis + +This file can be used as a [Visual Studio Visualizer](https://docs.microsoft.com/en-gb/visualstudio/debugger/create-custom-views-of-native-objects) to aid in visualizing rapidjson structures within the Visual Studio debugger. Natvis visualizers are supported in Visual Studio 2012 and later. To install, copy the file into this directory: + +`%USERPROFILE%\Documents\Visual Studio 2012\Visualizers` + +Each version of Visual Studio has a similar directory, it must be copied into each directory to be used with that particular version. In Visual Studio 2015 and later, this can be done without restarting Visual Studio (a new debugging session must be started). diff --git a/external/rapidjson/contrib/natvis/rapidjson.natvis b/external/rapidjson/contrib/natvis/rapidjson.natvis new file mode 100644 index 000000000..e7bd44b6e --- /dev/null +++ b/external/rapidjson/contrib/natvis/rapidjson.natvis @@ -0,0 +1,38 @@ + + + + + null + true + false + {(const Ch*)data_.ss.str,na} + {(const Ch*)((size_t)data_.s.str & 0x0000FFFFFFFFFFFF),na} + {data_.n.i.i} + {data_.n.u.u} + {data_.n.i64} + {data_.n.u64} + {data_.n.d} + Object members={data_.o.size} + Array members={data_.a.size} + + data_.o.size + data_.o.capacity + + data_.o.size + + (rapidjson::GenericMember<$T1,$T2>*)(((size_t)data_.o.members) & 0x0000FFFFFFFFFFFF) + + + data_.a.size + data_.a.capacity + + data_.a.size + + (rapidjson::GenericValue<$T1,$T2>*)(((size_t)data_.a.elements) & 0x0000FFFFFFFFFFFF) + + + + + + + diff --git a/external/rapidjson/doc/CMakeLists.txt b/external/rapidjson/doc/CMakeLists.txt new file mode 100644 index 000000000..c5345ba69 --- /dev/null +++ b/external/rapidjson/doc/CMakeLists.txt @@ -0,0 +1,27 @@ +find_package(Doxygen) + +IF(NOT DOXYGEN_FOUND) + MESSAGE(STATUS "No Doxygen found. Documentation won't be built") +ELSE() + file(GLOB SOURCES ${CMAKE_CURRENT_LIST_DIR}/../include/*) + file(GLOB MARKDOWN_DOC ${CMAKE_CURRENT_LIST_DIR}/../doc/*.md) + list(APPEND MARKDOWN_DOC ${CMAKE_CURRENT_LIST_DIR}/../readme.md) + + CONFIGURE_FILE(Doxyfile.in Doxyfile @ONLY) + CONFIGURE_FILE(Doxyfile.zh-cn.in Doxyfile.zh-cn @ONLY) + + file(GLOB DOXYFILES ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile*) + + add_custom_command(OUTPUT html + COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile + COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile.zh-cn + COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/html + DEPENDS ${MARKDOWN_DOC} ${SOURCES} ${DOXYFILES} + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/../ + ) + + add_custom_target(doc ALL DEPENDS html) + install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html + DESTINATION ${DOC_INSTALL_DIR} + COMPONENT doc) +ENDIF() diff --git a/external/rapidjson/doc/Doxyfile.in b/external/rapidjson/doc/Doxyfile.in new file mode 100644 index 000000000..6e79f9371 --- /dev/null +++ b/external/rapidjson/doc/Doxyfile.in @@ -0,0 +1,2369 @@ +# Doxyfile 1.8.7 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all text +# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv +# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv +# for the list of possible encodings. +# The default value is: UTF-8. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. + +PROJECT_NAME = RapidJSON + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. + +PROJECT_NUMBER = + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = "A fast JSON parser/generator for C++ with both SAX/DOM style API" + +# With the PROJECT_LOGO tag one can specify an logo or icon that is included in +# the documentation. The maximum height of the logo should not exceed 55 pixels +# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo +# to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If +# left blank the current directory will be used. + +OUTPUT_DIRECTORY = @CMAKE_CURRENT_BINARY_DIR@ + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub- +# directories (in 2 levels) under the output directory of each output format and +# will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. +# The default value is: NO. + +CREATE_SUBDIRS = NO + +# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode +# U+3044. +# The default value is: NO. + +ALLOW_UNICODE_NAMES = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, +# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), +# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, +# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, +# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, +# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, +# Ukrainian and Vietnamese. +# The default value is: English. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member +# descriptions after the members that are listed in the file and class +# documentation (similar to Javadoc). Set to NO to disable this. +# The default value is: YES. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief +# description of a member or function before the detailed description +# +# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. +# The default value is: YES. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator that is +# used to form the text in various listings. Each string in this list, if found +# as the leading text of the brief description, will be stripped from the text +# and the result, after processing the whole list, is used as the annotated +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, +# specifies, contains, represents, a, an and the. + +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# doxygen will generate a detailed section even if there is only a brief +# description. +# The default value is: NO. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. +# The default value is: NO. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path +# before files name in the file list and in the header files. If set to NO the +# shortest path that makes the file name unique will be used +# The default value is: YES. + +FULL_PATH_NAMES = YES + +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand +# part of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to +# strip. +# +# Note that you can specify absolute paths here, but also relative paths, which +# will be relative from the directory where doxygen is started. +# This tag requires that the tag FULL_PATH_NAMES is set to YES. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the +# path mentioned in the documentation of a class, which tells the reader which +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should +# specify the list of include paths that are normally passed to the compiler +# using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems doesn't +# support long names like on DOS, Mac, or CD-ROM. +# The default value is: NO. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief +# description.) +# The default value is: NO. + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first +# line (until the first dot) of a Qt-style comment as the brief description. If +# set to NO, the Qt-style will behave just like regular Qt-style comments (thus +# requiring an explicit \brief command for a brief description.) +# The default value is: NO. + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a +# multi-line C++ special comment block (i.e. a block of //! or /// comments) as +# a brief description. This used to be the default behavior. The new default is +# to treat a multi-line C++ comment block as a detailed description. Set this +# tag to YES if you prefer the old behavior instead. +# +# Note that setting this tag to YES also means that rational rose comments are +# not recognized any more. +# The default value is: NO. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the +# documentation from any documented member that it re-implements. +# The default value is: YES. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a +# new page for each member. If set to NO, the documentation of a member will be +# part of the file/class/namespace that contains it. +# The default value is: NO. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen +# uses this value to replace tabs by spaces in code fragments. +# Minimum value: 1, maximum value: 16, default value: 4. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that act as commands in +# the documentation. An alias has the form: +# name=value +# For example adding +# "sideeffect=@par Side Effects:\n" +# will allow you to put the command \sideeffect (or @sideeffect) in the +# documentation, which will result in a user-defined paragraph with heading +# "Side Effects:". You can put \n's in the value part of an alias to insert +# newlines. + +ALIASES = + +# This tag can be used to specify a number of word-keyword mappings (TCL only). +# A mapping has the form "name=value". For example adding "class=itcl::class" +# will allow you to use the command class in the itcl::class meaning. + +TCL_SUBST = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. For +# instance, some of the names that are used will be different. The list of all +# members will be omitted, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, and +# language is one of the parsers supported by doxygen: IDL, Java, Javascript, +# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: +# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: +# Fortran. In the later case the parser tries to guess whether the code is fixed +# or free formatted code, this is the default for Fortran type files), VHDL. For +# instance to make doxygen treat .inc files as Fortran files (default is PHP), +# and .f files as C (default is Fortran), use: inc=Fortran f=C. +# +# Note For files without extension you can use no_extension as a placeholder. +# +# Note that for custom extensions you also need to set FILE_PATTERNS otherwise +# the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments +# according to the Markdown format, which allows for more readable +# documentation. See http://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you can +# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in +# case of backward compatibilities issues. +# The default value is: YES. + +MARKDOWN_SUPPORT = YES + +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by by putting a % sign in front of the word +# or globally by setting AUTOLINK_SUPPORT to NO. +# The default value is: YES. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. +# The default value is: NO. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. +# The default value is: NO. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. +# The default value is: NO. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES to allow class member groups of the same type +# (for instance a group of public functions) to be put as a subgroup of that +# type (e.g. under the Public Functions section). Set it to NO to prevent +# subgrouping. Alternatively, this can be done per class using the +# \nosubgrouping command. +# The default value is: YES. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions +# are shown inside the group in which they are included (e.g. using \ingroup) +# instead of on a separate page (for HTML and Man pages) or section (for LaTeX +# and RTF). +# +# Note that this feature does not work in combination with +# SEPARATE_MEMBER_PAGES. +# The default value is: NO. + +INLINE_GROUPED_CLASSES = YES + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions +# with only public data fields or simple typedef fields will be shown inline in +# the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# Man pages) or section (for LaTeX and RTF). +# The default value is: NO. + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or +# enum is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically be +# useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. +# The default value is: NO. + +TYPEDEF_HIDES_STRUCT = NO + +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can be +# an expensive process and often the same symbol appears multiple times in the +# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small +# doxygen will become slower. If the cache is too large, memory is wasted. The +# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range +# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 +# symbols. At the end of a run doxygen will report the cache usage and suggest +# the optimal cache size from a speed point of view. +# Minimum value: 0, maximum value: 9, default value: 0. + +LOOKUP_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. + +EXTRACT_ALL = NO + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will +# be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal +# scope will be included in the documentation. +# The default value is: NO. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file will be +# included in the documentation. +# The default value is: NO. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO +# only classes defined in header files are included. Does not have any effect +# for Java sources. +# The default value is: YES. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local methods, +# which are defined in the implementation section but not in the interface are +# included in the documentation. If set to NO only methods in the interface are +# included. +# The default value is: NO. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base name of +# the file that contains the anonymous namespace. By default anonymous namespace +# are hidden. +# The default value is: NO. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all +# undocumented members inside documented classes or files. If set to NO these +# members will be included in the various overviews, but no documentation +# section is generated. This option has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. If set +# to NO these classes will be included in the various overviews. This option has +# no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend +# (class|struct|union) declarations. If set to NO these declarations will be +# included in the documentation. +# The default value is: NO. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any +# documentation blocks found inside the body of a function. If set to NO these +# blocks will be appended to the function's detailed documentation block. +# The default value is: NO. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation that is typed after a +# \internal command is included. If the tag is set to NO then the documentation +# will be excluded. Set it to YES to include the internal documentation. +# The default value is: NO. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file +# names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. +# The default value is: system dependent. + +CASE_SENSE_NAMES = NO + +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES the +# scope will be hidden. +# The default value is: NO. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of +# the files that are included by a file in the documentation of that file. +# The default value is: YES. + +SHOW_INCLUDE_FILES = YES + +# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each +# grouped member an include statement to the documentation, telling the reader +# which file to include in order to use the member. +# The default value is: NO. + +SHOW_GROUPED_MEMB_INC = NO + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include +# files with double quotes in the documentation rather than with sharp brackets. +# The default value is: NO. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the +# documentation for inline members. +# The default value is: YES. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO the members will appear in declaration order. +# The default value is: YES. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief +# descriptions of file, namespace and class members alphabetically by member +# name. If set to NO the members will appear in declaration order. Note that +# this will also influence the order of the classes in the class list. +# The default value is: NO. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the +# (brief and detailed) documentation of class members so that constructors and +# destructors are listed first. If set to NO the constructors will appear in the +# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. +# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief +# member documentation. +# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting +# detailed member documentation. +# The default value is: NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy +# of group names into alphabetical order. If set to NO the group names will +# appear in their defined order. +# The default value is: NO. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper +# type resolution of all parameters of a function it will reject a match between +# the prototype and the implementation of a member function even if there is +# only one candidate or it is obvious which candidate to choose by doing a +# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still +# accept a match between prototype and implementation in such cases. +# The default value is: NO. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the +# todo list. This list is created by putting \todo commands in the +# documentation. +# The default value is: YES. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the +# test list. This list is created by putting \test commands in the +# documentation. +# The default value is: YES. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug +# list. This list is created by putting \bug commands in the documentation. +# The default value is: YES. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO) +# the deprecated list. This list is created by putting \deprecated commands in +# the documentation. +# The default value is: YES. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional documentation +# sections, marked by \if ... \endif and \cond +# ... \endcond blocks. + +ENABLED_SECTIONS = $(RAPIDJSON_SECTIONS) + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the +# initial value of a variable or macro / define can have for it to appear in the +# documentation. If the initializer consists of more lines than specified here +# it will be hidden. Use a value of 0 to hide initializers completely. The +# appearance of the value of individual variables and macros / defines can be +# controlled using \showinitializer or \hideinitializer command in the +# documentation regardless of this setting. +# Minimum value: 0, maximum value: 10000, default value: 30. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at +# the bottom of the documentation of classes and structs. If set to YES the list +# will mention the files that were used to generate the documentation. +# The default value is: YES. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. + +SHOW_NAMESPACES = NO + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command command input-file, where command is the value of the +# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided +# by doxygen. Whatever the program writes to standard output is used as the file +# version. For an example see the documentation. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. You can +# optionally specify a file name after the option, if omitted DoxygenLayout.xml +# will be used as the name of the layout file. +# +# Note that if you run doxygen from a directory containing a file called +# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE +# tag is left empty. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files containing +# the reference definitions. This must be a list of .bib files. The .bib +# extension is automatically appended if omitted. This requires the bibtex tool +# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. +# For LaTeX the style of the bibliography can be controlled using +# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the +# search path. Do not use file names with spaces, bibtex cannot handle them. See +# also \cite for info how to create references. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated to +# standard output by doxygen. If QUIET is set to YES this implies that the +# messages are off. +# The default value is: NO. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES +# this implies that the warnings are on. +# +# Tip: Turn warnings on while writing the documentation. +# The default value is: YES. + +WARNINGS = YES + +# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate +# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: YES. + +WARN_IF_UNDOCUMENTED = YES + +# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some parameters +# in a documented function, or documenting parameters that don't exist or using +# markup commands wrongly. +# The default value is: YES. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that +# are documented, but have no documentation for their parameters or return +# value. If set to NO doxygen will only warn about wrong or incomplete parameter +# documentation, but not about the absence of documentation. +# The default value is: NO. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that doxygen +# can produce. The string should contain the $file, $line, and $text tags, which +# will be replaced by the file and line number from which the warning originated +# and the warning text. Optionally the format may contain $version, which will +# be replaced by the version of the file (if it could be obtained via +# FILE_VERSION_FILTER) +# The default value is: $file:$line: $text. + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning and error +# messages should be written. If left blank the output is written to standard +# error (stderr). + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. +# Note: If this tag is empty the current directory is searched. + +INPUT = readme.md \ + CHANGELOG.md \ + include/rapidjson/rapidjson.h \ + include/ \ + doc/features.md \ + doc/tutorial.md \ + doc/pointer.md \ + doc/stream.md \ + doc/encoding.md \ + doc/dom.md \ + doc/sax.md \ + doc/schema.md \ + doc/performance.md \ + doc/internals.md \ + doc/faq.md + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses +# libiconv (or the iconv built into libc) for the transcoding. See the libiconv +# documentation (see: http://www.gnu.org/software/libiconv) for the list of +# possible encodings. +# The default value is: UTF-8. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank the +# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii, +# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, +# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, +# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, +# *.qsf, *.as and *.js. + +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.inc \ + *.md + +# The RECURSIVE tag can be used to specify whether or not subdirectories should +# be searched for input files as well. +# The default value is: NO. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = ./include/rapidjson/msinttypes/ + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. +# The default value is: NO. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories use the pattern */test/* + +EXCLUDE_SYMBOLS = internal + +# The EXAMPLE_PATH tag can be used to specify one or more files or directories +# that contain example code fragments that are included (see the \include +# command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank all +# files are included. + +EXAMPLE_PATTERNS = * + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude commands +# irrespective of the value of the RECURSIVE tag. +# The default value is: NO. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or directories +# that contain images that are to be included in the documentation (see the +# \image command). + +IMAGE_PATH = ./doc + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command: +# +# +# +# where is the value of the INPUT_FILTER tag, and is the +# name of an input file. Doxygen will then use the output that the filter +# program writes to standard output. If FILTER_PATTERNS is specified, this tag +# will be ignored. +# +# Note that the filter must not add or remove lines; it is applied before the +# code is scanned, but not when the output code is generated. If lines are added +# or removed, the anchors will not be placed correctly. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: pattern=filter +# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how +# filters are used. If the FILTER_PATTERNS tag is empty or if none of the +# patterns match the file name, INPUT_FILTER is applied. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER ) will also be used to filter the input files that are used for +# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). +# The default value is: NO. + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and +# it is also possible to disable source filtering for a specific pattern using +# *.ext= (so without naming a filter). +# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. + +FILTER_SOURCE_PATTERNS = + +# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (index.html). This can be useful if you have a project on for instance GitHub +# and want to reuse the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = readme.md + +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will be +# generated. Documented entities will be cross-referenced with these sources. +# +# Note: To get rid of all source code in the generated output, make sure that +# also VERBATIM_HEADERS is set to NO. +# The default value is: NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body of functions, +# classes and enums directly into the documentation. +# The default value is: NO. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any +# special comment blocks from generated source code fragments. Normal C, C++ and +# Fortran comments will always remain visible. +# The default value is: YES. + +STRIP_CODE_COMMENTS = NO + +# If the REFERENCED_BY_RELATION tag is set to YES then for each documented +# function all documented functions referencing it will be listed. +# The default value is: NO. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES then for each documented function +# all documented entities called/used by that function will be listed. +# The default value is: NO. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set +# to YES, then the hyperlinks from functions in REFERENCES_RELATION and +# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will +# link to the documentation. +# The default value is: YES. + +REFERENCES_LINK_SOURCE = YES + +# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the +# source code will show a tooltip with additional information such as prototype, +# brief description and links to the definition and documentation. Since this +# will make the HTML file larger and loading of large files a bit slower, you +# can opt to disable this feature. +# The default value is: YES. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +SOURCE_TOOLTIPS = YES + +# If the USE_HTAGS tag is set to YES then the references to source code will +# point to the HTML generated by the htags(1) tool instead of doxygen built-in +# source browser. The htags tool is part of GNU's global source tagging system +# (see http://www.gnu.org/software/global/global.html). You will need version +# 4.8.6 or higher. +# +# To use it do the following: +# - Install the latest version of global +# - Enable SOURCE_BROWSER and USE_HTAGS in the config file +# - Make sure the INPUT points to the root of the source tree +# - Run doxygen as normal +# +# Doxygen will invoke htags (and that will in turn invoke gtags), so these +# tools must be available from the command line (i.e. in the search path). +# +# The result: instead of the source browser generated by doxygen, the links to +# source code will now point to the output of htags. +# The default value is: NO. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a +# verbatim copy of the header file for each class for which an include is +# specified. Set to NO to disable this. +# See also: Section \class. +# The default value is: YES. + +VERBATIM_HEADERS = YES + +# If the CLANG_ASSISTED_PARSING tag is set to YES, then doxygen will use the +# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the +# cost of reduced performance. This can be particularly helpful with template +# rich C++ code for which doxygen's built-in parser lacks the necessary type +# information. +# Note: The availability of this option depends on whether or not doxygen was +# compiled with the --with-libclang option. +# The default value is: NO. + +CLANG_ASSISTED_PARSING = NO + +# If clang assisted parsing is enabled you can provide the compiler with command +# line options that you would normally use when invoking the compiler. Note that +# the include paths will already be set by doxygen for the files and directories +# specified with INPUT and INCLUDE_PATH. +# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. + +CLANG_OPTIONS = + +#--------------------------------------------------------------------------- +# Configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all +# compounds will be generated. Enable this if the project contains a lot of +# classes, structs, unions or interfaces. +# The default value is: YES. + +ALPHABETICAL_INDEX = NO + +# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in +# which the alphabetical index list will be split. +# Minimum value: 1, maximum value: 20, default value: 5. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all classes will +# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag +# can be used to specify a prefix (or a list of prefixes) that should be ignored +# while generating the index headers. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output +# The default value is: YES. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each +# generated HTML page (for example: .htm, .php, .asp). +# The default value is: .html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a user-defined HTML header file for +# each generated HTML page. If the tag is left blank doxygen will generate a +# standard header. +# +# To get valid HTML the header file that includes any scripts and style sheets +# that doxygen needs, which is dependent on the configuration options used (e.g. +# the setting GENERATE_TREEVIEW). It is highly recommended to start with a +# default header using +# doxygen -w html new_header.html new_footer.html new_stylesheet.css +# YourConfigFile +# and then modify the file new_header.html. See also section "Doxygen usage" +# for information on how to generate the default header that doxygen normally +# uses. +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. For a description +# of the possible markers and block names see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_HEADER = ./doc/misc/header.html + +# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each +# generated HTML page. If the tag is left blank doxygen will generate a standard +# footer. See HTML_HEADER for more information on how to generate a default +# footer and what special commands can be used inside the footer. See also +# section "Doxygen usage" for information on how to generate the default footer +# that doxygen normally uses. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FOOTER = ./doc/misc/footer.html + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style +# sheet that is used by each HTML page. It can be used to fine-tune the look of +# the HTML output. If left blank doxygen will generate a default style sheet. +# See also section "Doxygen usage" for information on how to generate the style +# sheet that doxygen normally uses. +# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as +# it is more robust and this tag (HTML_STYLESHEET) will in the future become +# obsolete. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user- +# defined cascading style sheet that is included after the standard style sheets +# created by doxygen. Using this option one can overrule certain style aspects. +# This is preferred over using HTML_STYLESHEET since it does not replace the +# standard style sheet and is therefore more robust against future updates. +# Doxygen will copy the style sheet file to the output directory. For an example +# see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_STYLESHEET = ./doc/misc/doxygenextra.css + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that the +# files will be copied as-is; there are no commands or markers available. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen +# will adjust the colors in the stylesheet and background images according to +# this color. Hue is specified as an angle on a colorwheel, see +# http://en.wikipedia.org/wiki/Hue for more information. For instance the value +# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 +# purple, and 360 is red again. +# Minimum value: 0, maximum value: 359, default value: 220. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors +# in the HTML output. For a value of 0 the output will use grayscales only. A +# value of 255 will produce the most vivid colors. +# Minimum value: 0, maximum value: 255, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the +# luminance component of the colors in the HTML output. Values below 100 +# gradually make the output lighter, whereas values above 100 make the output +# darker. The value divided by 100 is the actual gamma applied, so 80 represents +# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not +# change the gamma. +# Minimum value: 40, maximum value: 240, default value: 80. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting this +# to NO can help when comparing the output of multiple runs. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_TIMESTAMP = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_SECTIONS = NO + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries +# shown in the various tree structured indices initially; the user can expand +# and collapse entries dynamically later on. Doxygen will expand the tree to +# such a level that at most the specified number of entries are visible (unless +# a fully collapsed tree already exceeds this amount). So setting the number of +# entries 1 will produce a full collapsed tree by default. 0 is a special value +# representing an infinite number of entries and will result in a full expanded +# tree by default. +# Minimum value: 0, maximum value: 9999, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files will be +# generated that can be used as input for Apple's Xcode 3 integrated development +# environment (see: http://developer.apple.com/tools/xcode/), introduced with +# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a +# Makefile in the HTML output directory. Running make will produce the docset in +# that directory and running make install will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at +# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_DOCSET = NO + +# This tag determines the name of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# The default value is: Doxygen generated docs. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# This tag specifies a string that should uniquely identify the documentation +# set bundle. This should be a reverse domain-name style string, e.g. +# com.mycompany.MyDocSet. Doxygen will append .docset to the name. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. +# The default value is: org.doxygen.Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. +# The default value is: Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three +# additional HTML index files: index.hhp, index.hhc, and index.hhk. The +# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop +# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on +# Windows. +# +# The HTML Help Workshop contains a compiler that can convert all HTML output +# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML +# files are now used as the Windows 98 help format, and will replace the old +# Windows help format (.hlp) on all Windows platforms in the future. Compressed +# HTML files also contain an index, a table of contents, and you can search for +# words in the documentation. The HTML workshop also contains a viewer for +# compressed HTML files. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_HTMLHELP = NO + +# The CHM_FILE tag can be used to specify the file name of the resulting .chm +# file. You can add a path in front of the file if the result should not be +# written to the html output directory. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_FILE = + +# The HHC_LOCATION tag can be used to specify the location (absolute path +# including file name) of the HTML help compiler ( hhc.exe). If non-empty +# doxygen will try to run the HTML help compiler on the generated index.hhp. +# The file has to be specified with full path. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +HHC_LOCATION = + +# The GENERATE_CHI flag controls if a separate .chi index file is generated ( +# YES) or that it should be included in the master .chm file ( NO). +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +GENERATE_CHI = NO + +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc) +# and project file content. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_INDEX_ENCODING = + +# The BINARY_TOC flag controls whether a binary table of contents is generated ( +# YES) or a normal table of contents ( NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members to +# the table of contents of the HTML help documentation and to the tree view. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that +# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help +# (.qch) of the generated HTML documentation. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify +# the file name of the resulting .qch file. The path specified is relative to +# the HTML output folder. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help +# Project output. For more information please see Qt Help Project / Namespace +# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt +# Help Project output. For more information please see Qt Help Project / Virtual +# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- +# folders). +# The default value is: doc. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_VIRTUAL_FOLDER = doc + +# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom +# filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's filter section matches. Qt Help Project / Filter Attributes (see: +# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_SECT_FILTER_ATTRS = + +# The QHG_LOCATION tag can be used to specify the location of Qt's +# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the +# generated .qhp file. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be +# generated, together with the HTML files, they form an Eclipse help plugin. To +# install this plugin and make it available under the help contents menu in +# Eclipse, the contents of the directory containing the HTML and XML files needs +# to be copied into the plugins directory of eclipse. The name of the directory +# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. +# After copying Eclipse needs to be restarted before the help appears. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the Eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have this +# name. Each documentation set should have its own identifier. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# If you want full control over the layout of the generated HTML pages it might +# be necessary to disable the index and replace it with your own. The +# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top +# of each HTML page. A value of NO enables the index and the value YES disables +# it. Since the tabs in the index contain the same information as the navigation +# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +DISABLE_INDEX = YES + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. If the tag +# value is set to YES, a side panel will be generated containing a tree-like +# index structure (just like the one that is generated for HTML Help). For this +# to work a browser that supports JavaScript, DHTML, CSS and frames is required +# (i.e. any modern browser). Windows users are probably better off using the +# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can +# further fine-tune the look of the index. As an example, the default style +# sheet generated by doxygen has an example that shows how to put an image at +# the root of the tree instead of the PROJECT_NAME. Since the tree basically has +# the same information as the tab index, you could consider setting +# DISABLE_INDEX to YES when enabling this option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_TREEVIEW = YES + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that +# doxygen will group on one line in the generated HTML documentation. +# +# Note that a value of 0 will completely suppress the enum values from appearing +# in the overview section. +# Minimum value: 0, maximum value: 20, default value: 4. +# This tag requires that the tag GENERATE_HTML is set to YES. + +ENUM_VALUES_PER_LINE = 4 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used +# to set the initial width (in pixels) of the frame in which the tree is shown. +# Minimum value: 0, maximum value: 1500, default value: 250. +# This tag requires that the tag GENERATE_HTML is set to YES. + +TREEVIEW_WIDTH = 250 + +# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to +# external symbols imported via tag files in a separate window. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of LaTeX formulas included as images in +# the HTML documentation. When you change the font size after a successful +# doxygen run you need to manually remove any form_*.png images from the HTML +# output directory to force them to be regenerated. +# Minimum value: 8, maximum value: 50, default value: 10. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are not +# supported properly for IE 6.0, but are supported on all modern browsers. +# +# Note that when changing this option you need to delete any form_*.png files in +# the HTML output directory before the changes have effect. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see +# http://www.mathjax.org) which uses client side Javascript for the rendering +# instead of using prerendered bitmaps. Use this if you do not have LaTeX +# installed or if you want to formulas look prettier in the HTML output. When +# enabled you may also need to install MathJax separately and configure the path +# to it using the MATHJAX_RELPATH option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +USE_MATHJAX = NO + +# When MathJax is enabled you can set the default output format to be used for +# the MathJax output. See the MathJax site (see: +# http://docs.mathjax.org/en/latest/output.html) for more details. +# Possible values are: HTML-CSS (which is slower, but has the best +# compatibility), NativeMML (i.e. MathML) and SVG. +# The default value is: HTML-CSS. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_FORMAT = HTML-CSS + +# When MathJax is enabled you need to specify the location relative to the HTML +# output directory using the MATHJAX_RELPATH option. The destination directory +# should contain the MathJax.js script. For instance, if the mathjax directory +# is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax +# Content Delivery Network so you can quickly see the result without installing +# MathJax. However, it is strongly recommended to install a local copy of +# MathJax from http://www.mathjax.org before deployment. +# The default value is: http://cdn.mathjax.org/mathjax/latest. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_RELPATH = http://www.mathjax.org/mathjax + +# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax +# extension names that should be enabled during MathJax rendering. For example +# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_EXTENSIONS = + +# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces +# of code that will be used on startup of the MathJax code. See the MathJax site +# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# example see the documentation. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_CODEFILE = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for +# the HTML output. The underlying search engine uses javascript and DHTML and +# should work on any modern browser. Note that when using HTML help +# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) +# there is already a search function so this one should typically be disabled. +# For large projects the javascript based search engine can be slow, then +# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to +# search using the keyboard; to jump to the search box use + S +# (what the is depends on the OS and browser, but it is typically +# , /