diff --git a/README.md b/README.md index e4631159..709d6911 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,4 @@ -

Demo image -
- - - - - - -
- - latest packaged version(s) - - -
@@ -22,7 +8,6 @@ Request Feature · Send a Pull Request -

# FTXUI diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 4270d5c5..6aa536df 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -8,13 +8,54 @@ if (NOT DOXYGEN_FOUND) return() endif() +include(FetchContent) +FetchContent_Declare( + doxygen-awesome-css + GIT_REPOSITORY https://github.com/jothepro/doxygen-awesome-css.git + GIT_TAG v2.3.4 + +) +FetchContent_MakeAvailable(doxygen-awesome-css) +FetchContent_GetProperties(doxygen-awesome-css SOURCE_DIR AWESOME_CSS_DIR) + # Generate example list for documentation -set(EXAMPLE_LIST "${CMAKE_CURRENT_BINARY_DIR}/example_list.md") -file(WRITE ${EXAMPLE_LIST} "# Examples") +set(DOM_EXAMPLES "") +set(COMPONENT_EXAMPLES "") + get_property(EXAMPLES GLOBAL PROPERTY FTXUI::EXAMPLES) -foreach(EXAMPLE IN LISTS EXAMPLES) - file(APPEND ${EXAMPLE_LIST} "\n@example examples/${EXAMPLE}.cpp") -endforeach(EXAMPLE IN LISTS EXAMPLES) +message(STATUS "Initial FTXUI::EXAMPLES = '${EXAMPLES}'") # Check this value + +foreach(example IN LISTS EXAMPLES) + if(example MATCHES "^dom/.*") + list(APPEND DOM_EXAMPLES "${example}") + elseif(example MATCHES "^component/.*") + list(APPEND COMPONENT_EXAMPLES "${example}") + else() + message(ERROR "Unknown example '${example}'") + endif() +endforeach() + +macro(write_example_list file title page examples) + file(APPEND "${file}" "@page ${page} ${title}\n") + file(APPEND "${file}" "@tableofcontents\n") + + foreach(example IN LISTS ${examples}) + get_filename_component(name "${example}" NAME_WE) + file(APPEND "${file}" "# ${name}\n") + file(APPEND "${file}" "@include examples/${example}.cpp\n") + file(APPEND "${file}" "@example examples/${example}.cpp\n") + endforeach() + +endmacro() + +write_example_list("${CMAKE_CURRENT_BINARY_DIR}/dom_examples.md" + "Example" + module-dom-examples + DOM_EXAMPLES) +write_example_list("${CMAKE_CURRENT_BINARY_DIR}/component_examples.md" + "Example" + module-component-examples + COMPONENT_EXAMPLES) configure_file(Doxyfile.in Doxyfile @ONLY) diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in index 8b603627..196be529 100644 --- a/doc/Doxyfile.in +++ b/doc/Doxyfile.in @@ -1,4 +1,4 @@ -# Doxyfile 1.8.13 +# Doxyfile 1.9.8 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. @@ -12,16 +12,26 @@ # For lists, items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (\" \"). +# +# Note: +# +# Use doxygen to compare the used configuration file with the template +# configuration file: +# doxygen -x [configFile] +# Use doxygen to compare the used configuration file with the template +# configuration file without replacing the environment variables or CMake type +# replacement variables: +# doxygen -x_noenv [configFile] #--------------------------------------------------------------------------- # 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. +# This tag specifies the encoding used for all characters in the configuration +# 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 +# https://www.gnu.org/software/libiconv/ for the list of possible encodings. # The default value is: UTF-8. DOXYFILE_ENCODING = UTF-8 @@ -32,7 +42,7 @@ DOXYFILE_ENCODING = UTF-8 # title of most generated pages and in a few other places. # The default value is: My Project. -PROJECT_NAME = "FTXUI" +PROJECT_NAME = FTXUI # 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 @@ -51,7 +61,7 @@ PROJECT_BRIEF = "C++ functional terminal UI." # pixels and the maximum width should not exceed 200 pixels. Doxygen will copy # the logo to the output directory. -#PROJECT_LOGO = ./logo.png +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 @@ -60,35 +70,47 @@ PROJECT_BRIEF = "C++ functional terminal UI." OUTPUT_DIRECTORY = ./doxygen -# 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 +# If the CREATE_SUBDIRS tag is set to YES then doxygen will create up to 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. +# performance problems for the file system. Adapt CREATE_SUBDIRS_LEVEL to +# control the number of sub-directories. # The default value is: NO. CREATE_SUBDIRS = NO +# Controls the number of sub-directories that will be created when +# CREATE_SUBDIRS tag is set to YES. Level 0 represents 16 directories, and every +# level increment doubles the number of directories, resulting in 4096 +# directories at level 8 which is the default and also the maximum value. The +# sub-directories are organized in 2 levels, the first level always has a fixed +# number of 16 directories. +# Minimum value: 0, maximum value: 8, default value: 8. +# This tag requires that the tag CREATE_SUBDIRS is set to YES. + +CREATE_SUBDIRS_LEVEL = 8 + # 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 +ALLOW_UNICODE_NAMES = YES # 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. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Bulgarian, +# Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch, English +# (United States), Esperanto, Farsi (Persian), Finnish, French, German, Greek, +# Hindi, 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 @@ -150,7 +172,7 @@ INLINE_INHERITED_MEMB = YES # shortest path that makes the file name unique will be used # The default value is: YES. -FULL_PATH_NAMES = YES +FULL_PATH_NAMES = NO # 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 @@ -190,6 +212,16 @@ SHORT_NAMES = NO JAVADOC_AUTOBRIEF = NO +# If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line +# such as +# /*************** +# as being the beginning of a Javadoc-style comment "banner". If set to NO, the +# Javadoc-style will behave just like regular comments and it will not be +# interpreted by doxygen. +# The default value is: NO. + +JAVADOC_BANNER = 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 @@ -210,6 +242,14 @@ QT_AUTOBRIEF = NO MULTILINE_CPP_IS_BRIEF = NO +# By default Python docstrings are displayed as preformatted text and doxygen's +# special commands cannot be used. By setting PYTHON_DOCSTRING to NO the +# doxygen's special commands can be used and the contents of the docstring +# documentation blocks is shown as doxygen documentation. +# The default value is: YES. + +PYTHON_DOCSTRING = YES + # 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. @@ -233,11 +273,16 @@ TAB_SIZE = 2 # the documentation. An alias has the form: # name=value # For example adding -# "sideeffect=@par Side Effects:\n" +# "sideeffect=@par Side Effects:^^" # 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. +# "Side Effects:". Note that you cannot put \n's in the value part of an alias +# to insert newlines (in the resulting output). You can put ^^ in the value part +# of an alias to insert a newline as if a physical newline was in the original +# file. When you need a literal { or } or , in the value part of an alias you +# have to escape them by means of a backslash (\), this can lead to conflicts +# with the commands \{ and \} for these it is advised to use the version @{ and +# @} or use a double escape (\\{ and \\}) ALIASES = @@ -269,28 +314,40 @@ OPTIMIZE_FOR_FORTRAN = NO OPTIMIZE_OUTPUT_VHDL = NO +# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice +# sources only. Doxygen will then generate output that is more tailored for that +# language. For instance, namespaces will be presented as modules, types will be +# separated into more groups, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_SLICE = 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. +# language is one of the parsers supported by doxygen: IDL, Java, JavaScript, +# Csharp (C#), C, C++, Lex, D, PHP, md (Markdown), Objective-C, Python, Slice, +# VHDL, 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). 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. +# the files are not read by doxygen. When specifying no_extension you should add +# * to the FILE_PATTERNS. +# +# Note see also the list of default file extension mappings. -EXTENSION_MAPPING = +EXTENSION_MAPPING = md=Markdown # 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. +# documentation. See https://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. @@ -302,11 +359,22 @@ MARKDOWN_SUPPORT = YES # to that level are automatically included in the table of contents, even if # they do not have an id attribute. # Note: This feature currently applies only to Markdown headings. -# Minimum value: 0, maximum value: 99, default value: 0. +# Minimum value: 0, maximum value: 99, default value: 5. # This tag requires that the tag MARKDOWN_SUPPORT is set to YES. TOC_INCLUDE_HEADINGS = 3 +# The MARKDOWN_ID_STYLE tag can be used to specify the algorithm used to +# generate identifiers for the Markdown headings. Note: Every identifier is +# unique. +# Possible values are: DOXYGEN use a fixed 'autotoc_md' string followed by a +# sequence number starting at 0 and GITHUB use the lower case version of title +# with any whitespace replaced by '-' and punctuation characters removed. +# The default value is: DOXYGEN. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +MARKDOWN_ID_STYLE = DOXYGEN + # 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 putting a % sign in front of the word or @@ -323,16 +391,16 @@ AUTOLINK_SUPPORT = YES # diagrams that involve STL classes more complete and accurate. # The default value is: NO. -BUILTIN_STL_SUPPORT = NO +BUILTIN_STL_SUPPORT = YES # 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 +CPP_CLI_SUPPORT = YES # 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 +# https://www.riverbankcomputing.com/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. @@ -392,7 +460,7 @@ INLINE_GROUPED_CLASSES = YES # Man pages) or section (for LaTeX and RTF). # The default value is: NO. -INLINE_SIMPLE_STRUCTS = YES +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 @@ -418,6 +486,27 @@ TYPEDEF_HIDES_STRUCT = NO LOOKUP_CACHE_SIZE = 0 +# The NUM_PROC_THREADS specifies the number of threads doxygen is allowed to use +# during processing. When set to 0 doxygen will based this on the number of +# cores available in the system. You can set it explicitly to a value larger +# than 0 to get more control over the balance between CPU load and processing +# speed. At this moment only the input processing can be done using multiple +# threads. Since this is still an experimental feature the default is set to 1, +# which effectively disables parallel processing. Please report any issues you +# encounter. Generating dot graphs in parallel is controlled by the +# DOT_NUM_THREADS setting. +# Minimum value: 0, maximum value: 32, default value: 1. + +NUM_PROC_THREADS = 1 + +# If the TIMESTAMP tag is set different from NO then each generated page will +# contain the date or date and time when the page was generated. Setting this to +# NO can help when comparing the output of multiple runs. +# Possible values are: YES, NO, DATETIME and DATE. +# The default value is: NO. + +TIMESTAMP = NO + #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- @@ -429,6 +518,7 @@ LOOKUP_CACHE_SIZE = 0 # 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 = YES # If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will @@ -437,6 +527,12 @@ EXTRACT_ALL = YES EXTRACT_PRIVATE = NO +# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual +# methods of a class will be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIV_VIRTUAL = 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. @@ -474,6 +570,13 @@ EXTRACT_LOCAL_METHODS = NO EXTRACT_ANON_NSPACES = NO +# If this flag is set to YES, the name of an unnamed parameter in a declaration +# will be determined by the corresponding definition. By default unnamed +# parameters remain unnamed in the output. +# The default value is: YES. + +RESOLVE_UNNAMED_PARAMS = YES + # 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 @@ -485,14 +588,15 @@ HIDE_UNDOC_MEMBERS = YES # 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. +# will also hide undocumented C++ concepts if enabled. This option has no effect +# if EXTRACT_ALL is enabled. # The default value is: NO. HIDE_UNDOC_CLASSES = YES # 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. +# declarations. If set to NO, these declarations will be included in the +# documentation. # The default value is: NO. HIDE_FRIEND_COMPOUNDS = YES @@ -502,7 +606,7 @@ HIDE_FRIEND_COMPOUNDS = YES # blocks will be appended to the function's detailed documentation block. # The default value is: NO. -HIDE_IN_BODY_DOCS = YES +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 @@ -511,12 +615,20 @@ HIDE_IN_BODY_DOCS = YES INTERNAL_DOCS = YES -# 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. +# With the correct setting of option CASE_SENSE_NAMES doxygen will better be +# able to match the capabilities of the underlying filesystem. In case the +# filesystem is case sensitive (i.e. it supports files in the same directory +# whose names only differ in casing), the option must be set to YES to properly +# deal with such files in case they appear in the input. For filesystems that +# are not case sensitive the option should be set to NO to properly deal with +# output files written for symbols that only differ in casing, such as for two +# classes, one named CLASS and the other named Class, and to also support +# references to files without having to specify the exact matching casing. On +# Windows (including Cygwin) and MacOS, users should typically set this option +# to NO, whereas on Linux or other Unix flavors it should typically be set to +# YES. +# Possible values are: SYSTEM, NO and YES. +# The default value is: SYSTEM. CASE_SENSE_NAMES = YES @@ -534,6 +646,12 @@ HIDE_SCOPE_NAMES = YES HIDE_COMPOUND_REFERENCE= NO +# If the SHOW_HEADERFILE tag is set to YES then the documentation for a class +# will show which file needs to be included to use the class. +# The default value is: YES. + +SHOW_HEADERFILE = YES + # 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. @@ -691,7 +809,8 @@ FILE_VERSION_FILTER = # 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. +# will be used as the name of the layout file. See also section "Changing the +# layout of pages" for information. # # 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 @@ -702,7 +821,7 @@ LAYOUT_FILE = @CMAKE_CURRENT_SOURCE_DIR@/doxygen_layout.xml # 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. +# to be installed. See also https://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. See also \cite for info how to create references. @@ -737,23 +856,50 @@ WARNINGS = 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. +# potential errors in the documentation, such as documenting some parameters in +# a documented function twice, or documenting parameters that don't exist or +# using markup commands wrongly. # The default value is: YES. WARN_IF_DOC_ERROR = YES +# If WARN_IF_INCOMPLETE_DOC is set to YES, doxygen will warn about incomplete +# function parameter documentation. If set to NO, doxygen will accept that some +# parameters have no documentation without warning. +# The default value is: YES. + +WARN_IF_INCOMPLETE_DOC = 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. +# value. If set to NO, doxygen will only warn about wrong parameter +# documentation, but not about the absence of documentation. If EXTRACT_ALL is +# set to YES then this flag will automatically be disabled. See also +# WARN_IF_INCOMPLETE_DOC # The default value is: NO. WARN_NO_PARAMDOC = NO +# If WARN_IF_UNDOC_ENUM_VAL option is set to YES, doxygen will warn about +# undocumented enumeration values. If set to NO, doxygen will accept +# undocumented enumeration values. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: NO. + +WARN_IF_UNDOC_ENUM_VAL = NO + # If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when -# a warning is encountered. +# a warning is encountered. If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS +# then doxygen will continue running as if WARN_AS_ERROR tag is set to NO, but +# at the end of the doxygen process doxygen will return with a non-zero status. +# If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS_PRINT then doxygen behaves +# like FAIL_ON_WARNINGS but in case no WARN_LOGFILE is defined doxygen will not +# write the warning messages in between other messages but write them at the end +# of a run, in case a WARN_LOGFILE is defined the warning messages will be +# besides being in the defined file also be shown at the end of a run, unless +# the WARN_LOGFILE is defined as - i.e. standard output (stdout) in that case +# the behavior will remain as with the setting FAIL_ON_WARNINGS. +# Possible values are: NO, YES, FAIL_ON_WARNINGS and FAIL_ON_WARNINGS_PRINT. # The default value is: NO. WARN_AS_ERROR = NO @@ -764,13 +910,27 @@ WARN_AS_ERROR = NO # 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) +# See also: WARN_LINE_FORMAT # The default value is: $file:$line: $text. WARN_FORMAT = "$file:$line: $text" +# In the $text part of the WARN_FORMAT command it is possible that a reference +# to a more specific place is given. To make it easier to jump to this place +# (outside of doxygen) the user can define a custom "cut" / "paste" string. +# Example: +# WARN_LINE_FORMAT = "'vi $file +$line'" +# See also: WARN_FORMAT +# The default value is: at line $line of file $file. + +WARN_LINE_FORMAT = "at line $line of file $file" + # 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). +# error (stderr). In case the file specified cannot be opened for writing the +# warning and error messages are written to standard error. When as file - is +# specified the warning and error messages are written to standard output +# (stdout). WARN_LOGFILE = @@ -784,20 +944,38 @@ WARN_LOGFILE = # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. -INPUT += @PROJECT_SOURCE_DIR@/include -INPUT += @PROJECT_SOURCE_DIR@/src -INPUT += @CMAKE_CURRENT_SOURCE_DIR@ -INPUT += @EXAMPLE_LIST@ +INPUT = \ + @CMAKE_CURRENT_SOURCE_DIR@/introduction.md \ + @CMAKE_CURRENT_SOURCE_DIR@/getting-started.md \ + @CMAKE_CURRENT_SOURCE_DIR@/installation.md \ + @CMAKE_CURRENT_SOURCE_DIR@/module.md \ + @CMAKE_CURRENT_SOURCE_DIR@ \ + @CMAKE_SOURCE_DIR@/include \ + @CMAKE_SOURCE_DIR@/src \ + @CMAKE_CURRENT_BINARY_DIR@ \ + @CMAKE_SOURCE_DIR@/CHANGELOG.md \ + @CMAKE_SOURCE_DIR@/examples \ # 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. +# documentation (see: +# https://www.gnu.org/software/libiconv/) for the list of possible encodings. +# See also: INPUT_FILE_ENCODING # The default value is: UTF-8. INPUT_ENCODING = UTF-8 +# This tag can be used to specify the character encoding of the source files +# that doxygen parses The INPUT_FILE_ENCODING tag can be used to specify +# character encoding on a per file pattern basis. Doxygen will compare the file +# name with each pattern and apply the encoding instead of the default +# INPUT_ENCODING) if there is a match. The character encodings are a list of the +# form: pattern=encoding (like *.php=ISO-8859-1). See cfg_input_encoding +# "INPUT_ENCODING" for further information on supported encodings. + +INPUT_FILE_ENCODING = + # 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. @@ -806,11 +984,15 @@ INPUT_ENCODING = UTF-8 # need to set EXTENSION_MAPPING for the extension otherwise the files are not # read by doxygen. # -# 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, *.pyw, *.f90, *.f95, *.f03, *.f08, -# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf and *.qsf. +# Note the list of default checked file patterns might differ from the list of +# default file extension mappings. +# +# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cxxm, +# *.cpp, *.cppm, *.c++, *.c++m, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, +# *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, *.h++, *.ixx, *.l, *.cs, *.d, *.php, +# *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, *.md, *.mm, *.dox (to be +# provided as doxygen C comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, +# *.f18, *.f, *.for, *.vhd, *.vhdl, *.ucf, *.qsf and *.ice. FILE_PATTERNS = *.c \ *.cc \ @@ -886,17 +1068,14 @@ EXCLUDE_SYMLINKS = NO # 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 += *test.cpp -EXCLUDE_PATTERNS += *take_any_args.hpp +EXCLUDE_PATTERNS = *test.cpp \ + *take_any_args.hpp # 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/* +# ANamespace::AClass, ANamespace::*Test EXCLUDE_SYMBOLS = @@ -943,6 +1122,11 @@ IMAGE_PATH = # code is scanned, but not when the output code is generated. If lines are added # or removed, the anchors will not be placed correctly. # +# Note that doxygen will use the data processed and written to standard output +# for further processing, therefore nothing else, like debug statements or used +# commands (so in case of a Windows batch file always use @echo OFF), should be +# written to standard output. +# # Note that for custom extensions or not directly supported extensions you also # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. @@ -982,7 +1166,16 @@ FILTER_SOURCE_PATTERNS = # (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 = @CMAKE_CURRENT_SOURCE_DIR@/README.md +USE_MDFILE_AS_MAINPAGE = introduction.md + +# The Fortran standard specifies that for fixed formatted Fortran code all +# characters from position 72 are to be considered as comment. A common +# extension is to allow longer lines before the automatic comment starts. The +# setting FORTRAN_COMMENT_AFTER will also make it possible that longer lines can +# be processed before the automatic comment starts. +# Minimum value: 7, maximum value: 10000, default value: 72. + +FORTRAN_COMMENT_AFTER = 72 #--------------------------------------------------------------------------- # Configuration options related to source browsing @@ -1011,7 +1204,7 @@ INLINE_SOURCES = NO 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. +# entity all documented functions referencing it will be listed. # The default value is: NO. REFERENCED_BY_RELATION = NO @@ -1043,12 +1236,12 @@ 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 +# (see https://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 +# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file # - Make sure the INPUT points to the root of the source tree # - Run doxygen as normal # @@ -1070,28 +1263,6 @@ USE_HTAGS = NO 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 -# generated with the -Duse-libclang=ON option for CMake. -# 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 += --include-directory @PROJECT_SOURCE_DIR@/include -CLANG_OPTIONS += --include-directory @PROJECT_SOURCE_DIR@/src -CLANG_OPTIONS += --include-directory @PROJECT_SOURCE_DIR@/examples -CLANG_OPTIONS += -std=c++17 - #--------------------------------------------------------------------------- # Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- @@ -1101,19 +1272,13 @@ CLANG_OPTIONS += -std=c++17 # classes, structs, unions or interfaces. # The default value is: YES. -ALPHABETICAL_INDEX = NO +ALPHABETICAL_INDEX = YES -# 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. +# 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. The IGNORE_PREFIX +# tag works for classes, function and member names. The entity will be placed in +# the alphabetical list under the first letter of the entity name that remains +# after removing the prefix. # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. IGNORE_PREFIX = @@ -1160,7 +1325,7 @@ HTML_FILE_EXTENSION = .html # of the possible markers and block names see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_HEADER = @CMAKE_CURRENT_SOURCE_DIR@/doxygen_header.html +HTML_HEADER = @CMAKE_CURRENT_SOURCE_DIR@/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 @@ -1170,7 +1335,7 @@ HTML_HEADER = @CMAKE_CURRENT_SOURCE_DIR@/doxygen_header.html # that doxygen normally uses. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_FOOTER = @CMAKE_CURRENT_SOURCE_DIR@/doxygen_footer.html +HTML_FOOTER = @CMAKE_CURRENT_SOURCE_DIR@/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 @@ -1192,10 +1357,18 @@ HTML_STYLESHEET = # Doxygen will copy the style sheet files to the output directory. # Note: The order of the extra style sheet files is of importance (e.g. the last # style sheet in the list overrules the setting of the previous ones in the -# list). For an example see the documentation. +# list). +# Note: Since the styling of scrollbars can currently not be overruled in +# Webkit/Chromium, the styling will be left out of the default doxygen.css if +# one or more extra stylesheets have been specified. So if scrollbar +# customization is desired it has to be added explicitly. For an example see the +# documentation. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_EXTRA_STYLESHEET = @CMAKE_CURRENT_SOURCE_DIR@/doxygen_extra.css +HTML_EXTRA_STYLESHEET = \ + @AWESOME_CSS_DIR@/doxygen-awesome.css \ + @CMAKE_CURRENT_SOURCE_DIR@/stylesheet.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 @@ -1205,13 +1378,29 @@ HTML_EXTRA_STYLESHEET = @CMAKE_CURRENT_SOURCE_DIR@/doxygen_extra.css # 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 += @CMAKE_CURRENT_SOURCE_DIR@/header_logo.png -#HTML_EXTRA_FILES += @CMAKE_CURRENT_SOURCE_DIR@/logo.png +HTML_EXTRA_FILES += @AWESOME_CSS_DIR@/doxygen-awesome-fragment-copy-button.js +HTML_EXTRA_FILES += @AWESOME_CSS_DIR@/doxygen-awesome-paragraph-link.js +HTML_EXTRA_FILES += @AWESOME_CSS_DIR@/doxygen-awesome-interactive-toc.js +HTML_EXTRA_FILES += @AWESOME_CSS_DIR@/doxygen-awesome-tabs.js +HTML_COPY_CLIPBOARD = NO + +# The HTML_COLORSTYLE tag can be used to specify if the generated HTML output +# should be rendered with a dark or light theme. +# Possible values are: LIGHT always generate light mode output, DARK always +# generate dark mode output, AUTO_LIGHT automatically set the mode according to +# the user preference, use light mode if no preference is set (the default), +# AUTO_DARK automatically set the mode according to the user preference, use +# dark mode if no preference is set and TOGGLE allow to user to switch between +# light and dark mode via a button. +# The default value is: AUTO_LIGHT. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE = LIGHT # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the style sheet 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 +# this color. Hue is specified as an angle on a color-wheel, see +# https://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. @@ -1220,7 +1409,7 @@ HTML_EXTRA_STYLESHEET = @CMAKE_CURRENT_SOURCE_DIR@/doxygen_extra.css 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 +# in the HTML output. For a value of 0 the output will use gray-scales 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. @@ -1238,14 +1427,16 @@ HTML_COLORSTYLE_SAT = 200 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 YES can help to show when doxygen was last run and thus if the -# documentation is up to date. -# The default value is: NO. +# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML +# documentation will contain a main index with vertical navigation menus that +# are dynamically created via JavaScript. If disabled, the navigation index will +# consists of multiple levels of tabs that are statically embedded in every HTML +# page. Disable this option to support browsers that do not have JavaScript, +# like the Qt help browser. +# The default value is: YES. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_TIMESTAMP = NO +HTML_DYNAMIC_MENUS = 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 @@ -1255,6 +1446,13 @@ HTML_TIMESTAMP = NO HTML_DYNAMIC_SECTIONS = YES +# If the HTML_CODE_FOLDING tag is set to YES then classes and functions can be +# dynamically folded and expanded in the generated HTML source code. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_CODE_FOLDING = YES + # 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 @@ -1270,13 +1468,14 @@ HTML_INDEX_NUM_ENTRIES = 200 # 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 +# environment (see: +# https://developer.apple.com/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. +# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy +# genXcode/_index.html for more information. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. @@ -1290,6 +1489,13 @@ GENERATE_DOCSET = NO DOCSET_FEEDNAME = "Doxygen generated docs" +# This tag determines the URL 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. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDURL = + # 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. @@ -1315,8 +1521,12 @@ DOCSET_PUBLISHER_NAME = ArthurSonzogni # 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. +# on Windows. In the beginning of 2021 Microsoft took the original page, with +# a.o. the download links, offline the HTML help workshop was already many years +# in maintenance mode). You can download the HTML help workshop from the web +# archives at Installation executable (see: +# http://web.archive.org/web/20160201063255/http://download.microsoft.com/downlo +# ad/0/A/9/0A939EF6-E31C-430F-A3DF-DFAE7960D564/htmlhelp.exe). # # 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 @@ -1346,7 +1556,7 @@ CHM_FILE = 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). +# (YES) or that it should be included in the main .chm file (NO). # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. @@ -1373,6 +1583,16 @@ BINARY_TOC = NO TOC_EXPAND = NO +# The SITEMAP_URL tag is used to specify the full URL of the place where the +# generated documentation will be placed on the server by the user during the +# deployment of the documentation. The generated sitemap is called sitemap.xml +# and placed on the directory specified by HTML_OUTPUT. In case no SITEMAP_URL +# is specified no sitemap is generated. For information about the sitemap +# protocol see https://www.sitemaps.org +# This tag requires that the tag GENERATE_HTML is set to YES. + +SITEMAP_URL = + # 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 @@ -1391,7 +1611,8 @@ 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). +# (see: +# https://doc.qt.io/archives/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. @@ -1399,8 +1620,8 @@ 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). +# Folders (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-folders). # The default value is: doc. # This tag requires that the tag GENERATE_QHP is set to YES. @@ -1408,30 +1629,30 @@ 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). +# Filters (see: +# https://doc.qt.io/archives/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). +# Filters (see: +# https://doc.qt.io/archives/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). +# https://doc.qt.io/archives/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. +# The QHG_LOCATION tag can be used to specify the location (absolute path +# including file name) 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 = @@ -1474,16 +1695,28 @@ DISABLE_INDEX = NO # 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 style sheets (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. +# further fine tune the look of the index (see "Fine-tuning the output"). 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 +# When both GENERATE_TREEVIEW and DISABLE_INDEX are set to YES, then the +# FULL_SIDEBAR option determines if the side bar is limited to only the treeview +# area (value NO) or if it should extend to the full height of the window (value +# YES). Setting this to YES gives a layout similar to +# https://docs.readthedocs.io with more room for contents, but less room for the +# project logo, title, and description. If either GENERATE_TREEVIEW or +# DISABLE_INDEX is set to NO, this option has no effect. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FULL_SIDEBAR = 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. # @@ -1508,6 +1741,24 @@ TREEVIEW_WIDTH = 250 EXT_LINKS_IN_WINDOW = NO +# If the OBFUSCATE_EMAILS tag is set to YES, doxygen will obfuscate email +# addresses. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +OBFUSCATE_EMAILS = YES + +# If the HTML_FORMULA_FORMAT option is set to svg, doxygen will use the pdf2svg +# tool (see https://github.com/dawbarton/pdf2svg) or inkscape (see +# https://inkscape.org) to generate formulas as SVG images instead of PNGs for +# the HTML output. These images will generally look nicer at scaled resolutions. +# Possible values are: png (the default) and svg (looks nicer but requires the +# pdf2svg or inkscape tool). +# The default value is: png. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FORMULA_FORMAT = png + # 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 @@ -1517,19 +1768,14 @@ EXT_LINKS_IN_WINDOW = NO 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. +# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands +# to create new LaTeX commands to be used in formulas as building blocks. See +# the section "Including formulas" for details. -FORMULA_TRANSPARENT = YES +FORMULA_MACROFILE = # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see -# http://www.mathjax.org) which uses client side Javascript for the rendering +# https://www.mathjax.org) which uses client side JavaScript for the rendering # instead of using pre-rendered 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 @@ -1539,11 +1785,29 @@ FORMULA_TRANSPARENT = YES USE_MATHJAX = NO +# With MATHJAX_VERSION it is possible to specify the MathJax version to be used. +# Note that the different versions of MathJax have different requirements with +# regards to the different settings, so it is possible that also other MathJax +# settings have to be changed when switching between the different MathJax +# versions. +# Possible values are: MathJax_2 and MathJax_3. +# The default value is: MathJax_2. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_VERSION = MathJax_2 + # 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. +# the MathJax output. For more details about the output format see MathJax +# version 2 (see: +# http://docs.mathjax.org/en/v2.7-latest/output.html) and MathJax version 3 +# (see: +# http://docs.mathjax.org/en/latest/web/components/output.html). # Possible values are: HTML-CSS (which is slower, but has the best -# compatibility), NativeMML (i.e. MathML) and SVG. +# compatibility. This is the name for Mathjax version 2, for MathJax version 3 +# this will be translated into chtml), NativeMML (i.e. MathML. Only supported +# for NathJax 2. For MathJax version 3 chtml will be used instead.), chtml (This +# is the name for Mathjax version 3, for MathJax version 2 this will be +# translated into HTML-CSS) and SVG. # The default value is: HTML-CSS. # This tag requires that the tag USE_MATHJAX is set to YES. @@ -1556,22 +1820,29 @@ MATHJAX_FORMAT = HTML-CSS # 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. +# MathJax from https://www.mathjax.org before deployment. The default value is: +# - in case of MathJax version 2: https://cdn.jsdelivr.net/npm/mathjax@2 +# - in case of MathJax version 3: https://cdn.jsdelivr.net/npm/mathjax@3 # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest # The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax # extension names that should be enabled during MathJax rendering. For example +# for MathJax version 2 (see +# https://docs.mathjax.org/en/v2.7-latest/tex.html#tex-and-latex-extensions): # MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# For example for MathJax version 3 (see +# http://docs.mathjax.org/en/latest/input/tex/extensions/index.html): +# MATHJAX_EXTENSIONS = ams # 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 +# (see: +# http://docs.mathjax.org/en/v2.7-latest/output.html) for more details. For an # example see the documentation. # This tag requires that the tag USE_MATHJAX is set to YES. @@ -1599,7 +1870,7 @@ MATHJAX_CODEFILE = SEARCHENGINE = YES # When the SERVER_BASED_SEARCH tag is enabled the search engine will be -# implemented using a web server instead of a web client using Javascript. There +# implemented using a web server instead of a web client using JavaScript. There # are two flavors of web server based searching depending on the EXTERNAL_SEARCH # setting. When disabled, doxygen will generate a PHP script for searching and # an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing @@ -1618,7 +1889,8 @@ SERVER_BASED_SEARCH = NO # # Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: http://xapian.org/). +# Xapian (see: +# https://xapian.org/). # # See the section "External Indexing and Searching" for details. # The default value is: NO. @@ -1631,8 +1903,9 @@ EXTERNAL_SEARCH = NO # # Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: http://xapian.org/). See the section "External Indexing and -# Searching" for details. +# Xapian (see: +# https://xapian.org/). See the section "External Indexing and Searching" for +# details. # This tag requires that the tag SEARCHENGINE is set to YES. SEARCHENGINE_URL = @@ -1683,21 +1956,35 @@ LATEX_OUTPUT = latex # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. # -# Note that when enabling USE_PDFLATEX this option is only used for generating -# bitmaps for formulas in the HTML output, but not in the Makefile that is -# written to the output directory. -# The default file is: latex. +# Note that when not enabling USE_PDFLATEX the default is latex when enabling +# USE_PDFLATEX the default is pdflatex and when in the later case latex is +# chosen this is overwritten by pdflatex. For specific output languages the +# default can have been set differently, this depends on the implementation of +# the output language. # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate # index for LaTeX. +# Note: This tag is used in the Makefile / make.bat. +# See also: LATEX_MAKEINDEX_CMD for the part in the generated output file +# (.tex). # The default file is: makeindex. # This tag requires that the tag GENERATE_LATEX is set to YES. MAKEINDEX_CMD_NAME = makeindex +# The LATEX_MAKEINDEX_CMD tag can be used to specify the command name to +# generate index for LaTeX. In case there is no backslash (\) as first character +# it will be automatically added in the LaTeX code. +# Note: This tag is used in the generated output file (.tex). +# See also: MAKEINDEX_CMD_NAME for the part in the Makefile / make.bat. +# The default value is: makeindex. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_MAKEINDEX_CMD = makeindex + # If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX # documents. This may be useful for small projects and may help to save some # trees in general. @@ -1727,29 +2014,31 @@ PAPER_TYPE = a4 EXTRA_PACKAGES = -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the -# generated LaTeX document. The header should contain everything until the first -# chapter. If it is left blank doxygen will generate a standard header. See -# section "Doxygen usage" for information on how to let doxygen write the -# default header to a separate file. +# The LATEX_HEADER tag can be used to specify a user-defined LaTeX header for +# the generated LaTeX document. The header should contain everything until the +# first chapter. If it is left blank doxygen will generate a standard header. It +# is highly recommended to start with a default header using +# doxygen -w latex new_header.tex new_footer.tex new_stylesheet.sty +# and then modify the file new_header.tex. See also section "Doxygen usage" for +# information on how to generate the default header that doxygen normally uses. # -# Note: Only use a user-defined header if you know what you are doing! The -# following commands have a special meaning inside the header: $title, -# $datetime, $date, $doxygenversion, $projectname, $projectnumber, -# $projectbrief, $projectlogo. Doxygen will replace $title with the empty -# string, for the replacement values of the other commands the user is referred -# to HTML_HEADER. +# Note: Only use a user-defined header if you know what you are doing! +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. The following +# commands have a special meaning inside the header (and footer): For a +# description of the possible markers and block names see the documentation. # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_HEADER = -# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the -# generated LaTeX document. The footer should contain everything after the last -# chapter. If it is left blank doxygen will generate a standard footer. See +# The LATEX_FOOTER tag can be used to specify a user-defined LaTeX footer for +# the generated LaTeX document. The footer should contain everything after the +# last chapter. If it is left blank doxygen will generate a standard footer. See # LATEX_HEADER for more information on how to generate a default footer and what -# special commands can be used inside the footer. -# -# Note: Only use a user-defined footer if you know what you are doing! +# 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. Note: Only use a user-defined footer if you know what you are +# doing! # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_FOOTER = @@ -1782,18 +2071,26 @@ LATEX_EXTRA_FILES = PDF_HYPERLINKS = YES -# If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate -# the PDF file directly from the LaTeX files. Set this option to YES, to get a -# higher quality PDF documentation. +# If the USE_PDFLATEX tag is set to YES, doxygen will use the engine as +# specified with LATEX_CMD_NAME to generate the PDF file directly from the LaTeX +# files. Set this option to YES, to get a higher quality PDF documentation. +# +# See also section LATEX_CMD_NAME for selecting the engine. # The default value is: YES. # This tag requires that the tag GENERATE_LATEX is set to YES. USE_PDFLATEX = YES -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode -# command to the generated LaTeX files. This will instruct LaTeX to keep running -# if errors occur, instead of asking the user for help. This option is also used -# when generating formulas in HTML. +# The LATEX_BATCHMODE tag signals the behavior of LaTeX in case of an error. +# Possible values are: NO same as ERROR_STOP, YES same as BATCH, BATCH In batch +# mode nothing is printed on the terminal, errors are scrolled as if is +# hit at every error; missing files that TeX tries to input or request from +# keyboard input (\read on a not open input stream) cause the job to abort, +# NON_STOP In nonstop mode the diagnostic message will appear on the terminal, +# but there is no possibility of user interaction just like in batch mode, +# SCROLL In scroll mode, TeX will stop only for missing files to input or if +# keyboard input is necessary and ERROR_STOP In errorstop mode, TeX will stop at +# each error, asking for user intervention. # The default value is: NO. # This tag requires that the tag GENERATE_LATEX is set to YES. @@ -1806,31 +2103,21 @@ LATEX_BATCHMODE = NO LATEX_HIDE_INDICES = NO -# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source -# code with syntax highlighting in the LaTeX output. -# -# Note that which sources are shown also depends on other settings such as -# SOURCE_BROWSER. -# The default value is: NO. -# This tag requires that the tag GENERATE_LATEX is set to YES. - -LATEX_SOURCE_CODE = NO - # The LATEX_BIB_STYLE tag can be used to specify the style to use for the # bibliography, e.g. plainnat, or ieeetr. See -# http://en.wikipedia.org/wiki/BibTeX and \cite for more info. +# https://en.wikipedia.org/wiki/BibTeX and \cite for more info. # The default value is: plain. # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_BIB_STYLE = plain -# If the LATEX_TIMESTAMP tag is set to YES then the footer of each generated -# 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: NO. +# The LATEX_EMOJI_DIRECTORY tag is used to specify the (relative or absolute) +# path from which the emoji images will be read. If a relative path is entered, +# it will be relative to the LATEX_OUTPUT directory. If left blank the +# LATEX_OUTPUT directory will be used. # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_TIMESTAMP = NO +LATEX_EMOJI_DIRECTORY = #--------------------------------------------------------------------------- # Configuration options related to the RTF output @@ -1871,9 +2158,9 @@ COMPACT_RTF = NO RTF_HYPERLINKS = NO -# Load stylesheet definitions from file. Syntax is similar to doxygen's config -# file, i.e. a series of assignments. You only have to provide replacements, -# missing definitions are set to their default value. +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# configuration file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. # # See also section "Doxygen usage" for information on how to generate the # default style sheet that doxygen normally uses. @@ -1882,22 +2169,12 @@ RTF_HYPERLINKS = NO RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an RTF document. Syntax is -# similar to doxygen's config file. A template extensions file can be generated -# using doxygen -e rtf extensionFile. +# similar to doxygen's configuration file. A template extensions file can be +# generated using doxygen -e rtf extensionFile. # This tag requires that the tag GENERATE_RTF is set to YES. RTF_EXTENSIONS_FILE = -# If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code -# with syntax highlighting in the RTF output. -# -# Note that which sources are shown also depends on other settings such as -# SOURCE_BROWSER. -# The default value is: NO. -# This tag requires that the tag GENERATE_RTF is set to YES. - -RTF_SOURCE_CODE = NO - #--------------------------------------------------------------------------- # Configuration options related to the man page output #--------------------------------------------------------------------------- @@ -1969,6 +2246,13 @@ XML_OUTPUT = xml XML_PROGRAMLISTING = YES +# If the XML_NS_MEMB_FILE_SCOPE tag is set to YES, doxygen will include +# namespace members in file scope as well, matching the HTML output. +# The default value is: NO. +# This tag requires that the tag GENERATE_XML is set to YES. + +XML_NS_MEMB_FILE_SCOPE = NO + #--------------------------------------------------------------------------- # Configuration options related to the DOCBOOK output #--------------------------------------------------------------------------- @@ -1987,27 +2271,44 @@ GENERATE_DOCBOOK = NO DOCBOOK_OUTPUT = docbook -# If the DOCBOOK_PROGRAMLISTING tag is set to YES, doxygen will include the -# program listings (including syntax highlighting and cross-referencing -# information) to the DOCBOOK output. Note that enabling this will significantly -# increase the size of the DOCBOOK output. -# The default value is: NO. -# This tag requires that the tag GENERATE_DOCBOOK is set to YES. - -DOCBOOK_PROGRAMLISTING = NO - #--------------------------------------------------------------------------- # Configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an -# AutoGen Definitions (see http://autogen.sf.net) file that captures the -# structure of the code including all documentation. Note that this feature is -# still experimental and incomplete at the moment. +# AutoGen Definitions (see https://autogen.sourceforge.net/) file that captures +# the structure of the code including all documentation. Note that this feature +# is still experimental and incomplete at the moment. # The default value is: NO. GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# Configuration options related to Sqlite3 output +#--------------------------------------------------------------------------- + +# If the GENERATE_SQLITE3 tag is set to YES doxygen will generate a Sqlite3 +# database with symbols found by doxygen stored in tables. +# The default value is: NO. + +GENERATE_SQLITE3 = NO + +# The SQLITE3_OUTPUT tag is used to specify where the Sqlite3 database 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: sqlite3. +# This tag requires that the tag GENERATE_SQLITE3 is set to YES. + +SQLITE3_OUTPUT = sqlite3 + +# The SQLITE3_OVERWRITE_DB tag is set to YES, the existing doxygen_sqlite3.db +# database file will be recreated with each doxygen run. If set to NO, doxygen +# will warn if an a database file is already found and not modify it. +# The default value is: YES. +# This tag requires that the tag GENERATE_SQLITE3 is set to YES. + +SQLITE3_RECREATE_DB = YES + #--------------------------------------------------------------------------- # Configuration options related to the Perl module output #--------------------------------------------------------------------------- @@ -2082,7 +2383,8 @@ SEARCH_INCLUDES = YES # The INCLUDE_PATH tag can be used to specify one or more directories that # contain include files that are not input files but should be processed by the -# preprocessor. +# preprocessor. Note that the INCLUDE_PATH is not recursive, so the setting of +# RECURSIVE has no effect here. # This tag requires that the tag SEARCH_INCLUDES is set to YES. INCLUDE_PATH = @@ -2149,15 +2451,15 @@ TAGFILES = GENERATE_TAGFILE = -# If the ALLEXTERNALS tag is set to YES, all external class will be listed in -# the class index. If set to NO, only the inherited external classes will be -# listed. +# If the ALLEXTERNALS tag is set to YES, all external classes and namespaces +# will be listed in the class and namespace index. If set to NO, only the +# inherited external classes will be listed. # The default value is: NO. ALLEXTERNALS = NO # If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will be +# in the topic index. If set to NO, only the current project's groups will be # listed. # The default value is: YES. @@ -2171,25 +2473,9 @@ EXTERNAL_GROUPS = YES EXTERNAL_PAGES = YES #--------------------------------------------------------------------------- -# Configuration options related to the dot tool +# Configuration options related to diagram generator tools #--------------------------------------------------------------------------- -# If the CLASS_DIAGRAMS tag is set to YES, doxygen will generate a class diagram -# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to -# NO turns the diagrams off. Note that this option also works with HAVE_DOT -# disabled, but it is recommended to install and use dot, since it yields more -# powerful graphs. -# The default value is: YES. - -CLASS_DIAGRAMS = YES - -# You can include diagrams made with dia in doxygen documentation. Doxygen will -# then run dia to produce the diagram and insert it in the documentation. The -# DIA_PATH tag allows you to specify the directory where the dia binary resides. -# If left empty dia is assumed to be found in the default search path. - -DIA_PATH = - # If set to YES the inheritance and collaboration graphs will hide inheritance # and usage relations if the target is undocumented or is not a class. # The default value is: YES. @@ -2198,7 +2484,7 @@ HIDE_UNDOC_RELATIONS = YES # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz (see: -# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent +# https://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent # Bell Labs. The other options in this section have no effect if this option is # set to NO # The default value is: YES. @@ -2215,49 +2501,73 @@ HAVE_DOT = YES DOT_NUM_THREADS = 0 -# When you want a differently looking font in the dot files that doxygen -# generates you can specify the font name using DOT_FONTNAME. You need to make -# sure dot is able to find the font, which can be done by putting it in a -# standard location or by setting the DOTFONTPATH environment variable or by -# setting DOT_FONTPATH to the directory containing the font. -# The default value is: Helvetica. +# DOT_COMMON_ATTR is common attributes for nodes, edges and labels of +# subgraphs. When you want a differently looking font in the dot files that +# doxygen generates you can specify fontname, fontcolor and fontsize attributes. +# For details please see Node, +# Edge and Graph Attributes specification You need to make sure dot is able +# to find the font, which can be done by putting it in a standard location or by +# setting the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the +# directory containing the font. Default graphviz fontsize is 14. +# The default value is: fontname=Helvetica,fontsize=10. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_FONTNAME = Helvetica +DOT_COMMON_ATTR = "fontname=Helvetica,fontsize=10" -# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of -# dot graphs. -# Minimum value: 4, maximum value: 24, default value: 10. +# DOT_EDGE_ATTR is concatenated with DOT_COMMON_ATTR. For elegant style you can +# add 'arrowhead=open, arrowtail=open, arrowsize=0.5'. Complete documentation about +# arrows shapes. +# The default value is: labelfontname=Helvetica,labelfontsize=10. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_FONTSIZE = 10 +DOT_EDGE_ATTR = "labelfontname=Helvetica,labelfontsize=10" -# By default doxygen will tell dot to use the default font as specified with -# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set -# the path where dot can find it using this tag. +# DOT_NODE_ATTR is concatenated with DOT_COMMON_ATTR. For view without boxes +# around nodes set 'shape=plain' or 'shape=plaintext' Shapes specification +# The default value is: shape=box,height=0.2,width=0.4. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_NODE_ATTR = "shape=box,height=0.2,width=0.4" + +# You can set the path where dot can find font specified with fontname in +# DOT_COMMON_ATTR and others dot attributes. # This tag requires that the tag HAVE_DOT is set to YES. DOT_FONTPATH = -# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for -# each documented class showing the direct and indirect inheritance relations. -# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO. +# If the CLASS_GRAPH tag is set to YES or GRAPH or BUILTIN then doxygen will +# generate a graph for each documented class showing the direct and indirect +# inheritance relations. In case the CLASS_GRAPH tag is set to YES or GRAPH and +# HAVE_DOT is enabled as well, then dot will be used to draw the graph. In case +# the CLASS_GRAPH tag is set to YES and HAVE_DOT is disabled or if the +# CLASS_GRAPH tag is set to BUILTIN, then the built-in generator will be used. +# If the CLASS_GRAPH tag is set to TEXT the direct and indirect inheritance +# relations will be shown as texts / links. +# Possible values are: NO, YES, TEXT, GRAPH and BUILTIN. # The default value is: YES. -# This tag requires that the tag HAVE_DOT is set to YES. CLASS_GRAPH = YES # If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a # graph for each documented class showing the direct and indirect implementation # dependencies (inheritance, containment, and class references variables) of the -# class with other documented classes. +# class with other documented classes. Explicit enabling a collaboration graph, +# when COLLABORATION_GRAPH is set to NO, can be accomplished by means of the +# command \collaborationgraph. Disabling a collaboration graph can be +# accomplished by means of the command \hidecollaborationgraph. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. -COLLABORATION_GRAPH = NO +COLLABORATION_GRAPH = YES # If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for -# groups, showing the direct groups dependencies. +# groups, showing the direct groups dependencies. Explicit enabling a group +# dependency graph, when GROUP_GRAPHS is set to NO, can be accomplished by means +# of the command \groupgraph. Disabling a directory graph can be accomplished by +# means of the command \hidegroupgraph. See also the chapter Grouping in the +# manual. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. @@ -2280,10 +2590,32 @@ UML_LOOK = NO # but if the number exceeds 15, the total amount of fields shown is limited to # 10. # Minimum value: 0, maximum value: 100, default value: 10. -# This tag requires that the tag HAVE_DOT is set to YES. +# This tag requires that the tag UML_LOOK is set to YES. UML_LIMIT_NUM_FIELDS = 10 +# If the DOT_UML_DETAILS tag is set to NO, doxygen will show attributes and +# methods without types and arguments in the UML graphs. If the DOT_UML_DETAILS +# tag is set to YES, doxygen will add type and arguments for attributes and +# methods in the UML graphs. If the DOT_UML_DETAILS tag is set to NONE, doxygen +# will not generate fields with class member information in the UML graphs. The +# class diagrams will look similar to the default class diagrams but using UML +# notation for the relationships. +# Possible values are: NO, YES and NONE. +# The default value is: NO. +# This tag requires that the tag UML_LOOK is set to YES. + +DOT_UML_DETAILS = NO + +# The DOT_WRAP_THRESHOLD tag can be used to set the maximum number of characters +# to display on a single line. If the actual line length exceeds this threshold +# significantly it will wrapped across multiple lines. Some heuristics are apply +# to avoid ugly line breaks. +# Minimum value: 0, maximum value: 1000, default value: 17. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_WRAP_THRESHOLD = 17 + # If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and # collaboration graphs will show the relations between templates and their # instances. @@ -2295,7 +2627,9 @@ TEMPLATE_RELATIONS = NO # If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to # YES then doxygen will generate a graph for each documented file showing the # direct and indirect include dependencies of the file with other documented -# files. +# files. Explicit enabling an include graph, when INCLUDE_GRAPH is is set to NO, +# can be accomplished by means of the command \includegraph. Disabling an +# include graph can be accomplished by means of the command \hideincludegraph. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. @@ -2304,7 +2638,10 @@ INCLUDE_GRAPH = NO # If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are # set to YES then doxygen will generate a graph for each documented file showing # the direct and indirect include dependencies of the file with other documented -# files. +# files. Explicit enabling an included by graph, when INCLUDED_BY_GRAPH is set +# to NO, can be accomplished by means of the command \includedbygraph. Disabling +# an included by graph can be accomplished by means of the command +# \hideincludedbygraph. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. @@ -2344,23 +2681,32 @@ GRAPHICAL_HIERARCHY = YES # If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the # dependencies a directory has on other directories in a graphical way. The # dependency relations are determined by the #include relations between the -# files in the directories. +# files in the directories. Explicit enabling a directory graph, when +# DIRECTORY_GRAPH is set to NO, can be accomplished by means of the command +# \directorygraph. Disabling a directory graph can be accomplished by means of +# the command \hidedirectorygraph. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. DIRECTORY_GRAPH = YES +# The DIR_GRAPH_MAX_DEPTH tag can be used to limit the maximum number of levels +# of child directories generated in directory dependency graphs by dot. +# Minimum value: 1, maximum value: 25, default value: 1. +# This tag requires that the tag DIRECTORY_GRAPH is set to YES. + +DIR_GRAPH_MAX_DEPTH = 1 + # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. For an explanation of the image formats see the section # output formats in the documentation of the dot tool (Graphviz (see: -# http://www.graphviz.org/)). +# https://www.graphviz.org/)). # Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order # to make the SVG files visible in IE 9+ (other browsers do not have this # requirement). -# Possible values are: png, png:cairo, png:cairo:cairo, png:cairo:gd, png:gd, -# png:gd:gd, jpg, jpg:cairo, jpg:cairo:gd, jpg:gd, jpg:gd:gd, gif, gif:cairo, -# gif:cairo:gd, gif:gd, gif:gd:gd, svg, png:gd, png:gd:gd, png:cairo, -# png:cairo:gd, png:cairo:cairo, png:cairo:gdiplus, png:gdiplus and +# Possible values are: png, jpg, jpg:cairo, jpg:cairo:gd, jpg:gd, jpg:gd:gd, +# gif, gif:cairo, gif:cairo:gd, gif:gd, gif:gd:gd, svg, png:gd, png:gd:gd, +# png:cairo, png:cairo:gd, png:cairo:cairo, png:cairo:gdiplus, png:gdiplus and # png:gdiplus:gdiplus. # The default value is: png. # This tag requires that the tag HAVE_DOT is set to YES. @@ -2392,11 +2738,12 @@ DOT_PATH = DOTFILE_DIRS = -# The MSCFILE_DIRS tag can be used to specify one or more directories that -# contain msc files that are included in the documentation (see the \mscfile -# command). +# You can include diagrams made with dia in doxygen documentation. Doxygen will +# then run dia to produce the diagram and insert it in the documentation. The +# DIA_PATH tag allows you to specify the directory where the dia binary resides. +# If left empty dia is assumed to be found in the default search path. -MSCFILE_DIRS = +DIA_PATH = # The DIAFILE_DIRS tag can be used to specify one or more directories that # contain dia files that are included in the documentation (see the \diafile @@ -2405,10 +2752,10 @@ MSCFILE_DIRS = DIAFILE_DIRS = # When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the -# path where java can find the plantuml.jar file. If left blank, it is assumed -# PlantUML is not used or called during a preprocessing step. Doxygen will -# generate a warning when it encounters a \startuml command in this case and -# will not generate output for the diagram. +# path where java can find the plantuml.jar file or to the filename of jar file +# to be used. If left blank, it is assumed PlantUML is not used or called during +# a preprocessing step. Doxygen will generate a warning when it encounters a +# \startuml command in this case and will not generate output for the diagram. PLANTUML_JAR_PATH = @@ -2432,7 +2779,7 @@ PLANTUML_INCLUDE_PATH = # Minimum value: 0, maximum value: 10000, default value: 50. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_GRAPH_MAX_NODES = 50 +DOT_GRAPH_MAX_NODES = 100 # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs # generated by dot. A depth value of 3 means that only nodes reachable from the @@ -2446,18 +2793,6 @@ DOT_GRAPH_MAX_NODES = 50 MAX_DOT_GRAPH_DEPTH = 0 -# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is disabled by default, because dot on Windows does not seem -# to support this out of the box. -# -# Warning: Depending on the platform used, enabling this option may lead to -# badly anti-aliased labels on the edges of a graph (i.e. they become hard to -# read). -# The default value is: NO. -# This tag requires that the tag HAVE_DOT is set to YES. - -DOT_TRANSPARENT = NO - # Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) support @@ -2470,14 +2805,34 @@ DOT_MULTI_TARGETS = NO # If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page # explaining the meaning of the various boxes and arrows in the dot generated # graphs. +# Note: This tag requires that UML_LOOK isn't set, i.e. the doxygen internal +# graphical representation for inheritance and collaboration diagrams is used. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. GENERATE_LEGEND = YES -# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate dot +# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate # files that are used to generate the various graphs. +# +# Note: This setting is not only used for dot files but also for msc temporary +# files. # The default value is: YES. -# This tag requires that the tag HAVE_DOT is set to YES. DOT_CLEANUP = YES + +# You can define message sequence charts within doxygen comments using the \msc +# command. If the MSCGEN_TOOL tag is left empty (the default), then doxygen will +# use a built-in version of mscgen tool to produce the charts. Alternatively, +# the MSCGEN_TOOL tag can also specify the name an external tool. For instance, +# specifying prog as the value, doxygen will call the tool as prog -T +# -o . The external tool should support +# output file formats "png", "eps", "svg", and "ismap". + +MSCGEN_TOOL = + +# The MSCFILE_DIRS tag can be used to specify one or more directories that +# contain msc files that are included in the documentation (see the \mscfile +# command). + +MSCFILE_DIRS = diff --git a/doc/doxygen_extra.css b/doc/doxygen_extra.css deleted file mode 100755 index ee6259e9..00000000 --- a/doc/doxygen_extra.css +++ /dev/null @@ -1,323 +0,0 @@ -/* - * GitHub Markdown style CSS for doxygen 1.8.14 - * Source: https://github.com/sindresorhus/github-markdown-css - * License: MIT � Sindre Sorhus - */ - -* { - box-sizing: border-box; -} - -body, table, div, p, dl { - -ms-text-size-adjust: 100%; - -webkit-text-size-adjust: 100%; - line-height: 1.5; - color: #24292e; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; - font-size: 16px; - word-wrap: break-word; -} - -b { - font-weight: 600; -} - -/* @group Heading Levels */ - -h1, h2, h3, h4, h5, h6 { - font-weight: 600; - line-height: 1.25; - margin-top: 24px; - margin-bottom: 16px; -} - -h1 { - font-size: 2em; - padding-bottom: 0.3em; - border-bottom: 1px solid #eaecef; -} - -h2 { - padding-bottom: 0.3em; - font-size: 1.5em; - border-bottom: 1px solid #eaecef; -} - -h3 { - font-size: 1.25em; -} - -h4 { - font-size: 1em; -} - -h5 { - font-size: 0.875em; -} - -h6 { - font-size: 0.85em; - color: #6a737d; -} - -a { - background-color: transparent; - color: #0366d6; - text-decoration: none; - font-weight: normal; -} - -.contents a:visited { - color: #0366d6; -} - -a:active, a:hover { - outline-width: 0; -} - -a:hover { - text-decoration: underline; -} - -a:not([href]) { - color: inherit; - text-decoration: none; -} - -a.el { - font-weight: normal; -} - -.image { - text-align: left; -} - -.tip { - background-image: url(tip.png); - background-position: left center; - background-repeat: no-repeat; - padding-left: 30px; - margin-top: 1em; - margin-bottom: 1em; - min-height: 31px; - display: block; - font-style:italic; -} - -.warn { - background-image: url(warn.png); - background-position: left center; - background-repeat: no-repeat; - padding-left: 48px; - margin-top: 1em; - margin-bottom: 1em; - min-height: 31px; - display: block; - font-style:italic; -} - -#projectname { - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; - font-size: 2em; - font-weight: bold; -} - -#projectbrief { - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; - font-size: 0.8em; -} - -#projectnumber { - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; - font-size: 1em; -} - -div.contents { - width: 980px; - padding: 40px; - margin-top: -1px; - margin-left: auto; - margin-right: auto; - margin-bottom: 10px; - border: 1px solid #d1d5da; - border-radius: 2px; -} - -div.toc { - border: 0 none; - border-radius: 7px; -} - -div.header { - width: 980px; - padding: 10px; - margin-top: 10px; - margin-left: auto; - margin-right: auto; - background-image: none; - background-repeat: none; - background-color: #f6f8fa; - border: 1px solid #d1d5da; -} - -div.headertitle { - padding: 0; -} - -.title ol { - margin: 0; -} - -.title ol li { - list-style-type: none; -} - -.ui-resizable-e { - background: none; - background-color: #E6E6E6; -} - -div.fragment { - background-color: #f3f3f3; - border-radius:5px; - border: 0 solid; - border: none; - padding:16px; - transition: all 0.5s ease-in-out; -} - -div.fragment:hover { - background-color: #e9e9e9; - box-shadow: 0 5px 10px -5px rgb(0,0,0,0.5) inset; -} - -div.line { - font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace; - font-size: 90%; - font-variant-numeric: tabular-nums lining-nums; - font-kerning: none; - -webkit-transition-duration: 0; - -moz-transition-duration: 0; - -ms-transition-duration: 0; - -o-transition-duration: 0; - transition-duration: 0; -} - -div.line.glow { - background-color: auto; - box-shadow: none; -} - -/* @group Code Colorization */ -span.keyword { - color: #808000 -} - -span.keywordtype { - color: #808000 -} - -span.keywordflow { - color: #808000 -} - -span.comment { - color: #008000 -} - -span.preprocessor { - color: #800000 -} - -span.stringliteral { - color: #000080 -} - -span.charliteral { - color: #000080 -} - -blockquote { - background-color: #EEEEEE; - border-left: 2px solid #606060; - margin: 0 24px 0 4px; - padding: 0 12px 0 16px; -} - -/* @end */ - -.arrow { - box-sizing: content-box; -} - -img { - max-width: 100%; - max-height: 100%; -} - -#nav-tree { - background-image: none; - background-color: white; -} - -#nav-tree .label { - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; - font-size: 14px; -} - -#side-nav { - width: 25%; - max-width: 50%; -} - -.memtitle { - background-image: none; -} - -.memproto { - text-shadow: none; - /* opera specific markup */ - box-shadow: none; - /* firefox specific markup */ - -moz-box-shadow: none; - -moz-border-radius-topright: 4px; - /* webkit specific markup */ - -webkit-box-shadow: none; - -webkit-border-top-right-radius: 4px; -} - -.memdoc { - background-image:none; - background-repeat:repeat-x; - background-color: #FFFFFF; - /* opera specific markup */ - box-shadow: none; - /* firefox specific markup */ - -moz-box-shadow: none; - /* webkit specific markup */ - -webkit-box-shadow: none; -} - -#main-menu { - background: none; - border-bottom: 1px solid black; -} - -#main-menu li { - border: none !important; - transition: all 0.1s ease-in-out; -} - -#main-menu li:hover { - color:black; - background-color:black; -} - -.sm-dox a, .sm-dox a:focus, .sm-dox a:active, .sm-dox a:hover, .sm-dox a.highlighted { - background-image:none; -} - -#titlearea { - margin: 8px; - border: none; -} diff --git a/doc/doxygen_footer.html b/doc/doxygen_footer.html deleted file mode 100644 index 0bc90f76..00000000 --- a/doc/doxygen_footer.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - diff --git a/doc/doxygen_header.html b/doc/doxygen_header.html deleted file mode 100644 index 48a2e369..00000000 --- a/doc/doxygen_header.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - -$projectname: $title -$title - - - -$treeview -$search -$mathjax - -$extrastylesheet - - -
- - -
- - - - - - - - - - - - - - - - - - - - - -
-
$projectname -  $projectnumber -
-
$projectbrief
-
-
$projectbrief
-
$searchbox
-
- - - - diff --git a/doc/doxygen_layout.xml b/doc/doxygen_layout.xml deleted file mode 100644 index d22fec75..00000000 --- a/doc/doxygen_layout.xml +++ /dev/null @@ -1,224 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/doc/footer.html b/doc/footer.html new file mode 100644 index 00000000..249d73fa --- /dev/null +++ b/doc/footer.html @@ -0,0 +1,17 @@ + + + + + + + + + + diff --git a/doc/getting-started.md b/doc/getting-started.md new file mode 100644 index 00000000..74ac1be6 --- /dev/null +++ b/doc/getting-started.md @@ -0,0 +1,60 @@ +@page getting-started Getting Started +@tableofcontents + +# Install FTXUI + +To set up FTXUI in your project, follow the [installation guide](installation.html), which provides instructions for multiple build systems and package managers. + +# Minimal Example + +Save the following code as `main.cpp`: + +```cpp +#include +#include +#include + +int main() { + using namespace ftxui; + + Element document = hbox({ + text("left") | border, + text("middle") | border | flex, + text("right") | border, + }); + + auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document)); + Render(screen, document); + screen.Print(); +} +``` + +Build and run it using your preferred build system. +If unsure, start with one of the methods described in the [installation page](installation.html). + +Expected output: + +``` +┌────┐┌────────────────────────────────────┐┌─────┐ +│left││middle ││right│ +└────┘└────────────────────────────────────┘└─────┘ +``` + +# Starter Template + +For a complete working project, clone the official starter repository: + +```bash +git clone https://github.com/ArthurSonzogni/ftxui-starter +``` + +Follow the build instructions in the `README.md` of that repository. + +
+ +| Previous | Next | +|:----------------------------------|------------------------:| +| [Introduction](index.html) | [Modules](modules.html) | + + +
diff --git a/doc/header.html b/doc/header.html new file mode 100644 index 00000000..1d1d368f --- /dev/null +++ b/doc/header.html @@ -0,0 +1,84 @@ + + + + + + + + +$projectname: $title +$title + + + + + + + + + + + + + +$treeview +$search +$mathjax +$darkmode + +$extrastylesheet + + + + +
+ + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
$projectname $projectnumber +
+
$projectbrief
+
+
$projectbrief
+
$searchbox
$searchbox
+
+ + diff --git a/doc/installation.md b/doc/installation.md new file mode 100644 index 00000000..32317ff1 --- /dev/null +++ b/doc/installation.md @@ -0,0 +1,39 @@ +@page installation Installation +@tableofcontents + +## Overview + +FTXUI can be integrated into your project using several build systems and package managers. +This page serves as an entry point for the available integration methods. + +## Supported Methods + +- @subpage installation_cmake +- @subpage installation_bazel +- @subpage installation_vcpkg +- @subpage installation_conan +- @subpage installation_manual + +## Next Steps + +Once FTXUI is installed: + +- [Getting Started](getting-started.html): Write and run your first program +- [Examples](examples.html): See what FTXUI can do +- Modules: + - [DOM](module-dom.html) + - [Component](module-component.html) + - [Screen](module-screen.html) + +## Contributions + +If you use another build system or package manager, feel free to contribute a guide. +You can also open a feature request on the [GitHub issue tracker](https://github.com/ArthurSonzogni/FTXUI/issues). + +
+ +| Previous | +|:------------------| +| [Getting Started](getting-started.html) | + +
diff --git a/doc/installation_bazel.md b/doc/installation_bazel.md new file mode 100644 index 00000000..beeb4aaa --- /dev/null +++ b/doc/installation_bazel.md @@ -0,0 +1,38 @@ +@page installation_bazel Bazel + +FTXUI can be integrated into your project using [Bazel](https://bazel.build) +with Bzlmod (Bazel modules). + +The library is registered in the [Bazel Central Registry](https://registry.bazel.build/modules/ftxui) + +**MODULE.bazel** +```starlark +bazel_dep(name = "ftxui", version = "6.1.9") +``` + +**BUILD.bazel** +```starlark +cc_binary( + name = "main", + srcs = ["main.cpp"], + deps = [ + "@ftxui//:component", + "@ftxui//:dom", + "@ftxui//:screen", + ], +) +``` + +## Starter Project + +You can use the official Bazel starter project for a minimal working setup: + +- [ftxui-bazel (starter)](https://github.com/ArthurSonzogni/ftxui-bazel) + +
+ +| Previous | +|:------------------| +| [Getting Started](getting-started.html) | + +
diff --git a/doc/installation_cmake.md b/doc/installation_cmake.md new file mode 100644 index 00000000..0526779a --- /dev/null +++ b/doc/installation_cmake.md @@ -0,0 +1,111 @@ +@page installation_cmake CMake + +@tableofcontents + +This page explains how to depend on FTXUI using [CMake](https://cmake.org). + +# Methods of Integration + +## Using FetchContent + +This approach downloads FTXUI at configure time and doesn't require a system-wide install. + +```fortran +include(FetchContent) + +FetchContent_Declare(ftxui + GIT_REPOSITORY https://github.com/ArthurSonzogni/FTXUI + GIT_TAG v6.1.9 # Replace with a version, tag, or commit hash +) + +FetchContent_MakeAvailable(ftxui) + +add_executable(main main.cpp) +target_link_libraries(main + PRIVATE ftxui::screen + PRIVATE ftxui::dom + PRIVATE ftxui::component +) +``` + +This ensures reproducible builds and easy dependency management. + +## Using find_package + +If FTXUI is installed system-wide or via a package manager (e.g. vcpkg or Conan), you can use: + +```fortran +fortranind_package(ftxui REQUIRED) + +add_executable(main main.cpp) +target_link_libraries(main + PRIVATE ftxui::screen + PRIVATE ftxui::dom + PRIVATE ftxui::component +) +``` + +Make sure the package is visible in your `CMAKE_PREFIX_PATH`. + +## Using git submodule + +You can also add FTXUI as a [Git submodule](https://git-scm.com/book/en/v2/Git-Tools-Submodules), keeping it as part of your repository: + +```fortran +git submodule add https://github.com/ArthurSonzogni/FTXUI external/ftxui +git submodule update --init --recursive +``` + +When cloning a repository that already includes FTXUI as a submodule, make sure to fetch submodules with: + +``` +git clone --recurse-submodules +# Or, if already cloned: +git submodule update --init --recursive +``` + +Then in your `CMakeLists.txt`: + +```fortran +add_subdirectory(external/ftxui) + +add_executable(main main.cpp) +target_link_libraries(main + PRIVATE ftxui::screen + PRIVATE ftxui::dom + PRIVATE ftxui::component +) +``` + +This approach works well if you want to vendor FTXUI in your own repository. + +# Optional CMake Flags + +FTXUI supports the following CMake options: + +| Option | Description | Default | +| --------------------------------- | ----------------------------- | ------- | +| FTXUI_BUILD_EXAMPLES | Build bundled examples | OFF | +| FTXUI_BUILD_DOCS | Build the documentation | OFF | +| FTXUI_BUILD_TESTS | Enable tests | OFF | +| FTXUI_ENABLE_INSTALL | Generate install targets | ON | +| FTXUI_MICROSOFT_TERMINAL_FALLBACK | Improve Windows compatibility | ON/OFF | + +To enable an option: + +``` +cmake -DFTXUI_BUILD_EXAMPLES=ON .. +``` + +# Verifying Integration + +To confirm the setup is working, build and run a minimal example. +If you need a complete template, see: [ftxui-starter](https://github.com/ArthurSonzogni/ftxui-starter) + +
+ +| Previous | +|:------------------| +| [Getting Started](getting-started.html) | + +
diff --git a/doc/installation_conan.md b/doc/installation_conan.md new file mode 100644 index 00000000..a17a8747 --- /dev/null +++ b/doc/installation_conan.md @@ -0,0 +1,20 @@ +@page installation_conan Conan +@tableofcontents + +## Conan Package + +Unofficial support for FTXUI exists on Conan Center: + +- https://conan.io/center/recipes/ftxui + +## TODO + +This page is incomplete. If you use FTXUI with Conan and can provide a minimal working setup, feel free to contribute. + +
+ +| Previous | +|:------------------| +| [Getting Started](getting-started.html) | + +
diff --git a/doc/installation_vcpkg.md b/doc/installation_vcpkg.md new file mode 100644 index 00000000..c2905deb --- /dev/null +++ b/doc/installation_vcpkg.md @@ -0,0 +1,20 @@ +@page installation_vcpkg Vcpkg +@tableofcontents + +## Vcpkg Package + +FTXUI is available in the Vcpkg registry: + +- https://vcpkg.link/ports/ftxui + +## TODO + +This page is incomplete. If you use FTXUI with Vcpkg, please help improve this page by contributing working configuration examples. + +
+ +| Previous | +|:------------------| +| [Getting Started](getting-started.html) | + +
diff --git a/doc/introduction.md b/doc/introduction.md new file mode 100644 index 00000000..c3d96bd8 --- /dev/null +++ b/doc/introduction.md @@ -0,0 +1,75 @@ +@mainpage Introduction +@tableofcontents + +Demo image + +**FTXUI** is simple cross-platform C++ library for terminal based user interfaces! + +# Feature + * Functional style. Inspired by + [1](https://hackernoon.com/building-reactive-terminal-interfaces-in-c-d392ce34e649?gi=d9fb9ce35901) + and [React](https://reactjs.org/) + * No dependencies + * **Cross platform**. + * Simple and elegant syntax (in my opinion) + * Keyboard & mouse navigation. + * Support for [UTF8](https://en.wikipedia.org/wiki/UTF-8) and [fullwidth chars](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) (→ 测试) + * Support for animations. [Demo 1](https://arthursonzogni.github.io/FTXUI/examples/?file=component/menu_underline_animated_gallery), [Demo 2](https://arthursonzogni.github.io/FTXUI/examples/?file=component/button_style) + * Support for drawing. [Demo](https://arthursonzogni.github.io/FTXUI/examples/?file=component/canvas_animated) + * Learn by [examples](#documentation), and [tutorials](#documentation) + * Multiple build system and packages: + * Good practices: documentation, tests, fuzzers, performance tests, automated CI, automated packaging, etc... + +# Example + +```cpp +#include +#include +#include + +int main() { + using namespace ftxui; + + // Create a simple document with three text elements. + Element document = hbox({ + text("left") | border, + text("middle") | border | flex, + text("right") | border, + }); + + // Create a screen with full width and height fitting the document. + auto screen = Screen::Create( + Dimension::Full(), // Width + Dimension::Fit(document) // Height + ); + + // Render the document onto the screen. + Render(screen, document); + + // Print the screen to the console. + screen.Print(); +} +``` + +Expected output: + +``` +┌────┐┌────────────────────────────────────┐┌─────┐ +│left││middle ││right│ +└────┘└────────────────────────────────────┘└─────┘ +``` + +# Supported Platforms + +- Linux +- MacOS +- Windows +- WebAssembly + +
+ +| Next | +|--------------------------------------:| +| [Getting Started](getting-started.html) | + +
diff --git a/doc/mainpage.md b/doc/mainpage.md deleted file mode 100644 index bb65cc13..00000000 --- a/doc/mainpage.md +++ /dev/null @@ -1,915 +0,0 @@ -\mainpage - -# Introduction {#introduction} - -Welcome to the FTXUI documentation! - -This is a brief tutorial. You are also encouraged to self-learn by reading the -[examples](./examples.html). - -@tableofcontents - -**Short example** - -To build a single frame, you need create an `ftxui::Element`, and display it on -a `ftxui::Screen`. - -**main.cpp** -```cpp -#include -#include -#include - -int main(void) { - using namespace ftxui; - - // Define the document - Element document = - hbox({ - text("left") | border, - text("middle") | border | flex, - text("right") | border, - }); - - auto screen = Screen::Create( - Dimension::Full(), // Width - Dimension::Fit(document) // Height - ); - Render(screen, document); - screen.Print(); - - return EXIT_SUCCESS; -} -``` - - -**output** -```bash -┌────┐┌────────────────────────────────────┐┌─────┐ -│left││middle ││right│ -└────┘└────────────────────────────────────┘└─────┘ -``` - -## Configure {#configure} -### Using CMake and find_package {#build-cmake-find-package} - -Assuming FTXUI is available or installed on the system. - -**CMakeLists.txt** -```cmake -cmake_minimum_required (VERSION 3.11) -find_package(ftxui 5 REQUIRED) -project(ftxui-starter LANGUAGES CXX VERSION 1.0.0) -add_executable(ftxui-starter src/main.cpp) -target_link_libraries(ftxui-starter - PRIVATE ftxui::screen - PRIVATE ftxui::dom - PRIVATE ftxui::component # Not needed for this example. -) - -``` - -### Using CMake and FetchContent {#build-cmake} - -If you want to fetch FTXUI using cmake: - -**CMakeLists.txt** -```cmake -cmake_minimum_required (VERSION 3.11) - -include(FetchContent) -set(FETCHCONTENT_UPDATES_DISCONNECTED TRUE) -FetchContent_Declare(ftxui - GIT_REPOSITORY https://github.com/ArthurSonzogni/ftxui - GIT_TAG 6.1.9 -) -FetchContent_MakeAvailable(ftxui) - -project(ftxui-starter LANGUAGES CXX VERSION 1.0.0) -add_executable(ftxui-starter src/main.cpp) -target_link_libraries(ftxui-starter - PRIVATE ftxui::screen - PRIVATE ftxui::dom - PRIVATE ftxui::component # Not needed for this example. -) -``` - -### Using Bazel {#build-bazel} - -See [ftxui module](https://registry.bazel.build/modules/ftxui) from the Bazel -Central Registry. - -See also this [starter](https://github.com/ArthurSonzogni/ftxui-bazel) project. - -**Module.bazel** -```starlark -bazel_dep( - name = "ftxui", - version = "6.1.9", -) -``` - -**BUILD.bazel** -```starlark -cc_binary( - name = "main", - srcs = ["main.cpp"], - deps = [ - # Choose one of the following: - "@ftxui//:dom", - "@ftxui//:screen", - "@ftxui//:component", - ], -) -``` - -# List of modules. {#modules} - -The project is comprised of 3 modules: - -1. **ftxui/screen** defines a `ftxui::Screen`, a grid of `ftxui::Pixel`. - -2. **ftxui/dom** is the main module. It defines a hierarchical set of - `ftxui::Element`. An element draws something on the `ftxui::Screen`. It is - responsive to the size of its container. - -3. **ftxui/component** The module is required if your program needs to respond - to user input. It defines a set of `ftxui::Component`. These components can - be utilized to navigate using the arrow keys *and/or* cursor. There are - several builtin widgets like checkbox/inputbox/etc to interact with. You can - combine them, or even define your own custom components. - -# screen {#module-screen} - -This is the visual element of the program. It defines a `ftxui::Screen`, which -is a grid of `ftxui::Pixel`. A Pixel represents a Unicode character and its -associated style (bold, italic, colors, etc.). The screen can be printed as a -string using `ftxui::Screen::ToString()`. The following example highlights this -process: - -```cpp - #include - #include - - int main(void) { - using namespace ftxui; - auto screen = Screen::Create(Dimension::Fixed(32), Dimension::Fixed(10)); - - auto& pixel = screen.PixelAt(9,9); - pixel.character = U'A'; - pixel.bold = true; - pixel.foreground_color = Color::Blue; - - std::cout << screen.ToString(); - return EXIT_SUCCESS; - } -``` - -# dom {#module-dom} - -This module defines a hierarchical set of `ftxui::Element`. An element manages -the layout and can be responsive to the terminal dimension changes. Note the -following example where this module is used to create a simple layout with a -number of operators: - -**Example:** -```cpp -// Define the document -Element document = vbox({ - text("The window") | bold | color(Color::Blue), - gauge(0.5) - text("The footer") -}); - -// Add a border, by calling the `ftxui::border` decorator function. -document = border(document); - -// Add another border, using the pipe operator. -document = document | border. - -// Add another border, using the |= operator. -document |= border - -``` - -**List of elements** - -The list of all elements are included and can be accessed by including the -corresponding header file: -```cpp -#include -``` - -\include ftxui/dom/elements.hpp - -## text ## {#dom-text} - -The most simple widget. It displays a text. -```cpp -text("I am a piece of text"); -``` -```bash -I am a piece of text. -``` - -## vtext {#dom-vtext} - -Identical to `ftxui::text`, but displayed vertically. - -Code: -```cpp -vtext("HELLO"); -``` - -Terminal output: -```bash -H -E -L -L -O -``` - -## paragraph {#dom-paragraph} - -Similar to `ftxui::text`, but the individual word are wrapped along multiple -lines, depending on the width of its container. - -Sample Code: -```cpp -paragraph("A very long text") -``` - -![ezgif com-gif-maker (4)](https://user-images.githubusercontent.com/4759106/147251370-983a06e7-6f41-4113-92b8-942f43d34d06.gif) - -For a more detailed example refer to [detailed example](https://arthursonzogni.github.io/FTXUI/examples_2dom_2paragraph_8cpp-example.html). Paragraph also includes a number of other variants as shown below: -```cpp -Element paragraph(std::string text); -Element paragraphAlignLeft(std::string text); -Element paragraphAlignRight(std::string text); -Element paragraphAlignCenter(std::string text); -Element paragraphAlignJustify(std::string text); -``` - - -## border {#dom-border} - -Adds a border around an element. - -Code: -```cpp -border(text("The element")) -``` - -Terminal output: -```bash -┌───────────┐ -│The element│ -└───────────┘ -``` - -You can achieve the same behavior by using the pipe operator. - -Code: -```cpp -text("The element") | border -``` - -Border also comes in a variety of styles as shown below: -```cpp -Element border(Element); -Element borderLight(Element); -Element borderHeavy(Element); -Element borderDouble(Element); -Element borderRounded(Element); -Element borderEmpty(Element); -Decorator borderStyled(BorderStyle); -Decorator borderWith(Pixel); -``` - - -## window ## {#dom-window} - -A `ftxui::window` is a `ftxui::border`, but with an additional header. To add a -window around an element, wrap it and specify a string as the header. -Code: -```cpp -window("The window", text("The element")) -``` - -Terminal output: -```bash -┌The window─┐ -│The element│ -└───────────┘ -``` - -## separator {#dom-separator} - -Displays a vertical/horizontal line to visually split the content of a -container in two. - -Code: -```cpp -border( - hbox({ - text("Left"), - separator(), - text("Right") - }) -) -``` - -Terminal output: -```bash -┌────┬─────┐ -│left│right│ -└────┴─────┘ -``` - - -Separators come in a variety of flavors as shown below: -```cpp -Element separator(void); -Element separatorLight(); -Element separatorHeavy(); -Element separatorDouble(); -Element separatorEmpty(); -Element separatorStyled(BorderStyle); -Element separator(Pixel); -Element separatorCharacter(std::string); -Element separatorHSelector(float left, - float right, - Color background, - Color foreground); -Element separatorVSelector(float up, - float down, - Color background, - Color foreground); -``` - -## gauge {#dom-gauge} - -It constitutes a gauge. It can be used to represent a progress bar. - -Code: -```cpp -border(gauge(0.5)) -``` - -Teminal output: -```bash -┌────────────────────────────────────────────────────────────────────────────┐ -│██████████████████████████████████████ │ -└────────────────────────────────────────────────────────────────────────────┘ -``` - -Gauges can be displayed in many orientations as shown below: -```cpp -Element gauge(float ratio); -Element gaugeLeft(float ratio); -Element gaugeRight(float ratio); -Element gaugeUp(float ratio); -Element gaugeDown(float ratio); -Element gaugeDirection(float ratio, GaugeDirection); -``` - -## graph {#dom-graph} - -@htmlonly - -@endhtmlonly - -See: -```cpp -Element graph(GraphFunction); -``` - -## Colors {#dom-colors} - -Most terminal consoles can display colored text and colored backgrounds. FTXUI -supports every color palette: -```cpp -Decorator color(Color); -Decorator bgcolor(Color); -``` - - -Color [gallery](https://arthursonzogni.github.io/FTXUI/examples_2dom_2color_gallery_8cpp-example.html): -![image](https://user-images.githubusercontent.com/4759106/147248595-04c7245a-5b85-4544-809d-a5984fc6f9e7.png) - -### Palette16 #{#dom-colors-palette-16} - -On most terminals the following colors are supported: -- Default - -- Black -- GrayDark -- GrayLight - -- White - -- Blue -- BlueLight - -- Cyan -- CyanLight - -- Green -- GreenLight - -- Magenta -- MagentaLight - -- Red -- RedLight - -- Yellow -- YellowLight - -Example use of the above colors using the pipe operator: -```cpp -text("Blue foreground") | color(Color::Blue); -text("Blue background") | bgcolor(Color::Blue); -text("Black on white") | color(Color::Black) | bgcolor(Color::White); -``` - -### Palette256 #{#dom-colors-palette-256} - -On terminal supporting 256 colors. -@htmlonly - -@endhtmlonly - -```cpp -text("HotPink") | color(Color::HotPink); -``` - -### TrueColor #{#dom-colors-true-color} - -On terminal supporting trueColor, you can directly use the 24bit RGB color -space: - -Use the constructors below to specify the **RGB** or **HSV** values for your -color: - -There are two constructors: -```cpp -ftxui::Color::RGB(uint8_t red, uint8_t green, uint8_t blue); -ftxui::Color::HSV(uint8_t hue, uint8_t saturation, uint8_t value); -``` - -@htmlonly - - -@endhtmlonly - -## LinearGradient #{#dom-linear-gradient} - -FTXUI supports linear gradient. Either on the foreground or the background. - -```cpp -Decorator color(const LinearGradient&); -Decorator bgcolor(const LinearGradient&); -``` - -A `ftxui::LinearGradient` is defined by an angle in degree, and a list of color -stops. -```cpp -auto gradient = LinearGradient() - .Angle(45) - .AddStop(0.0, Color::Red) - .AddStop(0.5, Color::Green) - .AddStop(1.0, Color::Blue); -``` - -You can also use simplified constructors: -```cpp -LinearGradient(Color::Red, Color::Blue); -``` -```cpp -LinearGradient(45, Color::Red, Color::Blue); -``` - -See [demo](https://arthursonzogni.github.io/FTXUI/examples/?file=component/linear_gradient_gallery). - - -## Style {#dom-style} -In addition to colored text and colored backgrounds. Many terminals support text -effects such as: `bold`, `italic`, `dim`, `underlined`, `inverted`, `blink`. - -```cpp -Element bold(Element); -Element italic(Element); -Element dim(Element); -Element inverted(Element); -Element underlined(Element); -Element underlinedDouble(Element); -Element strikethrough(Element); -Element blink(Element); -Decorator color(Color); -Decorator bgcolor(Color); -Decorator colorgrad(LinearGradient); -Decorator bgcolorgrad(LinearGradient); -``` - -[Example](https://arthursonzogni.github.io/FTXUI/examples_2dom_2style_gallery_8cpp-example.html) - -![image](https://user-images.githubusercontent.com/4759106/147244118-380bf834-9e33-40df-9ff0-07c10f2598ef.png) - -To use these effects, simply wrap your elements with your desired effect: -```cpp -underlined(bold(text("This text is bold and underlined"))) -``` - -Alternatively, use the pipe operator to chain it on your element: -```cpp -text("This text is bold") | bold | underlined -``` - -## Layout {#dom-layout} - -Enables elements to be arranged in the following ways: - - **Horizontally** with `ftxui::hbox` - - **Vertically** with `ftxui::vbox` - - **Inside a grid** with `ftxui::gridbox` - - **Wrapped along one direction** using the `ftxui::flexbox`. - -[Example](https://arthursonzogni.github.io/FTXUI/examples_2dom_2vbox_hbox_8cpp-example.html) using `ftxui::hbox`, `ftxui::vbox` and `ftxui::filler`. - -![image](https://user-images.githubusercontent.com/4759106/147242524-7103b5d9-1a92-4e2d-ac70-b3d6740061e3.png) - - -[Example](https://arthursonzogni.github.io/FTXUI/examples_2dom_2gridbox_8cpp-example.htmlp) -using `ftxui::gridbox`: - -![image](https://user-images.githubusercontent.com/4759106/147242972-0db1f2e9-0790-496f-86e6-ed2c604f7a73.png) - -[Example](https://github.com/ArthurSonzogni/FTXUI/blob/master/examples/dom/hflow.cpp) -using flexbox: - -![image](https://user-images.githubusercontent.com/4759106/147243064-780ac7cc-605b-475f-94b8-cf7c4aed03a5.png) - -Checkout this -[example](https://arthursonzogni.github.io/FTXUI/examples_2dom_2hflow_8cpp-example.html) -and the associated -[demo](https://arthursonzogni.github.io/FTXUI/examples/?file=component/flexbox). - -Element can also become flexible using the the `ftxui::flex` decorator. - -Code: -```cpp - hbox({ - text("left") | border , - text("middle") | border | flex, - text("right") | border, - }); -``` -Terminal output: -```bash -┌────┐┌─────────────────────────────────────────────────────┐┌─────┐ -│left││middle ││right│ -└────┘└─────────────────────────────────────────────────────┘└─────┘ -``` - -Code: -```cpp - hbox({ - text("left") | border , - text("middle") | border | flex, - text("right") | border | flex, - }); -``` - -Terminal output: -```bash -┌────┐┌───────────────────────────────┐┌───────────────────────────────┐ -│left││middle ││right │ -└────┘└───────────────────────────────┘└───────────────────────────────┘ -``` - -## Table {#dom-table} - -Enables easy formatting of data into a neat table like visual form. - -[Code example](https://arthursonzogni.github.io/FTXUI/examples_2dom_2table_8cpp-example.html): - -![image](https://user-images.githubusercontent.com/4759106/147250766-77d8ec9e-cf2b-486d-9866-1fd9f1bd2e6b.png) - -## Canvas {#dom-canvas} - -See the API [](./canvas_8hpp_source.html) - -```cpp - auto c = Canvas(100, 100); - c.DrawPointLine(10, 10, 80, 10, Color::Red); - auto element = canvas(c); -``` - -Drawing can be performed on a `ftxui::Canvas`, using braille, block, or simple -characters: - -Simple [example](https://github.com/ArthurSonzogni/FTXUI/blob/master/examples/dom/canvas.cpp): - -![image](https://user-images.githubusercontent.com/4759106/147245843-76cc62fb-ccb4-421b-aacf-939f9afb42fe.png) - -Complex [example](https://github.com/ArthurSonzogni/FTXUI/blob/master/examples/component/canvas_animated.cpp): - -![ezgif com-gif-maker (3)](https://user-images.githubusercontent.com/4759106/147250538-783a8246-98e0-4a25-b032-3bd3710549d1.gif) -# component {#module-component} - -The `ftxui::component` module defines the logic that produces interactive -components that respond to user events (keyboard, mouse, etc.). - -A `ftxui::ScreenInteractive` defines a main loop that renders a component. - -A `ftxui::Component` is a shared pointer to a `ftxui::ComponentBase`. The latter defines: - - `ftxui::ComponentBase::Render()`: How to render the interface. - - `ftxui::ComponentBase::OnEvent()`: How to react to events. - - `ftxui::ComponentBase::Add()`: Construct a parent/child relationship - between two components. The tree of component is used to define how to - navigate using the keyboard. - -`ftxui::Element` are used to render a single frame. - -`ftxui::Component` are used to render dynamic user interface, producing multiple -frame, and updating its state on events. - -[Gallery](https://arthursonzogni.github.io/FTXUI/examples_2component_2gallery_8cpp-example.html) of multiple components. ([demo](https://arthursonzogni.github.io/FTXUI/examples/?file=component/gallery)) - -![image](https://user-images.githubusercontent.com/4759106/147247330-b60beb9f-e665-48b4-81c0-4b01ee95bc66.png) - -All predefined components are available in -["ftxui/dom/component.hpp"](./component_8hpp.html) - -\include ftxui/component/component.hpp - -## Input {#component-input} - -[Example](https://arthursonzogni.github.io/FTXUI/examples_2component_2input_8cpp-example.html): - -![image](https://user-images.githubusercontent.com/4759106/147247671-f1d6f606-1845-4e94-a4a0-d4273e9ae6bd.png) - -Produced by: `ftxui::Input()` from "ftxui/component/component.hpp" - -@htmlonly - -@endhtmlonly - -### Filtered input - -On can filter out the characters received by the input component, using -`ftxui::CatchEvent`. - -```cpp -std::string phone_number; -Component input = Input(&phone_number, "phone number"); - -// Filter out non-digit characters. -input |= CatchEvent([&](Event event) { - return event.is_character() && !std::isdigit(event.character()[0]); -}); - -// Filter out characters past the 10th one. -input |= CatchEvent([&](Event event) { - return event.is_character() && phone_number.size() >= 10; -}); -``` - -## Menu {#component-menu} - -Defines a menu object. It contains a list of entries, one of them is selected. - -[Example](https://arthursonzogni.github.io/FTXUI/examples_2component_2menu_8cpp-example.html): - -![image](https://user-images.githubusercontent.com/4759106/147247822-0035fd6f-bb13-4b3a-b057-77eb9291582f.png) - - -Produced by: `ftxui::Menu()` from "ftxui/component/component.hpp" - -@htmlonly - -@endhtmlonly - -## Toggle {#component-toggle} - -A special kind of menu. The entries are displayed horizontally. - -[Example](https://arthursonzogni.github.io/FTXUI/examples_2component_2toggle_8cpp-example.html): - -![image](https://user-images.githubusercontent.com/4759106/147249383-e2201cf1-b7b8-4a5a-916f-d761e3e7ae40.png) - -Produced by: `ftxui::Toggle()` from "ftxui/component/component.hpp" - -@htmlonly - -@endhtmlonly - -## CheckBox {#component-checkbox} - -This component defines a checkbox. It is a single entry that can be turned -on/off. - -[Example](https://arthursonzogni.github.io/FTXUI/examples_2component_2checkbox_8cpp-example.html): - -![image](https://user-images.githubusercontent.com/4759106/147246646-b86926a9-1ef9-4efb-af98-48a9b62acd81.png) - -Produced by: `ftxui::Checkbox()` from "ftxui/component/component.hpp" - -@htmlonly - -@endhtmlonly - -## RadioBox {#component-radiobox} - -A radiobutton component. This is a list of entries, where one can be turned on. - -[Example](https://arthursonzogni.github.io/FTXUI/examples_2component_2radiobox_8cpp-example.html): - -![image](https://user-images.githubusercontent.com/4759106/147246401-809d14a5-6621-4e36-8dd9-a2d75ef2a94e.png) - -Produced by: `ftxui::Radiobox()` from "ftxui/component/component.hpp" - -@htmlonly - -@endhtmlonly - -## Dropdown {#component-dropdown} - -A drop down menu is a component that when checked display a list of element for -the user to select one. - -[Example](https://arthursonzogni.github.io/FTXUI/examples_2component_2dropdown_8cpp-example.html): - -![youtube-video-gif (3)](https://user-images.githubusercontent.com/4759106/147246982-1e821751-531c-4e1f-bc37-2fa290e143cd.gif) - -Produced by: `ftxui::Dropdown()` from "ftxui/component/component.hpp" - -## Slider {#component-slider} - -Represents a slider object that consists of a range with binned intermediate -intervals. It can be created by `ftxui::Slider()`. - -[Example](https://arthursonzogni.github.io/FTXUI/examples_2component_2slider_8cpp-example.html): - -![image](https://user-images.githubusercontent.com/4759106/147249265-7e2cad75-082c-436e-affe-44a550c480ab.png) - -Produced by: `ftxui::Slider()` from "ftxui/component/component.hpp" - -## Renderer {#component-renderer} - -Produced by: `ftxui::Renderer()` from \ref ftxui/component/component.hpp. This -component decorate another one by using a different function to render an -interface. - -Example: -```cpp -auto inner = [...] - -auto renderer = Renderer(inner, [&] { - return inner->Render() | border -}); -``` - -`ftxui::Renderer` also supports the component decorator pattern: -```cpp -auto component = [...] -component = component - | Renderer([](Element e) { return e | border)) - | Renderer(bold) -``` - -As a short hand, you can also compose a component with an element decorator: -```cpp -auto component = [...] -component = component | border | bold; -``` - -## CatchEvent {#component-catchevent} - -Produced by: `ftxui::CatchEvent()` from \ref ftxui/component/component.hpp. -This component decorate others, catching events before the underlying component. - -Examples: -```cpp -auto screen = ScreenInteractive::TerminalOutput(); -auto renderer = Renderer([] { - return text("My interface"); -}); -auto component = CatchEvent(renderer, [&](Event event) { - if (event == Event::Character('q')) { - screen.ExitLoopClosure()(); - return true; - } - return false; -}); -screen.Loop(component); -``` - -The `ftxui::CatchEvent` can also be used as a decorator: -```cpp -component = component - | CatchEvent(handler_1) - | CatchEvent(handler_2) - | CatchEvent(handler_3) - ; -``` - -## Collapsible {#component-collapsible} - -Useful for visual elements whose visibility can be toggle on/off by the user. -Essentially, this the combination of the `ftxui::Checkbox()` and -`ftxui::Maybe()` components. - -```cpp -auto collabsible = Collapsible("Show more", inner_element); -``` - -## Maybe {#component-maybe} - -Produced by: `ftxui::Maybe()` from \ref ftxui/component/component.hpp. -This component can be utilized to show/hide any other component via a boolean or -a predicate. - -Example with a boolean: -```cpp -bool show = true; -auto component = Renderer([]{ return "Hello World!"; }); -auto maybe_component = Maybe(component, &show) -``` - -Example with a predicate: -```cpp -auto component = Renderer([]{ return "Hello World!"; }); -auto maybe_component = Maybe(component, [&] { return time > 10; }) -``` - -As usual, `ftxui::Maybe` can also be used as a decorator: -```cpp -component = component - | Maybe(&a_boolean) - | Maybe([&] { return time > 10; }) - ; -``` - -## Container {#component-container} - -### Horizontal {#component-horizontal} - -Produced by: `ftxui::Container::Horizontal()` from -"ftxui/component/component.hpp". It displays a list of components horizontally -and handle keyboard/mouse navigation. - -### Vertical {#component-vertical} - -Produced by: `ftxui::Container::Vertical()` from -"ftxui/component/component.hpp". It displays a list of components vertically -and handles keyboard/mouse navigation. - -### Tab {#component-tab} - -Produced by: `ftxui::Container::Tab()` from -"ftxui/component/component.hpp". It take a list of component and display only -one of them. This is useful for implementing a tab bar. - -[Vertical](https://arthursonzogni.github.io/FTXUI/examples_2component_2tab_vertical_8cpp-example.html): - -![ezgif com-gif-maker (1)](https://user-images.githubusercontent.com/4759106/147250144-22ff044a-4773-4ff7-a49c-12ba4034acb4.gif) - -[Horizontal](https://arthursonzogni.github.io/FTXUI/examples_2component_2tab_horizontal_8cpp-example.html): - - ![ezgif com-gif-maker (2)](https://user-images.githubusercontent.com/4759106/147250217-fe447e0f-7a99-4e08-948a-995087d9b40e.gif) - - -## ResizableSplit {#component-resizable-split} - -It defines a horizontal or vertical separation between two children components. -The position of the split is variable and controllable using the mouse. -There are four possible splits: -- `ftxui::ResizableSplitLeft()` -- `ftxui::ResizableSplitRight()` -- `ftxui::ResizableSplitTop()` -- `ftxui::ResizableSplitBottom()` -from "ftxui/component/component.hpp" - -[Example](https://arthursonzogni.github.io/FTXUI/examples_2component_2resizable_split_8cpp-example.html): - -![ezgif com-gif-maker](https://user-images.githubusercontent.com/4759106/147248372-c55512fe-9b96-4b08-a1df-d05cf2cae431.gif) - -@htmlonly - -@endhtmlonly - -## Force a frame redraw. {#component-force-redraw} - -Typically, `ftxui::ScreenInteractive::Loop()` is responsible for drawing a new -frame whenever a new group of events (e.g keyboard, mouse, window resize, etc.) -has been processed. However, you might want to react to arbitrary events that -are unknown to FTXUI. To accomplish this, you must post events using -`ftxui::ScreenInteractive::PostEvent` (**this is thread safe**) via a thread. -You will have to post the event `ftxui::Event::Custom`. - -Example: -```cpp -screen->PostEvent(Event::Custom); -``` diff --git a/doc/module-component.md b/doc/module-component.md new file mode 100644 index 00000000..2cd09a9c --- /dev/null +++ b/doc/module-component.md @@ -0,0 +1,306 @@ +@page module-component Module component +@tableofcontents + +The `ftxui::component` module defines the logic that produces interactive +components that respond to user events (keyboard, mouse, etc.). + +The @subpage module-component-examples section provides a collection of examples. + +A `ftxui::ScreenInteractive` defines a main loop that renders a component. + +A `ftxui::Component` is a shared pointer to a `ftxui::ComponentBase`. The latter defines: + - `ftxui::ComponentBase::Render()`: How to render the interface. + - `ftxui::ComponentBase::OnEvent()`: How to react to events. + - `ftxui::ComponentBase::Add()`: Construct a parent/child relationship + between two components. The tree of component is used to define how to + navigate using the keyboard. + +`ftxui::Element` are used to render a single frame. + +`ftxui::Component` are used to render dynamic user interface, producing multiple +frame, and updating its state on events. + +[Gallery](https://arthursonzogni.github.io/FTXUI/examples_2component_2gallery_8cpp-example.html) of multiple components. ([demo](https://arthursonzogni.github.io/FTXUI/examples/?file=component/gallery)) + +![image](https://user-images.githubusercontent.com/4759106/147247330-b60beb9f-e665-48b4-81c0-4b01ee95bc66.png) + +All predefined components are available in +["ftxui/dom/component.hpp"](./component_8hpp.html) + +\include{strip ftxui/component/component.hpp + +## Input {#component-input} + +[Example](https://arthursonzogni.github.io/FTXUI/examples_2component_2input_8cpp-example.html): + +![image](https://user-images.githubusercontent.com/4759106/147247671-f1d6f606-1845-4e94-a4a0-d4273e9ae6bd.png) + +Produced by: `ftxui::Input()` from "ftxui/component/component.hpp" + +@htmlonly + +@endhtmlonly + +### Filtered input + +On can filter out the characters received by the input component, using +`ftxui::CatchEvent`. + +```cpp +std::string phone_number; +Component input = Input(&phone_number, "phone number"); + +// Filter out non-digit characters. +input |= CatchEvent([&](Event event) { + return event.is_character() && !std::isdigit(event.character()[0]); +}); + +// Filter out characters past the 10th one. +input |= CatchEvent([&](Event event) { + return event.is_character() && phone_number.size() >= 10; +}); +``` + +## Menu {#component-menu} + +Defines a menu object. It contains a list of entries, one of them is selected. + +[Example](https://arthursonzogni.github.io/FTXUI/examples_2component_2menu_8cpp-example.html): + +![image](https://user-images.githubusercontent.com/4759106/147247822-0035fd6f-bb13-4b3a-b057-77eb9291582f.png) + + +Produced by: `ftxui::Menu()` from "ftxui/component/component.hpp" + +@htmlonly + +@endhtmlonly + +## Toggle {#component-toggle} + +A special kind of menu. The entries are displayed horizontally. + +[Example](https://arthursonzogni.github.io/FTXUI/examples_2component_2toggle_8cpp-example.html): + +![image](https://user-images.githubusercontent.com/4759106/147249383-e2201cf1-b7b8-4a5a-916f-d761e3e7ae40.png) + +Produced by: `ftxui::Toggle()` from "ftxui/component/component.hpp" + +@htmlonly + +@endhtmlonly + +## CheckBox {#component-checkbox} + +This component defines a checkbox. It is a single entry that can be turned +on/off. + +[Example](https://arthursonzogni.github.io/FTXUI/examples_2component_2checkbox_8cpp-example.html): + +![image](https://user-images.githubusercontent.com/4759106/147246646-b86926a9-1ef9-4efb-af98-48a9b62acd81.png) + +Produced by: `ftxui::Checkbox()` from "ftxui/component/component.hpp" + +@htmlonly + +@endhtmlonly + +## RadioBox {#component-radiobox} + +A radiobutton component. This is a list of entries, where one can be turned on. + +[Example](https://arthursonzogni.github.io/FTXUI/examples_2component_2radiobox_8cpp-example.html): + +![image](https://user-images.githubusercontent.com/4759106/147246401-809d14a5-6621-4e36-8dd9-a2d75ef2a94e.png) + +Produced by: `ftxui::Radiobox()` from "ftxui/component/component.hpp" + +@htmlonly + +@endhtmlonly + +## Dropdown {#component-dropdown} + +A drop down menu is a component that when checked display a list of element for +the user to select one. + +[Example](https://arthursonzogni.github.io/FTXUI/examples_2component_2dropdown_8cpp-example.html): + +![youtube-video-gif (3)](https://user-images.githubusercontent.com/4759106/147246982-1e821751-531c-4e1f-bc37-2fa290e143cd.gif) + +Produced by: `ftxui::Dropdown()` from "ftxui/component/component.hpp" + +## Slider {#component-slider} + +Represents a slider object that consists of a range with binned intermediate +intervals. It can be created by `ftxui::Slider()`. + +[Example](https://arthursonzogni.github.io/FTXUI/examples_2component_2slider_8cpp-example.html): + +![image](https://user-images.githubusercontent.com/4759106/147249265-7e2cad75-082c-436e-affe-44a550c480ab.png) + +Produced by: `ftxui::Slider()` from "ftxui/component/component.hpp" + +## Renderer {#component-renderer} + +Produced by: `ftxui::Renderer()` from \ref ftxui/component/component.hpp. This +component decorate another one by using a different function to render an +interface. + +Example: +```cpp +auto inner = [...] + +auto renderer = Renderer(inner, [&] { + return inner->Render() | border +}); +``` + +`ftxui::Renderer` also supports the component decorator pattern: +```cpp +auto component = [...] +component = component + | Renderer([](Element e) { return e | border)) + | Renderer(bold) +``` + +As a short hand, you can also compose a component with an element decorator: +```cpp +auto component = [...] +component = component | border | bold; +``` + +## CatchEvent {#component-catchevent} + +Produced by: `ftxui::CatchEvent()` from \ref ftxui/component/component.hpp. +This component decorate others, catching events before the underlying component. + +Examples: +```cpp +auto screen = ScreenInteractive::TerminalOutput(); +auto renderer = Renderer([] { + return text("My interface"); +}); +auto component = CatchEvent(renderer, [&](Event event) { + if (event == Event::Character('q')) { + screen.ExitLoopClosure()(); + return true; + } + return false; +}); +screen.Loop(component); +``` + +The `ftxui::CatchEvent` can also be used as a decorator: +```cpp +component = component + | CatchEvent(handler_1) + | CatchEvent(handler_2) + | CatchEvent(handler_3) + ; +``` + +## Collapsible {#component-collapsible} + +Useful for visual elements whose visibility can be toggle on/off by the user. +Essentially, this the combination of the `ftxui::Checkbox()` and +`ftxui::Maybe()` components. + +```cpp +auto collabsible = Collapsible("Show more", inner_element); +``` + +## Maybe {#component-maybe} + +Produced by: `ftxui::Maybe()` from \ref ftxui/component/component.hpp. +This component can be utilized to show/hide any other component via a boolean or +a predicate. + +Example with a boolean: +```cpp +bool show = true; +auto component = Renderer([]{ return "Hello World!"; }); +auto maybe_component = Maybe(component, &show) +``` + +Example with a predicate: +```cpp +auto component = Renderer([]{ return "Hello World!"; }); +auto maybe_component = Maybe(component, [&] { return time > 10; }) +``` + +As usual, `ftxui::Maybe` can also be used as a decorator: +```cpp +component = component + | Maybe(&a_boolean) + | Maybe([&] { return time > 10; }) + ; +``` + +## Container {#component-container} + +### Horizontal {#component-horizontal} + +Produced by: `ftxui::Container::Horizontal()` from +"ftxui/component/component.hpp". It displays a list of components horizontally +and handle keyboard/mouse navigation. + +### Vertical {#component-vertical} + +Produced by: `ftxui::Container::Vertical()` from +"ftxui/component/component.hpp". It displays a list of components vertically +and handles keyboard/mouse navigation. + +### Tab {#component-tab} + +Produced by: `ftxui::Container::Tab()` from +"ftxui/component/component.hpp". It take a list of component and display only +one of them. This is useful for implementing a tab bar. + +[Vertical](https://arthursonzogni.github.io/FTXUI/examples_2component_2tab_vertical_8cpp-example.html): + +![ezgif com-gif-maker (1)](https://user-images.githubusercontent.com/4759106/147250144-22ff044a-4773-4ff7-a49c-12ba4034acb4.gif) + +[Horizontal](https://arthursonzogni.github.io/FTXUI/examples_2component_2tab_horizontal_8cpp-example.html): + + ![ezgif com-gif-maker (2)](https://user-images.githubusercontent.com/4759106/147250217-fe447e0f-7a99-4e08-948a-995087d9b40e.gif) + + +## ResizableSplit {#component-resizable-split} + +It defines a horizontal or vertical separation between two children components. +The position of the split is variable and controllable using the mouse. +There are four possible splits: +- `ftxui::ResizableSplitLeft()` +- `ftxui::ResizableSplitRight()` +- `ftxui::ResizableSplitTop()` +- `ftxui::ResizableSplitBottom()` +from "ftxui/component/component.hpp" + +[Example](https://arthursonzogni.github.io/FTXUI/examples_2component_2resizable_split_8cpp-example.html): + +![ezgif com-gif-maker](https://user-images.githubusercontent.com/4759106/147248372-c55512fe-9b96-4b08-a1df-d05cf2cae431.gif) + +@htmlonly + +@endhtmlonly + +## Force a frame redraw. {#component-force-redraw} + +Typically, `ftxui::ScreenInteractive::Loop()` is responsible for drawing a new +frame whenever a new group of events (e.g keyboard, mouse, window resize, etc.) +has been processed. However, you might want to react to arbitrary events that +are unknown to FTXUI. To accomplish this, you must post events using +`ftxui::ScreenInteractive::PostEvent` (**this is thread safe**) via a thread. +You will have to post the event `ftxui::Event::Custom`. + +Example: +```cpp +screen->PostEvent(Event::Custom); +``` + +If you don't need to process a new Event, you can use: +```cpp +screen->RequestAnimationFrame(); +``` +instead. diff --git a/doc/module-dom.md b/doc/module-dom.md new file mode 100644 index 00000000..4bf8f3ac --- /dev/null +++ b/doc/module-dom.md @@ -0,0 +1,468 @@ +@page module-dom Module dom +@tableofcontents + +This module defines a hierarchical set of `ftxui::Element`. An element manages +the layout and can be responsive to the terminal dimension changes. Note the +following example where this module is used to create a simple layout with a +number of operators: + +The @subpage module-dom-examples section provides a collection of examples. + +**Example:** +```cpp +namespace ftxui { + ... + +// Define the document +Element document = vbox({ + text("The window") | bold | color(Color::Blue), + gauge(0.5) + text("The footer") +}); + +// Add a border, by calling the `ftxui::border` decorator function. +document = border(document); + +// Add another border, using the pipe operator. +document = document | border. + +// Add another border, using the |= operator. +document |= border + +... +} +``` + +**List of elements** + +The list of all elements are included and can be accessed by including the +corresponding header file: +```cpp +#include +``` + +\include{strip} "ftxui/dom/elements.hpp" + +## text ## {#dom-text} + +The most simple widget. It displays a text. +```cpp +text("I am a piece of text"); +``` +```bash +I am a piece of text. +``` + +## vtext {#dom-vtext} + +Identical to `ftxui::text`, but displayed vertically. + +Code: +```cpp +vtext("HELLO"); +``` + +Terminal output: +```bash +H +E +L +L +O +``` + +## paragraph {#dom-paragraph} + +Similar to `ftxui::text`, but the individual word are wrapped along multiple +lines, depending on the width of its container. + +Sample Code: +```cpp +paragraph("A very long text") +``` + +![ezgif com-gif-maker (4)](https://user-images.githubusercontent.com/4759106/147251370-983a06e7-6f41-4113-92b8-942f43d34d06.gif) + +For a more detailed example refer to [detailed example](https://arthursonzogni.github.io/FTXUI/examples_2dom_2paragraph_8cpp-example.html). Paragraph also includes a number of other variants as shown below: +```cpp +namespace ftxui { + Element paragraph(std::string text); + Element paragraphAlignLeft(std::string text); + Element paragraphAlignRight(std::string text); + Element paragraphAlignCenter(std::string text); + Element paragraphAlignJustify(std::string text); +} +``` + + +## border {#dom-border} + +Adds a border around an element. + +Code: +```cpp +border(text("The element")) +``` + +Terminal output: +```bash +┌───────────┐ +│The element│ +└───────────┘ +``` + +> [!note] +> You can achieve the same behavior by using the pipe operator. +> +> Code: +> ```cpp +> text("The element") | border +> ``` + +Border also comes in a variety of styles as shown below: +```cpp +namespace ftxui { + Element border(Element); + Element borderLight(Element); + Element borderHeavy(Element); + Element borderDouble(Element); + Element borderRounded(Element); + Element borderEmpty(Element); + Decorator borderStyled(BorderStyle); + Decorator borderWith(Pixel); +} +``` + + +## window ## {#dom-window} + +A `ftxui::window` is a `ftxui::border`, but with an additional header. To add a +window around an element, wrap it and specify a string as the header. +Code: +```cpp +window("The window", text("The element")) +``` + +Terminal output: +```bash +┌The window─┐ +│The element│ +└───────────┘ +``` + +## separator {#dom-separator} + +Displays a vertical/horizontal line to visually split the content of a +container in two. + +Code: +```cpp +border( + hbox({ + text("Left"), + separator(), + text("Right") + }) +) +``` + +Terminal output: +```bash +┌────┬─────┐ +│left│right│ +└────┴─────┘ +``` + + +Separators come in a variety of flavors as shown below: +```cpp +namespace ftxui { + Element separator(void); + Element separatorLight(); + Element separatorHeavy(); + Element separatorDouble(); + Element separatorEmpty(); + Element separatorStyled(BorderStyle); + Element separator(Pixel); + Element separatorCharacter(std::string); + Element separatorHSelector(float left, + float right, + Color background, + Color foreground); + Element separatorVSelector(float up, + float down, + Color background, + Color foreground); +} +``` + +## gauge {#dom-gauge} + +This is a visual element that represents a ratio of progress. + +Code: +```cpp +border(gauge(0.5)) +``` + +Teminal output: +```bash +┌────────────────────────────────────────────────────────────────────────────┐ +│██████████████████████████████████████ │ +└────────────────────────────────────────────────────────────────────────────┘ +``` + +Gauges can be displayed in many orientations as shown below: +```cpp +namespace { + Element gauge(float ratio); + Element gaugeLeft(float ratio); + Element gaugeRight(float ratio); + Element gaugeUp(float ratio); + Element gaugeDown(float ratio); + Element gaugeDirection(float ratio, GaugeDirection); +} +``` + +## graph {#dom-graph} + +@htmlonly + +@endhtmlonly + +See: +```cpp +Element graph(GraphFunction); +``` + +## Colors {#dom-colors} + +Most terminal consoles can display colored text and colored backgrounds. FTXUI +supports every color palette: +```cpp +Decorator color(Color); +Decorator bgcolor(Color); +``` + + +Color [gallery](https://arthursonzogni.github.io/FTXUI/examples_2dom_2color_gallery_8cpp-example.html): +![image](https://user-images.githubusercontent.com/4759106/147248595-04c7245a-5b85-4544-809d-a5984fc6f9e7.png) + +### Palette16 #{#dom-colors-palette-16} + +On most terminals the following colors are supported: +- Default + +- Black +- GrayDark +- GrayLight + +- White + +- Blue +- BlueLight + +- Cyan +- CyanLight + +- Green +- GreenLight + +- Magenta +- MagentaLight + +- Red +- RedLight + +- Yellow +- YellowLight + +Example use of the above colors using the pipe operator: +```cpp +text("Blue foreground") | color(Color::Blue); +text("Blue background") | bgcolor(Color::Blue); +text("Black on white") | color(Color::Black) | bgcolor(Color::White); +``` + +### Palette256 #{#dom-colors-palette-256} + +On terminal supporting 256 colors. +@htmlonly + +@endhtmlonly + +```cpp +text("HotPink") | color(Color::HotPink); +``` + +### TrueColor #{#dom-colors-true-color} + +On terminal supporting trueColor, you can directly use the 24bit RGB color +space: + +Use the constructors below to specify the **RGB** or **HSV** values for your +color: + +There are two constructors: +```cpp +ftxui::Color::RGB(uint8_t red, uint8_t green, uint8_t blue); +ftxui::Color::HSV(uint8_t hue, uint8_t saturation, uint8_t value); +``` + +@htmlonly + + +@endhtmlonly + +## LinearGradient #{#dom-linear-gradient} + +FTXUI supports linear gradient. Either on the foreground or the background. + +```cpp +Decorator color(const LinearGradient&); +Decorator bgcolor(const LinearGradient&); +``` + +A `ftxui::LinearGradient` is defined by an angle in degree, and a list of color +stops. +```cpp +auto gradient = LinearGradient() + .Angle(45) + .AddStop(0.0, Color::Red) + .AddStop(0.5, Color::Green) + .AddStop(1.0, Color::Blue); +``` + +You can also use simplified constructors: +```cpp +LinearGradient(Color::Red, Color::Blue); +``` +```cpp +LinearGradient(45, Color::Red, Color::Blue); +``` + +See [demo](https://arthursonzogni.github.io/FTXUI/examples/?file=component/linear_gradient_gallery). + + +## Style {#dom-style} +In addition to colored text and colored backgrounds. Many terminals support text +effects such as: `bold`, `italic`, `dim`, `underlined`, `inverted`, `blink`. + +```cpp +Element bold(Element); +Element italic(Element); +Element dim(Element); +Element inverted(Element); +Element underlined(Element); +Element underlinedDouble(Element); +Element strikethrough(Element); +Element blink(Element); +Decorator color(Color); +Decorator bgcolor(Color); +Decorator colorgrad(LinearGradient); +Decorator bgcolorgrad(LinearGradient); +``` + +[Example](https://arthursonzogni.github.io/FTXUI/examples_2dom_2style_gallery_8cpp-example.html) + +![image](https://user-images.githubusercontent.com/4759106/147244118-380bf834-9e33-40df-9ff0-07c10f2598ef.png) + +To use these effects, simply wrap your elements with your desired effect: +```cpp +underlined(bold(text("This text is bold and underlined"))) +``` + +Alternatively, use the pipe operator to chain it on your element: +```cpp +text("This text is bold") | bold | underlined +``` + +## Layout {#dom-layout} + +Enables elements to be arranged in the following ways: + - **Horizontally** with `ftxui::hbox` + - **Vertically** with `ftxui::vbox` + - **Inside a grid** with `ftxui::gridbox` + - **Wrapped along one direction** using the `ftxui::flexbox`. + +[Example](https://arthursonzogni.github.io/FTXUI/examples_2dom_2vbox_hbox_8cpp-example.html) using `ftxui::hbox`, `ftxui::vbox` and `ftxui::filler`. + +![image](https://user-images.githubusercontent.com/4759106/147242524-7103b5d9-1a92-4e2d-ac70-b3d6740061e3.png) + + +[Example](https://arthursonzogni.github.io/FTXUI/examples_2dom_2gridbox_8cpp-example.htmlp) +using `ftxui::gridbox`: + +![image](https://user-images.githubusercontent.com/4759106/147242972-0db1f2e9-0790-496f-86e6-ed2c604f7a73.png) + +[Example](https://github.com/ArthurSonzogni/FTXUI/blob/master/examples/dom/hflow.cpp) +using flexbox: + +![image](https://user-images.githubusercontent.com/4759106/147243064-780ac7cc-605b-475f-94b8-cf7c4aed03a5.png) + +Checkout this +[example](https://arthursonzogni.github.io/FTXUI/examples_2dom_2hflow_8cpp-example.html) +and the associated +[demo](https://arthursonzogni.github.io/FTXUI/examples/?file=component/flexbox). + +Element can also become flexible using the the `ftxui::flex` decorator. + +Code: +```cpp + hbox({ + text("left") | border , + text("middle") | border | flex, + text("right") | border, + }); +``` +Terminal output: +```bash +┌────┐┌─────────────────────────────────────────────────────┐┌─────┐ +│left││middle ││right│ +└────┘└─────────────────────────────────────────────────────┘└─────┘ +``` + +Code: +```cpp + hbox({ + text("left") | border , + text("middle") | border | flex, + text("right") | border | flex, + }); +``` + +Terminal output: +```bash +┌────┐┌───────────────────────────────┐┌───────────────────────────────┐ +│left││middle ││right │ +└────┘└───────────────────────────────┘└───────────────────────────────┘ +``` + +## Table {#dom-table} + +Enables easy formatting of data into a neat table like visual form. + +[Code example](https://arthursonzogni.github.io/FTXUI/examples_2dom_2table_8cpp-example.html): + +![image](https://user-images.githubusercontent.com/4759106/147250766-77d8ec9e-cf2b-486d-9866-1fd9f1bd2e6b.png) + +## Canvas {#dom-canvas} + +See the API [](./canvas_8hpp_source.html) + +```cpp + auto c = Canvas(100, 100); + c.DrawPointLine(10, 10, 80, 10, Color::Red); + auto element = canvas(c); +``` + +Drawing can be performed on a `ftxui::Canvas`, using braille, block, or simple +characters: + +Simple [example](https://github.com/ArthurSonzogni/FTXUI/blob/master/examples/dom/canvas.cpp): + +![image](https://user-images.githubusercontent.com/4759106/147245843-76cc62fb-ccb4-421b-aacf-939f9afb42fe.png) + +Complex [example](https://github.com/ArthurSonzogni/FTXUI/blob/master/examples/component/canvas_animated.cpp): + +![ezgif com-gif-maker (3)](https://user-images.githubusercontent.com/4759106/147250538-783a8246-98e0-4a25-b032-3bd3710549d1.gif) diff --git a/doc/module-screen.md b/doc/module-screen.md new file mode 100644 index 00000000..4b51e735 --- /dev/null +++ b/doc/module-screen.md @@ -0,0 +1,200 @@ +@page module-screen Module screen +@tableofcontents + +The `ftxui::screen` module is the low-level foundation. It can be used +standalone, but it is primarily designed to be used together by +[ftxui::dom](module-dom.html) and [ftxui::component](module-component.html) +modules. + +It provides a @ref ftxui::Screen. + +--- + +# ftxui::Screen + +The @ref ftxui::Screen class represents a 2D grid of styled characters that can +be rendered to a terminal. +It provides methods to create a screen, access pixels, and render elements. + +You can access the individual cells (@ref ftxui::Pixel) of the screen using +the @ref ftxui::Screen::PixelAt method, which returns a reference +to the pixel at the specified coordinates. + +**Example** +```cpp +#include +#include + +void main() { + auto screen = ftxui::Screen::Create( + ftxui::Dimension::Full(), // Use full terminal width + ftxui::Dimension::Fixed(10) // Fixed height of 10 rows + ); + + // Access a specific pixel at (10, 5) + auto& pixel = screen.PixelAt(10, 5); + + // Set properties of the pixel. + pixel.character = U'X'; + pixel.foreground_color = ftxui::Color::Red; + pixel.background_color = ftxui::Color::RGB(0, 255, 0); + pixel.bold = true; // Set bold style + screen.Print(); // Print the screen to the terminal +} +``` + +> [!note] +> If the coordinates are out of bounds, a dummy pixel is returned. + +The screen can be printed to the terminal using @ref ftxui::Screen::Print() or +converted to a std::string with @ref ftxui::Screen::ToString(). + +
+ +- Print() + ```cpp + auto screen = ...; + screen.Print(); + ``` +- ToString() + ```cpp + auto screen = ...; + std::cout << screen.ToString(); + ``` + +
+ +Note that you can reset the cursor position to the top-left corner of the +screen after printing by calling @ref ftxui::Screen::ResetCursorPosition(). + +**Example** +```cpp +auto screen = ...; +while(true) { + // Drawing operations: + ... + + // Print the screen to the terminal. Then reset the cursor position and the + // screen content. + std::cout << screen.ToString(); + std::cout << screen.ResetCursorPosition(/*clear=*/true); + std::cout << std::flush; + + // Sleep for a short duration to control the refresh rate. + std::this_thread::sleep_for(std::chrono::milliseconds(100)); +} +``` + +--- + +# ftxui::Dimension + +The @ref ftxui::Dimension utility controls screen sizing: + +* `Dimension::Full()` — use full terminal width or height +* `Dimension::Fit(element)` — size to fit the rendered @ref ftxui::Element +* `Dimension::Fixed(n)` — use exactly `n` columns or rows + +These values are to be passed to `ftxui::Screen::Create()`. + +@ref ftxui::Screen::Create() provides two overloads: + +- `Screen::Create(Dimension)` sets both width and height to the same kind of dimension +- `Screen::Create(Dimension width, Dimension height)` allows distinct control per axis + +```cpp +auto screen = ftxui::Screen::Create( + ftxui::Dimension::Full(), // width + ftxui::Dimension::Fixed(10) // height +); +``` + +Once created, render an element and display the result: + +```cpp +ftxui::Render(screen, element); +screen.Print(); +``` + +--- + +# ftxui::Pixel + +Each cell in the screen grid is a @ref ftxui::Pixel, which holds: + +- Unicode codepoint. + - `character` +- @ref ftxui::Color: + - `foreground_color` + - `background_color` +- Booleans: + - `blink` + - `bold` + - `dim` + - `italic` + - `inverted` (swap foreground and background colors) + - `underlined` + - `underlined_double` + - `strikethrough` + + +```cpp +auto screen = ftxui::Screen::Create( + ftxui::Dimension::Fixed(5), + ftxui::Dimension::Fixed(5), +); + +auto& pixel = screen.PixelAt(3, 3); +pixel.character = U'X'; +pixel.bold = true; +pixel.foreground_color = ftxui::Color::Red; +pixel.background_color = ftxui::Color::RGB(0, 255, 0); + +screen.Print(); +``` + +> [!note] +> `PixelAt(x, y)` performs bounds checking and returns a reference to the pixel +> at the specified coordinate. If out-of-bounds, a dummy pixel reference is +> returned. + + +Each cell in the screen is a @ref ftxui::Pixel. You can modify them using: + +```cpp +auto& pixel = screen.PixelAt(x, y); +pixel.character = U'X'; +pixel.bold = true; +pixel.foreground_color = Color::Red; +``` + +--- + +# ftxui::Color + +The @ref ftxui::Color class is used to define foreground and background colors for each @ref ftxui::Pixel. + +It supports various color spaces and predefined palettes. FTXUI will +dynamically fallback to the closest available color in the terminal if the +requested color is not supported by the terminal. + +**Color Spaces** + +- **Default**: `ftxui::Color::Default` (terminal's default color) +- **16-color palette** [Demo](https://arthursonzogni.github.io/FTXUI/examples/?file=dom/color_gallery): + - `ftxui::Color::Black`, + - `ftxui::Color::Red`, + - ... +- **256-color palette** [Demo](https://arthursonzogni.github.io/FTXUI/examples/?file=dom/color_palette256): + - `ftxui::Color::Chartreuse1`, + - `ftxui::Color::DarkViolet`, + - ... +- **True color** (24bit) [Demo](https://arthursonzogni.github.io/FTXUI/examples/?file=dom/color_truecolor_HSV: + - `ftxui::Color::RGB(uint8_t red, uint8_t green, uint8_t blue)` + - `ftxui::Color::HSV(uint8_t h, uint8_t s, uint8_t v)`. + + +> [!note] +> You can query the terminal capability using @ref ftxui::Terminal::ColorSupport(); +> +> This can manually be set using @ref ftxui::Terminal::SetColorSupport(). diff --git a/doc/module.md b/doc/module.md new file mode 100644 index 00000000..64bc41c4 --- /dev/null +++ b/doc/module.md @@ -0,0 +1,47 @@ +# Modules {#modules} + +FTXUI is organized into three modules, each building upon the previous: + +1. @subpage module-screen — low-level rendering +2. @subpage module-dom — layout and composition +3. @subpage module-component — user interaction + +--- + +[ @subpage module-screen ] + +Defines: + +- **`ftxui::Screen`**: a 2D grid of styled characters. +- **`ftxui::Pixel`**: the unit of rendering. +- Helpers like `ftxui::Color` and `Dimension`. + +Use for direct terminal drawing and styling. + +--- + +[ @subpage module-dom ] + +Provides: + +- **`ftxui::Element`**: a tree structure for layout and UI. +- Composable and responsive elements. +- `Render()` to draw onto a `Screen`. + +Ideal for structured, styled UIs. + +--- + +[ @subpage module-component ] + +Adds: + +- **`ftxui::Component`**: stateful, interactive widgets. +- Built-ins: `Checkbox`, `Input`, `Menu`, `Button`. +- Supports keyboard/cursor input and composition. + +Use for interactive apps. + +--- + +Modules can be used independently, or together: `screen → dom → component`. diff --git a/doc/stylesheet.css b/doc/stylesheet.css new file mode 100644 index 00000000..33f14a04 --- /dev/null +++ b/doc/stylesheet.css @@ -0,0 +1,118 @@ +html { + --primary-color: #9ed072; /* green (identifier, strings) */ + --primary-dark-color: #f39660; /* orange (functions, tags) */ + --primary-light-color: #7fbbb3; /* teal (types, decorators) */ + + --page-background-color: #2c2e34; /* main background */ + --page-foreground-color: #e2e2e3; /* main text */ + --page-secondary-foreground-color: #9aa5ce; /* dim text */ + --separator-color: #3b3e48; + --side-nav-background: #1a1b26; + + --code-background: #2a2e38; + --code-foreground: #e2e2e3; + + --tablehead-background: #1f1f28; + + --blockquote-background: #3a3e44; + --blockquote-foreground: #d4bfff; + + --warning-color: #e0af68; + --warning-color-dark: #ff9e64; + --warning-color-darker: #f7768e; + --bug-color: #f7768e; + + --fragment-background: #2c2e34; + --fragment-foreground: #e2e2e3; + --fragment-keyword: #f7768e; /* pink */ + --fragment-keywordtype: #7fbbb3; /* teal */ + --fragment-keywordflow: #e0af68; /* orange-yellow */ + --fragment-token: #9ed072; /* green */ + --fragment-comment: #5c6370; + --fragment-link: #7aa2f7; /* blue link */ + --fragment-preprocessor: #f39660; /* orange */ + --fragment-linenumber-color: #414868; + --fragment-linenumber-background: #2c2e34; + --fragment-linenumber-border: #1a1b26; +} + +/* Base style for all sections */ +.section.note, +.section.warning, +.section.remark, +.section.attention, +.section.important { + border-left: 4px solid var(--primary-dark-color); + border-radius: 6px; + padding: 0.9em 1.2em; + margin: 1.5em 0; + background-color: #2e303e; + color: var(--page-foreground-color); + font-size: 0.95em; +} + +/* Section title */ +.section.note dt, +.section.warning dt, +.section.remark dt, +.section.attention dt, +.section.important dt { + font-weight: bold; + display: block; + margin-bottom: 0.35em; +} + +/* Section body */ +.section.note dd, +.section.warning dd, +.section.remark dd, +.section.attention dd, +.section.important dd { + margin: 0; +} + +/* Note - soft cyan */ +.section.note { + border-left-color: #7fbbb3; + background-color: #263640; +} +.section.note dt { + color: #7fbbb3; +} + +/* Warning - amber */ +.section.warning { + border-left-color: #e0af68; + background-color: #3d2f1f; +} +.section.warning dt { + color: #e0af68; +} + +/* Tip (Remark) - green */ +.section.remark { + border-left-color: #9ed072; + background-color: #2d3a2d; +} +.section.remark dt { + color: #9ed072; +} + +/* Caution (Attention) - bold red-orange */ +.section.attention { + border-left-color: #f7768e; + background-color: #3d2a2e; +} +.section.attention dt { + color: #f7768e; +} + +/* Important - purple */ +.section.important { + border-left-color: #ab9df2; + background-color: #2f2a3a; +} +.section.important dt { + color: #ab9df2; +} + diff --git a/include/ftxui/component/component_options.hpp b/include/ftxui/component/component_options.hpp index e9dd0845..a5a9cac3 100644 --- a/include/ftxui/component/component_options.hpp +++ b/include/ftxui/component/component_options.hpp @@ -17,9 +17,8 @@ namespace ftxui { -/// @brief arguments for |ButtonOption::transform|, |CheckboxOption::transform|, -/// |Radiobox::transform|, |MenuEntryOption::transform|, -/// |MenuOption::transform|. +/// @brief arguments for transform from |ButtonOption|, |CheckboxOption|, +/// |RadioboxOption|, |MenuEntryOption|, |MenuOption|. struct EntryState { std::string label; ///< The label to display. bool state; ///< The state of the button/checkbox/radiobox diff --git a/src/ftxui/component/collapsible.cpp b/src/ftxui/component/collapsible.cpp index a79c8550..e93dbe11 100644 --- a/src/ftxui/component/collapsible.cpp +++ b/src/ftxui/component/collapsible.cpp @@ -28,7 +28,7 @@ namespace ftxui { /// /// ▼ Show details ///
-///  ``` +/// ``` // NOLINTNEXTLINE Component Collapsible(ConstStringRef label, Component child, Ref show) { class Impl : public ComponentBase { diff --git a/src/ftxui/component/event.cpp b/src/ftxui/component/event.cpp index 25a50575..365f3487 100644 --- a/src/ftxui/component/event.cpp +++ b/src/ftxui/component/event.cpp @@ -74,7 +74,7 @@ Event Event::CursorShape(std::string input, int shape) { /// @brief An custom event whose meaning is defined by the user of the library. /// @param input An arbitrary sequence of character defined by the developer. -/// @ingroup component. +/// @ingroup component // static Event Event::Special(std::string input) { Event event; diff --git a/src/ftxui/component/hoverable.cpp b/src/ftxui/component/hoverable.cpp index 9af6498b..ec2a2615 100644 --- a/src/ftxui/component/hoverable.cpp +++ b/src/ftxui/component/hoverable.cpp @@ -159,7 +159,7 @@ ComponentDecorator Hoverable(bool* hover) { /// button |= Hoverable( /// [&]{ on_enter_cnt++; }, /// [&]{ on_leave_cnt++; } -// ); +/// ); /// ``` // NOLINTNEXTLINE ComponentDecorator Hoverable(std::function on_enter, @@ -182,7 +182,7 @@ ComponentDecorator Hoverable(std::function on_enter, /// auto button = Button("exit", screen.ExitLoopClosure()); /// bool hovered = false; /// auto button_hoverable = Hoverable(button, -// [&](bool hover) { hovered = hover;}); +/// [&](bool hover) { hovered = hover;}); /// ``` // NOLINTNEXTLINE Component Hoverable(Component component, std::function on_change) { diff --git a/src/ftxui/component/input.cpp b/src/ftxui/component/input.cpp index a61e6256..6ef53883 100644 --- a/src/ftxui/component/input.cpp +++ b/src/ftxui/component/input.cpp @@ -603,6 +603,7 @@ Component Input(StringRef content, InputOption option) { /// @brief An input box for editing text. /// @param content The editable content. +/// @param placeholder The placeholder text. /// @param option Additional optional parameters. /// @ingroup component /// @see InputBase diff --git a/src/ftxui/dom/flexbox.cpp b/src/ftxui/dom/flexbox.cpp index 00780d2e..758d4fbc 100644 --- a/src/ftxui/dom/flexbox.cpp +++ b/src/ftxui/dom/flexbox.cpp @@ -242,11 +242,11 @@ class Flexbox : public Node { /// text("element 2"), /// text("element 3"), /// }, FlexboxConfig() -// .Set(FlexboxConfig::Direction::Column) -// .Set(FlexboxConfig::Wrap::WrapInversed) -// .SetGapMainAxis(1) -// .SetGapCrossAxis(1) -// ) +/// .Set(FlexboxConfig::Direction::Column) +/// .Set(FlexboxConfig::Wrap::WrapInversed) +/// .SetGapMainAxis(1) +/// .SetGapCrossAxis(1) +/// ) /// ``` Element flexbox(Elements children, FlexboxConfig config) { return std::make_shared(std::move(children), config); diff --git a/src/ftxui/dom/gauge.cpp b/src/ftxui/dom/gauge.cpp index 19926a2d..9f073de7 100644 --- a/src/ftxui/dom/gauge.cpp +++ b/src/ftxui/dom/gauge.cpp @@ -164,7 +164,7 @@ class Gauge : public Node { /// @brief Draw a high definition progress bar progressing in specified /// direction. /// @param progress The proportion of the area to be filled. Belong to [0,1]. -// @param direction Direction of progress bars progression. +/// @param direction Direction of progress bars progression. /// @ingroup dom Element gaugeDirection(float progress, Direction direction) { return std::make_shared(progress, direction);