./ 0000755 0000156 0000165 00000000000 12677430773 011115 5 ustar jenkins jenkins ./doc/ 0000755 0000156 0000165 00000000000 12677430772 011661 5 ustar jenkins jenkins ./doc/DirectionalDragArea.svg 0000644 0000156 0000165 00000027762 12677430772 016244 0 ustar jenkins jenkins
image/svg+xml
maxDeviation
wideningAngle
distanceThreshold
Position of touch press
Valid area for touch position during recognition
./doc/devices.conf 0000644 0000156 0000165 00000002452 12677430772 014155 0 ustar jenkins jenkins # This file can hold multiple device configs. Devices are separated by sections.
#
# SupportedOrientations holds a list of all enabled orientations. A standard
# phone will usually have Portrait,Landcape,InvertedLandscape in order to
# disable upside down usage.
#
# PrimaryOrientation gives the orientation the device will start up with
# when there is no orientations sensor input available (yet) or lock to
# when an application specifies to be locked to PrimaryOrientation.
#
# The other Orientation settings can be used to re-map the orientations.
# A device might be used with different orientations than how the screen
# is physically mounted on the hardware.
#
# Category can be phone, tablet, or desktop. This option determines
# whether the side stage is shown (tablet) or not (phone). Using
# desktop will load the shell in windowed mode. Note that the user
# can override/change this by connecting input hardware or change
# user settings.
#
# Any options not listed will default to the values of the example below.
[devicename]
SupportedOrientations=Portrait,InvertedPortrait,Landscape,InvertedLandscape
PrimaryOrientation=PrimaryOrienation
PortraitOrientation=Portrait
InvertedPortraitOrientation=InvertedPortrait
LandscapeOrientation=Landscape
InvertedLandscapeOrientation=InvertedLandscape
Category=phone
./doc/CMakeLists.txt 0000644 0000156 0000165 00000003350 12677430772 014422 0 ustar jenkins jenkins #
# Documentation
#
find_package(Doxygen)
find_program(DOT_EXECUTABLE dot /usr/bin)
find_program(DOXYQML_EXECUTABLE doxyqml /usr/bin)
if (NOT DOXYGEN_FOUND OR NOT DOT_EXECUTABLE OR NOT DOXYQML_EXECUTABLE)
message(WARNING "Cannot generate documentation: doxygen, doxyqml and/or graphviz not found")
else()
file(GLOB_RECURSE DOC_FILES
${CMAKE_BINARY_DIR}/include/*.h
${CMAKE_SOURCE_DIR}/include/*.h
${CMAKE_SOURCE_DIR}/src/*.h
${CMAKE_SOURCE_DIR}/src/*.cpp
${CMAKE_SOURCE_DIR}/plugins/*.h
${CMAKE_SOURCE_DIR}/plugins/*.cpp
${CMAKE_SOURCE_DIR}/plugins/*.qml
${CMAKE_SOURCE_DIR}/plugins/*.js
${CMAKE_SOURCE_DIR}/qml/*.qml
${CMAKE_SOURCE_DIR}/qml/*.js
${CMAKE_SOURCE_DIR}/tests/autopilot/*.py
${CMAKE_SOURCE_DIR}/tests/utils/*.h
${CMAKE_SOURCE_DIR}/tests/utils/*.cpp
${CMAKE_SOURCE_DIR}/tests/utils/*.qml
${CMAKE_SOURCE_DIR}/tests/utils/*.js
${CMAKE_SOURCE_DIR}/tests/autopilot/unity8/shell/emulators/*.py
${CMAKE_SOURCE_DIR}/tests/autopilot/unity8/process_helpers.py)
string(REPLACE ";" " " DOXYGEN_INPUT "${DOC_FILES}")
configure_file(${PROJECT_SOURCE_DIR}/doc/Doxyfile.in ${PROJECT_BINARY_DIR}/doc/Doxyfile @ONLY IMMEDIATE)
add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/doc/${PROJECT_NAME}/index.html
COMMAND ${DOXYGEN_EXECUTABLE} ${PROJECT_BINARY_DIR}/doc/Doxyfile
DEPENDS ${PROJECT_BINARY_DIR}/doc/Doxyfile ${DOC_FILES})
add_custom_target(doc DEPENDS ${PROJECT_BINARY_DIR}/doc/${PROJECT_NAME}/index.html)
install(DIRECTORY ${PROJECT_BINARY_DIR}/doc/${PROJECT_NAME}
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/doc
OPTIONAL)
endif()
./doc/Doxyfile.in 0000644 0000156 0000165 00000305106 12677430772 014001 0 ustar jenkins jenkins # Doxyfile 1.8.6
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project.
#
# All text after a double hash (##) is considered a comment and is placed in
# front of the TAG it is preceding.
#
# All text after a single hash (#) is considered a comment and will be ignored.
# The format is:
# TAG = value [value, ...]
# For lists, items can also be appended using:
# TAG += value [value, ...]
# Values that contain spaces should be placed between quotes (\" \").
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
# This tag specifies the encoding used for all characters in the config file
# that follow. The default is UTF-8 which is also the encoding used for all text
# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv
# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv
# for the list of possible encodings.
# The default value is: UTF-8.
DOXYFILE_ENCODING = UTF-8
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by
# double-quotes, unless you are using Doxywizard) that should identify the
# project for which the documentation is generated. This name is used in the
# title of most generated pages and in a few other places.
# The default value is: My Project.
PROJECT_NAME = "Unity 8"
# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER =
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
# quick idea about the purpose of the project. Keep the description short.
PROJECT_BRIEF =
# With the PROJECT_LOGO tag one can specify an logo or icon that is included in
# the documentation. The maximum height of the logo should not exceed 55 pixels
# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo
# to the output directory.
PROJECT_LOGO =
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
# into which the generated documentation will be written. If a relative path is
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.
OUTPUT_DIRECTORY = @PROJECT_BINARY_DIR@/doc
# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub-
# directories (in 2 levels) under the output directory of each output format and
# will distribute the generated files over these directories. Enabling this
# option can be useful when feeding doxygen a huge amount of source files, where
# putting all generated files in the same directory would otherwise causes
# performance problems for the file system.
# The default value is: NO.
CREATE_SUBDIRS = NO
# The OUTPUT_LANGUAGE tag is used to specify the language in which all
# documentation generated by doxygen is written. Doxygen will use this
# information to generate all constant output in the proper language.
# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese,
# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States),
# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian,
# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages),
# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian,
# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian,
# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish,
# Ukrainian and Vietnamese.
# The default value is: English.
OUTPUT_LANGUAGE = English
# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member
# descriptions after the members that are listed in the file and class
# documentation (similar to Javadoc). Set to NO to disable this.
# The default value is: YES.
BRIEF_MEMBER_DESC = YES
# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief
# description of a member or function before the detailed description
#
# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
# brief descriptions will be completely suppressed.
# The default value is: YES.
REPEAT_BRIEF = YES
# This tag implements a quasi-intelligent brief description abbreviator that is
# used to form the text in various listings. Each string in this list, if found
# as the leading text of the brief description, will be stripped from the text
# and the result, after processing the whole list, is used as the annotated
# text. Otherwise, the brief description is used as-is. If left blank, the
# following values are used ($name is automatically replaced with the name of
# the entity):The $name class, The $name widget, The $name file, is, provides,
# specifies, contains, represents, a, an and the.
ABBREVIATE_BRIEF = "The $name class" \
"The $name widget" \
"The $name file" \
is \
provides \
specifies \
contains \
represents \
a \
an \
the
# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
# doxygen will generate a detailed section even if there is only a brief
# description.
# The default value is: NO.
ALWAYS_DETAILED_SEC = NO
# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
# inherited members of a class in the documentation of that class as if those
# members were ordinary class members. Constructors, destructors and assignment
# operators of the base classes will not be shown.
# The default value is: NO.
INLINE_INHERITED_MEMB = NO
# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path
# before files name in the file list and in the header files. If set to NO the
# shortest path that makes the file name unique will be used
# The default value is: YES.
FULL_PATH_NAMES = YES
# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.
# Stripping is only done if one of the specified strings matches the left-hand
# part of the path. The tag can be used to show relative paths in the file list.
# If left blank the directory from which doxygen is run is used as the path to
# strip.
#
# Note that you can specify absolute paths here, but also relative paths, which
# will be relative from the directory where doxygen is started.
# This tag requires that the tag FULL_PATH_NAMES is set to YES.
STRIP_FROM_PATH = @PROJECT_SOURCE_DIR@ @PROJECT_BINARY_DIR@
# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
# path mentioned in the documentation of a class, which tells the reader which
# header file to include in order to use a class. If left blank only the name of
# the header file containing the class definition is used. Otherwise one should
# specify the list of include paths that are normally passed to the compiler
# using the -I flag.
STRIP_FROM_INC_PATH = @PROJECT_SOURCE_DIR@ @PROJECT_BINARY_DIR@
# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
# less readable) file names. This can be useful is your file systems doesn't
# support long names like on DOS, Mac, or CD-ROM.
# The default value is: NO.
SHORT_NAMES = NO
# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
# first line (until the first dot) of a Javadoc-style comment as the brief
# description. If set to NO, the Javadoc-style will behave just like regular Qt-
# style comments (thus requiring an explicit @brief command for a brief
# description.)
# The default value is: NO.
JAVADOC_AUTOBRIEF = NO
# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first
# line (until the first dot) of a Qt-style comment as the brief description. If
# set to NO, the Qt-style will behave just like regular Qt-style comments (thus
# requiring an explicit \brief command for a brief description.)
# The default value is: NO.
QT_AUTOBRIEF = NO
# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a
# multi-line C++ special comment block (i.e. a block of //! or /// comments) as
# a brief description. This used to be the default behavior. The new default is
# to treat a multi-line C++ comment block as a detailed description. Set this
# tag to YES if you prefer the old behavior instead.
#
# Note that setting this tag to YES also means that rational rose comments are
# not recognized any more.
# The default value is: NO.
MULTILINE_CPP_IS_BRIEF = NO
# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the
# documentation from any documented member that it re-implements.
# The default value is: YES.
INHERIT_DOCS = YES
# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a
# new page for each member. If set to NO, the documentation of a member will be
# part of the file/class/namespace that contains it.
# The default value is: NO.
SEPARATE_MEMBER_PAGES = NO
# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen
# uses this value to replace tabs by spaces in code fragments.
# Minimum value: 1, maximum value: 16, default value: 4.
TAB_SIZE = 4
# This tag can be used to specify a number of aliases that act as commands in
# the documentation. An alias has the form:
# name=value
# For example adding
# "sideeffect=@par Side Effects:\n"
# will allow you to put the command \sideeffect (or @sideeffect) in the
# documentation, which will result in a user-defined paragraph with heading
# "Side Effects:". You can put \n's in the value part of an alias to insert
# newlines.
ALIASES = "accessors=\par Accessors:\n" "notifier=\par Notifier:\n"
# This tag can be used to specify a number of word-keyword mappings (TCL only).
# A mapping has the form "name=value". For example adding "class=itcl::class"
# will allow you to use the command class in the itcl::class meaning.
TCL_SUBST =
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
# only. Doxygen will then generate output that is more tailored for C. For
# instance, some of the names that are used will be different. The list of all
# members will be omitted, etc.
# The default value is: NO.
OPTIMIZE_OUTPUT_FOR_C = NO
# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or
# Python sources only. Doxygen will then generate output that is more tailored
# for that language. For instance, namespaces will be presented as packages,
# qualified scopes will look different, etc.
# The default value is: NO.
OPTIMIZE_OUTPUT_JAVA = NO
# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
# sources. Doxygen will then generate output that is tailored for Fortran.
# The default value is: NO.
OPTIMIZE_FOR_FORTRAN = NO
# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
# sources. Doxygen will then generate output that is tailored for VHDL.
# The default value is: NO.
OPTIMIZE_OUTPUT_VHDL = NO
# Doxygen selects the parser to use depending on the extension of the files it
# parses. With this tag you can assign which parser to use for a given
# extension. Doxygen has a built-in mapping, but you can override or extend it
# using this tag. The format is ext=language, where ext is a file extension, and
# language is one of the parsers supported by doxygen: IDL, Java, Javascript,
# C#, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL. For instance to make
# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C
# (default is Fortran), use: inc=Fortran f=C.
#
# Note For files without extension you can use no_extension as a placeholder.
#
# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
# the files are not read by doxygen.
EXTENSION_MAPPING =
# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
# according to the Markdown format, which allows for more readable
# documentation. See http://daringfireball.net/projects/markdown/ for details.
# The output of markdown processing is further processed by doxygen, so you can
# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in
# case of backward compatibilities issues.
# The default value is: YES.
MARKDOWN_SUPPORT = YES
# When enabled doxygen tries to link words that correspond to documented
# classes, or namespaces to their corresponding documentation. Such a link can
# be prevented in individual cases by by putting a % sign in front of the word
# or globally by setting AUTOLINK_SUPPORT to NO.
# The default value is: YES.
AUTOLINK_SUPPORT = YES
# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
# to include (a tag file for) the STL sources as input, then you should set this
# tag to YES in order to let doxygen match functions declarations and
# definitions whose arguments contain STL classes (e.g. func(std::string);
# versus func(std::string) {}). This also make the inheritance and collaboration
# diagrams that involve STL classes more complete and accurate.
# The default value is: NO.
BUILTIN_STL_SUPPORT = NO
# If you use Microsoft's C++/CLI language, you should set this option to YES to
# enable parsing support.
# The default value is: NO.
CPP_CLI_SUPPORT = NO
# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:
# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen
# will parse them like normal C++ but will assume all classes use public instead
# of private inheritance when no explicit protection keyword is present.
# The default value is: NO.
SIP_SUPPORT = NO
# For Microsoft's IDL there are propget and propput attributes to indicate
# getter and setter methods for a property. Setting this option to YES will make
# doxygen to replace the get and set methods by a property in the documentation.
# This will only work if the methods are indeed getting or setting a simple
# type. If this is not the case, or you want to show the methods anyway, you
# should set this option to NO.
# The default value is: YES.
IDL_PROPERTY_SUPPORT = YES
# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
# tag is set to YES, then doxygen will reuse the documentation of the first
# member in the group (if any) for the other members of the group. By default
# all members of a group must be documented explicitly.
# The default value is: NO.
DISTRIBUTE_GROUP_DOC = NO
# Set the SUBGROUPING tag to YES to allow class member groups of the same type
# (for instance a group of public functions) to be put as a subgroup of that
# type (e.g. under the Public Functions section). Set it to NO to prevent
# subgrouping. Alternatively, this can be done per class using the
# \nosubgrouping command.
# The default value is: YES.
SUBGROUPING = YES
# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions
# are shown inside the group in which they are included (e.g. using \ingroup)
# instead of on a separate page (for HTML and Man pages) or section (for LaTeX
# and RTF).
#
# Note that this feature does not work in combination with
# SEPARATE_MEMBER_PAGES.
# The default value is: NO.
INLINE_GROUPED_CLASSES = NO
# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions
# with only public data fields or simple typedef fields will be shown inline in
# the documentation of the scope in which they are defined (i.e. file,
# namespace, or group documentation), provided this scope is documented. If set
# to NO, structs, classes, and unions are shown on a separate page (for HTML and
# Man pages) or section (for LaTeX and RTF).
# The default value is: NO.
INLINE_SIMPLE_STRUCTS = NO
# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or
# enum is documented as struct, union, or enum with the name of the typedef. So
# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
# with name TypeT. When disabled the typedef will appear as a member of a file,
# namespace, or class. And the struct will be named TypeS. This can typically be
# useful for C code in case the coding convention dictates that all compound
# types are typedef'ed and only the typedef is referenced, never the tag name.
# The default value is: NO.
TYPEDEF_HIDES_STRUCT = NO
# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This
# cache is used to resolve symbols given their name and scope. Since this can be
# an expensive process and often the same symbol appears multiple times in the
# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small
# doxygen will become slower. If the cache is too large, memory is wasted. The
# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range
# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536
# symbols. At the end of a run doxygen will report the cache usage and suggest
# the optimal cache size from a speed point of view.
# Minimum value: 0, maximum value: 9, default value: 0.
LOOKUP_CACHE_SIZE = 0
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
# documentation are documented, even if no documentation was available. Private
# class members and static file members will be hidden unless the
# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.
# Note: This will also disable the warnings about undocumented members that are
# normally produced when WARNINGS is set to YES.
# The default value is: NO.
EXTRACT_ALL = NO
# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will
# be included in the documentation.
# The default value is: NO.
EXTRACT_PRIVATE = NO
# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal
# scope will be included in the documentation.
# The default value is: NO.
EXTRACT_PACKAGE = NO
# If the EXTRACT_STATIC tag is set to YES all static members of a file will be
# included in the documentation.
# The default value is: NO.
EXTRACT_STATIC = NO
# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined
# locally in source files will be included in the documentation. If set to NO
# only classes defined in header files are included. Does not have any effect
# for Java sources.
# The default value is: YES.
EXTRACT_LOCAL_CLASSES = YES
# This flag is only useful for Objective-C code. When set to YES local methods,
# which are defined in the implementation section but not in the interface are
# included in the documentation. If set to NO only methods in the interface are
# included.
# The default value is: NO.
EXTRACT_LOCAL_METHODS = NO
# If this flag is set to YES, the members of anonymous namespaces will be
# extracted and appear in the documentation as a namespace called
# 'anonymous_namespace{file}', where file will be replaced with the base name of
# the file that contains the anonymous namespace. By default anonymous namespace
# are hidden.
# The default value is: NO.
EXTRACT_ANON_NSPACES = NO
# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all
# undocumented members inside documented classes or files. If set to NO these
# members will be included in the various overviews, but no documentation
# section is generated. This option has no effect if EXTRACT_ALL is enabled.
# The default value is: NO.
HIDE_UNDOC_MEMBERS = NO
# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all
# undocumented classes that are normally visible in the class hierarchy. If set
# to NO these classes will be included in the various overviews. This option has
# no effect if EXTRACT_ALL is enabled.
# The default value is: NO.
HIDE_UNDOC_CLASSES = 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.
# The default value is: NO.
HIDE_FRIEND_COMPOUNDS = NO
# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any
# documentation blocks found inside the body of a function. If set to NO these
# blocks will be appended to the function's detailed documentation block.
# The default value is: NO.
HIDE_IN_BODY_DOCS = NO
# The INTERNAL_DOCS tag determines if documentation that is typed after a
# \internal command is included. If the tag is set to NO then the documentation
# will be excluded. Set it to YES to include the internal documentation.
# The default value is: NO.
INTERNAL_DOCS = NO
# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file
# names in lower-case letters. If set to YES upper-case letters are also
# allowed. This is useful if you have classes or files whose names only differ
# in case and if your file system supports case sensitive file names. Windows
# and Mac users are advised to set this option to NO.
# The default value is: system dependent.
CASE_SENSE_NAMES = NO
# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with
# their full class and namespace scopes in the documentation. If set to YES the
# scope will be hidden.
# The default value is: NO.
HIDE_SCOPE_NAMES = NO
# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of
# the files that are included by a file in the documentation of that file.
# The default value is: YES.
SHOW_INCLUDE_FILES = YES
# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each
# grouped member an include statement to the documentation, telling the reader
# which file to include in order to use the member.
# The default value is: NO.
SHOW_GROUPED_MEMB_INC = NO
# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include
# files with double quotes in the documentation rather than with sharp brackets.
# The default value is: NO.
FORCE_LOCAL_INCLUDES = NO
# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the
# documentation for inline members.
# The default value is: YES.
INLINE_INFO = YES
# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the
# (detailed) documentation of file and class members alphabetically by member
# name. If set to NO the members will appear in declaration order.
# The default value is: YES.
SORT_MEMBER_DOCS = YES
# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief
# descriptions of file, namespace and class members alphabetically by member
# name. If set to NO the members will appear in declaration order. Note that
# this will also influence the order of the classes in the class list.
# The default value is: NO.
SORT_BRIEF_DOCS = NO
# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the
# (brief and detailed) documentation of class members so that constructors and
# destructors are listed first. If set to NO the constructors will appear in the
# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS.
# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief
# member documentation.
# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting
# detailed member documentation.
# The default value is: NO.
SORT_MEMBERS_CTORS_1ST = NO
# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy
# of group names into alphabetical order. If set to NO the group names will
# appear in their defined order.
# The default value is: NO.
SORT_GROUP_NAMES = NO
# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by
# fully-qualified names, including namespaces. If set to NO, the class list will
# be sorted only by class name, not including the namespace part.
# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
# Note: This option applies only to the class list, not to the alphabetical
# list.
# The default value is: NO.
SORT_BY_SCOPE_NAME = NO
# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper
# type resolution of all parameters of a function it will reject a match between
# the prototype and the implementation of a member function even if there is
# only one candidate or it is obvious which candidate to choose by doing a
# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still
# accept a match between prototype and implementation in such cases.
# The default value is: NO.
STRICT_PROTO_MATCHING = NO
# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the
# todo list. This list is created by putting \todo commands in the
# documentation.
# The default value is: YES.
GENERATE_TODOLIST = YES
# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the
# test list. This list is created by putting \test commands in the
# documentation.
# The default value is: YES.
GENERATE_TESTLIST = YES
# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug
# list. This list is created by putting \bug commands in the documentation.
# The default value is: YES.
GENERATE_BUGLIST = YES
# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO)
# the deprecated list. This list is created by putting \deprecated commands in
# the documentation.
# The default value is: YES.
GENERATE_DEPRECATEDLIST= YES
# The ENABLED_SECTIONS tag can be used to enable conditional documentation
# sections, marked by \if ... \endif and \cond
# ... \endcond blocks.
ENABLED_SECTIONS =
# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the
# initial value of a variable or macro / define can have for it to appear in the
# documentation. If the initializer consists of more lines than specified here
# it will be hidden. Use a value of 0 to hide initializers completely. The
# appearance of the value of individual variables and macros / defines can be
# controlled using \showinitializer or \hideinitializer command in the
# documentation regardless of this setting.
# Minimum value: 0, maximum value: 10000, default value: 30.
MAX_INITIALIZER_LINES = 30
# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at
# the bottom of the documentation of classes and structs. If set to YES the list
# will mention the files that were used to generate the documentation.
# The default value is: YES.
SHOW_USED_FILES = YES
# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This
# will remove the Files entry from the Quick Index and from the Folder Tree View
# (if specified).
# The default value is: YES.
SHOW_FILES = YES
# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces
# page. This will remove the Namespaces entry from the Quick Index and from the
# Folder Tree View (if specified).
# The default value is: YES.
SHOW_NAMESPACES = YES
# The FILE_VERSION_FILTER tag can be used to specify a program or script that
# doxygen should invoke to get the current version for each file (typically from
# the version control system). Doxygen will invoke the program by executing (via
# popen()) the command command input-file, where command is the value of the
# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided
# by doxygen. Whatever the program writes to standard output is used as the file
# version. For an example see the documentation.
FILE_VERSION_FILTER =
# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
# by doxygen. The layout file controls the global structure of the generated
# output files in an output format independent way. To create the layout file
# that represents doxygen's defaults, run doxygen with the -l option. You can
# optionally specify a file name after the option, if omitted DoxygenLayout.xml
# will be used as the name of the layout file.
#
# Note that if you run doxygen from a directory containing a file called
# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
# tag is left empty.
LAYOUT_FILE =
# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
# the reference definitions. This must be a list of .bib files. The .bib
# extension is automatically appended if omitted. This requires the bibtex tool
# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info.
# For LaTeX the style of the bibliography can be controlled using
# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the
# search path. Do not use file names with spaces, bibtex cannot handle them. See
# also \cite for info how to create references.
CITE_BIB_FILES =
#---------------------------------------------------------------------------
# Configuration options related to warning and progress messages
#---------------------------------------------------------------------------
# The QUIET tag can be used to turn on/off the messages that are generated to
# standard output by doxygen. If QUIET is set to YES this implies that the
# messages are off.
# The default value is: NO.
QUIET = YES
# The WARNINGS tag can be used to turn on/off the warning messages that are
# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES
# this implies that the warnings are on.
#
# Tip: Turn warnings on while writing the documentation.
# The default value is: YES.
WARNINGS = YES
# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate
# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag
# will automatically be disabled.
# The default value is: YES.
WARN_IF_UNDOCUMENTED = NO
# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
# potential errors in the documentation, such as not documenting some parameters
# in a documented function, or documenting parameters that don't exist or using
# markup commands wrongly.
# The default value is: YES.
WARN_IF_DOC_ERROR = YES
# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that
# are documented, but have no documentation for their parameters or return
# value. If set to NO doxygen will only warn about wrong or incomplete parameter
# documentation, but not about the absence of documentation.
# The default value is: NO.
WARN_NO_PARAMDOC = NO
# The WARN_FORMAT tag determines the format of the warning messages that doxygen
# can produce. The string should contain the $file, $line, and $text tags, which
# will be replaced by the file and line number from which the warning originated
# and the warning text. Optionally the format may contain $version, which will
# be replaced by the version of the file (if it could be obtained via
# FILE_VERSION_FILTER)
# The default value is: $file:$line: $text.
WARN_FORMAT = "$file:$line: $text"
# The WARN_LOGFILE tag can be used to specify a file to which warning and error
# messages should be written. If left blank the output is written to standard
# error (stderr).
WARN_LOGFILE =
#---------------------------------------------------------------------------
# Configuration options related to the input files
#---------------------------------------------------------------------------
# The INPUT tag is used to specify the files and/or directories that contain
# documented source files. You may enter file names like myfile.cpp or
# directories like /usr/src/myproject. Separate the files or directories with
# spaces.
# Note: If this tag is empty the current directory is searched.
INPUT = @DOXYGEN_INPUT@
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
# documentation (see: http://www.gnu.org/software/libiconv) for the list of
# possible encodings.
# The default value is: UTF-8.
INPUT_ENCODING = UTF-8
# If the value of the INPUT tag contains directories, you can use the
# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
# *.h) to filter out the source-files in the directories. If left blank the
# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii,
# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp,
# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown,
# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf,
# *.qsf, *.as and *.js.
FILE_PATTERNS = *.cpp \
*.h \
*.py \
*.js \
*.qml
# The RECURSIVE tag can be used to specify whether or not subdirectories should
# be searched for input files as well.
# The default value is: NO.
RECURSIVE = YES
# The EXCLUDE tag can be used to specify files and/or directories that should be
# excluded from the INPUT source files. This way you can easily exclude a
# subdirectory from a directory tree whose root is specified with the INPUT tag.
#
# Note that relative paths are relative to the directory from which doxygen is
# run.
EXCLUDE =
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded
# from the input.
# The default value is: NO.
EXCLUDE_SYMLINKS = NO
# If the value of the INPUT tag contains directories, you can use the
# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
# certain files from those directories.
#
# Note that the wildcards are matched against the file with absolute path, so to
# exclude all test directories for example use the pattern */test/*
EXCLUDE_PATTERNS =
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the
# output. The symbol name can be a fully qualified name, a word, or if the
# wildcard * is used, a substring. Examples: ANamespace, AClass,
# AClass::ANamespace, ANamespace::*Test
#
# Note that the wildcards are matched against the file with absolute path, so to
# exclude all test directories use the pattern */test/*
EXCLUDE_SYMBOLS =
# The EXAMPLE_PATH tag can be used to specify one or more files or directories
# that contain example code fragments that are included (see the \include
# command).
EXAMPLE_PATH =
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
# *.h) to filter out the source-files in the directories. If left blank all
# files are included.
EXAMPLE_PATTERNS =
# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
# searched for input files to be used with the \include or \dontinclude commands
# irrespective of the value of the RECURSIVE tag.
# The default value is: NO.
EXAMPLE_RECURSIVE = NO
# The IMAGE_PATH tag can be used to specify one or more files or directories
# that contain images that are to be included in the documentation (see the
# \image command).
IMAGE_PATH =
# The INPUT_FILTER tag can be used to specify a program that doxygen should
# invoke to filter for each input file. Doxygen will invoke the filter program
# by executing (via popen()) the command:
#
#
#
# where is the value of the INPUT_FILTER tag, and is the
# name of an input file. Doxygen will then use the output that the filter
# program writes to standard output. If FILTER_PATTERNS is specified, this tag
# will be ignored.
#
# Note that the filter must not add or remove lines; it is applied before the
# code is scanned, but not when the output code is generated. If lines are added
# or removed, the anchors will not be placed correctly.
INPUT_FILTER =
# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
# basis. Doxygen will compare the file name with each pattern and apply the
# filter if there is a match. The filters are a list of the form: pattern=filter
# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how
# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
# patterns match the file name, INPUT_FILTER is applied.
FILTER_PATTERNS = *.qml=doxyqml
# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
# INPUT_FILTER ) will also be used to filter the input files that are used for
# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).
# The default value is: NO.
FILTER_SOURCE_FILES = NO
# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and
# it is also possible to disable source filtering for a specific pattern using
# *.ext= (so without naming a filter).
# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.
FILTER_SOURCE_PATTERNS =
# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that
# is part of the input, its contents will be placed on the main page
# (index.html). This can be useful if you have a project on for instance GitHub
# and want to reuse the introduction page also for the doxygen output.
USE_MDFILE_AS_MAINPAGE =
#---------------------------------------------------------------------------
# Configuration options related to source browsing
#---------------------------------------------------------------------------
# If the SOURCE_BROWSER tag is set to YES then a list of source files will be
# generated. Documented entities will be cross-referenced with these sources.
#
# Note: To get rid of all source code in the generated output, make sure that
# also VERBATIM_HEADERS is set to NO.
# The default value is: NO.
SOURCE_BROWSER = YES
# Setting the INLINE_SOURCES tag to YES will include the body of functions,
# classes and enums directly into the documentation.
# The default value is: NO.
INLINE_SOURCES = YES
# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any
# special comment blocks from generated source code fragments. Normal C, C++ and
# Fortran comments will always remain visible.
# The default value is: YES.
STRIP_CODE_COMMENTS = YES
# If the REFERENCED_BY_RELATION tag is set to YES then for each documented
# function all documented functions referencing it will be listed.
# The default value is: NO.
REFERENCED_BY_RELATION = NO
# If the REFERENCES_RELATION tag is set to YES then for each documented function
# all documented entities called/used by that function will be listed.
# The default value is: NO.
REFERENCES_RELATION = NO
# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set
# to YES, then the hyperlinks from functions in REFERENCES_RELATION and
# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will
# link to the documentation.
# The default value is: YES.
REFERENCES_LINK_SOURCE = YES
# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the
# source code will show a tooltip with additional information such as prototype,
# brief description and links to the definition and documentation. Since this
# will make the HTML file larger and loading of large files a bit slower, you
# can opt to disable this feature.
# The default value is: YES.
# This tag requires that the tag SOURCE_BROWSER is set to YES.
SOURCE_TOOLTIPS = YES
# If the USE_HTAGS tag is set to YES then the references to source code will
# point to the HTML generated by the htags(1) tool instead of doxygen built-in
# source browser. The htags tool is part of GNU's global source tagging system
# (see http://www.gnu.org/software/global/global.html). You will need version
# 4.8.6 or higher.
#
# To use it do the following:
# - Install the latest version of global
# - Enable SOURCE_BROWSER and USE_HTAGS in the config file
# - Make sure the INPUT points to the root of the source tree
# - Run doxygen as normal
#
# Doxygen will invoke htags (and that will in turn invoke gtags), so these
# tools must be available from the command line (i.e. in the search path).
#
# The result: instead of the source browser generated by doxygen, the links to
# source code will now point to the output of htags.
# The default value is: NO.
# This tag requires that the tag SOURCE_BROWSER is set to YES.
USE_HTAGS = NO
# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a
# verbatim copy of the header file for each class for which an include is
# specified. Set to NO to disable this.
# See also: Section \class.
# The default value is: YES.
VERBATIM_HEADERS = YES
#---------------------------------------------------------------------------
# Configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all
# compounds will be generated. Enable this if the project contains a lot of
# classes, structs, unions or interfaces.
# The default value is: YES.
ALPHABETICAL_INDEX = 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.
# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the HTML output
#---------------------------------------------------------------------------
# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output
# The default value is: YES.
GENERATE_HTML = YES
# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
# it.
# The default directory is: html.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_OUTPUT = unity8
# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each
# generated HTML page (for example: .htm, .php, .asp).
# The default value is: .html.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_FILE_EXTENSION = .html
# The HTML_HEADER tag can be used to specify a user-defined HTML header file for
# each generated HTML page. If the tag is left blank doxygen will generate a
# standard header.
#
# To get valid HTML the header file that includes any scripts and style sheets
# that doxygen needs, which is dependent on the configuration options used (e.g.
# the setting GENERATE_TREEVIEW). It is highly recommended to start with a
# default header using
# doxygen -w html new_header.html new_footer.html new_stylesheet.css
# YourConfigFile
# and then modify the file new_header.html. See also section "Doxygen usage"
# for information on how to generate the default header that doxygen normally
# uses.
# Note: The header is subject to change so you typically have to regenerate the
# default header when upgrading to a newer version of doxygen. For a description
# of the possible markers and block names see the documentation.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_HEADER =
# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
# generated HTML page. If the tag is left blank doxygen will generate a standard
# footer. See HTML_HEADER for more information on how to generate a default
# footer and what special commands can be used inside the footer. See also
# section "Doxygen usage" for information on how to generate the default footer
# that doxygen normally uses.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_FOOTER =
# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
# sheet that is used by each HTML page. It can be used to fine-tune the look of
# the HTML output. If left blank doxygen will generate a default style sheet.
# See also section "Doxygen usage" for information on how to generate the style
# sheet that doxygen normally uses.
# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as
# it is more robust and this tag (HTML_STYLESHEET) will in the future become
# obsolete.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_STYLESHEET =
# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user-
# defined cascading style sheet that is included after the standard style sheets
# created by doxygen. Using this option one can overrule certain style aspects.
# This is preferred over using HTML_STYLESHEET since it does not replace the
# standard style sheet and is therefor more robust against future updates.
# Doxygen will copy the style sheet file to the output directory. For an example
# see the documentation.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_EXTRA_STYLESHEET =
# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
# other source files which should be copied to the HTML output directory. Note
# that these files will be copied to the base HTML output directory. Use the
# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
# files. In the HTML_STYLESHEET file, use the file name only. Also note that the
# files will be copied as-is; there are no commands or markers available.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_EXTRA_FILES =
# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
# will adjust the colors in the stylesheet and background images according to
# this color. Hue is specified as an angle on a colorwheel, see
# http://en.wikipedia.org/wiki/Hue for more information. For instance the value
# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300
# purple, and 360 is red again.
# Minimum value: 0, maximum value: 359, default value: 220.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_COLORSTYLE_HUE = 220
# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors
# in the HTML output. For a value of 0 the output will use grayscales only. A
# value of 255 will produce the most vivid colors.
# Minimum value: 0, maximum value: 255, default value: 100.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_COLORSTYLE_SAT = 100
# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the
# luminance component of the colors in the HTML output. Values below 100
# gradually make the output lighter, whereas values above 100 make the output
# darker. The value divided by 100 is the actual gamma applied, so 80 represents
# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not
# change the gamma.
# Minimum value: 40, maximum value: 240, default value: 80.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_COLORSTYLE_GAMMA = 80
# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
# page will contain the date and time when the page was generated. Setting this
# to NO can help when comparing the output of multiple runs.
# The default value is: YES.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_TIMESTAMP = YES
# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
# documentation will contain sections that can be hidden and shown after the
# page has loaded.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_DYNAMIC_SECTIONS = NO
# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries
# shown in the various tree structured indices initially; the user can expand
# and collapse entries dynamically later on. Doxygen will expand the tree to
# such a level that at most the specified number of entries are visible (unless
# a fully collapsed tree already exceeds this amount). So setting the number of
# entries 1 will produce a full collapsed tree by default. 0 is a special value
# representing an infinite number of entries and will result in a full expanded
# tree by default.
# Minimum value: 0, maximum value: 9999, default value: 100.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_INDEX_NUM_ENTRIES = 100
# If the GENERATE_DOCSET tag is set to YES, additional index files will be
# generated that can be used as input for Apple's Xcode 3 integrated development
# environment (see: http://developer.apple.com/tools/xcode/), introduced with
# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a
# Makefile in the HTML output directory. Running make will produce the docset in
# that directory and running make install will install the docset in
# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at
# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
# for more information.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_DOCSET = NO
# This tag determines the name of the docset feed. A documentation feed provides
# an umbrella under which multiple documentation sets from a single provider
# (such as a company or product suite) can be grouped.
# The default value is: Doxygen generated docs.
# This tag requires that the tag GENERATE_DOCSET is set to YES.
DOCSET_FEEDNAME = "Doxygen generated docs"
# This tag specifies a string that should uniquely identify the documentation
# set bundle. This should be a reverse domain-name style string, e.g.
# com.mycompany.MyDocSet. Doxygen will append .docset to the name.
# The default value is: org.doxygen.Project.
# This tag requires that the tag GENERATE_DOCSET is set to YES.
DOCSET_BUNDLE_ID = org.doxygen.Project
# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify
# the documentation publisher. This should be a reverse domain-name style
# string, e.g. com.mycompany.MyDocSet.documentation.
# The default value is: org.doxygen.Publisher.
# This tag requires that the tag GENERATE_DOCSET is set to YES.
DOCSET_PUBLISHER_ID = org.doxygen.Publisher
# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
# The default value is: Publisher.
# This tag requires that the tag GENERATE_DOCSET is set to YES.
DOCSET_PUBLISHER_NAME = Publisher
# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
# additional HTML index files: index.hhp, index.hhc, and index.hhk. The
# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop
# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on
# Windows.
#
# The HTML Help Workshop contains a compiler that can convert all HTML output
# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML
# files are now used as the Windows 98 help format, and will replace the old
# Windows help format (.hlp) on all Windows platforms in the future. Compressed
# HTML files also contain an index, a table of contents, and you can search for
# words in the documentation. The HTML workshop also contains a viewer for
# compressed HTML files.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_HTMLHELP = NO
# The CHM_FILE tag can be used to specify the file name of the resulting .chm
# file. You can add a path in front of the file if the result should not be
# written to the html output directory.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
CHM_FILE =
# The HHC_LOCATION tag can be used to specify the location (absolute path
# including file name) of the HTML help compiler ( hhc.exe). If non-empty
# doxygen will try to run the HTML help compiler on the generated index.hhp.
# The file has to be specified with full path.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
HHC_LOCATION =
# The GENERATE_CHI flag controls if a separate .chi index file is generated (
# YES) or that it should be included in the master .chm file ( NO).
# The default value is: NO.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
GENERATE_CHI = NO
# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc)
# and project file content.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
CHM_INDEX_ENCODING =
# The BINARY_TOC flag controls whether a binary table of contents is generated (
# YES) or a normal table of contents ( NO) in the .chm file.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
BINARY_TOC = NO
# The TOC_EXPAND flag can be set to YES to add extra items for group members to
# the table of contents of the HTML help documentation and to the tree view.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
TOC_EXPAND = NO
# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that
# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help
# (.qch) of the generated HTML documentation.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_QHP = NO
# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify
# the file name of the resulting .qch file. The path specified is relative to
# the HTML output folder.
# This tag requires that the tag GENERATE_QHP is set to YES.
QCH_FILE =
# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
# Project output. For more information please see Qt Help Project / Namespace
# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace).
# The default value is: org.doxygen.Project.
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_NAMESPACE = org.doxygen.Project
# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
# Help Project output. For more information please see Qt Help Project / Virtual
# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual-
# folders).
# The default value is: doc.
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_VIRTUAL_FOLDER = doc
# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
# filter to add. For more information please see Qt Help Project / Custom
# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
# filters).
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_CUST_FILTER_NAME =
# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
# custom filter to add. For more information please see Qt Help Project / Custom
# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
# filters).
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_CUST_FILTER_ATTRS =
# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
# project's filter section matches. Qt Help Project / Filter Attributes (see:
# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes).
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_SECT_FILTER_ATTRS =
# The QHG_LOCATION tag can be used to specify the location of Qt's
# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the
# generated .qhp file.
# This tag requires that the tag GENERATE_QHP is set to YES.
QHG_LOCATION =
# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be
# generated, together with the HTML files, they form an Eclipse help plugin. To
# install this plugin and make it available under the help contents menu in
# Eclipse, the contents of the directory containing the HTML and XML files needs
# to be copied into the plugins directory of eclipse. The name of the directory
# within the plugins directory should be the same as the ECLIPSE_DOC_ID value.
# After copying Eclipse needs to be restarted before the help appears.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_ECLIPSEHELP = NO
# A unique identifier for the Eclipse help plugin. When installing the plugin
# the directory name containing the HTML and XML files should also have this
# name. Each documentation set should have its own identifier.
# The default value is: org.doxygen.Project.
# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.
ECLIPSE_DOC_ID = org.doxygen.Project
# If you want full control over the layout of the generated HTML pages it might
# be necessary to disable the index and replace it with your own. The
# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top
# of each HTML page. A value of NO enables the index and the value YES disables
# it. Since the tabs in the index contain the same information as the navigation
# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
DISABLE_INDEX = NO
# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
# structure should be generated to display hierarchical information. If the tag
# value is set to YES, a side panel will be generated containing a tree-like
# index structure (just like the one that is generated for HTML Help). For this
# to work a browser that supports JavaScript, DHTML, CSS and frames is required
# (i.e. any modern browser). Windows users are probably better off using the
# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can
# further fine-tune the look of the index. As an example, the default style
# sheet generated by doxygen has an example that shows how to put an image at
# the root of the tree instead of the PROJECT_NAME. Since the tree basically has
# the same information as the tab index, you could consider setting
# DISABLE_INDEX to YES when enabling this option.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_TREEVIEW = YES
# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that
# doxygen will group on one line in the generated HTML documentation.
#
# Note that a value of 0 will completely suppress the enum values from appearing
# in the overview section.
# Minimum value: 0, maximum value: 20, default value: 4.
# This tag requires that the tag GENERATE_HTML is set to YES.
ENUM_VALUES_PER_LINE = 4
# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used
# to set the initial width (in pixels) of the frame in which the tree is shown.
# Minimum value: 0, maximum value: 1500, default value: 250.
# This tag requires that the tag GENERATE_HTML is set to YES.
TREEVIEW_WIDTH = 250
# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to
# external symbols imported via tag files in a separate window.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
EXT_LINKS_IN_WINDOW = NO
# Use this tag to change the font size of LaTeX formulas included as images in
# the HTML documentation. When you change the font size after a successful
# doxygen run you need to manually remove any form_*.png images from the HTML
# output directory to force them to be regenerated.
# Minimum value: 8, maximum value: 50, default value: 10.
# This tag requires that the tag GENERATE_HTML is set to YES.
FORMULA_FONTSIZE = 10
# Use the FORMULA_TRANPARENT tag to determine whether or not the images
# generated for formulas are transparent PNGs. Transparent PNGs are not
# supported properly for IE 6.0, but are supported on all modern browsers.
#
# Note that when changing this option you need to delete any form_*.png files in
# the HTML output directory before the changes have effect.
# The default value is: YES.
# This tag requires that the tag GENERATE_HTML is set to YES.
FORMULA_TRANSPARENT = YES
# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
# http://www.mathjax.org) which uses client side Javascript for the rendering
# instead of using prerendered bitmaps. Use this if you do not have LaTeX
# installed or if you want to formulas look prettier in the HTML output. When
# enabled you may also need to install MathJax separately and configure the path
# to it using the MATHJAX_RELPATH option.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
USE_MATHJAX = NO
# When MathJax is enabled you can set the default output format to be used for
# the MathJax output. See the MathJax site (see:
# http://docs.mathjax.org/en/latest/output.html) for more details.
# Possible values are: HTML-CSS (which is slower, but has the best
# compatibility), NativeMML (i.e. MathML) and SVG.
# The default value is: HTML-CSS.
# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_FORMAT = HTML-CSS
# When MathJax is enabled you need to specify the location relative to the HTML
# output directory using the MATHJAX_RELPATH option. The destination directory
# should contain the MathJax.js script. For instance, if the mathjax directory
# is located at the same level as the HTML output directory, then
# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax
# Content Delivery Network so you can quickly see the result without installing
# MathJax. However, it is strongly recommended to install a local copy of
# MathJax from http://www.mathjax.org before deployment.
# The default value is: http://cdn.mathjax.org/mathjax/latest.
# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_RELPATH = http://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
# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_EXTENSIONS =
# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
# of code that will be used on startup of the MathJax code. See the MathJax site
# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an
# example see the documentation.
# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_CODEFILE =
# When the SEARCHENGINE tag is enabled doxygen will generate a search box for
# the HTML output. The underlying search engine uses javascript and DHTML and
# should work on any modern browser. Note that when using HTML help
# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET)
# there is already a search function so this one should typically be disabled.
# For large projects the javascript based search engine can be slow, then
# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to
# search using the keyboard; to jump to the search box use + S
# (what the is depends on the OS and browser, but it is typically
# , /, or both). Inside the search box use the to jump into the search results window, the results can be navigated
# using the . Press to select an item or to cancel
# the search. The filter options can be selected when the cursor is inside the
# search box by pressing +. Also here use the
# to select a filter and or to activate or cancel the filter
# option.
# The default value is: YES.
# This tag requires that the tag GENERATE_HTML is set to YES.
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
# are two flavours 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 and searching needs to be provided by external tools. See
# the section "External Indexing and Searching" for details.
# The default value is: NO.
# This tag requires that the tag SEARCHENGINE is set to YES.
SERVER_BASED_SEARCH = NO
# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP
# script for searching. Instead the search results are written to an XML file
# which needs to be processed by an external indexer. Doxygen will invoke an
# external search engine pointed to by the SEARCHENGINE_URL option to obtain the
# search results.
#
# 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.
# The default value is: NO.
# This tag requires that the tag SEARCHENGINE is set to YES.
EXTERNAL_SEARCH = NO
# The SEARCHENGINE_URL should point to a search engine hosted by a web server
# which will return the search results when EXTERNAL_SEARCH is enabled.
#
# 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.
# This tag requires that the tag SEARCHENGINE is set to YES.
SEARCHENGINE_URL =
# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
# search data is written to a file for indexing by an external tool. With the
# SEARCHDATA_FILE tag the name of this file can be specified.
# The default file is: searchdata.xml.
# This tag requires that the tag SEARCHENGINE is set to YES.
SEARCHDATA_FILE = searchdata.xml
# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the
# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is
# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple
# projects and redirect the results back to the right project.
# This tag requires that the tag SEARCHENGINE is set to YES.
EXTERNAL_SEARCH_ID =
# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen
# projects other than the one defined by this configuration file, but that are
# all added to the same external search index. Each project needs to have a
# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of
# to a relative location where the documentation can be found. The format is:
# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...
# This tag requires that the tag SEARCHENGINE is set to YES.
EXTRA_SEARCH_MAPPINGS =
#---------------------------------------------------------------------------
# Configuration options related to the LaTeX output
#---------------------------------------------------------------------------
# If the GENERATE_LATEX tag is set to YES doxygen will generate LaTeX output.
# The default value is: YES.
GENERATE_LATEX = NO
# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
# it.
# The default directory is: latex.
# This tag requires that the tag GENERATE_LATEX is set to YES.
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.
# 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.
# The default file is: makeindex.
# This tag requires that the tag GENERATE_LATEX is set to YES.
MAKEINDEX_CMD_NAME = 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.
# The default value is: NO.
# This tag requires that the tag GENERATE_LATEX is set to YES.
COMPACT_LATEX = NO
# The PAPER_TYPE tag can be used to set the paper type that is used by the
# printer.
# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x
# 14 inches) and executive (7.25 x 10.5 inches).
# The default value is: a4.
# This tag requires that the tag GENERATE_LATEX is set to YES.
PAPER_TYPE = a4
# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names
# that should be included in the LaTeX output. To get the times font for
# instance you can specify
# EXTRA_PACKAGES=times
# If left blank no extra packages will be included.
# This tag requires that the tag GENERATE_LATEX is set to YES.
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.
#
# 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. Doxygen will
# replace them by respectively the title of the page, the current date and time,
# only the current date, the version number of doxygen, the project name (see
# PROJECT_NAME), or the project number (see PROJECT_NUMBER).
# 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.
#
# 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 =
# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or
# other source files which should be copied to the LATEX_OUTPUT output
# directory. Note that the files will be copied as-is; there are no commands or
# markers available.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_EXTRA_FILES =
# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is
# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will
# contain links (just like the HTML output) instead of page references. This
# makes the output suitable for online browsing using a PDF viewer.
# The default value is: YES.
# This tag requires that the tag GENERATE_LATEX is set to YES.
PDF_HYPERLINKS = YES
# If the LATEX_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.
# 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 default value is: NO.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_BATCHMODE = NO
# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the
# index chapters (such as File Index, Compound Index, etc.) in the output.
# The default value is: NO.
# This tag requires that the tag GENERATE_LATEX is set to YES.
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.
# The default value is: plain.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_BIB_STYLE = plain
#---------------------------------------------------------------------------
# Configuration options related to the RTF output
#---------------------------------------------------------------------------
# If the GENERATE_RTF tag is set to YES doxygen will generate RTF output. The
# RTF output is optimized for Word 97 and may not look too pretty with other RTF
# readers/editors.
# The default value is: NO.
GENERATE_RTF = NO
# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
# it.
# The default directory is: rtf.
# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_OUTPUT = rtf
# If the COMPACT_RTF tag is set to YES doxygen generates more compact RTF
# documents. This may be useful for small projects and may help to save some
# trees in general.
# The default value is: NO.
# This tag requires that the tag GENERATE_RTF is set to YES.
COMPACT_RTF = NO
# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will
# contain hyperlink fields. The RTF file will contain links (just like the HTML
# output) instead of page references. This makes the output suitable for online
# browsing using Word or some other Word compatible readers that support those
# fields.
#
# Note: WordPad (write) and others do not support links.
# The default value is: NO.
# This tag requires that the tag GENERATE_RTF is set to YES.
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.
#
# See also section "Doxygen usage" for information on how to generate the
# default style sheet that doxygen normally uses.
# This tag requires that the tag GENERATE_RTF is set to YES.
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.
# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# Configuration options related to the man page output
#---------------------------------------------------------------------------
# If the GENERATE_MAN tag is set to YES doxygen will generate man pages for
# classes and files.
# The default value is: NO.
GENERATE_MAN = NO
# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
# it. A directory man3 will be created inside the directory specified by
# MAN_OUTPUT.
# The default directory is: man.
# This tag requires that the tag GENERATE_MAN is set to YES.
MAN_OUTPUT = man
# The MAN_EXTENSION tag determines the extension that is added to the generated
# man pages. In case the manual section does not start with a number, the number
# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is
# optional.
# The default value is: .3.
# This tag requires that the tag GENERATE_MAN is set to YES.
MAN_EXTENSION = .3
# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it
# will generate one additional man file for each entity documented in the real
# man page(s). These additional files only source the real man page, but without
# them the man command would be unable to find the correct page.
# The default value is: NO.
# This tag requires that the tag GENERATE_MAN is set to YES.
MAN_LINKS = NO
#---------------------------------------------------------------------------
# Configuration options related to the XML output
#---------------------------------------------------------------------------
# If the GENERATE_XML tag is set to YES doxygen will generate an XML file that
# captures the structure of the code including all documentation.
# The default value is: NO.
GENERATE_XML = NO
# The XML_OUTPUT tag is used to specify where the XML pages 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: xml.
# This tag requires that the tag GENERATE_XML is set to YES.
XML_OUTPUT = xml
# The XML_SCHEMA tag can be used to specify a XML schema, which can be used by a
# validating XML parser to check the syntax of the XML files.
# This tag requires that the tag GENERATE_XML is set to YES.
XML_SCHEMA =
# The XML_DTD tag can be used to specify a XML DTD, which can be used by a
# validating XML parser to check the syntax of the XML files.
# This tag requires that the tag GENERATE_XML is set to YES.
XML_DTD =
# If the XML_PROGRAMLISTING tag is set to YES doxygen will dump the program
# listings (including syntax highlighting and cross-referencing information) to
# the XML output. Note that enabling this will significantly increase the size
# of the XML output.
# The default value is: YES.
# This tag requires that the tag GENERATE_XML is set to YES.
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
# Configuration options related to the DOCBOOK output
#---------------------------------------------------------------------------
# If the GENERATE_DOCBOOK tag is set to YES doxygen will generate Docbook files
# that can be used to generate PDF.
# The default value is: NO.
GENERATE_DOCBOOK = NO
# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages 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: docbook.
# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
DOCBOOK_OUTPUT = docbook
#---------------------------------------------------------------------------
# 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.
# The default value is: NO.
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
# Configuration options related to the Perl module output
#---------------------------------------------------------------------------
# If the GENERATE_PERLMOD tag is set to YES doxygen will generate a Perl module
# 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_PERLMOD = NO
# If the PERLMOD_LATEX tag is set to YES doxygen will generate the necessary
# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI
# output from the Perl module output.
# The default value is: NO.
# This tag requires that the tag GENERATE_PERLMOD is set to YES.
PERLMOD_LATEX = NO
# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be nicely
# formatted so it can be parsed by a human reader. This is useful if you want to
# understand what is going on. On the other hand, if this tag is set to NO the
# size of the Perl module output will be much smaller and Perl will parse it
# just the same.
# The default value is: YES.
# This tag requires that the tag GENERATE_PERLMOD is set to YES.
PERLMOD_PRETTY = YES
# The names of the make variables in the generated doxyrules.make file are
# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful
# so different doxyrules.make files included by the same Makefile don't
# overwrite each other's variables.
# This tag requires that the tag GENERATE_PERLMOD is set to YES.
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
# If the ENABLE_PREPROCESSING tag is set to YES doxygen will evaluate all
# C-preprocessor directives found in the sources and include files.
# The default value is: YES.
ENABLE_PREPROCESSING = YES
# If the MACRO_EXPANSION tag is set to YES doxygen will expand all macro names
# in the source code. If set to NO only conditional compilation will be
# performed. Macro expansion can be done in a controlled way by setting
# EXPAND_ONLY_PREDEF to YES.
# The default value is: NO.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
MACRO_EXPANSION = NO
# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
# the macro expansion is limited to the macros specified with the PREDEFINED and
# EXPAND_AS_DEFINED tags.
# The default value is: NO.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
EXPAND_ONLY_PREDEF = NO
# If the SEARCH_INCLUDES tag is set to YES the includes files in the
# INCLUDE_PATH will be searched if a #include is found.
# The default value is: YES.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
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.
# This tag requires that the tag SEARCH_INCLUDES is set to YES.
INCLUDE_PATH =
# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
# patterns (like *.h and *.hpp) to filter out the header-files in the
# directories. If left blank, the patterns specified with FILE_PATTERNS will be
# used.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
INCLUDE_FILE_PATTERNS =
# The PREDEFINED tag can be used to specify one or more macro names that are
# defined before the preprocessor is started (similar to the -D option of e.g.
# gcc). The argument of the tag is a list of macros of the form: name or
# name=definition (no spaces). If the definition and the "=" are omitted, "=1"
# is assumed. To prevent a macro definition from being undefined via #undef or
# recursively expanded use the := operator instead of the = operator.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
PREDEFINED =
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
# tag can be used to specify a list of macro names that should be expanded. The
# macro definition that is found in the sources will be used. Use the PREDEFINED
# tag if you want to use a different macro definition that overrules the
# definition found in the source code.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
EXPAND_AS_DEFINED =
# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
# remove all refrences to function-like macros that are alone on a line, have an
# all uppercase name, and do not end with a semicolon. Such function macros are
# typically used for boiler-plate code, and will confuse the parser if not
# removed.
# The default value is: YES.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration options related to external references
#---------------------------------------------------------------------------
# The TAGFILES tag can be used to specify one or more tag files. For each tag
# file the location of the external documentation should be added. The format of
# a tag file without this location is as follows:
# TAGFILES = file1 file2 ...
# Adding location for the tag files is done as follows:
# TAGFILES = file1=loc1 "file2 = loc2" ...
# where loc1 and loc2 can be relative or absolute paths or URLs. See the
# section "Linking to external documentation" for more information about the use
# of tag files.
# Note: Each tag file must have an unique name (where the name does NOT include
# the path). If a tag file is not located in the directory in which doxygen is
# run, you must also specify the path to the tagfile here.
TAGFILES =
# When a file name is specified after GENERATE_TAGFILE, doxygen will create a
# tag file that is based on the input files it reads. See section "Linking to
# external documentation" for more information about the usage of tag files.
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.
# 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
# listed.
# The default value is: YES.
EXTERNAL_GROUPS = YES
# If the EXTERNAL_PAGES tag is set to YES all external pages will be listed in
# the related pages index. If set to NO, only the current project's pages will
# be listed.
# The default value is: YES.
EXTERNAL_PAGES = YES
# The PERL_PATH should be the absolute path and name of the perl script
# interpreter (i.e. the result of 'which perl').
# The default file (with absolute path) is: /usr/bin/perl.
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
# 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 define message sequence charts within doxygen comments using the \msc
# command. Doxygen will then run the mscgen tool (see:
# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the
# documentation. The MSCGEN_PATH tag allows you to specify the directory where
# the mscgen tool resides. If left empty the tool is assumed to be found in the
# default search path.
MSCGEN_PATH =
# 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.
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
# Bell Labs. The other options in this section have no effect if this option is
# set to NO
# The default value is: NO.
HAVE_DOT = YES
# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
# to run in parallel. When set to 0 doxygen will base this on the number of
# processors available in the system. You can set it explicitly to a value
# larger than 0 to get control over the balance between CPU load and processing
# speed.
# Minimum value: 0, maximum value: 32, default value: 0.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_NUM_THREADS = 0
# When you want a differently looking font n 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.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_FONTNAME = Helvetica
# 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.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_FONTSIZE = 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.
# 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.
# 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.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
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.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
GROUP_GRAPHS = YES
# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
# collaboration diagrams in a style similar to the OMG's Unified Modeling
# Language.
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
UML_LOOK = NO
# If the UML_LOOK tag is enabled, the fields and methods are shown inside the
# class node. If there are many fields or methods and many nodes the graph may
# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the
# number of items for each type to make the size more manageable. Set this to 0
# for no limit. Note that the threshold may be exceeded by 50% before the limit
# is enforced. So when you set the threshold to 10, up to 15 fields may appear,
# 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.
UML_LIMIT_NUM_FIELDS = 10
# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and
# collaboration graphs will show the relations between templates and their
# instances.
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
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.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
INCLUDE_GRAPH = YES
# 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.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
INCLUDED_BY_GRAPH = YES
# If the CALL_GRAPH tag is set to YES then doxygen will generate a call
# dependency graph for every global function or class method.
#
# Note that enabling this option will significantly increase the time of a run.
# So in most cases it will be better to enable call graphs for selected
# functions only using the \callgraph command.
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
CALL_GRAPH = NO
# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller
# dependency graph for every global function or class method.
#
# Note that enabling this option will significantly increase the time of a run.
# So in most cases it will be better to enable caller graphs for selected
# functions only using the \callergraph command.
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
CALLER_GRAPH = NO
# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical
# hierarchy of all classes instead of a textual one.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
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.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
DIRECTORY_GRAPH = YES
# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
# generated by dot.
# 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, jpg, gif and svg.
# The default value is: png.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_IMAGE_FORMAT = png
# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
# enable generation of interactive SVG images that allow zooming and panning.
#
# Note that this requires a modern browser other than Internet Explorer. Tested
# and working are Firefox, Chrome, Safari, and Opera.
# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make
# the SVG files visible. Older versions of IE do not have SVG support.
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
INTERACTIVE_SVG = NO
# The DOT_PATH tag can be used to specify the path where the dot tool can be
# found. If left blank, it is assumed the dot tool can be found in the path.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_PATH =
# The DOTFILE_DIRS tag can be used to specify one or more directories that
# contain dot files that are included in the documentation (see the \dotfile
# command).
# This tag requires that the tag HAVE_DOT is set to YES.
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).
MSCFILE_DIRS =
# 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
# command).
DIAFILE_DIRS =
# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes
# that will be shown in the graph. If the number of nodes in a graph becomes
# larger than this value, doxygen will truncate the graph, which is visualized
# by representing a node as a red box. Note that doxygen if the number of direct
# children of the root node in a graph is already larger than
# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that
# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
# 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
# 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
# root by following a path via at most 3 edges will be shown. Nodes that lay
# further from the root node will be omitted. Note that setting this option to 1
# or 2 may greatly reduce the computation time needed for large code bases. Also
# note that the size of a graph can be further restricted by
# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
# Minimum value: 0, maximum value: 1000, default value: 0.
# This tag requires that the tag HAVE_DOT is set to YES.
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 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
# this, this feature is disabled by default.
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_MULTI_TARGETS = YES
# 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.
# 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
# files that are used to generate the various graphs.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_CLEANUP = YES
./.settings/ 0000755 0000156 0000165 00000000000 12677430772 013032 5 ustar jenkins jenkins ./.settings/Autopilot List.launch 0000644 0000156 0000165 00000001647 12677430772 017112 0 ustar jenkins jenkins
./.settings/Autopilot Run.launch 0000644 0000156 0000165 00000001710 12677430772 016732 0 ustar jenkins jenkins
./cmake/ 0000755 0000156 0000165 00000000000 12677430772 012174 5 ustar jenkins jenkins ./cmake/modules/ 0000755 0000156 0000165 00000000000 12677430772 013644 5 ustar jenkins jenkins ./cmake/modules/EnableCoverageReport.cmake 0000644 0000156 0000165 00000016414 12677430772 020712 0 ustar jenkins jenkins # - Creates a special coverage build type and target on GCC.
#
# Defines a function ENABLE_COVERAGE_REPORT which generates the coverage target
# for selected targets. Optional arguments to this function are used to filter
# unwanted results using globbing expressions. Moreover targets with tests for
# the source code can be specified to trigger regenerating the report if the
# test has changed
#
# ENABLE_COVERAGE_REPORT(TARGETS target... [FILTER filter...] [TESTS test targets...])
#
# To generate a coverage report first build the project with
# CMAKE_BUILD_TYPE=coverage, then call make test and afterwards make coverage.
#
# The coverage report is based on gcov. Depending on the availability of lcov
# a HTML report will be generated and/or an XML report of gcovr is found.
# The generated coverage target executes all found solutions. Special targets
# exist to create e.g. only the xml report: coverage-xml.
#
# Copyright (C) 2010 by Johannes Wienke
#
# This program is free software; you can redistribute it
# and/or modify it under the terms of the GNU General
# Public License as published by the Free Software Foundation;
# either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
INCLUDE(ParseArguments)
FIND_PACKAGE(Lcov)
FIND_PACKAGE(gcovr)
FUNCTION(ENABLE_COVERAGE_REPORT)
# argument parsing
PARSE_ARGUMENTS(ARG "FILTER;TARGETS;TESTS" "" ${ARGN})
SET(COVERAGE_RAW_FILE "${CMAKE_BINARY_DIR}/coverage.raw.info")
SET(COVERAGE_FILTERED_FILE "${CMAKE_BINARY_DIR}/coverage.info")
SET(COVERAGE_REPORT_DIR "${CMAKE_BINARY_DIR}/coveragereport")
SET(COVERAGE_XML_FILE "${CMAKE_BINARY_DIR}/coverage.xml")
SET(COVERAGE_XML_COMMAND_FILE "${CMAKE_BINARY_DIR}/coverage-xml.cmake")
# decide if there is any tool to create coverage data
SET(TOOL_FOUND FALSE)
IF(LCOV_FOUND OR GCOVR_FOUND)
SET(TOOL_FOUND TRUE)
ENDIF()
IF(NOT TOOL_FOUND)
MESSAGE(STATUS "Cannot enable coverage targets because neither lcov nor gcovr are found.")
ENDIF()
STRING(TOLOWER "${CMAKE_BUILD_TYPE}" COVERAGE_BUILD_TYPE)
IF(CMAKE_COMPILER_IS_GNUCXX AND TOOL_FOUND AND "${COVERAGE_BUILD_TYPE}" MATCHES "coverage")
MESSAGE(STATUS "Coverage support enabled for targets: ${ARG_TARGETS}")
# create coverage build type
SET(CMAKE_CXX_FLAGS_COVERAGE ${CMAKE_CXX_FLAGS_DEBUG} PARENT_SCOPE)
SET(CMAKE_C_FLAGS_COVERAGE ${CMAKE_C_FLAGS_DEBUG} PARENT_SCOPE)
SET(CMAKE_CONFIGURATION_TYPES ${CMAKE_CONFIGURATION_TYPES} coverage PARENT_SCOPE)
# instrument targets
SET_TARGET_PROPERTIES(${ARG_TARGETS} PROPERTIES COMPILE_FLAGS --coverage
LINK_FLAGS --coverage)
# html report
IF (LCOV_FOUND)
MESSAGE(STATUS "Enabling HTML coverage report")
# set up coverage target
ADD_CUSTOM_COMMAND(OUTPUT ${COVERAGE_RAW_FILE}
COMMAND ${LCOV_EXECUTABLE} -c -d ${CMAKE_BINARY_DIR} -o ${COVERAGE_RAW_FILE}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMENT "Collecting coverage data"
DEPENDS ${ARG_TARGETS} ${ARG_TESTS}
VERBATIM)
# filter unwanted stuff
LIST(LENGTH ARG_FILTER FILTER_LENGTH)
IF(${FILTER_LENGTH} GREATER 0)
SET(FILTER COMMAND ${LCOV_EXECUTABLE})
FOREACH(F ${ARG_FILTER})
SET(FILTER ${FILTER} -r ${COVERAGE_FILTERED_FILE} ${F})
ENDFOREACH()
SET(FILTER ${FILTER} -o ${COVERAGE_FILTERED_FILE})
ELSE()
SET(FILTER "")
ENDIF()
ADD_CUSTOM_COMMAND(OUTPUT ${COVERAGE_FILTERED_FILE}
COMMAND ${LCOV_EXECUTABLE} -e ${COVERAGE_RAW_FILE} "${CMAKE_SOURCE_DIR}*" -o ${COVERAGE_FILTERED_FILE}
${FILTER}
DEPENDS ${COVERAGE_RAW_FILE}
COMMENT "Filtering recorded coverage data for project-relevant entries"
VERBATIM)
ADD_CUSTOM_COMMAND(OUTPUT ${COVERAGE_REPORT_DIR}
COMMAND ${CMAKE_COMMAND} -E make_directory ${COVERAGE_REPORT_DIR}
COMMAND ${GENHTML_EXECUTABLE} --legend --show-details -t "${PROJECT_NAME} test coverage" -o ${COVERAGE_REPORT_DIR} ${COVERAGE_FILTERED_FILE}
DEPENDS ${COVERAGE_FILTERED_FILE}
COMMENT "Generating HTML coverage report in ${COVERAGE_REPORT_DIR}"
VERBATIM)
ADD_CUSTOM_TARGET(coverage-html
DEPENDS ${COVERAGE_REPORT_DIR})
ENDIF()
# xml coverage report
IF(GCOVR_FOUND)
MESSAGE(STATUS "Enabling XML coverage report")
# filter unwanted stuff
SET(GCOV_FILTER "")
LIST(LENGTH ARG_FILTER FILTER_LENGTH)
IF(${FILTER_LENGTH} GREATER 0)
FOREACH(F ${ARG_FILTER})
SET(GCOV_FILTER "${GCOV_FILTER} -e \"${F}\"")
ENDFOREACH()
ENDIF()
# gcovr cannot write directly to a file so the execution needs to
# be wrapped in a cmake file that generates the file output
FILE(WRITE ${COVERAGE_XML_COMMAND_FILE}
"SET(ENV{LANG} en)\n")
FILE(APPEND ${COVERAGE_XML_COMMAND_FILE}
"EXECUTE_PROCESS(COMMAND \"${GCOVR_EXECUTABLE}\" -x -r \"${CMAKE_SOURCE_DIR}\" ${GCOV_FILTER} OUTPUT_FILE \"${COVERAGE_XML_FILE}\" WORKING_DIRECTORY \"${CMAKE_BINARY_DIR}\")\n")
ADD_CUSTOM_COMMAND(OUTPUT ${COVERAGE_XML_FILE}
COMMAND ${CMAKE_COMMAND} ARGS -P ${COVERAGE_XML_COMMAND_FILE}
COMMENT "Generating coverage XML report"
VERBATIM)
ADD_CUSTOM_TARGET(coverage-xml
DEPENDS ${COVERAGE_XML_FILE})
ENDIF()
# provide a global coverage target executing both steps if available
SET(GLOBAL_DEPENDS "")
IF(LCOV_FOUND)
LIST(APPEND GLOBAL_DEPENDS ${COVERAGE_REPORT_DIR})
ENDIF()
IF(GCOVR_FOUND)
LIST(APPEND GLOBAL_DEPENDS ${COVERAGE_XML_FILE})
ENDIF()
IF(LCOV_FOUND OR GCOVR_FOUND)
ADD_CUSTOM_TARGET(coverage
DEPENDS ${GLOBAL_DEPENDS})
ENDIF()
ENDIF()
# This gets rid of any stale .gcda files. Run this if a running a binary causes lots of messages about
# about a "merge mismatch for summaries".
ADD_CUSTOM_TARGET(clean-coverage COMMAND find ${CMAKE_BINARY_DIR} -name '*.gcda' | xargs rm -f)
ENDFUNCTION()
./cmake/modules/Findgcovr.cmake 0000644 0000156 0000165 00000001702 12677430772 016567 0 ustar jenkins jenkins # - Find gcovr scrip
# Will define:
#
# GCOVR_EXECUTABLE - the gcovr script
#
# Uses:
#
# GCOVR_ROOT - root to search for the script
#
# Copyright (C) 2011 by Johannes Wienke
#
# This program is free software; you can redistribute it
# and/or modify it under the terms of the GNU General
# Public License as published by the Free Software Foundation;
# either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
INCLUDE(FindPackageHandleStandardArgs)
FIND_PROGRAM(GCOVR_EXECUTABLE gcovr HINTS ${GCOVR_ROOT} "${GCOVR_ROOT}/bin")
FIND_PACKAGE_HANDLE_STANDARD_ARGS(gcovr DEFAULT_MSG GCOVR_EXECUTABLE)
# only visible in advanced view
MARK_AS_ADVANCED(GCOVR_EXECUTABLE)
./cmake/modules/QmlTest.cmake 0000644 0000156 0000165 00000024461 12677430772 016246 0 ustar jenkins jenkins # If you need to override the qmlscene or qmltestrunner executables,
# create the corresponding executable target.
# These functions respect the global STDOUT_LOGGER and ARTIFACTS_DIR variables.
# You can use those with cmake_parse_arguments
# if you need to wrap and mangle arguments.
set(QMLTEST_OPTIONS ADD_TEST CACHE INTERNAL "")
set(QMLTEST_SINGLE ITERATIONS ARG_PREFIX CACHE INTERNAL "")
set(QMLTEST_MULTI ARGS ENVIRONMENT DEPENDS IMPORT_PATHS TARGETS CACHE INTERNAL "")
# import_executables(name1 [name2 [...]]
# [OPTIONAL] # continue when not found
# )
#
# This will find the named executables and import them
# to an imported target of the same name.
function(import_executables)
cmake_parse_arguments(QMLTEST "OPTIONAL" "" "" ${ARGN})
foreach(NAME ${QMLTEST_UNPARSED_ARGUMENTS})
if(NOT TARGET ${NAME})
add_executable(${NAME} IMPORTED GLOBAL)
find_program(${NAME}_exe ${NAME})
if(NOT QMLTEST_OPTIONAL AND NOT ${NAME}_exe)
message(FATAL_ERROR "Could not locate ${NAME}.")
elseif(NOT ${NAME}_exe)
message(STATUS "Could not locate ${NAME}, skipping.")
else()
set_target_properties(${NAME} PROPERTIES IMPORTED_LOCATION ${${NAME}_exe})
endif()
endif()
endforeach()
endfunction()
# add_qml_test(path component_name
# [...]
# )
#
# Add test targets for ${component_name} under ${path}. It's assumed
# that the test file is named ${path}/tst_${component_name}.qml.
#
# This function wraps add_manual_qml_test and add_qml_unittest,
# see below for available arguments.
function(add_qml_test PATH COMPONENT_NAME)
cmake_parse_arguments(QMLTEST "${QMLTEST_OPTIONS}" "${QMLTEST_SINGLE}" "${QMLTEST_MULTI}" ${ARGN})
mangle_arguments()
add_qml_unittest(${ARGV})
add_manual_qml_test(${ARGV})
endfunction()
# add_qml_unittest(path component_name
# [...]
# )
#
# Add test targets for ${component_name} under ${path}. It's assumed
# that the test file is named ${path}/tst_${component_name}.qml.
#
# This function wraps add_executable_test, see below for available arguments.
function(add_qml_unittest PATH COMPONENT_NAME)
import_executables(qmltestrunner)
add_executable_test(${COMPONENT_NAME} qmltestrunner
${ARGN}
ARGS -input ${CMAKE_CURRENT_SOURCE_DIR}/${PATH}/tst_${COMPONENT_NAME}.qml ${QMLTEST_ARGS}
)
endfunction()
# add_manual_qml_test(path component_name
# [...]
# )
#
# Add manual test targets for ${component_name} under ${path}. It's assumed
# that the test file is named ${path}/tst_${component_name}.qml.
#
# This function wraps add_manual_test, see below for available arguments.
function(add_manual_qml_test PATH COMPONENT_NAME)
import_executables(qmlscene)
cmake_parse_arguments(QMLTEST "${QMLTEST_OPTIONS}" "${QMLTEST_SINGLE}" "${QMLTEST_MULTI}" ${ARGN})
add_manual_test(${COMPONENT_NAME} qmlscene
${ARGN}
ARGS ${CMAKE_CURRENT_SOURCE_DIR}/${PATH}/tst_${COMPONENT_NAME}.qml ${QMLTEST_ARGS}
)
endfunction()
# add_executable_test(target component_name
# [...] # see doc for add_manual_qml_test for common arguments
# [ADD_TEST] # whether to add to the "test" target
# [ARG_PREFIX arg_prefix] # prefix logging arguments with this string
# [ARGS] arg1 [arg2 [...]] # pass these arguments to the test executable
# [TARGETS target1 [target2 [...]]] # make the listed targets depend on this test
# # if a corresponding xvfbtarget1, xvfbtarget2 etc. exists,
# # this test running under xvfb will be added as a dependency
# # of those targets
# [ITERATIONS count] # run this test as a benchmark for ${count} iterations
# )
#
# Logging options in the standard form of "-o filename,format"
# will be appended to the arguments list, prefixed with ARG_PREFIX.
# XUnitXML files will be stored in current binary dir or under
# ARTIFACTS_DIR, if set.
#
# Three targets will be created:
# - test${component_name} - Runs the test
# - xvfbtest${component_name} - Runs the test under xvfb
# - gdbtest${component_name} - Runs the test under gdb
function(add_executable_test COMPONENT_NAME TARGET)
import_executables(gdb xvfb-run OPTIONAL)
cmake_parse_arguments(QMLTEST "${QMLTEST_OPTIONS}" "${QMLTEST_SINGLE}" "${QMLTEST_MULTI}" ${ARGN})
mangle_arguments()
if(ARTIFACTS_DIR)
file(RELATIVE_PATH path ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
file(MAKE_DIRECTORY ${ARTIFACTS_DIR}/${path})
set(file_logger -o ${ARTIFACTS_DIR}/${path}/test${COMPONENT_NAME}.xml,xunitxml)
else()
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
set(file_logger -o ${CMAKE_CURRENT_BINARY_DIR}/test${COMPONENT_NAME}.xml,xunitxml)
endif()
bake_arguments("${QMLTEST_ARG_PREFIX}" args ${iterations} ${file_logger} ${STDOUT_LOGGER})
set(qmltest_command
$
${QMLTEST_ARGS}
${args}
)
add_qmltest_target(test${COMPONENT_NAME} ${TARGET}
COMMAND ${qmltest_command}
${depends}
ENVIRONMENT QML2_IMPORT_PATH=${imports} ${QMLTEST_ENVIRONMENT}
${add_test}
${targets}
)
if(TARGET xvfb-run)
add_qmltest_target(xvfbtest${COMPONENT_NAME} ${TARGET}
COMMAND $ --server-args "-screen 0 1024x768x24" --auto-servernum ${qmltest_command}
${depends}
ENVIRONMENT QML2_IMPORT_PATH=${imports} ${QMLTEST_ENVIRONMENT} LD_PRELOAD=/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}/mesa/libGL.so.1
TARGETS ${xvfb_targets}
)
endif()
if(TARGET gdb)
add_qmltest_target(gdbtest${COMPONENT_NAME} ${TARGET}
COMMAND $ -ex run -args ${qmltest_command}
${depends}
ENVIRONMENT QML2_IMPORT_PATH=${imports} ${QMLTEST_ENVIRONMENT}
)
endif()
endfunction()
# add_manual_test(target component_name
# [DEPENDS target1 [target2 [...]]] # make this test depend on the specified targets
# [IMPORT_PATHS import_path1 [import_path2 [...]] # use these QML import paths
# # (they're searched first to last)
# [ENVIRONMENT var1=value1 [var2=value2 [...]]] # set these environment variables
# )
#
# Two targets will be created:
# - try${component_name} - Runs the test for manual interaction
# - gdbtry${component_name} - Runs the test under gdb
function(add_manual_test COMPONENT_NAME TARGET)
import_executables(gdb OPTIONAL)
cmake_parse_arguments(QMLTEST "${QMLTEST_OPTIONS}" "${QMLTEST_SINGLE}" "${QMLTEST_MULTI}" ${ARGN})
mangle_arguments()
bake_arguments("${QMLTEST_ARG_PREFIX}" args -qmljsdebugger=port:3768,3800)
set(qmltry_command
$
${QMLTEST_ARGS}
${args}
)
add_qmltest_target(try${COMPONENT_NAME} ${TARGET}
COMMAND ${qmltry_command}
${depends}
ENVIRONMENT QML2_IMPORT_PATH=${imports} ${QMLTEST_ENVIRONMENT}
)
if(TARGET gdb)
add_qmltest_target(gdbtry${COMPONENT_NAME} ${TARGET}
COMMAND $ -ex run -args ${qmltry_command}
${depends}
ENVIRONMENT QML2_IMPORT_PATH=${imports} ${QMLTEST_ENVIRONMENT}
)
endif()
endfunction()
################### INTERNAL ####################
# add_qmltest_target(target_name target
# COMMAND test_exe [arg1 [...]] # execute this test with arguments
# [...] # see above for available arguments:
# # ADD_TEST, ENVIRONMENT, DEPENDS and TARGETS
# )
function(add_qmltest_target TARGET_NAME TARGET)
cmake_parse_arguments(QMLTEST "${QMLTEST_OPTIONS}" "${QMLTEST_SINGLE}" "COMMAND;${QMLTEST_MULTI}" ${ARGN})
mangle_arguments()
# Additional arguments
string(TOLOWER "${CMAKE_GENERATOR}" cmake_generator_lower)
if(cmake_generator_lower STREQUAL "unix makefiles")
set(function "$(FUNCTION)")
endif()
add_custom_target(${TARGET_NAME}
env ${QMLTEST_ENVIRONMENT}
${QMLTEST_COMMAND} ${function}
DEPENDS ${TARGET} ${QMLTEST_DEPENDS}
)
if(QMLTEST_ADD_TEST)
add_test(
NAME ${TARGET_NAME}
COMMAND ${QMLTEST_COMMAND}
)
foreach(ENV ${QMLTEST_ENVIRONMENT})
set_property(TEST ${TARGET_NAME} APPEND PROPERTY ENVIRONMENT ${ENV})
endforeach()
set_property(TEST ${TARGET_NAME} APPEND PROPERTY DEPENDS ${TARGET})
foreach(DEPEND ${DEPENDS})
set_property(TEST ${TARGET_NAME} APPEND PROPERTY DEPENDS ${DEPEND})
endforeach()
endif()
foreach(UPSTREAM_TARGET ${QMLTEST_TARGETS})
add_dependencies(${UPSTREAM_TARGET} ${TARGET_NAME})
endforeach()
endfunction()
# mangle_arguments(${ARGN})
#
# Verify there were no unparsed arguments and
# mangle the known ones for further processing.
macro(mangle_arguments)
if(QMLTEST_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "Unexpected arguments: ${QMLTEST_UNPARSED_ARGUMENTS}")
endif()
if(QMLTEST_ADD_TEST)
set(add_test ADD_TEST)
endif()
if(QMLTEST_IMPORT_PATHS)
string(REPLACE ";" ":" imports "${QMLTEST_IMPORT_PATHS}")
endif()
if(QMLTEST_ITERATIONS)
set(iterations -iterations ${QMLTEST_ITERATIONS})
endif()
if(QMLTEST_DEPENDS)
set(depends DEPENDS ${QMLTEST_DEPENDS})
endif()
if(QMLTEST_TARGETS)
set(targets TARGETS ${QMLTEST_TARGETS})
endif()
set(xvfb_targets "")
foreach(target ${QMLTEST_TARGETS})
if(TARGET xvfb${target})
list(APPEND xvfb_targets xvfb${target})
endif()
endforeach()
set(xvfb_targets "${xvfb_targets}" PARENT_SCOPE)
endmacro()
# bake_arguments(prefix output
# arg1 [arg2 [...]]
# )
#
# If set, add the argument prefix before every passed
# argument and store the result in ${OUTPUT} variable.
function(bake_arguments PREFIX OUTPUT)
set(args "${ARGN}")
if(PREFIX)
set(args "")
foreach(arg ${ARGN})
list(APPEND args ${PREFIX})
list(APPEND args ${arg})
endforeach()
endif()
set(${OUTPUT} "${args}" PARENT_SCOPE)
endfunction()
./cmake/modules/autopilot.cmake 0000644 0000156 0000165 00000001013 12677430772 016661 0 ustar jenkins jenkins add_custom_target(autopilot)
function(declare_autopilot_test TEST_NAME TEST_SUITE WORKING_DIR)
add_custom_target(autopilot-${TEST_NAME}
COMMAND UNITY_TESTING=1 LANG=C QML2_IMPORT_PATH=${SHELL_INSTALL_QML}/mocks python3 -m autopilot.run run ${TEST_SUITE}
WORKING_DIRECTORY ${WORKING_DIR}
DEPENDS fake_install
)
add_custom_target(fake_install
COMMAND cmake --build ${CMAKE_BINARY_DIR} --target install
)
add_dependencies(autopilot autopilot-${TEST_NAME})
endfunction()
./cmake/modules/ParseArguments.cmake 0000644 0000156 0000165 00000003406 12677430772 017611 0 ustar jenkins jenkins # Parse arguments passed to a function into several lists separated by
# upper-case identifiers and options that do not have an associated list e.g.:
#
# SET(arguments
# hello OPTION3 world
# LIST3 foo bar
# OPTION2
# LIST1 fuz baz
# )
# PARSE_ARGUMENTS(ARG "LIST1;LIST2;LIST3" "OPTION1;OPTION2;OPTION3" ${arguments})
#
# results in 7 distinct variables:
# * ARG_DEFAULT_ARGS: hello;world
# * ARG_LIST1: fuz;baz
# * ARG_LIST2:
# * ARG_LIST3: foo;bar
# * ARG_OPTION1: FALSE
# * ARG_OPTION2: TRUE
# * ARG_OPTION3: TRUE
#
# taken from http://www.cmake.org/Wiki/CMakeMacroParseArguments
MACRO(PARSE_ARGUMENTS prefix arg_names option_names)
SET(DEFAULT_ARGS)
FOREACH(arg_name ${arg_names})
SET(${prefix}_${arg_name})
ENDFOREACH(arg_name)
FOREACH(option ${option_names})
SET(${prefix}_${option} FALSE)
ENDFOREACH(option)
SET(current_arg_name DEFAULT_ARGS)
SET(current_arg_list)
FOREACH(arg ${ARGN})
SET(larg_names ${arg_names})
LIST(FIND larg_names "${arg}" is_arg_name)
IF (is_arg_name GREATER -1)
SET(${prefix}_${current_arg_name} ${current_arg_list})
SET(current_arg_name ${arg})
SET(current_arg_list)
ELSE (is_arg_name GREATER -1)
SET(loption_names ${option_names})
LIST(FIND loption_names "${arg}" is_option)
IF (is_option GREATER -1)
SET(${prefix}_${arg} TRUE)
ELSE (is_option GREATER -1)
SET(current_arg_list ${current_arg_list} ${arg})
ENDIF (is_option GREATER -1)
ENDIF (is_arg_name GREATER -1)
ENDFOREACH(arg)
SET(${prefix}_${current_arg_name} ${current_arg_list})
ENDMACRO(PARSE_ARGUMENTS)
./cmake/modules/FindLcov.cmake 0000644 0000156 0000165 00000001720 12677430772 016352 0 ustar jenkins jenkins # - Find lcov
# Will define:
#
# LCOV_EXECUTABLE - the lcov binary
# GENHTML_EXECUTABLE - the genhtml executable
#
# Copyright (C) 2010 by Johannes Wienke
#
# This program is free software; you can redistribute it
# and/or modify it under the terms of the GNU General
# Public License as published by the Free Software Foundation;
# either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
INCLUDE(FindPackageHandleStandardArgs)
FIND_PROGRAM(LCOV_EXECUTABLE lcov)
FIND_PROGRAM(GENHTML_EXECUTABLE genhtml)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lcov DEFAULT_MSG LCOV_EXECUTABLE GENHTML_EXECUTABLE)
# only visible in advanced view
MARK_AS_ADVANCED(LCOV_EXECUTABLE GENHTML_EXECUTABLE)
./cmake/modules/QmlPlugins.cmake 0000644 0000156 0000165 00000012541 12677430772 016744 0 ustar jenkins jenkins # If you need to override the qmlplugindump binary, create the qmlplugin executable
# target before loading this plugin.
if(NOT TARGET qmlplugindump)
find_program(qmlplugindump_exe qmlplugindump)
if(NOT qmlplugindump_exe)
msg(FATAL_ERROR "Could not locate qmlplugindump.")
endif()
add_executable(qmlplugindump IMPORTED)
set_target_properties(qmlplugindump PROPERTIES IMPORTED_LOCATION ${qmlplugindump_exe})
endif()
#
# A custom target for building the qmltypes files manually.
#
if (NOT TARGET qmltypes)
add_custom_target(qmltypes)
endif()
# Creates a target for copying resource files into build dir and optionally installing them.
#
# Files will be copied into ${BINARY_DIR}/${path} or ${CMAKE_CURRENT_BINARY_DIR} and installed
# into ${DESTINATION}/${path}.
#
# Resource file names are matched against {*.{qml,js,jpg,png,sci,svg},qmldir}.
#
# export_qmlfiles(plugin path
# [SEARCH_PATH path] # Path to search for resources in (defaults to ${CMAKE_CURRENT_SOURCE_DIR})
# [BINARY_DIR path]
# [DESTINATION path]
# [TARGET_PREFIX string] # Will be prefixed to the target name
# )
#
# Created target:
# - ${TARGET_PREFIX}${plugin}-qmlfiles - Copies resources into the binary dir.
macro(export_qmlfiles PLUGIN PATH)
set(single SEARCH_PATH BINARY_DIR DESTINATION TARGET_PREFIX)
cmake_parse_arguments(QMLFILES "" "${single}" "" ${ARGN})
if(NOT QMLFILES_SEARCH_PATH)
set(QMLFILES_SEARCH_PATH ${CMAKE_CURRENT_SOURCE_DIR})
endif()
if(QMLFILES_BINARY_DIR)
set(qmlfiles_dir ${QMLFILES_BINARY_DIR}/${PATH})
else()
set(qmlfiles_dir ${CMAKE_CURRENT_BINARY_DIR})
endif()
file(GLOB QMLFILES
${QMLFILES_SEARCH_PATH}/*.qml
${QMLFILES_SEARCH_PATH}/*.js
${QMLFILES_SEARCH_PATH}/*.jpg
${QMLFILES_SEARCH_PATH}/*.png
${QMLFILES_SEARCH_PATH}/*.sci
${QMLFILES_SEARCH_PATH}/*.svg
${QMLFILES_SEARCH_PATH}/*.qmltypes
${QMLFILES_SEARCH_PATH}/qmldir
)
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${qmlfiles_dir})
# copy the files
add_custom_target(${QMLFILES_TARGET_PREFIX}${PLUGIN}-qmlfiles ALL
COMMAND cp ${QMLFILES} ${qmlfiles_dir}
DEPENDS ${QMLFILES}
SOURCES ${QMLFILES}
)
if(QMLFILES_DESTINATION)
# install the qmlfiles file.
install(FILES ${QMLFILES}
DESTINATION ${QMLFILES_DESTINATION}/${PATH}
)
endif()
endmacro()
# Creates a target for generating the typeinfo file for a QML plugin and/or installs the plugin
# targets.
#
# Files will be copied into ${BINARY_DIR}/${path} or ${CMAKE_CURRENT_BINARY_DIR} and installed
# into ${DESTINATION}/${path}. If you don't pass BINARY_DIR, it's assumed that current source
# path ends with ${path}.
#
# The generated file will be named after the last segment of the plugin name, e.g. Foo.qmltypes.
#
# export_qmlplugin(plugin version path
# [BINARY_DIR path]
# [DESTINATION path]
# [TARGET_PREFIX string] # Will be prefixed to the target name
# [ENVIRONMENT string] # Will be added to qmlplugindump's env
# [TARGETS target1 [target2 ...]] # Targets to depend on and install (e.g. the plugin shared object)
# [NO_TYPES] # Do not create the qmltypes target
# )
#
# Created target:
# - ${TARGET_PREFIX}${plugin}-qmltypes - Generates the qmltypes file in the source dir.
# It will be made a dependency of the "qmltypes" target.
macro(export_qmlplugin PLUGIN VERSION PATH)
set(options NO_TYPES)
set(single BINARY_DIR DESTINATION TARGET_PREFIX ENVIRONMENT)
set(multi TARGETS)
cmake_parse_arguments(QMLPLUGIN "${options}" "${single}" "${multi}" ${ARGN})
if(QMLPLUGIN_BINARY_DIR)
set(qmlplugin_dir ${QMLPLUGIN_BINARY_DIR}/${PATH})
else()
# Find import path to point qmlplugindump at
string(REGEX REPLACE "/${PATH}$" "" QMLPLUGIN_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}")
set(qmlplugin_dir ${CMAKE_CURRENT_BINARY_DIR})
endif()
if(NOT QMLPLUGIN_NO_TYPES)
# Relative path for the module
string(REPLACE "${CMAKE_BINARY_DIR}/" "" QMLPLUGIN_MODULE_DIR "${QMLPLUGIN_BINARY_DIR}")
# Find the last segment of the plugin name to use as qmltypes basename
string(REGEX MATCH "[^.]+$" plugin_suffix ${PLUGIN})
set(target_prefix ${QMLPLUGIN_TARGET_PREFIX}${PLUGIN})
set(qmltypes_path ${CMAKE_CURRENT_SOURCE_DIR}/${plugin_suffix}.qmltypes)
add_custom_target(${target_prefix}-qmltypes
COMMAND env ${QMLPLUGIN_ENVIRONMENT} $ -notrelocatable
${PLUGIN} ${VERSION} ${QMLPLUGIN_MODULE_DIR} > ${qmltypes_path}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
add_dependencies(${target_prefix}-qmltypes ${target_prefix}-qmlfiles ${QMLPLUGIN_TARGETS})
add_dependencies(qmltypes ${target_prefix}-qmltypes)
endif()
set_target_properties(${QMLPLUGIN_TARGETS} PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY ${qmlplugin_dir}
LIBRARY_OUTPUT_DIRECTORY ${qmlplugin_dir}
RUNTIME_OUTPUT_DIRECTORY ${qmlplugin_dir}
)
if (QMLPLUGIN_DESTINATION)
# Install additional targets
install(TARGETS ${QMLPLUGIN_TARGETS}
DESTINATION ${QMLPLUGIN_DESTINATION}/${PATH}
)
endif()
endmacro()
./run.sh 0000755 0000156 0000165 00000003702 12677430772 012261 0 ustar jenkins jenkins #!/bin/sh
. /etc/environment
export QML2_IMPORT_PATH
QML_PHONE_SHELL_PATH=./builddir/src/unity8
GDB=false
FAKE=false
USE_MOCKS=false
MOUSE_TOUCH=true
usage() {
echo "usage: "$0" [OPTIONS]\n" >&2
echo "Script to run the shell.\n" >&2
echo "OPTIONS:" >&2
echo " -f, --fake Force use of fake Qml modules." >&2
echo " -g, --gdb Run through gdb." >&2
echo " -h, --help Show this help." >&2
echo " -m, --nomousetouch Run without -mousetouch argument." >&2
echo >&2
exit 1
}
ARGS=`getopt -n$0 -u -a --longoptions="fake,gdb,help:,nomousetouch" -o "fghm" -- "$@"`
[ $? -ne 0 ] && usage
eval set -- "$ARGS"
while [ $# -gt 0 ]
do
case "$1" in
-f|--fake) USE_MOCKS=true;;
-g|--gdb) GDB=true;;
-h|--help) usage;;
-m|--nomousetouch) MOUSE_TOUCH=false;;
--) shift;break;;
esac
shift
done
if $USE_MOCKS; then
export QML2_IMPORT_PATH=$QML2_IMPORT_PATH:$PWD/builddir/tests/mocks:$PWD/builddir/plugins:$PWD/builddir/modules
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/builddir/tests/mocks/LightDM/liblightdm:$PWD/builddir/tests/mocks/libusermetrics:$PWD/builddir/tests/mocks/QMenuModel
else
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/builddir/plugins/LightDM/liblightdm
fi
QML_PHONE_SHELL_ARGS="-windowgeometry=40gux68gu -devicename=mako"
if $MOUSE_TOUCH; then
QML_PHONE_SHELL_ARGS="$QML_PHONE_SHELL_ARGS -mousetouch"
fi
control_c()
{
/sbin/initctl stop unity8
exit $?
}
trap control_c INT
if $GDB; then
gdb -ex run --args $QML_PHONE_SHELL_PATH $QML_PHONE_SHELL_ARGS $@
else
status=`/sbin/initctl status unity8`
if [ "$status" != "unity8 stop/waiting" ]; then
echo "Unity8 is already running, please stop it first"
exit 1
fi
/sbin/initctl start unity8 BINARY="`readlink -f $QML_PHONE_SHELL_PATH` $QML_PHONE_SHELL_ARGS $@" XDG_DATA_DIRS=$XDG_DATA_DIRS QML2_IMPORT_PATH=$QML2_IMPORT_PATH LD_LIBRARY_PATH=$LD_LIBRARY_PATH
tailf -n 0 ~/.cache/upstart/unity8.log
fi
./plugins/ 0000755 0000156 0000165 00000000000 12677430772 012575 5 ustar jenkins jenkins ./plugins/AccountsService/ 0000755 0000156 0000165 00000000000 12677430772 015675 5 ustar jenkins jenkins ./plugins/AccountsService/AccountsServiceDBusAdaptor.cpp 0000644 0000156 0000165 00000014706 12677430772 023602 0 ustar jenkins jenkins /*
* Copyright (C) 2013-2016 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#include "AccountsServiceDBusAdaptor.h"
#include
#include
#include
#include
#include
AccountsServiceDBusAdaptor::AccountsServiceDBusAdaptor(QObject* parent)
: QObject(parent),
m_accountsManager(nullptr),
m_ignoreNextChanged(false)
{
QDBusConnection connection = QDBusConnection::SM_BUSNAME();
QDBusConnectionInterface *interface = connection.interface();
interface->startService(QStringLiteral("org.freedesktop.Accounts"));
m_accountsManager = new QDBusInterface(QStringLiteral("org.freedesktop.Accounts"),
QStringLiteral("/org/freedesktop/Accounts"),
QStringLiteral("org.freedesktop.Accounts"),
connection, this);
}
QDBusPendingReply AccountsServiceDBusAdaptor::getAllPropertiesAsync(const QString &user, const QString &interface)
{
QDBusInterface *iface = getUserInterface(user);
if (iface != nullptr && iface->isValid()) {
return iface->asyncCall(QStringLiteral("GetAll"), interface);
}
return QDBusPendingReply(QDBusMessage::createError(QDBusError::Other, QStringLiteral("Invalid Interface")));
}
QDBusPendingReply AccountsServiceDBusAdaptor::getUserPropertyAsync(const QString &user, const QString &interface, const QString &property)
{
QDBusInterface *iface = getUserInterface(user);
if (iface != nullptr && iface->isValid()) {
return iface->asyncCall(QStringLiteral("Get"), interface, property);
}
return QDBusPendingReply(QDBusMessage::createError(QDBusError::Other, QStringLiteral("Invalid Interface")));
}
QDBusPendingCall AccountsServiceDBusAdaptor::setUserPropertyAsync(const QString &user, const QString &interface, const QString &property, const QVariant &value)
{
QDBusInterface *iface = getUserInterface(user);
if (iface != nullptr && iface->isValid()) {
if (interface == QStringLiteral("org.freedesktop.Accounts.User")) {
// Standard AccountsService properties use special set methods.
// It will not let you use the usual DBus property setters.
QDBusInterface accountsIface(iface->service(),
iface->path(),
interface,
iface->connection());
return accountsIface.asyncCall(QStringLiteral("Set") + property, value);
} else {
// The value needs to be carefully wrapped
return iface->asyncCall(QStringLiteral("Set"), interface, property, QVariant::fromValue(QDBusVariant(value)));
}
}
return QDBusPendingCall::fromCompletedCall(QDBusMessage::createError(QDBusError::Other, QStringLiteral("Invalid Interface")));
}
void AccountsServiceDBusAdaptor::propertiesChangedSlot(const QString &interface, const QVariantMap &changed, const QStringList &invalid)
{
// Merge changed and invalidated together
QStringList combined;
combined << invalid;
combined << changed.keys();
combined.removeDuplicates();
Q_EMIT propertiesChanged(getUserForPath(message().path()), interface, combined);
// In case a non-builtin property changes, we're getting propertiesChanged *and* changed
// As the generic changed requires asking back over DBus, it's quite slow to process.
// We don't want to trigger that when we know it's not a built-in property change.
m_ignoreNextChanged = true;
}
void AccountsServiceDBusAdaptor::maybeChangedSlot()
{
if (!m_ignoreNextChanged) {
Q_EMIT maybeChanged(getUserForPath(message().path()));
}
m_ignoreNextChanged = false;
}
QString AccountsServiceDBusAdaptor::getUserForPath(const QString &path) const
{
QMap::const_iterator i;
for (i = m_users.constBegin(); i != m_users.constEnd(); ++i) {
if (i.value()->path() == path) {
return i.key();
}
}
return QString();
}
QDBusInterface *AccountsServiceDBusAdaptor::getUserInterface(const QString &user)
{
QDBusInterface *iface = m_users.value(user);
if (iface == nullptr && m_accountsManager->isValid()) {
QDBusReply answer = m_accountsManager->call(QStringLiteral("FindUserByName"), user);
if (answer.isValid()) {
const QString path = answer.value().path();
iface = new QDBusInterface(QStringLiteral("org.freedesktop.Accounts"),
path,
QStringLiteral("org.freedesktop.DBus.Properties"),
m_accountsManager->connection(), this);
// With its own pre-defined properties, AccountsService is oddly
// close-lipped. It won't send out proper DBus.Properties notices,
// but it does have one catch-all Changed() signal. So let's
// listen to that.
iface->connection().connect(
iface->service(),
path,
QStringLiteral("org.freedesktop.Accounts.User"),
QStringLiteral("Changed"),
this,
SLOT(maybeChangedSlot()));
// But custom properties do send out the right notifications, so
// let's still listen there.
iface->connection().connect(
iface->service(),
path,
QStringLiteral("org.freedesktop.DBus.Properties"),
QStringLiteral("PropertiesChanged"),
this,
SLOT(propertiesChangedSlot(QString, QVariantMap, QStringList)));
m_users.insert(user, iface);
} else {
qWarning() << "Couldn't get user interface" << answer.error().name() << answer.error().message();
}
}
return iface;
}
./plugins/AccountsService/AccountsService.qmltypes 0000644 0000156 0000165 00000003207 12677430772 022577 0 ustar jenkins jenkins import QtQuick.tooling 1.1
// This file describes the plugin-supplied types contained in the library.
// It is used for QML tooling purposes only.
//
// This file was auto-generated by:
// 'qmlplugindump -notrelocatable AccountsService 0.1 plugins'
Module {
Component {
name: "AccountsService"
prototype: "QObject"
exports: ["AccountsService/AccountsService 0.1"]
isCreatable: false
isSingleton: true
exportMetaObjectRevisions: [0]
Enum {
name: "PasswordDisplayHint"
values: {
"Keyboard": 0,
"Numeric": 1
}
}
Property { name: "user"; type: "string" }
Property { name: "demoEdges"; type: "bool" }
Property { name: "demoEdgesCompleted"; type: "QStringList"; isReadonly: true }
Property { name: "enableLauncherWhileLocked"; type: "bool"; isReadonly: true }
Property { name: "enableIndicatorsWhileLocked"; type: "bool"; isReadonly: true }
Property { name: "backgroundFile"; type: "string"; isReadonly: true }
Property { name: "statsWelcomeScreen"; type: "bool"; isReadonly: true }
Property { name: "passwordDisplayHint"; type: "PasswordDisplayHint"; isReadonly: true }
Property { name: "failedLogins"; type: "uint" }
Property { name: "hereEnabled"; type: "bool" }
Property { name: "hereLicensePath"; type: "string"; isReadonly: true }
Property { name: "hereLicensePathValid"; type: "bool"; isReadonly: true }
Method {
name: "markDemoEdgeCompleted"
Parameter { name: "edge"; type: "string" }
}
}
}
./plugins/AccountsService/plugin.h 0000644 0000156 0000165 00000002004 12677430772 017340 0 ustar jenkins jenkins /*
* Copyright (C) 2012,2013 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*
* Authors: Michael Terry
*/
#ifndef ACCOUNTSSERVICE_PLUGIN_H
#define ACCOUNTSSERVICE_PLUGIN_H
#include
#include
class AccountsServicePlugin : public QQmlExtensionPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
public:
void registerTypes(const char *uri) override;
};
#endif
./plugins/AccountsService/AccountsServiceDBusAdaptor.h 0000644 0000156 0000165 00000004022 12677430772 023235 0 ustar jenkins jenkins /*
* Copyright (C) 2013-2016 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#ifndef UNITY_ACCOUNTSSERVICEDBUSADAPTOR_H
#define UNITY_ACCOUNTSSERVICEDBUSADAPTOR_H
#include
#include
#include
#include
#include
#include
#include
class AccountsServiceDBusAdaptor: public QObject, public QDBusContext
{
Q_OBJECT
public:
explicit AccountsServiceDBusAdaptor(QObject *parent = 0);
~AccountsServiceDBusAdaptor() = default;
QDBusPendingReply getAllPropertiesAsync(const QString &user, const QString &interface);
QDBusPendingReply getUserPropertyAsync(const QString &user, const QString &interface, const QString &property);
QDBusPendingCall setUserPropertyAsync(const QString &user, const QString &interface, const QString &property, const QVariant &value);
Q_SIGNALS:
void propertiesChanged(const QString &user, const QString &interface, const QStringList &changed);
void maybeChanged(const QString &user); // Standard properties might have changed
private Q_SLOTS:
void propertiesChangedSlot(const QString &interface, const QVariantMap &changed, const QStringList &invalid);
void maybeChangedSlot();
private:
QDBusInterface *getUserInterface(const QString &user);
QString getUserForPath(const QString &path) const;
QDBusInterface *m_accountsManager;
QMap m_users;
bool m_ignoreNextChanged;
};
#endif
./plugins/AccountsService/plugin.cpp 0000644 0000156 0000165 00000002453 12677430772 017703 0 ustar jenkins jenkins /*
* Copyright (C) 2012,2013 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*
* Authors: Michael Terry
*/
#include "plugin.h"
#include "AccountsService.h"
#include
#include
static QObject *service_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
{
Q_UNUSED(engine)
Q_UNUSED(scriptEngine)
return new AccountsService();
}
void AccountsServicePlugin::registerTypes(const char *uri)
{
Q_ASSERT(uri == QLatin1String("AccountsService"));
qDBusRegisterMetaType>();
qRegisterMetaType("AccountsService::PasswordDisplayHint");
qmlRegisterSingletonType(uri, 0, 1, "AccountsService", service_provider);
}
./plugins/AccountsService/com.canonical.unity.AccountsService.xml 0000644 0000156 0000165 00000004114 12677430772 025371 0 ustar jenkins jenkins
./plugins/AccountsService/AccountsService.h 0000644 0000156 0000165 00000013422 12677430772 021150 0 ustar jenkins jenkins /*
* Copyright (C) 2013, 2015 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#ifndef UNITY_ACCOUNTSSERVICE_H
#define UNITY_ACCOUNTSSERVICE_H
#include
#include
#include
#include
#include
class AccountsServiceDBusAdaptor;
class QDBusInterface;
class AccountsService: public QObject
{
Q_OBJECT
Q_ENUMS(PasswordDisplayHint)
Q_PROPERTY (QString user
READ user
WRITE setUser
NOTIFY userChanged)
Q_PROPERTY (bool demoEdges
READ demoEdges
WRITE setDemoEdges
NOTIFY demoEdgesChanged)
Q_PROPERTY (QStringList demoEdgesCompleted
READ demoEdgesCompleted
NOTIFY demoEdgesCompletedChanged)
Q_PROPERTY (bool enableLauncherWhileLocked
READ enableLauncherWhileLocked
NOTIFY enableLauncherWhileLockedChanged)
Q_PROPERTY (bool enableIndicatorsWhileLocked
READ enableIndicatorsWhileLocked
NOTIFY enableIndicatorsWhileLockedChanged)
Q_PROPERTY (QString backgroundFile
READ backgroundFile
NOTIFY backgroundFileChanged)
Q_PROPERTY (bool statsWelcomeScreen
READ statsWelcomeScreen
NOTIFY statsWelcomeScreenChanged)
Q_PROPERTY (PasswordDisplayHint passwordDisplayHint
READ passwordDisplayHint
NOTIFY passwordDisplayHintChanged)
Q_PROPERTY (uint failedLogins
READ failedLogins
WRITE setFailedLogins
NOTIFY failedLoginsChanged)
Q_PROPERTY(bool hereEnabled
READ hereEnabled
WRITE setHereEnabled
NOTIFY hereEnabledChanged)
Q_PROPERTY(QString hereLicensePath
READ hereLicensePath
NOTIFY hereLicensePathChanged)
Q_PROPERTY(bool hereLicensePathValid // qml sees a null string as "", so we use proxy setting for that
READ hereLicensePathValid
NOTIFY hereLicensePathChanged)
Q_PROPERTY(QString realName READ realName WRITE setRealName NOTIFY realNameChanged)
Q_PROPERTY(QString email READ email WRITE setEmail NOTIFY emailChanged)
Q_PROPERTY(QStringList keymaps
READ keymaps
NOTIFY keymapsChanged)
public:
enum PasswordDisplayHint {
Keyboard,
Numeric,
};
explicit AccountsService(QObject *parent = 0, const QString & user = QString());
~AccountsService() = default;
QString user() const;
void setUser(const QString &user);
bool demoEdges() const;
void setDemoEdges(bool demoEdges);
QStringList demoEdgesCompleted() const;
Q_INVOKABLE void markDemoEdgeCompleted(const QString &edge);
bool enableLauncherWhileLocked() const;
bool enableIndicatorsWhileLocked() const;
QString backgroundFile() const;
bool statsWelcomeScreen() const;
PasswordDisplayHint passwordDisplayHint() const;
uint failedLogins() const;
void setFailedLogins(uint failedLogins);
bool hereEnabled() const;
void setHereEnabled(bool enabled);
QString hereLicensePath() const;
bool hereLicensePathValid() const;
QString realName() const;
void setRealName(const QString &realName);
QString email() const;
void setEmail(const QString &email);
QStringList keymaps() const;
Q_SIGNALS:
void userChanged();
void demoEdgesChanged();
void demoEdgesCompletedChanged();
void enableLauncherWhileLockedChanged();
void enableIndicatorsWhileLockedChanged();
void backgroundFileChanged();
void statsWelcomeScreenChanged();
void passwordDisplayHintChanged();
void failedLoginsChanged();
void hereEnabledChanged();
void hereLicensePathChanged();
void realNameChanged();
void emailChanged();
void keymapsChanged();
private Q_SLOTS:
void onPropertiesChanged(const QString &user, const QString &interface, const QStringList &changed);
void onMaybeChanged(const QString &user);
private:
typedef QVariant (*ProxyConverter)(const QVariant &);
void refresh(bool async);
void registerProperty(const QString &interface, const QString &property, const QString &signal);
void registerProxy(const QString &interface, const QString &property, QDBusInterface *iface, const QString &method, ProxyConverter converter = nullptr);
void updateAllProperties(const QString &interface, bool async);
void updateProperty(const QString &interface, const QString &property);
void updateCache(const QString &interface, const QString &property, const QVariant &value);
void setProperty(const QString &interface, const QString &property, const QVariant &value);
QVariant getProperty(const QString &interface, const QString &property) const;
void emitChangedForProperty(const QString &interface, const QString &property);
struct PropertyInfo {
QVariant value{};
QString signal{};
QDBusInterface *proxyInterface{};
QString proxyMethod{};
ProxyConverter proxyConverter{};
};
typedef QHash< QString, QHash > PropertyHash;
PropertyHash m_properties;
AccountsServiceDBusAdaptor *m_service;
QDBusInterface *m_unityInput;
QString m_user;
};
#endif
./plugins/AccountsService/qmldir 0000644 0000156 0000165 00000000124 12677430772 017105 0 ustar jenkins jenkins module AccountsService
plugin AccountsService-qml
typeinfo AccountsService.qmltypes
./plugins/AccountsService/CMakeLists.txt 0000644 0000156 0000165 00000001505 12677430772 020436 0 ustar jenkins jenkins add_definitions(-DSM_BUSNAME=systemBus)
add_library(AccountsService-qml MODULE
AccountsService.cpp
AccountsServiceDBusAdaptor.cpp
plugin.cpp
)
qt5_use_modules(AccountsService-qml DBus Qml)
add_unity8_plugin(AccountsService 0.1 AccountsService TARGETS AccountsService-qml)
set(DBUS_IFACE_DIR "${CMAKE_INSTALL_PREFIX}/share/dbus-1/interfaces")
set(ACCOUNTS_IFACE_DIR "${CMAKE_INSTALL_PREFIX}/share/accountsservice/interfaces")
install(FILES com.canonical.unity.AccountsService.xml
DESTINATION "${DBUS_IFACE_DIR}"
)
# Create accountsservice symlink for above dbus interface
install(CODE "
execute_process(COMMAND mkdir -p \"\$ENV{DESTDIR}${ACCOUNTS_IFACE_DIR}\")
execute_process(COMMAND ln -sf ../../dbus-1/interfaces/com.canonical.unity.AccountsService.xml \"\$ENV{DESTDIR}${ACCOUNTS_IFACE_DIR}\")
")
./plugins/AccountsService/AccountsService.cpp 0000644 0000156 0000165 00000041361 12677430772 021506 0 ustar jenkins jenkins /*
* Copyright (C) 2013, 2015 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#include "AccountsService.h"
#include "AccountsServiceDBusAdaptor.h"
#include
#include
#include
#include
#define IFACE_ACCOUNTS_USER QStringLiteral("org.freedesktop.Accounts.User")
#define IFACE_LOCATION_HERE QStringLiteral("com.ubuntu.location.providers.here.AccountsService")
#define IFACE_UBUNTU_INPUT QStringLiteral("com.ubuntu.AccountsService.Input")
#define IFACE_UBUNTU_SECURITY QStringLiteral("com.ubuntu.AccountsService.SecurityPrivacy")
#define IFACE_UBUNTU_SECURITY_OLD QStringLiteral("com.ubuntu.touch.AccountsService.SecurityPrivacy")
#define IFACE_UNITY QStringLiteral("com.canonical.unity.AccountsService")
#define IFACE_UNITY_PRIVATE QStringLiteral("com.canonical.unity.AccountsService.Private")
#define PROP_BACKGROUND_FILE QStringLiteral("BackgroundFile")
#define PROP_DEMO_EDGES QStringLiteral("demo-edges")
#define PROP_DEMO_EDGES_COMPLETED QStringLiteral("DemoEdgesCompleted")
#define PROP_EMAIL QStringLiteral("Email")
#define PROP_ENABLE_INDICATORS_WHILE_LOCKED QStringLiteral("EnableIndicatorsWhileLocked")
#define PROP_ENABLE_LAUNCHER_WHILE_LOCKED QStringLiteral("EnableLauncherWhileLocked")
#define PROP_FAILED_LOGINS QStringLiteral("FailedLogins")
#define PROP_INPUT_SOURCES QStringLiteral("InputSources")
#define PROP_LICENSE_ACCEPTED QStringLiteral("LicenseAccepted")
#define PROP_LICENSE_BASE_PATH QStringLiteral("LicenseBasePath")
#define PROP_MOUSE_CURSOR_SPEED QStringLiteral("MouseCursorSpeed")
#define PROP_MOUSE_DOUBLE_CLICK_SPEED QStringLiteral("MouseDoubleClickSpeed")
#define PROP_MOUSE_PRIMARY_BUTTON QStringLiteral("MousePrimaryButton")
#define PROP_MOUSE_SCROLL_SPEED QStringLiteral("MouseScrollSpeed")
#define PROP_PASSWORD_DISPLAY_HINT QStringLiteral("PasswordDisplayHint")
#define PROP_REAL_NAME QStringLiteral("RealName")
#define PROP_STATS_WELCOME_SCREEN QStringLiteral("StatsWelcomeScreen")
#define PROP_TOUCHPAD_CURSOR_SPEED QStringLiteral("TouchpadCursorSpeed")
#define PROP_TOUCHPAD_DISABLE_WHILE_TYPING QStringLiteral("TouchpadDisableWhileTyping")
#define PROP_TOUCHPAD_DISABLE_WITH_MOUSE QStringLiteral("TouchpadDisableWithMouse")
#define PROP_TOUCHPAD_DOUBLE_CLICK_SPEED QStringLiteral("TouchpadDoubleClickSpeed")
#define PROP_TOUCHPAD_PRIMARY_BUTTON QStringLiteral("TouchpadPrimaryButton")
#define PROP_TOUCHPAD_SCROLL_SPEED QStringLiteral("TouchpadScrollSpeed")
#define PROP_TOUCHPAD_TAP_TO_CLICK QStringLiteral("TouchpadTapToClick")
#define PROP_TOUCHPAD_TWO_FINGER_SCROLL QStringLiteral("TouchpadTwoFingerScroll")
using StringMap = QMap;
using StringMapList = QList;
Q_DECLARE_METATYPE(StringMapList)
QVariant primaryButtonConverter(const QVariant &value)
{
QString stringValue = value.toString();
if (stringValue == "left") {
return QVariant::fromValue(0);
} else if (stringValue == "right") {
return QVariant::fromValue(1); // Mir is less clear on this -- any non-zero value is the same
} else {
return QVariant::fromValue(0); // default to left
}
}
AccountsService::AccountsService(QObject* parent, const QString &user)
: QObject(parent)
, m_service(new AccountsServiceDBusAdaptor(this))
{
m_unityInput = new QDBusInterface(QStringLiteral("com.canonical.Unity.Input"),
QStringLiteral("/com/canonical/Unity/Input"),
QStringLiteral("com.canonical.Unity.Input"),
QDBusConnection::SM_BUSNAME(), this);
connect(m_service, &AccountsServiceDBusAdaptor::propertiesChanged, this, &AccountsService::onPropertiesChanged);
connect(m_service, &AccountsServiceDBusAdaptor::maybeChanged, this, &AccountsService::onMaybeChanged);
registerProperty(IFACE_ACCOUNTS_USER, PROP_BACKGROUND_FILE, QStringLiteral("backgroundFileChanged"));
registerProperty(IFACE_ACCOUNTS_USER, PROP_EMAIL, QStringLiteral("emailChanged"));
registerProperty(IFACE_ACCOUNTS_USER, PROP_REAL_NAME, QStringLiteral("realNameChanged"));
registerProperty(IFACE_ACCOUNTS_USER, PROP_INPUT_SOURCES, QStringLiteral("keymapsChanged"));
registerProperty(IFACE_LOCATION_HERE, PROP_LICENSE_ACCEPTED, QStringLiteral("hereEnabledChanged"));
registerProperty(IFACE_LOCATION_HERE, PROP_LICENSE_BASE_PATH, QStringLiteral("hereLicensePathChanged"));
registerProperty(IFACE_UBUNTU_SECURITY, PROP_ENABLE_LAUNCHER_WHILE_LOCKED, QStringLiteral("enableLauncherWhileLockedChanged"));
registerProperty(IFACE_UBUNTU_SECURITY, PROP_ENABLE_INDICATORS_WHILE_LOCKED, QStringLiteral("enableIndicatorsWhileLockedChanged"));
registerProperty(IFACE_UBUNTU_SECURITY, PROP_PASSWORD_DISPLAY_HINT, QStringLiteral("passwordDisplayHintChanged"));
registerProperty(IFACE_UBUNTU_SECURITY_OLD, PROP_STATS_WELCOME_SCREEN, QStringLiteral("statsWelcomeScreenChanged"));
registerProperty(IFACE_UNITY, PROP_DEMO_EDGES, QStringLiteral("demoEdgesChanged"));
registerProperty(IFACE_UNITY, PROP_DEMO_EDGES_COMPLETED, QStringLiteral("demoEdgesCompletedChanged"));
registerProperty(IFACE_UNITY_PRIVATE, PROP_FAILED_LOGINS, QStringLiteral("failedLoginsChanged"));
registerProxy(IFACE_UBUNTU_INPUT, PROP_MOUSE_CURSOR_SPEED,
m_unityInput, QStringLiteral("setMouseCursorSpeed"));
registerProxy(IFACE_UBUNTU_INPUT, PROP_MOUSE_DOUBLE_CLICK_SPEED,
m_unityInput, QStringLiteral("setMouseDoubleClickSpeed"));
registerProxy(IFACE_UBUNTU_INPUT, PROP_MOUSE_PRIMARY_BUTTON,
m_unityInput, QStringLiteral("setMousePrimaryButton"),
primaryButtonConverter);
registerProxy(IFACE_UBUNTU_INPUT, PROP_MOUSE_SCROLL_SPEED,
m_unityInput, QStringLiteral("setMouseScrollSpeed"));
registerProxy(IFACE_UBUNTU_INPUT, PROP_TOUCHPAD_CURSOR_SPEED,
m_unityInput, QStringLiteral("setTouchpadCursorSpeed"));
registerProxy(IFACE_UBUNTU_INPUT, PROP_TOUCHPAD_SCROLL_SPEED,
m_unityInput, QStringLiteral("setTouchpadScrollSpeed"));
registerProxy(IFACE_UBUNTU_INPUT, PROP_TOUCHPAD_DISABLE_WHILE_TYPING,
m_unityInput, QStringLiteral("setTouchpadDisableWhileTyping"));
registerProxy(IFACE_UBUNTU_INPUT, PROP_TOUCHPAD_DISABLE_WITH_MOUSE,
m_unityInput, QStringLiteral("setTouchpadDisableWithMouse"));
registerProxy(IFACE_UBUNTU_INPUT, PROP_TOUCHPAD_DOUBLE_CLICK_SPEED,
m_unityInput, QStringLiteral("setTouchpadDoubleClickSpeed"));
registerProxy(IFACE_UBUNTU_INPUT, PROP_TOUCHPAD_PRIMARY_BUTTON,
m_unityInput, QStringLiteral("setTouchpadPrimaryButton"),
primaryButtonConverter);
registerProxy(IFACE_UBUNTU_INPUT, PROP_TOUCHPAD_TAP_TO_CLICK,
m_unityInput, QStringLiteral("setTouchpadTapToClick"));
registerProxy(IFACE_UBUNTU_INPUT, PROP_TOUCHPAD_TWO_FINGER_SCROLL,
m_unityInput, QStringLiteral("setTouchpadTwoFingerScroll"));
setUser(!user.isEmpty() ? user : QString::fromUtf8(qgetenv("USER")));
}
QString AccountsService::user() const
{
return m_user;
}
void AccountsService::setUser(const QString &user)
{
if (user.isEmpty() || m_user == user)
return;
bool wasEmpty = m_user.isEmpty();
m_user = user;
Q_EMIT userChanged();
// Do the first update synchronously, as a cheap way to block rendering
// until we have the right values on bootup.
refresh(!wasEmpty);
}
bool AccountsService::demoEdges() const
{
auto value = getProperty(IFACE_UNITY, PROP_DEMO_EDGES);
return value.toBool();
}
void AccountsService::setDemoEdges(bool demoEdges)
{
setProperty(IFACE_UNITY, PROP_DEMO_EDGES, demoEdges);
}
QStringList AccountsService::demoEdgesCompleted() const
{
auto value = getProperty(IFACE_UNITY, PROP_DEMO_EDGES_COMPLETED);
return value.toStringList();
}
void AccountsService::markDemoEdgeCompleted(const QString &edge)
{
auto currentList = demoEdgesCompleted();
if (!currentList.contains(edge)) {
setProperty(IFACE_UNITY, PROP_DEMO_EDGES_COMPLETED, currentList << edge);
}
}
bool AccountsService::enableLauncherWhileLocked() const
{
auto value = getProperty(IFACE_UBUNTU_SECURITY, PROP_ENABLE_LAUNCHER_WHILE_LOCKED);
return value.toBool();
}
bool AccountsService::enableIndicatorsWhileLocked() const
{
auto value = getProperty(IFACE_UBUNTU_SECURITY, PROP_ENABLE_INDICATORS_WHILE_LOCKED);
return value.toBool();
}
QString AccountsService::backgroundFile() const
{
auto value = getProperty(IFACE_ACCOUNTS_USER, PROP_BACKGROUND_FILE);
return value.toString();
}
bool AccountsService::statsWelcomeScreen() const
{
auto value = getProperty(IFACE_UBUNTU_SECURITY_OLD, PROP_STATS_WELCOME_SCREEN);
return value.toBool();
}
AccountsService::PasswordDisplayHint AccountsService::passwordDisplayHint() const
{
auto value = getProperty(IFACE_UBUNTU_SECURITY, PROP_PASSWORD_DISPLAY_HINT);
return (PasswordDisplayHint)value.toInt();
}
bool AccountsService::hereEnabled() const
{
auto value = getProperty(IFACE_LOCATION_HERE, PROP_LICENSE_ACCEPTED);
return value.toBool();
}
void AccountsService::setHereEnabled(bool enabled)
{
setProperty(IFACE_LOCATION_HERE, PROP_LICENSE_ACCEPTED, enabled);
}
QString AccountsService::hereLicensePath() const
{
auto value = getProperty(IFACE_LOCATION_HERE, PROP_LICENSE_BASE_PATH);
QString hereLicensePath = value.toString();
if (hereLicensePath.isEmpty() || !QFile::exists(hereLicensePath))
hereLicensePath = QStringLiteral("");
return hereLicensePath;
}
bool AccountsService::hereLicensePathValid() const
{
auto value = getProperty(IFACE_LOCATION_HERE, PROP_LICENSE_BASE_PATH);
return !value.toString().isNull();
}
QString AccountsService::realName() const
{
auto value = getProperty(IFACE_ACCOUNTS_USER, PROP_REAL_NAME);
return value.toString();
}
void AccountsService::setRealName(const QString &realName)
{
setProperty(IFACE_ACCOUNTS_USER, PROP_REAL_NAME, realName);
}
QString AccountsService::email() const
{
auto value = getProperty(IFACE_ACCOUNTS_USER, PROP_EMAIL);
return value.toString();
}
void AccountsService::setEmail(const QString &email)
{
setProperty(IFACE_ACCOUNTS_USER, PROP_EMAIL, email);
}
QStringList AccountsService::keymaps() const
{
auto value = getProperty(IFACE_ACCOUNTS_USER, PROP_INPUT_SOURCES);
QDBusArgument arg = value.value();
StringMapList maps = qdbus_cast(arg);
QStringList simplifiedMaps;
Q_FOREACH(const StringMap &map, maps) {
Q_FOREACH(const QString &entry, map) {
simplifiedMaps.append(entry);
}
}
if (!simplifiedMaps.isEmpty()) {
return simplifiedMaps;
}
return {QStringLiteral("us")};
}
uint AccountsService::failedLogins() const
{
return getProperty(IFACE_UNITY_PRIVATE, PROP_FAILED_LOGINS).toUInt();
}
void AccountsService::setFailedLogins(uint failedLogins)
{
setProperty(IFACE_UNITY_PRIVATE, PROP_FAILED_LOGINS, failedLogins);
}
// ====================================================
// Everything below this line is generic helper methods
// ====================================================
void AccountsService::emitChangedForProperty(const QString &interface, const QString &property)
{
QString signalName = m_properties[interface][property].signal;
QMetaObject::invokeMethod(this, signalName.toUtf8().data());
}
QVariant AccountsService::getProperty(const QString &interface, const QString &property) const
{
return m_properties[interface][property].value;
}
void AccountsService::setProperty(const QString &interface, const QString &property, const QVariant &value)
{
if (m_properties[interface][property].value != value) {
m_properties[interface][property].value = value;
m_service->setUserPropertyAsync(m_user, interface, property, value);
emitChangedForProperty(interface, property);
}
}
void AccountsService::updateCache(const QString &interface, const QString &property, const QVariant &value)
{
PropertyInfo &info = m_properties[interface][property];
if (info.proxyInterface) {
QVariant finalValue;
if (info.proxyConverter) {
finalValue = info.proxyConverter(value);
} else {
finalValue = value;
}
info.proxyInterface->asyncCall(info.proxyMethod, finalValue);
return; // don't bother saving a copy
}
if (info.value != value) {
info.value = value;
emitChangedForProperty(interface, property);
}
}
void AccountsService::updateProperty(const QString &interface, const QString &property)
{
QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user,
interface,
property);
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
connect(watcher, &QDBusPendingCallWatcher::finished,
this, [this, interface, property](QDBusPendingCallWatcher* watcher) {
QDBusPendingReply reply = *watcher;
watcher->deleteLater();
if (reply.isError()) {
qWarning() << "Failed to get '" << property << "' property:" << reply.error().message();
return;
}
updateCache(interface, property, reply.value());
});
}
void AccountsService::updateAllProperties(const QString &interface, bool async)
{
QDBusPendingCall pendingReply = m_service->getAllPropertiesAsync(m_user,
interface);
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
connect(watcher, &QDBusPendingCallWatcher::finished,
this, [this, interface](QDBusPendingCallWatcher* watcher) {
QDBusPendingReply< QHash > reply = *watcher;
watcher->deleteLater();
if (reply.isError()) {
qWarning() << "Failed to get all properties for" << interface << ":" << reply.error().message();
return;
}
auto valueHash = reply.value();
auto i = valueHash.constBegin();
while (i != valueHash.constEnd()) {
updateCache(interface, i.key(), i.value());
++i;
}
});
if (!async) {
watcher->waitForFinished();
}
}
void AccountsService::registerProxy(const QString &interface, const QString &property, QDBusInterface *iface, const QString &method, ProxyConverter converter)
{
registerProperty(interface, property, nullptr);
m_properties[interface][property].proxyInterface = iface;
m_properties[interface][property].proxyMethod = method;
m_properties[interface][property].proxyConverter = converter;
}
void AccountsService::registerProperty(const QString &interface, const QString &property, const QString &signal)
{
m_properties[interface][property] = PropertyInfo();
m_properties[interface][property].signal = signal;
}
void AccountsService::onPropertiesChanged(const QString &user, const QString &interface, const QStringList &changed)
{
if (m_user != user) {
return;
}
auto propHash = m_properties.value(interface);
auto i = propHash.constBegin();
while (i != propHash.constEnd()) {
if (changed.contains(i.key())) {
updateProperty(interface, i.key());
}
++i;
}
}
void AccountsService::onMaybeChanged(const QString &user)
{
if (m_user != user) {
return;
}
// Any of the standard properties might have changed!
auto propHash = m_properties.value(IFACE_ACCOUNTS_USER);
auto i = propHash.constBegin();
while (i != propHash.constEnd()) {
updateProperty(IFACE_ACCOUNTS_USER, i.key());
++i;
}
}
void AccountsService::refresh(bool async)
{
auto i = m_properties.constBegin();
while (i != m_properties.constEnd()) {
updateAllProperties(i.key(), async);
++i;
}
}
./plugins/SessionBroadcast/ 0000755 0000156 0000165 00000000000 12677430772 016043 5 ustar jenkins jenkins ./plugins/SessionBroadcast/plugin.h 0000644 0000156 0000165 00000001770 12677430772 017517 0 ustar jenkins jenkins /*
* Copyright (C) 2013 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*
* Authors: Michael Terry
*/
#ifndef UNITY_SESSIONBROADCAST_PLUGIN_H
#define UNITY_SESSIONBROADCAST_PLUGIN_H
#include
class SessionBroadcastPlugin : public QQmlExtensionPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
public:
void registerTypes(const char *uri) override;
};
#endif
./plugins/SessionBroadcast/SessionBroadcast.cpp 0000644 0000156 0000165 00000002635 12677430772 022023 0 ustar jenkins jenkins /*
* Copyright (C) 2013 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*
* Author: Michael Terry
*/
#include "SessionBroadcast.h"
#include
SessionBroadcast::SessionBroadcast(QObject* parent)
: QObject(parent)
{
auto connection = QDBusConnection::SM_BUSNAME();
connection.connect(QStringLiteral("com.canonical.Unity.Greeter.Broadcast"),
QStringLiteral("/com/canonical/Unity/Greeter/Broadcast"),
QStringLiteral("com.canonical.Unity.Greeter.Broadcast"),
QStringLiteral("ShowHome"),
this,
SLOT(onShowHome(const QString &)));
}
void SessionBroadcast::onShowHome(const QString &username)
{
// Only listen to requests meant for us
if (username == qgetenv("USER")) {
Q_EMIT showHome();
}
}
./plugins/SessionBroadcast/SessionBroadcast.qmltypes 0000644 0000156 0000165 00000001026 12677430772 023110 0 ustar jenkins jenkins import QtQuick.tooling 1.1
// This file describes the plugin-supplied types contained in the library.
// It is used for QML tooling purposes only.
//
// This file was auto-generated by:
// 'qmlplugindump -notrelocatable SessionBroadcast 0.1 plugins'
Module {
Component {
name: "SessionBroadcast"
prototype: "QObject"
exports: ["SessionBroadcast/SessionBroadcast 0.1"]
isCreatable: false
isSingleton: true
exportMetaObjectRevisions: [0]
Signal { name: "showHome" }
}
}
./plugins/SessionBroadcast/plugin.cpp 0000644 0000156 0000165 00000002201 12677430772 020040 0 ustar jenkins jenkins /*
* Copyright (C) 2013 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*
* Authors: Michael Terry
*/
#include "plugin.h"
#include "SessionBroadcast.h"
#include
static QObject *broadcast_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
{
Q_UNUSED(engine)
Q_UNUSED(scriptEngine)
return new SessionBroadcast();
}
void SessionBroadcastPlugin::registerTypes(const char *uri)
{
Q_ASSERT(uri == QLatin1String("SessionBroadcast"));
qmlRegisterSingletonType(uri, 0, 1, "SessionBroadcast", broadcast_provider);
}
./plugins/SessionBroadcast/SessionBroadcast.h 0000644 0000156 0000165 00000002022 12677430772 021456 0 ustar jenkins jenkins /*
* Copyright (C) 2013 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*
* Authors: Michael Terry
*/
#ifndef UNITY_SESSIONBROADCAST_H
#define UNITY_SESSIONBROADCAST_H
#include
#include
class QDBusInterface;
class SessionBroadcast: public QObject
{
Q_OBJECT
public:
explicit SessionBroadcast(QObject *parent = 0);
Q_SIGNALS:
void showHome();
private Q_SLOTS:
void onShowHome(const QString &username);
};
#endif
./plugins/SessionBroadcast/qmldir 0000644 0000156 0000165 00000000127 12677430772 017256 0 ustar jenkins jenkins module SessionBroadcast
plugin SessionBroadcast-qml
typeinfo SessionBroadcast.qmltypes
./plugins/SessionBroadcast/CMakeLists.txt 0000644 0000156 0000165 00000000406 12677430772 020603 0 ustar jenkins jenkins add_definitions(-DSM_BUSNAME=systemBus)
add_library(SessionBroadcast-qml MODULE
SessionBroadcast.cpp
plugin.cpp
)
qt5_use_modules(SessionBroadcast-qml DBus Qml)
add_unity8_plugin(SessionBroadcast 0.1 SessionBroadcast TARGETS SessionBroadcast-qml)
./plugins/Utils/ 0000755 0000156 0000165 00000000000 12677430773 013676 5 ustar jenkins jenkins ./plugins/Utils/windowstatestorage.h 0000644 0000156 0000165 00000003424 12677430772 020006 0 ustar jenkins jenkins /*
* Copyright 2015 Canonical Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see .
*/
#include
#include
#include
#include
class WindowStateStorage: public QObject
{
Q_OBJECT
Q_ENUMS(WindowState)
public:
enum WindowState {
WindowStateNormal,
WindowStateMaximized
};
WindowStateStorage(QObject *parent = 0);
virtual ~WindowStateStorage();
Q_INVOKABLE void saveState(const QString &windowId, WindowState state);
Q_INVOKABLE WindowState getState(const QString &windowId, WindowState defaultValue) const;
Q_INVOKABLE void saveGeometry(const QString &windowId, const QRect rect);
Q_INVOKABLE QRect getGeometry(const QString &windowId, const QRect defaultValue) const;
Q_INVOKABLE void saveStage(const QString &appId, int stage);
Q_INVOKABLE int getStage(const QString &appId) const;
private:
void initdb();
void saveValue(const QString &queryString);
QSqlQuery getValue(const QString &queryString) const;
static void executeAsyncQuery(const QString &queryString);
static QMutex s_mutex;
// NB: This is accessed from threads. Make sure to mutex it.
QSqlDatabase m_db;
QList< QFuture > m_asyncQueries;
};
./plugins/Utils/unitysortfilterproxymodelqml.cpp 0000644 0000156 0000165 00000010635 12677430772 022531 0 ustar jenkins jenkins /*
* Copyright (C) 2012 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
// self
#include "unitysortfilterproxymodelqml.h"
// Qt
#include
UnitySortFilterProxyModelQML::UnitySortFilterProxyModelQML(QObject *parent)
: QSortFilterProxyModel(parent)
, m_invertMatch(false)
{
connect(this, &UnitySortFilterProxyModelQML::modelReset, this, &UnitySortFilterProxyModelQML::countChanged);
connect(this, &UnitySortFilterProxyModelQML::rowsInserted, this, &UnitySortFilterProxyModelQML::countChanged);
connect(this, &UnitySortFilterProxyModelQML::rowsRemoved, this, &UnitySortFilterProxyModelQML::countChanged);
}
/*
* Enter row index of filtered/sorted model, returns row index of source model
*/
int UnitySortFilterProxyModelQML::mapRowToSource(int row)
{
if (sourceModel() == nullptr)
return -1;
return QSortFilterProxyModel::mapToSource(index(row, 0)).row();
}
QHash UnitySortFilterProxyModelQML::roleNames() const
{
return sourceModel() ? sourceModel()->roleNames() : QHash();
}
void
UnitySortFilterProxyModelQML::setModel(QAbstractItemModel *itemModel)
{
if (itemModel == nullptr) {
return;
}
if (itemModel != sourceModel()) {
if (sourceModel() != nullptr) {
sourceModel()->disconnect(this);
}
setSourceModel(itemModel);
connect(itemModel, &QAbstractItemModel::modelReset, this, &UnitySortFilterProxyModelQML::totalCountChanged);
connect(itemModel, &QAbstractItemModel::rowsInserted, this, &UnitySortFilterProxyModelQML::totalCountChanged);
connect(itemModel, &QAbstractItemModel::rowsRemoved, this, &UnitySortFilterProxyModelQML::totalCountChanged);
Q_EMIT totalCountChanged();
Q_EMIT modelChanged();
}
}
QVariantMap
UnitySortFilterProxyModelQML::get(int row)
{
QVariantMap res;
const QHash roles = roleNames();
auto it = roles.begin();
for ( ; it != roles.end(); ++it) {
res[*it] = data(row, it.key());
}
return res;
}
QVariant
UnitySortFilterProxyModelQML::data(int row, int role)
{
if (sourceModel() == nullptr) {
return QVariant();
}
return index(row, 0).data(role);
}
int
UnitySortFilterProxyModelQML::totalCount() const
{
if (sourceModel() != nullptr) {
return sourceModel()->rowCount();
} else {
return 0;
}
}
int
UnitySortFilterProxyModelQML::count()
{
return rowCount();
}
bool
UnitySortFilterProxyModelQML::invertMatch() const
{
return m_invertMatch;
}
void
UnitySortFilterProxyModelQML::setInvertMatch(bool invertMatch)
{
if (invertMatch != m_invertMatch) {
m_invertMatch = invertMatch;
Q_EMIT invertMatchChanged(invertMatch);
invalidateFilter();
}
}
bool
UnitySortFilterProxyModelQML::filterAcceptsRow(int sourceRow,
const QModelIndex &sourceParent) const
{
// If there's no regexp set, always accept all rows indepenently of the invertMatch setting
if (filterRegExp().isEmpty()) {
return true;
}
bool result = QSortFilterProxyModel::filterAcceptsRow(sourceRow, sourceParent);
return (m_invertMatch) ? !result : result;
}
int
UnitySortFilterProxyModelQML::findFirst(int role, const QVariant& value) const
{
QModelIndexList matches = match(index(0, 0), role, value, 1, Qt::MatchExactly);
if (!matches.isEmpty()) {
return matches.first().row();
} else {
return -1;
}
}
int
UnitySortFilterProxyModelQML::mapFromSource(int row)
{
if (sourceModel() != nullptr) {
return QSortFilterProxyModel::mapFromSource(sourceModel()->index(row, 0)).row();
} else {
return -1;
}
}
int
UnitySortFilterProxyModelQML::mapToSource(int row)
{
if (sourceModel() != nullptr) {
return QSortFilterProxyModel::mapToSource(index(row, 0)).row();
} else {
return -1;
}
}
./plugins/Utils/inputeventgenerator.h 0000644 0000156 0000165 00000002633 12677430772 020162 0 ustar jenkins jenkins /*
* Copyright (C) 2016 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#ifndef INPUTEVENTGENERATOR_H
#define INPUTEVENTGENERATOR_H
#include
#include
#include
/**
* \brief This class allows injecting Key events into the scene it lives in.
*/
class InputEventGenerator : public QQuickItem
{
Q_OBJECT
public:
InputEventGenerator(QQuickItem *parent = 0);
/**
* Generate and post and event to the scene. The key event will be sent to the scene the Generator
* lives in and it will be dispatched through the regular event/focus queue.
*/
Q_INVOKABLE void generateKeyEvent(Qt::Key key, bool pressed, Qt::KeyboardModifiers modifiers = Qt::NoModifier, quint64 timestamp = QDateTime::currentMSecsSinceEpoch(), quint32 nativeScanCode = 0, const QString &text = QString());
};
#endif // INPUTEVENTGENERATOR_H
./plugins/Utils/unitymenumodelpaths.h 0000644 0000156 0000165 00000005160 12677430772 020166 0 ustar jenkins jenkins /*
* Copyright (C) 2013 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*
* Author: Nick Dedekind
*/
#ifndef UNITY_MENU_MODEL_PATHS_H
#define UNITY_MENU_MODEL_PATHS_H
#include
class UnityMenuModelPaths : public QObject
{
Q_OBJECT
Q_PROPERTY(QVariant source READ source WRITE setSource NOTIFY sourceChanged)
Q_PROPERTY(QByteArray busName READ busName NOTIFY busNameChanged)
Q_PROPERTY(QVariantMap actions READ actions NOTIFY actionsChanged)
Q_PROPERTY(QByteArray menuObjectPath READ menuObjectPath NOTIFY menuObjectPathChanged)
Q_PROPERTY(QByteArray busNameHint READ busNameHint WRITE setBusNameHint NOTIFY busNameHintChanged)
Q_PROPERTY(QByteArray actionsHint READ actionsHint WRITE setActionsHint NOTIFY actionsHintChanged)
Q_PROPERTY(QByteArray menuObjectPathHint READ menuObjectPathHint WRITE setMenuObjectPathHint NOTIFY menuObjectPathHintChanged)
public:
explicit UnityMenuModelPaths(QObject *parent = 0);
QVariant source() const;
void setSource(const QVariant& data);
QByteArray busName() const;
QVariantMap actions() const;
QByteArray menuObjectPath() const;
QByteArray busNameHint() const;
QByteArray actionsHint() const;
QByteArray menuObjectPathHint() const;
Q_SIGNALS:
void sourceChanged();
void busNameChanged();
void actionsChanged();
void menuObjectPathChanged();
void busNameHintChanged();
void actionsHintChanged();
void menuObjectPathHintChanged();
private:
void setBusName(const QByteArray &name);
void setActions(const QVariantMap& actions);
void setMenuObjectPath(const QByteArray &path);
void setBusNameHint(const QByteArray& nameHint);
void setActionsHint(const QByteArray &actionsHint);
void setMenuObjectPathHint(const QByteArray &pathHint);
void updateData();
QVariant m_sourceData;
QByteArray m_busName;
QVariantMap m_actions;
QByteArray m_menuObjectPath;
QByteArray m_busNameHint;
QByteArray m_actionsHint;
QByteArray m_menuObjectPathHint;
};
#endif // UNITY_MENU_MODEL_PATHS_H
./plugins/Utils/deviceconfigparser.h 0000644 0000156 0000165 00000004567 12677430772 017724 0 ustar jenkins jenkins /*
* Copyright 2016 Canonical Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see .
*/
#ifndef DEVICECONFIGPARSER_H
#define DEVICECONFIGPARSER_H
#include
#include
class DeviceConfigParser: public QObject
{
Q_OBJECT
Q_PROPERTY(QString name READ name WRITE setName NOTIFY changed)
Q_PROPERTY(Qt::ScreenOrientation primaryOrientation READ primaryOrientation NOTIFY changed)
Q_PROPERTY(Qt::ScreenOrientations supportedOrientations READ supportedOrientations NOTIFY changed)
Q_PROPERTY(Qt::ScreenOrientation landscapeOrientation READ landscapeOrientation NOTIFY changed)
Q_PROPERTY(Qt::ScreenOrientation invertedLandscapeOrientation READ invertedLandscapeOrientation NOTIFY changed)
Q_PROPERTY(Qt::ScreenOrientation portraitOrientation READ portraitOrientation NOTIFY changed)
Q_PROPERTY(Qt::ScreenOrientation invertedPortraitOrientation READ invertedPortraitOrientation NOTIFY changed)
Q_PROPERTY(QString category READ category NOTIFY changed)
public:
DeviceConfigParser(QObject *parent = nullptr);
QString name() const;
void setName(const QString &name);
Qt::ScreenOrientation primaryOrientation() const;
Qt::ScreenOrientations supportedOrientations() const;
Qt::ScreenOrientation landscapeOrientation() const;
Qt::ScreenOrientation invertedLandscapeOrientation() const;
Qt::ScreenOrientation portraitOrientation() const;
Qt::ScreenOrientation invertedPortraitOrientation() const;
QString category() const;
Q_SIGNALS:
void changed();
private:
QString m_name;
QSettings *m_config;
QStringList readOrientationsFromConfig(const QString &key) const;
QString readOrientationFromConfig(const QString &key) const;
Qt::ScreenOrientation stringToOrientation(const QString &orientationString, Qt::ScreenOrientation defaultValue) const;
};
#endif
./plugins/Utils/Style.js 0000644 0000156 0000165 00000002351 12677430772 015334 0 ustar jenkins jenkins /*
* Copyright (C) 2014 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
.pragma library
/*! \brief Calculate average luminance of the passed colors
\note If not fully opaque, luminance is dependant on blending.
*/
function luminance() {
var sum = 0;
// TODO this was originally
// for (var k in arguments) {
// but for some unkown reason was causing crashes in testDash/testDashContent
// investigate when we have some time
for (var k = 0; k < arguments.length; ++k) {
// only way to convert string to color
var c = Qt.lighter(arguments[k], 1.0);
sum += 0.2126 * c.r + 0.7152 * c.g + 0.0722 * c.b;
}
return sum / arguments.length;
}
./plugins/Utils/Timer.cpp 0000644 0000156 0000165 00000002416 12677430772 015464 0 ustar jenkins jenkins /*
* Copyright (C) 2015 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#include "Timer.h"
namespace UnityUtil {
Timer::Timer(QObject *parent) : AbstractTimer(parent)
{
m_timer.setSingleShot(true);
connect(&m_timer, &QTimer::timeout, this, &AbstractTimer::timeout);
}
int Timer::interval() const
{
return m_timer.interval();
}
void Timer::setInterval(int msecs)
{
m_timer.setInterval(msecs);
}
void Timer::start()
{
m_timer.start();
AbstractTimer::start();
}
void Timer::stop()
{
m_timer.stop();
AbstractTimer::stop();
}
bool Timer::isSingleShot() const
{
return m_timer.isSingleShot();
}
void Timer::setSingleShot(bool value)
{
m_timer.setSingleShot(value);
}
} // namespace UnityUtil
./plugins/Utils/qvariantlistmodel.cpp 0000644 0000156 0000165 00000017564 12677430772 020160 0 ustar jenkins jenkins /****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
/*
A simple model that uses a QVariantList as its data source.
*/
// LightDM currently is Qt4 compatible, and so doesn't define setRoleNames.
// To use the same method of setting role name that it does, we
// set our compatibility to Qt4 here too.
#define QT_DISABLE_DEPRECATED_BEFORE QT_VERSION_CHECK(4, 0, 0)
#include "qvariantlistmodel.h"
#include
/*!
\class QVariantListModel
\brief The QVariantListModel class provides a model that supplies variants to views.
QVariantListModel is an editable model that can be used for simple
cases where you need to display a number of variants in a view.
The model provides all the standard functions of an editable
model, representing the data in the variant list as a model with
one column and a number of rows equal to the number of items in
the list.
Model indexes corresponding to items are obtained with the
\l{QAbstractListModel::index()}{index()} function. Item data is
read with the data() function and written with setData().
The number of rows (and number of items in the variant list)
can be found with the rowCount() function.
The model can be constructed with an existing variant list, or
variants can be set later with the setVariantList() convenience
function. Variants can also be inserted in the usual way with the
insertRows() function, and removed with removeRows(). The contents
of the variant list can be retrieved with the variantList()
convenience function.
\sa QAbstractListModel, QAbstractItemModel, {Model Classes}
*/
/*!
Constructs a variant list model with the given \a parent.
*/
QVariantListModel::QVariantListModel(QObject *parent) :
QAbstractListModel(parent)
{
QHash roles(roleNames());
roles[Qt::DisplayRole] = "modelData";
setRoleNames(roles);
}
/*!
Constructs a variant list model containing the specified \a list
with the given \a parent.
*/
QVariantListModel::QVariantListModel(const QVariantList &list, QObject *parent) :
QAbstractListModel(parent), lst(list)
{
QHash roles(roleNames());
roles[Qt::DisplayRole] = "modelData";
setRoleNames(roles);
}
QVariantListModel::~QVariantListModel() {
}
/*!
Returns the number of rows in the model. This value corresponds to the
number of items in the model's internal variant list.
The optional \a parent argument is in most models used to specify
the parent of the rows to be counted. Because this is a list if a
valid parent is specified, the result will always be 0.
\sa insertRows(), removeRows(), QAbstractItemModel::rowCount()
*/
int QVariantListModel::rowCount(const QModelIndex &parent) const
{
if (parent.isValid())
return 0;
return lst.count();
}
/*!
\reimp
*/
QModelIndex QVariantListModel::sibling(int row, int column,
const QModelIndex &idx) const
{
if (!idx.isValid() || column != 0 || row >= lst.count())
return QModelIndex();
return createIndex(row, 0);
}
/*!
Returns data for the specified \a role, from the item with the
given \a index.
If the view requests an invalid index, an invalid variant is returned.
\sa setData()
*/
QVariant QVariantListModel::data(const QModelIndex &index, int role) const
{
if (index.row() < 0 || index.row() >= lst.size())
return QVariant();
if (role == Qt::DisplayRole || role == Qt::EditRole)
return lst.at(index.row());
return QVariant();
}
/*!
Sets the data for the specified \a role in the item with the given
\a index in the model, to the provided \a value.
The dataChanged() signal is emitted if the item is changed.
\sa Qt::ItemDataRole, data()
*/
bool QVariantListModel::setData(const QModelIndex &index, const QVariant &value,
int role)
{
if (index.row() >= 0 && index.row() < lst.size()
&& (role == Qt::EditRole || role == Qt::DisplayRole))
{
lst.replace(index.row(), value);
dataChanged(index, index, QVector() << role);
return true;
}
return false;
}
/*!
Inserts \a count rows into the model, beginning at the given \a row.
The \a parent index of the rows is optional and is only used for
consistency with QAbstractItemModel. By default, a null index is
specified, indicating that the rows are inserted in the top level of
the model.
\sa QAbstractItemModel::insertRows()
*/
bool QVariantListModel::insertRows(int row, int count,
const QModelIndex &parent)
{
if (count < 1 || row < 0 || row > rowCount(parent))
return false;
beginInsertRows(QModelIndex(), row, row + count - 1);
for (int r = 0; r < count; ++r)
lst.insert(row, QVariant());
endInsertRows();
return true;
}
/*!
Removes \a count rows from the model, beginning at the given \a row.
The \a parent index of the rows is optional and is only used for
consistency with QAbstractItemModel. By default, a null index is
specified, indicating that the rows are removed in the top level of
the model.
\sa QAbstractItemModel::removeRows()
*/
bool QVariantListModel::removeRows(int row, int count,
const QModelIndex &parent)
{
if (count <= 0 || row < 0 || (row + count) > rowCount(parent))
return false;
beginRemoveRows(QModelIndex(), row, row + count - 1);
for (int r = 0; r < count; ++r)
lst.removeAt(row);
endRemoveRows();
return true;
}
/*!
Returns the variant list used by the model to store data.
*/
QVariantList QVariantListModel::variantList() const
{
return lst;
}
/*!
Sets the model's internal variant list to \a list. The model will
notify any attached views that its underlying data has changed.
\sa dataChanged()
*/
void QVariantListModel::setVariantList(const QVariantList &list)
{
int size = lst.size();
bool sameSize = list.size() == size;
if (!sameSize)
{
beginResetModel();
}
lst = list;
if (!sameSize)
{
endResetModel();
} else
{
dataChanged(QAbstractListModel::index(0),
QAbstractListModel::index(size - 1));
}
}
./plugins/Utils/plugin.h 0000644 0000156 0000165 00000002066 12677430772 015350 0 ustar jenkins jenkins /*
* Copyright (C) 2012 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*
* Author: Michał Sawicz
*/
#ifndef UTILS_PLUGIN_H
#define UTILS_PLUGIN_H
#include
#include
class UtilsPlugin : public QQmlExtensionPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
public:
void registerTypes(const char *uri) override;
void initializeEngine(QQmlEngine *engine, const char *uri) override;
};
#endif
./plugins/Utils/windowinputfilter.h 0000644 0000156 0000165 00000003637 12677430772 017654 0 ustar jenkins jenkins /*
* Copyright (C) 2014 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*
* Author: Daniel d'Andrada
*/
#ifndef UNITY_WINDOWINPUTFILTER_H
#define UNITY_WINDOWINPUTFILTER_H
#include
#include
/*
Receives all key events that arrive in the QQuickWindow where this item is placed.
Rejected key events will be allowed to be processed normally by the QQuickWindow whereas
accepted ones will be filtered out. Events are accepted by default, so make sure you reject
the keys you're not interested in.
If more than one WindowInputFilter exist in the same QML scene (and thus in the same QQuickWindow)
they will be called in the order of creation, which can be tricky to assess. So the best practice
is to have at most one WindowInputFilter per QML scene.
*/
class WindowInputFilter : public QQuickItem
{
Q_OBJECT
Q_PROPERTY(ulong lastInputTimestamp READ lastInputTimestamp NOTIFY lastInputTimestampChanged)
public:
WindowInputFilter(QQuickItem *parent = 0);
bool eventFilter(QObject *watched, QEvent *event) override;
ulong lastInputTimestamp() const;
Q_SIGNALS:
void lastInputTimestampChanged();
private Q_SLOTS:
void setupFilterOnWindow(QQuickWindow *window);
private:
QPointer m_filteredWindow;
ulong m_lastInputTimestamp;
};
#endif // UNITY_WINDOWINPUTFILTER_H
./plugins/Utils/applicationsfiltermodel.h 0000644 0000156 0000165 00000004344 12677430772 020770 0 ustar jenkins jenkins /*
* Copyright (C) 2015 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#ifndef APPLICATIONSFILTERMODEL_H
#define APPLICATIONSFILTERMODEL_H
#include
namespace unity {
namespace shell {
namespace application {
class ApplicationManagerInterface;
class ApplicationInfoInterface;
}
}
}
using namespace unity::shell::application;
class ApplicationsFilterModel: public QSortFilterProxyModel
{
Q_OBJECT
Q_PROPERTY(unity::shell::application::ApplicationManagerInterface* applicationsModel READ applicationsModel WRITE setApplicationsModel NOTIFY applicationsModelChanged)
Q_PROPERTY(bool filterTouchApps READ filterTouchApps WRITE setFilterTouchApps NOTIFY filterTouchAppsChanged)
Q_PROPERTY(bool filterLegacyApps READ filterLegacyApps WRITE setFilterLegacyApps NOTIFY filterLegacyAppsChanged)
Q_PROPERTY(int count READ rowCount NOTIFY countChanged)
public:
ApplicationsFilterModel(QObject *parent = 0);
ApplicationManagerInterface* applicationsModel() const;
void setApplicationsModel(ApplicationManagerInterface* applicationsModel);
bool filterTouchApps() const;
void setFilterTouchApps(bool filterTouchApps);
bool filterLegacyApps() const;
void setFilterLegacyApps(bool filterLegacyApps);
bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override;
Q_INVOKABLE unity::shell::application::ApplicationInfoInterface* get(int index) const;
Q_SIGNALS:
void applicationsModelChanged();
void filterTouchAppsChanged();
void filterLegacyAppsChanged();
void countChanged();
private:
ApplicationManagerInterface* m_appModel;
bool m_filterTouchApps;
bool m_filterLegacyApps;
};
#endif
./plugins/Utils/windowscreenshotprovider.cpp 0000644 0000156 0000165 00000003562 12677430772 021567 0 ustar jenkins jenkins /*
* Copyright (C) 2015 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#include "windowscreenshotprovider.h"
#include
#include
WindowScreenshotProvider::WindowScreenshotProvider()
: QQuickImageProvider(QQmlImageProviderBase::Image, 0)
{
}
// A very simple implementation where we assume that there's only one window and that it's a
// QQuickWindow. Thus the id parameter is irrelevant.
//
// Idea: Make the id contain the objectName of the QQuickWindow once we care about a multi-display
// compositor?
// Strictly speaking that could be the actual QWindow::winId(), but that's mostly a
// meaningless arbitrary number.
QImage WindowScreenshotProvider::requestImage(const QString &id, QSize *size, const QSize &requestedSize)
{
Q_UNUSED(id);
Q_UNUSED(requestedSize);
QWindowList windows = QGuiApplication::topLevelWindows();
if (windows.count() != 1) {
size->rwidth() = 0;
size->rheight() = 0;
return QImage();
}
QQuickWindow *quickWindow = qobject_cast(windows[0]);
if (!quickWindow) {
size->rwidth() = 0;
size->rheight() = 0;
return QImage();
}
QImage image = quickWindow->grabWindow();
size->rwidth() = image.width();
size->rheight() = image.height();
return image;
}
./plugins/Utils/windowstatestorage.cpp 0000644 0000156 0000165 00000014115 12677430772 020340 0 ustar jenkins jenkins /*
* Copyright 2015 Canonical Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see .
*/
#include "windowstatestorage.h"
#include
#include
#include
#include
#include
#include
#include
#include
QMutex WindowStateStorage::s_mutex;
inline QString sanitiseString(QString string) {
return string.remove("\"").remove("'").remove("\\");
}
WindowStateStorage::WindowStateStorage(QObject *parent):
QObject(parent)
{
QString dbPath = QDir::homePath() + "/.cache/unity8/";
m_db = QSqlDatabase::addDatabase(QStringLiteral("QSQLITE"));
QDir dir;
dir.mkpath(dbPath);
m_db.setDatabaseName(dbPath + "windowstatestorage.sqlite");
initdb();
}
WindowStateStorage::~WindowStateStorage()
{
QFutureSynchronizer futureSync;
for (int i = 0; i < m_asyncQueries.count(); ++i) {
futureSync.addFuture(m_asyncQueries[i]);
}
futureSync.waitForFinished();
m_db.close();
}
void WindowStateStorage::saveState(const QString &windowId, WindowStateStorage::WindowState state)
{
const QString queryString = QStringLiteral("INSERT OR REPLACE INTO state (windowId, state) values ('%1', '%2');")
.arg(sanitiseString(windowId))
.arg((int)state);
saveValue(queryString);
}
WindowStateStorage::WindowState WindowStateStorage::getState(const QString &windowId, WindowStateStorage::WindowState defaultValue) const
{
const QString queryString = QStringLiteral("SELECT * FROM state WHERE windowId = '%1';")
.arg(sanitiseString(windowId));
QSqlQuery query = getValue(queryString);
if (!query.first()) {
return defaultValue;
}
return (WindowState)query.value(QStringLiteral("state")).toInt();
}
void WindowStateStorage::saveGeometry(const QString &windowId, const QRect rect)
{
const QString queryString = QStringLiteral("INSERT OR REPLACE INTO geometry (windowId, x, y, width, height) values ('%1', '%2', '%3', '%4', '%5');")
.arg(sanitiseString(windowId))
.arg(rect.x())
.arg(rect.y())
.arg(rect.width())
.arg(rect.height());
saveValue(queryString);
}
void WindowStateStorage::saveStage(const QString &appId, int stage)
{
const QString queryString = QStringLiteral("INSERT OR REPLACE INTO stage (appId, stage) values ('%1', '%2');")
.arg(sanitiseString(appId))
.arg((int)stage);
saveValue(queryString);
}
int WindowStateStorage::getStage(const QString &appId) const
{
const QString queryString = QStringLiteral("SELECT * FROM stage WHERE appId = '%1';")
.arg(sanitiseString(appId));
QSqlQuery query = getValue(queryString);
if (!query.first()) {
return unity::shell::application::ApplicationInfoInterface::MainStage;
}
return query.value("stage").toInt();
}
void WindowStateStorage::executeAsyncQuery(const QString &queryString)
{
QMutexLocker l(&s_mutex);
QSqlQuery query;
bool ok = query.exec(queryString);
if (!ok) {
qWarning() << "Error executing query" << queryString
<< "Driver error:" << query.lastError().driverText()
<< "Database error:" << query.lastError().databaseText();
}
}
QRect WindowStateStorage::getGeometry(const QString &windowId, const QRect defaultValue) const
{
QString queryString = QStringLiteral("SELECT * FROM geometry WHERE windowId = '%1';")
.arg(sanitiseString(windowId));
QSqlQuery query = getValue(queryString);
if (!query.first()) {
return defaultValue;
}
return QRect(query.value(QStringLiteral("x")).toInt(), query.value(QStringLiteral("y")).toInt(), query.value(QStringLiteral("width")).toInt(), query.value(QStringLiteral("height")).toInt());
}
void WindowStateStorage::initdb()
{
m_db.open();
if (!m_db.open()) {
qWarning() << "Error opening state database:" << m_db.lastError().driverText() << m_db.lastError().databaseText();
return;
}
if (!m_db.tables().contains(QStringLiteral("geometry"))) {
QSqlQuery query;
query.exec(QStringLiteral("CREATE TABLE geometry(windowId TEXT UNIQUE, x INTEGER, y INTEGER, width INTEGER, height INTEGER);"));
}
if (!m_db.tables().contains(QStringLiteral("state"))) {
QSqlQuery query;
query.exec(QStringLiteral("CREATE TABLE state(windowId TEXT UNIQUE, state INTEGER);"));
}
if (!m_db.tables().contains(QStringLiteral("stage"))) {
QSqlQuery query;
query.exec(QStringLiteral("CREATE TABLE stage(appId TEXT UNIQUE, stage INTEGER);"));
}
}
void WindowStateStorage::saveValue(const QString &queryString)
{
QMutexLocker mutexLocker(&s_mutex);
QFuture future = QtConcurrent::run(executeAsyncQuery, queryString);
m_asyncQueries.append(future);
QFutureWatcher *futureWatcher = new QFutureWatcher();
futureWatcher->setFuture(future);
connect(futureWatcher, &QFutureWatcher::finished,
this,
[=](){ m_asyncQueries.removeAll(futureWatcher->future());
futureWatcher->deleteLater(); });
}
QSqlQuery WindowStateStorage::getValue(const QString &queryString) const
{
QMutexLocker l(&s_mutex);
QSqlQuery query;
bool ok = query.exec(queryString);
if (!ok) {
qWarning() << "Error retrieving database query:" << queryString
<< "Driver error:" << query.lastError().driverText()
<< "Database error:" << query.lastError().databaseText();
}
return query;
}
./plugins/Utils/Timer.h 0000644 0000156 0000165 00000004064 12677430772 015132 0 ustar jenkins jenkins /*
* Copyright (C) 2015 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#ifndef UNITYUTIL_TIMER_H
#define UNITYUTIL_TIMER_H
#include "ElapsedTimer.h"
#include
#include
#include
namespace UnityUtil {
/** Defines an interface for a Timer. Useful for tests. */
class AbstractTimer : public QObject
{
Q_OBJECT
public:
AbstractTimer(QObject *parent) : QObject(parent), m_isRunning(false) {}
virtual int interval() const = 0;
virtual void setInterval(int msecs) = 0;
virtual void start() { m_isRunning = true; }
virtual void stop() { m_isRunning = false; }
bool isRunning() const { return m_isRunning; }
virtual bool isSingleShot() const = 0;
virtual void setSingleShot(bool value) = 0;
Q_SIGNALS:
void timeout();
private:
bool m_isRunning;
};
/** A QTimer wrapper */
class Timer : public AbstractTimer
{
Q_OBJECT
public:
Timer(QObject *parent = nullptr);
int interval() const override;
void setInterval(int msecs) override;
void start() override;
void stop() override;
bool isSingleShot() const override;
void setSingleShot(bool value) override;
private:
QTimer m_timer;
};
class AbstractTimerFactory
{
public:
virtual ~AbstractTimerFactory() {}
virtual AbstractTimer *create(QObject *parent = nullptr) = 0;
};
class TimerFactory : public AbstractTimerFactory
{
public:
AbstractTimer *create(QObject *parent = nullptr) override { return new Timer(parent); }
};
} // namespace UnityUtil
#endif // UNITYUTIL_TIMER_H
./plugins/Utils/WindowInputMonitor.h 0000644 0000156 0000165 00000005430 12677430772 017707 0 ustar jenkins jenkins /*
* Copyright (C) 2015 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#ifndef UNITY_WINDOWINPUTMONITOR_H
#define UNITY_WINDOWINPUTMONITOR_H
#include
#include
#include "Timer.h"
#include "ElapsedTimer.h"
/**
* Monitors input events received by the window holding this item and the Home (Win aka Super_L)
* key presses.
*
* Additionally, this class monitors for generic touch events on the screen, to
* help with hiding/revealing the mouse pointer.
*/
class WindowInputMonitor : public QQuickItem
{
Q_OBJECT
public:
WindowInputMonitor(QQuickItem *parent = 0);
// for testing
WindowInputMonitor(UnityUtil::AbstractTimer *timer,
UnityUtil::AbstractElapsedTimer *elapsedTimer,
QQuickItem *parent = 0);
virtual ~WindowInputMonitor();
bool eventFilter(QObject *watched, QEvent *event) override;
void update(QEvent *event);
const qint64 msecsWithoutTouches = 150;
Q_SIGNALS:
/**
* Emitted when the home key has been intentionally tapped
*
* It only says the home key has been activated if it has been tapped in isolation,
* that is, without being accompanied by touches on the screen. Home key taps that
* happen along with (or immediately after, or immediately before) touches on the
* screen are considered to have happened unintentionally and are thus ignored.
*
* Rationale being that it's easy to accidentally hit the home key while performing
* a swipe from a screen edge, for instance. That's particularly the case when the
* home key is a capacitive key.
*/
void homeKeyActivated();
/**
* Emitted when a touch begin event is detected
*/
void touchBegun();
/**
* Emitted when a touch end event is detected
* @param pos the position in screen coordinates
*/
void touchEnded(const QPointF &pos);
private Q_SLOTS:
void setupFilterOnWindow(QQuickWindow *window);
void emitActivatedIfNoTouchesAround();
private:
QPointer m_filteredWindow;
bool m_windowBeingTouched;
bool m_homeKeyPressed;
UnityUtil::AbstractElapsedTimer *m_windowLastTouchedTimer;
UnityUtil::AbstractTimer *m_activationTimer;
};
#endif // UNITY_WINDOWINPUTMONITOR_H
./plugins/Utils/ElapsedTimer.h 0000644 0000156 0000165 00000002752 12677430772 016432 0 ustar jenkins jenkins /*
* Copyright (C) 2015 Canonical Ltd.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License, as
* published by the Free Software Foundation; either version 2.1 or 3.0
* of the License.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranties of
* MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the applicable version of the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of both the GNU Lesser General Public
* License along with this program. If not, see
*/
#ifndef UNITYUTIL_ELAPSEDTIMER_H
#define UNITYUTIL_ELAPSEDTIMER_H
#include
namespace UnityUtil {
/**
Interface for ElapsedTimer implementations
*/
class AbstractElapsedTimer {
public:
virtual ~AbstractElapsedTimer() {}
virtual void start() = 0;
virtual qint64 msecsSinceReference() const = 0;
virtual qint64 elapsed() const = 0;
};
/**
A QElapsedTimer wrapper
*/
class ElapsedTimer : public AbstractElapsedTimer {
public:
void start() override { m_timer.start(); }
qint64 msecsSinceReference() const override { return m_timer.msecsSinceReference(); }
qint64 elapsed() const override { return m_timer.elapsed(); }
private:
QElapsedTimer m_timer;
};
} // namespace UnityUtil
#endif // UNITYUTIL_ELAPSEDTIMER_H
./plugins/Utils/constants.cpp 0000644 0000156 0000165 00000001575 12677430772 016425 0 ustar jenkins jenkins /*
* Copyright 2015 Canonical Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see .
*/
#include "constants.h"
Constants::Constants(QObject *parent)
: QObject(parent)
{
if (qEnvironmentVariableIsEmpty("QT_LOAD_TESTABILITY")) {
m_indicatorValueTimeout = 30000;
} else {
m_indicatorValueTimeout = 5000;
}
}
./plugins/Utils/plugin.cpp 0000644 0000156 0000165 00000006606 12677430772 015707 0 ustar jenkins jenkins /*
* Copyright (C) 2012-2015 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
// Qt
#include
#include
#include
#include
// self
#include "plugin.h"
// local
#include "activefocuslogger.h"
#include "easingcurve.h"
#include "WindowInputMonitor.h"
#include "inputwatcher.h"
#include "qlimitproxymodelqml.h"
#include "unitysortfilterproxymodelqml.h"
#include "unitymenumodelpaths.h"
#include "windowinputfilter.h"
#include "windowscreenshotprovider.h"
#include "windowstatestorage.h"
#include "constants.h"
#include "timezoneFormatter.h"
#include "applicationsfiltermodel.h"
#include "inputeventgenerator.h"
#include "deviceconfigparser.h"
#include "globalfunctions.h"
static QObject *createWindowStateStorage(QQmlEngine *engine, QJSEngine *scriptEngine)
{
Q_UNUSED(engine)
Q_UNUSED(scriptEngine)
return new WindowStateStorage();
}
static QObject *createConstants(QQmlEngine *engine, QJSEngine *scriptEngine)
{
Q_UNUSED(engine)
Q_UNUSED(scriptEngine)
return new Constants();
}
static QObject *createGlobalFunctions(QQmlEngine *engine, QJSEngine *scriptEngine)
{
Q_UNUSED(engine)
Q_UNUSED(scriptEngine)
return new GlobalFunctions();
}
void UtilsPlugin::registerTypes(const char *uri)
{
Q_ASSERT(uri == QLatin1String("Utils"));
qmlRegisterType(uri, 0, 1, "WindowInputMonitor");
qmlRegisterType();
qmlRegisterType(uri, 0, 1, "LimitProxyModel");
qmlRegisterType(uri, 0, 1, "UnitySortFilterProxyModel");
qmlRegisterType(uri, 0, 1, "UnityMenuModelPaths");
qmlRegisterType(uri, 0, 1, "WindowInputFilter");
qmlRegisterType(uri, 0, 1, "EasingCurve");
qmlRegisterSingletonType(uri, 0, 1, "WindowStateStorage", createWindowStateStorage);
qmlRegisterType(uri, 0, 1, "InputWatcher");
qmlRegisterSingletonType(uri, 0, 1, "Constants", createConstants);
qmlRegisterSingletonType(uri, 0, 1, "TimezoneFormatter",
[](QQmlEngine*, QJSEngine*) -> QObject* { return new TimezoneFormatter; });
qmlRegisterType(uri, 0, 1, "ActiveFocusLogger");
qmlRegisterType(uri, 0, 1, "ApplicationsFilterModel");
qmlRegisterType(uri, 0, 1, "InputEventGenerator");
qmlRegisterType(uri, 0, 1, "DeviceConfigParser");
qmlRegisterSingletonType(uri, 0, 1, "Functions", createGlobalFunctions);
}
void UtilsPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
{
QQmlExtensionPlugin::initializeEngine(engine, uri);
engine->addImageProvider(QStringLiteral("window"), new WindowScreenshotProvider);
}
./plugins/Utils/windowscreenshotprovider.h 0000644 0000156 0000165 00000001762 12677430772 021234 0 ustar jenkins jenkins /*
* Copyright (C) 2015 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#ifndef WINDOW_SCREENSHOT_PROVIDER_H_
#define WINDOW_SCREENSHOT_PROVIDER_H_
#include
class WindowScreenshotProvider : public QQuickImageProvider
{
public:
WindowScreenshotProvider();
// id is ignored for now
QImage requestImage(const QString &id, QSize *size, const QSize &requestedSize) override;
};
#endif // WINDOW_SCREENSHOT_PROVIDER_H_
./plugins/Utils/windowinputfilter.cpp 0000644 0000156 0000165 00000004067 12677430772 020205 0 ustar jenkins jenkins /*
* Copyright (C) 2014 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*
* Author: Daniel d'Andrada
*/
#include "windowinputfilter.h"
#include
WindowInputFilter::WindowInputFilter(QQuickItem *parent)
: QQuickItem(parent),
m_lastInputTimestamp(0)
{
connect(this, &QQuickItem::windowChanged,
this, &WindowInputFilter::setupFilterOnWindow);
}
bool WindowInputFilter::eventFilter(QObject *watched, QEvent *event)
{
Q_ASSERT(!m_filteredWindow.isNull());
Q_ASSERT(watched == static_cast(m_filteredWindow.data()));
Q_UNUSED(watched);
QInputEvent *inputEvent = dynamic_cast(event);
if (inputEvent) {
m_lastInputTimestamp = inputEvent->timestamp();
Q_EMIT lastInputTimestampChanged();
}
if (event->type() == QEvent::KeyPress || event->type() == QEvent::KeyRelease) {
// Let QML see this event and decide if it does not want it
event->accept();
QCoreApplication::sendEvent(this, event);
return event->isAccepted();
} else {
// Not interested
return false;
}
}
void WindowInputFilter::setupFilterOnWindow(QQuickWindow *window)
{
if (!m_filteredWindow.isNull()) {
m_filteredWindow->removeEventFilter(this);
m_filteredWindow.clear();
}
if (window) {
window->installEventFilter(this);
m_filteredWindow = window;
}
}
ulong WindowInputFilter::lastInputTimestamp() const
{
return m_lastInputTimestamp;
}
./plugins/Utils/Utils.qmltypes 0000644 0000156 0000165 00000014262 12677430772 016602 0 ustar jenkins jenkins import QtQuick.tooling 1.1
// This file describes the plugin-supplied types contained in the library.
// It is used for QML tooling purposes only.
//
// This file was auto-generated by:
// 'qmlplugindump -notrelocatable Utils 0.1 plugins'
Module {
Component {
name: "EasingCurve"
prototype: "QObject"
exports: ["Utils/EasingCurve 0.1"]
exportMetaObjectRevisions: [0]
Property { name: "type"; type: "QEasingCurve::Type" }
Property { name: "period"; type: "double" }
Property { name: "progress"; type: "double" }
Property { name: "value"; type: "double"; isReadonly: true }
}
Component {
name: "QAbstractProxyModel"
prototype: "QAbstractItemModel"
Property { name: "sourceModel"; type: "QAbstractItemModel"; isPointer: true }
}
Component { name: "QIdentityProxyModel"; prototype: "QAbstractProxyModel" }
Component {
name: "QLimitProxyModelQML"
prototype: "QIdentityProxyModel"
exports: ["Utils/LimitProxyModel 0.1"]
exportMetaObjectRevisions: [0]
Property { name: "model"; type: "QAbstractItemModel"; isPointer: true }
Property { name: "limit"; type: "int" }
Property { name: "count"; type: "int"; isReadonly: true }
Signal { name: "totalCountChanged" }
}
Component {
name: "QSortFilterProxyModel"
prototype: "QAbstractProxyModel"
Property { name: "filterRegExp"; type: "QRegExp" }
Property { name: "filterKeyColumn"; type: "int" }
Property { name: "dynamicSortFilter"; type: "bool" }
Property { name: "filterCaseSensitivity"; type: "Qt::CaseSensitivity" }
Property { name: "sortCaseSensitivity"; type: "Qt::CaseSensitivity" }
Property { name: "isSortLocaleAware"; type: "bool" }
Property { name: "sortRole"; type: "int" }
Property { name: "filterRole"; type: "int" }
Method {
name: "setFilterRegExp"
Parameter { name: "pattern"; type: "string" }
}
Method {
name: "setFilterWildcard"
Parameter { name: "pattern"; type: "string" }
}
Method {
name: "setFilterFixedString"
Parameter { name: "pattern"; type: "string" }
}
Method { name: "clear" }
Method { name: "invalidate" }
}
Component {
name: "RelativeTimeFormatter"
prototype: "TimeFormatter"
exports: ["Utils/RelativeTimeFormatter 0.1"]
exportMetaObjectRevisions: [0]
}
Component {
name: "TimeFormatter"
prototype: "QObject"
exports: ["Utils/GDateTimeFormatter 0.1", "Utils/TimeFormatter 0.1"]
exportMetaObjectRevisions: [0, 0]
Property { name: "format"; type: "string" }
Property { name: "timeString"; type: "string"; isReadonly: true }
Property { name: "time"; type: "qlonglong" }
Signal {
name: "formatChanged"
Parameter { name: "format"; type: "string" }
}
Signal {
name: "timeStringChanged"
Parameter { name: "timeString"; type: "string" }
}
Signal {
name: "timeChanged"
Parameter { name: "time"; type: "qlonglong" }
}
}
Component {
name: "UnityMenuModelPaths"
prototype: "QObject"
exports: ["Utils/UnityMenuModelPaths 0.1"]
exportMetaObjectRevisions: [0]
Property { name: "source"; type: "QVariant" }
Property { name: "busName"; type: "QByteArray"; isReadonly: true }
Property { name: "actions"; type: "QVariantMap"; isReadonly: true }
Property { name: "menuObjectPath"; type: "QByteArray"; isReadonly: true }
Property { name: "busNameHint"; type: "QByteArray" }
Property { name: "actionsHint"; type: "QByteArray" }
Property { name: "menuObjectPathHint"; type: "QByteArray" }
}
Component {
name: "UnitySortFilterProxyModelQML"
prototype: "QSortFilterProxyModel"
exports: ["Utils/UnitySortFilterProxyModel 0.1"]
exportMetaObjectRevisions: [0]
Property { name: "model"; type: "QAbstractItemModel"; isPointer: true }
Property { name: "totalCount"; type: "int"; isReadonly: true }
Property { name: "count"; type: "int"; isReadonly: true }
Property { name: "invertMatch"; type: "bool" }
Signal {
name: "invertMatchChanged"
Parameter { type: "bool" }
}
Method {
name: "get"
type: "QVariantMap"
Parameter { name: "row"; type: "int" }
}
Method {
name: "data"
type: "QVariant"
Parameter { name: "row"; type: "int" }
Parameter { name: "role"; type: "int" }
}
Method { name: "count"; type: "int" }
Method {
name: "findFirst"
type: "int"
Parameter { name: "role"; type: "int" }
Parameter { name: "value"; type: "QVariant" }
}
Method {
name: "mapRowToSource"
type: "int"
Parameter { name: "row"; type: "int" }
}
Method {
name: "mapFromSource"
type: "int"
Parameter { name: "row"; type: "int" }
}
Method {
name: "mapToSource"
type: "int"
Parameter { name: "row"; type: "int" }
}
}
Component {
name: "WindowInputFilter"
defaultProperty: "data"
prototype: "QQuickItem"
exports: ["Utils/WindowInputFilter 0.1"]
exportMetaObjectRevisions: [0]
}
Component {
name: "WindowStateStorage"
prototype: "QObject"
exports: ["Utils/WindowStateStorage 0.1"]
isCreatable: false
isSingleton: true
exportMetaObjectRevisions: [0]
Method {
name: "saveGeometry"
Parameter { name: "windowId"; type: "string" }
Parameter { name: "rect"; type: "QRect" }
}
Method {
name: "getGeometry"
type: "QRect"
Parameter { name: "windowId"; type: "string" }
Parameter { name: "defaultValue"; type: "QRect" }
}
}
}
./plugins/Utils/qlimitproxymodelqml.cpp 0000644 0000156 0000165 00000023226 12677430772 020542 0 ustar jenkins jenkins /*
* Copyright (C) 2012, 2013 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
// self
#include "qlimitproxymodelqml.h"
// Qt
#include
QLimitProxyModelQML::QLimitProxyModelQML(QObject *parent)
: QIdentityProxyModel(parent)
, m_limit(-1)
, m_sourceInserting(false)
, m_sourceRemoving(false)
, m_dataChangedBegin(-1)
, m_dataChangedEnd(-1)
{
connect(this, &QLimitProxyModelQML::modelReset, this, &QLimitProxyModelQML::countChanged);
connect(this, &QLimitProxyModelQML::rowsInserted, this, &QLimitProxyModelQML::countChanged);
connect(this, &QLimitProxyModelQML::rowsRemoved, this, &QLimitProxyModelQML::countChanged);
}
QHash QLimitProxyModelQML::roleNames() const
{
return sourceModel() ? sourceModel()->roleNames() : QHash();
}
void
QLimitProxyModelQML::setModel(QAbstractItemModel *itemModel)
{
if (itemModel != sourceModel()) {
if (sourceModel() != nullptr) {
sourceModel()->disconnect(this);
}
setSourceModel(itemModel);
if (sourceModel() != nullptr) {
// Disconnect the QIdentityProxyModel handling for rows removed/added...
disconnect(sourceModel(), &QAbstractItemModel::rowsAboutToBeInserted, this, nullptr);
disconnect(sourceModel(), &QAbstractItemModel::rowsInserted, this, nullptr);
disconnect(sourceModel(), &QAbstractItemModel::rowsAboutToBeRemoved, this, nullptr);
disconnect(sourceModel(), &QAbstractItemModel::rowsRemoved, this, nullptr);
// ... and use our own
connect(sourceModel(), &QAbstractItemModel::rowsAboutToBeInserted,
this, &QLimitProxyModelQML::sourceRowsAboutToBeInserted);
connect(sourceModel(), &QAbstractItemModel::rowsInserted,
this, &QLimitProxyModelQML::sourceRowsInserted);
connect(sourceModel(), &QAbstractItemModel::rowsAboutToBeRemoved,
this, &QLimitProxyModelQML::sourceRowsAboutToBeRemoved);
connect(sourceModel(), &QAbstractItemModel::rowsRemoved,
this, &QLimitProxyModelQML::sourceRowsRemoved);
}
Q_EMIT modelChanged();
}
}
int
QLimitProxyModelQML::rowCount(const QModelIndex &parent) const
{
if (parent.isValid()) // We are not a tree
return 0;
const int unlimitedCount = QIdentityProxyModel::rowCount(parent);
return m_limit < 0 ? unlimitedCount : qMin(m_limit, unlimitedCount);
}
int
QLimitProxyModelQML::limit() const
{
return m_limit;
}
void
QLimitProxyModelQML::setLimit(int limit)
{
if (limit != m_limit) {
bool inserting = false;
bool removing = false;
const int oldCount = rowCount();
const int unlimitedCount = QIdentityProxyModel::rowCount();
if (m_limit < 0) {
if (limit < oldCount) {
removing = true;
beginRemoveRows(QModelIndex(), limit, oldCount - 1);
}
} else if (limit < 0) {
if (m_limit < unlimitedCount) {
inserting = true;
beginInsertRows(QModelIndex(), m_limit, unlimitedCount - 1);
}
} else {
if (limit > m_limit && unlimitedCount > m_limit) {
inserting = true;
beginInsertRows(QModelIndex(), m_limit, qMin(limit, unlimitedCount) - 1);
} else if (limit < m_limit && limit < oldCount) {
removing = true;
beginRemoveRows(QModelIndex(), limit, oldCount - 1);
}
}
m_limit = limit;
if (inserting) {
endInsertRows();
} else if (removing) {
endRemoveRows();
}
Q_EMIT limitChanged();
}
}
void
QLimitProxyModelQML::sourceRowsAboutToBeInserted(const QModelIndex &parent, int start, int end)
{
if (m_limit < 0) {
beginInsertRows(mapFromSource(parent), start, end);
m_sourceInserting = true;
} else if (start < m_limit) {
const int nSourceAddedItems = end - start + 1;
const int currentCount = QIdentityProxyModel::rowCount();
if (currentCount + nSourceAddedItems <= m_limit) {
// After Inserting items we will be under the limit
// so just proceed with the insertion normally
beginInsertRows(mapFromSource(parent), start, end);
m_sourceInserting = true;
} else if (currentCount >= m_limit) {
// We are already over the limit so to our users we are not adding items, just
// changing it's data, i.e we had something like
// A B C D E
// with a limit of 5
// after inserting (let's say three 'F' at position 1) we will have
// A F F F B
// so we just need to signal a dataChanged from 1 to 4
m_dataChangedBegin = start;
m_dataChangedEnd = m_limit - 1;
} else { // currentCount < m_limit && currentCount + nSourceAddedItems > m_limit
// We have less items than the limit but after adding them we will be over
// To our users this means we need to insert some items and change the
// data of some others, i.e we had something like
// A B C
// with a limit of 5
// after inserting (let's say three 'F' at position 1) we will have
// A F F F B
// so we need to signal an insetion from position 1 to 2, instead of from
// position 1 to 3 and a after that a data changed from 3 to 4
const int nItemsToInsert = m_limit - currentCount;
beginInsertRows(mapFromSource(parent), start, start + nItemsToInsert - 1);
m_sourceInserting = true;
m_dataChangedBegin = start + nItemsToInsert;
m_dataChangedEnd = m_limit - 1;
if (m_dataChangedBegin > m_dataChangedEnd) {
// Just in case we were empty and insert 6 items with a limit of 5
// We don't want to signal a dataChanged from 5 to 4
m_dataChangedBegin = -1;
m_dataChangedEnd = -1;
}
}
}
}
void
QLimitProxyModelQML::sourceRowsAboutToBeRemoved(const QModelIndex &parent, int start, int end)
{
if (m_limit < 0) {
beginRemoveRows(mapFromSource(parent), start, end);
m_sourceRemoving = true;
} else if (start < m_limit) {
const int nSourceRemovedItems = end - start + 1;
const int currentCount = QIdentityProxyModel::rowCount();
if (currentCount <= m_limit) {
// We are already under the limit so
// so just proceed with the removal normally
beginRemoveRows(mapFromSource(parent), start, end);
m_sourceRemoving = true;
} else if (currentCount - nSourceRemovedItems >= m_limit) {
// Even after removing items we will be at or over the limit
// So to our users we are not removing anything, just changing the data
// i.e. we had a internal model with
// A B C D E F G H
// and a limit of 5, our users just see
// A B C D E
// so if we remove 3 items starting at 1 we have to expose
// A E F G H
// that is, a dataChanged from 1 to 4
m_dataChangedBegin = start;
m_dataChangedEnd = m_limit - 1;
} else { // currentCount > m_limit && currentCount - nSourceRemovedItems < m_limit
// We have more items than the limit but after removing we will be below it
// So to our users we both removing and changing the data
// i.e. we had a internal model with
// A B C D E F G
// and a limit of 5, our users just see
// A B C D E
// so if we remove items from 1 to 3 we have to expose
// A E F G
// that is, a remove from 4 to 4 and a dataChanged from 1 to 3
const int nItemsToRemove = m_limit - (currentCount - nSourceRemovedItems);
beginRemoveRows(mapFromSource(parent), m_limit - nItemsToRemove, m_limit - 1);
m_sourceRemoving = true;
m_dataChangedBegin = start;
m_dataChangedEnd = m_limit - nItemsToRemove - 1;
if (m_dataChangedBegin > m_dataChangedEnd) {
m_dataChangedBegin = -1;
m_dataChangedEnd = -1;
}
}
}
}
void
QLimitProxyModelQML::sourceRowsInserted(const QModelIndex & /*parent*/, int /*start*/, int /*end*/)
{
if (m_sourceInserting) {
endInsertRows();
m_sourceInserting = false;
}
if (m_dataChangedBegin != -1 && m_dataChangedEnd != -1) {
dataChanged(index(m_dataChangedBegin, 0), index(m_dataChangedEnd, 0));
m_dataChangedBegin = -1;
m_dataChangedEnd = -1;
}
}
void
QLimitProxyModelQML::sourceRowsRemoved(const QModelIndex & /*parent*/, int /*start*/, int /*end*/)
{
if (m_sourceRemoving) {
endRemoveRows();
m_sourceRemoving = false;
}
if (m_dataChangedBegin != -1 && m_dataChangedEnd != -1) {
dataChanged(index(m_dataChangedBegin, 0), index(m_dataChangedEnd, 0));
m_dataChangedBegin = -1;
m_dataChangedEnd = -1;
}
}
./plugins/Utils/inputwatcher.cpp 0000644 0000156 0000165 00000005323 12677430772 017121 0 ustar jenkins jenkins /*
* Copyright (C) 2015 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*
*/
#include "inputwatcher.h"
#include
InputWatcher::InputWatcher(QObject *parent)
: QObject(parent)
, m_mousePressed(false)
, m_touchPressed(false)
{
}
QObject *InputWatcher::target() const
{
return m_target;
}
void InputWatcher::setTarget(QObject *value)
{
if (m_target == value) {
return;
}
if (m_target) {
m_target->removeEventFilter(this);
}
setMousePressed(false);
setTouchPressed(false);
m_target = value;
if (m_target) {
m_target->installEventFilter(this);
}
Q_EMIT targetChanged(value);
}
bool InputWatcher::targetPressed() const
{
return m_mousePressed || m_touchPressed;
}
bool InputWatcher::eventFilter(QObject* /*watched*/, QEvent *event)
{
switch (event->type()) {
case QEvent::TouchBegin:
setTouchPressed(true);
break;
case QEvent::TouchEnd:
setTouchPressed(false);
break;
case QEvent::MouseButtonPress:
{
QMouseEvent *mouseEvent = static_cast(event);
if (mouseEvent->button() == Qt::LeftButton) {
setMousePressed(true);
}
}
break;
case QEvent::MouseButtonRelease:
{
QMouseEvent *mouseEvent = static_cast(event);
if (mouseEvent->button() == Qt::LeftButton) {
setMousePressed(false);
}
}
break;
default:
// Not interested
break;
}
// We never filter them out. We are just watching.
return false;
}
void InputWatcher::setMousePressed(bool value)
{
if (value == m_mousePressed) {
return;
}
bool oldPressed = targetPressed();
m_mousePressed = value;
if (targetPressed() != oldPressed) {
Q_EMIT targetPressedChanged(targetPressed());
}
}
void InputWatcher::setTouchPressed(bool value)
{
if (value == m_touchPressed) {
return;
}
bool oldPressed = targetPressed();
m_touchPressed = value;
if (targetPressed() != oldPressed) {
Q_EMIT targetPressedChanged(targetPressed());
}
}
./plugins/Utils/activefocuslogger.h 0000644 0000156 0000165 00000002027 12677430772 017562 0 ustar jenkins jenkins /*
* Copyright (C) 2015 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#ifndef UNITY_ACTIVEFOCUSLOGGER_H
#define UNITY_ACTIVEFOCUSLOGGER_H
#include
#include
class ActiveFocusLogger : public QQuickItem
{
Q_OBJECT
public:
ActiveFocusLogger(QQuickItem *parent = 0);
private Q_SLOTS:
void setupFilterOnWindow(QQuickWindow *window);
void printActiveFocusInfo();
private:
QPointer m_window;
};
#endif // UNITY_ACTIVEFOCUSLOGGER_H
./plugins/Utils/qlimitproxymodelqml.h 0000644 0000156 0000165 00000003702 12677430772 020204 0 ustar jenkins jenkins /*
* Copyright (C) 2012, 2013 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#ifndef QLIMITPROXYMODELQML_H
#define QLIMITPROXYMODELQML_H
#include
class QLimitProxyModelQML : public QIdentityProxyModel
{
Q_OBJECT
Q_PROPERTY(QAbstractItemModel* model READ sourceModel WRITE setModel NOTIFY modelChanged)
Q_PROPERTY(int limit READ limit WRITE setLimit NOTIFY limitChanged)
Q_PROPERTY(int count READ rowCount NOTIFY countChanged)
public:
explicit QLimitProxyModelQML(QObject *parent = 0);
/* getters */
int limit() const;
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
QHash roleNames() const override;
/* setters */
void setModel(QAbstractItemModel *model);
void setLimit(int limit);
Q_SIGNALS:
void limitChanged();
void totalCountChanged();
void countChanged();
void modelChanged();
private Q_SLOTS:
void sourceRowsAboutToBeInserted(const QModelIndex &parent, int start, int end);
void sourceRowsAboutToBeRemoved(const QModelIndex &parent, int start, int end);
void sourceRowsInserted(const QModelIndex &parent, int start, int end);
void sourceRowsRemoved(const QModelIndex &parent, int start, int end);
private:
int m_limit;
bool m_sourceInserting;
bool m_sourceRemoving;
int m_dataChangedBegin;
int m_dataChangedEnd;
};
#endif // QLIMITPROXYMODELQML_H
./plugins/Utils/globalfunctions.cpp 0000644 0000156 0000165 00000003534 12677430772 017577 0 ustar jenkins jenkins /*
* Copyright 2015 Canonical Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see .
*/
#include "globalfunctions.h"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-pedantic"
#include
#pragma GCC diagnostic pop
#include
GlobalFunctions::GlobalFunctions(QObject *parent)
: QObject(parent)
{
}
QQuickItem *GlobalFunctions::itemAt(QQuickItem* parent, int x, int y, QJSValue matcher)
{
if (!parent) return nullptr;
QList children = QQuickItemPrivate::get(parent)->paintOrderChildItems();
for (int i = children.count() - 1; i >= 0; --i) {
QQuickItem *child = children.at(i);
// Map coordinates to the child element's coordinate space
QPointF point = parent->mapToItem(child, QPointF(x, y));
if (child->isVisible() && point.x() >= 0
&& child->width() >= point.x()
&& point.y() >= 0
&& child->height() >= point.y()) {
if (!matcher.isCallable()) return child;
QQmlEngine* engine = qmlEngine(child);
if (!engine) return child;
QJSValue newObj = engine->newQObject(child);
if (matcher.call(QJSValueList() << newObj).toBool()) {
return child;
}
}
}
return nullptr;
}
./plugins/Utils/EdgeBarrierSettings.qml 0000644 0000156 0000165 00000004756 12677430772 020320 0 ustar jenkins jenkins /*
* Copyright (C) 2015 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
pragma Singleton
import QtQuick 2.4
import GSettings 1.0
QtObject {
id: root
// The only public property
readonly property real pushThreshold:
d.minPushThreshold + ((d.maxPushThreshold - d.minPushThreshold) * (1.0 - d.sensitivity))
onPushThresholdChanged: {
// Avoid calling d.printSettings() directly as it would spam the console during initialization
d.printSettingsTimer.start();
}
property QtObject priv: QtObject {
id: d
property Timer printSettingsTimer: Timer {
interval: 1
onTriggered: d.printSettings();
}
function printSettings() {
console.log("EdgeBarrierSettings: min="+(minPushThreshold/units.gu(1))+"gu("+minPushThreshold+"px)"
+", max="+(maxPushThreshold/units.gu(1))+"gu("+maxPushThreshold+"px)"
+", sensitivity="+sensitivity
+", threshold="+(pushThreshold/units.gu(1))+"gu("+pushThreshold+"px)"
);
}
property real defaultMinPushThreshold: units.gu(2)
property real minPushThreshold: gsettings.edgeBarrierMinPush ? units.gu(gsettings.edgeBarrierMinPush) : defaultMinPushThreshold
property real maxPushThreshold: {
if (gsettings.edgeBarrierMaxPush && units.gu(gsettings.edgeBarrierMaxPush) > minPushThreshold) {
return units.gu(gsettings.edgeBarrierMaxPush);
} else if (minPushThreshold == defaultMinPushThreshold) {
return units.gu(60);
} else {
return minPushThreshold * 10.0;
}
}
// Value range is [0.0, 1.0]
readonly property real sensitivity: gsettings.edgeBarrierSensitivity
? Math.min(Math.max(0, gsettings.edgeBarrierSensitivity), 100) / 100
: 0.35
property var gsettings: GSettings { schema.id: "com.canonical.Unity8" }
}
}
./plugins/Utils/unitymenumodelpaths.cpp 0000644 0000156 0000165 00000010341 12677430772 020516 0 ustar jenkins jenkins /*
* Copyright (C) 2013 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*
* Author: Nick Dedekind
*/
#include "unitymenumodelpaths.h"
#include
static QVariant parseVariantData(const QVariant& var);
const QDBusArgument &operator>>(const QDBusArgument &arg, QVariantMap &map)
{
arg.beginMap();
map.clear();
while (!arg.atEnd()) {
QString key;
QVariant value;
arg.beginMapEntry();
arg >> key >> value;
map.insertMulti(key, parseVariantData(value)); // re-parse for qdbusargument
arg.endMapEntry();
}
arg.endMap();
return arg;
}
static QVariant parseVariantData(const QVariant& var) {
if ((int)var.type() == QMetaType::User && var.userType() == qMetaTypeId()) {
QDBusArgument arg(var.value());
if (arg.currentType() == QDBusArgument::MapType) {
QVariantMap map;
arg >> map;
return map;
}
return arg.asVariant();
}
return var;
}
UnityMenuModelPaths::UnityMenuModelPaths(QObject *parent)
: QObject(parent)
{
}
QVariant UnityMenuModelPaths::source() const
{
return m_sourceData;
}
void UnityMenuModelPaths::setSource(const QVariant& data)
{
if (m_sourceData != data) {
m_sourceData = data;
Q_EMIT sourceChanged();
updateData();
}
}
void UnityMenuModelPaths::updateData()
{
QVariantMap dataMap = parseVariantData(m_sourceData).toMap();
if (!m_busNameHint.isEmpty() && dataMap.contains(m_busNameHint)) {
setBusName(dataMap[m_busNameHint].toByteArray());
} else {
setBusName("");
}
if (!m_menuObjectPathHint.isEmpty() && dataMap.contains(m_menuObjectPathHint)) {
setMenuObjectPath(dataMap[m_menuObjectPathHint].toByteArray());
} else {
setMenuObjectPath("");
}
if (!m_actionsHint.isEmpty() && dataMap.contains(m_actionsHint)) {
setActions(dataMap[m_actionsHint].toMap());
} else {
setActions(QVariantMap());
}
}
QByteArray UnityMenuModelPaths::busName() const
{
return m_busName;
}
void UnityMenuModelPaths::setBusName(const QByteArray &name)
{
if (m_busName != name) {
m_busName = name;
Q_EMIT busNameChanged();
}
}
QVariantMap UnityMenuModelPaths::actions() const
{
return m_actions;
}
void UnityMenuModelPaths::setActions(const QVariantMap &actions)
{
if (m_actions != actions) {
m_actions = actions;
Q_EMIT actionsChanged();
}
}
QByteArray UnityMenuModelPaths::menuObjectPath() const
{
return m_menuObjectPath;
}
void UnityMenuModelPaths::setMenuObjectPath(const QByteArray &path)
{
if (m_menuObjectPath != path) {
m_menuObjectPath = path;
Q_EMIT menuObjectPathChanged();
}
}
QByteArray UnityMenuModelPaths::busNameHint() const
{
return m_busNameHint;
}
void UnityMenuModelPaths::setBusNameHint(const QByteArray &nameHint)
{
if (m_busNameHint != nameHint) {
m_busNameHint = nameHint;
Q_EMIT busNameHintChanged();
updateData();
}
}
QByteArray UnityMenuModelPaths::actionsHint() const
{
return m_actionsHint;
}
void UnityMenuModelPaths::setActionsHint(const QByteArray &actionsHint)
{
if (m_actionsHint != actionsHint) {
m_actionsHint = actionsHint;
Q_EMIT actionsHintChanged();
updateData();
}
}
QByteArray UnityMenuModelPaths::menuObjectPathHint() const
{
return m_menuObjectPathHint;
}
void UnityMenuModelPaths::setMenuObjectPathHint(const QByteArray &pathHint)
{
if (m_menuObjectPathHint != pathHint) {
m_menuObjectPathHint = pathHint;
Q_EMIT menuObjectPathHintChanged();
updateData();
}
} ./plugins/Utils/constants.h 0000644 0000156 0000165 00000002111 12677430772 016055 0 ustar jenkins jenkins /*
* Copyright 2015 Canonical Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see .
*/
#ifndef CONSTANTS_H
#define CONSTANTS_H
#include
/**
* @brief The Constants class
*
* This singleton class exposes contants to Qml
*
*/
class Constants: public QObject
{
Q_OBJECT
Q_PROPERTY(int indicatorValueTimeout READ indicatorValueTimeout CONSTANT)
public:
Constants(QObject *parent = 0);
int indicatorValueTimeout() const { return m_indicatorValueTimeout; }
private:
int m_indicatorValueTimeout;
};
#endif
./plugins/Utils/activefocuslogger.cpp 0000644 0000156 0000165 00000003600 12677430772 020113 0 ustar jenkins jenkins /*
* Copyright (C) 2015 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#include "activefocuslogger.h"
#include
ActiveFocusLogger::ActiveFocusLogger(QQuickItem *parent)
: QQuickItem(parent)
{
connect(this, &QQuickItem::windowChanged,
this, &ActiveFocusLogger::setupFilterOnWindow);
}
void ActiveFocusLogger::setupFilterOnWindow(QQuickWindow *window)
{
if (!m_window.isNull()) {
disconnect(m_window.data(), nullptr, this, nullptr);
m_window.clear();
}
if (window) {
m_window = window;
QObject::connect(window, &QQuickWindow::activeFocusItemChanged,
this, &ActiveFocusLogger::printActiveFocusInfo);
}
}
void ActiveFocusLogger::printActiveFocusInfo()
{
if (!m_window || !isEnabled()) {
return;
}
qDebug() << "============== Active focus info START ================";
if (m_window->activeFocusItem()) {
qDebug() << m_window->activeFocusItem();
qDebug() << "Ancestry:";
QQuickItem *item = m_window->activeFocusItem()->parentItem();
while (item != nullptr) {
qDebug() << item << ", isFocusScope =" << item->isFocusScope();
item = item->parentItem();
}
} else {
qDebug() << "NULL";
}
qDebug() << "============== Active focus info END ================";
}
./plugins/Utils/inputeventgenerator.cpp 0000644 0000156 0000165 00000002274 12677430772 020516 0 ustar jenkins jenkins /*
* Copyright (C) 2016 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#include "inputeventgenerator.h"
#include
#include
#include
InputEventGenerator::InputEventGenerator(QQuickItem *parent)
: QQuickItem(parent)
{
}
void InputEventGenerator::generateKeyEvent(Qt::Key key, bool pressed, Qt::KeyboardModifiers modifiers, quint64 timestamp, quint32 nativeScanCode, const QString &text)
{
QEvent::Type type = pressed ? QEvent::KeyPress : QEvent::KeyRelease;
QKeyEvent ev(type, key, modifiers, nativeScanCode, 0, 0, text);
ev.setTimestamp(timestamp);
QCoreApplication::sendEvent(window(), &ev);
}
./plugins/Utils/applicationsfiltermodel.cpp 0000644 0000156 0000165 00000005655 12677430772 021331 0 ustar jenkins jenkins /*
* Copyright (C) 2015 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
// unity-api
#include
#include
#include "applicationsfiltermodel.h"
using namespace unity::shell::application;
ApplicationsFilterModel::ApplicationsFilterModel(QObject *parent):
QSortFilterProxyModel(parent),
m_appModel(nullptr),
m_filterTouchApps(false),
m_filterLegacyApps(false)
{
}
ApplicationManagerInterface *ApplicationsFilterModel::applicationsModel() const
{
return m_appModel;
}
void ApplicationsFilterModel::setApplicationsModel(ApplicationManagerInterface *applicationsModel)
{
if (m_appModel != applicationsModel) {
if (m_appModel) {
disconnect(m_appModel, &ApplicationManagerInterface::countChanged, this, &ApplicationsFilterModel::countChanged);
}
m_appModel = applicationsModel;
setSourceModel(m_appModel);
Q_EMIT applicationsModelChanged();
connect(m_appModel, &ApplicationManagerInterface::countChanged, this, &ApplicationsFilterModel::countChanged);
}
}
bool ApplicationsFilterModel::filterTouchApps() const
{
return m_filterTouchApps;
}
void ApplicationsFilterModel::setFilterTouchApps(bool filterTouchApps)
{
if (m_filterTouchApps != filterTouchApps) {
m_filterTouchApps = filterTouchApps;
Q_EMIT filterTouchAppsChanged();
invalidateFilter();
Q_EMIT countChanged();
}
}
bool ApplicationsFilterModel::filterLegacyApps() const
{
return m_filterLegacyApps;
}
void ApplicationsFilterModel::setFilterLegacyApps(bool filterLegacyApps)
{
if (m_filterLegacyApps != filterLegacyApps) {
m_filterLegacyApps = filterLegacyApps;
Q_EMIT filterLegacyAppsChanged();
invalidateFilter();
Q_EMIT countChanged();
}
}
bool ApplicationsFilterModel::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const
{
Q_UNUSED(source_parent);
ApplicationInfoInterface *app = m_appModel->get(source_row);
Q_ASSERT(app);
if (m_filterLegacyApps && !app->isTouchApp()) {
return false;
}
if (m_filterTouchApps && app->isTouchApp()) {
return false;
}
return true;
}
ApplicationInfoInterface *ApplicationsFilterModel::get(int index) const
{
return m_appModel->get(mapToSource(this->index(index, 0)).row());
}
./plugins/Utils/timezoneFormatter.h 0000644 0000156 0000165 00000002004 12677430772 017560 0 ustar jenkins jenkins /*
* Copyright 2015 Canonical Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#ifndef TIMEZONE_FORMATTER_H
#define TIMEZONE_FORMATTER_H
#include
class TimezoneFormatter : public QObject
{
Q_OBJECT
public:
TimezoneFormatter(QObject * parent = nullptr);
~TimezoneFormatter() = default;
Q_INVOKABLE QString currentTimeInTimezone(const QVariant &tzId) const;
Q_INVOKABLE QString currentTimeInTimezoneWithAbbrev(const QVariant &tzId) const;
};
#endif
./plugins/Utils/globalfunctions.h 0000644 0000156 0000165 00000002315 12677430772 017240 0 ustar jenkins jenkins /*
* Copyright 2015 Canonical Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see .
*/
#ifndef GLOBALFUNCTIONS_H
#define GLOBALFUNCTIONS_H
#include
#include
class QQuickItem;
/**
* @brief The GlobalFunctions class
*
* This singleton class exposes utility functions to QML
*
*/
class GlobalFunctions : public QObject
{
Q_OBJECT
public:
explicit GlobalFunctions(QObject *parent = 0);
static Q_INVOKABLE QQuickItem* itemAt(QQuickItem* parent,
int x,
int y,
QJSValue matcher);
};
#endif // GLOBALFUNCTIONS_H
./plugins/Utils/unitysortfilterproxymodelqml.h 0000644 0000156 0000165 00000004132 12677430772 022171 0 ustar jenkins jenkins /*
* Copyright (C) 2012 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#ifndef UNITYSORTFILTERPROXYMODELQML_H
#define UNITYSORTFILTERPROXYMODELQML_H
#include
class UnitySortFilterProxyModelQML : public QSortFilterProxyModel
{
Q_OBJECT
Q_PROPERTY(QAbstractItemModel* model READ sourceModel WRITE setModel NOTIFY modelChanged)
Q_PROPERTY(int totalCount READ totalCount NOTIFY totalCountChanged)
Q_PROPERTY(int count READ count NOTIFY countChanged)
Q_PROPERTY(bool invertMatch READ invertMatch WRITE setInvertMatch NOTIFY invertMatchChanged)
public:
explicit UnitySortFilterProxyModelQML(QObject *parent = 0);
Q_INVOKABLE QVariantMap get(int row); // Use with caution, it can be slow to query all the roles
Q_INVOKABLE QVariant data(int row, int role);
Q_INVOKABLE int count();
Q_INVOKABLE int findFirst(int role, const QVariant& value) const;
Q_INVOKABLE int mapRowToSource(int row);
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;
/* getters */
int totalCount() const;
bool invertMatch() const;
QHash roleNames() const override;
/* setters */
void setModel(QAbstractItemModel *model);
void setInvertMatch(bool invertMatch);
Q_INVOKABLE int mapFromSource(int row);
Q_INVOKABLE int mapToSource(int row);
Q_SIGNALS:
void totalCountChanged();
void countChanged();
void invertMatchChanged(bool);
void modelChanged();
private:
bool m_invertMatch;
};
#endif // UNITYSORTFILTERPROXYMODELQML_H
./plugins/Utils/qvariantlistmodel.h 0000644 0000156 0000165 00000005676 12677430772 017626 0 ustar jenkins jenkins /****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QVARIANTLISTMODEL_H
#define QVARIANTLISTMODEL_H
#include
#include
class Q_CORE_EXPORT QVariantListModel : public QAbstractListModel
{
Q_OBJECT
public:
explicit QVariantListModel(QObject *parent = 0);
explicit QVariantListModel(const QVariantList &list, QObject *parent = 0);
~QVariantListModel();
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
QModelIndex sibling(int row, int column, const QModelIndex &idx) const override;
QVariant data(const QModelIndex &index, int role) const override;
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;
bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;
QVariantList variantList() const;
void setVariantList(const QVariantList &list);
private:
QVariantList lst;
};
#endif // QVARIANTLISTMODEL_H
./plugins/Utils/qmldir 0000644 0000156 0000165 00000000203 12677430772 015103 0 ustar jenkins jenkins module Utils
plugin Utils-qml
typeinfo Utils.qmltypes
Style 0.1 Style.js
singleton EdgeBarrierSettings 0.1 EdgeBarrierSettings.qml
./plugins/Utils/deviceconfigparser.cpp 0000644 0000156 0000165 00000011636 12677430772 020252 0 ustar jenkins jenkins /*
* Copyright 2016 Canonical Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see .
*/
#include "deviceconfigparser.h"
#include
#include
#include
#include
DeviceConfigParser::DeviceConfigParser(QObject *parent): QObject(parent)
{
QString path;
Q_FOREACH (const QString &standardPath, QStandardPaths::standardLocations(QStandardPaths::GenericConfigLocation)) {
if (QFileInfo(standardPath + "/devices.conf").exists()) {
path = standardPath + "/devices.conf";
break;
}
}
if (path.isEmpty()) {
path = "/etc/ubuntu/devices.conf";
}
qDebug() << "Using" << path << "as device configuration file";
m_config = new QSettings(path, QSettings::IniFormat, this);
}
QString DeviceConfigParser::name() const
{
return m_name;
}
void DeviceConfigParser::setName(const QString &name)
{
if (m_name == name) {
return;
}
m_name = name;
Q_EMIT changed();
}
Qt::ScreenOrientation DeviceConfigParser::primaryOrientation() const
{
return stringToOrientation(readOrientationFromConfig("PrimaryOrientation"), Qt::PrimaryOrientation);
}
Qt::ScreenOrientations DeviceConfigParser::supportedOrientations() const
{
QStringList values = readOrientationsFromConfig("SupportedOrientations");
if (values.isEmpty()) {
return Qt::PortraitOrientation
| Qt::InvertedPortraitOrientation
| Qt::LandscapeOrientation
| Qt::InvertedLandscapeOrientation;
}
Qt::ScreenOrientations ret = Qt::PrimaryOrientation;
Q_FOREACH(const QString &orientationString, values) {
ret |= stringToOrientation(orientationString, Qt::PrimaryOrientation);
}
return ret;
}
Qt::ScreenOrientation DeviceConfigParser::landscapeOrientation() const
{
return stringToOrientation(readOrientationFromConfig("LandscapeOrientation"), Qt::LandscapeOrientation);
}
Qt::ScreenOrientation DeviceConfigParser::invertedLandscapeOrientation() const
{
return stringToOrientation(readOrientationFromConfig("InvertedLandscapeOrientation"), Qt::InvertedLandscapeOrientation);
}
Qt::ScreenOrientation DeviceConfigParser::portraitOrientation() const
{
return stringToOrientation(readOrientationFromConfig("PortraitOrientation"), Qt::PortraitOrientation);
}
Qt::ScreenOrientation DeviceConfigParser::invertedPortraitOrientation() const
{
return stringToOrientation(readOrientationFromConfig("InvertedPortraitOrientation"), Qt::InvertedPortraitOrientation);
}
QString DeviceConfigParser::category() const
{
QStringList supportedValues = {"phone", "tablet", "desktop"};
m_config->beginGroup(m_name);
QString value = m_config->value("Category", "phone").toString();
if (!supportedValues.contains(value)) {
qWarning().nospace().noquote() << "Unknown option \"" << value << "\" in " << m_config->fileName()
<< ". Supported options are: " << supportedValues.join(", ") << ".";
return "phone";
}
m_config->endGroup();
return value;
}
QStringList DeviceConfigParser::readOrientationsFromConfig(const QString &key) const
{
m_config->beginGroup(m_name);
QStringList ret;
if (m_config->contains(key)) {
ret = m_config->value(key).toStringList();
}
m_config->endGroup();
return ret;
}
QString DeviceConfigParser::readOrientationFromConfig(const QString &key) const
{
QStringList ret = readOrientationsFromConfig(key);
return ret.count() > 0 ? ret.first() : QString();
}
Qt::ScreenOrientation DeviceConfigParser::stringToOrientation(const QString &orientationString, Qt::ScreenOrientation defaultValue) const
{
if (orientationString == "Landscape") {
return Qt::LandscapeOrientation;
}
if (orientationString == "InvertedLandscape") {
return Qt::InvertedLandscapeOrientation;
}
if (orientationString == "Portrait") {
return Qt::PortraitOrientation;
}
if (orientationString == "InvertedPortrait") {
return Qt::InvertedPortraitOrientation;
}
if (!orientationString.isEmpty()) {
// Some option we don't know. Give some hint on what went wrong.
qWarning().nospace().noquote() << "Unknown option \"" << orientationString << "\" in " << m_config->fileName()
<< ". Supported options are: Landscape, InvertedLandscape, Portrait and InvertedPortrait.";
}
return defaultValue;
}
./plugins/Utils/inputwatcher.h 0000644 0000156 0000165 00000003141 12677430772 016562 0 ustar jenkins jenkins /*
* Copyright (C) 2015 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*
*/
#ifndef UNITY_INPUTWATCHER_H
#define UNITY_INPUTWATCHER_H
#include
#include
/*
Monitors the target object for input events to figure out whether it's pressed
or not.
*/
class InputWatcher : public QObject
{
Q_OBJECT
Q_PROPERTY(QObject* target READ target WRITE setTarget NOTIFY targetChanged)
// Whether the target object is pressed (by either touch or mouse)
Q_PROPERTY(bool targetPressed READ targetPressed NOTIFY targetPressedChanged)
public:
InputWatcher(QObject *parent = nullptr);
QObject *target() const;
void setTarget(QObject *value);
bool targetPressed() const;
bool eventFilter(QObject *watched, QEvent *event) override;
Q_SIGNALS:
void targetChanged(QObject *value);
void targetPressedChanged(bool value);
private:
void setMousePressed(bool value);
void setTouchPressed(bool value);
bool m_mousePressed;
bool m_touchPressed;
QPointer m_target;
};
#endif // UNITY_INPUTWATCHER_H
./plugins/Utils/WindowInputMonitor.cpp 0000644 0000156 0000165 00000007127 12677430772 020247 0 ustar jenkins jenkins /*
* Copyright (C) 2015 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#include "WindowInputMonitor.h"
#include
using namespace UnityUtil;
WindowInputMonitor::WindowInputMonitor(QQuickItem *parent)
: WindowInputMonitor(new Timer, new ElapsedTimer, parent)
{
}
WindowInputMonitor::WindowInputMonitor(UnityUtil::AbstractTimer *timer,
UnityUtil::AbstractElapsedTimer *elapsedTimer,
QQuickItem *parent)
: QQuickItem(parent)
, m_windowBeingTouched(false)
, m_homeKeyPressed(false)
, m_windowLastTouchedTimer(elapsedTimer)
, m_activationTimer(timer)
{
m_windowLastTouchedTimer->start();
connect(this, &QQuickItem::windowChanged,
this, &WindowInputMonitor::setupFilterOnWindow);
connect(m_activationTimer, &UnityUtil::AbstractTimer::timeout,
this, &WindowInputMonitor::emitActivatedIfNoTouchesAround);
m_activationTimer->setInterval(msecsWithoutTouches);
}
WindowInputMonitor::~WindowInputMonitor()
{
delete m_windowLastTouchedTimer;
delete m_activationTimer;
}
bool WindowInputMonitor::eventFilter(QObject *watched, QEvent *event)
{
Q_ASSERT(!m_filteredWindow.isNull());
Q_ASSERT(watched == static_cast(m_filteredWindow.data()));
Q_UNUSED(watched);
update(event);
// We're only monitoring, never filtering out events
return false;
}
void WindowInputMonitor::update(QEvent *event)
{
if (event->type() == QEvent::KeyPress) {
QKeyEvent *keyEvent = static_cast(event);
m_homeKeyPressed = true;
if (keyEvent->key() == Qt::Key_Super_L && !keyEvent->isAutoRepeat()
&& !m_windowBeingTouched
&& m_windowLastTouchedTimer->elapsed() >= msecsWithoutTouches) {
m_activationTimer->start();
}
} else if (event->type() == QEvent::KeyRelease) {
QKeyEvent *keyEvent = static_cast(event);
if (keyEvent->key() == Qt::Key_Super_L) {
m_homeKeyPressed = false;
}
} else if (event->type() == QEvent::TouchBegin) {
m_activationTimer->stop();
m_windowBeingTouched = true;
Q_EMIT touchBegun();
} else if (event->type() == QEvent::TouchEnd) {
m_windowBeingTouched = false;
m_windowLastTouchedTimer->start();
QTouchEvent * touchEv = static_cast(event);
if (touchEv && !touchEv->touchPoints().isEmpty()) {
const QPointF pos = touchEv->touchPoints().last().screenPos();
Q_EMIT touchEnded(pos);
}
}
}
void WindowInputMonitor::setupFilterOnWindow(QQuickWindow *window)
{
if (!m_filteredWindow.isNull()) {
m_filteredWindow->removeEventFilter(this);
m_filteredWindow.clear();
}
if (window) {
window->installEventFilter(this);
m_filteredWindow = window;
}
}
void WindowInputMonitor::emitActivatedIfNoTouchesAround()
{
if (!m_homeKeyPressed && !m_windowBeingTouched &&
(m_windowLastTouchedTimer->elapsed() > msecsWithoutTouches)) {
Q_EMIT homeKeyActivated();
}
}
./plugins/Utils/CMakeLists.txt 0000644 0000156 0000165 00000002340 12677430772 016434 0 ustar jenkins jenkins include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${Qt5Gui_PRIVATE_INCLUDE_DIRS}
${Qt5Quick_PRIVATE_INCLUDE_DIRS}
${GIO_INCLUDE_DIRS}
)
set(QMLPLUGIN_SRC
activefocuslogger.cpp
${APPLICATION_API_INCLUDEDIR}/unity/shell/application/ApplicationManagerInterface.h
applicationsfiltermodel.cpp
constants.cpp
WindowInputMonitor.cpp
inputwatcher.cpp
qlimitproxymodelqml.cpp
unitysortfilterproxymodelqml.cpp
Timer.cpp
unitymenumodelpaths.cpp
windowinputfilter.cpp
windowscreenshotprovider.cpp
easingcurve.cpp
windowstatestorage.cpp
timezoneFormatter.cpp
inputeventgenerator.cpp
deviceconfigparser.cpp
globalfunctions.cpp
plugin.cpp
)
add_library(Utils-qml SHARED
${QMLPLUGIN_SRC}
)
target_link_libraries(Utils-qml ${GIO_LDFLAGS})
# Because this is an internal support library, we want
# to expose all symbols in it. Consider changing this
# either to a static library or just using the
# files directly in targets.
set_target_properties(Utils-qml PROPERTIES COMPILE_FLAGS -fvisibility=default)
qt5_use_modules(Utils-qml Qml Quick DBus Network Gui Sql Concurrent)
add_unity8_plugin(Utils 0.1 Utils TARGETS Utils-qml)
./plugins/Utils/timezoneFormatter.cpp 0000644 0000156 0000165 00000003107 12677430772 020120 0 ustar jenkins jenkins /*
* Copyright 2015 Canonical Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#include
#include "timezoneFormatter.h"
TimezoneFormatter::TimezoneFormatter(QObject *parent)
: QObject(parent)
{
}
QString TimezoneFormatter::currentTimeInTimezone(const QVariant &tzId) const
{
QTimeZone tz(tzId.toByteArray());
if (tz.isValid()) {
const QDateTime now = QDateTime::currentDateTime().toTimeZone(tz);
// return locale-aware string in the form "day, hh:mm", e.g. "Mon 14:30" or "Mon 1:30 pm"
return QStringLiteral("%1 %2").arg(now.toString(QStringLiteral("ddd")), now.time().toString(Qt::DefaultLocaleShortDate));
}
return QString();
}
QString TimezoneFormatter::currentTimeInTimezoneWithAbbrev(const QVariant &tzId) const
{
QTimeZone tz(tzId.toByteArray());
if (tz.isValid()) {
const QDateTime now = QDateTime::currentDateTime().toTimeZone(tz);
return QStringLiteral("%1 %2").arg(now.time().toString(QStringLiteral("h:mm"))).arg(tz.abbreviation(now));
}
return QString();
}
./plugins/Utils/easingcurve.cpp 0000644 0000156 0000165 00000003336 12677430772 016721 0 ustar jenkins jenkins /*
* Copyright 2014 Canonical Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see .
*
* Authors: Michael Zanetti
*/
#include "easingcurve.h"
EasingCurve::EasingCurve(QObject *parent):
QObject(parent),
m_progress(0),
m_value(0)
{
}
QEasingCurve::Type EasingCurve::type() const
{
return m_easingCurve.type();
}
void EasingCurve::setType(const QEasingCurve::Type type)
{
// FIXME: Working around bug https://bugreports.qt-project.org/browse/QTBUG-38686 here
QEasingCurve newCurve;
newCurve.setType(type);
newCurve.setPeriod(m_easingCurve.period());
m_easingCurve = newCurve;
Q_EMIT typeChanged();
}
qreal EasingCurve::period() const
{
return m_easingCurve.period();
}
void EasingCurve::setPeriod(qreal period)
{
m_easingCurve.setPeriod(period);
Q_EMIT periodChanged();
}
qreal EasingCurve::progress() const
{
return m_progress;
}
void EasingCurve::setProgress(qreal progress)
{
if (m_progress != progress) {
m_progress = progress;
m_value = m_easingCurve.valueForProgress(m_progress);
Q_EMIT progressChanged();
}
}
qreal EasingCurve::value() const
{
return m_value;
}
./plugins/Utils/easingcurve.h 0000644 0000156 0000165 00000004142 12677430772 016362 0 ustar jenkins jenkins /*
* Copyright 2014 Canonical Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see .
*
* Authors: Michael Zanetti
*/
#ifndef EASINGCURVE_H
#define EASINGCURVE_H
#include
#include
/**
* @brief The EasingCurve class
*
* This class exposes the QEasingCurve C++ API to QML.
* This is useful for user interactive animations. While the QML Animation types
* all require a "from", "to" and "duration", this one is based on "period" and
* "progress". So you can control the position of the animation by changing the
* progress, also going back and forward in the aimation. Depending on the type
* of the easing curve, value will return the transformed progress.
*/
class EasingCurve: public QObject
{
Q_OBJECT
Q_ENUMS(QEasingCurve::Type)
Q_PROPERTY(QEasingCurve::Type type READ type WRITE setType NOTIFY typeChanged)
Q_PROPERTY(qreal period READ period WRITE setPeriod NOTIFY periodChanged)
Q_PROPERTY(qreal progress READ progress WRITE setProgress NOTIFY progressChanged)
Q_PROPERTY(qreal value READ value NOTIFY progressChanged)
public:
EasingCurve(QObject *parent = 0);
QEasingCurve::Type type() const;
void setType(const QEasingCurve::Type type);
qreal period() const;
void setPeriod(qreal period);
qreal progress() const;
void setProgress(qreal progress);
qreal value() const;
Q_SIGNALS:
void typeChanged();
void periodChanged();
void progressChanged();
private:
QEasingCurve m_easingCurve;
qreal m_progress;
qreal m_value;
};
#endif
./plugins/GlobalShortcut/ 0000755 0000156 0000165 00000000000 12677430772 015531 5 ustar jenkins jenkins ./plugins/GlobalShortcut/plugin.h 0000644 0000156 0000165 00000001663 12677430772 017206 0 ustar jenkins jenkins /*
* Copyright (C) 2015 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#ifndef GLOBALSHORTCUTPLUGIN_H
#define GLOBALSHORTCUTPLUGIN_H
#include
class GlobalShortcutPlugin: public QQmlExtensionPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
public:
void registerTypes(const char *uri) override;
};
#endif // GLOBALSHORTCUTPLUGIN_H
./plugins/GlobalShortcut/GlobalShortcut.qmltypes 0000644 0000156 0000165 00000001646 12677430772 022274 0 ustar jenkins jenkins import QtQuick.tooling 1.1
// This file describes the plugin-supplied types contained in the library.
// It is used for QML tooling purposes only.
//
// This file was auto-generated by:
// 'qmlplugindump -notrelocatable GlobalShortcut 1.0 plugins'
Module {
Component {
name: "GlobalShortcut"
defaultProperty: "data"
prototype: "QQuickItem"
exports: ["GlobalShortcut/GlobalShortcut 1.0"]
exportMetaObjectRevisions: [0]
Property { name: "shortcut"; type: "QVariant" }
Property { name: "active"; type: "bool" }
Signal {
name: "shortcutChanged"
Parameter { name: "shortcut"; type: "QVariant" }
}
Signal {
name: "triggered"
Parameter { name: "shortcut"; type: "string" }
}
Signal {
name: "activeChanged"
Parameter { name: "active"; type: "bool" }
}
}
}
./plugins/GlobalShortcut/globalshortcut.h 0000644 0000156 0000165 00000004111 12677430772 020733 0 ustar jenkins jenkins /*
* Copyright (C) 2015 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#ifndef GLOBALSHORTCUT_H
#define GLOBALSHORTCUT_H
#include
#include
#include
/**
* @brief The GlobalShortcut class
*
* QML component for registering a shortcut; the shortcut itself can be
* specified either as a string ("Ctrl+Alt+L") or as an enum value
* (Qt.ControlModifier|Qt.AltModifier|Qt.Key_L).
*
* When the shortcut is detected, the signal triggered() gets emitted.
*/
class GlobalShortcut: public QQuickItem
{
Q_OBJECT
/**
* The shortcut itself
*/
Q_PROPERTY(QVariant shortcut READ shortcut WRITE setShortcut NOTIFY shortcutChanged)
/**
* Whether the shortcut is active (true by default)
*/
Q_PROPERTY(bool active READ isActive WRITE setActive NOTIFY activeChanged)
public:
GlobalShortcut(QQuickItem *parent = nullptr);
~GlobalShortcut() = default;
QVariant shortcut() const;
void setShortcut(const QVariant &shortcut);
bool isActive() const;
void setActive(bool active);
protected:
void componentComplete() override;
void keyPressEvent(QKeyEvent * event) override;
Q_SIGNALS:
void shortcutChanged(const QVariant &shortcut);
/**
* Emitted when a global keypress of @p shortcut is detected
*/
void triggered(const QString &shortcut);
void activeChanged(bool active);
private Q_SLOTS:
void setupFilterOnWindow(QQuickWindow* window);
private:
QVariant m_shortcut;
bool m_active = true;
};
#endif // GLOBALSHORTCUT_H
./plugins/GlobalShortcut/plugin.cpp 0000644 0000156 0000165 00000001561 12677430772 017536 0 ustar jenkins jenkins /*
* Copyright (C) 2015 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#include "plugin.h"
#include "globalshortcut.h"
#include
void GlobalShortcutPlugin::registerTypes(const char *uri)
{
Q_ASSERT(uri == QLatin1String("GlobalShortcut"));
qmlRegisterType(uri, 1, 0, "GlobalShortcut");
}
./plugins/GlobalShortcut/globalshortcutregistry.h 0000644 0000156 0000165 00000003557 12677430772 022541 0 ustar jenkins jenkins /*
* Copyright (C) 2015 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#ifndef GLOBALSHORTCUT_REGISTRY_H
#define GLOBALSHORTCUT_REGISTRY_H
#include
#include
#include
#include
#include "globalshortcut.h"
typedef QMap>> GlobalShortcutList;
/**
* @brief The GlobalShortcutRegistry class
*
* Serves as a central point for shortcut registration.
*/
class Q_DECL_EXPORT GlobalShortcutRegistry: public QObject
{
Q_OBJECT
public:
GlobalShortcutRegistry(QObject * parent = nullptr);
~GlobalShortcutRegistry() = default;
/**
* @return the list of shortcuts currently registered
*/
GlobalShortcutList shortcuts() const;
/**
* @return whether shortcut @p seq is currently registered
*/
bool hasShortcut(const QVariant &seq) const;
/**
* Adds a shortcut @p seq to the registry
*/
void addShortcut(const QVariant &seq, GlobalShortcut * sc);
/**
* Sets up key events filtering on window @p wid
*/
void setupFilterOnWindow(qulonglong wid);
protected:
bool eventFilter(QObject *obj, QEvent *event) override;
private Q_SLOTS:
void removeShortcut(QObject *obj);
private:
GlobalShortcutList m_shortcuts;
QPointer m_filteredWindow = nullptr;
};
#endif
./plugins/GlobalShortcut/globalshortcutregistry.cpp 0000644 0000156 0000165 00000006356 12677430772 023074 0 ustar jenkins jenkins /*
* Copyright (C) 2015 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#include
#include
#include
#include
#include "globalshortcutregistry.h"
static qulonglong s_windowId = 0;
GlobalShortcutRegistry::GlobalShortcutRegistry(QObject *parent)
: QObject(parent)
{
}
GlobalShortcutList GlobalShortcutRegistry::shortcuts() const
{
return m_shortcuts;
}
bool GlobalShortcutRegistry::hasShortcut(const QVariant &seq) const
{
return m_shortcuts.contains(seq);
}
void GlobalShortcutRegistry::addShortcut(const QVariant &seq, GlobalShortcut *sc)
{
if (sc) {
if (!m_shortcuts.contains(seq)) { // create a new entry
m_shortcuts.insert(seq, {sc});
} else { // append to an existing one
auto shortcuts = m_shortcuts[seq];
shortcuts.append(sc);
m_shortcuts.insert(seq, shortcuts);
}
connect(sc, &GlobalShortcut::destroyed, this, &GlobalShortcutRegistry::removeShortcut);
}
}
void GlobalShortcutRegistry::removeShortcut(QObject *obj)
{
QMutableMapIterator>> it(m_shortcuts);
while (it.hasNext()) {
it.next();
GlobalShortcut * scObj = static_cast(obj);
if (scObj && it.value().contains(scObj)) {
it.value().removeAll(scObj);
if (it.value().isEmpty()) {
it.remove();
}
}
}
}
bool GlobalShortcutRegistry::eventFilter(QObject *obj, QEvent *event)
{
Q_ASSERT(m_filteredWindow);
Q_ASSERT(obj == static_cast(m_filteredWindow.data()));
if (event->type() == QEvent::KeyPress) {
QKeyEvent *keyEvent = static_cast(event);
int seq = keyEvent->key() + keyEvent->modifiers();
if (m_shortcuts.contains(seq)) {
const auto shortcuts = m_shortcuts.value(seq);
Q_FOREACH(const auto &shortcut, shortcuts) {
if (shortcut) {
qApp->sendEvent(shortcut, keyEvent);
event->accept();
}
}
}
return event->isAccepted();
}
return QObject::eventFilter(obj, event);
}
void GlobalShortcutRegistry::setupFilterOnWindow(qulonglong wid)
{
if (wid == s_windowId) {
return;
}
if (m_filteredWindow) {
m_filteredWindow->removeEventFilter(this);
m_filteredWindow.clear();
s_windowId = 0;
}
Q_FOREACH(QWindow *window, qApp->allWindows()) {
if (window && window->winId() == wid) {
m_filteredWindow = window;
window->installEventFilter(this);
s_windowId = wid;
break;
}
}
}
./plugins/GlobalShortcut/qmldir 0000644 0000156 0000165 00000000060 12677430772 016740 0 ustar jenkins jenkins module GlobalShortcut
plugin GlobalShortcut-qml
./plugins/GlobalShortcut/CMakeLists.txt 0000644 0000156 0000165 00000000451 12677430772 020271 0 ustar jenkins jenkins set(globalshortcutplugin_SRCS
globalshortcut.cpp
globalshortcutregistry.cpp
plugin.cpp)
add_library(GlobalShortcut-qml SHARED ${globalshortcutplugin_SRCS})
qt5_use_modules(GlobalShortcut-qml Quick Gui)
add_unity8_plugin(GlobalShortcut 1.0 GlobalShortcut TARGETS GlobalShortcut-qml)
./plugins/GlobalShortcut/globalshortcut.cpp 0000644 0000156 0000165 00000003573 12677430772 021301 0 ustar jenkins jenkins /*
* Copyright (C) 2015 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#include "globalshortcut.h"
#include "globalshortcutregistry.h"
#include
#include
Q_GLOBAL_STATIC(GlobalShortcutRegistry, registry)
GlobalShortcut::GlobalShortcut(QQuickItem *parent)
: QQuickItem(parent)
{
}
QVariant GlobalShortcut::shortcut() const
{
return m_shortcut;
}
void GlobalShortcut::setShortcut(const QVariant &shortcut)
{
if (m_shortcut == shortcut)
return;
m_shortcut = shortcut;
registry->addShortcut(shortcut, this);
Q_EMIT shortcutChanged(shortcut);
}
bool GlobalShortcut::isActive() const
{
return m_active;
}
void GlobalShortcut::setActive(bool active)
{
if (m_active == active)
return;
m_active = active;
Q_EMIT activeChanged(active);
}
void GlobalShortcut::componentComplete()
{
connect(this, &QQuickItem::windowChanged, this, &GlobalShortcut::setupFilterOnWindow);
}
void GlobalShortcut::keyPressEvent(QKeyEvent * event)
{
Q_UNUSED(event)
if (m_active) {
Q_EMIT triggered(m_shortcut.toString());
}
}
void GlobalShortcut::setupFilterOnWindow(QQuickWindow *window)
{
if (!window) {
// qWarning() << Q_FUNC_INFO << "Failed to setup filter on window";
return;
}
registry->setupFilterOnWindow((qulonglong) window->winId());
}
./plugins/Lights/ 0000755 0000156 0000165 00000000000 12677430772 014027 5 ustar jenkins jenkins ./plugins/Lights/plugin.h 0000644 0000156 0000165 00000001775 12677430772 015510 0 ustar jenkins jenkins /*
* Copyright (C) 2014 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*
* Author: Renato Araujo Oliveira Filho
*/
#ifndef LIGHTS_PLUGIN_H
#define LIGHTS_PLUGIN_H
#include
#include
class LightsPlugin : public QQmlExtensionPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
public:
void registerTypes(const char *uri) override;
};
#endif
./plugins/Lights/android-hardware.h 0000644 0000156 0000165 00000001562 12677430772 017417 0 ustar jenkins jenkins /*
* Copyright (C) 2014 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*
*/
// The purpose of this header wrapper is just to avoid having warnings being reported on
// code from external header files, as we can't do anything about them.
#pragma GCC system_header
#include
#include
./plugins/Lights/plugin.cpp 0000644 0000156 0000165 00000002114 12677430772 016027 0 ustar jenkins jenkins /*
* Copyright (C) 2014 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*
* Author: Renato Araujo Oliveira Filho
*/
#include "plugin.h"
#include "Lights.h"
#include
static QObject *lights_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
{
Q_UNUSED(engine)
Q_UNUSED(scriptEngine)
return new Lights();
}
void LightsPlugin::registerTypes(const char *uri)
{
Q_ASSERT(uri == QLatin1String("Lights"));
qmlRegisterSingletonType(uri, 0, 1, "Lights", lights_provider);
}
./plugins/Lights/Lights.cpp 0000644 0000156 0000165 00000007263 12677430772 015775 0 ustar jenkins jenkins /*
* Copyright (C) 2014 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*
* Author: Renato Araujo Oliveira Filho
*/
#include "Lights.h"
#include
extern "C" {
#include "android-hardware.h"
#include
}
Lights::Lights(QObject* parent)
: QObject(parent),
m_lightDevice(0),
m_color("blue"),
m_state(Lights::Off),
m_onMs(1000),
m_offMs(3000)
{
}
Lights::~Lights()
{
if (m_lightDevice) {
hw_device_t* device = (hw_device_t*) m_lightDevice;
device->close(device);
}
}
void Lights::setState(Lights::State newState)
{
if (!init()) {
qWarning() << "No lights device";
return;
}
if (m_state != newState) {
if (newState == Lights::On) {
turnOn();
} else {
turnOff();
}
m_state = newState;
Q_EMIT stateChanged(m_state);
}
}
Lights::State Lights::state() const
{
return m_state;
}
void Lights::setColor(const QColor &color)
{
if (m_color != color) {
m_color = color;
Q_EMIT colorChanged(m_color);
// FIXME: update the color if the light is already on
}
}
QColor Lights::color() const
{
return m_color;
}
int Lights::onMillisec() const
{
return m_onMs;
}
void Lights::setOnMillisec(int onMs)
{
if (m_onMs != onMs) {
m_onMs = onMs;
Q_EMIT onMillisecChanged(m_onMs);
// FIXME: update the property if the light is already on
}
}
int Lights::offMillisec() const
{
return m_offMs;
}
void Lights::setOffMillisec(int offMs)
{
if (m_offMs != offMs) {
m_offMs = offMs;
Q_EMIT offMillisecChanged(m_offMs);
// FIXME: update the property if the light is already on
}
}
bool Lights::init()
{
if (m_lightDevice) {
return true;
}
int err;
hw_module_t* module;
err = hw_get_module(LIGHTS_HARDWARE_MODULE_ID, (hw_module_t const**)&module);
if (err == 0) {
hw_device_t* device;
err = module->methods->open(module, LIGHT_ID_NOTIFICATIONS, &device);
if (err == 0) {
m_lightDevice = (light_device_t*)device;
turnOff();
return true;
} else {
qWarning() << "Failed to access notification lights";
}
} else {
qWarning() << "Failed to initialize lights hardware.";
}
return false;
}
void Lights::turnOn()
{
// pulse
light_state_t state;
memset(&state, 0, sizeof(light_state_t));
state.color = m_color.rgba();
state.flashMode = LIGHT_FLASH_TIMED;
state.flashOnMS = m_onMs;
state.flashOffMS = m_offMs;
state.brightnessMode = BRIGHTNESS_MODE_USER;
if (m_lightDevice->set_light(m_lightDevice, &state) != 0) {
qWarning() << "Failed to turn the light off";
}
}
void Lights::turnOff()
{
light_state_t state;
memset(&state, 0, sizeof(light_state_t));
state.color = 0x00000000;
state.flashMode = LIGHT_FLASH_NONE;
state.flashOnMS = 0;
state.flashOffMS = 0;
state.brightnessMode = 0;
if (m_lightDevice->set_light(m_lightDevice, &state) != 0) {
qWarning() << "Failed to turn the light off";
}
}
./plugins/Lights/Lights.h 0000644 0000156 0000165 00000003645 12677430772 015442 0 ustar jenkins jenkins /*
* Copyright (C) 2014 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*
* Author: Renato Araujo Oliveira Filho
*/
#ifndef UNITY_LIGHTS_H
#define UNITY_LIGHTS_H
#include
#include
struct light_device_t;
class Lights: public QObject
{
Q_OBJECT
Q_ENUMS(State)
Q_PROPERTY(State state READ state WRITE setState NOTIFY stateChanged)
Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
Q_PROPERTY(int onMillisec READ onMillisec WRITE setOnMillisec NOTIFY onMillisecChanged)
Q_PROPERTY(int offMillisec READ offMillisec WRITE setOffMillisec NOTIFY offMillisecChanged)
public:
enum State {
Off,
On,
};
explicit Lights(QObject *parent = 0);
~Lights();
void setState(State newState);
State state() const;
void setColor(const QColor &color);
QColor color() const;
int onMillisec() const;
void setOnMillisec(int onMs);
int offMillisec() const;
void setOffMillisec(int offMs);
Q_SIGNALS:
void stateChanged(State newState);
void colorChanged(const QColor &color);
void onMillisecChanged(int onMs);
void offMillisecChanged(int offMs);
private:
light_device_t* m_lightDevice;
QColor m_color;
State m_state;
int m_onMs;
int m_offMs;
bool init();
void turnOff();
void turnOn();
};
#endif
./plugins/Lights/qmldir 0000644 0000156 0000165 00000000071 12677430772 015240 0 ustar jenkins jenkins module Lights
plugin Lights-qml
typeinfo Lights.qmltypes
./plugins/Lights/CMakeLists.txt 0000644 0000156 0000165 00000000622 12677430772 016567 0 ustar jenkins jenkins pkg_check_modules(ANDROID_HEADERS REQUIRED android-headers)
pkg_check_modules(ANDROID_HARDWARE REQUIRED libhardware)
include_directories(
${ANDROID_HEADERS_INCLUDE_DIRS}
)
add_library(Lights-qml MODULE
plugin.cpp
Lights.cpp
)
qt5_use_modules(Lights-qml Qml Gui)
target_link_libraries(Lights-qml ${ANDROID_HARDWARE_LIBRARIES})
add_unity8_plugin(Lights 0.1 Lights TARGETS Lights-qml)
./plugins/Lights/Lights.qmltypes 0000644 0000156 0000165 00000002371 12677430772 017064 0 ustar jenkins jenkins import QtQuick.tooling 1.1
// This file describes the plugin-supplied types contained in the library.
// It is used for QML tooling purposes only.
//
// This file was auto-generated by:
// 'qmlplugindump -notrelocatable Lights 0.1 plugins'
Module {
Component {
name: "Lights"
prototype: "QObject"
exports: ["Lights/Lights 0.1"]
isCreatable: false
isSingleton: true
exportMetaObjectRevisions: [0]
Enum {
name: "State"
values: {
"Off": 0,
"On": 1
}
}
Property { name: "state"; type: "State" }
Property { name: "color"; type: "QColor" }
Property { name: "onMillisec"; type: "int" }
Property { name: "offMillisec"; type: "int" }
Signal {
name: "stateChanged"
Parameter { name: "newState"; type: "State" }
}
Signal {
name: "colorChanged"
Parameter { name: "color"; type: "QColor" }
}
Signal {
name: "onMillisecChanged"
Parameter { name: "onMs"; type: "int" }
}
Signal {
name: "offMillisecChanged"
Parameter { name: "offMs"; type: "int" }
}
}
}
./plugins/Ubuntu/ 0000755 0000156 0000165 00000000000 12677430772 014057 5 ustar jenkins jenkins ./plugins/Ubuntu/Gestures/ 0000755 0000156 0000165 00000000000 12677430773 015661 5 ustar jenkins jenkins ./plugins/Ubuntu/Gestures/FloatingFlickable.cpp 0000644 0000156 0000165 00000011326 12677430772 021727 0 ustar jenkins jenkins /*
* Copyright (C) 2015 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#include "FloatingFlickable.h"
#include
#include "DirectionalDragArea.h"
#include
FloatingFlickable::FloatingFlickable(QQuickItem *parent)
: QQuickItem(parent)
, m_mousePressed(false)
{
m_dragArea = new DirectionalDragArea(this);
m_dragArea->setWidth(width());
m_dragArea->setHeight(height());
m_dragArea->setDirection(Direction::Horizontal);
connect(m_dragArea, &DirectionalDragArea::touchXChanged,
this, &FloatingFlickable::onDragAreaTouchPosChanged);
connect(m_dragArea, &DirectionalDragArea::touchYChanged,
this, &FloatingFlickable::onDragAreaTouchPosChanged);
connect(m_dragArea, &DirectionalDragArea::draggingChanged,
this, &FloatingFlickable::onDragAreaDraggingChanged);
connect(m_dragArea, &DirectionalDragArea::directionChanged, this, &FloatingFlickable::directionChanged);
m_flickable = new QQuickFlickable(this);
m_flickable->setEnabled(false);
m_flickable->setWidth(width());
m_flickable->setHeight(height());
connect(m_flickable, &QQuickFlickable::contentWidthChanged, this, &FloatingFlickable::contentWidthChanged);
connect(m_flickable, &QQuickFlickable::contentHeightChanged, this, &FloatingFlickable::contentHeightChanged);
connect(m_flickable, &QQuickFlickable::contentXChanged, this, &FloatingFlickable::contentXChanged);
connect(m_flickable, &QQuickFlickable::contentYChanged, this, &FloatingFlickable::contentYChanged);
connect(this, &QQuickItem::widthChanged, this, &FloatingFlickable::updateChildrenWidth);
connect(this, &QQuickItem::heightChanged, this, &FloatingFlickable::updateChildrenHeight);
}
qreal FloatingFlickable::contentWidth() const
{
return m_flickable->contentWidth();
}
void FloatingFlickable::setContentWidth(qreal contentWidth)
{
m_flickable->setContentWidth(contentWidth);
}
qreal FloatingFlickable::contentHeight() const
{
return m_flickable->contentHeight();
}
void FloatingFlickable::setContentHeight(qreal contentHeight)
{
m_flickable->setContentHeight(contentHeight);
}
qreal FloatingFlickable::contentX() const
{
return m_flickable->contentX();
}
void FloatingFlickable::setContentX(qreal contentX)
{
m_flickable->setContentX(contentX);
}
qreal FloatingFlickable::contentY() const
{
return m_flickable->contentY();
}
void FloatingFlickable::setContentY(qreal contentY)
{
m_flickable->setContentY(contentY);
}
Direction::Type FloatingFlickable::direction() const
{
return m_dragArea->direction();
}
void FloatingFlickable::setDirection(Direction::Type direction)
{
m_dragArea->setDirection(direction);
if (Direction::isHorizontal(direction)) {
m_flickable->setFlickableDirection(QQuickFlickable::HorizontalFlick);
} else {
m_flickable->setFlickableDirection(QQuickFlickable::VerticalFlick);
}
}
void FloatingFlickable::updateChildrenWidth()
{
m_dragArea->setWidth(width());
m_flickable->setWidth(width());
}
void FloatingFlickable::updateChildrenHeight()
{
m_dragArea->setHeight(height());
m_flickable->setHeight(height());
}
void FloatingFlickable::onDragAreaTouchPosChanged(qreal)
{
if (m_mousePressed) {
QMouseEvent mouseEvent(QEvent::MouseMove,
QPointF(m_dragArea->touchX(),m_dragArea->touchY()),
Qt::NoButton, Qt::LeftButton, Qt::NoModifier);
QCoreApplication::sendEvent(m_flickable, &mouseEvent);
}
}
void FloatingFlickable::onDragAreaDraggingChanged(bool dragging)
{
if (dragging && !m_mousePressed) {
QMouseEvent mouseEvent(QEvent::MouseButtonPress,
QPointF(m_dragArea->touchX(),m_dragArea->touchY()),
Qt::LeftButton, Qt::LeftButton, Qt::NoModifier);
QCoreApplication::sendEvent(m_flickable, &mouseEvent);
m_mousePressed = true;
} else if (!dragging && m_mousePressed) {
QMouseEvent mouseEvent(QEvent::MouseButtonRelease,
QPointF(m_dragArea->touchX(),m_dragArea->touchY()),
Qt::LeftButton, Qt::LeftButton, Qt::NoModifier);
QCoreApplication::sendEvent(m_flickable, &mouseEvent);
m_mousePressed = false;
}
}
./plugins/Ubuntu/Gestures/TouchDispatcher.h 0000644 0000156 0000165 00000006102 12677430772 021121 0 ustar jenkins jenkins /*
* Copyright (C) 2014-2015 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#ifndef UBUNTU_TOUCH_DISPATCHER_H
#define UBUNTU_TOUCH_DISPATCHER_H
#include "UbuntuGesturesQmlGlobal.h"
#include
#include
/*
Dispatches touches to the given target, converting the touch point
coordinates accordingly.
Also takes care of synthesizing mouse events in case the target
doesn't work with touch events.
*/
class UBUNTUGESTURESQML_EXPORT TouchDispatcher {
public:
TouchDispatcher();
void setTargetItem(QQuickItem *target);
QQuickItem *targetItem() { return m_targetItem; }
void dispatch(QTouchDevice *device,
Qt::KeyboardModifiers modifiers,
const QList &touchPoints,
QWindow *window,
ulong timestamp);
void reset();
enum Status {
NoActiveTouch,
DeliveringTouchEvents,
DeliveringMouseEvents,
TargetRejectedTouches
};
private:
void dispatchTouchBegin(
QTouchDevice *device,
Qt::KeyboardModifiers modifiers,
const QList &touchPoints,
QWindow *window,
ulong timestamp);
void dispatchAsTouch(QEvent::Type eventType,
QTouchDevice *device,
Qt::KeyboardModifiers modifiers,
const QList &touchPoints,
QWindow *window,
ulong timestamp);
void dispatchAsMouse(
QTouchDevice *device,
Qt::KeyboardModifiers modifiers,
const QList &touchPoints,
ulong timestamp);
static void transformTouchPoints(QList