kde/plasma-desktop: vendor full-fork (path=source); gitlab archive blake3 is non-deterministic so vendoring is the only reproducible path

This commit is contained in:
2026-08-01 04:48:46 +03:00
parent 510404fd2b
commit bdc78201c1
4615 changed files with 1382060 additions and 2 deletions
+5 -2
View File
@@ -4,8 +4,11 @@ version = "6.7.2"
#TODO: plasma-desktop — KDE desktop settings. Depends on plasma-workspace.
[source]
tar = "https://invent.kde.org/plasma/plasma-desktop/-/archive/v6.7.2/plasma-desktop-v6.7.2.tar.gz"
blake3 = "166ee7ac2270e5742411152dca338de8f15501faf0aa5bc15a66e0936afbaea5"
# Vendored full-fork: builds from committed source/ (offline). GitLab archive
# tarballs are non-deterministic (regenerated per request) so no stable blake3 —
# vendoring is the only reproducible option.
# upstream: https://invent.kde.org/plasma/plasma-desktop/-/archive/v6.7.2/plasma-desktop-v6.7.2.tar.gz
path = "source"
[build]
template = "custom"
@@ -0,0 +1,4 @@
[General]
disableUnqualifiedAccess = "i18n,i18nc,i18nd,i18ndc,i18ncp,i18np,xi18nc,kcm"
warnOnUsage = "plasmoid"
disableHeuristic = false
@@ -0,0 +1,6 @@
# clang-format
bd3c925dc98fc02a23f4f8ce73497f958db53188
a413ebc786c4c471728cfc4eacaa7c33948d9324
1e8dacf6ba5c7d985100cc74bbcf2a8ca2906f31
# qAsConst to std::as_const
e57c6a6e5c5f9939f8a508e8ca22e6958d3d268f
@@ -0,0 +1,30 @@
.vscode
# Ignore the following files
*~
*.[oa]
*.diff
*.kate-swp
*.kdev4
.kdev_include_paths
*.kdevelop.pcs
*.moc
*.moc.cpp
*.orig
*.user
.*.swp
.swp.*
Doxyfile
Makefile
avail
random_seed
/build*/
CMakeLists.txt.user*
*.unc-backup*
.clang-format
/build*/
cmake-build-debug*
.idea
/compile_commands.json
.clangd
.cache
*.qmlls.ini
@@ -0,0 +1,12 @@
# SPDX-FileCopyrightText: None
# SPDX-License-Identifier: CC0-1.0
include:
- project: sysadmin/ci-utilities
file:
- /gitlab-templates/linux-qt6.yml
- /gitlab-templates/freebsd-qt6.yml
- /gitlab-templates/xml-lint.yml
- /gitlab-templates/yaml-lint.yml
- /gitlab-templates/qml-lint.yml
- /gitlab-templates/linux-qt6-next.yml
@@ -0,0 +1,73 @@
# SPDX-FileCopyrightText: None
# SPDX-License-Identifier: CC0-1.0
Dependencies:
- 'on': ['@all']
'require':
'frameworks/attica': '@latest-kf6'
'frameworks/baloo': '@latest-kf6'
'frameworks/extra-cmake-modules': '@latest-kf6'
'frameworks/kcmutils': '@latest-kf6'
'frameworks/kcodecs': '@latest-kf6'
'frameworks/kcompletion': '@latest-kf6'
'frameworks/kconfig': '@latest-kf6'
'frameworks/kconfigwidgets': '@latest-kf6'
'frameworks/kcoreaddons': '@latest-kf6'
'frameworks/kcrash': '@latest-kf6'
'frameworks/kdbusaddons': '@latest-kf6'
'frameworks/kfilemetadata': '@latest-kf6'
'frameworks/kglobalaccel': '@latest-kf6'
'frameworks/kguiaddons': '@latest-kf6'
'frameworks/ki18n': '@latest-kf6'
'frameworks/kiconthemes': '@latest-kf6'
'frameworks/kio': '@latest-kf6'
'frameworks/kitemmodels': '@latest-kf6'
'frameworks/kitemviews': '@latest-kf6'
'frameworks/kjobwidgets': '@latest-kf6'
'frameworks/knewstuff': '@latest-kf6'
'frameworks/knotifications': '@latest-kf6'
'frameworks/knotifyconfig': '@latest-kf6'
'frameworks/kpackage': '@latest-kf6'
'frameworks/kparts': '@latest-kf6'
'frameworks/krunner': '@latest-kf6'
'frameworks/kservice': '@latest-kf6'
'frameworks/ktextwidgets': '@latest-kf6'
'frameworks/kwidgetsaddons': '@latest-kf6'
'frameworks/kwindowsystem': '@latest-kf6'
'frameworks/kxmlgui': '@latest-kf6'
'frameworks/solid': '@latest-kf6'
'frameworks/sonnet': '@latest-kf6'
'frameworks/kunitconversion': '@latest-kf6'
'plasma/libplasma': '@same'
'plasma/plasma-sdk': '@same'
'plasma/libksysguard': '@same'
'plasma/breeze': '@same'
'plasma/plasma-workspace': '@same'
'plasma/powerdevil': '@same'
'plasma/systemsettings': '@same'
'plasma/plasma-activities': '@same'
'plasma/plasma-activities-stats': '@same'
'third-party/packagekit-qt': '@latest'
'third-party/wayland': '@latest'
'third-party/wayland-protocols': '@latest'
'libraries/kirigami-addons': '@latest-kf6'
'network/kaccounts-integration': '@latest-kf6'
RuntimeDependencies:
- 'on': ['@all']
'require':
'plasma/plasma-integration': '@same'
- 'on': ['Linux']
'require':
'frameworks/kded': '@latest-kf6'
'frameworks/qqc2-desktop-style': '@latest-kf6'
'network/kio-extras': '@latest-kf6'
'plasma/kactivitymanagerd': '@same'
'plasma/plasma-pa': '@same'
'sdk/selenium-webdriver-at-spi': '@same'
Options:
ctest-arguments: '--repeat until-pass:5'
require-passing-tests-on: ['@all']
xml-validate-ignore: ['kcms/keyboard/tests/config/base.bad.xml']
run-qmllint: true
@@ -0,0 +1 @@
v6.7.2
@@ -0,0 +1,12 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: plasma-desktop
Upstream-Contact: KDE <community@kde.org>
Source: https://invent.kde.org/plasma/plasma-desktop/
Files: emojier/data/*.dict
Copyright: Unicode, Inc.
License: Unicode-DFS-2016
Files: kcms/runners/plugininstaller/autotests
Copyright: Alexander Lohnau
License: CC0-1.0
@@ -0,0 +1 @@
https://ev.kde.org/.well-known/funding.json
@@ -0,0 +1,359 @@
cmake_minimum_required(VERSION 3.16)
project(plasma-desktop)
set(PROJECT_VERSION "6.7.2")
string(REPLACE "." ";" VERSION_LIST ${PROJECT_VERSION})
list(GET VERSION_LIST 0 PROJECT_VERSION_MAJOR)
set(PROJECT_DEP_VERSION "6.7.0")
set(QT_MIN_VERSION "6.10.0")
set(KF6_MIN_VERSION "6.26.0")
set(ACCOUNTSQT_DEP_VERSION "1.13")
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(ECM ${KF6_MIN_VERSION} REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
set(INSTALL_SDDM_THEME TRUE)
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(ECMFindQmlModule)
include(ECMGenerateExportHeader)
include(ECMInstallIcons)
include(ECMMarkAsTest)
include(ECMMarkNonGuiExecutable)
include(ECMOptionalAddSubdirectory)
include(ECMQtDeclareLoggingCategory)
include(ECMSetupVersion)
include(FeatureSummary)
include(CheckIncludeFiles)
include(KDEClangFormat)
include(KDEGitCommitHooks)
include(ECMQmlModule)
include(ECMConfiguredInstall)
option(BUILD_DOC "Whether to build the documentation" ON)
option(BUILD_KCM_MOUSE_KWIN_WAYLAND "Build the Mouse KCM's KWin+Wayland backend" ON)
option(BUILD_KCM_MOUSE_X11 "Build the Mouse KCM's X11 backend" ON)
option(BUILD_KCM_TOUCHPAD_KWIN_WAYLAND "Build the Touchpad KCM's KWin+Wayland backend" ON)
option(BUILD_KCM_TOUCHPAD_X11 "Build the Touchpad KCM's X11 backend" ON)
option(BUILD_KCM_TABLET "Build the Tablet KCM" ON)
find_package(Qt6 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
Quick
QuickWidgets
DBus
Widgets
Svg
Concurrent
Core5Compat
ShaderTools
Sql # kcms/activities
)
if (Qt6Gui_VERSION VERSION_GREATER_EQUAL "6.10.0")
find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE)
endif()
if(BUILD_KCM_TABLET)
find_package(Qt6WaylandClient ${QT_MIN_VERSION} CONFIG REQUIRED)
endif()
find_package(KF6 ${KF6_MIN_VERSION} REQUIRED COMPONENTS
Auth
Crash
Config
I18n
KCMUtils
NewStuff
KIO
Notifications
NotifyConfig
Attica
Runner
GlobalAccel
CoreAddons # KSharedDataCache required by KImageCache, KStringHandler required by FolderModel
GuiAddons # KImageCache
DBusAddons
Config
WidgetsAddons
Codecs
Sonnet
Package
IconThemes
XmlGui
Svg
)
find_package(Plasma5Support ${PROJECT_DEP_VERSION} REQUIRED)
find_package(Plasma ${PROJECT_DEP_VERSION} REQUIRED)
find_package(PlasmaQuick ${PROJECT_DEP_VERSION} REQUIRED)
find_package(PlasmaActivities ${PROJECT_DEP_VERSION} REQUIRED)
find_package(PlasmaActivitiesStats ${PROJECT_DEP_VERSION} REQUIRED)
if(BUILD_TESTING)
find_package(Qt6Test ${QT_MIN_VERSION} CONFIG REQUIRED)
include(ECMAddTests)
endif()
if(BUILD_DOC)
find_package(KF6DocTools ${KF6_MIN_VERSION})
set_package_properties(KF6DocTools PROPERTIES
DESCRIPTION "Tools to generate documentation"
TYPE REQUIRED
)
endif()
find_package(AccountsQt6 ${ACCOUNTSQT_DEP_VERSION} CONFIG)
set_package_properties(AccountsQt6 PROPERTIES
DESCRIPTION "Accounts management library for Qt applications"
URL "https://gitlab.com/accounts-sso/libaccounts-qt"
PURPOSE "Required for building the OpenDesktop integration plugin"
TYPE OPTIONAL
)
find_package(KAccounts6 20.04)
set_package_properties(KAccounts6 PROPERTIES
DESCRIPTION "Accounts management library for KDE applications"
PURPOSE "Required for building the OpenDesktop integration plugin"
TYPE OPTIONAL
)
find_package(PkgConfig REQUIRED)
pkg_check_modules(SignOnOAuth2 IMPORTED_TARGET signon-oauth2plugin)
set_package_properties(signon-oauth2plugin PROPERTIES
DESCRIPTION "Plugin for SignOnQt6 which handles OAuth and OAuth2 logins"
URL "https://gitlab.com/accounts-sso/signon-plugin-oauth2"
PURPOSE "Required for running the OpenDesktop integration plugin"
TYPE RUNTIME
)
find_package(KF6Kirigami ${KF6_MIN_VERSION} CONFIG)
set_package_properties(KF6Kirigami PROPERTIES
DESCRIPTION "A QtQuick based components set"
PURPOSE "Required at runtime by many KCMs"
TYPE RUNTIME
)
find_package(KF6KirigamiAddons 1.0.0 CONFIG)
set_package_properties(KF6KirigamiAddons PROPERTIES
DESCRIPTION "Extra controls for Kirigami applications"
PURPOSE "Required at runtime for Kickoff"
TYPE RUNTIME
)
find_package(KF6QQC2DesktopStyle ${KF6_MIN_VERSION} CONFIG)
set_package_properties(KF6QQC2DesktopStyle PROPERTIES
DESCRIPTION "QtQuickControls 2 style that uses QWidget's QStyle for painting"
PURPOSE "Required at runtime by many KCMs"
TYPE RUNTIME
)
if(BUILD_KCM_TABLET)
find_package(Canberra)
set_package_properties(Canberra PROPERTIES
TYPE REQUIRED
PURPOSE "Required for building Tablet input KCM"
)
find_package(WaylandProtocols 1.44)
set_package_properties(WaylandProtocols PROPERTIES
TYPE REQUIRED
PURPOSE "Collection of Wayland protocols that add functionality not available in the Wayland core protocol"
URL "https://gitlab.freedesktop.org/wayland/wayland-protocols/"
)
find_package(Wayland 1.2)
set_package_properties(Wayland PROPERTIES
TYPE REQUIRED
PURPOSE "Required for building Tablet input KCM"
)
pkg_check_modules(LIBWACOM libwacom REQUIRED IMPORTED_TARGET)
endif()
find_package(SDL2 2.0.16)
set_package_properties(SDL2 PROPERTIES
TYPE OPTIONAL
PURPOSE "Required for building Game Controller KCM"
)
find_package(LibKLookAndFeel ${PROJECT_DEP_VERSION} CONFIG REQUIRED)
find_package(LibKWorkspace ${PROJECT_DEP_VERSION} CONFIG REQUIRED)
find_package(LibNotificationManager ${PROJECT_DEP_VERSION} CONFIG REQUIRED)
find_package(LibTaskManager ${PROJECT_DEP_VERSION} CONFIG REQUIRED)
find_package(KWinDBusInterface CONFIG REQUIRED)
find_package(ScreenSaverDBusInterface CONFIG REQUIRED)
find_package(KRunnerAppDBusInterface CONFIG REQUIRED)
find_package(KSMServerDBusInterface CONFIG REQUIRED)
find_package(KF6ItemModels CONFIG REQUIRED)
find_package(KSysGuard CONFIG REQUIRED)
find_package(KF6KDED CONFIG REQUIRED)
find_package(KF6Baloo ${KF6_MIN_VERSION})
set_package_properties(KF6Baloo PROPERTIES
DESCRIPTION "File Searching"
PURPOSE "Needed to build the File Search KCM"
TYPE RECOMMENDED
)
find_package(X11)
set_package_properties(X11 PROPERTIES
DESCRIPTION "X11 libraries"
URL "https://www.x.org"
PURPOSE "Required for building the X11 based workspace"
TYPE REQUIRED
)
if(X11_FOUND)
set(HAVE_X11 1)
endif()
find_package(UDev)
set_package_properties(UDev PROPERTIES
DESCRIPTION "API for enumerating and introspecting local devices (part of systemd)"
URL "https://www.freedesktop.org/wiki/Software/systemd/"
PURPOSE "Required for device discovery in keyboard daemon and game controller kcm"
TYPE OPTIONAL
)
find_package(XCB
REQUIRED COMPONENTS
XCB SHM IMAGE
OPTIONAL_COMPONENTS
XKB XINPUT ATOM RECORD
)
if (BUILD_KCM_TOUCHPAD_X11)
find_package(X11_XCB)
set_package_properties(X11_XCB PROPERTIES
PURPOSE "Required for touchpad KCM (X11 backend) when option BUILD_KCM_TOUCHPAD_X11=ON"
TYPE REQUIRED
)
endif()
set_package_properties(XCB PROPERTIES TYPE REQUIRED)
add_feature_info("XCB-XKB" XCB_XKB_FOUND "Required for building kcm/keyboard")
pkg_check_modules(XORGLIBINPUT xorg-libinput IMPORTED_TARGET)
pkg_check_modules(XORGSERVER xorg-server IMPORTED_TARGET)
pkg_check_modules(XKBREGISTRY xkbregistry REQUIRED IMPORTED_TARGET)
ecm_find_qmlmodule(org.kde.pipewire 0.1)
if(XORGLIBINPUT_FOUND)
set(HAVE_XORGLIBINPUT 1)
endif()
include(ConfigureChecks.cmake)
find_package(PackageKitQt6)
set_package_properties(PackageKitQt6 PROPERTIES
DESCRIPTION "Software Manager integration"
PURPOSE "Used in the KRunner plugin installer"
TYPE OPTIONAL
)
if(PackageKitQt6_FOUND)
set(HAVE_PACKAGEKIT TRUE)
endif()
find_package(GLIB2)
set_package_properties(GLIB2 PROPERTIES
PURPOSE "Required for building kimpanel"
TYPE OPTIONAL
)
# For kimpanel
pkg_check_modules(IBUS "ibus-1.0>=1.5.0" IMPORTED_TARGET)
pkg_check_modules(GOBJECT gobject-2.0 IMPORTED_TARGET)
pkg_check_modules(SCIM scim IMPORTED_TARGET)
ecm_setup_version(${PROJECT_VERSION} VARIABLE_PREFIX PLASMA VERSION_HEADER plasma_version.h)
include_directories("${CMAKE_CURRENT_BINARY_DIR}")
add_definitions(
-DQT_NO_CONTEXTLESS_CONNECT
)
configure_file(config-workspace.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-workspace.h)
configure_file(config-X11.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-X11.h)
configure_file(config-build-options.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-build-options.h)
plasma_install_package(desktoppackage org.kde.plasma.desktop shells shell)
if (INSTALL_SDDM_THEME)
configure_file(sddm-theme/theme.conf.cmake ${CMAKE_CURRENT_BINARY_DIR}/sddm-theme/theme.conf)
# Install the login theme into the SDDM directory
#NOTE this trailing slash is important to rename the directory
install(DIRECTORY sddm-theme/
DESTINATION ${KDE_INSTALL_FULL_DATADIR}/sddm/themes/breeze
PATTERN "README.txt" EXCLUDE
PATTERN "components" EXCLUDE
PATTERN "dummydata" EXCLUDE
PATTERN "theme.conf.cmake" EXCLUDE
)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/sddm-theme/theme.conf
DESTINATION ${KDE_INSTALL_FULL_DATADIR}/sddm/themes/breeze
)
endif()
add_subdirectory(layout-templates)
add_subdirectory(runners)
add_subdirectory(containments)
add_subdirectory(toolboxes)
add_subdirectory(applets)
add_subdirectory(kcms)
add_subdirectory(knetattach)
if(KAccounts6_FOUND AND AccountsQt6_FOUND)
add_subdirectory(attica-kde)
endif()
add_subdirectory(imports/activitymanager/)
add_subdirectory(solid-device-automounter)
add_subdirectory(emojier)
if(X11_Xkb_FOUND AND XCB_XKB_FOUND)
add_subdirectory(kaccess)
endif()
install(FILES org.kde.plasmashell.metainfo.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
install(FILES kde-mimeapps.list DESTINATION ${KDE_INSTALL_APPDIR})
install(FILES kconf_update/50-krunner-activate-typing.upd DESTINATION ${KDE_INSTALL_KCONFUPDATEDIR})
install(PROGRAMS kconf_update/50-krunner-activate-typing.sh DESTINATION ${KDE_INSTALL_KCONFUPDATEDIR})
# add clang-format target for all our real source files
file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h)
kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
find_package(XdgUserDir)
set_package_properties(XdgUserDir PROPERTIES
DESCRIPTION "Xdg-user-dir script"
PURPOSE "Used to translate default paths in KCM desktoppath"
TYPE RUNTIME
)
find_package(FontNotoColorEmoji)
set_package_properties(FontNotoColorEmoji PROPERTIES
PURPOSE "Default emoji font, needed to display emojis properly in Emoji Selector"
URL "https://www.google.com/get/noto/"
TYPE RUNTIME
)
add_subdirectory(appiumtests)
if(BUILD_DOC)
add_subdirectory(doc)
kdoctools_install(po)
endif()
ki18n_install(po)
@@ -0,0 +1,74 @@
## Code Map
### `applets/`
Various desktop-specific applets. Look inside the specific applet directories for more info.
### `emojier/`
The Emoji Selector, bound to Meta+dot by default.
### `kcms/`
KCMs are KDE Config Modules, which make up System Settings. Desktop-specific ones can be found here.
### `runners/`
Runners are plugins for KRunner, the launcher system used throughout Plasma. Only two runners are provided here:
- `plasma-desktop`, which provides access to the Plasma and KWin scripting consoles.
- `kwin`, which provides access to the KWin debug console.
Most of the interesting runners are in plasma-workspace and other component repos.
### `toolboxes/`
UI for the "Edit Mode" in Plasma. See also the `ConfigOverlay.qml` in `containments/` for the UI elements for editing individual applets.
### `containments/`
The panel, desktop, and folder view containments.
### `desktoppackage/contents/updates/`
Update scripts used to ensure that Plasma updates go smoothly, such as migrating settings whenever the configuration format changes.
### `desktoppackage/contents/configuration/`
UI for the config and about dialogs and popups of applets and containments.
### `desktoppackage/contents/applet/`
UI shells for the applet, like the applet loading error page and the CompactRepresentation.
### `desktoppackage/contents/explorer/`
UI related to adding and changing applets — the add widgets sidebar and the applet alternatives menu.
### `desktoppackage/contents/views`
UI for the panel and desktop.
### `layout-templates/`
Templates for the items in the "Add Panel…" menu on the desktop: default panel, empty panel, and global menubar.
### `solid-device-automounter/`
Provides the KCM, library, and KDE Daemon (kded) plugin for handling and configuring the automatic mounting of any removable devices plugged in.
### `kaccess/`
Accessibility daemon.
### `knetattach/`
Wizard to add a network folder.
### `imports/activitymanager/`
Provides the `org.kde.plasma.activityswitcher` QML import. Used in various applets to interact with and handle Activities.
### `attica-kde/`
Attica is the KDE Framework for interacting with Open Collaboration Services, used in KDE for the Get New Stuff system. The part here is the plugin for integrating the OCS accounts system into Plasma.
@@ -0,0 +1,397 @@
GNU Free Documentation License
Version 1.2, November 2002
Copyright (C) 2000,2001,2002 Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
0. PREAMBLE
The purpose of this License is to make a manual, textbook, or other
functional and useful document "free" in the sense of freedom: to
assure everyone the effective freedom to copy and redistribute it,
with or without modifying it, either commercially or noncommercially.
Secondarily, this License preserves for the author and publisher a way
to get credit for their work, while not being considered responsible
for modifications made by others.
This License is a kind of "copyleft", which means that derivative
works of the document must themselves be free in the same sense. It
complements the GNU General Public License, which is a copyleft
license designed for free software.
We have designed this License in order to use it for manuals for free
software, because free software needs free documentation: a free
program should come with manuals providing the same freedoms that the
software does. But this License is not limited to software manuals;
it can be used for any textual work, regardless of subject matter or
whether it is published as a printed book. We recommend this License
principally for works whose purpose is instruction or reference.
1. APPLICABILITY AND DEFINITIONS
This License applies to any manual or other work, in any medium, that
contains a notice placed by the copyright holder saying it can be
distributed under the terms of this License. Such a notice grants a
world-wide, royalty-free license, unlimited in duration, to use that
work under the conditions stated herein. The "Document", below,
refers to any such manual or work. Any member of the public is a
licensee, and is addressed as "you". You accept the license if you
copy, modify or distribute the work in a way requiring permission
under copyright law.
A "Modified Version" of the Document means any work containing the
Document or a portion of it, either copied verbatim, or with
modifications and/or translated into another language.
A "Secondary Section" is a named appendix or a front-matter section of
the Document that deals exclusively with the relationship of the
publishers or authors of the Document to the Document's overall subject
(or to related matters) and contains nothing that could fall directly
within that overall subject. (Thus, if the Document is in part a
textbook of mathematics, a Secondary Section may not explain any
mathematics.) The relationship could be a matter of historical
connection with the subject or with related matters, or of legal,
commercial, philosophical, ethical or political position regarding
them.
The "Invariant Sections" are certain Secondary Sections whose titles
are designated, as being those of Invariant Sections, in the notice
that says that the Document is released under this License. If a
section does not fit the above definition of Secondary then it is not
allowed to be designated as Invariant. The Document may contain zero
Invariant Sections. If the Document does not identify any Invariant
Sections then there are none.
The "Cover Texts" are certain short passages of text that are listed,
as Front-Cover Texts or Back-Cover Texts, in the notice that says that
the Document is released under this License. A Front-Cover Text may
be at most 5 words, and a Back-Cover Text may be at most 25 words.
A "Transparent" copy of the Document means a machine-readable copy,
represented in a format whose specification is available to the
general public, that is suitable for revising the document
straightforwardly with generic text editors or (for images composed of
pixels) generic paint programs or (for drawings) some widely available
drawing editor, and that is suitable for input to text formatters or
for automatic translation to a variety of formats suitable for input
to text formatters. A copy made in an otherwise Transparent file
format whose markup, or absence of markup, has been arranged to thwart
or discourage subsequent modification by readers is not Transparent.
An image format is not Transparent if used for any substantial amount
of text. A copy that is not "Transparent" is called "Opaque".
Examples of suitable formats for Transparent copies include plain
ASCII without markup, Texinfo input format, LaTeX input format, SGML
or XML using a publicly available DTD, and standard-conforming simple
HTML, PostScript or PDF designed for human modification. Examples of
transparent image formats include PNG, XCF and JPG. Opaque formats
include proprietary formats that can be read and edited only by
proprietary word processors, SGML or XML for which the DTD and/or
processing tools are not generally available, and the
machine-generated HTML, PostScript or PDF produced by some word
processors for output purposes only.
The "Title Page" means, for a printed book, the title page itself,
plus such following pages as are needed to hold, legibly, the material
this License requires to appear in the title page. For works in
formats which do not have any title page as such, "Title Page" means
the text near the most prominent appearance of the work's title,
preceding the beginning of the body of the text.
A section "Entitled XYZ" means a named subunit of the Document whose
title either is precisely XYZ or contains XYZ in parentheses following
text that translates XYZ in another language. (Here XYZ stands for a
specific section name mentioned below, such as "Acknowledgements",
"Dedications", "Endorsements", or "History".) To "Preserve the Title"
of such a section when you modify the Document means that it remains a
section "Entitled XYZ" according to this definition.
The Document may include Warranty Disclaimers next to the notice which
states that this License applies to the Document. These Warranty
Disclaimers are considered to be included by reference in this
License, but only as regards disclaiming warranties: any other
implication that these Warranty Disclaimers may have is void and has
no effect on the meaning of this License.
2. VERBATIM COPYING
You may copy and distribute the Document in any medium, either
commercially or noncommercially, provided that this License, the
copyright notices, and the license notice saying this License applies
to the Document are reproduced in all copies, and that you add no other
conditions whatsoever to those of this License. You may not use
technical measures to obstruct or control the reading or further
copying of the copies you make or distribute. However, you may accept
compensation in exchange for copies. If you distribute a large enough
number of copies you must also follow the conditions in section 3.
You may also lend copies, under the same conditions stated above, and
you may publicly display copies.
3. COPYING IN QUANTITY
If you publish printed copies (or copies in media that commonly have
printed covers) of the Document, numbering more than 100, and the
Document's license notice requires Cover Texts, you must enclose the
copies in covers that carry, clearly and legibly, all these Cover
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
the back cover. Both covers must also clearly and legibly identify
you as the publisher of these copies. The front cover must present
the full title with all words of the title equally prominent and
visible. You may add other material on the covers in addition.
Copying with changes limited to the covers, as long as they preserve
the title of the Document and satisfy these conditions, can be treated
as verbatim copying in other respects.
If the required texts for either cover are too voluminous to fit
legibly, you should put the first ones listed (as many as fit
reasonably) on the actual cover, and continue the rest onto adjacent
pages.
If you publish or distribute Opaque copies of the Document numbering
more than 100, you must either include a machine-readable Transparent
copy along with each Opaque copy, or state in or with each Opaque copy
a computer-network location from which the general network-using
public has access to download using public-standard network protocols
a complete Transparent copy of the Document, free of added material.
If you use the latter option, you must take reasonably prudent steps,
when you begin distribution of Opaque copies in quantity, to ensure
that this Transparent copy will remain thus accessible at the stated
location until at least one year after the last time you distribute an
Opaque copy (directly or through your agents or retailers) of that
edition to the public.
It is requested, but not required, that you contact the authors of the
Document well before redistributing any large number of copies, to give
them a chance to provide you with an updated version of the Document.
4. MODIFICATIONS
You may copy and distribute a Modified Version of the Document under
the conditions of sections 2 and 3 above, provided that you release
the Modified Version under precisely this License, with the Modified
Version filling the role of the Document, thus licensing distribution
and modification of the Modified Version to whoever possesses a copy
of it. In addition, you must do these things in the Modified Version:
A. Use in the Title Page (and on the covers, if any) a title distinct
from that of the Document, and from those of previous versions
(which should, if there were any, be listed in the History section
of the Document). You may use the same title as a previous version
if the original publisher of that version gives permission.
B. List on the Title Page, as authors, one or more persons or entities
responsible for authorship of the modifications in the Modified
Version, together with at least five of the principal authors of the
Document (all of its principal authors, if it has fewer than five),
unless they release you from this requirement.
C. State on the Title page the name of the publisher of the
Modified Version, as the publisher.
D. Preserve all the copyright notices of the Document.
E. Add an appropriate copyright notice for your modifications
adjacent to the other copyright notices.
F. Include, immediately after the copyright notices, a license notice
giving the public permission to use the Modified Version under the
terms of this License, in the form shown in the Addendum below.
G. Preserve in that license notice the full lists of Invariant Sections
and required Cover Texts given in the Document's license notice.
H. Include an unaltered copy of this License.
I. Preserve the section Entitled "History", Preserve its Title, and add
to it an item stating at least the title, year, new authors, and
publisher of the Modified Version as given on the Title Page. If
there is no section Entitled "History" in the Document, create one
stating the title, year, authors, and publisher of the Document as
given on its Title Page, then add an item describing the Modified
Version as stated in the previous sentence.
J. Preserve the network location, if any, given in the Document for
public access to a Transparent copy of the Document, and likewise
the network locations given in the Document for previous versions
it was based on. These may be placed in the "History" section.
You may omit a network location for a work that was published at
least four years before the Document itself, or if the original
publisher of the version it refers to gives permission.
K. For any section Entitled "Acknowledgements" or "Dedications",
Preserve the Title of the section, and preserve in the section all
the substance and tone of each of the contributor acknowledgements
and/or dedications given therein.
L. Preserve all the Invariant Sections of the Document,
unaltered in their text and in their titles. Section numbers
or the equivalent are not considered part of the section titles.
M. Delete any section Entitled "Endorsements". Such a section
may not be included in the Modified Version.
N. Do not retitle any existing section to be Entitled "Endorsements"
or to conflict in title with any Invariant Section.
O. Preserve any Warranty Disclaimers.
If the Modified Version includes new front-matter sections or
appendices that qualify as Secondary Sections and contain no material
copied from the Document, you may at your option designate some or all
of these sections as invariant. To do this, add their titles to the
list of Invariant Sections in the Modified Version's license notice.
These titles must be distinct from any other section titles.
You may add a section Entitled "Endorsements", provided it contains
nothing but endorsements of your Modified Version by various
parties--for example, statements of peer review or that the text has
been approved by an organization as the authoritative definition of a
standard.
You may add a passage of up to five words as a Front-Cover Text, and a
passage of up to 25 words as a Back-Cover Text, to the end of the list
of Cover Texts in the Modified Version. Only one passage of
Front-Cover Text and one of Back-Cover Text may be added by (or
through arrangements made by) any one entity. If the Document already
includes a cover text for the same cover, previously added by you or
by arrangement made by the same entity you are acting on behalf of,
you may not add another; but you may replace the old one, on explicit
permission from the previous publisher that added the old one.
The author(s) and publisher(s) of the Document do not by this License
give permission to use their names for publicity for or to assert or
imply endorsement of any Modified Version.
5. COMBINING DOCUMENTS
You may combine the Document with other documents released under this
License, under the terms defined in section 4 above for modified
versions, provided that you include in the combination all of the
Invariant Sections of all of the original documents, unmodified, and
list them all as Invariant Sections of your combined work in its
license notice, and that you preserve all their Warranty Disclaimers.
The combined work need only contain one copy of this License, and
multiple identical Invariant Sections may be replaced with a single
copy. If there are multiple Invariant Sections with the same name but
different contents, make the title of each such section unique by
adding at the end of it, in parentheses, the name of the original
author or publisher of that section if known, or else a unique number.
Make the same adjustment to the section titles in the list of
Invariant Sections in the license notice of the combined work.
In the combination, you must combine any sections Entitled "History"
in the various original documents, forming one section Entitled
"History"; likewise combine any sections Entitled "Acknowledgements",
and any sections Entitled "Dedications". You must delete all sections
Entitled "Endorsements".
6. COLLECTIONS OF DOCUMENTS
You may make a collection consisting of the Document and other documents
released under this License, and replace the individual copies of this
License in the various documents with a single copy that is included in
the collection, provided that you follow the rules of this License for
verbatim copying of each of the documents in all other respects.
You may extract a single document from such a collection, and distribute
it individually under this License, provided you insert a copy of this
License into the extracted document, and follow this License in all
other respects regarding verbatim copying of that document.
7. AGGREGATION WITH INDEPENDENT WORKS
A compilation of the Document or its derivatives with other separate
and independent documents or works, in or on a volume of a storage or
distribution medium, is called an "aggregate" if the copyright
resulting from the compilation is not used to limit the legal rights
of the compilation's users beyond what the individual works permit.
When the Document is included in an aggregate, this License does not
apply to the other works in the aggregate which are not themselves
derivative works of the Document.
If the Cover Text requirement of section 3 is applicable to these
copies of the Document, then if the Document is less than one half of
the entire aggregate, the Document's Cover Texts may be placed on
covers that bracket the Document within the aggregate, or the
electronic equivalent of covers if the Document is in electronic form.
Otherwise they must appear on printed covers that bracket the whole
aggregate.
8. TRANSLATION
Translation is considered a kind of modification, so you may
distribute translations of the Document under the terms of section 4.
Replacing Invariant Sections with translations requires special
permission from their copyright holders, but you may include
translations of some or all Invariant Sections in addition to the
original versions of these Invariant Sections. You may include a
translation of this License, and all the license notices in the
Document, and any Warranty Disclaimers, provided that you also include
the original English version of this License and the original versions
of those notices and disclaimers. In case of a disagreement between
the translation and the original version of this License or a notice
or disclaimer, the original version will prevail.
If a section in the Document is Entitled "Acknowledgements",
"Dedications", or "History", the requirement (section 4) to Preserve
its Title (section 1) will typically require changing the actual
title.
9. TERMINATION
You may not copy, modify, sublicense, or distribute the Document except
as expressly provided for under this License. Any other attempt to
copy, modify, sublicense or distribute the Document is void, and will
automatically terminate your rights under this License. However,
parties who have received copies, or rights, from you under this
License will not have their licenses terminated so long as such
parties remain in full compliance.
10. FUTURE REVISIONS OF THIS LICENSE
The Free Software Foundation may publish new, revised versions
of the GNU Free Documentation License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns. See
http://www.gnu.org/copyleft/.
Each version of the License is given a distinguishing version number.
If the Document specifies that a particular numbered version of this
License "or any later version" applies to it, you have the option of
following the terms and conditions either of that specified version or
of any later version that has been published (not as a draft) by the
Free Software Foundation. If the Document does not specify a version
number of this License, you may choose any version ever published (not
as a draft) by the Free Software Foundation.
ADDENDUM: How to use this License for your documents
To use this License in a document you have written, include a copy of
the License in the document and put the following copyright and
license notices just after the title page:
Copyright (c) YEAR YOUR NAME.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included in the section entitled "GNU
Free Documentation License".
If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
replace the "with...Texts." line with this:
with the Invariant Sections being LIST THEIR TITLES, with the
Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
If you have Invariant Sections without Cover Texts, or some other
combination of the three, merge those two alternatives to suit the
situation.
If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of
free software license, such as the GNU General Public License,
to permit their use in free software.
@@ -0,0 +1,24 @@
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH} )
pkg_get_variable(XKBDIR xkeyboard-config xkb_base)
if (NOT XKBDIR)
message(FATAL_ERROR "Couldn't find xkb_base using pkg-config: is xkeyboard-config installed?")
elseif (CMAKE_CROSSCOMPILING)
if (NOT EXISTS "${CMAKE_SYSROOT}/${XKBDIR}")
message(FATAL_ERROR "Couldn't find XKB location in CMAKE_SYSROOT: \"${CMAKE_SYSROOT}/${XKBDIR}\"")
endif()
elseif(NOT EXISTS "${XKBDIR}")
message(FATAL_ERROR "Couldn't find XKB location: \"${XKBDIR}\".")
endif()
check_function_exists(statvfs HAVE_STATVFS)
check_include_files(limits.h HAVE_LIMITS_H)
check_include_files(sys/time.h HAVE_SYS_TIME_H) # ksmserver, ksplashml, sftp
check_include_files("sys/stat.h;sys/vfs.h" HAVE_SYS_VFS_H) # statvfs for plasma/solid
check_include_files("sys/stat.h;sys/statvfs.h" HAVE_SYS_STATVFS_H) # statvfs for plasma/solid
check_include_files(sys/param.h HAVE_SYS_PARAM_H)
check_include_files("sys/param.h;sys/mount.h" HAVE_SYS_MOUNT_H)
check_include_files("sys/types.h;sys/statfs.h" HAVE_SYS_STATFS_H)
check_include_files(unistd.h HAVE_UNISTD_H)
set(CMAKE_EXTRA_INCLUDE_FILES sys/socket.h)
@@ -0,0 +1,26 @@
Copyright (c) <year> <owner>. All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,121 @@
Creative Commons Legal Code
CC0 1.0 Universal
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
HEREUNDER.
Statement of Purpose
The laws of most jurisdictions throughout the world automatically confer
exclusive Copyright and Related Rights (defined below) upon the creator
and subsequent owner(s) (each and all, an "owner") of an original work of
authorship and/or a database (each, a "Work").
Certain owners wish to permanently relinquish those rights to a Work for
the purpose of contributing to a commons of creative, cultural and
scientific works ("Commons") that the public can reliably and without fear
of later claims of infringement build upon, modify, incorporate in other
works, reuse and redistribute as freely as possible in any form whatsoever
and for any purposes, including without limitation commercial purposes.
These owners may contribute to the Commons to promote the ideal of a free
culture and the further production of creative, cultural and scientific
works, or to gain reputation or greater distribution for their Work in
part through the use and efforts of others.
For these and/or other purposes and motivations, and without any
expectation of additional consideration or compensation, the person
associating CC0 with a Work (the "Affirmer"), to the extent that he or she
is an owner of Copyright and Related Rights in the Work, voluntarily
elects to apply CC0 to the Work and publicly distribute the Work under its
terms, with knowledge of his or her Copyright and Related Rights in the
Work and the meaning and intended legal effect of CC0 on those rights.
1. Copyright and Related Rights. A Work made available under CC0 may be
protected by copyright and related or neighboring rights ("Copyright and
Related Rights"). Copyright and Related Rights include, but are not
limited to, the following:
i. the right to reproduce, adapt, distribute, perform, display,
communicate, and translate a Work;
ii. moral rights retained by the original author(s) and/or performer(s);
iii. publicity and privacy rights pertaining to a person's image or
likeness depicted in a Work;
iv. rights protecting against unfair competition in regards to a Work,
subject to the limitations in paragraph 4(a), below;
v. rights protecting the extraction, dissemination, use and reuse of data
in a Work;
vi. database rights (such as those arising under Directive 96/9/EC of the
European Parliament and of the Council of 11 March 1996 on the legal
protection of databases, and under any national implementation
thereof, including any amended or successor version of such
directive); and
vii. other similar, equivalent or corresponding rights throughout the
world based on applicable law or treaty, and any national
implementations thereof.
2. Waiver. To the greatest extent permitted by, but not in contravention
of, applicable law, Affirmer hereby overtly, fully, permanently,
irrevocably and unconditionally waives, abandons, and surrenders all of
Affirmer's Copyright and Related Rights and associated claims and causes
of action, whether now known or unknown (including existing as well as
future claims and causes of action), in the Work (i) in all territories
worldwide, (ii) for the maximum duration provided by applicable law or
treaty (including future time extensions), (iii) in any current or future
medium and for any number of copies, and (iv) for any purpose whatsoever,
including without limitation commercial, advertising or promotional
purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
member of the public at large and to the detriment of Affirmer's heirs and
successors, fully intending that such Waiver shall not be subject to
revocation, rescission, cancellation, termination, or any other legal or
equitable action to disrupt the quiet enjoyment of the Work by the public
as contemplated by Affirmer's express Statement of Purpose.
3. Public License Fallback. Should any part of the Waiver for any reason
be judged legally invalid or ineffective under applicable law, then the
Waiver shall be preserved to the maximum extent permitted taking into
account Affirmer's express Statement of Purpose. In addition, to the
extent the Waiver is so judged Affirmer hereby grants to each affected
person a royalty-free, non transferable, non sublicensable, non exclusive,
irrevocable and unconditional license to exercise Affirmer's Copyright and
Related Rights in the Work (i) in all territories worldwide, (ii) for the
maximum duration provided by applicable law or treaty (including future
time extensions), (iii) in any current or future medium and for any number
of copies, and (iv) for any purpose whatsoever, including without
limitation commercial, advertising or promotional purposes (the
"License"). The License shall be deemed effective as of the date CC0 was
applied by Affirmer to the Work. Should any part of the License for any
reason be judged legally invalid or ineffective under applicable law, such
partial invalidity or ineffectiveness shall not invalidate the remainder
of the License, and in such case Affirmer hereby affirms that he or she
will not (i) exercise any of his or her remaining Copyright and Related
Rights in the Work or (ii) assert any associated claims and causes of
action with respect to the Work, in either case contrary to Affirmer's
express Statement of Purpose.
4. Limitations and Disclaimers.
a. No trademark or patent rights held by Affirmer are waived, abandoned,
surrendered, licensed or otherwise affected by this document.
b. Affirmer offers the Work as-is and makes no representations or
warranties of any kind concerning the Work, express, implied,
statutory or otherwise, including without limitation warranties of
title, merchantability, fitness for a particular purpose, non
infringement, or the absence of latent or other defects, accuracy, or
the present or absence of errors, whether or not discoverable, all to
the greatest extent permissible under applicable law.
c. Affirmer disclaims responsibility for clearing rights of other persons
that may apply to the Work or any use thereof, including without
limitation any person's Copyright and Related Rights in the Work.
Further, Affirmer disclaims responsibility for obtaining any necessary
consents, permissions or other rights required for any use of the
Work.
d. Affirmer understands and acknowledges that Creative Commons is not a
party to this document and has no duty or obligation with respect to
this CC0 or use of the Work.
@@ -0,0 +1,130 @@
GNU Free Documentation License
Version 1.2, November 2002
Copyright (C) 2000,2001,2002 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
0. PREAMBLE
The purpose of this License is to make a manual, textbook, or other functional and useful document "free" in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others.
This License is a kind of "copyleft", which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software.
We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference.
1. APPLICABILITY AND DEFINITIONS
This License applies to any manual or other work, in any medium, that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. Such a notice grants a world-wide, royalty-free license, unlimited in duration, to use that work under the conditions stated herein. The "Document", below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as "you". You accept the license if you copy, modify or distribute the work in a way requiring permission under copyright law.
A "Modified Version" of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language.
A "Secondary Section" is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them.
The "Invariant Sections" are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. If a section does not fit the above definition of Secondary then it is not allowed to be designated as Invariant. The Document may contain zero Invariant Sections. If the Document does not identify any Invariant Sections then there are none.
The "Cover Texts" are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A Front-Cover Text may be at most 5 words, and a Back-Cover Text may be at most 25 words.
A "Transparent" copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, that is suitable for revising the document straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup, or absence of markup, has been arranged to thwart or discourage subsequent modification by readers is not Transparent. An image format is not Transparent if used for any substantial amount of text. A copy that is not "Transparent" is called "Opaque".
Examples of suitable formats for Transparent copies include plain ASCII without markup, Texinfo input format, LaTeX input format, SGML or XML using a publicly available DTD, and standard-conforming simple HTML, PostScript or PDF designed for human modification. Examples of transparent image formats include PNG, XCF and JPG. Opaque formats include proprietary formats that can be read and edited only by proprietary word processors, SGML or XML for which the DTD and/or processing tools are not generally available, and the machine-generated HTML, PostScript or PDF produced by some word processors for output purposes only.
The "Title Page" means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, "Title Page" means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text.
A section "Entitled XYZ" means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a specific section name mentioned below, such as "Acknowledgements", "Dedications", "Endorsements", or "History".) To "Preserve the Title" of such a section when you modify the Document means that it remains a section "Entitled XYZ" according to this definition.
The Document may include Warranty Disclaimers next to the notice which states that this License applies to the Document. These Warranty Disclaimers are considered to be included by reference in this License, but only as regards disclaiming warranties: any other implication that these Warranty Disclaimers may have is void and has no effect on the meaning of this License.
2. VERBATIM COPYING
You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3.
You may also lend copies, under the same conditions stated above, and you may publicly display copies.
3. COPYING IN QUANTITY
If you publish printed copies (or copies in media that commonly have printed covers) of the Document, numbering more than 100, and the Document's license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects.
If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages.
If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a computer-network location from which the general network-using public has access to download using public-standard network protocols a complete Transparent copy of the Document, free of added material. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public.
It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document.
4. MODIFICATIONS
You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version:
A. Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission.
B. List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has fewer than five), unless they release you from this requirement.
C. State on the Title page the name of the publisher of the Modified Version, as the publisher.
D. Preserve all the copyright notices of the Document.
E. Add an appropriate copyright notice for your modifications adjacent to the other copyright notices.
F. Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below.
G. Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document's license notice.
H. Include an unaltered copy of this License.
I. Preserve the section Entitled "History", Preserve its Title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section Entitled "History" in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence.
J. Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the "History" section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission.
K. For any section Entitled "Acknowledgements" or "Dedications", Preserve the Title of the section, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein.
L. Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles.
M. Delete any section Entitled "Endorsements". Such a section may not be included in the Modified Version.
N. Do not retitle any existing section to be Entitled "Endorsements" or to conflict in title with any Invariant Section.
O. Preserve any Warranty Disclaimers.
If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version's license notice. These titles must be distinct from any other section titles.
You may add a section Entitled "Endorsements", provided it contains nothing but endorsements of your Modified Version by various parties--for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard.
You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one.
The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version.
5. COMBINING DOCUMENTS
You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice, and that you preserve all their Warranty Disclaimers.
The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work.
In the combination, you must combine any sections Entitled "History" in the various original documents, forming one section Entitled "History"; likewise combine any sections Entitled "Acknowledgements", and any sections Entitled "Dedications". You must delete all sections Entitled "Endorsements".
6. COLLECTIONS OF DOCUMENTS
You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects.
You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document.
7. AGGREGATION WITH INDEPENDENT WORKS
A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, is called an "aggregate" if the copyright resulting from the compilation is not used to limit the legal rights of the compilation's users beyond what the individual works permit. When the Document is included in an aggregate, this License does not apply to the other works in the aggregate which are not themselves derivative works of the Document.
If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one half of the entire aggregate, the Document's Cover Texts may be placed on covers that bracket the Document within the aggregate, or the electronic equivalent of covers if the Document is in electronic form. Otherwise they must appear on printed covers that bracket the whole aggregate.
8. TRANSLATION
Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License, and all the license notices in the Document, and any Warranty Disclaimers, provided that you also include the original English version of this License and the original versions of those notices and disclaimers. In case of a disagreement between the translation and the original version of this License or a notice or disclaimer, the original version will prevail.
If a section in the Document is Entitled "Acknowledgements", "Dedications", or "History", the requirement (section 4) to Preserve its Title (section 1) will typically require changing the actual title.
9. TERMINATION
You may not copy, modify, sublicense, or distribute the Document except as expressly provided for under this License. Any other attempt to copy, modify, sublicense or distribute the Document is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
10. FUTURE REVISIONS OF THIS LICENSE
The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See http://www.gnu.org/copyleft/.
Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License "or any later version" applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation.
ADDENDUM: How to use this License for your documents
To use this License in a document you have written, include a copy of the License in the document and put the following copyright and license notices just after the title page:
Copyright (c) YEAR YOUR NAME. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".
If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, replace the "with...Texts." line with this:
with the Invariant Sections being LIST THEIR TITLES, with the Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
If you have Invariant Sections without Cover Texts, or some other combination of the three, merge those two alternatives to suit the situation.
If your document contains nontrivial examples of program code, we recommend releasing these examples in parallel under your choice of free software license, such as the GNU General Public License, to permit their use in free software.
@@ -0,0 +1,311 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
Everyone is permitted to copy and distribute verbatim copies of this license
document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your freedom to share
and change it. By contrast, the GNU General Public License is intended to
guarantee your freedom to share and change free software--to make sure the
software is free for all its users. This General Public License applies to
most of the Free Software Foundation's software and to any other program whose
authors commit to using it. (Some other Free Software Foundation software
is covered by the GNU Lesser General Public License instead.) You can apply
it to your programs, too.
When we speak of free software, we are referring to freedom, not price. Our
General Public Licenses are designed to make sure that you have the freedom
to distribute copies of free software (and charge for this service if you
wish), that you receive source code or can get it if you want it, that you
can change the software or use pieces of it in new free programs; and that
you know you can do these things.
To protect your rights, we need to make restrictions that forbid anyone to
deny you these rights or to ask you to surrender the rights. These restrictions
translate to certain responsibilities for you if you distribute copies of
the software, or if you modify it.
For example, if you distribute copies of such a program, whether gratis or
for a fee, you must give the recipients all the rights that you have. You
must make sure that they, too, receive or can get the source code. And you
must show them these terms so they know their rights.
We protect your rights with two steps: (1) copyright the software, and (2)
offer you this license which gives you legal permission to copy, distribute
and/or modify the software.
Also, for each author's protection and ours, we want to make certain that
everyone understands that there is no warranty for this free software. If
the software is modified by someone else and passed on, we want its recipients
to know that what they have is not the original, so that any problems introduced
by others will not reflect on the original authors' reputations.
Finally, any free program is threatened constantly by software patents. We
wish to avoid the danger that redistributors of a free program will individually
obtain patent licenses, in effect making the program proprietary. To prevent
this, we have made it clear that any patent must be licensed for everyone's
free use or not licensed at all.
The precise terms and conditions for copying, distribution and modification
follow.
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains a notice
placed by the copyright holder saying it may be distributed under the terms
of this General Public License. The "Program", below, refers to any such program
or work, and a "work based on the Program" means either the Program or any
derivative work under copyright law: that is to say, a work containing the
Program or a portion of it, either verbatim or with modifications and/or translated
into another language. (Hereinafter, translation is included without limitation
in the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not covered
by this License; they are outside its scope. The act of running the Program
is not restricted, and the output from the Program is covered only if its
contents constitute a work based on the Program (independent of having been
made by running the Program). Whether that is true depends on what the Program
does.
1. You may copy and distribute verbatim copies of the Program's source code
as you receive it, in any medium, provided that you conspicuously and appropriately
publish on each copy an appropriate copyright notice and disclaimer of warranty;
keep intact all the notices that refer to this License and to the absence
of any warranty; and give any other recipients of the Program a copy of this
License along with the Program.
You may charge a fee for the physical act of transferring a copy, and you
may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion of it,
thus forming a work based on the Program, and copy and distribute such modifications
or work under the terms of Section 1 above, provided that you also meet all
of these conditions:
a) You must cause the modified files to carry prominent notices stating that
you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in whole or
in part contains or is derived from the Program or any part thereof, to be
licensed as a whole at no charge to all third parties under the terms of this
License.
c) If the modified program normally reads commands interactively when run,
you must cause it, when started running for such interactive use in the most
ordinary way, to print or display an announcement including an appropriate
copyright notice and a notice that there is no warranty (or else, saying that
you provide a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this License.
(Exception: if the Program itself is interactive but does not normally print
such an announcement, your work based on the Program is not required to print
an announcement.)
These requirements apply to the modified work as a whole. If identifiable
sections of that work are not derived from the Program, and can be reasonably
considered independent and separate works in themselves, then this License,
and its terms, do not apply to those sections when you distribute them as
separate works. But when you distribute the same sections as part of a whole
which is a work based on the Program, the distribution of the whole must be
on the terms of this License, whose permissions for other licensees extend
to the entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest your
rights to work written entirely by you; rather, the intent is to exercise
the right to control the distribution of derivative or collective works based
on the Program.
In addition, mere aggregation of another work not based on the Program with
the Program (or with a work based on the Program) on a volume of a storage
or distribution medium does not bring the other work under the scope of this
License.
3. You may copy and distribute the Program (or a work based on it, under Section
2) in object code or executable form under the terms of Sections 1 and 2 above
provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable source code,
which must be distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three years, to give
any third party, for a charge no more than your cost of physically performing
source distribution, a complete machine-readable copy of the corresponding
source code, to be distributed under the terms of Sections 1 and 2 above on
a medium customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer to distribute
corresponding source code. (This alternative is allowed only for noncommercial
distribution and only if you received the program in object code or executable
form with such an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for making
modifications to it. For an executable work, complete source code means all
the source code for all modules it contains, plus any associated interface
definition files, plus the scripts used to control compilation and installation
of the executable. However, as a special exception, the source code distributed
need not include anything that is normally distributed (in either source or
binary form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component itself
accompanies the executable.
If distribution of executable or object code is made by offering access to
copy from a designated place, then offering equivalent access to copy the
source code from the same place counts as distribution of the source code,
even though third parties are not compelled to copy the source along with
the object code.
4. You may not copy, modify, sublicense, or distribute the Program except
as expressly provided under this License. Any attempt otherwise to copy, modify,
sublicense or distribute the Program is void, and will automatically terminate
your rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses terminated
so long as such parties remain in full compliance.
5. You are not required to accept this License, since you have not signed
it. However, nothing else grants you permission to modify or distribute the
Program or its derivative works. These actions are prohibited by law if you
do not accept this License. Therefore, by modifying or distributing the Program
(or any work based on the Program), you indicate your acceptance of this License
to do so, and all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the Program),
the recipient automatically receives a license from the original licensor
to copy, distribute or modify the Program subject to these terms and conditions.
You may not impose any further restrictions on the recipients' exercise of
the rights granted herein. You are not responsible for enforcing compliance
by third parties to this License.
7. If, as a consequence of a court judgment or allegation of patent infringement
or for any other reason (not limited to patent issues), conditions are imposed
on you (whether by court order, agreement or otherwise) that contradict the
conditions of this License, they do not excuse you from the conditions of
this License. If you cannot distribute so as to satisfy simultaneously your
obligations under this License and any other pertinent obligations, then as
a consequence you may not distribute the Program at all. For example, if a
patent license would not permit royalty-free redistribution of the Program
by all those who receive copies directly or indirectly through you, then the
only way you could satisfy both it and this License would be to refrain entirely
from distribution of the Program.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply and
the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any patents
or other property right claims or to contest validity of any such claims;
this section has the sole purpose of protecting the integrity of the free
software distribution system, which is implemented by public license practices.
Many people have made generous contributions to the wide range of software
distributed through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing to
distribute software through any other system and a licensee cannot impose
that choice.
This section is intended to make thoroughly clear what is believed to be a
consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in certain
countries either by patents or by copyrighted interfaces, the original copyright
holder who places the Program under this License may add an explicit geographical
distribution limitation excluding those countries, so that distribution is
permitted only in or among countries not thus excluded. In such case, this
License incorporates the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions of
the General Public License from time to time. Such new versions will be similar
in spirit to the present version, but may differ in detail to address new
problems or concerns.
Each version is given a distinguishing version number. If the Program specifies
a version number of this License which applies to it and "any later version",
you have the option of following the terms and conditions either of that version
or of any later version published by the Free Software Foundation. If the
Program does not specify a version number of this License, you may choose
any version ever published by the Free Software Foundation.
10. If you wish to incorporate parts of the Program into other free programs
whose distribution conditions are different, write to the author to ask for
permission. For software which is copyrighted by the Free Software Foundation,
write to the Free Software Foundation; we sometimes make exceptions for this.
Our decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing and reuse
of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR
THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE
STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM
"AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE
OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE
OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA
OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES
OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH
HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest possible
use to the public, the best way to achieve this is to make it free software
which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest to attach
them to the start of each source file to most effectively convey the exclusion
of warranty; and each file should have at least the "copyright" line and a
pointer to where the full notice is found.
one line to give the program's name and an idea of what it does. Copyright
(C) yyyy name of author
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 of the License, 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.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
Street, Fifth Floor, Boston, MA 02110-1301, USA. Also add information on how
to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this when
it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author Gnomovision comes
with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software,
and you are welcome to redistribute it under certain conditions; type `show
c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may be
called something other than `show w' and `show c'; they could even be mouse-clicks
or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your school,
if any, to sign a "copyright disclaimer" for the program, if necessary. Here
is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision'
(which makes passes at compilers) written by James Hacker.
signature of Ty Coon, 1 April 1989 Ty Coon, President of Vice
@@ -0,0 +1,311 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
Everyone is permitted to copy and distribute verbatim copies of this license
document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your freedom to share
and change it. By contrast, the GNU General Public License is intended to
guarantee your freedom to share and change free software--to make sure the
software is free for all its users. This General Public License applies to
most of the Free Software Foundation's software and to any other program whose
authors commit to using it. (Some other Free Software Foundation software
is covered by the GNU Lesser General Public License instead.) You can apply
it to your programs, too.
When we speak of free software, we are referring to freedom, not price. Our
General Public Licenses are designed to make sure that you have the freedom
to distribute copies of free software (and charge for this service if you
wish), that you receive source code or can get it if you want it, that you
can change the software or use pieces of it in new free programs; and that
you know you can do these things.
To protect your rights, we need to make restrictions that forbid anyone to
deny you these rights or to ask you to surrender the rights. These restrictions
translate to certain responsibilities for you if you distribute copies of
the software, or if you modify it.
For example, if you distribute copies of such a program, whether gratis or
for a fee, you must give the recipients all the rights that you have. You
must make sure that they, too, receive or can get the source code. And you
must show them these terms so they know their rights.
We protect your rights with two steps: (1) copyright the software, and (2)
offer you this license which gives you legal permission to copy, distribute
and/or modify the software.
Also, for each author's protection and ours, we want to make certain that
everyone understands that there is no warranty for this free software. If
the software is modified by someone else and passed on, we want its recipients
to know that what they have is not the original, so that any problems introduced
by others will not reflect on the original authors' reputations.
Finally, any free program is threatened constantly by software patents. We
wish to avoid the danger that redistributors of a free program will individually
obtain patent licenses, in effect making the program proprietary. To prevent
this, we have made it clear that any patent must be licensed for everyone's
free use or not licensed at all.
The precise terms and conditions for copying, distribution and modification
follow.
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains a notice
placed by the copyright holder saying it may be distributed under the terms
of this General Public License. The "Program", below, refers to any such program
or work, and a "work based on the Program" means either the Program or any
derivative work under copyright law: that is to say, a work containing the
Program or a portion of it, either verbatim or with modifications and/or translated
into another language. (Hereinafter, translation is included without limitation
in the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not covered
by this License; they are outside its scope. The act of running the Program
is not restricted, and the output from the Program is covered only if its
contents constitute a work based on the Program (independent of having been
made by running the Program). Whether that is true depends on what the Program
does.
1. You may copy and distribute verbatim copies of the Program's source code
as you receive it, in any medium, provided that you conspicuously and appropriately
publish on each copy an appropriate copyright notice and disclaimer of warranty;
keep intact all the notices that refer to this License and to the absence
of any warranty; and give any other recipients of the Program a copy of this
License along with the Program.
You may charge a fee for the physical act of transferring a copy, and you
may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion of it,
thus forming a work based on the Program, and copy and distribute such modifications
or work under the terms of Section 1 above, provided that you also meet all
of these conditions:
a) You must cause the modified files to carry prominent notices stating that
you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in whole or
in part contains or is derived from the Program or any part thereof, to be
licensed as a whole at no charge to all third parties under the terms of this
License.
c) If the modified program normally reads commands interactively when run,
you must cause it, when started running for such interactive use in the most
ordinary way, to print or display an announcement including an appropriate
copyright notice and a notice that there is no warranty (or else, saying that
you provide a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this License.
(Exception: if the Program itself is interactive but does not normally print
such an announcement, your work based on the Program is not required to print
an announcement.)
These requirements apply to the modified work as a whole. If identifiable
sections of that work are not derived from the Program, and can be reasonably
considered independent and separate works in themselves, then this License,
and its terms, do not apply to those sections when you distribute them as
separate works. But when you distribute the same sections as part of a whole
which is a work based on the Program, the distribution of the whole must be
on the terms of this License, whose permissions for other licensees extend
to the entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest your
rights to work written entirely by you; rather, the intent is to exercise
the right to control the distribution of derivative or collective works based
on the Program.
In addition, mere aggregation of another work not based on the Program with
the Program (or with a work based on the Program) on a volume of a storage
or distribution medium does not bring the other work under the scope of this
License.
3. You may copy and distribute the Program (or a work based on it, under Section
2) in object code or executable form under the terms of Sections 1 and 2 above
provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable source code,
which must be distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three years, to give
any third party, for a charge no more than your cost of physically performing
source distribution, a complete machine-readable copy of the corresponding
source code, to be distributed under the terms of Sections 1 and 2 above on
a medium customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer to distribute
corresponding source code. (This alternative is allowed only for noncommercial
distribution and only if you received the program in object code or executable
form with such an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for making
modifications to it. For an executable work, complete source code means all
the source code for all modules it contains, plus any associated interface
definition files, plus the scripts used to control compilation and installation
of the executable. However, as a special exception, the source code distributed
need not include anything that is normally distributed (in either source or
binary form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component itself
accompanies the executable.
If distribution of executable or object code is made by offering access to
copy from a designated place, then offering equivalent access to copy the
source code from the same place counts as distribution of the source code,
even though third parties are not compelled to copy the source along with
the object code.
4. You may not copy, modify, sublicense, or distribute the Program except
as expressly provided under this License. Any attempt otherwise to copy, modify,
sublicense or distribute the Program is void, and will automatically terminate
your rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses terminated
so long as such parties remain in full compliance.
5. You are not required to accept this License, since you have not signed
it. However, nothing else grants you permission to modify or distribute the
Program or its derivative works. These actions are prohibited by law if you
do not accept this License. Therefore, by modifying or distributing the Program
(or any work based on the Program), you indicate your acceptance of this License
to do so, and all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the Program),
the recipient automatically receives a license from the original licensor
to copy, distribute or modify the Program subject to these terms and conditions.
You may not impose any further restrictions on the recipients' exercise of
the rights granted herein. You are not responsible for enforcing compliance
by third parties to this License.
7. If, as a consequence of a court judgment or allegation of patent infringement
or for any other reason (not limited to patent issues), conditions are imposed
on you (whether by court order, agreement or otherwise) that contradict the
conditions of this License, they do not excuse you from the conditions of
this License. If you cannot distribute so as to satisfy simultaneously your
obligations under this License and any other pertinent obligations, then as
a consequence you may not distribute the Program at all. For example, if a
patent license would not permit royalty-free redistribution of the Program
by all those who receive copies directly or indirectly through you, then the
only way you could satisfy both it and this License would be to refrain entirely
from distribution of the Program.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply and
the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any patents
or other property right claims or to contest validity of any such claims;
this section has the sole purpose of protecting the integrity of the free
software distribution system, which is implemented by public license practices.
Many people have made generous contributions to the wide range of software
distributed through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing to
distribute software through any other system and a licensee cannot impose
that choice.
This section is intended to make thoroughly clear what is believed to be a
consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in certain
countries either by patents or by copyrighted interfaces, the original copyright
holder who places the Program under this License may add an explicit geographical
distribution limitation excluding those countries, so that distribution is
permitted only in or among countries not thus excluded. In such case, this
License incorporates the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions of
the General Public License from time to time. Such new versions will be similar
in spirit to the present version, but may differ in detail to address new
problems or concerns.
Each version is given a distinguishing version number. If the Program specifies
a version number of this License which applies to it and "any later version",
you have the option of following the terms and conditions either of that version
or of any later version published by the Free Software Foundation. If the
Program does not specify a version number of this License, you may choose
any version ever published by the Free Software Foundation.
10. If you wish to incorporate parts of the Program into other free programs
whose distribution conditions are different, write to the author to ask for
permission. For software which is copyrighted by the Free Software Foundation,
write to the Free Software Foundation; we sometimes make exceptions for this.
Our decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing and reuse
of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR
THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE
STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM
"AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE
OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE
OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA
OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES
OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH
HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest possible
use to the public, the best way to achieve this is to make it free software
which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest to attach
them to the start of each source file to most effectively convey the exclusion
of warranty; and each file should have at least the "copyright" line and a
pointer to where the full notice is found.
one line to give the program's name and an idea of what it does. Copyright
(C) yyyy name of author
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 of the License, 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.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
Street, Fifth Floor, Boston, MA 02110-1301, USA. Also add information on how
to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this when
it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author Gnomovision comes
with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software,
and you are welcome to redistribute it under certain conditions; type `show
c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may be
called something other than `show w' and `show c'; they could even be mouse-clicks
or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your school,
if any, to sign a "copyright disclaimer" for the program, if necessary. Here
is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision'
(which makes passes at compilers) written by James Hacker.
signature of Ty Coon, 1 April 1989 Ty Coon, President of Vice
@@ -0,0 +1,604 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies of this license
document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for software and
other kinds of works.
The licenses for most software and other practical works are designed to take
away your freedom to share and change the works. By contrast, the GNU General
Public License is intended to guarantee your freedom to share and change all
versions of a program--to make sure it remains free software for all its users.
We, the Free Software Foundation, use the GNU General Public License for most
of our software; it applies also to any other work released this way by its
authors. You can apply it to your programs, too.
When we speak of free software, we are referring to freedom, not price. Our
General Public Licenses are designed to make sure that you have the freedom
to distribute copies of free software (and charge for them if you wish), that
you receive source code or can get it if you want it, that you can change
the software or use pieces of it in new free programs, and that you know you
can do these things.
To protect your rights, we need to prevent others from denying you these rights
or asking you to surrender the rights. Therefore, you have certain responsibilities
if you distribute copies of the software, or if you modify it: responsibilities
to respect the freedom of others.
For example, if you distribute copies of such a program, whether gratis or
for a fee, you must pass on to the recipients the same freedoms that you received.
You must make sure that they, too, receive or can get the source code. And
you must show them these terms so they know their rights.
Developers that use the GNU GPL protect your rights with two steps: (1) assert
copyright on the software, and (2) offer you this License giving you legal
permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains that
there is no warranty for this free software. For both users' and authors'
sake, the GPL requires that modified versions be marked as changed, so that
their problems will not be attributed erroneously to authors of previous versions.
Some devices are designed to deny users access to install or run modified
versions of the software inside them, although the manufacturer can do so.
This is fundamentally incompatible with the aim of protecting users' freedom
to change the software. The systematic pattern of such abuse occurs in the
area of products for individuals to use, which is precisely where it is most
unacceptable. Therefore, we have designed this version of the GPL to prohibit
the practice for those products. If such problems arise substantially in other
domains, we stand ready to extend this provision to those domains in future
versions of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents. States
should not allow patents to restrict development and use of software on general-purpose
computers, but in those that do, we wish to avoid the special danger that
patents applied to a free program could make it effectively proprietary. To
prevent this, the GPL assures that patents cannot be used to render the program
non-free.
The precise terms and conditions for copying, distribution and modification
follow.
TERMS AND CONDITIONS
0. Definitions.
“This License” refers to version 3 of the GNU General Public License.
“Copyright” also means copyright-like laws that apply to other kinds of works,
such as semiconductor masks.
“The Program” refers to any copyrightable work licensed under this License.
Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals
or organizations.
To “modify” a work means to copy from or adapt all or part of the work in
a fashion requiring copyright permission, other than the making of an exact
copy. The resulting work is called a “modified version” of the earlier work
or a work “based on” the earlier work.
A “covered work” means either the unmodified Program or a work based on the
Program.
To “propagate” a work means to do anything with it that, without permission,
would make you directly or secondarily liable for infringement under applicable
copyright law, except executing it on a computer or modifying a private copy.
Propagation includes copying, distribution (with or without modification),
making available to the public, and in some countries other activities as
well.
To “convey” a work means any kind of propagation that enables other parties
to make or receive copies. Mere interaction with a user through a computer
network, with no transfer of a copy, is not conveying.
An interactive user interface displays “Appropriate Legal Notices” to the
extent that it includes a convenient and prominently visible feature that
(1) displays an appropriate copyright notice, and (2) tells the user that
there is no warranty for the work (except to the extent that warranties are
provided), that licensees may convey the work under this License, and how
to view a copy of this License. If the interface presents a list of user commands
or options, such as a menu, a prominent item in the list meets this criterion.
1. Source Code.
The “source code” for a work means the preferred form of the work for making
modifications to it. “Object code” means any non-source form of a work.
A “Standard Interface” means an interface that either is an official standard
defined by a recognized standards body, or, in the case of interfaces specified
for a particular programming language, one that is widely used among developers
working in that language.
The “System Libraries” of an executable work include anything, other than
the work as a whole, that (a) is included in the normal form of packaging
a Major Component, but which is not part of that Major Component, and (b)
serves only to enable use of the work with that Major Component, or to implement
a Standard Interface for which an implementation is available to the public
in source code form. A “Major Component”, in this context, means a major essential
component (kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to produce
the work, or an object code interpreter used to run it.
The “Corresponding Source” for a work in object code form means all the source
code needed to generate, install, and (for an executable work) run the object
code and to modify the work, including scripts to control those activities.
However, it does not include the work's System Libraries, or general-purpose
tools or generally available free programs which are used unmodified in performing
those activities but which are not part of the work. For example, Corresponding
Source includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically linked
subprograms that the work is specifically designed to require, such as by
intimate data communication or control flow between those subprograms and
other parts of the work.
The Corresponding Source need not include anything that users can regenerate
automatically from other parts of the Corresponding Source.
The Corresponding Source for a work in source code form is that same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of copyright
on the Program, and are irrevocable provided the stated conditions are met.
This License explicitly affirms your unlimited permission to run the unmodified
Program. The output from running a covered work is covered by this License
only if the output, given its content, constitutes a covered work. This License
acknowledges your rights of fair use or other equivalent, as provided by copyright
law.
You may make, run and propagate covered works that you do not convey, without
conditions so long as your license otherwise remains in force. You may convey
covered works to others for the sole purpose of having them make modifications
exclusively for you, or provide you with facilities for running those works,
provided that you comply with the terms of this License in conveying all material
for which you do not control copyright. Those thus making or running the covered
works for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of your copyrighted
material outside their relationship with you.
Conveying under any other circumstances is permitted solely under the conditions
stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological measure
under any applicable law fulfilling obligations under article 11 of the WIPO
copyright treaty adopted on 20 December 1996, or similar laws prohibiting
or restricting circumvention of such measures.
When you convey a covered work, you waive any legal power to forbid circumvention
of technological measures to the extent such circumvention is effected by
exercising rights under this License with respect to the covered work, and
you disclaim any intention to limit operation or modification of the work
as a means of enforcing, against the work's users, your or third parties'
legal rights to forbid circumvention of technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you receive
it, in any medium, provided that you conspicuously and appropriately publish
on each copy an appropriate copyright notice; keep intact all notices stating
that this License and any non-permissive terms added in accord with section
7 apply to the code; keep intact all notices of the absence of any warranty;
and give all recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey, and you
may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to produce
it from the Program, in the form of source code under the terms of section
4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified it, and
giving a relevant date.
b) The work must carry prominent notices stating that it is released under
this License and any conditions added under section 7. This requirement modifies
the requirement in section 4 to “keep intact all notices”.
c) You must license the entire work, as a whole, under this License to anyone
who comes into possession of a copy. This License will therefore apply, along
with any applicable section 7 additional terms, to the whole of the work,
and all its parts, regardless of how they are packaged. This License gives
no permission to license the work in any other way, but it does not invalidate
such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display Appropriate
Legal Notices; however, if the Program has interactive interfaces that do
not display Appropriate Legal Notices, your work need not make them do so.
A compilation of a covered work with other separate and independent works,
which are not by their nature extensions of the covered work, and which are
not combined with it such as to form a larger program, in or on a volume of
a storage or distribution medium, is called an “aggregate” if the compilation
and its resulting copyright are not used to limit the access or legal rights
of the compilation's users beyond what the individual works permit. Inclusion
of a covered work in an aggregate does not cause this License to apply to
the other parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms of sections
4 and 5, provided that you also convey the machine-readable Corresponding
Source under the terms of this License, in one of these ways:
a) Convey the object code in, or embodied in, a physical product (including
a physical distribution medium), accompanied by the Corresponding Source fixed
on a durable physical medium customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product (including
a physical distribution medium), accompanied by a written offer, valid for
at least three years and valid for as long as you offer spare parts or customer
support for that product model, to give anyone who possesses the object code
either (1) a copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical medium customarily
used for software interchange, for a price no more than your reasonable cost
of physically performing this conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the written
offer to provide the Corresponding Source. This alternative is allowed only
occasionally and noncommercially, and only if you received the object code
with such an offer, in accord with subsection 6b.
d) Convey the object code by offering access from a designated place (gratis
or for a charge), and offer equivalent access to the Corresponding Source
in the same way through the same place at no further charge. You need not
require recipients to copy the Corresponding Source along with the object
code. If the place to copy the object code is a network server, the Corresponding
Source may be on a different server (operated by you or a third party) that
supports equivalent copying facilities, provided you maintain clear directions
next to the object code saying where to find the Corresponding Source. Regardless
of what server hosts the Corresponding Source, you remain obligated to ensure
that it is available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided you inform
other peers where the object code and Corresponding Source of the work are
being offered to the general public at no charge under subsection 6d.
A separable portion of the object code, whose source code is excluded from
the Corresponding Source as a System Library, need not be included in conveying
the object code work.
A “User Product” is either (1) a “consumer product”, which means any tangible
personal property which is normally used for personal, family, or household
purposes, or (2) anything designed or sold for incorporation into a dwelling.
In determining whether a product is a consumer product, doubtful cases shall
be resolved in favor of coverage. For a particular product received by a particular
user, “normally used” refers to a typical or common use of that class of product,
regardless of the status of the particular user or of the way in which the
particular user actually uses, or expects or is expected to use, the product.
A product is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent the
only significant mode of use of the product.
“Installation Information” for a User Product means any methods, procedures,
authorization keys, or other information required to install and execute modified
versions of a covered work in that User Product from a modified version of
its Corresponding Source. The information must suffice to ensure that the
continued functioning of the modified object code is in no case prevented
or interfered with solely because modification has been made.
If you convey an object code work under this section in, or with, or specifically
for use in, a User Product, and the conveying occurs as part of a transaction
in which the right of possession and use of the User Product is transferred
to the recipient in perpetuity or for a fixed term (regardless of how the
transaction is characterized), the Corresponding Source conveyed under this
section must be accompanied by the Installation Information. But this requirement
does not apply if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has been installed
in ROM).
The requirement to provide Installation Information does not include a requirement
to continue to provide support service, warranty, or updates for a work that
has been modified or installed by the recipient, or for the User Product in
which it has been modified or installed. Access to a network may be denied
when the modification itself materially and adversely affects the operation
of the network or violates the rules and protocols for communication across
the network.
Corresponding Source conveyed, and Installation Information provided, in accord
with this section must be in a format that is publicly documented (and with
an implementation available to the public in source code form), and must require
no special password or key for unpacking, reading or copying.
7. Additional Terms.
“Additional permissions” are terms that supplement the terms of this License
by making exceptions from one or more of its conditions. Additional permissions
that are applicable to the entire Program shall be treated as though they
were included in this License, to the extent that they are valid under applicable
law. If additional permissions apply only to part of the Program, that part
may be used separately under those permissions, but the entire Program remains
governed by this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option remove any
additional permissions from that copy, or from any part of it. (Additional
permissions may be written to require their own removal in certain cases when
you modify the work.) You may place additional permissions on material, added
by you to a covered work, for which you have or can give appropriate copyright
permission.
Notwithstanding any other provision of this License, for material you add
to a covered work, you may (if authorized by the copyright holders of that
material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the terms of
sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or author
attributions in that material or in the Appropriate Legal Notices displayed
by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or requiring
that modified versions of such material be marked in reasonable ways as different
from the original version; or
d) Limiting the use for publicity purposes of names of licensors or authors
of the material; or
e) Declining to grant rights under trademark law for use of some trade names,
trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that material by
anyone who conveys the material (or modified versions of it) with contractual
assumptions of liability to the recipient, for any liability that these contractual
assumptions directly impose on those licensors and authors.
All other non-permissive additional terms are considered “further restrictions”
within the meaning of section 10. If the Program as you received it, or any
part of it, contains a notice stating that it is governed by this License
along with a term that is a further restriction, you may remove that term.
If a license document contains a further restriction but permits relicensing
or conveying under this License, you may add to a covered work material governed
by the terms of that license document, provided that the further restriction
does not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you must place,
in the relevant source files, a statement of the additional terms that apply
to those files, or a notice indicating where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the form
of a separately written license, or stated as exceptions; the above requirements
apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly provided
under this License. Any attempt otherwise to propagate or modify it is void,
and will automatically terminate your rights under this License (including
any patent licenses granted under the third paragraph of section 11).
However, if you cease all violation of this License, then your license from
a particular copyright holder is reinstated (a) provisionally, unless and
until the copyright holder explicitly and finally terminates your license,
and (b) permanently, if the copyright holder fails to notify you of the violation
by some reasonable means prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is reinstated permanently
if the copyright holder notifies you of the violation by some reasonable means,
this is the first time you have received notice of violation of this License
(for any work) from that copyright holder, and you cure the violation prior
to 30 days after your receipt of the notice.
Termination of your rights under this section does not terminate the licenses
of parties who have received copies or rights from you under this License.
If your rights have been terminated and not permanently reinstated, you do
not qualify to receive new licenses for the same material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or run a copy
of the Program. Ancillary propagation of a covered work occurring solely as
a consequence of using peer-to-peer transmission to receive a copy likewise
does not require acceptance. However, nothing other than this License grants
you permission to propagate or modify any covered work. These actions infringe
copyright if you do not accept this License. Therefore, by modifying or propagating
a covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically receives
a license from the original licensors, to run, modify and propagate that work,
subject to this License. You are not responsible for enforcing compliance
by third parties with this License.
An “entity transaction” is a transaction transferring control of an organization,
or substantially all assets of one, or subdividing an organization, or merging
organizations. If propagation of a covered work results from an entity transaction,
each party to that transaction who receives a copy of the work also receives
whatever licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the Corresponding
Source of the work from the predecessor in interest, if the predecessor has
it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the rights
granted or affirmed under this License. For example, you may not impose a
license fee, royalty, or other charge for exercise of rights granted under
this License, and you may not initiate litigation (including a cross-claim
or counterclaim in a lawsuit) alleging that any patent claim is infringed
by making, using, selling, offering for sale, or importing the Program or
any portion of it.
11. Patents.
A “contributor” is a copyright holder who authorizes use under this License
of the Program or a work on which the Program is based. The work thus licensed
is called the contributor's “contributor version”.
A contributor's “essential patent claims” are all patent claims owned or controlled
by the contributor, whether already acquired or hereafter acquired, that would
be infringed by some manner, permitted by this License, of making, using,
or selling its contributor version, but do not include claims that would be
infringed only as a consequence of further modification of the contributor
version. For purposes of this definition, “control” includes the right to
grant patent sublicenses in a manner consistent with the requirements of this
License.
Each contributor grants you a non-exclusive, worldwide, royalty-free patent
license under the contributor's essential patent claims, to make, use, sell,
offer for sale, import and otherwise run, modify and propagate the contents
of its contributor version.
In the following three paragraphs, a “patent license” is any express agreement
or commitment, however denominated, not to enforce a patent (such as an express
permission to practice a patent or covenant not to sue for patent infringement).
To “grant” such a patent license to a party means to make such an agreement
or commitment not to enforce a patent against the party.
If you convey a covered work, knowingly relying on a patent license, and the
Corresponding Source of the work is not available for anyone to copy, free
of charge and under the terms of this License, through a publicly available
network server or other readily accessible means, then you must either (1)
cause the Corresponding Source to be so available, or (2) arrange to deprive
yourself of the benefit of the patent license for this particular work, or
(3) arrange, in a manner consistent with the requirements of this License,
to extend the patent license to downstream recipients. “Knowingly relying”
means you have actual knowledge that, but for the patent license, your conveying
the covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that country
that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or arrangement,
you convey, or propagate by procuring conveyance of, a covered work, and grant
a patent license to some of the parties receiving the covered work authorizing
them to use, propagate, modify or convey a specific copy of the covered work,
then the patent license you grant is automatically extended to all recipients
of the covered work and works based on it.
A patent license is “discriminatory” if it does not include within the scope
of its coverage, prohibits the exercise of, or is conditioned on the non-exercise
of one or more of the rights that are specifically granted under this License.
You may not convey a covered work if you are a party to an arrangement with
a third party that is in the business of distributing software, under which
you make payment to the third party based on the extent of your activity of
conveying the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory patent
license (a) in connection with copies of the covered work conveyed by you
(or copies made from those copies), or (b) primarily for and in connection
with specific products or compilations that contain the covered work, unless
you entered into that arrangement, or that patent license was granted, prior
to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting any implied
license or other defenses to infringement that may otherwise be available
to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or otherwise)
that contradict the conditions of this License, they do not excuse you from
the conditions of this License. If you cannot convey a covered work so as
to satisfy simultaneously your obligations under this License and any other
pertinent obligations, then as a consequence you may not convey it at all.
For example, if you agree to terms that obligate you to collect a royalty
for further conveying from those to whom you convey the Program, the only
way you could satisfy both those terms and this License would be to refrain
entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have permission to
link or combine any covered work with a work licensed under version 3 of the
GNU Affero General Public License into a single combined work, and to convey
the resulting work. The terms of this License will continue to apply to the
part which is the covered work, but the special requirements of the GNU Affero
General Public License, section 13, concerning interaction through a network
will apply to the combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of the
GNU General Public License from time to time. Such new versions will be similar
in spirit to the present version, but may differ in detail to address new
problems or concerns.
Each version is given a distinguishing version number. If the Program specifies
that a certain numbered version of the GNU General Public License “or any
later version” applies to it, you have the option of following the terms and
conditions either of that numbered version or of any later version published
by the Free Software Foundation. If the Program does not specify a version
number of the GNU General Public License, you may choose any version ever
published by the Free Software Foundation.
If the Program specifies that a proxy can decide which future versions of
the GNU General Public License can be used, that proxy's public statement
of acceptance of a version permanently authorizes you to choose that version
for the Program.
Later license versions may give you additional or different permissions. However,
no additional obligations are imposed on any author or copyright holder as
a result of your choosing to follow a later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE
LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER
EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM
PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL
ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM
AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL,
INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO
USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED
INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE
PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER
PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided above cannot
be given local legal effect according to their terms, reviewing courts shall
apply local law that most closely approximates an absolute waiver of all civil
liability in connection with the Program, unless a warranty or assumption
of liability accompanies a copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest possible
use to the public, the best way to achieve this is to make it free software
which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest to attach
them to the start of each source file to most effectively state the exclusion
of warranty; and each file should have at least the “copyright” line and a
pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
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 3 of the License, 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.
You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short notice like
this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it under certain
conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands might
be different; for a GUI interface, you would use an “about box”.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a “copyright disclaimer” for the program, if necessary. For
more information on this, and how to apply and follow the GNU GPL, see <http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General Public
License instead of this License. But first, please read <http://www.gnu.org/philosophy/why-not-lgpl.html>.
@@ -0,0 +1,444 @@
GNU LIBRARY GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1991 Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
Everyone is permitted to copy and distribute verbatim copies of this license
document, but changing it is not allowed.
[This is the first released version of the library GPL. It is numbered 2
because it goes with version 2 of the ordinary GPL.]
Preamble
The licenses for most software are designed to take away your freedom to share
and change it. By contrast, the GNU General Public Licenses are intended to
guarantee your freedom to share and change free software--to make sure the
software is free for all its users.
This license, the Library General Public License, applies to some specially
designated Free Software Foundation software, and to any other libraries whose
authors decide to use it. You can use it for your libraries, too.
When we speak of free software, we are referring to freedom, not price. Our
General Public Licenses are designed to make sure that you have the freedom
to distribute copies of free software (and charge for this service if you
wish), that you receive source code or can get it if you want it, that you
can change the software or use pieces of it in new free programs; and that
you know you can do these things.
To protect your rights, we need to make restrictions that forbid anyone to
deny you these rights or to ask you to surrender the rights. These restrictions
translate to certain responsibilities for you if you distribute copies of
the library, or if you modify it.
For example, if you distribute copies of the library, whether gratis or for
a fee, you must give the recipients all the rights that we gave you. You must
make sure that they, too, receive or can get the source code. If you link
a program with the library, you must provide complete object files to the
recipients so that they can relink them with the library, after making changes
to the library and recompiling it. And you must show them these terms so they
know their rights.
Our method of protecting your rights has two steps: (1) copyright the library,
and (2) offer you this license which gives you legal permission to copy, distribute
and/or modify the library.
Also, for each distributor's protection, we want to make certain that everyone
understands that there is no warranty for this free library. If the library
is modified by someone else and passed on, we want its recipients to know
that what they have is not the original version, so that any problems introduced
by others will not reflect on the original authors' reputations.
Finally, any free program is threatened constantly by software patents. We
wish to avoid the danger that companies distributing free software will individually
obtain patent licenses, thus in effect transforming the program into proprietary
software. To prevent this, we have made it clear that any patent must be licensed
for everyone's free use or not licensed at all.
Most GNU software, including some libraries, is covered by the ordinary GNU
General Public License, which was designed for utility programs. This license,
the GNU Library General Public License, applies to certain designated libraries.
This license is quite different from the ordinary one; be sure to read it
in full, and don't assume that anything in it is the same as in the ordinary
license.
The reason we have a separate public license for some libraries is that they
blur the distinction we usually make between modifying or adding to a program
and simply using it. Linking a program with a library, without changing the
library, is in some sense simply using the library, and is analogous to running
a utility program or application program. However, in a textual and legal
sense, the linked executable is a combined work, a derivative of the original
library, and the ordinary General Public License treats it as such.
Because of this blurred distinction, using the ordinary General Public License
for libraries did not effectively promote software sharing, because most developers
did not use the libraries. We concluded that weaker conditions might promote
sharing better.
However, unrestricted linking of non-free programs would deprive the users
of those programs of all benefit from the free status of the libraries themselves.
This Library General Public License is intended to permit developers of non-free
programs to use free libraries, while preserving your freedom as a user of
such programs to change the free libraries that are incorporated in them.
(We have not seen how to achieve this as regards changes in header files,
but we have achieved it as regards changes in the actual functions of the
Library.) The hope is that this will lead to faster development of free libraries.
The precise terms and conditions for copying, distribution and modification
follow. Pay close attention to the difference between a "work based on the
library" and a "work that uses the library". The former contains code derived
from the library, while the latter only works together with the library.
Note that it is possible for a library to be covered by the ordinary General
Public License rather than by this special one.
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library which contains a
notice placed by the copyright holder or other authorized party saying it
may be distributed under the terms of this Library General Public License
(also called "this License"). Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data prepared
so as to be conveniently linked with application programs (which use some
of those functions and data) to form executables.
The "Library", below, refers to any such software library or work which has
been distributed under these terms. A "work based on the Library" means either
the Library or any derivative work under copyright law: that is to say, a
work containing the Library or a portion of it, either verbatim or with modifications
and/or translated straightforwardly into another language. (Hereinafter, translation
is included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for making modifications
to it. For a library, complete source code means all the source code for all
modules it contains, plus any associated interface definition files, plus
the scripts used to control compilation and installation of the library.
Activities other than copying, distribution and modification are not covered
by this License; they are outside its scope. The act of running a program
using the Library is not restricted, and output from such a program is covered
only if its contents constitute a work based on the Library (independent of
the use of the Library in a tool for writing it). Whether that is true depends
on what the Library does and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's complete source
code as you receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice and disclaimer
of warranty; keep intact all the notices that refer to this License and to
the absence of any warranty; and distribute a copy of this License along with
the Library.
You may charge a fee for the physical act of transferring a copy, and you
may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Library or any portion of it,
thus forming a work based on the Library, and copy and distribute such modifications
or work under the terms of Section 1 above, provided that you also meet all
of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices stating that
you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no charge to all
third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a table of
data to be supplied by an application program that uses the facility, other
than as an argument passed when the facility is invoked, then you must make
a good faith effort to ensure that, in the event an application does not supply
such function or table, the facility still operates, and performs whatever
part of its purpose remains meaningful.
(For example, a function in a library to compute square roots has a purpose
that is entirely well-defined independent of the application. Therefore, Subsection
2d requires that any application-supplied function or table used by this function
must be optional: if the application does not supply it, the square root function
must still compute square roots.)
These requirements apply to the modified work as a whole. If identifiable
sections of that work are not derived from the Library, and can be reasonably
considered independent and separate works in themselves, then this License,
and its terms, do not apply to those sections when you distribute them as
separate works. But when you distribute the same sections as part of a whole
which is a work based on the Library, the distribution of the whole must be
on the terms of this License, whose permissions for other licensees extend
to the entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest your
rights to work written entirely by you; rather, the intent is to exercise
the right to control the distribution of derivative or collective works based
on the Library.
In addition, mere aggregation of another work not based on the Library with
the Library (or with a work based on the Library) on a volume of a storage
or distribution medium does not bring the other work under the scope of this
License.
3. You may opt to apply the terms of the ordinary GNU General Public License
instead of this License to a given copy of the Library. To do this, you must
alter all the notices that refer to this License, so that they refer to the
ordinary GNU General Public License, version 2, instead of to this License.
(If a newer version than version 2 of the ordinary GNU General Public License
has appeared, then you can specify that version instead if you wish.) Do not
make any other change in these notices.
Once this change is made in a given copy, it is irreversible for that copy,
so the ordinary GNU General Public License applies to all subsequent copies
and derivative works made from that copy.
This option is useful when you wish to copy part of the code of the Library
into a program that is not a library.
4. You may copy and distribute the Library (or a portion or derivative of
it, under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you accompany it with the complete corresponding
machine-readable source code, which must be distributed under the terms of
Sections 1 and 2 above on a medium customarily used for software interchange.
If distribution of object code is made by offering access to copy from a designated
place, then offering equivalent access to copy the source code from the same
place satisfies the requirement to distribute the source code, even though
third parties are not compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the Library, but
is designed to work with the Library by being compiled or linked with it,
is called a "work that uses the Library". Such a work, in isolation, is not
a derivative work of the Library, and therefore falls outside the scope of
this License.
However, linking a "work that uses the Library" with the Library creates an
executable that is a derivative of the Library (because it contains portions
of the Library), rather than a "work that uses the library". The executable
is therefore covered by this License. Section 6 states terms for distribution
of such executables.
When a "work that uses the Library" uses material from a header file that
is part of the Library, the object code for the work may be a derivative work
of the Library even though the source code is not. Whether this is true is
especially significant if the work can be linked without the Library, or if
the work is itself a library. The threshold for this to be true is not precisely
defined by law.
If such an object file uses only numerical parameters, data structure layouts
and accessors, and small macros and small inline functions (ten lines or less
in length), then the use of the object file is unrestricted, regardless of
whether it is legally a derivative work. (Executables containing this object
code plus portions of the Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may distribute
the object code for the work under the terms of Section 6. Any executables
containing that work also fall under Section 6, whether or not they are linked
directly with the Library itself.
6. As an exception to the Sections above, you may also compile or link a "work
that uses the Library" with the Library to produce a work containing portions
of the Library, and distribute that work under terms of your choice, provided
that the terms permit modification of the work for the customer's own use
and reverse engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the Library
is used in it and that the Library and its use are covered by this License.
You must supply a copy of this License. If the work during execution displays
copyright notices, you must include the copyright notice for the Library among
them, as well as a reference directing the user to the copy of this License.
Also, you must do one of these things:
a) Accompany the work with the complete corresponding machine-readable source
code for the Library including whatever changes were used in the work (which
must be distributed under Sections 1 and 2 above); and, if the work is an
executable linked with the Library, with the complete machine-readable "work
that uses the Library", as object code and/or source code, so that the user
can modify the Library and then relink to produce a modified executable containing
the modified Library. (It is understood that the user who changes the contents
of definitions files in the Library will not necessarily be able to recompile
the application to use the modified definitions.)
b) Accompany the work with a written offer, valid for at least three years,
to give the same user the materials specified in Subsection 6a, above, for
a charge no more than the cost of performing this distribution.
c) If distribution of the work is made by offering access to copy from a designated
place, offer equivalent access to copy the above specified materials from
the same place.
d) Verify that the user has already received a copy of these materials or
that you have already sent this user a copy.
For an executable, the required form of the "work that uses the Library" must
include any data and utility programs needed for reproducing the executable
from it. However, as a special exception, the source code distributed need
not include anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the operating
system on which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license restrictions of
other proprietary libraries that do not normally accompany the operating system.
Such a contradiction means you cannot use both them and the Library together
in an executable that you distribute.
7. You may place library facilities that are a work based on the Library side-by-side
in a single library together with other library facilities not covered by
this License, and distribute such a combined library, provided that the separate
distribution of the work based on the Library and of the other library facilities
is otherwise permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work based on the
Library, uncombined with any other library facilities. This must be distributed
under the terms of the Sections above.
b) Give prominent notice with the combined library of the fact that part of
it is a work based on the Library, and explaining where to find the accompanying
uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute the Library
except as expressly provided under this License. Any attempt otherwise to
copy, modify, sublicense, link with, or distribute the Library is void, and
will automatically terminate your rights under this License. However, parties
who have received copies, or rights, from you under this License will not
have their licenses terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not signed
it. However, nothing else grants you permission to modify or distribute the
Library or its derivative works. These actions are prohibited by law if you
do not accept this License. Therefore, by modifying or distributing the Library
(or any work based on the Library), you indicate your acceptance of this License
to do so, and all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the Library),
the recipient automatically receives a license from the original licensor
to copy, distribute, link with or modify the Library subject to these terms
and conditions. You may not impose any further restrictions on the recipients'
exercise of the rights granted herein. You are not responsible for enforcing
compliance by third parties to this License.
11. If, as a consequence of a court judgment or allegation of patent infringement
or for any other reason (not limited to patent issues), conditions are imposed
on you (whether by court order, agreement or otherwise) that contradict the
conditions of this License, they do not excuse you from the conditions of
this License. If you cannot distribute so as to satisfy simultaneously your
obligations under this License and any other pertinent obligations, then as
a consequence you may not distribute the Library at all. For example, if a
patent license would not permit royalty-free redistribution of the Library
by all those who receive copies directly or indirectly through you, then the
only way you could satisfy both it and this License would be to refrain entirely
from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any patents
or other property right claims or to contest validity of any such claims;
this section has the sole purpose of protecting the integrity of the free
software distribution system which is implemented by public license practices.
Many people have made generous contributions to the wide range of software
distributed through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing to
distribute software through any other system and a licensee cannot impose
that choice.
This section is intended to make thoroughly clear what is believed to be a
consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in certain
countries either by patents or by copyrighted interfaces, the original copyright
holder who places the Library under this License may add an explicit geographical
distribution limitation excluding those countries, so that distribution is
permitted only in or among countries not thus excluded. In such case, this
License incorporates the limitation as if written in the body of this License.
13. The Free Software Foundation may publish revised and/or new versions of
the Library General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to address
new problems or concerns.
Each version is given a distinguishing version number. If the Library specifies
a version number of this License which applies to it and "any later version",
you have the option of following the terms and conditions either of that version
or of any later version published by the Free Software Foundation. If the
Library does not specify a license version number, you may choose any version
ever published by the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free programs
whose distribution conditions are incompatible with these, write to the author
to ask for permission. For software which is copyrighted by the Free Software
Foundation, write to the Free Software Foundation; we sometimes make exceptions
for this. Our decision will be guided by the two goals of preserving the free
status of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR
THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE
STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY
"AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE
OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE
THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE
OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA
OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES
OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH
HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest possible
use to the public, we recommend making it free software that everyone can
redistribute and change. You can do so by permitting redistribution under
these terms (or, alternatively, under the terms of the ordinary General Public
License).
To apply these terms, attach the following notices to the library. It is safest
to attach them to the start of each source file to most effectively convey
the exclusion of warranty; and each file should have at least the "copyright"
line and a pointer to where the full notice is found.
one line to give the library's name and an idea of what it does.
Copyright (C) year name of author
This library is free software; you can redistribute it and/or modify it under
the terms of the GNU Library General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version.
This library 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 Library General Public License for
more details.
You should have received a copy of the GNU Library General Public License
along with this library; if not, write to the Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your school,
if any, to sign a "copyright disclaimer" for the library, if necessary. Here
is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in
the library `Frob' (a library for tweaking knobs) written
by James Random Hacker.
signature of Ty Coon, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!
@@ -0,0 +1,444 @@
GNU LIBRARY GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1991 Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
Everyone is permitted to copy and distribute verbatim copies of this license
document, but changing it is not allowed.
[This is the first released version of the library GPL. It is numbered 2
because it goes with version 2 of the ordinary GPL.]
Preamble
The licenses for most software are designed to take away your freedom to share
and change it. By contrast, the GNU General Public Licenses are intended to
guarantee your freedom to share and change free software--to make sure the
software is free for all its users.
This license, the Library General Public License, applies to some specially
designated Free Software Foundation software, and to any other libraries whose
authors decide to use it. You can use it for your libraries, too.
When we speak of free software, we are referring to freedom, not price. Our
General Public Licenses are designed to make sure that you have the freedom
to distribute copies of free software (and charge for this service if you
wish), that you receive source code or can get it if you want it, that you
can change the software or use pieces of it in new free programs; and that
you know you can do these things.
To protect your rights, we need to make restrictions that forbid anyone to
deny you these rights or to ask you to surrender the rights. These restrictions
translate to certain responsibilities for you if you distribute copies of
the library, or if you modify it.
For example, if you distribute copies of the library, whether gratis or for
a fee, you must give the recipients all the rights that we gave you. You must
make sure that they, too, receive or can get the source code. If you link
a program with the library, you must provide complete object files to the
recipients so that they can relink them with the library, after making changes
to the library and recompiling it. And you must show them these terms so they
know their rights.
Our method of protecting your rights has two steps: (1) copyright the library,
and (2) offer you this license which gives you legal permission to copy, distribute
and/or modify the library.
Also, for each distributor's protection, we want to make certain that everyone
understands that there is no warranty for this free library. If the library
is modified by someone else and passed on, we want its recipients to know
that what they have is not the original version, so that any problems introduced
by others will not reflect on the original authors' reputations.
Finally, any free program is threatened constantly by software patents. We
wish to avoid the danger that companies distributing free software will individually
obtain patent licenses, thus in effect transforming the program into proprietary
software. To prevent this, we have made it clear that any patent must be licensed
for everyone's free use or not licensed at all.
Most GNU software, including some libraries, is covered by the ordinary GNU
General Public License, which was designed for utility programs. This license,
the GNU Library General Public License, applies to certain designated libraries.
This license is quite different from the ordinary one; be sure to read it
in full, and don't assume that anything in it is the same as in the ordinary
license.
The reason we have a separate public license for some libraries is that they
blur the distinction we usually make between modifying or adding to a program
and simply using it. Linking a program with a library, without changing the
library, is in some sense simply using the library, and is analogous to running
a utility program or application program. However, in a textual and legal
sense, the linked executable is a combined work, a derivative of the original
library, and the ordinary General Public License treats it as such.
Because of this blurred distinction, using the ordinary General Public License
for libraries did not effectively promote software sharing, because most developers
did not use the libraries. We concluded that weaker conditions might promote
sharing better.
However, unrestricted linking of non-free programs would deprive the users
of those programs of all benefit from the free status of the libraries themselves.
This Library General Public License is intended to permit developers of non-free
programs to use free libraries, while preserving your freedom as a user of
such programs to change the free libraries that are incorporated in them.
(We have not seen how to achieve this as regards changes in header files,
but we have achieved it as regards changes in the actual functions of the
Library.) The hope is that this will lead to faster development of free libraries.
The precise terms and conditions for copying, distribution and modification
follow. Pay close attention to the difference between a "work based on the
library" and a "work that uses the library". The former contains code derived
from the library, while the latter only works together with the library.
Note that it is possible for a library to be covered by the ordinary General
Public License rather than by this special one.
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library which contains a
notice placed by the copyright holder or other authorized party saying it
may be distributed under the terms of this Library General Public License
(also called "this License"). Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data prepared
so as to be conveniently linked with application programs (which use some
of those functions and data) to form executables.
The "Library", below, refers to any such software library or work which has
been distributed under these terms. A "work based on the Library" means either
the Library or any derivative work under copyright law: that is to say, a
work containing the Library or a portion of it, either verbatim or with modifications
and/or translated straightforwardly into another language. (Hereinafter, translation
is included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for making modifications
to it. For a library, complete source code means all the source code for all
modules it contains, plus any associated interface definition files, plus
the scripts used to control compilation and installation of the library.
Activities other than copying, distribution and modification are not covered
by this License; they are outside its scope. The act of running a program
using the Library is not restricted, and output from such a program is covered
only if its contents constitute a work based on the Library (independent of
the use of the Library in a tool for writing it). Whether that is true depends
on what the Library does and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's complete source
code as you receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice and disclaimer
of warranty; keep intact all the notices that refer to this License and to
the absence of any warranty; and distribute a copy of this License along with
the Library.
You may charge a fee for the physical act of transferring a copy, and you
may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Library or any portion of it,
thus forming a work based on the Library, and copy and distribute such modifications
or work under the terms of Section 1 above, provided that you also meet all
of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices stating that
you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no charge to all
third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a table of
data to be supplied by an application program that uses the facility, other
than as an argument passed when the facility is invoked, then you must make
a good faith effort to ensure that, in the event an application does not supply
such function or table, the facility still operates, and performs whatever
part of its purpose remains meaningful.
(For example, a function in a library to compute square roots has a purpose
that is entirely well-defined independent of the application. Therefore, Subsection
2d requires that any application-supplied function or table used by this function
must be optional: if the application does not supply it, the square root function
must still compute square roots.)
These requirements apply to the modified work as a whole. If identifiable
sections of that work are not derived from the Library, and can be reasonably
considered independent and separate works in themselves, then this License,
and its terms, do not apply to those sections when you distribute them as
separate works. But when you distribute the same sections as part of a whole
which is a work based on the Library, the distribution of the whole must be
on the terms of this License, whose permissions for other licensees extend
to the entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest your
rights to work written entirely by you; rather, the intent is to exercise
the right to control the distribution of derivative or collective works based
on the Library.
In addition, mere aggregation of another work not based on the Library with
the Library (or with a work based on the Library) on a volume of a storage
or distribution medium does not bring the other work under the scope of this
License.
3. You may opt to apply the terms of the ordinary GNU General Public License
instead of this License to a given copy of the Library. To do this, you must
alter all the notices that refer to this License, so that they refer to the
ordinary GNU General Public License, version 2, instead of to this License.
(If a newer version than version 2 of the ordinary GNU General Public License
has appeared, then you can specify that version instead if you wish.) Do not
make any other change in these notices.
Once this change is made in a given copy, it is irreversible for that copy,
so the ordinary GNU General Public License applies to all subsequent copies
and derivative works made from that copy.
This option is useful when you wish to copy part of the code of the Library
into a program that is not a library.
4. You may copy and distribute the Library (or a portion or derivative of
it, under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you accompany it with the complete corresponding
machine-readable source code, which must be distributed under the terms of
Sections 1 and 2 above on a medium customarily used for software interchange.
If distribution of object code is made by offering access to copy from a designated
place, then offering equivalent access to copy the source code from the same
place satisfies the requirement to distribute the source code, even though
third parties are not compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the Library, but
is designed to work with the Library by being compiled or linked with it,
is called a "work that uses the Library". Such a work, in isolation, is not
a derivative work of the Library, and therefore falls outside the scope of
this License.
However, linking a "work that uses the Library" with the Library creates an
executable that is a derivative of the Library (because it contains portions
of the Library), rather than a "work that uses the library". The executable
is therefore covered by this License. Section 6 states terms for distribution
of such executables.
When a "work that uses the Library" uses material from a header file that
is part of the Library, the object code for the work may be a derivative work
of the Library even though the source code is not. Whether this is true is
especially significant if the work can be linked without the Library, or if
the work is itself a library. The threshold for this to be true is not precisely
defined by law.
If such an object file uses only numerical parameters, data structure layouts
and accessors, and small macros and small inline functions (ten lines or less
in length), then the use of the object file is unrestricted, regardless of
whether it is legally a derivative work. (Executables containing this object
code plus portions of the Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may distribute
the object code for the work under the terms of Section 6. Any executables
containing that work also fall under Section 6, whether or not they are linked
directly with the Library itself.
6. As an exception to the Sections above, you may also compile or link a "work
that uses the Library" with the Library to produce a work containing portions
of the Library, and distribute that work under terms of your choice, provided
that the terms permit modification of the work for the customer's own use
and reverse engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the Library
is used in it and that the Library and its use are covered by this License.
You must supply a copy of this License. If the work during execution displays
copyright notices, you must include the copyright notice for the Library among
them, as well as a reference directing the user to the copy of this License.
Also, you must do one of these things:
a) Accompany the work with the complete corresponding machine-readable source
code for the Library including whatever changes were used in the work (which
must be distributed under Sections 1 and 2 above); and, if the work is an
executable linked with the Library, with the complete machine-readable "work
that uses the Library", as object code and/or source code, so that the user
can modify the Library and then relink to produce a modified executable containing
the modified Library. (It is understood that the user who changes the contents
of definitions files in the Library will not necessarily be able to recompile
the application to use the modified definitions.)
b) Accompany the work with a written offer, valid for at least three years,
to give the same user the materials specified in Subsection 6a, above, for
a charge no more than the cost of performing this distribution.
c) If distribution of the work is made by offering access to copy from a designated
place, offer equivalent access to copy the above specified materials from
the same place.
d) Verify that the user has already received a copy of these materials or
that you have already sent this user a copy.
For an executable, the required form of the "work that uses the Library" must
include any data and utility programs needed for reproducing the executable
from it. However, as a special exception, the source code distributed need
not include anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the operating
system on which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license restrictions of
other proprietary libraries that do not normally accompany the operating system.
Such a contradiction means you cannot use both them and the Library together
in an executable that you distribute.
7. You may place library facilities that are a work based on the Library side-by-side
in a single library together with other library facilities not covered by
this License, and distribute such a combined library, provided that the separate
distribution of the work based on the Library and of the other library facilities
is otherwise permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work based on the
Library, uncombined with any other library facilities. This must be distributed
under the terms of the Sections above.
b) Give prominent notice with the combined library of the fact that part of
it is a work based on the Library, and explaining where to find the accompanying
uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute the Library
except as expressly provided under this License. Any attempt otherwise to
copy, modify, sublicense, link with, or distribute the Library is void, and
will automatically terminate your rights under this License. However, parties
who have received copies, or rights, from you under this License will not
have their licenses terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not signed
it. However, nothing else grants you permission to modify or distribute the
Library or its derivative works. These actions are prohibited by law if you
do not accept this License. Therefore, by modifying or distributing the Library
(or any work based on the Library), you indicate your acceptance of this License
to do so, and all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the Library),
the recipient automatically receives a license from the original licensor
to copy, distribute, link with or modify the Library subject to these terms
and conditions. You may not impose any further restrictions on the recipients'
exercise of the rights granted herein. You are not responsible for enforcing
compliance by third parties to this License.
11. If, as a consequence of a court judgment or allegation of patent infringement
or for any other reason (not limited to patent issues), conditions are imposed
on you (whether by court order, agreement or otherwise) that contradict the
conditions of this License, they do not excuse you from the conditions of
this License. If you cannot distribute so as to satisfy simultaneously your
obligations under this License and any other pertinent obligations, then as
a consequence you may not distribute the Library at all. For example, if a
patent license would not permit royalty-free redistribution of the Library
by all those who receive copies directly or indirectly through you, then the
only way you could satisfy both it and this License would be to refrain entirely
from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any patents
or other property right claims or to contest validity of any such claims;
this section has the sole purpose of protecting the integrity of the free
software distribution system which is implemented by public license practices.
Many people have made generous contributions to the wide range of software
distributed through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing to
distribute software through any other system and a licensee cannot impose
that choice.
This section is intended to make thoroughly clear what is believed to be a
consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in certain
countries either by patents or by copyrighted interfaces, the original copyright
holder who places the Library under this License may add an explicit geographical
distribution limitation excluding those countries, so that distribution is
permitted only in or among countries not thus excluded. In such case, this
License incorporates the limitation as if written in the body of this License.
13. The Free Software Foundation may publish revised and/or new versions of
the Library General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to address
new problems or concerns.
Each version is given a distinguishing version number. If the Library specifies
a version number of this License which applies to it and "any later version",
you have the option of following the terms and conditions either of that version
or of any later version published by the Free Software Foundation. If the
Library does not specify a license version number, you may choose any version
ever published by the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free programs
whose distribution conditions are incompatible with these, write to the author
to ask for permission. For software which is copyrighted by the Free Software
Foundation, write to the Free Software Foundation; we sometimes make exceptions
for this. Our decision will be guided by the two goals of preserving the free
status of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR
THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE
STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY
"AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE
OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE
THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE
OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA
OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES
OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH
HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest possible
use to the public, we recommend making it free software that everyone can
redistribute and change. You can do so by permitting redistribution under
these terms (or, alternatively, under the terms of the ordinary General Public
License).
To apply these terms, attach the following notices to the library. It is safest
to attach them to the start of each source file to most effectively convey
the exclusion of warranty; and each file should have at least the "copyright"
line and a pointer to where the full notice is found.
one line to give the library's name and an idea of what it does.
Copyright (C) year name of author
This library is free software; you can redistribute it and/or modify it under
the terms of the GNU Library General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version.
This library 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 Library General Public License for
more details.
You should have received a copy of the GNU Library General Public License
along with this library; if not, write to the Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your school,
if any, to sign a "copyright disclaimer" for the library, if necessary. Here
is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in
the library `Frob' (a library for tweaking knobs) written
by James Random Hacker.
signature of Ty Coon, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!
@@ -0,0 +1,462 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies of this license
document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts as
the successor of the GNU Library Public License, version 2, hence the version
number 2.1.]
Preamble
The licenses for most software are designed to take away your freedom to share
and change it. By contrast, the GNU General Public Licenses are intended to
guarantee your freedom to share and change free software--to make sure the
software is free for all its users.
This license, the Lesser General Public License, applies to some specially
designated software packages--typically libraries--of the Free Software Foundation
and other authors who decide to use it. You can use it too, but we suggest
you first think carefully about whether this license or the ordinary General
Public License is the better strategy to use in any particular case, based
on the explanations below.
When we speak of free software, we are referring to freedom of use, not price.
Our General Public Licenses are designed to make sure that you have the freedom
to distribute copies of free software (and charge for this service if you
wish); that you receive source code or can get it if you want it; that you
can change the software and use pieces of it in new free programs; and that
you are informed that you can do these things.
To protect your rights, we need to make restrictions that forbid distributors
to deny you these rights or to ask you to surrender these rights. These restrictions
translate to certain responsibilities for you if you distribute copies of
the library or if you modify it.
For example, if you distribute copies of the library, whether gratis or for
a fee, you must give the recipients all the rights that we gave you. You must
make sure that they, too, receive or can get the source code. If you link
other code with the library, you must provide complete object files to the
recipients, so that they can relink them with the library after making changes
to the library and recompiling it. And you must show them these terms so they
know their rights.
We protect your rights with a two-step method: (1) we copyright the library,
and (2) we offer you this license, which gives you legal permission to copy,
distribute and/or modify the library.
To protect each distributor, we want to make it very clear that there is no
warranty for the free library. Also, if the library is modified by someone
else and passed on, the recipients should know that what they have is not
the original version, so that the original author's reputation will not be
affected by problems that might be introduced by others.
Finally, software patents pose a constant threat to the existence of any free
program. We wish to make sure that a company cannot effectively restrict the
users of a free program by obtaining a restrictive license from a patent holder.
Therefore, we insist that any patent license obtained for a version of the
library must be consistent with the full freedom of use specified in this
license.
Most GNU software, including some libraries, is covered by the ordinary GNU
General Public License. This license, the GNU Lesser General Public License,
applies to certain designated libraries, and is quite different from the ordinary
General Public License. We use this license for certain libraries in order
to permit linking those libraries into non-free programs.
When a program is linked with a library, whether statically or using a shared
library, the combination of the two is legally speaking a combined work, a
derivative of the original library. The ordinary General Public License therefore
permits such linking only if the entire combination fits its criteria of freedom.
The Lesser General Public License permits more lax criteria for linking other
code with the library.
We call this license the "Lesser" General Public License because it does Less
to protect the user's freedom than the ordinary General Public License. It
also provides other free software developers Less of an advantage over competing
non-free programs. These disadvantages are the reason we use the ordinary
General Public License for many libraries. However, the Lesser license provides
advantages in certain special circumstances.
For example, on rare occasions, there may be a special need to encourage the
widest possible use of a certain library, so that it becomes a de-facto standard.
To achieve this, non-free programs must be allowed to use the library. A more
frequent case is that a free library does the same job as widely used non-free
libraries. In this case, there is little to gain by limiting the free library
to free software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free programs
enables a greater number of people to use a large body of free software. For
example, permission to use the GNU C Library in non-free programs enables
many more people to use the whole GNU operating system, as well as its variant,
the GNU/Linux operating system.
Although the Lesser General Public License is Less protective of the users'
freedom, it does ensure that the user of a program that is linked with the
Library has the freedom and the wherewithal to run that program using a modified
version of the Library.
The precise terms and conditions for copying, distribution and modification
follow. Pay close attention to the difference between a "work based on the
library" and a "work that uses the library". The former contains code derived
from the library, whereas the latter must be combined with the library in
order to run.
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other program
which contains a notice placed by the copyright holder or other authorized
party saying it may be distributed under the terms of this Lesser General
Public License (also called "this License"). Each licensee is addressed as
"you".
A "library" means a collection of software functions and/or data prepared
so as to be conveniently linked with application programs (which use some
of those functions and data) to form executables.
The "Library", below, refers to any such software library or work which has
been distributed under these terms. A "work based on the Library" means either
the Library or any derivative work under copyright law: that is to say, a
work containing the Library or a portion of it, either verbatim or with modifications
and/or translated straightforwardly into another language. (Hereinafter, translation
is included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for making modifications
to it. For a library, complete source code means all the source code for all
modules it contains, plus any associated interface definition files, plus
the scripts used to control compilation and installation of the library.
Activities other than copying, distribution and modification are not covered
by this License; they are outside its scope. The act of running a program
using the Library is not restricted, and output from such a program is covered
only if its contents constitute a work based on the Library (independent of
the use of the Library in a tool for writing it). Whether that is true depends
on what the Library does and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's complete source
code as you receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice and disclaimer
of warranty; keep intact all the notices that refer to this License and to
the absence of any warranty; and distribute a copy of this License along with
the Library.
You may charge a fee for the physical act of transferring a copy, and you
may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Library or any portion of it,
thus forming a work based on the Library, and copy and distribute such modifications
or work under the terms of Section 1 above, provided that you also meet all
of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices stating that
you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no charge to all
third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a table of
data to be supplied by an application program that uses the facility, other
than as an argument passed when the facility is invoked, then you must make
a good faith effort to ensure that, in the event an application does not supply
such function or table, the facility still operates, and performs whatever
part of its purpose remains meaningful.
(For example, a function in a library to compute square roots has a purpose
that is entirely well-defined independent of the application. Therefore, Subsection
2d requires that any application-supplied function or table used by this function
must be optional: if the application does not supply it, the square root function
must still compute square roots.)
These requirements apply to the modified work as a whole. If identifiable
sections of that work are not derived from the Library, and can be reasonably
considered independent and separate works in themselves, then this License,
and its terms, do not apply to those sections when you distribute them as
separate works. But when you distribute the same sections as part of a whole
which is a work based on the Library, the distribution of the whole must be
on the terms of this License, whose permissions for other licensees extend
to the entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest your
rights to work written entirely by you; rather, the intent is to exercise
the right to control the distribution of derivative or collective works based
on the Library.
In addition, mere aggregation of another work not based on the Library with
the Library (or with a work based on the Library) on a volume of a storage
or distribution medium does not bring the other work under the scope of this
License.
3. You may opt to apply the terms of the ordinary GNU General Public License
instead of this License to a given copy of the Library. To do this, you must
alter all the notices that refer to this License, so that they refer to the
ordinary GNU General Public License, version 2, instead of to this License.
(If a newer version than version 2 of the ordinary GNU General Public License
has appeared, then you can specify that version instead if you wish.) Do not
make any other change in these notices.
Once this change is made in a given copy, it is irreversible for that copy,
so the ordinary GNU General Public License applies to all subsequent copies
and derivative works made from that copy.
This option is useful when you wish to copy part of the code of the Library
into a program that is not a library.
4. You may copy and distribute the Library (or a portion or derivative of
it, under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you accompany it with the complete corresponding
machine-readable source code, which must be distributed under the terms of
Sections 1 and 2 above on a medium customarily used for software interchange.
If distribution of object code is made by offering access to copy from a designated
place, then offering equivalent access to copy the source code from the same
place satisfies the requirement to distribute the source code, even though
third parties are not compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the Library, but
is designed to work with the Library by being compiled or linked with it,
is called a "work that uses the Library". Such a work, in isolation, is not
a derivative work of the Library, and therefore falls outside the scope of
this License.
However, linking a "work that uses the Library" with the Library creates an
executable that is a derivative of the Library (because it contains portions
of the Library), rather than a "work that uses the library". The executable
is therefore covered by this License. Section 6 states terms for distribution
of such executables.
When a "work that uses the Library" uses material from a header file that
is part of the Library, the object code for the work may be a derivative work
of the Library even though the source code is not. Whether this is true is
especially significant if the work can be linked without the Library, or if
the work is itself a library. The threshold for this to be true is not precisely
defined by law.
If such an object file uses only numerical parameters, data structure layouts
and accessors, and small macros and small inline functions (ten lines or less
in length), then the use of the object file is unrestricted, regardless of
whether it is legally a derivative work. (Executables containing this object
code plus portions of the Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may distribute
the object code for the work under the terms of Section 6. Any executables
containing that work also fall under Section 6, whether or not they are linked
directly with the Library itself.
6. As an exception to the Sections above, you may also combine or link a "work
that uses the Library" with the Library to produce a work containing portions
of the Library, and distribute that work under terms of your choice, provided
that the terms permit modification of the work for the customer's own use
and reverse engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the Library
is used in it and that the Library and its use are covered by this License.
You must supply a copy of this License. If the work during execution displays
copyright notices, you must include the copyright notice for the Library among
them, as well as a reference directing the user to the copy of this License.
Also, you must do one of these things:
a) Accompany the work with the complete corresponding machine-readable source
code for the Library including whatever changes were used in the work (which
must be distributed under Sections 1 and 2 above); and, if the work is an
executable linked with the Library, with the complete machine-readable "work
that uses the Library", as object code and/or source code, so that the user
can modify the Library and then relink to produce a modified executable containing
the modified Library. (It is understood that the user who changes the contents
of definitions files in the Library will not necessarily be able to recompile
the application to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the Library. A
suitable mechanism is one that (1) uses at run time a copy of the library
already present on the user's computer system, rather than copying library
functions into the executable, and (2) will operate properly with a modified
version of the library, if the user installs one, as long as the modified
version is interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at least three years,
to give the same user the materials specified in Subsection 6a, above, for
a charge no more than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy from a designated
place, offer equivalent access to copy the above specified materials from
the same place.
e) Verify that the user has already received a copy of these materials or
that you have already sent this user a copy.
For an executable, the required form of the "work that uses the Library" must
include any data and utility programs needed for reproducing the executable
from it. However, as a special exception, the materials to be distributed
need not include anything that is normally distributed (in either source or
binary form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component itself
accompanies the executable.
It may happen that this requirement contradicts the license restrictions of
other proprietary libraries that do not normally accompany the operating system.
Such a contradiction means you cannot use both them and the Library together
in an executable that you distribute.
7. You may place library facilities that are a work based on the Library side-by-side
in a single library together with other library facilities not covered by
this License, and distribute such a combined library, provided that the separate
distribution of the work based on the Library and of the other library facilities
is otherwise permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work based on the
Library, uncombined with any other library facilities. This must be distributed
under the terms of the Sections above.
b) Give prominent notice with the combined library of the fact that part of
it is a work based on the Library, and explaining where to find the accompanying
uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute the Library
except as expressly provided under this License. Any attempt otherwise to
copy, modify, sublicense, link with, or distribute the Library is void, and
will automatically terminate your rights under this License. However, parties
who have received copies, or rights, from you under this License will not
have their licenses terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not signed
it. However, nothing else grants you permission to modify or distribute the
Library or its derivative works. These actions are prohibited by law if you
do not accept this License. Therefore, by modifying or distributing the Library
(or any work based on the Library), you indicate your acceptance of this License
to do so, and all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the Library),
the recipient automatically receives a license from the original licensor
to copy, distribute, link with or modify the Library subject to these terms
and conditions. You may not impose any further restrictions on the recipients'
exercise of the rights granted herein. You are not responsible for enforcing
compliance by third parties with this License.
11. If, as a consequence of a court judgment or allegation of patent infringement
or for any other reason (not limited to patent issues), conditions are imposed
on you (whether by court order, agreement or otherwise) that contradict the
conditions of this License, they do not excuse you from the conditions of
this License. If you cannot distribute so as to satisfy simultaneously your
obligations under this License and any other pertinent obligations, then as
a consequence you may not distribute the Library at all. For example, if a
patent license would not permit royalty-free redistribution of the Library
by all those who receive copies directly or indirectly through you, then the
only way you could satisfy both it and this License would be to refrain entirely
from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any patents
or other property right claims or to contest validity of any such claims;
this section has the sole purpose of protecting the integrity of the free
software distribution system which is implemented by public license practices.
Many people have made generous contributions to the wide range of software
distributed through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing to
distribute software through any other system and a licensee cannot impose
that choice.
This section is intended to make thoroughly clear what is believed to be a
consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in certain
countries either by patents or by copyrighted interfaces, the original copyright
holder who places the Library under this License may add an explicit geographical
distribution limitation excluding those countries, so that distribution is
permitted only in or among countries not thus excluded. In such case, this
License incorporates the limitation as if written in the body of this License.
13. The Free Software Foundation may publish revised and/or new versions of
the Lesser General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to address
new problems or concerns.
Each version is given a distinguishing version number. If the Library specifies
a version number of this License which applies to it and "any later version",
you have the option of following the terms and conditions either of that version
or of any later version published by the Free Software Foundation. If the
Library does not specify a license version number, you may choose any version
ever published by the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free programs
whose distribution conditions are incompatible with these, write to the author
to ask for permission. For software which is copyrighted by the Free Software
Foundation, write to the Free Software Foundation; we sometimes make exceptions
for this. Our decision will be guided by the two goals of preserving the free
status of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR
THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE
STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY
"AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE
OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE
THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE
OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA
OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES
OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH
HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest possible
use to the public, we recommend making it free software that everyone can
redistribute and change. You can do so by permitting redistribution under
these terms (or, alternatively, under the terms of the ordinary General Public
License).
To apply these terms, attach the following notices to the library. It is safest
to attach them to the start of each source file to most effectively convey
the exclusion of warranty; and each file should have at least the "copyright"
line and a pointer to where the full notice is found.
one line to give the library's name and an idea of what it does.
Copyright (C) year name of author
This library 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 of the License, or (at your option)
any later version.
This library 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 library; if not, write to the Free Software Foundation, Inc., 51
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information
on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your school,
if any, to sign a "copyright disclaimer" for the library, if necessary. Here
is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in
the library `Frob' (a library for tweaking knobs) written
by James Random Hacker.
signature of Ty Coon, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!
@@ -0,0 +1,462 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies of this license
document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts as
the successor of the GNU Library Public License, version 2, hence the version
number 2.1.]
Preamble
The licenses for most software are designed to take away your freedom to share
and change it. By contrast, the GNU General Public Licenses are intended to
guarantee your freedom to share and change free software--to make sure the
software is free for all its users.
This license, the Lesser General Public License, applies to some specially
designated software packages--typically libraries--of the Free Software Foundation
and other authors who decide to use it. You can use it too, but we suggest
you first think carefully about whether this license or the ordinary General
Public License is the better strategy to use in any particular case, based
on the explanations below.
When we speak of free software, we are referring to freedom of use, not price.
Our General Public Licenses are designed to make sure that you have the freedom
to distribute copies of free software (and charge for this service if you
wish); that you receive source code or can get it if you want it; that you
can change the software and use pieces of it in new free programs; and that
you are informed that you can do these things.
To protect your rights, we need to make restrictions that forbid distributors
to deny you these rights or to ask you to surrender these rights. These restrictions
translate to certain responsibilities for you if you distribute copies of
the library or if you modify it.
For example, if you distribute copies of the library, whether gratis or for
a fee, you must give the recipients all the rights that we gave you. You must
make sure that they, too, receive or can get the source code. If you link
other code with the library, you must provide complete object files to the
recipients, so that they can relink them with the library after making changes
to the library and recompiling it. And you must show them these terms so they
know their rights.
We protect your rights with a two-step method: (1) we copyright the library,
and (2) we offer you this license, which gives you legal permission to copy,
distribute and/or modify the library.
To protect each distributor, we want to make it very clear that there is no
warranty for the free library. Also, if the library is modified by someone
else and passed on, the recipients should know that what they have is not
the original version, so that the original author's reputation will not be
affected by problems that might be introduced by others.
Finally, software patents pose a constant threat to the existence of any free
program. We wish to make sure that a company cannot effectively restrict the
users of a free program by obtaining a restrictive license from a patent holder.
Therefore, we insist that any patent license obtained for a version of the
library must be consistent with the full freedom of use specified in this
license.
Most GNU software, including some libraries, is covered by the ordinary GNU
General Public License. This license, the GNU Lesser General Public License,
applies to certain designated libraries, and is quite different from the ordinary
General Public License. We use this license for certain libraries in order
to permit linking those libraries into non-free programs.
When a program is linked with a library, whether statically or using a shared
library, the combination of the two is legally speaking a combined work, a
derivative of the original library. The ordinary General Public License therefore
permits such linking only if the entire combination fits its criteria of freedom.
The Lesser General Public License permits more lax criteria for linking other
code with the library.
We call this license the "Lesser" General Public License because it does Less
to protect the user's freedom than the ordinary General Public License. It
also provides other free software developers Less of an advantage over competing
non-free programs. These disadvantages are the reason we use the ordinary
General Public License for many libraries. However, the Lesser license provides
advantages in certain special circumstances.
For example, on rare occasions, there may be a special need to encourage the
widest possible use of a certain library, so that it becomes a de-facto standard.
To achieve this, non-free programs must be allowed to use the library. A more
frequent case is that a free library does the same job as widely used non-free
libraries. In this case, there is little to gain by limiting the free library
to free software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free programs
enables a greater number of people to use a large body of free software. For
example, permission to use the GNU C Library in non-free programs enables
many more people to use the whole GNU operating system, as well as its variant,
the GNU/Linux operating system.
Although the Lesser General Public License is Less protective of the users'
freedom, it does ensure that the user of a program that is linked with the
Library has the freedom and the wherewithal to run that program using a modified
version of the Library.
The precise terms and conditions for copying, distribution and modification
follow. Pay close attention to the difference between a "work based on the
library" and a "work that uses the library". The former contains code derived
from the library, whereas the latter must be combined with the library in
order to run.
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other program
which contains a notice placed by the copyright holder or other authorized
party saying it may be distributed under the terms of this Lesser General
Public License (also called "this License"). Each licensee is addressed as
"you".
A "library" means a collection of software functions and/or data prepared
so as to be conveniently linked with application programs (which use some
of those functions and data) to form executables.
The "Library", below, refers to any such software library or work which has
been distributed under these terms. A "work based on the Library" means either
the Library or any derivative work under copyright law: that is to say, a
work containing the Library or a portion of it, either verbatim or with modifications
and/or translated straightforwardly into another language. (Hereinafter, translation
is included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for making modifications
to it. For a library, complete source code means all the source code for all
modules it contains, plus any associated interface definition files, plus
the scripts used to control compilation and installation of the library.
Activities other than copying, distribution and modification are not covered
by this License; they are outside its scope. The act of running a program
using the Library is not restricted, and output from such a program is covered
only if its contents constitute a work based on the Library (independent of
the use of the Library in a tool for writing it). Whether that is true depends
on what the Library does and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's complete source
code as you receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice and disclaimer
of warranty; keep intact all the notices that refer to this License and to
the absence of any warranty; and distribute a copy of this License along with
the Library.
You may charge a fee for the physical act of transferring a copy, and you
may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Library or any portion of it,
thus forming a work based on the Library, and copy and distribute such modifications
or work under the terms of Section 1 above, provided that you also meet all
of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices stating that
you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no charge to all
third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a table of
data to be supplied by an application program that uses the facility, other
than as an argument passed when the facility is invoked, then you must make
a good faith effort to ensure that, in the event an application does not supply
such function or table, the facility still operates, and performs whatever
part of its purpose remains meaningful.
(For example, a function in a library to compute square roots has a purpose
that is entirely well-defined independent of the application. Therefore, Subsection
2d requires that any application-supplied function or table used by this function
must be optional: if the application does not supply it, the square root function
must still compute square roots.)
These requirements apply to the modified work as a whole. If identifiable
sections of that work are not derived from the Library, and can be reasonably
considered independent and separate works in themselves, then this License,
and its terms, do not apply to those sections when you distribute them as
separate works. But when you distribute the same sections as part of a whole
which is a work based on the Library, the distribution of the whole must be
on the terms of this License, whose permissions for other licensees extend
to the entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest your
rights to work written entirely by you; rather, the intent is to exercise
the right to control the distribution of derivative or collective works based
on the Library.
In addition, mere aggregation of another work not based on the Library with
the Library (or with a work based on the Library) on a volume of a storage
or distribution medium does not bring the other work under the scope of this
License.
3. You may opt to apply the terms of the ordinary GNU General Public License
instead of this License to a given copy of the Library. To do this, you must
alter all the notices that refer to this License, so that they refer to the
ordinary GNU General Public License, version 2, instead of to this License.
(If a newer version than version 2 of the ordinary GNU General Public License
has appeared, then you can specify that version instead if you wish.) Do not
make any other change in these notices.
Once this change is made in a given copy, it is irreversible for that copy,
so the ordinary GNU General Public License applies to all subsequent copies
and derivative works made from that copy.
This option is useful when you wish to copy part of the code of the Library
into a program that is not a library.
4. You may copy and distribute the Library (or a portion or derivative of
it, under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you accompany it with the complete corresponding
machine-readable source code, which must be distributed under the terms of
Sections 1 and 2 above on a medium customarily used for software interchange.
If distribution of object code is made by offering access to copy from a designated
place, then offering equivalent access to copy the source code from the same
place satisfies the requirement to distribute the source code, even though
third parties are not compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the Library, but
is designed to work with the Library by being compiled or linked with it,
is called a "work that uses the Library". Such a work, in isolation, is not
a derivative work of the Library, and therefore falls outside the scope of
this License.
However, linking a "work that uses the Library" with the Library creates an
executable that is a derivative of the Library (because it contains portions
of the Library), rather than a "work that uses the library". The executable
is therefore covered by this License. Section 6 states terms for distribution
of such executables.
When a "work that uses the Library" uses material from a header file that
is part of the Library, the object code for the work may be a derivative work
of the Library even though the source code is not. Whether this is true is
especially significant if the work can be linked without the Library, or if
the work is itself a library. The threshold for this to be true is not precisely
defined by law.
If such an object file uses only numerical parameters, data structure layouts
and accessors, and small macros and small inline functions (ten lines or less
in length), then the use of the object file is unrestricted, regardless of
whether it is legally a derivative work. (Executables containing this object
code plus portions of the Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may distribute
the object code for the work under the terms of Section 6. Any executables
containing that work also fall under Section 6, whether or not they are linked
directly with the Library itself.
6. As an exception to the Sections above, you may also combine or link a "work
that uses the Library" with the Library to produce a work containing portions
of the Library, and distribute that work under terms of your choice, provided
that the terms permit modification of the work for the customer's own use
and reverse engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the Library
is used in it and that the Library and its use are covered by this License.
You must supply a copy of this License. If the work during execution displays
copyright notices, you must include the copyright notice for the Library among
them, as well as a reference directing the user to the copy of this License.
Also, you must do one of these things:
a) Accompany the work with the complete corresponding machine-readable source
code for the Library including whatever changes were used in the work (which
must be distributed under Sections 1 and 2 above); and, if the work is an
executable linked with the Library, with the complete machine-readable "work
that uses the Library", as object code and/or source code, so that the user
can modify the Library and then relink to produce a modified executable containing
the modified Library. (It is understood that the user who changes the contents
of definitions files in the Library will not necessarily be able to recompile
the application to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the Library. A
suitable mechanism is one that (1) uses at run time a copy of the library
already present on the user's computer system, rather than copying library
functions into the executable, and (2) will operate properly with a modified
version of the library, if the user installs one, as long as the modified
version is interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at least three years,
to give the same user the materials specified in Subsection 6a, above, for
a charge no more than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy from a designated
place, offer equivalent access to copy the above specified materials from
the same place.
e) Verify that the user has already received a copy of these materials or
that you have already sent this user a copy.
For an executable, the required form of the "work that uses the Library" must
include any data and utility programs needed for reproducing the executable
from it. However, as a special exception, the materials to be distributed
need not include anything that is normally distributed (in either source or
binary form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component itself
accompanies the executable.
It may happen that this requirement contradicts the license restrictions of
other proprietary libraries that do not normally accompany the operating system.
Such a contradiction means you cannot use both them and the Library together
in an executable that you distribute.
7. You may place library facilities that are a work based on the Library side-by-side
in a single library together with other library facilities not covered by
this License, and distribute such a combined library, provided that the separate
distribution of the work based on the Library and of the other library facilities
is otherwise permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work based on the
Library, uncombined with any other library facilities. This must be distributed
under the terms of the Sections above.
b) Give prominent notice with the combined library of the fact that part of
it is a work based on the Library, and explaining where to find the accompanying
uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute the Library
except as expressly provided under this License. Any attempt otherwise to
copy, modify, sublicense, link with, or distribute the Library is void, and
will automatically terminate your rights under this License. However, parties
who have received copies, or rights, from you under this License will not
have their licenses terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not signed
it. However, nothing else grants you permission to modify or distribute the
Library or its derivative works. These actions are prohibited by law if you
do not accept this License. Therefore, by modifying or distributing the Library
(or any work based on the Library), you indicate your acceptance of this License
to do so, and all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the Library),
the recipient automatically receives a license from the original licensor
to copy, distribute, link with or modify the Library subject to these terms
and conditions. You may not impose any further restrictions on the recipients'
exercise of the rights granted herein. You are not responsible for enforcing
compliance by third parties with this License.
11. If, as a consequence of a court judgment or allegation of patent infringement
or for any other reason (not limited to patent issues), conditions are imposed
on you (whether by court order, agreement or otherwise) that contradict the
conditions of this License, they do not excuse you from the conditions of
this License. If you cannot distribute so as to satisfy simultaneously your
obligations under this License and any other pertinent obligations, then as
a consequence you may not distribute the Library at all. For example, if a
patent license would not permit royalty-free redistribution of the Library
by all those who receive copies directly or indirectly through you, then the
only way you could satisfy both it and this License would be to refrain entirely
from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any patents
or other property right claims or to contest validity of any such claims;
this section has the sole purpose of protecting the integrity of the free
software distribution system which is implemented by public license practices.
Many people have made generous contributions to the wide range of software
distributed through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing to
distribute software through any other system and a licensee cannot impose
that choice.
This section is intended to make thoroughly clear what is believed to be a
consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in certain
countries either by patents or by copyrighted interfaces, the original copyright
holder who places the Library under this License may add an explicit geographical
distribution limitation excluding those countries, so that distribution is
permitted only in or among countries not thus excluded. In such case, this
License incorporates the limitation as if written in the body of this License.
13. The Free Software Foundation may publish revised and/or new versions of
the Lesser General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to address
new problems or concerns.
Each version is given a distinguishing version number. If the Library specifies
a version number of this License which applies to it and "any later version",
you have the option of following the terms and conditions either of that version
or of any later version published by the Free Software Foundation. If the
Library does not specify a license version number, you may choose any version
ever published by the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free programs
whose distribution conditions are incompatible with these, write to the author
to ask for permission. For software which is copyrighted by the Free Software
Foundation, write to the Free Software Foundation; we sometimes make exceptions
for this. Our decision will be guided by the two goals of preserving the free
status of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR
THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE
STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY
"AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE
OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE
THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE
OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA
OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES
OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH
HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest possible
use to the public, we recommend making it free software that everyone can
redistribute and change. You can do so by permitting redistribution under
these terms (or, alternatively, under the terms of the ordinary General Public
License).
To apply these terms, attach the following notices to the library. It is safest
to attach them to the start of each source file to most effectively convey
the exclusion of warranty; and each file should have at least the "copyright"
line and a pointer to where the full notice is found.
one line to give the library's name and an idea of what it does.
Copyright (C) year name of author
This library 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 of the License, or (at your option)
any later version.
This library 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 library; if not, write to the Free Software Foundation, Inc., 51
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information
on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your school,
if any, to sign a "copyright disclaimer" for the library, if necessary. Here
is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in
the library `Frob' (a library for tweaking knobs) written
by James Random Hacker.
signature of Ty Coon, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!
@@ -0,0 +1,144 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies of this license
document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates the terms
and conditions of version 3 of the GNU General Public License, supplemented
by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser General
Public License, and the "GNU GPL" refers to version 3 of the GNU General Public
License.
"The Library" refers to a covered work governed by this License, other than
an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided by the
Library, but which is not otherwise based on the Library. Defining a subclass
of a class defined by the Library is deemed a mode of using an interface provided
by the Library.
A "Combined Work" is a work produced by combining or linking an Application
with the Library. The particular version of the Library with which the Combined
Work was made is also called the "Linked Version".
The "Minimal Corresponding Source" for a Combined Work means the Corresponding
Source for the Combined Work, excluding any source code for portions of the
Combined Work that, considered in isolation, are based on the Application,
and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the object
code and/or source code for the Application, including any data and utility
programs needed for reproducing the Combined Work from the Application, but
excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License without
being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a facility
refers to a function or data to be supplied by an Application that uses the
facility (other than as an argument passed when the facility is invoked),
then you may convey a copy of the modified version:
a) under this License, provided that you make a good faith effort to ensure
that, in the event an Application does not supply the function or data, the
facility still operates, and performs whatever part of its purpose remains
meaningful, or
b) under the GNU GPL, with none of the additional permissions of this License
applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from a header
file that is part of the Library. You may convey such object code under terms
of your choice, provided that, if the incorporated material is not limited
to numerical parameters, data structure layouts and accessors, or small macros,
inline functions and templates (ten or fewer lines in length), you do both
of the following:
a) Give prominent notice with each copy of the object code that the Library
is used in it and that the Library and its use are covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that, taken together,
effectively do not restrict modification of the portions of the Library contained
in the Combined Work and reverse engineering for debugging such modifications,
if you also do each of the following:
a) Give prominent notice with each copy of the Combined Work that the Library
is used in it and that the Library and its use are covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during execution, include
the copyright notice for the Library among these notices, as well as a reference
directing the user to the copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this License,
and the Corresponding Application Code in a form suitable for, and under terms
that permit, the user to recombine or relink the Application with a modified
version of the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying Corresponding Source.
1) Use a suitable shared library mechanism for linking with the Library.
A suitable mechanism is one that (a) uses at run time a copy of the Library
already present on the user's computer system, and (b) will operate properly
with a modified version of the Library that is interface-compatible with the
Linked Version.
e) Provide Installation Information, but only if you would otherwise be required
to provide such information under section 6 of the GNU GPL, and only to the
extent that such information is necessary to install and execute a modified
version of the Combined Work produced by recombining or relinking the Application
with a modified version of the Linked Version. (If you use option 4d0, the
Installation Information must accompany the Minimal Corresponding Source and
Corresponding Application Code. If you use option 4d1, you must provide the
Installation Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the Library side
by side in a single library together with other library facilities that are
not Applications and are not covered by this License, and convey such a combined
library under terms of your choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based on the
Library, uncombined with any other library facilities, conveyed under the
terms of this License.
b) Give prominent notice with the combined library that part of it is a work
based on the Library, and explaining where to find the accompanying uncombined
form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions of the
GNU Lesser General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to address
new problems or concerns.
Each version is given a distinguishing version number. If the Library as you
received it specifies that a certain numbered version of the GNU Lesser General
Public License "or any later version" applies to it, you have the option of
following the terms and conditions either of that published version or of
any later version published by the Free Software Foundation. If the Library
as you received it does not specify a version number of the GNU Lesser General
Public License, you may choose any version of the GNU Lesser General Public
License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide whether
future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is permanent
authorization for you to choose that version for the Library.
@@ -0,0 +1,12 @@
This library 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 3 of
the license or (at your option) at any later version that is
accepted by the membership of KDE e.V. (or its successor
approved by the membership of KDE e.V.), which shall act as a
proxy as defined in Section 14 of version 3 of the license.
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.
@@ -0,0 +1,12 @@
This library 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 3 of the license or (at your option) any later version
that is accepted by the membership of KDE e.V. (or its successor
approved by the membership of KDE e.V.), which shall act as a
proxy as defined in Section 6 of version 3 of the license.
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.
@@ -0,0 +1,18 @@
Permission to use, copy, modify, distribute, and sell this software
and its documentation for any purpose is hereby granted without
fee, provided that the above copyright notice appear in all copies
and that both that copyright notice and this permission notice
appear in supporting documentation, and that the name of Red Hat
not be used in advertising or publicity pertaining to distribution
of the software without specific, written prior permission. Red
Hat makes no representations about the suitability of this software
for any purpose. It is provided "as is" without express or implied
warranty.
THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
@@ -0,0 +1,22 @@
UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE
Unicode Data Files include all data files under the directories http://www.unicode.org/Public/, http://www.unicode.org/reports/, http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and http://www.unicode.org/utility/trac/browser/.
Unicode Data Files do not include PDF online code charts under the directory http://www.unicode.org/Public/.
Software includes any source code published in the Unicode Standard or under the directories http://www.unicode.org/Public/, http://www.unicode.org/reports/, http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and http://www.unicode.org/utility/trac/browser/.
NOTICE TO USER: Carefully read the following legal agreement. BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE.
COPYRIGHT AND PERMISSION NOTICE
Copyright © 1991-2022 Unicode, Inc. All rights reserved. Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
Permission is hereby granted, free of charge, to any person obtaining a copy of the Unicode data files and any associated documentation (the "Data Files") or Unicode software and any associated documentation (the "Software") to deal in the Data Files or Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, and/or sell copies of the Data Files or Software, and to permit persons to whom the Data Files or Software are furnished to do so, provided that either
(a) this copyright and permission notice appear with all copies of the Data Files or Software, or
(b) this copyright and permission notice appear in associated Documentation.
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES OR SOFTWARE.
Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in these Data Files or Software without prior written authorization of the copyright holder.
@@ -0,0 +1,21 @@
/** @mainpage Plasma
Documentation for the Plasma libraries and utilities.
<p>
- <a href="../engines/html/index.html"><b>engines</b></a>
(<a href="../engines/html/classes.html">classes</a>)\n
<i>Engines for Plasma</i>
- <a href="../applets/html/index.html"><b>applets</b></a>
(<a href="../applets/html/classes.html">classes</a>)\n
<i>Plasma Applets</i>
- <a href="../animators/html/index.html"><b>animators</b></a>
(<a href="../animators/html/classes.html">classes</a>)\n
<i>Plasma Animators</i>
*/
// DOXYGEN_SET_PROJECT_NAME = Plasma
// DOXYGEN_SET_RECURSIVE = YES
// DOXYGEN_EXCLUDE = engines applets animators
// vim:ts=4:sw=4:expandtab:filetype=doxygen
@@ -0,0 +1,32 @@
# Plasma Desktop
Plasma for the desktop form factor. This repository contains code for many of the widgets, KCMs, and other parts of the Plasma Desktop.
See [the CODEMAP](./CODEMAP.md) to get an idea of the layout of this repository.
## See Also
This repository contains only components specific to the desktop form factor. Components which are more generic can be found elsewhere under the [Plasma group](https://invent.kde.org/plasma/) or in individual repositories. For example:
* [Plasma Workspace](https://invent.kde.org/plasma/plasma-workspace) contains more generic code shared between Desktop, Mobile, and other form factors of Plasma. If you can't find what you're looking for in plasma-desktop, look here first.
* [libplasma](https://invent.kde.org/plasma/libplasma) includes the building blocks for Plasma widgets.
* [Plasma NetworkManager Applet](https://invent.kde.org/plasma/plasma-nm) has code for the network manager widget.
* [Plasma PulseAudio Applet](https://invent.kde.org/plasma/plasma-pa) is where the code for the PulseAudio KCM and widget lives.
* [Plasma Add-ons](https://invent.kde.org/plasma/kdeplasma-addons) is the home of the rest of the widgets that aren't in plasma-desktop, plasma-workspace, or another specific repository. For example: Web Browser, Comics, and Sticky Notes.
## Building
The easiest way to make changes and test Plasma Desktop during development is to [build it with kdesrc-build](https://develop.kde.org/docs/getting-started/building/).
## Contributing
Like other projects in the KDE ecosystem, contributions are welcome from all. This repository is managed on [KDE Invent](https://invent.kde.org/plasma/plasma-desktop), our GitLab instance.
* Want to contribute code? See the [GitLab wiki page](https://community.kde.org/Infrastructure/GitLab) for a tutorial on how to send a merge request.
* Reporting a bug? Please submit it on the [KDE Bugtracking System](https://bugs.kde.org/enter_bug.cgi?format=guided&product=plasmashell). Please do not use the Issues
tab to report bugs.
* Is there a part of Plasma Desktop that's not translated? See the [Getting Involved in Translation wiki page](https://community.kde.org/Get_Involved/translation) to see how
you can help translate!
If you get stuck or need help with anything at all, head over to the [KDE New Contributors room](https://go.kde.org/matrix/#/#kde-welcome:kde.org) on Matrix. For questions specifically about Plasma Desktop, please ask in the [KDE Development room](https://go.kde.org/matrix/#/#plasma:kde.org). See [Matrix](https://community.kde.org/Matrix) for more details.
@@ -0,0 +1,26 @@
# SPDX-FileCopyrightText: 2023 Fushan Wen <qydwhotmail@gmail.com>
# SPDX-License-Identifier: BSD-3-Clause
if(NOT BUILD_TESTING OR NOT CMAKE_SYSTEM_NAME MATCHES "Linux")
return()
endif()
find_package(SeleniumWebDriverATSPI)
set_package_properties(SeleniumWebDriverATSPI PROPERTIES
DESCRIPTION "Server component for selenium tests using Linux accessibility infrastructure"
PURPOSE "Needed for GUI tests"
URL "https://invent.kde.org/sdk/selenium-webdriver-at-spi"
TYPE OPTIONAL
)
if(NOT SeleniumWebDriverATSPI_FOUND AND NOT DEFINED ENV{KDECI_BUILD})
return()
endif()
add_subdirectory(applets)
add_subdirectory(desktop)
add_subdirectory(kcms)
add_test(
NAME emojiertest
COMMAND selenium-webdriver-at-spi-run ${CMAKE_CURRENT_SOURCE_DIR}/emojiertest.py --failfast
)
set_tests_properties(emojiertest PROPERTIES TIMEOUT 300 ENVIRONMENT "TEST_WITH_KWIN_WAYLAND=0")
@@ -0,0 +1,21 @@
# SPDX-FileCopyrightText: 2023 Fushan Wen <qydwhotmail@gmail.com>
# SPDX-License-Identifier: BSD-3-Clause
add_test(
NAME kickofftest
COMMAND selenium-webdriver-at-spi-run ${CMAKE_CURRENT_SOURCE_DIR}/kickofftest/kickofftest.py --failfast
)
set_tests_properties(kickofftest PROPERTIES TIMEOUT 120 ENVIRONMENT "USE_CUSTOM_BUS=1;KACTIVITYMANAGERD_PATH=${KDE_INSTALL_FULL_LIBEXECDIR}/kactivitymanagerd")
add_test(
NAME taskmanagertest
COMMAND selenium-webdriver-at-spi-run ${CMAKE_CURRENT_SOURCE_DIR}/taskmanagertest.py --failfast
)
set_tests_properties(taskmanagertest PROPERTIES TIMEOUT 120 ENVIRONMENT "USE_CUSTOM_BUS=1;KACTIVITYMANAGERD_PATH=${KDE_INSTALL_FULL_LIBEXECDIR}/kactivitymanagerd")
add_test(
NAME taskmanager_visiblelabeltest
COMMAND selenium-webdriver-at-spi-run ${CMAKE_CURRENT_SOURCE_DIR}/taskmanager_visiblelabel.py
)
set_tests_properties(taskmanager_visiblelabeltest PROPERTIES TIMEOUT 120)
@@ -0,0 +1,143 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: BSD-3-Clause
# SPDX-FileCopyrightText: 2022-2023 Harald Sitter <sitter@kde.org>
import os
import subprocess
import sys
import time
import unittest
from typing import Final
from appium import webdriver
from appium.options.common.base import AppiumOptions
from appium.webdriver.common.appiumby import AppiumBy
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), os.pardir, os.pardir, "desktop"))
from desktoptest import name_has_owner, start_kactivitymanagerd
WIDGET_ID: Final = "org.kde.plasma.kickoff"
KDE_VERSION: Final = 6
class KickoffTests(unittest.TestCase):
driver: webdriver.Remote
kactivitymanagerd: subprocess.Popen | None = None
@classmethod
def setUpClass(cls) -> None:
cls.kactivitymanagerd = start_kactivitymanagerd()
options = AppiumOptions()
options.set_capability("environ", {
"LC_ALL": "en_US.UTF-8",
})
options.set_capability("app", f"plasmawindowed -p org.kde.plasma.desktop {WIDGET_ID}")
options.set_capability("timeouts", {'implicit': 10000})
cls.driver = webdriver.Remote(command_executor='http://127.0.0.1:4723', options=options)
@classmethod
def tearDownClass(self) -> None:
subprocess.check_call([f"kquitapp{KDE_VERSION}", "plasmawindowed"])
self.driver.quit()
if self.kactivitymanagerd is not None:
self.kactivitymanagerd.terminate()
self.kactivitymanagerd.wait()
def tearDown(self) -> None:
"""
Take screenshot when the current test fails
"""
if not self._outcome.result.wasSuccessful():
self.driver.get_screenshot_as_file(f"failed_test_shot_{WIDGET_ID}_#{self.id()}.png")
print(self.driver.page_source, file=sys.stderr)
def test_1_keyboard_navigation(self) -> None:
focused_elements = self.driver.find_elements(by=AppiumBy.XPATH, value="//table_cell[contains(@states, 'focused')]")
self.assertEqual(len(focused_elements), 1)
first_favorite = focused_elements[0].id
self.assertIn("KickoffGridDelegate", focused_elements[0].get_attribute('accessibility-id'))
# Go right to second favorite
ActionChains(self.driver).send_keys(Keys.RIGHT).perform()
focused_elements = self.driver.find_elements(by=AppiumBy.XPATH, value="//table_cell[contains(@states, 'focused')]")
self.assertEqual(len(focused_elements), 1)
self.assertNotEqual(first_favorite, focused_elements[0].id)
# Go left to first favorite again
ActionChains(self.driver).send_keys(Keys.LEFT).perform()
focused_elements = self.driver.find_elements(by=AppiumBy.XPATH, value="//table_cell[contains(@states, 'focused')]")
self.assertEqual(len(focused_elements), 1)
self.assertEqual(first_favorite, focused_elements[0].id)
# Go further left to the category list
ActionChains(self.driver).key_down(Keys.SHIFT).send_keys(Keys.TAB).key_up(Keys.ALT).perform()
focused_elements = self.driver.find_elements(by=AppiumBy.XPATH, value="//list_item[contains(@states, 'focused')]")
self.assertEqual(len(focused_elements), 1)
self.assertNotEqual(first_favorite, focused_elements[0].id)
favorites_category = focused_elements[0].id
# Go down to the 'all apps' category
ActionChains(self.driver).send_keys(Keys.DOWN).perform()
focused_elements = self.driver.find_elements(by=AppiumBy.XPATH, value="//list_item[contains(@states, 'focused')]")
self.assertEqual(len(focused_elements), 1)
self.assertNotEqual(favorites_category, focused_elements[0].id)
# Go right to the first all app. This must not be a grid delegate anymore (favorites are griddelegates)
ActionChains(self.driver).send_keys(Keys.RIGHT).perform()
focused_elements = self.driver.find_elements(by=AppiumBy.XPATH, value="//list_item[contains(@states, 'focused')]")
self.assertEqual(len(focused_elements), 1)
self.assertNotEqual(favorites_category, focused_elements[0].id)
self.assertNotEqual(first_favorite, focused_elements[0].id)
self.assertNotIn("KickoffGridDelegate", focused_elements[0].get_attribute('accessibility-id'))
first_all_app = focused_elements[0].id
# Go down to second all app
ActionChains(self.driver).send_keys(Keys.DOWN).perform()
focused_elements = self.driver.find_elements(by=AppiumBy.XPATH, value="//list_item[contains(@states, 'focused')]")
self.assertEqual(len(focused_elements), 1)
self.assertNotEqual(first_all_app, focused_elements[0].id)
# Hitting Tab should get us to the "menu bar" at the bottom
ActionChains(self.driver).send_keys(Keys.TAB).perform()
focused_elements = self.driver.find_elements(by=AppiumBy.XPATH, value="//page_tab[contains(@states, 'focused') and @name='Applications']")
self.assertEqual(len(focused_elements), 1)
# Hitting Right should get us to the "Places" page
ActionChains(self.driver).send_keys(Keys.RIGHT).perform()
self.driver.find_element(AppiumBy.NAME, "Frequently Used")
# Hitting Right again should move focus to the power action button
ActionChains(self.driver).send_keys(Keys.RIGHT).perform()
try:
self.driver.find_element(by=AppiumBy.XPATH, value="//push_button_menu[contains(@states, 'focused') and @name='Session']")
except NoSuchElementException:
self.driver.find_element(by=AppiumBy.XPATH, value="//button[contains(@states, 'focused') and @name='Sleep']")
def test_2_search_calculator(self) -> None:
search_field = self.driver.find_element(by=AppiumBy.NAME, value="Search")
search_field.send_keys("1")
search_field.send_keys("2345+67890")
element = self.driver.find_element(by=AppiumBy.CLASS_NAME, value="[list item | 80235]")
search_field.clear()
WebDriverWait(self.driver, 5).until_not(lambda _: element.is_displayed())
def test_3_search_app(self) -> None:
# Emoji Selector is the only actual application we install from workspace :|
search_field = self.driver.find_element(by=AppiumBy.NAME, value="Search")
search_field.send_keys("Emoji Selector")
element = self.driver.find_element(by=AppiumBy.CLASS_NAME, value="[list item | Emoji Selector]")
element.click()
WebDriverWait(self.driver, 5).until(lambda _: name_has_owner(None, "org.kde.plasma.emojier"))
subprocess.check_call([f"kquitapp{KDE_VERSION}", "plasma.emojier"])
search_field.clear()
WebDriverWait(self.driver, 5).until_not(lambda _: element.is_displayed())
if __name__ == '__main__':
unittest.main()
@@ -0,0 +1,75 @@
#!/usr/bin/env python3
# SPDX-FileCopyrightText: 2023 Niccolò Venerandi <niccolo@venerandi.com>
# SPDX-License-Identifier: MIT
import os
import subprocess
import time
import unittest
from typing import Final
from appium import webdriver
from appium.options.common.base import AppiumOptions
from appium.webdriver.common.appiumby import AppiumBy
from appium.webdriver.webelement import WebElement
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
import pyatspi
WIDGET_ID: Final = "org.kde.plasma.taskmanager"
class VisibleLabelTest(unittest.TestCase):
"""
Tests that the label of the Task Manager is visible
"""
driver: webdriver.Remote
@classmethod
def setUpClass(cls) -> None:
"""
Opens the widget and initialize the webdriver
"""
options = AppiumOptions()
options.set_capability("environ", {
"LC_ALL": "en_US.UTF-8",
})
options.set_capability("app", f"plasmoidviewer -a {WIDGET_ID} -c org.kde.panel -f vertical --size 120x500")
options.set_capability("timeouts", {'implicit': 10000})
cls.driver = webdriver.Remote(command_executor='http://127.0.0.1:4723', options=options)
def tearDown(self) -> None:
"""
Take screenshot when the current test fails
"""
if not self._outcome.result.wasSuccessful():
self.driver.get_screenshot_as_file(f"failed_test_shot_{WIDGET_ID}_#{self.id()}.png")
@classmethod
def tearDownClass(cls) -> None:
"""
Make sure to terminate the driver again, lest it dangles.
"""
cls.driver.quit()
def test_1_bug487023_group_dialog(self) -> None:
"""
Tests the task manager label is visible and within panel bounds
"""
environ = os.environ.copy()
environ["GDK_BACKEND"] = "wayland"
environ["GSK_RENDERER"] = "cairo"
environ["AT_SPI_BUS_ADDRESS"] = "org:foo=bar" # Disable atspi for the test window
window_1 = subprocess.Popen(["python3", os.path.join(os.path.dirname(os.path.abspath(__file__)), os.pardir, "desktop", "desktoptest_testwindow.py")], env=environ)
self.addCleanup(window_1.terminate)
WebDriverWait(self.driver, 10).until(EC.visibility_of_element_located((AppiumBy.NAME, "Test Window-labelhint")))
r = self.driver.find_element(AppiumBy.NAME, "Test Window-labelhint").rect
self.assertTrue(0 < r['x'] + r['width'] < 120)
if __name__ == '__main__':
unittest.main()
@@ -0,0 +1,145 @@
#!/usr/bin/env python3
# SPDX-FileCopyrightText: 2023 Fushan Wen <qydwhotmail@gmail.com>
# SPDX-License-Identifier: MIT
import os
import subprocess
import sys
import time
import unittest
from typing import Final
from appium import webdriver
from appium.options.common.base import AppiumOptions
from appium.webdriver.common.appiumby import AppiumBy
from appium.webdriver.webelement import WebElement
from gi.repository import Gio, GLib
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), os.pardir, "desktop"))
from desktoptest import (DesktopFileWrapper, start_kactivitymanagerd)
WIDGET_ID: Final = "org.kde.plasma.taskmanager"
KDE_VERSION: Final = 6
class Bug487023Test(unittest.TestCase):
"""
Tests for the task manager widget
"""
driver: webdriver.Remote
kactivitymanagerd: subprocess.Popen | None = None
wrapper: DesktopFileWrapper
@classmethod
def setUpClass(cls) -> None:
"""
Opens the widget and initialize the webdriver
"""
cls.wrapper = DesktopFileWrapper()
cls.wrapper.create()
cls.kactivitymanagerd = start_kactivitymanagerd()
options = AppiumOptions()
options.set_capability("environ", {
"LC_ALL": "en_US.UTF-8",
"QT_FATAL_WARNINGS": "0",
"QT_LOGGING_RULES": "qt.accessibility.atspi.warning=false;kf.plasma.core.warning=false;kf.windowsystem.warning=false;kf.kirigami.platform.warning=false;org.kde.plasma.notificationmanager.warning=false;org.kde.plasma.taskmanager.debug=true",
})
options.set_capability("app", f"plasmawindowed -p org.kde.plasma.desktop {WIDGET_ID}")
options.set_capability("timeouts", {'implicit': 10000})
cls.driver = webdriver.Remote(command_executor='http://127.0.0.1:4723', options=options)
os.environ["GDK_BACKEND"] = "wayland"
os.environ["GSK_RENDERER"] = "cairo"
os.environ["AT_SPI_BUS_ADDRESS"] = "org:foo=bar" # Disable atspi for the test window
def tearDown(self) -> None:
"""
Take screenshot when the current test fails
"""
if not self._outcome.result.wasSuccessful():
self.driver.get_screenshot_as_file(f"failed_test_shot_{WIDGET_ID}_#{self.id()}.png")
@classmethod
def tearDownClass(cls) -> None:
"""
Make sure to terminate the driver again, lest it dangles.
"""
subprocess.check_call([f"kquitapp{KDE_VERSION}", "plasmawindowed"])
for _ in range(10):
try:
subprocess.check_call(["pidof", "plasmawindowed"])
except subprocess.CalledProcessError:
break
time.sleep(1)
cls.driver.quit()
if cls.kactivitymanagerd is not None:
cls.kactivitymanagerd.terminate()
cls.kactivitymanagerd.wait()
def test_0_open(self) -> None:
"""
Open the widget
"""
self.driver.find_element(AppiumBy.NAME, "Icons-and-Text Task Manager")
def test_1_badge_count(self) -> None:
"""
Can list running windows and show badge counts based on app id
"""
test_window = subprocess.Popen([self.wrapper.application_path], stdout=sys.stderr, stderr=sys.stderr)
assert test_window.poll() is None
self.addCleanup(test_window.kill)
# Wait until the window appears in the widget
wait = WebDriverWait(self.driver, 30)
wait.until(EC.presence_of_element_located((AppiumBy.NAME, "Test Window")))
# Set badge count and match again
changed_properties = GLib.Variant('a{sv}', {
"count": GLib.Variant('x', 123),
"count-visible": GLib.Variant('b', True),
})
session_bus: Gio.DBusConnection = Gio.bus_get_sync(Gio.BusType.SESSION)
session_bus.emit_signal(None, "/com/canonical/unity/launcherentry/1", "com.canonical.Unity.LauncherEntry", "Update", GLib.Variant.new_tuple(GLib.Variant('s', f"application://{self.wrapper.APPLICATION_ID}.desktop"), changed_properties))
badge_element = wait.until(EC.presence_of_element_located((AppiumBy.NAME, "123")))
# Hide the badge count
changed_properties = GLib.Variant('a{sv}', {
"count-visible": GLib.Variant('b', False),
})
session_bus.emit_signal(None, "/com/canonical/unity/launcherentry/1", "com.canonical.Unity.LauncherEntry", "Update", GLib.Variant.new_tuple(GLib.Variant('s', f"application://{self.wrapper.APPLICATION_ID}.desktop"), changed_properties))
wait.until_not(lambda _: badge_element.is_displayed())
def test_2_bug487023_group_dialog(self) -> None:
"""
Tests the group dialog can be opened
"""
# Change "Clicking grouped task" to "Shows textual list"
wait = WebDriverWait(self.driver, 30)
subprocess.check_call(["plasmawindowed", "--config"])
wait.until(EC.presence_of_element_located((AppiumBy.NAME, "Behavior"))).click()
combobox_element: WebElement = wait.until(EC.presence_of_element_located((AppiumBy.NAME, "Cycles through tasks")))
combobox_element.click()
combobox_element.click()
combobox_element.click()
wait.until(EC.presence_of_element_located((AppiumBy.NAME, "Shows textual list")))
self.driver.find_element(AppiumBy.NAME, "Group only when the Task Manager is full").click()
self.driver.find_element(AppiumBy.NAME, "OK").click()
wait.until_not(lambda _: combobox_element.is_displayed())
window_1 = subprocess.Popen(["python3", self.wrapper.application_path])
window_2 = subprocess.Popen(["python3", self.wrapper.application_path])
self.addCleanup(window_1.kill)
self.addCleanup(window_2.kill)
wait.until(EC.presence_of_element_located((AppiumBy.NAME, self.wrapper.APPLICATION_NAME))).click()
self.assertEqual(len(self.driver.find_elements(AppiumBy.NAME, "Test Window")), 2) # 2 tasks in the group dialog
if __name__ == '__main__':
unittest.main()
@@ -0,0 +1,35 @@
# SPDX-FileCopyrightText: 2023 Fushan Wen <qydwhotmail@gmail.com>
# SPDX-License-Identifier: BSD-3-Clause
add_test(
NAME desktoptest
COMMAND selenium-webdriver-at-spi-run ${CMAKE_CURRENT_SOURCE_DIR}/desktoptest.py --failfast
)
set_tests_properties(desktoptest PROPERTIES TIMEOUT 300 ENVIRONMENT "TEST_WITHOUT_GLOBAL_SHORTCUT=0;USE_CUSTOM_BUS=1;KACTIVITYMANAGERD_PATH=${KDE_INSTALL_FULL_LIBEXECDIR}/kactivitymanagerd;GDK_BACKEND=wayland;GSK_RENDERER=cairo")
add_test(
NAME folderviewtest
COMMAND selenium-webdriver-at-spi-run ${CMAKE_CURRENT_SOURCE_DIR}/folderviewtest.py --failfast
)
set_tests_properties(folderviewtest PROPERTIES TIMEOUT 300 ENVIRONMENT "CMAKE_BINARY_DIR=${CMAKE_BINARY_DIR};KACTIVITYMANAGERD_PATH=${KDE_INSTALL_FULL_LIBEXECDIR}/kactivitymanagerd")
add_test(
NAME bug472909test_wayland
COMMAND selenium-webdriver-at-spi-run ${CMAKE_CURRENT_SOURCE_DIR}/bug472909.py --failfast
)
add_test(
NAME bug476968test
COMMAND selenium-webdriver-at-spi-run ${CMAKE_CURRENT_SOURCE_DIR}/bug476968.py --failfast
)
set_tests_properties(
bug472909test_wayland
bug476968test
PROPERTIES TIMEOUT 600 ENVIRONMENT "CMAKE_BINARY_DIR=${CMAKE_BINARY_DIR};KACTIVITYMANAGERD_PATH=${KDE_INSTALL_FULL_LIBEXECDIR}/kactivitymanagerd;GDK_BACKEND=wayland")
add_test(
NAME panel_focus_test
COMMAND selenium-webdriver-at-spi-run ${CMAKE_CURRENT_SOURCE_DIR}/panelfocustest.py
)
set_tests_properties(panel_focus_test PROPERTIES TIMEOUT 300 ENVIRONMENT "KACTIVITYMANAGERD_PATH=${KDE_INSTALL_FULL_LIBEXECDIR}/kactivitymanagerd")
@@ -0,0 +1,415 @@
<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN"
"http://www.freedesktop.org/standards/menu-spec/1.0/menu.dtd">
<!--
# SPDX-License-Identifier: GPL-2.0-or-later
# SPDX-FileCopyrightText: 2018-2020 Stasiek Michalski <hellcp@opensuse.org>
-->
<Menu>
<Name>Applications</Name>
<Directory>kde-main.directory</Directory>
<!-- Search the default locations -->
<DefaultAppDirs/>
<DefaultDirectoryDirs/>
<DefaultLayout>
<Merge type="menus"/>
<Merge type="files"/>
<Separator/>
<Menuname>More</Menuname>
</DefaultLayout>
<Layout>
<Merge type="menus"/>
<Menuname>Applications</Menuname>
<Merge type="files"/>
</Layout>
<Menu>
<Name>Applications</Name>
<Directory>kf5-unknown.directory</Directory>
<OnlyUnallocated/>
<Include>
<Not>
<!-- Don't list non-KDE core applications -->
<And>
<Category>Core</Category>
<Not><Category>KDE</Category></Not>
</And>
<!-- Don't list SUSE's YaST in here -->
<Category>X-SuSE-YaST</Category>
<Category>X-KDE-settings-hardware</Category>
<Category>X-KDE-settings-accessibility</Category>
<Category>X-KDE-settings-components</Category>
<Category>X-KDE-settings-desktop</Category>
<Category>X-KDE-settings-looknfeel</Category>
<Category>X-KDE-settings-network</Category>
<Category>X-KDE-settings-webbrowsing</Category>
<Category>X-KDE-settings-peripherals</Category>
<Category>X-KDE-settings-hardware</Category>
<Category>X-KDE-settings-power</Category>
<Category>X-KDE-settings-security</Category>
<Category>X-KDE-settings-sound</Category>
<Category>X-KDE-settings-system</Category>
<Category>X-KDE-information</Category>
<Filename>kde-kcm_knetworkconfmodule_ss.desktop</Filename>
<Filename>kde-medianotifications.desktop</Filename>
<Filename>kde-audioencoding.desktop</Filename>
</Not>
</Include>
</Menu>
<Menu>
<Name>Development</Name>
<Directory>kf5-development.directory</Directory>
<Menu>
<Name>Translation</Name>
<Directory>kf5-development-translation.directory</Directory>
<Include>
<And>
<Category>Development</Category>
<Category>Translation</Category>
</And>
</Include>
</Menu>
<Menu>
<Name>Web Development</Name>
<Directory>kf5-development-webdevelopment.directory</Directory>
<Include>
<And>
<Category>Development</Category>
<Category>WebDevelopment</Category>
</And>
</Include>
</Menu>
<Include>
<And>
<Category>Development</Category>
<Not><Category>Translation</Category></Not>
<Not><Category>WebDevelopment</Category></Not>
</And>
</Include>
</Menu>
<Menu>
<Name>Science</Name>
<Directory>kf5-science.directory</Directory>
<Include>
<And><!-- Include /any/ Science app which is not an Education app -->
<Or>
<Category>Astronomy</Category>
<Category>Biology</Category>
<Category>Chemistry</Category>
<Category>Geology</Category>
<Category>MedicalSoftware</Category>
<Category>Physics</Category>
<Category>Math</Category>
<Category>Science</Category>
</Or>
<Not><Category>Education</Category></Not>
</And>
</Include>
</Menu>
<Menu>
<Name>Education</Name>
<Directory>kf5-education.directory</Directory>
<Menu>
<Name>Languages</Name>
<Directory>kf5-edu-languages.directory</Directory>
<Include>
<And>
<Category>Education</Category>
<Category>Languages</Category>
</And>
</Include>
</Menu>
<Menu>
<Name>Mathematics</Name>
<Directory>kf5-edu-mathematics.directory</Directory>
<Include>
<And>
<Category>Education</Category>
<Category>Math</Category>
</And>
</Include>
</Menu>
<Menu>
<Name>Miscellaneous</Name>
<Directory>kf5-edu-miscellaneous.directory</Directory>
<Include>
<And>
<Category>Education</Category>
<Not>
<Category>Languages</Category>
<Category>Math</Category>
<Category>Science</Category>
<Category>Teaching</Category>
</Not>
</And>
</Include>
</Menu>
<Menu>
<Name>Science</Name>
<Directory>kf5-edu-science.directory</Directory>
<Include>
<And>
<Category>Education</Category>
<Category>Science</Category>
</And>
</Include>
</Menu>
<Menu>
<Name>Tools</Name>
<Directory>kf5-edu-tools.directory</Directory>
<Include>
<And>
<Category>Education</Category>
<Category>Teaching</Category>
</And>
</Include>
</Menu>
</Menu>
<Menu>
<Name>Games</Name>
<Directory>kf5-games.directory</Directory>
<Menu>
<Name>Arcade</Name>
<Directory>kf5-games-arcade.directory</Directory>
<Include>
<And>
<Category>Game</Category>
<Category>ArcadeGame</Category>
</And>
</Include>
</Menu>
<Menu>
<Name>Board</Name>
<Directory>kf5-games-board.directory</Directory>
<Include>
<And>
<Category>Game</Category>
<Category>BoardGame</Category>
</And>
</Include>
</Menu>
<Menu>
<Name>Card</Name>
<Directory>kf5-games-card.directory</Directory>
<Include>
<And>
<Category>Game</Category>
<Category>CardGame</Category>
</And>
</Include>
</Menu>
<Menu>
<Name>Kidsgames</Name>
<Directory>kf5-games-kids.directory</Directory>
<Include>
<And>
<Category>Game</Category>
<Category>KidsGame</Category>
</And>
</Include>
</Menu>
<Menu>
<Name>TacticStrategy</Name>
<Directory>kf5-games-strategy.directory</Directory>
<Include>
<And>
<Category>Game</Category>
<Category>StrategyGame</Category>
</And>
</Include>
</Menu>
<Menu>
<Name>Logic</Name>
<Directory>kf5-games-logic.directory</Directory>
<Include>
<And>
<Category>Game</Category>
<Category>LogicGame</Category>
</And>
</Include>
</Menu>
<Include>
<And>
<Category>Game</Category>
<Not>
<Category>ArcadeGame</Category>
<Category>BoardGame</Category>
<Category>CardGame</Category>
<Category>KidsGame</Category>
<Category>StrategyGame</Category>
<Category>LogicGame</Category>
</Not>
</And>
</Include>
</Menu>
<Menu>
<Name>Graphics</Name>
<Directory>kf5-graphics.directory</Directory>
<Include>
<And>
<Category>Graphics</Category>
<Not><Category>X-KDE-More</Category></Not>
</And>
</Include>
<Menu>
<Name>More</Name>
<Directory>kf5-more.directory</Directory>
<Include>
<And>
<Category>Graphics</Category>
<Category>X-KDE-More</Category>
</And>
</Include>
</Menu>
</Menu>
<Menu>
<Name>Internet</Name>
<Directory>kf5-internet.directory</Directory>
<Include>
<And>
<Category>Network</Category>
<Not><Category>X-KDE-More</Category></Not>
</And>
</Include>
<Menu>
<Name>Terminal</Name>
<Directory>kf5-internet-terminal.directory</Directory>
</Menu>
<Menu>
<Name>More</Name>
<Directory>kf5-more.directory</Directory>
<Include>
<And>
<Category>Network</Category>
<Category>X-KDE-More</Category>
</And>
</Include>
</Menu>
</Menu>
<Menu>
<Name>Multimedia</Name>
<Directory>kf5-multimedia.directory</Directory>
<Include>
<And>
<Category>AudioVideo</Category>
<Not><Category>X-KDE-More</Category></Not>
</And>
</Include>
<Menu>
<Name>More</Name>
<Directory>kf5-more.directory</Directory>
<Include>
<And>
<Category>AudioVideo</Category>
<Category>X-KDE-More</Category>
</And>
</Include>
</Menu>
</Menu>
<Menu>
<Name>Office</Name>
<Directory>kf5-office.directory</Directory>
<Layout>
<Merge type="menus"/>
<Filename>kde-koshell.desktop</Filename>
<Filename>kde-Kontact.desktop</Filename>
<Separator/>
<Filename>kde-kword.desktop</Filename>
<Filename>kde-kspread.desktop</Filename>
<Filename>kde-kpresenter.desktop</Filename>
<Merge type="files"/>
<Separator/>
<Menuname>More</Menuname>
</Layout>
<Include>
<And>
<Category>Office</Category>
<Not><Category>X-KDE-More</Category></Not>
</And>
</Include>
<Menu>
<Name>More</Name>
<Directory>kf5-more.directory</Directory>
<Include>
<And>
<Category>Office</Category>
<Category>X-KDE-More</Category>
</And>
</Include>
</Menu>
</Menu>
<Menu>
<Name>Settingsmenu</Name>
<Directory>kf5-settingsmenu.directory</Directory>
<Include>
<Category>Settings</Category>
</Include>
</Menu>
<Menu>
<Name>System</Name>
<Directory>kf5-system.directory</Directory>
<Include>
<And>
<Category>System</Category>
<Not><Category>X-KDE-More</Category></Not>
</And>
</Include>
<Menu>
<Name>More</Name>
<Directory>kf5-more.directory</Directory>
<Include>
<And>
<Category>System</Category>
<Category>X-KDE-More</Category>
</And>
</Include>
</Menu>
<Menu>
<Name>ScreenSavers</Name>
<Directory>kf5-system-screensavers.directory</Directory>
</Menu>
<Menu>
<Name>Terminal</Name>
<Directory>kf5-system-terminal.directory</Directory>
</Menu>
</Menu>
<Menu>
<Name>Utilities</Name>
<Directory>kf5-utilities.directory</Directory>
<Include>
<And>
<Category>Utility</Category>
<Not><Category>X-KDE-More</Category></Not>
</And>
<Category>TextEditor</Category>
<Category>Accessibility</Category>
<Category>X-KDE-Utilities-Desktop</Category>
<Category>X-KDE-Utilities-File</Category>
<Category>X-KDE-Utilities-Peripherals</Category>
<Category>X-KDE-Utilities-PIM</Category>
</Include>
<Menu>
<Name>XUtilities</Name>
<Directory>kf5-utilities-xutils.directory</Directory>
</Menu>
<Menu>
<Name>More</Name>
<Directory>kf5-more.directory</Directory>
<Include>
<And>
<Category>Utility</Category>
<Category>X-KDE-More</Category>
</And>
</Include>
</Menu>
</Menu>
<Include>
<And>
<Category>KDE</Category>
<Category>Core</Category>
</And>
</Include>
<DefaultMergeDirs/>
<MergeFile>applications-kmenuedit.menu</MergeFile>
</Menu>
@@ -0,0 +1,105 @@
#!/usr/bin/env python3
# SPDX-FileCopyrightText: 2023 Fushan Wen <qydwhotmail@gmail.com>
# SPDX-License-Identifier: MIT
import os
import subprocess
import sys
import unittest
from appium import webdriver
from appium.options.common.base import AppiumOptions
from appium.webdriver.common.appiumby import AppiumBy
from desktoptest import start_plasmashell
from gi.repository import Gio, GLib
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
class Bug472909Test(unittest.TestCase):
"""
Kickoff is taking focus away after being closed with meta key
"""
driver: webdriver.Remote
kactivitymanagerd: subprocess.Popen | None = None
kded: subprocess.Popen | None = None
plasmashell: subprocess.Popen | None = None
@classmethod
def setUpClass(cls) -> None:
cls.kactivitymanagerd, cls.kded, cls.plasmashell = start_plasmashell()
options = AppiumOptions()
options.set_capability("app", "Root")
options.set_capability("timeouts", {'implicit': 30000})
cls.driver = webdriver.Remote(command_executor='http://127.0.0.1:4723', options=options)
def tearDown(self) -> None:
"""
Take screenshot when the current test fails
"""
if os.environ["GDK_BACKEND"] == "wayland" and not self._outcome.result.wasSuccessful():
self.driver.get_screenshot_as_file(f"failed_test_shot_bug472909_#{self.id()}.png")
@classmethod
def tearDownClass(cls) -> None:
"""
Make sure to terminate the driver again, lest it dangles.
"""
subprocess.check_output(["kquitapp6", "plasmashell"], stderr=sys.stderr)
cls.plasmashell.wait()
if cls.kded:
cls.kded.terminate()
cls.kded.wait()
if cls.kactivitymanagerd:
cls.kactivitymanagerd.terminate()
cls.kactivitymanagerd.wait()
cls.driver.quit()
def test_bug472909(self) -> None:
wait = WebDriverWait(self.driver, 30)
wait.until(EC.presence_of_element_located((AppiumBy.NAME, "Application Launcher")))
# The driver doesn't support sending global keyboard shortcuts
session_bus: Gio.DBusConnection = Gio.bus_get_sync(Gio.BusType.SESSION)
message = Gio.DBusMessage.new_method_call("org.kde.kglobalaccel", "/component/plasmashell", "org.kde.kglobalaccel.Component", "allShortcutInfos")
reply, _ = session_bus.send_message_with_reply_sync(message, Gio.DBusSendMessageFlags.NONE, 1000)
shortcut_list = reply.get_body().get_child_value(0)
launcher_shortcut_id: str = ""
for i in range(shortcut_list.n_children()):
shortcut_info: GLib.Variant = shortcut_list.get_child_value(i)
shortcut_id: str = shortcut_info.get_child_value(0).get_string()
if not shortcut_id.startswith("activate application launcher"):
continue
launcher_shortcut_id = shortcut_id
break
self.assertGreater(len(launcher_shortcut_id), 0)
# Start active indicator window
test_env = os.environ.copy()
test_env["GDK_BACKEND"] = "wayland"
test_env["GSK_RENDERER"] = "cairo"
test_window = subprocess.Popen([os.path.join(os.path.dirname(os.path.abspath(__file__)), "bug472909_activewindow.py")], stdout=sys.stderr, stderr=sys.stderr, env=test_env)
self.addCleanup(test_window.terminate)
def activate_shortcut() -> None:
message = Gio.DBusMessage.new_method_call("org.kde.kglobalaccel", "/component/plasmashell", "org.kde.kglobalaccel.Component", "invokeShortcut")
message.set_body(GLib.Variant("(s)", [launcher_shortcut_id]))
session_bus.send_message_with_reply_sync(message, Gio.DBusSendMessageFlags.NONE, 1000)
# Activate the shortcut twice to test focus restoration
wait.until(EC.presence_of_element_located((AppiumBy.NAME, "Active Window")))
activate_shortcut()
wait.until(EC.presence_of_element_located((AppiumBy.NAME, "Inactive Window")))
activate_shortcut()
wait.until(EC.presence_of_element_located((AppiumBy.NAME, "Active Window")))
test_window.terminate()
test_window.wait()
if __name__ == '__main__':
assert subprocess.call(["pidof", "plasmashell"]) != 0, "The test requires plasmashell to quit"
unittest.main()
@@ -0,0 +1,42 @@
#!/usr/bin/env python3
# SPDX-FileCopyrightText: 2023 Fushan Wen <qydwhotmail@gmail.com>
# SPDX-License-Identifier: MIT
import gi
gi.require_version('Gtk', '4.0')
from gi.repository import GLib, Gtk
class TestWindow(Gtk.ApplicationWindow):
def __init__(self, _app: Gtk.Application) -> None:
super().__init__(application=_app, title="Test Window")
self.button = Gtk.Button(label="Active Window")
self.button.connect("clicked", self.on_button_clicked)
self.set_child(self.button)
self.connect("notify::is-active", self.on_is_active_changed)
GLib.timeout_add_seconds(60, self.close)
def on_button_clicked(self, widget) -> None:
self.close()
def on_is_active_changed(self, instance, param) -> None:
if self.is_active():
self.button.set_label("Active Window")
else:
self.button.set_label("Inactive Window")
def on_activate(_app: Gtk.Application) -> None:
win = TestWindow(_app)
win.present()
if __name__ == "__main__":
app = Gtk.Application(application_id='org.kde.testwindow')
app.connect('activate', on_activate)
app.run(None)
@@ -0,0 +1,72 @@
#!/usr/bin/env python3
# SPDX-FileCopyrightText: 2023 Fushan Wen <qydwhotmail@gmail.com>
# SPDX-License-Identifier: MIT
import subprocess
import sys
import unittest
from appium import webdriver
from appium.options.common.base import AppiumOptions
from appium.webdriver.common.appiumby import AppiumBy
from desktoptest import start_kactivitymanagerd, start_kded
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
class Bug476968Test(unittest.TestCase):
"""
plasmashell crashes when clicking configure button in System Tray settings window for applets without an overridden configure action
"""
driver: webdriver.Remote
kactivitymanagerd: subprocess.Popen | None = None
kded: subprocess.Popen | None = None
@classmethod
def setUpClass(cls) -> None:
"""
Initializes the webdriver and the desktop folder
"""
cls.kactivitymanagerd = start_kactivitymanagerd()
cls.kded = start_kded()
options = AppiumOptions()
options.set_capability("app", "plasmashell -p org.kde.plasma.desktop --no-respawn")
options.set_capability("timeouts", {'implicit': 30000})
cls.driver = webdriver.Remote(command_executor='http://127.0.0.1:4723', options=options)
def tearDown(self) -> None:
"""
Take screenshot when the current test fails
"""
if not self._outcome.result.wasSuccessful():
self.driver.get_screenshot_as_file(f"failed_test_shot_bug476968_#{self.id()}.png")
@classmethod
def tearDownClass(cls) -> None:
"""
Make sure to terminate the driver again, lest it dangles.
"""
subprocess.check_output(["kquitapp6", "plasmashell"], stderr=sys.stderr)
if cls.kded:
cls.kded.kill()
if cls.kactivitymanagerd:
cls.kactivitymanagerd.kill()
cls.driver.quit()
def test_bug476968(self) -> None:
wait = WebDriverWait(self.driver, 30)
wait.until(EC.presence_of_element_located((AppiumBy.NAME, "Show hidden icons"))).click() # plasma-workspace/applets/systemtray/package/contents/ui/ExpanderArrow.qml
wait.until(EC.presence_of_element_located((AppiumBy.NAME, "Configure System Tray..."))).click()
entries = wait.until(EC.presence_of_element_located((AppiumBy.NAME, "Entries")))
entries.click()
wait.until(EC.presence_of_element_located((AppiumBy.NAME, "Configure Camera Indicator..."))).click()
wait.until_not(lambda _: entries.is_displayed()) # Wait until the old window closes
wait.until(EC.presence_of_element_located((AppiumBy.NAME, "Camera Indicator Settings"))) # Window title
if __name__ == '__main__':
assert subprocess.call(["pidof", "plasmashell"]) != 0, "The test requires plasmashell to quit"
unittest.main()
@@ -0,0 +1,31 @@
#!/usr/bin/env python3
# SPDX-FileCopyrightText: 2025 Fushan Wen <qydwhotmail@gmail.com>
# SPDX-License-Identifier: MIT
# pylint: disable=too-many-arguments
import gi
gi.require_version('Gtk', '4.0')
from gi.repository import GLib, Gtk
class TestWindow(Gtk.ApplicationWindow):
def __init__(self, _app: Gtk.Application) -> None:
super().__init__(application=_app, title="Bug488736Test")
self.set_default_size(10, 10)
self.maximize()
GLib.timeout_add_seconds(60, _app.quit)
def on_activate(_app: Gtk.Application) -> None:
win = TestWindow(_app)
win.set_visible(True)
if __name__ == '__main__':
app = Gtk.Application(application_id='org.kde.testwindow')
app.connect('activate', on_activate)
app.run(None)
@@ -0,0 +1,418 @@
#!/usr/bin/env python3
# SPDX-FileCopyrightText: 2023 Harald Sitter <sitter@kde.org>
# SPDX-FileCopyrightText: 2023 Fushan Wen <qydwhotmail@gmail.com>
# SPDX-License-Identifier: GPL-2.0-or-later
import logging
import os
import shutil
import subprocess
import sys
import tempfile
import time
import unittest
from typing import Final
import cv2 as cv
import gi
gi.require_version('Gtk', '4.0')
gi.require_version('GdkPixbuf', '2.0')
from appium import webdriver
from appium.options.common.base import AppiumOptions
from appium.webdriver.common.appiumby import AppiumBy
from appium.webdriver.webelement import WebElement
from desktoptest_testwindow import DesktopFileWrapper
from gi.repository import GdkPixbuf, Gio, GLib, Gtk
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.actions.action_builder import ActionBuilder
from selenium.webdriver.common.actions.interaction import POINTER_TOUCH
from selenium.webdriver.common.actions.pointer_input import PointerInput
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
KACTIVITYMANAGERD_PATH: Final = os.environ.get("KACTIVITYMANAGERD_PATH", "/usr/libexec/kactivitymanagerd")
KACTIVITYMANAGERD_SERVICE_NAME: Final = "org.kde.ActivityManager"
PLASMASHELL_SERVICE_NAME: Final = "org.kde.plasmashell"
KDE_VERSION: Final = 6
def name_has_owner(session_bus: Gio.DBusConnection | None, name: str) -> bool:
"""
Whether the given name is available on session bus
"""
if session_bus is None:
session_bus = Gio.bus_get_sync(Gio.BusType.SESSION)
message: Gio.DBusMessage = Gio.DBusMessage.new_method_call("org.freedesktop.DBus", "/", "org.freedesktop.DBus", "NameHasOwner")
message.set_body(GLib.Variant("(s)", [name]))
reply, _ = session_bus.send_message_with_reply_sync(message, Gio.DBusSendMessageFlags.NONE, 1000)
return reply and reply.get_signature() == 'b' and reply.get_body().get_child_value(0).get_boolean()
def build_ksycoca() -> None:
subprocess.check_call([f"kbuildsycoca{KDE_VERSION}"], stdout=sys.stderr, stderr=sys.stderr, env=os.environ)
def start_kactivitymanagerd() -> subprocess.Popen | None:
session_bus: Gio.DBusConnection = Gio.bus_get_sync(Gio.BusType.SESSION)
if name_has_owner(session_bus, KACTIVITYMANAGERD_SERVICE_NAME):
return None
os.makedirs(os.path.join(GLib.get_user_config_dir(), "menus"))
shutil.copy(os.path.join(os.path.dirname(os.path.abspath(__file__)), "applications.menu"), os.path.join(GLib.get_user_config_dir(), "menus"))
kactivitymanagerd = subprocess.Popen([KACTIVITYMANAGERD_PATH], stdout=sys.stderr, stderr=sys.stderr, env=os.environ)
started: bool = False
for _ in range(10):
if name_has_owner(session_bus, KACTIVITYMANAGERD_SERVICE_NAME):
started = True
break
logging.info("waiting for kactivitymanagerd to appear on the DBus session")
time.sleep(1)
assert started
build_ksycoca()
return kactivitymanagerd
def start_kded() -> subprocess.Popen | None:
session_bus: Gio.DBusConnection = Gio.bus_get_sync(Gio.BusType.SESSION)
kded = None
if not name_has_owner(session_bus, f"org.kde.kded{KDE_VERSION}"):
kded = subprocess.Popen([f"kded{KDE_VERSION}"], stdout=sys.stderr, stderr=sys.stderr)
kded_started: bool = False
for _ in range(10):
if name_has_owner(session_bus, f"org.kde.kded{KDE_VERSION}"):
kded_started = True
break
print(f"waiting for kded{KDE_VERSION} to appear on the dbus session")
time.sleep(1)
assert kded_started
return kded
def start_plasmashell() -> tuple:
"""
Launches plashashell and returns the subprocess instances
"""
kactivitymanagerd = start_kactivitymanagerd()
kded = start_kded()
eng_env = os.environ.copy()
eng_env["LC_ALL"] = "en_US.UTF-8"
plasmashell = subprocess.Popen(["plasmashell", "-p", "org.kde.plasma.desktop", "--no-respawn"], stdout=sys.stderr, stderr=sys.stderr, env=eng_env)
return (kactivitymanagerd, kded, plasmashell)
class DesktopTest(unittest.TestCase):
"""
Tests for the desktop package
"""
driver: webdriver.Remote
kactivitymanagerd: subprocess.Popen | None = None
kded: subprocess.Popen | None = None
plasmashell: subprocess.Popen | None = None
@classmethod
def setUpClass(cls) -> None:
"""
Initializes the webdriver
"""
cls.kactivitymanagerd, cls.kded, cls.plasmashell = start_plasmashell()
options = AppiumOptions()
options.set_capability("app", "Root")
options.set_capability("timeouts", {'implicit': 30000})
cls.driver = webdriver.Remote(command_executor='http://127.0.0.1:4723', options=options)
def tearDown(self) -> None:
"""
Take screenshot when the current test fails
"""
if not self._outcome.result.wasSuccessful():
self.driver.get_screenshot_as_file(f"failed_test_shot_plasmashell_#{self.id()}.png")
@classmethod
def tearDownClass(cls) -> None:
"""
Make sure to terminate the driver again, lest it dangles.
"""
if cls.plasmashell is not None:
subprocess.check_output(["kquitapp6", "plasmashell"], stderr=sys.stderr)
assert cls.plasmashell.wait(30) == 0, cls.plasmashell.returncode
if cls.kded:
cls.kded.kill()
if cls.kactivitymanagerd:
cls.kactivitymanagerd.kill()
cls.driver.quit()
def _exit_edit_mode(self) -> None:
"""
Finds the close button and clicks it
"""
add_or_manage_widgets_button = self.driver.find_element(AppiumBy.NAME, "Add or Manage Widgets…")
self.driver.find_element(AppiumBy.NAME, "Exit Edit Mode").click()
WebDriverWait(self.driver, 30).until_not(lambda _: add_or_manage_widgets_button.is_displayed())
def _open_containment_config_dialog(self) -> None:
ActionChains(self.driver).key_down(Keys.CONTROL).key_down(Keys.SHIFT).send_keys("d").key_up(Keys.CONTROL).key_up(Keys.SHIFT).perform()
WebDriverWait(self.driver, 30).until(EC.presence_of_element_located((AppiumBy.NAME, "Wallpaper type:")))
def test_0_panel_ready(self) -> None:
"""
Waits until the panel is ready
"""
wait = WebDriverWait(self.driver, 30)
wait.until(EC.presence_of_element_located((AppiumBy.NAME, "Application Launcher")))
def test_1_containment_config_dialog_2_add_new_wallpaper(self) -> None:
"""
Tests if the file dialog is opened successfully
@see https://invent.kde.org/plasma/plasma-integration/-/merge_requests/117
"""
self._open_containment_config_dialog()
self.driver.find_element(AppiumBy.NAME, "Add Wallpaper Image…").click()
wait = WebDriverWait(self.driver, 30)
title_element: WebElement = wait.until(EC.presence_of_element_located((AppiumBy.NAME, "Open Image")))
buttons = self.driver.find_elements(AppiumBy.XPATH, "//button[@name='Cancel' and contains(@accessibility-id, 'KFileWidget')]")
for button in buttons:
button.click()
wait.until_not(lambda _: title_element.is_displayed())
def test_1_containment_config_dialog_3_other_sections(self) -> None:
"""
Opens other sections successively and matches text to make sure there is no breaking QML error
"""
self._open_containment_config_dialog()
wait = WebDriverWait(self.driver, 30)
mouseaction_element: WebElement = wait.until(EC.presence_of_element_located((AppiumBy.NAME, "Mouse Actions")))
location_element = wait.until(EC.presence_of_element_located((AppiumBy.NAME, "Location")))
icons_element = wait.until(EC.presence_of_element_located((AppiumBy.NAME, "Icons")))
filter_element = wait.until(EC.presence_of_element_located((AppiumBy.NAME, "Filter")))
mouseaction_element.click()
wait.until(EC.presence_of_element_located((AppiumBy.NAME, "Add Action")))
location_element.click()
wait.until(EC.presence_of_element_located((AppiumBy.NAME, "Desktop folder")))
icons_element.click()
wait.until(EC.presence_of_element_located((AppiumBy.NAME, "Configure Preview Plugins…"))).click()
wait.until(EC.presence_of_element_located((AppiumBy.NAME, "Preview Plugins")))
filter_element.click()
wait.until(EC.presence_of_element_located((AppiumBy.NAME, "File name pattern:")))
ActionChains(self.driver).send_keys(Keys.ESCAPE).perform()
wait.until_not(lambda _: mouseaction_element.is_displayed())
@unittest.skip("TODO: Open panel config dialog without keyboard shortcut")
def test_3_open_panel_edit_mode(self) -> None:
"""
Tests the edit mode toolbox can be loaded
Consolidates https://invent.kde.org/frameworks/plasma-framework/-/commit/3bb099a427cacd44fef7668225d8094f952dd5b2
"""
# Alt+D, E
actions = ActionChains(self.driver)
actions.key_down(Keys.ALT).send_keys("d").key_up(Keys.ALT).perform()
actions.send_keys("e").perform()
wait = WebDriverWait(self.driver, 30)
self.driver.find_element(AppiumBy.NAME, "Configure Panel…").click()
widget_button: WebElement = wait.until(EC.presence_of_element_located((AppiumBy.NAME, "Add New")))
wait.until(EC.presence_of_element_located((AppiumBy.NAME, "Clone Panel")))
actions.send_keys(Keys.ESCAPE).perform()
wait.until_not(lambda _: widget_button.is_displayed())
self._exit_edit_mode()
def test_5_bug477185_meta_number_shortcut(self) -> None:
"""
Meta+1 should activate the first launcher item
"""
# Prepare a desktop file
with DesktopFileWrapper() as wrapper:
session_bus = Gio.bus_get_sync(Gio.BusType.SESSION)
# Add a new launcher item
message: Gio.DBusMessage = Gio.DBusMessage.new_method_call(PLASMASHELL_SERVICE_NAME, "/PlasmaShell", "org.kde.PlasmaShell", "evaluateScript")
message.set_body(GLib.Variant("(s)", [f"panels().forEach(containment => containment.widgets('org.kde.plasma.icontasks').forEach(widget => {{widget.currentConfigGroup = ['General'];widget.writeConfig('launchers', 'file://{wrapper.path}');}}))"]))
session_bus.send_message_with_reply_sync(message, Gio.DBusSendMessageFlags.NONE, 1000)
wait = WebDriverWait(self.driver, 30)
wait.until(EC.presence_of_element_located((AppiumBy.NAME, "Software Center")))
# Activate the first launcher
# ActionChains(self.driver).key_down(Keys.META).send_keys("1").key_up(Keys.META) # FIXME Meta modifier doesn't work
message = Gio.DBusMessage.new_method_call("org.kde.kglobalaccel", "/component/plasmashell", "org.kde.kglobalaccel.Component", "invokeShortcut")
message.set_body(GLib.Variant("(s)", ["activate task manager entry 1"]))
session_bus.send_message_with_reply_sync(message, Gio.DBusSendMessageFlags.NONE, 1000)
wait.until(EC.presence_of_element_located((AppiumBy.NAME, "Install Software")))
@unittest.skipIf("KDECI_BUILD" in os.environ, "TODO: failed in CI")
def test_6_sentry_3516_load_layout(self) -> None:
"""
ShellCorona::loadLookAndFeelDefaultLayout -> ShellCorona::unload() -> qDeleteAll(panelViews) -> QWindow::visibleChanged -> rectNotify() -> 💣
@see https://bugreports.qt.io/browse/QTBUG-118841
"""
kickoff_element = self.driver.find_element(AppiumBy.NAME, "Application Launcher")
session_bus = Gio.bus_get_sync(Gio.BusType.SESSION)
# LookAndFeelManager::save
message: Gio.DBusMessage = Gio.DBusMessage.new_method_call(PLASMASHELL_SERVICE_NAME, "/PlasmaShell", "org.kde.PlasmaShell", "loadLookAndFeelDefaultLayout")
message.set_body(GLib.Variant("(s)", ["org.kde.breezedark.desktop"]))
session_bus.send_message_with_reply_sync(message, Gio.DBusSendMessageFlags.NONE, 10000)
self.assertFalse(kickoff_element.is_displayed())
self.driver.find_element(AppiumBy.NAME, "Application Launcher")
def test_7_bug_query_accent_color_binding_loop(self) -> None:
"""
Don't use binding as usedInAccentColor may be disabled immediately after a query from kcm_colors.
The call order is:
1. desktop.usedInAccentColor: true -> wallpaperColors.active: true
2. Kirigami.ImageColors.update()
3. Kirigami.ImageColors emits paletteChanged()
5. If binding is used, ShellCorona::colorChanged is emitted immediately in the same context after desktop.accentColor is updated
-> desktop.usedInAccentColor: false -> desktop.accentColor: "transparent" (binding restoration).
6. The second time querying the accent color, the QML engine will report binding loop detected in desktop.usedInAccentColor,
and desktop.accentColor will return "transparent" directly before any accent color from the wallpaper is extracted.
"""
session_bus = Gio.bus_get_sync(Gio.BusType.SESSION)
# Send the same request twice to check binding loop
for i in range(2):
print(f"sending message {i}", file=sys.stderr)
message: Gio.DBusMessage = Gio.DBusMessage.new_method_call(PLASMASHELL_SERVICE_NAME, "/PlasmaShell", "org.kde.PlasmaShell", "color")
reply, _ = session_bus.send_message_with_reply_sync(message, Gio.DBusSendMessageFlags.NONE, 1000)
self.assertEqual(reply.get_signature(), "u")
self.assertGreater(reply.get_body().get_child_value(0).get_uint32(), 0)
print("done sending message", file=sys.stderr)
def test_8_touch_long_press_on_desktop(self) -> None:
# BUG478958: Long press on the desktop to enter the edit mode
screen_geometry = Gtk.Window().get_display().get_monitors()[0].get_geometry()
long_press_time_ms: int = Gtk.Settings.get_default().get_property("gtk-long-press-time") * 2 + 5000
self.assertGreater(screen_geometry.width, 100)
self.assertGreater(screen_geometry.height, 100)
# Click "More" to open the desktop context menu
wait = WebDriverWait(self.driver, 5)
success = False
for _ in range(20):
try:
# Work around "no target window"
action = ActionBuilder(self.driver, mouse=PointerInput(POINTER_TOUCH, "finger"))
action.pointer_action.move_to_location(int(screen_geometry.width / 2), int(screen_geometry.height / 2)).click()
action.perform()
action = ActionBuilder(self.driver, mouse=PointerInput(POINTER_TOUCH, "finger"))
action.pointer_action.move_to_location(int(screen_geometry.width / 2), int(screen_geometry.height / 2)).pointer_down().pause(long_press_time_ms / 1000).pointer_up()
action.perform()
wait.until(EC.presence_of_element_located((AppiumBy.NAME, "More"))).click()
success = True
break
except TimeoutException:
continue
self.assertTrue(success)
# BUG 477220: "More" button in the desktop toolbox does not open the context menu
time.sleep(3) # Wait until the menu appears
self.driver.get_screenshot_as_file("bug477220_open_context_menu_before.png")
actions = ActionChains(self.driver)
for _ in range(3): # The number of menu items by default
actions = actions.send_keys(Keys.DOWN).pause(0.5)
actions.perform()
self.driver.get_screenshot_as_file("bug477220_open_context_menu_after.png")
img1 = cv.imread("bug477220_open_context_menu_before.png", cv.IMREAD_GRAYSCALE)
img2 = cv.imread("bug477220_open_context_menu_after.png", cv.IMREAD_GRAYSCALE)
diff = cv.subtract(img1, img2)
self.assertGreater(cv.countNonZero(diff), 4000) # Menu highlight changes
# Click an empty area to close the menu
action = ActionBuilder(self.driver, mouse=PointerInput(POINTER_TOUCH, "finger"))
action.pointer_action.move_to_location(int(screen_geometry.width / 2), int(screen_geometry.height / 2)).click()
action.perform()
# Long press on the panel to enter the edit mode
time.sleep(3) # Wait until the menu disappears
wait = WebDriverWait(self.driver, 5)
success = False
for _ in range(20):
try:
# Work around "no target window"
action = ActionBuilder(self.driver, mouse=PointerInput(POINTER_TOUCH, "finger"))
action.pointer_action.move_to_location(int(screen_geometry.width / 2), int(screen_geometry.height - 20)).click()
action.perform()
# Press on the panel
action = ActionBuilder(self.driver, mouse=PointerInput(POINTER_TOUCH, "finger"))
action.pointer_action.move_to_location(int(screen_geometry.width / 2), int(screen_geometry.height - 20)).pointer_down().pause(long_press_time_ms / 1000).pointer_up()
action.perform()
wait.until(EC.presence_of_element_located((AppiumBy.NAME, "Add New"))) # The panel config dialog is opened
success = True
break
except TimeoutException:
continue
self.assertTrue(success)
self._exit_edit_mode()
def test_9_bug488736_adpative_opacity(self) -> None:
"""
When a window is maximized in the foreground, the panel should be translucent.
"""
self.driver.find_element(AppiumBy.NAME, "Application Launcher")
# Set color wallpaper and defloat all panels to test the bug
session_bus = Gio.bus_get_sync(Gio.BusType.SESSION)
message = Gio.DBusMessage.new_method_call(PLASMASHELL_SERVICE_NAME, "/PlasmaShell", "org.kde.PlasmaShell", "setWallpaper")
params: dict[str, GLib.Variant] = {
"Color": GLib.Variant("(u)", [4294901760]), # RGBA value
}
# wallpaperPlugin(s), parameters(a{sv}), screenNum(u)
message.set_body(GLib.Variant("(sa{sv}u)", ["org.kde.color", params, 0]))
reply, _ = session_bus.send_message_with_reply_sync(message, Gio.DBusSendMessageFlags.NONE, 100000)
self.assertEqual(reply.get_message_type(), Gio.DBusMessageType.METHOD_RETURN)
message = Gio.DBusMessage.new_method_call(PLASMASHELL_SERVICE_NAME, "/PlasmaShell", "org.kde.PlasmaShell", "evaluateScript")
message.set_body(GLib.Variant("(s)", ["panels().forEach(containment => containment.floating = false)"]))
reply, _ = session_bus.send_message_with_reply_sync(message, Gio.DBusSendMessageFlags.NONE, 10000)
self.assertEqual(reply.get_message_type(), Gio.DBusMessageType.METHOD_RETURN)
# Open a maximized window
maximized_window = subprocess.Popen([os.path.join(os.path.dirname(os.path.abspath(__file__)), "bug488736_adaptive_opacity.py")], stdout=sys.stderr, stderr=sys.stderr)
self.addCleanup(maximized_window.kill)
time.sleep(3) # Window animation
with tempfile.TemporaryDirectory() as temp_dir:
saved_image_path: str = os.path.join(temp_dir, "desktop_screenshot.png")
self.driver.get_screenshot_as_file(saved_image_path)
pixbuf1 = GdkPixbuf.Pixbuf.new_from_file(saved_image_path)
maximized_window.kill()
time.sleep(3) # Window animation
with tempfile.TemporaryDirectory() as temp_dir:
saved_image_path = os.path.join(temp_dir, "desktop_screenshot.png")
self.driver.get_screenshot_as_file(saved_image_path)
pixbuf2 = GdkPixbuf.Pixbuf.new_from_file(saved_image_path)
self.assertEqual(pixbuf1.get_width(), pixbuf2.get_width())
self.assertEqual(pixbuf1.get_height(), pixbuf2.get_height())
self.assertGreater(pixbuf1.get_height(), 0)
n_channels: int = pixbuf1.get_n_channels()
pixel1 = pixbuf1.read_pixel_bytes().get_data()
pixel2 = pixbuf2.read_pixel_bytes().get_data()
# Get the pixel at the same position, 10 is a reasonable number to offset from the bottom line
offset = (pixbuf1.get_height() - 10) * pixbuf1.get_width() * n_channels + int(pixbuf1.get_width() / 2) * n_channels
self.assertNotEqual((pixel1[offset], pixel1[offset + 1], pixel1[offset + 2]), (pixel2[offset], pixel2[offset + 1], pixel2[offset + 2]))
if __name__ == '__main__':
assert subprocess.call(["pidof", "plasmashell"]) != 0, "The test requires plasmashell to quit"
unittest.main()
@@ -0,0 +1,88 @@
#!/usr/bin/env python3
# SPDX-FileCopyrightText: 2023 Fushan Wen <qydwhotmail@gmail.com>
# SPDX-License-Identifier: MIT
import logging
import os
import stat
import subprocess
import sys
from typing import Final, Self
import gi
gi.require_version('GdkPixbuf', '2.0')
gi.require_version('Gtk', '4.0')
from gi.repository import GdkPixbuf, GLib, Gtk
KDE_VERSION: Final = 6
class DesktopFileWrapper(object):
APPLICATION_ID: Final = "org.kde.testwindow"
APPLICATION_NAME: Final = "Software Center"
def __init__(self) -> None:
self.path: str = os.path.join(GLib.get_user_data_dir(), "applications", f"{self.APPLICATION_ID}.desktop")
self.application_path: str = os.path.realpath(__file__)
self.icon_path: str = os.path.join(GLib.get_user_data_dir(), "icons", "test.png")
def create(self) -> None:
os.makedirs(os.path.join(GLib.get_user_data_dir(), "applications"))
os.makedirs(os.path.join(GLib.get_user_data_dir(), "icons"))
pixbuf = GdkPixbuf.Pixbuf.new(GdkPixbuf.Colorspace.RGB, True, 8, 16, 16)
pixbuf.fill(0xff0000ff)
assert pixbuf.savev(self.icon_path, "png")
with open(self.path, "w", encoding="utf-8") as file_handler:
file_handler.writelines([
"[Desktop Entry]\n",
"Type=Application\n",
f"Icon={self.icon_path}\n",
f"Name={self.APPLICATION_NAME}\n",
f"Exec={self.application_path}\n",
])
file_handler.flush()
os.chmod(self.path, os.stat(self.path).st_mode | stat.S_IEXEC)
logging.info(self.path)
logging.info(self.icon_path)
subprocess.check_call([f"kbuildsycoca{KDE_VERSION}"], stdout=sys.stderr, stderr=sys.stderr, env=os.environ)
def __enter__(self) -> Self:
self.create()
return self
def __exit__(self, *args) -> None:
os.remove(self.path)
os.remove(self.icon_path)
class TestWindow(Gtk.ApplicationWindow):
def __init__(self, _app: Gtk.Application) -> None:
super().__init__(application=_app, title="Test Window")
self.button = Gtk.Button(label="Install Software")
self.button.connect("clicked", self.on_button_clicked)
self.set_child(self.button)
GLib.timeout_add_seconds(120, self.close)
def on_button_clicked(self, widget) -> None:
self.close()
def on_activate(_app: Gtk.Application) -> None:
win = TestWindow(_app)
win.present()
if __name__ == "__main__":
app = Gtk.Application(application_id=DesktopFileWrapper.APPLICATION_ID)
app.connect('activate', on_activate)
app.run(None)
@@ -0,0 +1,118 @@
#!/usr/bin/env python3
# SPDX-FileCopyrightText: 2023 Fushan Wen <qydwhotmail@gmail.com>
# SPDX-License-Identifier: MIT
import base64
import functools
import os
import subprocess
import sys
import tempfile
import time
import unittest
import gi
import numpy as np
from appium import webdriver
from appium.options.common.base import AppiumOptions
from appium.webdriver.common.appiumby import AppiumBy
from desktoptest import start_kactivitymanagerd, start_kded
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
gi.require_version('GdkPixbuf', '2.0')
gi.require_version('Gdk', '4.0')
from gi.repository import Gdk, GdkPixbuf, GLib
class FolderViewTest(unittest.TestCase):
"""
Tests for the desktop folder view layout
"""
driver: webdriver.Remote
kactivitymanagerd: subprocess.Popen | None = None
kded: subprocess.Popen | None = None
desktop_dir: str = ""
@classmethod
def setUpClass(cls) -> None:
"""
Initializes the webdriver and the desktop folder
"""
cls.desktop_dir = GLib.get_user_special_dir(GLib.UserDirectory.DIRECTORY_DESKTOP)
if not os.path.exists(cls.desktop_dir):
os.makedirs(cls.desktop_dir)
# Create an image file
bits_per_sample = 8
width = height = 16
pixbuf = GdkPixbuf.Pixbuf.new(GdkPixbuf.Colorspace.RGB, True, bits_per_sample, width, height)
pixbuf.fill(0xff0000ff)
assert pixbuf.savev(os.path.join(cls.desktop_dir, "test.png"), "png")
cls.addClassCleanup(functools.partial(os.remove, os.path.join(cls.desktop_dir, "test.png")))
cls.kactivitymanagerd = start_kactivitymanagerd()
cls.kded = start_kded()
options = AppiumOptions()
options.set_capability("app", "plasmashell -p org.kde.plasma.desktop --no-respawn")
options.set_capability("timeouts", {'implicit': 30000})
cls.driver = webdriver.Remote(command_executor='http://127.0.0.1:4723', options=options)
def tearDown(self) -> None:
"""
Take screenshot when the current test fails
"""
if not self._outcome.result.wasSuccessful():
self.driver.get_screenshot_as_file(f"failed_test_shot_folderview_#{self.id()}.png")
@classmethod
def tearDownClass(cls) -> None:
"""
Make sure to terminate the driver again, lest it dangles.
"""
subprocess.check_output(["kquitapp6", "plasmashell"], stderr=sys.stderr)
if cls.kded:
cls.kded.kill()
if cls.kactivitymanagerd:
cls.kactivitymanagerd.kill()
cls.driver.quit()
def test_0_folderview_ready(self) -> None:
"""
Waits until the folder view is ready
"""
WebDriverWait(self.driver, 30).until(EC.presence_of_element_located((AppiumBy.NAME, "test.png")))
time.sleep(3) # Make sure the desktop is ready
def test_1_image_preview(self) -> None:
"""
test.png is filled with red color
"""
with tempfile.TemporaryDirectory() as temp_dir:
# Take desktop screenshot
saved_image_path: str = os.path.join(temp_dir, "desktop.png")
self.driver.get_screenshot_as_file(saved_image_path)
with open(saved_image_path, 'rb') as f:
first_image = base64.b64encode(f.read()).decode()
# Create a red square
pixbuf = GdkPixbuf.Pixbuf.new(GdkPixbuf.Colorspace.RGB, True, 8, 16, 16)
pixbuf.fill(0xff0000ff)
second_image = base64.b64encode(Gdk.Texture.new_for_pixbuf(pixbuf).save_to_png_bytes().get_data()).decode()
self.driver.find_image_occurrence(first_image, second_image)
def test_2_bug469260_new_file_appear_without_refresh(self) -> None:
"""
A new file on desktop created by other applications should show up immediately
"""
with open(os.path.join(self.desktop_dir, "test.txt"), "w", encoding="utf-8") as handler:
handler.write("\n")
self.addCleanup(functools.partial(os.remove, os.path.join(self.desktop_dir, "test.txt")))
WebDriverWait(self.driver, 30).until(EC.presence_of_element_located((AppiumBy.NAME, "test.txt")))
if __name__ == '__main__':
assert subprocess.call(["pidof", "plasmashell"]) != 0, "The test requires plasmashell to quit"
unittest.main()
@@ -0,0 +1,135 @@
#!/usr/bin/env python3
# SPDX-FileCopyrightText: 2024 Niccolò Venerandi <niccolo@venerandi.com>
# SPDX-License-Identifier: MIT
import functools
import os
import pathlib
import stat
import subprocess
import sys
import time
import unittest
from typing import Final
from appium import webdriver
from appium.options.common.base import AppiumOptions
from appium.webdriver.common.appiumby import AppiumBy
from appium.webdriver.webelement import WebElement
from gi.repository import Gio, GLib
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
from desktoptest import start_plasmashell
class PanelFocusTest(unittest.TestCase):
"""
Tests for panel focus
"""
driver: webdriver.Remote
kactivitymanagerd: subprocess.Popen | None = None
kded: subprocess.Popen | None = None
plasmashell: subprocess.Popen | None = None
@classmethod
def setUpClass(cls) -> None:
"""
Initializes the webdriver
"""
cls.kactivitymanagerd, cls.kded, cls.plasmashell = start_plasmashell()
options = AppiumOptions()
options.set_capability("app", "Root")
options.set_capability("timeouts", {'implicit': 30000})
cls.driver = webdriver.Remote(command_executor='http://127.0.0.1:4723', options=options)
def tearDown(self) -> None:
"""
Take screenshot when the current test fails
"""
if not self._outcome.result.wasSuccessful():
self.driver.get_screenshot_as_file(f"failed_test_shot_plasmashell_#{self.id()}.png")
@classmethod
def tearDownClass(cls) -> None:
"""
Make sure to terminate the driver again, lest it dangles.
"""
cls.driver.quit()
def test_0_peek_at_desktop_not_giving_panel_focus(self) -> None:
"""
This clicks on the Peek at Desktop element and checks that the panel has
not gained keyboard focus by checking for the invisibility of the panel
focus indicator.
"""
el = self.driver.find_element(by=AppiumBy.NAME, value="Peek at Desktop")
el.click()
WebDriverWait(self.driver, 6).until(EC.visibility_of_element_located((AppiumBy.NAME, "Minimize All Applet Active Indicator")))
WebDriverWait(self.driver, 6).until(EC.invisibility_of_element_located((AppiumBy.NAME, "Panel Focus Indicator")))
el.click()
def test_1_setting_focus_shortcut(self) -> None:
"""
We set a shortcut for the panel, we activate it, and we check that the panel
focus indicator is indeed visible.
"""
# The driver doesn't support sending global keyboard shortcuts
session_bus: Gio.DBusConnection = Gio.bus_get_sync(Gio.BusType.SESSION)
message = Gio.DBusMessage.new_method_call("org.kde.kglobalaccel", "/component/plasmashell", "org.kde.kglobalaccel.Component", "allShortcutInfos")
reply, _ = session_bus.send_message_with_reply_sync(message, Gio.DBusSendMessageFlags.NONE, 1000)
shortcut_list = reply.get_body().get_child_value(0)
before = set(shortcut_list.get_child_value(i).get_child_value(0).get_string() for i in range(shortcut_list.n_children()))
actions = ActionChains(self.driver)
actions.context_click(self.driver.find_element(by=AppiumBy.NAME, value="Peek at Desktop"))
# Wait for the context menu to appear
actions.pause(0.4)
actions.send_keys(Keys.ARROW_UP)
actions.pause(0.1)
actions.send_keys(Keys.ENTER)
actions.perform()
setter = self.driver.find_element(by=AppiumBy.NAME, value="Focus Shortcut Setter")
actions.click(setter)
actions.key_down(Keys.ALT)
actions.send_keys("a")
actions.key_up(Keys.ALT)
# Wait for the shortcut input button to set the new shortcut
actions.pause(1.5)
actions.send_keys(Keys.ESCAPE)
actions.perform()
actions.pause(0.5)
actions.context_click()
# Wait for the context menu to appear
actions.pause(0.1)
actions.send_keys(Keys.ARROW_UP)
actions.pause(0.1)
actions.send_keys(Keys.ENTER)
actions.pause(1)
actions.perform()
message = Gio.DBusMessage.new_method_call("org.kde.kglobalaccel", "/component/plasmashell", "org.kde.kglobalaccel.Component", "allShortcutInfos")
reply, _ = session_bus.send_message_with_reply_sync(message, Gio.DBusSendMessageFlags.NONE, 1000)
shortcut_list = reply.get_body().get_child_value(0)
after = set(shortcut_list.get_child_value(i).get_child_value(0).get_string() for i in range(shortcut_list.n_children()))
difference = after - before
self.assertTrue(len(difference) == 1)
launcher_shortcut_id = difference.pop()
message = Gio.DBusMessage.new_method_call("org.kde.kglobalaccel", "/component/plasmashell", "org.kde.kglobalaccel.Component", "invokeShortcut")
message.set_body(GLib.Variant("(s)", [launcher_shortcut_id]))
session_bus.send_message_with_reply_sync(message, Gio.DBusSendMessageFlags.NONE, 1000)
WebDriverWait(self.driver, 6).until(EC.visibility_of_element_located((AppiumBy.NAME, "Panel Focus Indicator")))
if __name__ == '__main__':
assert subprocess.call(["pidof", "plasmashell"]) != 0, "The test requires plasmashell to quit"
unittest.main()
@@ -0,0 +1,72 @@
#!/usr/bin/env python3
# SPDX-FileCopyrightText: 2023 Fushan Wen <qydwhotmail@gmail.com>
# SPDX-License-Identifier: MIT
import subprocess
import time
import unittest
from typing import Final
from appium import webdriver
from appium.options.common.base import AppiumOptions
from appium.webdriver.common.appiumby import AppiumBy
KDE_VERSION: Final = 6
class EmojierTest(unittest.TestCase):
"""
Tests for plasma-emojier
"""
driver: webdriver.Remote
@classmethod
def setUpClass(cls) -> None:
options = AppiumOptions()
options.set_capability("app", f"plasma-emojier")
options.set_capability("timeouts", {'implicit': 10000})
cls.driver = webdriver.Remote(command_executor='http://127.0.0.1:4723', options=options)
def tearDown(self) -> None:
"""
Take screenshot when the current test fails
"""
if not self._outcome.result.wasSuccessful():
self.driver.get_screenshot_as_file(f"failed_test_shot_emojier_#{self.id()}.png")
@classmethod
def tearDownClass(cls) -> None:
"""
Make sure to terminate the driver again, lest it dangles.
"""
subprocess.check_call([f"kquitapp{KDE_VERSION}", "plasma.emojier"])
cls.driver.quit()
def test_0_open(self) -> None:
"""
Tests the app does not crash on opening
Note that, since there are no recent emojis by default, the application
opens on the "All" page so this should check for elements that are
visible on that page.
@see https://bugs.kde.org/show_bug.cgi?id=478458
"""
self.driver.find_element(AppiumBy.NAME, "All")
self.driver.find_element(AppiumBy.NAME, "Search")
def test_1_open_category(self) -> None:
self.driver.find_element(AppiumBy.NAME, "All").click()
self.driver.find_element(AppiumBy.NAME, "grinning face").click()
time.sleep(1)
self.assertEqual(self.driver.get_clipboard_text(), "😀")
def test_2_recent_usage(self) -> None:
self.driver.find_element(AppiumBy.NAME, "Recent").click()
self.driver.find_element(AppiumBy.NAME, "grinning face")
if __name__ == '__main__':
unittest.main()
@@ -0,0 +1,20 @@
# SPDX-FileCopyrightText: 2023 Fushan Wen <qydwhotmail@gmail.com>
# SPDX-License-Identifier: BSD-3-Clause
add_test(
NAME kcm_kded_test
COMMAND selenium-webdriver-at-spi-run ${CMAKE_CURRENT_SOURCE_DIR}/kcm_kded_test.py
)
set_tests_properties(kcm_kded_test PROPERTIES TIMEOUT 120 ENVIRONMENT "USE_CUSTOM_BUS=1")
add_test(
NAME kcm_keys_test
COMMAND selenium-webdriver-at-spi-run ${CMAKE_CURRENT_SOURCE_DIR}/kcm_keys_test.py --failfast
)
set_tests_properties(kcm_keys_test PROPERTIES TIMEOUT 120 ENVIRONMENT "LC_ALL=en_US.UTF-8;TEST_WITH_KWIN_WAYLAND=0;USE_CUSTOM_BUS=1;KGLOBALACCELD_PATH=${KDE_INSTALL_FULL_LIBEXECDIR}/kglobalacceld;KACTIVITYMANAGERD_PATH=${KDE_INSTALL_FULL_LIBEXECDIR}/kactivitymanagerd")
add_test(
NAME kcm_plasmasearch_test
COMMAND selenium-webdriver-at-spi-run ${CMAKE_CURRENT_SOURCE_DIR}/kcm_plasmasearch_test.py
)
set_tests_properties(kcm_plasmasearch_test PROPERTIES TIMEOUT 120)
@@ -0,0 +1,155 @@
#!/usr/bin/env python3
# SPDX-FileCopyrightText: 2024 Fushan Wen <qydwhotmail@gmail.com>
# SPDX-License-Identifier: MIT
import os
import subprocess
import sys
import unittest
import time
from typing import Final
from appium import webdriver
from appium.options.common.base import AppiumOptions
from appium.webdriver.common.appiumby import AppiumBy
from appium.webdriver.webelement import WebElement
from gi.repository import Gio, GLib
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), os.pardir, "desktop"))
KDE_VERSION: Final = 6
KCM_ID: Final = "kcm_kded"
def loadedModules(session_bus: Gio.DBusConnection) -> list[str]:
kded_reply: GLib.Variant = session_bus.call_sync(f"org.kde.kded{KDE_VERSION}", "/kded", f"org.kde.kded{KDE_VERSION}", "loadedModules", None, GLib.VariantType("(as)"), Gio.DBusSendMessageFlags.NONE, 1000)
return kded_reply.get_child_value(0).unpack()
def name_has_owner(session_bus: Gio.DBusConnection | None, name: str) -> bool:
"""
Whether the given name is available on session bus
"""
if session_bus is None:
session_bus = Gio.bus_get_sync(Gio.BusType.SESSION)
message: Gio.DBusMessage = Gio.DBusMessage.new_method_call("org.freedesktop.DBus", "/", "org.freedesktop.DBus", "NameHasOwner")
message.set_body(GLib.Variant("(s)", [name]))
reply, _ = session_bus.send_message_with_reply_sync(message, Gio.DBusSendMessageFlags.NONE, 1000)
return reply and reply.get_signature() == 'b' and reply.get_body().get_child_value(0).get_boolean()
def start_kded() -> subprocess.Popen | None:
session_bus: Gio.DBusConnection = Gio.bus_get_sync(Gio.BusType.SESSION)
kded = None
if not name_has_owner(session_bus, f"org.kde.kded{KDE_VERSION}"):
kded = subprocess.Popen([f"kded{KDE_VERSION}"], stdout=sys.stderr, stderr=sys.stderr)
kded_started: bool = False
for _ in range(10):
if name_has_owner(session_bus, f"org.kde.kded{KDE_VERSION}"):
kded_started = True
break
print(f"waiting for kded{KDE_VERSION} to appear on the dbus session")
time.sleep(1)
assert kded_started
return kded
class KCMTest(unittest.TestCase):
"""
Tests for kcm_kded
The KCM is hidden in systemsettings by default so if it breaks, few people will notice it.
This test makes sure the KCM still works.
"""
driver: webdriver.Remote
kded_process: subprocess.Popen | None = None
@classmethod
def setUpClass(cls) -> None:
"""
Opens the KCM and initialize the webdriver
"""
options = AppiumOptions()
options.set_capability("app", f"kcmshell{KDE_VERSION} {KCM_ID}")
environment = {
"LC_ALL": "en_US.UTF-8",
}
options.set_capability("environ", environment)
options.set_capability("timeouts", {'implicit': 10000})
cls.driver = webdriver.Remote(command_executor='http://127.0.0.1:4723', options=options)
cls.kded_process = start_kded()
def tearDown(self) -> None:
"""
Take screenshot when the current test fails
"""
if not self._outcome.result.wasSuccessful():
self.driver.get_screenshot_as_file(f"failed_test_shot_{KCM_ID}_#{self.id()}.png")
@classmethod
def tearDownClass(cls) -> None:
"""
Make sure to terminate the driver again, lest it dangles.
"""
cls.driver.find_element(AppiumBy.XPATH, "//*[@name='Cancel' and contains(@accessibility-id, 'Button')]").click()
if cls.kded_process is not None:
subprocess.check_output([f"kquitapp{KDE_VERSION}", f"kded{KDE_VERSION}"], stderr=sys.stderr)
cls.kded_process.wait()
cls.driver.quit()
def test_0_start_stop_service(self) -> None:
"""
Start/stop the accent color service
"""
self.driver.find_element(AppiumBy.NAME, "Background Services")
wait = WebDriverWait(self.driver, 30)
START_BUTTON_NAME: Final = "Start Accent Color"
STOP_BUTTON_NAME: Final = "Stop Accent Color"
SERVICE_NAME: Final = "plasma_accentcolor_service" # The id is from plasma-workspace
session_bus: Gio.DBusConnection = Gio.bus_get_sync(Gio.BusType.SESSION)
# The service has X-KDE-Kded-autoload: true, so it is always loaded when kded is running.
# Wait for autoloading to complete, then stop it to get into a known stopped state.
wait.until(EC.element_to_be_clickable((AppiumBy.NAME, STOP_BUTTON_NAME))).click()
wait.until(EC.element_to_be_clickable((AppiumBy.NAME, START_BUTTON_NAME)))
wait.until(lambda _: SERVICE_NAME not in loadedModules(session_bus))
self.assertNotIn(SERVICE_NAME, loadedModules(session_bus))
# Start the service again, and verify it is loaded.
wait.until(EC.element_to_be_clickable((AppiumBy.NAME, START_BUTTON_NAME))).click()
stop_button: WebElement = wait.until(EC.element_to_be_clickable((AppiumBy.NAME, STOP_BUTTON_NAME)))
wait.until(lambda _: SERVICE_NAME in loadedModules(session_bus))
self.assertIn(SERVICE_NAME, loadedModules(session_bus))
# Stop the service again to make sure it can be stopped again after being started.
stop_button.click()
wait.until(EC.element_to_be_clickable((AppiumBy.NAME, START_BUTTON_NAME)))
wait.until(lambda _: SERVICE_NAME not in loadedModules(session_bus))
self.assertNotIn(SERVICE_NAME, loadedModules(session_bus))
def test_1_toggle_automatically_loading_service(self) -> None:
"""
Toggle automatically loading the accent color service
"""
self.driver.find_element(AppiumBy.NAME, "Disable automatically loading Accent Color on startup").click()
self.driver.find_element(AppiumBy.NAME, "Apply").click()
wait = WebDriverWait(self.driver, 30)
wait.until(lambda _: subprocess.check_output([f"kreadconfig{KDE_VERSION}", "--file", "kded5rc", "--group", "Module-plasma_accentcolor_service", "--key", "autoload"]).decode(encoding="utf-8").strip() == "false")
self.driver.find_element(AppiumBy.NAME, "Enable automatically loading Accent Color on startup").click()
self.driver.find_element(AppiumBy.NAME, "Apply").click()
wait.until(lambda _: subprocess.check_output([f"kreadconfig{KDE_VERSION}", "--file", "kded5rc", "--group", "Module-plasma_accentcolor_service", "--key", "autoload"]).decode(encoding="utf-8").strip() == "true")
if __name__ == '__main__':
assert os.getenv("USE_CUSTOM_BUS") == "1"
unittest.main()
@@ -0,0 +1,179 @@
#!/usr/bin/env python3
# SPDX-FileCopyrightText: 2024 Fushan Wen <qydwhotmail@gmail.com>
# SPDX-License-Identifier: MIT
import logging
import os
import subprocess
import sys
import time
import unittest
from typing import Final
from appium import webdriver
from appium.options.common.base import AppiumOptions
from appium.webdriver.common.appiumby import AppiumBy
from gi.repository import GLib
from selenium.webdriver.support.ui import WebDriverWait
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), os.pardir, "desktop"))
from desktoptest import name_has_owner, start_kactivitymanagerd
KDE_VERSION: Final = 6
KCM_ID: Final = "kcm_keys"
KGLOBALACCELD_PATH: Final = os.getenv("KGLOBALACCELD_PATH", "/usr/libexec/kglobalacceld")
class KCMTest(unittest.TestCase):
"""
Tests for kcm_keys
"""
driver: webdriver.Remote
kactivitymanagerd: subprocess.Popen | None = None
kglobalacceld: subprocess.Popen | None = None
@classmethod
def setUpClass(cls) -> None:
# Start KGlobalAccel daemon service
if not name_has_owner(None, "org.kde.kglobalaccel"):
cls.kglobalacceld = subprocess.Popen([KGLOBALACCELD_PATH], stdout=sys.stderr, stderr=sys.stderr)
# Install applications.menu
cls.kactivitymanagerd = start_kactivitymanagerd()
options = AppiumOptions()
options.set_capability("app", f"kcmshell{KDE_VERSION} {KCM_ID}")
environment = {
"LC_ALL": "en_US.UTF-8",
"QT_LOGGING_RULES": "qt.accessibility.atspi.warning=false;qt.qml.typeresolution.cycle.warning=false;qt.qpa.wayland.warning=false;kf.plasma.core.warning=false;kf.windowsystem.warning=false;kf.kirigami.platform.warning=false",
}
# work around unresolvable warnings from Kirigami https://qt-project.atlassian.net/browse/QTBUG-143033
if "KDECI_BUILD" not in os.environ or os.environ["CI_JOB_NAME"] != "suse_tumbleweed_qt611":
environment["QT_FATAL_WARNINGS"] = "1"
options.set_capability("environ", environment)
options.set_capability("timeouts", {'implicit': 10000})
cls.driver = webdriver.Remote(command_executor='http://127.0.0.1:4723', options=options)
def tearDown(self) -> None:
"""
Take screenshot when the current test fails
"""
if not self._outcome.result.wasSuccessful():
subprocess.check_call(["import", "-window", "root", f"failed_test_shot_{KCM_ID}_#{self.id()}.png"])
@classmethod
def tearDownClass(cls) -> None:
"""
Make sure to terminate the driver again, lest it dangles.
"""
cls.driver.find_element(AppiumBy.XPATH, "//*[@name='Cancel' and contains(@accessibility-id, 'Button')]").click()
if cls.kactivitymanagerd is not None:
cls.kactivitymanagerd.kill()
if cls.kglobalacceld is not None:
subprocess.check_output([f"kquitapp{KDE_VERSION}", f"kglobalaccel"], stderr=sys.stderr)
cls.kglobalacceld.wait()
cls.driver.quit()
def test_0_open(self) -> None:
# Placeholder
self.driver.find_element(AppiumBy.NAME, "Select an item from the list to view its shortcuts here")
# Sidebar
self.driver.find_element(by=AppiumBy.XPATH, value="//heading[@name='Applications' and contains(@accessibility-id, 'ListSectionHeader')]")
self.driver.find_element(by=AppiumBy.XPATH, value="//heading[@name='Common Actions' and contains(@accessibility-id, 'ListSectionHeader')]")
def test_1_application_shortcuts(self) -> None:
"""
List some applications' shortcuts
"""
self.assertTrue(name_has_owner(None, "org.kde.kglobalaccel"))
self.driver.find_element(by=AppiumBy.XPATH, value="//list_item[@name='KRunner']").click()
self.driver.find_element(by=AppiumBy.NAME, value="Run command on clipboard contents:Alt+Shift+F2").click()
self.driver.find_element(by=AppiumBy.NAME, value="Default shortcut Alt+Shift+F2 is enabled.")
self.driver.find_element(by=AppiumBy.XPATH, value="//list_item[@name='Emoji Selector']").click()
self.driver.find_element(by=AppiumBy.NAME, value="Launch:")
self.driver.find_element(by=AppiumBy.NAME, value="Meta+., Meta+Ctrl+Alt+Shift+Space")
# Test if the config is saved
self.driver.find_element(by=AppiumBy.NAME, value="Add custom shortcut").click()
subprocess.check_call(["xdotool", "key", "Ctrl+0x002e"]) # https://gitlab.com/nokun/gestures/-/wikis/xdotool-list-of-key-codes
delete_button = self.driver.find_element(by=AppiumBy.NAME, value="Delete shortcut")
apply_button = self.driver.find_element(AppiumBy.XPATH, "//*[@name='Apply' and contains(@accessibility-id, 'Button')]")
apply_button.click()
wait = WebDriverWait(self.driver, 10)
wait.until(lambda _: "Ctrl+." in subprocess.check_output([f"kreadconfig{KDE_VERSION}", "--file", "kglobalshortcutsrc", "--group", "services", "--group", "org.kde.plasma.emojier.desktop", "--key", "_launch"]).decode(encoding="utf-8").strip())
# Remove the custom shortcut and check again
delete_button.click()
apply_button.click()
wait.until_not(lambda _: "Ctrl+." in subprocess.check_output([f"kreadconfig{KDE_VERSION}", "--file", "kglobalshortcutsrc", "--group", "services", "--group", "org.kde.plasma.emojier.desktop", "--key", "_launch"]).decode(encoding="utf-8").strip())
def test_2_add_new(self) -> None:
self.assertTrue(name_has_owner(None, "org.kde.kglobalaccel"))
# Maximize the window to update rect
window_id = subprocess.check_output(["xdotool", "search", "Shortcuts"]).decode().strip()
subprocess.check_call(["xdotool", "windowmove", window_id, "0", "0"])
# Open the dialog
button_rect = self.driver.find_element(AppiumBy.NAME, "Add New").rect
scale = 1.0
if "KDECI_BUILD" not in os.environ:
xrdb_output = subprocess.check_output(["xrdb", "-query"]).decode().splitlines()
for l in xrdb_output:
if l.startswith("Xft.dpi"):
scale = int(l.removeprefix("Xft.dpi:").strip()) / 90
logging.info(f"button rect: {button_rect}")
subprocess.check_call(["xdotool", "mousemove", str(int(button_rect["x"] * scale + 10)), str(int(button_rect["y"] * scale + 10)), "click", "1"])
self.driver.find_element(AppiumBy.NAME, "Add new command or script").click()
# Add a new command
command = "echo appiumtest > /dev/null"
self.driver.find_element(AppiumBy.NAME, "Command").send_keys(command)
time.sleep(1)
self.driver.find_element(AppiumBy.NAME, "Add command").click()
# Assign a shortcut
self.driver.find_element(AppiumBy.NAME, f"{command}:")
self.driver.find_element(AppiumBy.NAME, "No default shortcuts")
self.driver.find_element(by=AppiumBy.NAME, value="Add custom shortcut").click()
subprocess.check_call(["xdotool", "key", "Ctrl+0x002e"])
delete_button = self.driver.find_element(by=AppiumBy.NAME, value="Delete shortcut")
apply_button = self.driver.find_element(AppiumBy.XPATH, "//*[@name='Apply' and contains(@accessibility-id, 'Button')]")
apply_button.click()
# Test if the config is saved
custom_command_desktop_file = "net.local.echo.desktop"
wait = WebDriverWait(self.driver, 10)
wait.until(lambda _: subprocess.check_output([f"kreadconfig{KDE_VERSION}", "--file", "kglobalshortcutsrc", "--group", "services", "--group", custom_command_desktop_file, "--key", "_launch"]).decode(encoding="utf-8").strip() == "Ctrl+.")
with open(os.path.join(GLib.get_user_data_dir(), "applications", custom_command_desktop_file), encoding="utf-8") as file_handler:
for line in file_handler:
if line.startswith("Exec="):
self.assertIn(command, line)
if line.startswith("X-KDE-GlobalAccel-CommandShortcut"):
self.assertIn("true", line)
# Remove the custom shortcut and check again
delete_button.click()
apply_button.click()
wait.until_not(lambda _: subprocess.check_output([f"kreadconfig{KDE_VERSION}", "--file", "kglobalshortcutsrc", "--group", "services", "--group", custom_command_desktop_file, "--key", "_launch"]).decode(encoding="utf-8").strip() == "Ctrl+.")
self.assertTrue(os.path.exists(os.path.join(GLib.get_user_data_dir(), "applications", custom_command_desktop_file)))
# Remove the custom command
self.driver.find_element(by=AppiumBy.NAME, value="Remove all shortcuts for ").click()
self.driver.find_element(by=AppiumBy.NAME, value="Undo deletion").click()
self.driver.find_element(by=AppiumBy.NAME, value="Remove all shortcuts for ").click()
apply_button.click()
wait.until_not(lambda _: os.path.exists(os.path.join(GLib.get_user_data_dir(), "applications", custom_command_desktop_file)))
if __name__ == '__main__':
assert os.getenv("LC_ALL") == "en_US.UTF-8"
assert os.getenv("TEST_WITH_KWIN_WAYLAND") == "0" # On Wayland kglobalshortcutsrc is not updated
logging.getLogger().setLevel(logging.INFO)
unittest.main()
@@ -0,0 +1,60 @@
#!/usr/bin/env python3
# SPDX-FileCopyrightText: 2023 Fushan Wen <qydwhotmail@gmail.com>
# SPDX-License-Identifier: MIT
import unittest
from typing import Final
from appium import webdriver
from appium.options.common.base import AppiumOptions
from appium.webdriver.common.appiumby import AppiumBy
KDE_VERSION: Final = 6
KCM_ID: Final = "kcm_plasmasearch"
class KCMTest(unittest.TestCase):
"""
Tests for kcm_plasmasearch
"""
driver: webdriver.Remote
@classmethod
def setUpClass(cls) -> None:
"""
Opens the KCM and initialize the webdriver
"""
options = AppiumOptions()
options.set_capability("app", f"kcmshell{KDE_VERSION} {KCM_ID}")
options.set_capability("timeouts", {'implicit': 10000})
cls.driver = webdriver.Remote(command_executor='http://127.0.0.1:4723', options=options)
def tearDown(self) -> None:
"""
Take screenshot when the current test fails
"""
if not self._outcome.result.wasSuccessful():
self.driver.get_screenshot_as_file(f"failed_test_shot_{KCM_ID}_#{self.id()}.png")
@classmethod
def tearDownClass(cls) -> None:
"""
Make sure to terminate the driver again, lest it dangles.
"""
cls.driver.quit()
def test_0_open(self) -> None:
"""
Tests the plugin list is loaded
@see https://bugs.kde.org/show_bug.cgi?id=476702
"""
self.driver.find_element(AppiumBy.NAME, "Configure KRunner…")
self.driver.find_element(AppiumBy.NAME, "Applications")
self.driver.find_element(AppiumBy.NAME, "Remove from favorites")
self.driver.find_element(AppiumBy.NAME, "File Search")
if __name__ == '__main__':
unittest.main()
@@ -0,0 +1,19 @@
plasma_install_package(activitypager org.kde.plasma.activitypager)
add_subdirectory(kicker)
add_subdirectory(kickoff)
add_subdirectory(trash)
add_subdirectory(taskmanager)
add_subdirectory(window-list)
plasma_install_package(icontasks org.kde.plasma.icontasks)
if(PlasmaActivities_FOUND)
add_subdirectory(pager)
add_subdirectory(showActivityManager)
endif()
add_subdirectory(minimizeall)
add_subdirectory(showdesktop)
add_subdirectory(kimpanel)
add_subdirectory(keyboardlayout)
@@ -0,0 +1,180 @@
{
"KPackageStructure": "Plasma/Applet",
"KPlugin": {
"Authors": [
{
"Email": "plasma-devel@kde.org",
"Name": "The Plasma Team",
"Name[ar]": "فريق بلازما",
"Name[ast]": "L'equipu de Plasma",
"Name[az]": "Plasma komandası",
"Name[be]": "Каманда Plasma",
"Name[bg]": "Екипът на Plasma",
"Name[ca@valencia]": "L'equip de Plasma",
"Name[ca]": "L'equip del Plasma",
"Name[cs]": "Team Plasma",
"Name[da]": "Plasma-udviklingsholdet",
"Name[de]": "Das Plasma-Team",
"Name[el]": "Η ομάδα Plasma",
"Name[en_GB]": "The Plasma Team",
"Name[eo]": "La Teamo de Plasma",
"Name[es]": "El equipo de Plasma",
"Name[et]": "Plasma meeskond",
"Name[eu]": "Plasmaren taldea",
"Name[fi]": "Plasma-työryhmä",
"Name[fr]": "L'équipe de Plasma",
"Name[ga]": "An Fhoireann Plasma",
"Name[gl]": "O equipo de Plasma",
"Name[he]": "צוות פלזמה",
"Name[hu]": "A Plasma fejlesztői",
"Name[ia]": "Le equipa de Plasma",
"Name[id]": "Tim Plasma",
"Name[ie]": "Li equipe de Plasma",
"Name[is]": "Plasma-þróunarhópurinn",
"Name[it]": "La squadra di Plasma",
"Name[ja]": "Plasma チーム",
"Name[ka]": "Plasma-ის გუნდი",
"Name[ko]": "Plasma 팀",
"Name[lt]": "Plasma komanda",
"Name[lv]": "„Plasma“ komanda",
"Name[nb]": "Utviklingslaget for Plasma",
"Name[nl]": "Het team van Plasma",
"Name[nn]": "Utviklingslaget for Plasma",
"Name[pa]": "ਪਲਾਜ਼ਮਾ ਟੀਮ",
"Name[pl]": "Zespół Plazmy",
"Name[pt]": "A Equipa do Plasma",
"Name[pt_BR]": "A equipe do Plasma",
"Name[ro]": "Echipa Plasma",
"Name[ru]": "Команда разработчиков Plasma",
"Name[sa]": "प्लाज्मादलम्",
"Name[sk]": "Tím Plasma",
"Name[sl]": "Ekipa Plasme",
"Name[sv]": "Plasma-gruppen",
"Name[ta]": "பிளாஸ்மா குழு",
"Name[tr]": "Plasma Takımı",
"Name[ug]": "Plasma قوشۇنى",
"Name[uk]": "Команда розробників Плазми",
"Name[vi]": "Đội Plasma",
"Name[zh_CN]": "Plasma 开发团队",
"Name[zh_TW]": "Plasma 團隊"
}
],
"BugReportUrl": "https://bugs.kde.org/enter_bug.cgi?product=plasmashell&component=Pager%20widget",
"Category": "Windows and Tasks",
"Description": "Switch between activities",
"Description[ar]": "بدل بين الأنشطة",
"Description[az]": "Otaqlar arası keçid",
"Description[be]": "Пераключэнне паміж пакоямі",
"Description[bg]": "Превключване между дейностите",
"Description[ca@valencia]": "Canvia entre activitats",
"Description[ca]": "Commuta entre activitats",
"Description[cs]": "Přepnout mezi aktivitami",
"Description[da]": "Skift mellem aktiviteter",
"Description[de]": "Zwischen Aktivitäten umschalten",
"Description[el]": "Εναλλαγή μεταξύ δραστηριοτήτων",
"Description[en_GB]": "Switch between activities",
"Description[eo]": "Komuti inter aktivecoj",
"Description[es]": "Cambiar entre actividades",
"Description[et]": "Lülitumine tegevuste vahel",
"Description[eu]": "Jarduera artean trukatzea",
"Description[fi]": "Vaihda aktiviteetista toiseen",
"Description[fr]": "Basculer entre les activités",
"Description[ga]": "Athraigh idir gníomhaíochtaí",
"Description[gl]": "Cambia de actividade.",
"Description[he]": "מעבר בין פעילויות",
"Description[hu]": "Váltás az aktivitások között",
"Description[ia]": "Commuta inter activitates",
"Description[id]": "Beralih antar aktivitas",
"Description[ie]": "Alterar li activitás",
"Description[is]": "Skipt á milli athafna",
"Description[it]": "Passa da un'attività all'altra",
"Description[ja]": "アクティビティの切り替え",
"Description[ka]": "აქტივობებს შორის გადართვა",
"Description[ko]": "활동간 전환",
"Description[lt]": "Perjungti tarp veiklų",
"Description[lv]": "Pārslēgties starp aktivitātēm",
"Description[nb]": "Bytt mellom aktiviteter",
"Description[nl]": "Tussen activiteiten schakelen",
"Description[nn]": "Byt mellom aktivitetar",
"Description[pa]": "ਸਰਗਰਮੀਆਂ ਵਿਚਾਲੇ ਬਦਲੋ",
"Description[pl]": "Przełącza między aktywnościami",
"Description[pt]": "Alternar entre Atividades",
"Description[pt_BR]": "Alternar entre as atividades",
"Description[ro]": "Schimbă între activități",
"Description[ru]": "Переключение между комнатами",
"Description[sa]": "क्रियाकलापानाम् मध्ये परिवर्तनं कुर्वन्तु",
"Description[sk]": "Prepínanie medzi aktivitami",
"Description[sl]": "Preklopi med opravili",
"Description[sv]": "Byt mellan aktiviteter",
"Description[ta]": "செயல்பாடுகளுக்கிடையே தாவ உதவும்",
"Description[tr]": "Etkinlikler arasında gezin",
"Description[ug]": "پائالىيەتلەر ئارا ئالماشتۇرىدۇ",
"Description[uk]": "Перемикання між просторами дій",
"Description[vi]": "Chuyển giữa các Hoạt động",
"Description[zh_CN]": "在不同活动之间切换",
"Description[zh_TW]": "在活動間切換",
"EnabledByDefault": true,
"Icon": "org.kde.plasma.pager",
"Id": "org.kde.plasma.activitypager",
"License": "GPL-2.0+",
"Name": "Activity Pager",
"Name[ar]": "مبوب الأنشطة",
"Name[az]": "İş otağı dəyişdiricisi",
"Name[be]": "Пэйджар пакояў",
"Name[bg]": "Пейджър на дейностите",
"Name[ca@valencia]": "Paginador d'activitats",
"Name[ca]": "Paginador d'activitats",
"Name[cs]": "Prohlížeč aktivit",
"Name[da]": "Aktivitetssøger",
"Name[de]": "Aktivitätenübersicht",
"Name[el]": "Σελιδοποίηση δραστηριότητας",
"Name[en_GB]": "Activity Pager",
"Name[eo]": "Aktiveca Tabulpaĝilo",
"Name[es]": "Paginador de actividades",
"Name[et]": "Tegevuste lülitaja",
"Name[eu]": "Jardueren orrialdekatzailea",
"Name[fi]": "Aktiviteettisivutin",
"Name[fr]": "Gestionnaire d'activités",
"Name[ga]": "Leathanach Gníomhaíochta",
"Name[gl]": "Paxinador de actividades",
"Name[he]": "דפדפן פעילויות",
"Name[hu]": "Aktivitásváltó",
"Name[ia]": "Pager de activitate",
"Name[id]": "Pager Aktivitas",
"Name[ie]": "Paginator de activitás",
"Name[is]": "Athafnaflettir",
"Name[it]": "Paginatore attività",
"Name[ja]": "アクティビティページャ",
"Name[ka]": "აქტივობის პეიჯერი",
"Name[ko]": "활동 호출기",
"Name[lt]": "Veiklų perjungiklis",
"Name[lv]": "Aktivitāšu lapotājs",
"Name[nb]": "Aktivitetsbytter",
"Name[nl]": "Pager van activiteiten",
"Name[nn]": "Aktivitets­bytar",
"Name[pa]": "ਸਰਗਰਮੀ ਪੇਜ਼ਰ",
"Name[pl]": "Przełącznik aktywności",
"Name[pt]": "Paginador de Atividades",
"Name[pt_BR]": "Paginador de atividades",
"Name[ro]": "Paginator de activități",
"Name[ru]": "Переключение комнат",
"Name[sa]": "गतिविधि पेजर",
"Name[sk]": "Stránkovač aktivít",
"Name[sl]": "Pager dejavnosti",
"Name[sv]": "Aktivitetsbytare",
"Name[ta]": "செயல்பாடு மாற்றி",
"Name[tr]": "Etkinlik Sayfalayıcısı",
"Name[ug]": "پائالىيەت باشقۇرغۇچ",
"Name[uk]": "Пейджер просторів дій",
"Name[vi]": "Tổng quan Hoạt động",
"Name[zh_CN]": "活动切换器",
"Name[zh_TW]": "活動管理器",
"Website": "https://userbase.kde.org"
},
"X-Plasma-API-Minimum-Version": "6.0",
"X-Plasma-Provides": [
"org.kde.plasma.virtualdesktops",
"org.kde.plasma.activities"
],
"X-Plasma-RootPath": "org.kde.plasma.pager"
}
@@ -0,0 +1,171 @@
{
"KPackageStructure": "Plasma/Applet",
"KPlugin": {
"Authors": [
{
"Email": "hein@kde.org",
"Name": "Eike Hein",
"Name[ar]": "إيكي هين",
"Name[az]": "Eike Hein",
"Name[be]": "Eike Hein",
"Name[bg]": "Eike Hein",
"Name[ca@valencia]": "Eike Hein",
"Name[ca]": "Eike Hein",
"Name[cs]": "Eike Hein",
"Name[da]": "Eike Hein",
"Name[de]": "Eike Hein",
"Name[el]": "Eike Hein",
"Name[en_GB]": "Eike Hein",
"Name[eo]": "Eike Hein",
"Name[es]": "Eike Hein",
"Name[et]": "Eike Hein",
"Name[eu]": "Eike Hein",
"Name[fi]": "Eike Hein",
"Name[fr]": "Eike Hein",
"Name[ga]": "Eike Hein",
"Name[gl]": "Eike Hein",
"Name[he]": "אייק היין",
"Name[hu]": "Eike Hein",
"Name[ia]": "Eike Hein",
"Name[id]": "Eike Hein",
"Name[ie]": "Eike Hein",
"Name[is]": "Eike Hein",
"Name[it]": "Eike Hein",
"Name[ja]": "Eike Hein",
"Name[ka]": "აიკე ჰაინი",
"Name[ko]": "Eike Hein",
"Name[lt]": "Eike Hein",
"Name[lv]": "Eike Hein",
"Name[nb]": "Eike Hein",
"Name[nl]": "Eike Hein",
"Name[nn]": "Eike Hein",
"Name[pa]": "ਇਕੀ ਹੀਇਨ",
"Name[pl]": "Eike Hein",
"Name[pt]": "Eike Hein",
"Name[pt_BR]": "Eike Hein",
"Name[ro]": "Eike Hein",
"Name[ru]": "Eike Hein",
"Name[sa]": "ऐके हेन",
"Name[sk]": "Eike Hein",
"Name[sl]": "Eike Hein",
"Name[sv]": "Eike Hein",
"Name[ta]": "எய்கே ஹைன்",
"Name[tr]": "Eike Hein",
"Name[ug]": "Eike Hein",
"Name[uk]": "Eike Hein",
"Name[vi]": "Eike Hein",
"Name[zh_CN]": "Eike Hein",
"Name[zh_TW]": "Eike Hein"
}
],
"BugReportUrl": "https://bugs.kde.org/enter_bug.cgi?product=plasmashell&component=Task%20Manager%20and%20Icons-Only%20Task%20Manager%20widgets",
"Category": "Windows and Tasks",
"Description": "App bar displaying only icons",
"Description[ar]": "شريط التطبيقات يعرض أيقونات فقط",
"Description[az]": "Yalnız nişanları göstərən tətbiq paneli",
"Description[be]": "На панэлі праграм паказваюцца толькі значкі",
"Description[bg]": "Лента с приложения, показваща само икони",
"Description[ca@valencia]": "Barra d'aplicacions que mostra només les icones",
"Description[ca]": "Barra d'aplicacions que mostra només les icones",
"Description[cs]": "Lišta aplikací zobrazující pouze ikony",
"Description[da]": "App-linjen viser kun ikoner",
"Description[de]": "Nur Symbole werden auf der Anwendungsleiste angezeigt",
"Description[el]": "Γραμμή εφαρμογών που εμφανίζει μόνο εικονίδια",
"Description[en_GB]": "App bar displaying only icons",
"Description[eo]": "Apobreto montranta nur piktogramojn",
"Description[es]": "Barra de aplicaciones que solo muestra iconos",
"Description[eu]": "Ikonoak bakarrik azaltzen dituen aplikazio-barra",
"Description[fi]": "Vain kuvakkeet näyttävä sovelluspalkki",
"Description[fr]": "Barre d'applications n'affichant que des icônes",
"Description[ga]": "Barra aipeanna ag taispeáint deilbhíní amháin",
"Description[gl]": "Barra de aplicacións que amosa só iconas.",
"Description[he]": "סרגל היישומים מציג סמלים בלבד",
"Description[hu]": "Csak ikonokat megjelenítő alkalmazássáv",
"Description[ia]": "Barra de app monstrante solmente icones",
"Description[id]": "Bilah app menampilkan ikon saja",
"Description[is]": "Forritastika sem birtir eingöngu tákn",
"Description[it]": "Barra dell'applicazione che mostra solo le icone",
"Description[ja]": "アイコンのみを表示するアプリケーションバー",
"Description[ka]": "აპის პანელი, მხოლოდ, ხატულებს აჩვენებს",
"Description[ko]": "아이콘만 표시하는 앱 표시줄",
"Description[lt]": "Programų juosta atvaizduojanti tik piktogramas",
"Description[lv]": "Programmu josla, kurā ir tikai ikonas",
"Description[nb]": "Oppgavelinje med bare ikoner",
"Description[nl]": "Toepassingenbalk met alleen pictogrammen",
"Description[nn]": "Oppgåvelinje med berre ikon",
"Description[pl]": "Pasek aplikacji wyświetlający tylko ikony",
"Description[pt]": "Barra de aplicações apenas com ícones",
"Description[pt_BR]": "Barra de aplicativos apenas com ícones",
"Description[ro]": "Bară de aplicații ce afișează doar pictograme",
"Description[ru]": "Панель задач, использующая только значки",
"Description[sa]": "केवलं चिह्नानि प्रदर्शयति एप् बार",
"Description[sk]": "Panel aplikácií zobrazujúci iba ikony",
"Description[sl]": "Vrstica aplikacij, ki prikazuje samo ikone",
"Description[sv]": "Programrad som bara visar ikoner",
"Description[ta]": "சின்னங்களை மட்டும் காட்டும் பணிப்பட்டை",
"Description[tr]": "Yalnızca simgeler görüntüleyen uygulama çubuğu",
"Description[ug]": "پىروگرامما بالداقتا سىنبەلگىنلا كۆرسىتىدۇ",
"Description[uk]": "Панель програм, де показано лише піктограми",
"Description[zh_CN]": "应用栏仅显示图标",
"Description[zh_TW]": "只顯示圖示的應用程式列",
"EnabledByDefault": true,
"Icon": "preferences-system-windows",
"Id": "org.kde.plasma.icontasks",
"License": "GPL-2.0+",
"Name": "Icons-Only Task Manager",
"Name[ar]": "مدير مهامّ بأيقونات فقط",
"Name[az]": "Yalnız nişanlı tapşırıq meneceri",
"Name[be]": "Кіраўнік задач у выглядзе значкоў",
"Name[bg]": "Мениджър на задачи (само икони)",
"Name[ca@valencia]": "Gestor de tasques només amb icones",
"Name[ca]": "Gestor de tasques només amb icones",
"Name[cs]": "Správce úloh pouze s ikonami",
"Name[da]": "Opgavelinje kun med ikoner",
"Name[de]": "Fensterleiste nur mit Symbolen",
"Name[el]": "Διαχείριση εργασιών μόνο με εικονίδια",
"Name[en_GB]": "Icons-Only Task Manager",
"Name[eo]": "Nur-Piktograma Taskadministrilo",
"Name[es]": "Gestor de tareas con solo iconos",
"Name[eu]": "Ikono-soileko ataza-kudeatzailea",
"Name[fi]": "Kuvaketehtävienhallinta",
"Name[fr]": "Gestionnaire de tâches uniquement par icônes",
"Name[ga]": "Bainisteoir Tascanna Deilbhíní Amháin",
"Name[gl]": "Xestor de tarefas de só iconas",
"Name[he]": "מנהל משימות של סמלים בלבד",
"Name[hu]": "Ikonos feladatkezelő",
"Name[ia]": "Gerente de carga a sol icone",
"Name[id]": "Pengelola Tugas Ikon Saja",
"Name[is]": "Verkefnastjóri með táknum eingöngu",
"Name[it]": "Gestore dei processi solo icone",
"Name[ja]": "アイコンだけのタスクマネージャ",
"Name[ka]": "მხოლოდ ხატულებიანი ამოცანების მმართველი",
"Name[ko]": "아이콘 전용 작업 관리자",
"Name[lt]": "Tik piktogramų užduočių tvarkytuvė",
"Name[lv]": "Tikai ikonu uzdevumu pārvaldnieks",
"Name[nb]": "Oppgavebehandler med bare ikoner",
"Name[nl]": "Takenbeheer met alleen pictogrammen",
"Name[nn]": "Oppgåve­handsamar med berre ikon",
"Name[pa]": "ਸਿਰਫ਼-ਆਈਕਾਨ ਟਾਸਕ ਮੈਨੇਜਰ",
"Name[pl]": "Ikonowy przełącznik zadań",
"Name[pt]": "Barra de tarefas (ícones)",
"Name[pt_BR]": "Gerenciador de tarefas apenas com ícones",
"Name[ro]": "Gestionar de sarcini numai cu pictograme",
"Name[ru]": "Панель задач (только значки)",
"Name[sa]": "चिह्न-केवलं कार्यप्रबन्धकम्",
"Name[sk]": "Správca úloh iba s ikonami",
"Name[sl]": "Upravljalnik opravil samo z ikonami",
"Name[sv]": "Aktivitetshanterare med bara ikoner",
"Name[ta]": "சின்னங்களை மட்டும் கொண்ட பணி மேலாளி",
"Name[tr]": "Simgesel Görev Yöneticisi",
"Name[ug]": "سىنبەلگە ۋەزىپە باشقۇرغۇچ",
"Name[uk]": "Керування задачами лише за допомогою піктограм",
"Name[zh_CN]": "图标任务管理器",
"Name[zh_TW]": "只有圖示的工作管理員",
"Website": "https://userbase.kde.org/Plasma/Tasks"
},
"X-Plasma-API-Minimum-Version": "6.0",
"X-Plasma-Provides": [
"org.kde.plasma.multitasking"
],
"X-Plasma-RootPath": "org.kde.plasma.taskmanager"
}
@@ -0,0 +1,12 @@
# SPDX-FileCopyrightText: 2025 Tobias Fella <tobias.fella@kde.org>
# SPDX-License-Identifier: BSD-3-Clause
plasma_add_applet(org.kde.plasma.keyboardlayout
QML_SOURCES
qml/main.qml
qml/config.qml
qml/configGeneral.qml
RESOURCES
main.xml
GENERATE_APPLET_CLASS
)
@@ -0,0 +1,2 @@
#! /usr/bin/env bash
$XGETTEXT `find . -name \*.js -o -name \*.qml -o -name \*.cpp` -o $podir/plasma_applet_org.kde.plasma.keyboardlayout.pot
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd">
<kcfgfile name=""/>
<group name="General">
<entry name="displayStyle" type="Enum">
<label>Whether to show text, a flag, or both on the compact representation.</label>
<choices>
<choice name="Label"/>
<choice name="Flag"/>
<choice name="LabelOverFlag"/>
</choices>
<default>0</default>
</entry>
</group>
</kcfg>
@@ -0,0 +1,205 @@
{
"KPlugin": {
"Authors": [
{
"Email": "butirsky@gmail.com",
"Name": "Andrey Butirsky",
"Name[ar]": "أندريه بوتيرسكي",
"Name[az]": "Andrey Butirsky",
"Name[be]": "Andrey Butirsky",
"Name[bg]": "Andrey Butirsky",
"Name[ca@valencia]": "Andrey Butirsky",
"Name[ca]": "Andrey Butirsky",
"Name[cs]": "Andrey Butirsky",
"Name[da]": "Andrey Butirsky",
"Name[de]": "Andrey Butirsky",
"Name[el]": "Andrey Butirsky",
"Name[en_GB]": "Andrey Butirsky",
"Name[eo]": "Andrey Butirsky",
"Name[es]": "Andrey Butirsky",
"Name[et]": "Andrey Butirsky",
"Name[eu]": "Andrey Butirsky",
"Name[fi]": "Andrey Butirsky",
"Name[fr]": "Andrey Butirsky",
"Name[ga]": "Andrey Butirsky",
"Name[gl]": "Andrey Butirsky",
"Name[he]": "אנדריי בוטירסקי",
"Name[hu]": "Andrey Butirsky",
"Name[ia]": "Andrey Butirsky",
"Name[id]": "Andrey Butirsky",
"Name[ie]": "Andrey Butirsky",
"Name[is]": "Andrey Butirsky",
"Name[it]": "Andrey Butirsky",
"Name[ja]": "Andrey Butirsky",
"Name[ka]": "ანდრეი ბუტირსკი",
"Name[ko]": "Andrey Butirsky",
"Name[lt]": "Andrey Butirsky",
"Name[lv]": "Andrey Butirsky",
"Name[nb]": "Andrey Butirsky",
"Name[nl]": "Andrey Butirsky",
"Name[nn]": "Andrey Butirsky",
"Name[pl]": "Andrey Butirsky",
"Name[pt]": "Andrey Butirsky",
"Name[pt_BR]": "Andrey Butirsky",
"Name[ro]": "Andrey Butirsky",
"Name[ru]": "Андрей Бутырский",
"Name[sa]": "आन्द्रे बुतिर्स्की",
"Name[sk]": "Andrey Butirsky",
"Name[sl]": "Andrey Butirsky",
"Name[sv]": "Andrey Butirsky",
"Name[ta]": "ஆன்டிரே புடிர்ஸ்கி",
"Name[tr]": "Andrey Butirsky",
"Name[ug]": "Andrey Butirsky",
"Name[uk]": "Андрєй Бутирскій",
"Name[vi]": "Andrey Butirsky",
"Name[zh_CN]": "Andrey Butirsky",
"Name[zh_TW]": "Andrey Butirsky"
}
],
"BugReportUrl": "https://bugs.kde.org/enter_bug.cgi?product=plasmashell&component=Keyboard%20Layout%20widget",
"Category": "Language",
"Description": "Show/switch keyboard layout",
"Description[ar]": "اعرض/بدّل بين تخطيطات لوحات المفاتيح",
"Description[az]": "Klaviatura qatını göstərmək/dəyişmək",
"Description[be]": "Паказ і пераключэнне раскладкі клавіятуры",
"Description[bg]": "Превключване клавиатурна подредба",
"Description[ca@valencia]": "Mostra/canvia la disposició del teclat",
"Description[ca]": "Mostra/commuta la disposició del teclat",
"Description[cs]": "Zobrazit/přepnout rozvržení klávesnice",
"Description[da]": "Vis/skift tastaturlayout",
"Description[de]": "Tastaturbelegungen anzeigen/umschalten",
"Description[el]": "Εμφάνιση/αλλαγή διάταξης πληκτρολογίου",
"Description[en_GB]": "Show/switch keyboard layout",
"Description[eo]": "Montri/ŝalti klavararanĝon",
"Description[es]": "Mostrar o cambiar la distribución del teclado",
"Description[et]": "Klaviatuuripaigutuste näitamine ja nende vahel lülitamine",
"Description[eu]": "Erakutsi/aldatu teklatu-antolaera",
"Description[fi]": "Näytä tai vaihda näppäimistöasettelu",
"Description[fr]": "Afficher / Basculer une disposition de clavier",
"Description[ga]": "Taispeáin/athraigh leagan amach an mhéarchláir",
"Description[gl]": "Amosar ou alternar a disposición de teclado.",
"Description[he]": "הצגת/החלפת פריסת מקלדת",
"Description[hu]": "Billentyűzetkiosztások megjelenítése/váltása",
"Description[ia]": "Monstra/commuta disposition de claviero",
"Description[id]": "Tampilkan/alihkan tata letak keyboard",
"Description[ie]": "Monstrar o alterar li arangeament del tastatura",
"Description[is]": "Sýna/skipta um lyklaborðsskipan",
"Description[it]": "Mostra/Cambia la mappatura della tastiera",
"Description[ja]": "キーボードレイアウトの表示/切り替え",
"Description[ka]": "კლავიატურის განლაგების ჩვენების ჩართ/გამორთ",
"Description[ko]": "키보드 레이아웃 표시/전환",
"Description[lt]": "Rodyti/perjungti klaviatūros išdėstymą",
"Description[lv]": "Parādīt/pārslēgties starp tastatūras izkārtojumiem",
"Description[nb]": "Vis/bytt tastaturoppsett",
"Description[nl]": "Toon/schakel tussen toetsenbordindelingen",
"Description[nn]": "Vis/byt tastaturoppsett",
"Description[pa]": "ਕੀਬੋਰਡ ਲੇਆਉਟ ਵੇਖੋ/ਬਦਲੋ",
"Description[pl]": "Pokaż/przełącz układ klawiatury",
"Description[pt]": "Mostrar/mudar esquema do teclado",
"Description[pt_BR]": "Mostrar/trocar o layout de teclado",
"Description[ro]": "Arată/schimbă aranjamentul de tastatură",
"Description[ru]": "Просмотр и переключение между раскладками клавиатуры",
"Description[sa]": "कीबोर्डविन्यासं दर्शयतु/परिवर्तयतु",
"Description[sk]": "Zobraziť/prepnúť rozloženie klávesnice",
"Description[sl]": "Oglej/preklopi razporeditev tipk",
"Description[sv]": "Visa och byt tangentbordslayout",
"Description[ta]": "விசைப்பலகை தளவமைப்பை காட்டு/மாற்று",
"Description[tr]": "Klavye yerleşimini görüntüle/geçiş yap",
"Description[ug]": "ھەرپتاختا جايلاشتۇرۇشنى كۆرسىتىدۇ/ئالماشتۇرىدۇ",
"Description[uk]": "Показати/Перемкнути розкладку клавіатури",
"Description[vi]": "Hiện/chuyển bố cục bàn phím",
"Description[zh_CN]": "显示/切换键盘布局",
"Description[zh_TW]": "顯示/切換鍵盤佈局",
"EnabledByDefault": true,
"Icon": "input-keyboard",
"License": "GPL-2.0+",
"Name": "Keyboard Layout",
"Name[af]": "Sleutelbord Uitleg",
"Name[ar]": "تخطيط لوحة المفاتيح",
"Name[az]": "Klaviatura qatı",
"Name[be@latin]": "Vykład klavijatury",
"Name[be]": "Раскладка клавіятуры",
"Name[bg]": "Клавиатурни подредби",
"Name[bn]": "কীবোর্ড বিন্যাস",
"Name[bn_IN]": "কি-বোর্ড বিন্যাস",
"Name[br]": "Reizhadur ar stokellaoueg",
"Name[ca@valencia]": "Disposició del teclat",
"Name[ca]": "Disposició del teclat",
"Name[cs]": "Rozvržení klávesnice",
"Name[csb]": "Ùstôw klawiaturë",
"Name[cy]": "Cynllun Bysellfwrdd",
"Name[da]": "Tastaturlayout",
"Name[de]": "Tastaturbelegung",
"Name[el]": "Διάταξη πληκτρολογίου",
"Name[en_GB]": "Keyboard Layout",
"Name[eo]": "Klavararanĝo",
"Name[es]": "Distribución del teclado",
"Name[et]": "Klaviatuuri paigutus",
"Name[eu]": "Teklatuaren antolaera",
"Name[fa]": "طرح‌بندی صفحه کلید",
"Name[fi]": "Näppäinasettelu",
"Name[fr]": "Disposition du clavier",
"Name[fy]": "Toetseboerdyndieling",
"Name[ga]": "Leagan Amach Méarchláir",
"Name[gl]": "Disposición do teclado",
"Name[gu]": "કીબોર્ડ દેખાવ",
"Name[he]": "פריסת מקלדת",
"Name[hi]": "कुंजीपट ख़ाका",
"Name[hne]": "कुंजीपट खाका",
"Name[hr]": "Raspored tipkovnice",
"Name[hsb]": "Tastaturowy layout",
"Name[hu]": "Billentyűzetkiosztás",
"Name[ia]": "Disposition de claviero",
"Name[id]": "Tata Letak Keyboard",
"Name[ie]": "Arangeament de tastatura",
"Name[is]": "Lyklaborðsskipan",
"Name[it]": "Mappatura della tastiera",
"Name[ja]": "キーボード配列",
"Name[ka]": "კლავიატურის განლაგება",
"Name[kk]": "Перенетақта сәйкестігі",
"Name[km]": "ប្លង់​ក្ដារចុច",
"Name[kn]": "ಕೀಲಿಮಣೆ ವಿನ್ಯಾಸ",
"Name[ko]": "키보드 레이아웃",
"Name[ku]": "Rengê Klavyeyê",
"Name[lt]": "Klaviatūros išdėstymas",
"Name[lv]": "Tastatūras izkārtojums",
"Name[mai]": "कीबोर्ड लेआउट",
"Name[mk]": "Распоред на тастатура",
"Name[mr]": "कळफलक रचना",
"Name[nb]": "Tastaturoppsett",
"Name[nds]": "Tasttoornen",
"Name[ne]": "कुञ्जीपाटी सजावट",
"Name[nl]": "Toetsenbordindeling",
"Name[nn]": "Tastatur­oppsett",
"Name[oc]": "Disposicion del clavièr",
"Name[or]": "କିବୋର୍ଡ଼ ବିନ୍ୟାସ",
"Name[pa]": "ਕੀ-ਬੋਰਡ ਲੇਆਉਟ",
"Name[pl]": "Układ klawiatury",
"Name[pt]": "Esquema do teclado",
"Name[pt_BR]": "Layout do teclado",
"Name[ro]": "Aranjament de tastatură",
"Name[ru]": "Раскладка клавиатуры",
"Name[sa]": "कीबोर्ड लेआउट",
"Name[si]": "යතුරුපුවරු ආකෘතිය",
"Name[sk]": "Rozloženie klávesnice",
"Name[sl]": "Razporeditev tipk",
"Name[sv]": "Tangentbordslayout",
"Name[ta]": "விசைப்பலகை தளவமைப்பு",
"Name[te]": "కీబోర్డ్ కూర్పు",
"Name[tg]": "Тугмабандии клавиатура",
"Name[th]": "ผังแป้นพิมพ์",
"Name[tr]": "Klavye Yerleşimi",
"Name[ug]": "ھەرپتاختا جايلاشتۇرۇلۇشى",
"Name[uk]": "Розкладка клавіатури",
"Name[uz@cyrillic]": "Тугмалар тартиби",
"Name[uz]": "Tugmalar tartibi",
"Name[vi]": "Bố cục bàn phím",
"Name[wa]": "Adjinçmint del taprece",
"Name[xh]": "Ubeko Lwebhodi yezitshixo",
"Name[zh_CN]": "键盘布局",
"Name[zh_TW]": "鍵盤佈局",
"Website": "https://kde.org/plasma-desktop/"
},
"X-Plasma-API-Minimum-Version": "6.0",
"X-Plasma-NotificationAreaCategory": "Hardware"
}
@@ -0,0 +1,10 @@
import QtQuick
import org.kde.plasma.configuration
ConfigModel {
ConfigCategory {
name: i18nc("@title:group for configuration dialog page", "General")
icon: "configure"
source: "configGeneral.qml"
}
}
@@ -0,0 +1,108 @@
/*
SPDX-FileCopyrightText: 2021 Andrey Butirsky <butirsky@gmail.com>
SPDX-FileCopyrightText: 2022 Nate Graham <nate@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import org.kde.kirigami as Kirigami
import org.kde.plasma.workspace.keyboardlayout
import org.kde.plasma.workspace.components as WorkspaceComponents
import org.kde.plasma.private.kcm_keyboard as KCMKeyboard
import org.kde.kcmutils
SimpleKCM {
id: root
property int cfg_displayStyle
readonly property string layoutShortName: keyboardLayout.layoutsList.length ? keyboardLayout.layoutsList[keyboardLayout.layout].shortName
: ""
readonly property string displayName: keyboardLayout.layoutsList.length ? keyboardLayout.layoutsList[keyboardLayout.layout].displayName
: ""
KeyboardLayout { id: keyboardLayout }
Kirigami.FormLayout {
RadioButton {
id: showLabel
Kirigami.FormData.label: i18nc("@title:group of radio buttons, options are language codes or images", "Display style:") // qmllint disable unqualified
text: root.displayName.length > 0 ? root.displayName: root.layoutShortName
checked: root.cfg_displayStyle === 0
onToggled: root.cfg_displayStyle = 0;
}
RadioButton {
id: showFlag
checked: root.cfg_displayStyle === 1
onToggled: root.cfg_displayStyle = 1;
contentItem: RowLayout {
id: flagMissing
spacing: Kirigami.Units.smallSpacing
anchors.left: parent.left
anchors.leftMargin: showFlag.indicator.width + showFlag.spacing
// Deliberately using this instead of Image to preserve visual fidelity
// with what the widget will show
Kirigami.Icon {
id: flagImage
implicitWidth: Kirigami.Units.iconSizes.medium
implicitHeight: Kirigami.Units.iconSizes.medium
source: KCMKeyboard.Flags.getIcon(root.layoutShortName)
visible: valid
}
Kirigami.Icon {
implicitWidth: Kirigami.Units.iconSizes.smallMedium
implicitHeight: Kirigami.Units.iconSizes.smallMedium
source: "emblem-warning"
visible: !flagImage.visible
}
Label {
text: i18nc("@info:placeholder Make this translation as short as possible", "No flag available") // qmllint disable unqualified
visible: !flagImage.visible
}
}
}
RadioButton {
id: showLabelOverFlag
checked: root.cfg_displayStyle === 2
onToggled: root.cfg_displayStyle = 2;
contentItem: Kirigami.Icon {
// Deliberately using this instead of Image to preserve visual fidelity
// with what the widget will show
id: labelOverFlagImage
width: Kirigami.Units.iconSizes.medium
height: Kirigami.Units.iconSizes.medium
anchors.left: parent.left
anchors.leftMargin: showLabelOverFlag.indicator.width + showLabelOverFlag.spacing
source: KCMKeyboard.Flags.getIcon(root.layoutShortName)
visible: valid
WorkspaceComponents.BadgeOverlay {
anchors.bottom: parent.bottom
anchors.right: parent.right
text: showLabel.text
icon: parent
}
}
}
Kirigami.Separator {
Kirigami.FormData.isSection: true
}
Button {
Kirigami.FormData.label: i18nc("@label prefixed to button, as in 'keyboard layouts'", "Layouts:") // qmllint disable unqualified
text: i18nc("@action:button opens kcm_keyboard", "Configure…") // qmllint disable unqualified
icon.name: "configure"
onClicked: KCMLauncher.openSystemSettings("kcm_keyboard", "--tab=layouts")
}
}
}
@@ -0,0 +1,129 @@
/*
SPDX-FileCopyrightText: 2020 Andrey Butirsky <butirsky@gmail.com>
SPDX-License-Identifier: GPL-2.0-or-later
*/
pragma ComponentBehavior: Bound
import QtQuick
import org.kde.plasma.plasmoid
import org.kde.plasma.core as PlasmaCore
import org.kde.plasma.components as PlasmaComponents3
import org.kde.plasma.workspace.components
import org.kde.plasma.private.kcm_keyboard as KCMKeyboard
import org.kde.kirigami as Kirigami
PlasmoidItem {
id: root
signal layoutSelected(int layoutIndex)
preferredRepresentation: fullRepresentation
toolTipMainText: Plasmoid.title
toolTipSubText: "" // proper subtext is set by fullRepresentation
readonly property bool inEmbeddedContainment: Plasmoid.containment.containmentType === PlasmaCore.Containment.CustomEmbedded
fullRepresentation: KeyboardLayoutSwitcher {
id: switcher
hoverEnabled: true
Plasmoid.status: hasMultipleKeyboardLayouts ? PlasmaCore.Types.ActiveStatus : root.inEmbeddedContainment ? PlasmaCore.Types.HiddenStatus : PlasmaCore.Types.PassiveStatus
Binding {
root.toolTipSubText: switcher.layoutNames.longName
}
PlasmaCore.ToolTipArea {
anchors.fill: parent
mainText: root.toolTipMainText
subText: root.toolTipSubText
}
Instantiator {
id: actionsInstantiator
model: switcher.keyboardLayout.layoutsList
delegate: PlasmaCore.Action {
required property string longName
required property string shortName
required property int index
text: longName
icon.icon: KCMKeyboard.Flags.getIcon(shortName)
onTriggered: {
root.layoutSelected(index);
}
}
onObjectAdded: (index, object) => {
Plasmoid.contextualActions.push(object)
}
onObjectRemoved: (index, object) => {
Plasmoid.contextualActions.splice(Plasmoid.contextualActions.indexOf(object), 1)
}
}
Connections {
target: root
function onLayoutSelected(layoutIndex) {
switcher.keyboardLayout.layout = layoutIndex;
}
}
Connections {
target: Plasmoid
function onActivated() {
switcher.keyboardLayout.switchToNextLayout()
}
}
Kirigami.Icon {
id: flag
anchors.fill: parent
visible: valid && (Plasmoid.configuration.displayStyle === 1 || Plasmoid.configuration.displayStyle === 2)
active: switcher.containsMouse
source: KCMKeyboard.Flags.getIcon(switcher.layoutNames.shortName)
BadgeOverlay {
anchors.bottom: parent.bottom
anchors.right: parent.right
// The parent component has it set really tight to save space;
// we need to undo that here for legibility
horizontalPadding: Kirigami.Units.smallSpacing
visible: !countryCode.visible && Plasmoid.configuration.displayStyle === 2
text: countryCode.text
icon: flag
}
}
PlasmaComponents3.Label {
id: countryCode
anchors.centerIn: parent
width: Math.min(switcher.width, switcher.height)
height: width
visible: Plasmoid.configuration.displayStyle === 0 || !flag.valid
font.pointSize: height || Kirigami.Theme.defaultFont.pointSize
fontSizeMode: Text.Fit
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
text: switcher.layoutNames.displayName || switcher.layoutNames.shortName
textFormat: Text.PlainText
}
}
function actionTriggered(actionName) {
const layoutIndex = parseInt(actionName);
if (!isNaN(layoutIndex)) {
layoutSelected(layoutIndex);
}
}
}
@@ -0,0 +1,133 @@
/*
SPDX-FileCopyrightText: 2013 Aurélien Gâteau <agateau@kde.org>
SPDX-FileCopyrightText: 2014-2015 Eike Hein <hein@kde.org>
SPDX-FileCopyrightText: 2024 ivan tkachenko <me@ratijas.tk>
SPDX-License-Identifier: GPL-2.0-or-later
*/
pragma Singleton
pragma ComponentBehavior: Bound
import QtQuick
import org.kde.plasma.extras as PlasmaExtras
import "code/tools.js" as Tools
QtObject {
id: root
property Item visualParent
property ItemAbstractDelegate delegate
// See tools.js for a list of possible members
property var actionList
readonly property bool opened: __menu ? (__menu.status !== PlasmaExtras.Menu.Closed) : false
property PlasmaExtras.Menu __menu
signal actionClicked(string actionId, var actionArgument)
signal closed()
onActionListChanged: {
__refreshMenu();
}
onOpenedChanged: {
if (!opened) {
closed();
}
}
function triggerAction(actionId: string, actionArgument: var): void {
if (Tools.triggerAction(delegate.baseModel, delegate.index, actionId, actionArgument) === true) {
delegate.interactionConcluded()
}
}
function open(x: var, y: var): void {
if (!actionList) {
return;
}
if (x !== undefined && y !== undefined) {
__menu.open(x, y);
} else {
__menu.open();
}
}
function __refreshMenu(): void {
if (__menu) {
__menu.destroy();
}
if (!actionList) {
return;
}
__menu = contextMenuComponent.createObject(this);
__fillMenu(__menu, actionList);
}
function __fillMenu(menu: PlasmaExtras.Menu, actionItems: var): void {
actionItems.forEach(actionItem => {
if (actionItem.subActions) {
// This is a menu
const submenuItem = contextSubmenuItemComponent.createObject(menu, { actionItem });
__fillMenu(submenuItem.submenu, actionItem.subActions);
} else {
contextMenuItemComponent.createObject(menu, { actionItem });
}
});
}
readonly property list<QtObject> __data: [
Component {
id: contextMenuComponent
PlasmaExtras.Menu {
visualParent: root.visualParent
}
},
Component {
id: contextSubmenuItemComponent
PlasmaExtras.MenuItem {
id: submenuItem
required property var actionItem
text: actionItem.text ?? ""
icon: actionItem.icon ?? null
readonly property PlasmaExtras.Menu submenu: PlasmaExtras.Menu {
visualParent: submenuItem.action
}
}
},
Component {
id: contextMenuItemComponent
PlasmaExtras.MenuItem {
required property var actionItem
text : actionItem.text ?? ""
enabled : actionItem.type !== "title" && (actionItem.enabled ?? true)
separator : actionItem.type === "separator"
section : actionItem.type === "title"
icon : actionItem.icon ?? null
checkable : actionItem.checkable ?? false
checked : actionItem.checked ?? false
onClicked: {
root.triggerAction(actionItem.actionId, actionItem.actionArgument);
}
}
}
]
}
@@ -0,0 +1,31 @@
set_source_files_properties(ActionMenu.qml
PROPERTIES QT_QML_SINGLETON_TYPE TRUE)
plasma_add_applet(org.kde.plasma.kicker
QML_SOURCES
config.qml
ActionMenu.qml
CompactRepresentation.qml
ConfigGeneral.qml
DashboardRepresentation.qml
HoverBlocker.qml
ItemAbstractDelegate.qml
ItemGridDelegate.qml
ItemGridView.qml
ItemListDelegate.qml
ItemListDialog.qml
ItemListView.qml
ItemMultiGridView.qml
MenuRepresentation.qml
RunnerResultsList.qml
SideBarItem.qml
SideBarSection.qml
main.qml
RESOURCES
main.xml
GENERATE_APPLET_CLASS
)
ecm_target_qml_sources(org.kde.plasma.kicker SOURCES code/tools.js PATH code)
@@ -0,0 +1,135 @@
/*
SPDX-FileCopyrightText: 2013-2014 Eike Hein <hein@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Layouts
import org.kde.kirigami as Kirigami
import org.kde.plasma.core as PlasmaCore
import org.kde.plasma.plasmoid
import org.kde.plasma.private.kicker as Kicker
Item {
id: root
readonly property bool isDash: Plasmoid.pluginName === "org.kde.plasma.kickerdash"
readonly property bool vertical: (Plasmoid.formFactor === PlasmaCore.Types.Vertical)
readonly property bool useCustomButtonImage: (Plasmoid.configuration.useCustomButtonImage
&& Plasmoid.configuration.customButtonImage.length !== 0)
property string toolTipSubText: ""
property Component dashWindowComponent
readonly property Kicker.DashboardWindow dashWindow: isDash && dashWindowComponent && dashWindowComponent.status === Component.Ready
? dashWindowComponent.createObject(root, { visualParent: root }) as Kicker.DashboardWindow : null
onWidthChanged: updateSizeHints()
onHeightChanged: updateSizeHints()
function updateSizeHints(): void {
if (useCustomButtonImage && imageFallback.visible) {
if (vertical) {
const scaledHeight = Math.floor(parent?.width * (imageFallback.implicitHeight / imageFallback.implicitWidth));
root.Layout.minimumWidth = -1;
root.Layout.minimumHeight = scaledHeight;
root.Layout.maximumWidth = Kirigami.Units.iconSizes.huge;
root.Layout.maximumHeight = scaledHeight;
} else {
const scaledWidth = Math.floor(parent?.height * (imageFallback.implicitWidth / imageFallback.implicitHeight));
root.Layout.minimumWidth = scaledWidth;
root.Layout.minimumHeight = -1;
root.Layout.maximumWidth = scaledWidth;
root.Layout.maximumHeight = Kirigami.Units.iconSizes.huge;
}
} else {
root.Layout.minimumWidth = -1;
root.Layout.minimumHeight = -1;
root.Layout.maximumWidth = Kirigami.Units.iconSizes.huge;
root.Layout.maximumHeight = Kirigami.Units.iconSizes.huge;
}
}
Kirigami.Icon {
id: buttonIcon
anchors.fill: parent
active: mouseArea.containsMouse
source: root.useCustomButtonImage ? Plasmoid.configuration.customButtonImage : Plasmoid.configuration.icon
visible: !imageFallback.visible
// A custom icon could also be rectangular, but Kirigami.Icon only supports square ones.
// If a square, custom, icon is given, we load it using Kirigami.Icon and round it to
// the nearest icon size again to avoid scaling artifacts.
roundToIconSize: true
onSourceChanged: root.updateSizeHints()
onVisibleChanged: root.updateSizeHints()
}
Image {
id: imageFallback
readonly property double aspectRatio: root.vertical
? implicitHeight / implicitWidth
: implicitWidth / implicitHeight
anchors.fill: parent
visible: root.useCustomButtonImage && status == Image.Ready && aspectRatio !== 1 && source !== ""
mipmap: true
source: Plasmoid.icon.startsWith("/") ? "file:" + Plasmoid.icon.split("/").map(encodeURIComponent).join("/") : ""
onSourceChanged: root.updateSizeHints()
onVisibleChanged: root.updateSizeHints()
fillMode: Image.PreserveAspectFit
}
MouseArea {
id: mouseArea
anchors.fill: parent
property bool wasExpanded: false;
activeFocusOnTab: true
hoverEnabled: !root.dashWindow || !root.dashWindow.visible
Keys.onReturnPressed: Plasmoid.activated()
Keys.onEnterPressed: Plasmoid.activated()
Keys.onSpacePressed: Plasmoid.activated()
Keys.onSelectPressed: Plasmoid.activated()
Accessible.name: Plasmoid.title
Accessible.description: root.toolTipSubText
Accessible.role: Accessible.Button
onPressed: mouse => {
if (!root.isDash) {
wasExpanded = kicker.expanded
}
}
onClicked: mouse => {
if (root.isDash) {
root.dashWindow.toggle();
} else {
kicker.expanded = !wasExpanded;
}
}
}
Connections {
target: Plasmoid
enabled: root.isDash && root.dashWindow !== null
function onActivated(): void {
root.dashWindow.toggle();
}
}
}
@@ -0,0 +1,273 @@
/*
SPDX-FileCopyrightText: 2014 Eike Hein <hein@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls as QQC2
import org.kde.draganddrop as DragDrop
import org.kde.iconthemes as KIconThemes
import org.kde.kcmutils as KCMUtils
import org.kde.kirigami as Kirigami
import org.kde.ksvg as KSvg
import org.kde.plasma.core as PlasmaCore
import org.kde.plasma.plasmoid
KCMUtils.SimpleKCM {
id: configGeneral
readonly property bool isDash: (Plasmoid.pluginName === "org.kde.plasma.kickerdash")
property string cfg_icon: Plasmoid.configuration.icon
property bool cfg_useCustomButtonImage: Plasmoid.configuration.useCustomButtonImage
property string cfg_customButtonImage: Plasmoid.configuration.customButtonImage
property alias cfg_appNameFormat: appNameFormat.currentIndex
property alias cfg_limitDepth: limitDepth.checked
property alias cfg_alphaSort: alphaSort.checked
property alias cfg_showIconsRootLevel: showIconsRootLevel.checked
property alias cfg_recentOrdering: recentOrdering.currentIndex
property alias cfg_showRecentApps: showRecentApps.checked
property alias cfg_showRecentDocs: showRecentDocs.checked
property alias cfg_showRecentFolders: showRecentFolders.checked
property alias cfg_highlightNewlyInstalledApps: highlightNewlyInstalledAppsCheckbox.checked
property alias cfg_useExtraRunners: useExtraRunners.checked
property alias cfg_alignResultsToBottom: alignResultsToBottom.checked
property alias cfg_forceDarkMode: forceDarkMode.checked
Kirigami.FormLayout {
anchors.left: parent.left
anchors.right: parent.right
QQC2.Button {
id: iconButton
Kirigami.FormData.label: i18nc("@label prefix for icon-only button", "Icon:")
implicitWidth: previewFrame.width + Kirigami.Units.smallSpacing * 2
implicitHeight: previewFrame.height + Kirigami.Units.smallSpacing * 2
// Just to provide some visual feedback when dragging;
// cannot have checked without checkable enabled
checkable: true
checked: dropArea.containsAcceptableDrag
onPressed: iconMenu.opened ? iconMenu.close() : iconMenu.open()
DragDrop.DropArea {
id: dropArea
property bool containsAcceptableDrag: false
anchors.fill: parent
onDragEnter: event => {
// Cannot use string operations (e.g. indexOf()) on "url" basic type.
const urlString = event.mimeData.url.toString();
// This list is also hardcoded in KIconDialog.
const extensions = [".png", ".xpm", ".svg", ".svgz"];
containsAcceptableDrag = urlString.startsWith("file:///")
&& extensions.some(extension => urlString.endsWith(extension));
if (!containsAcceptableDrag) {
event.ignore();
}
}
onDragLeave: event => {
containsAcceptableDrag = false
}
onDrop: event => {
if (containsAcceptableDrag) {
// Strip file:// prefix, we already verified in onDragEnter that we have only local URLs.
iconDialog.setCustomButtonImage(event.mimeData.url.toString().substr("file://".length));
}
containsAcceptableDrag = false;
}
}
KIconThemes.IconDialog {
id: iconDialog
function setCustomButtonImage(image) {
configGeneral.cfg_customButtonImage = image || configGeneral.cfg_icon || "start-here-kde-symbolic"
configGeneral.cfg_useCustomButtonImage = true;
}
onAccepted: {
if (iconDialog.iconName != "") {
setCustomButtonImage(iconDialog.iconName)
}
}
}
KSvg.FrameSvgItem {
id: previewFrame
anchors.centerIn: parent
imagePath: Plasmoid.location === PlasmaCore.Types.Vertical || Plasmoid.location === PlasmaCore.Types.Horizontal
? "widgets/panel-background" : "widgets/background"
width: Kirigami.Units.iconSizes.large + fixedMargins.left + fixedMargins.right
height: Kirigami.Units.iconSizes.large + fixedMargins.top + fixedMargins.bottom
Kirigami.Icon {
anchors.centerIn: parent
width: Kirigami.Units.iconSizes.large
height: width
source: configGeneral.cfg_useCustomButtonImage ? configGeneral.cfg_customButtonImage : configGeneral.cfg_icon
}
}
QQC2.Menu {
id: iconMenu
// Appear below the button
y: parent.height
onClosed: iconButton.checked = false;
QQC2.MenuItem {
text: i18nc("@item:inmenu Open icon chooser dialog", "Choose…")
icon.name: "document-open-folder"
onClicked: iconDialog.open()
}
QQC2.MenuItem {
text: i18nc("@item:inmenu Reset icon to default", "Reset to default icon")
icon.name: "edit-clear"
onClicked: {
configGeneral.cfg_icon = "start-here-kde-symbolic"
configGeneral.cfg_customButtonImage = ""
configGeneral.cfg_useCustomButtonImage = false
}
}
}
}
Item {
Kirigami.FormData.isSection: true
}
QQC2.ComboBox {
id: appNameFormat
visible: !configGeneral.isDash
Kirigami.FormData.label: i18nc("@label:listbox", "Show applications as:")
model: [i18nc("@item:inlistbox", "Name only"), i18nc("@item:inlistbox", "Description only"),
i18nc("@item:inlistbox", "Name (Description)"), i18nc("@item:inlistbox", "Description (Name)")]
}
Item {
Kirigami.FormData.isSection: true
}
QQC2.CheckBox {
id: alphaSort
Kirigami.FormData.label: i18nc("@title:group prefix for checkbox group", "Behavior:")
text: i18nc("@option:check", "Sort applications alphabetically")
}
QQC2.CheckBox {
id: limitDepth
visible: !configGeneral.isDash
text: i18nc("@option:check", "Flatten sub-menus to a single level")
}
QQC2.CheckBox {
id: showIconsRootLevel
visible: !configGeneral.isDash
text: i18nc("@option:check", "Show icons on the root level of the menu")
}
QQC2.CheckBox {
id: highlightNewlyInstalledAppsCheckbox
text: i18nc("@option:check", "Highlight newly-installed applications")
}
Item {
Kirigami.FormData.isSection: true
}
QQC2.CheckBox {
id: showRecentApps
Kirigami.FormData.label: i18nc("@title:group prefix for checkbox group", "Show categories:")
text: recentOrdering.currentIndex == 0
? i18nc("@option:check", "Recent applications")
: i18nc("@option:check", "Often used applications")
}
QQC2.CheckBox {
id: showRecentDocs
text: recentOrdering.currentIndex == 0
? i18nc("@option:check", "Recent files")
: i18nc("@option:check", "Often used files")
}
QQC2.CheckBox {
id: showRecentFolders
text: recentOrdering.currentIndex == 0
? i18nc("@option:check", "Recent places")
: i18nc("@option:check", "Often used places")
}
QQC2.ComboBox {
id: recentOrdering
Kirigami.FormData.label: i18nc("@label:listbox", "Sort items in categories by:")
model: [i18nc("@item:inlistbox Sort items in categories by [Recently used | Often used]", "Recently used"), i18nc("@item:inlistbox Sort items in categories by [Recently used | Often used]", "Often used")]
}
Item {
Kirigami.FormData.isSection: true
}
QQC2.CheckBox {
id: useExtraRunners
Kirigami.FormData.label: i18nc("@title:group prefix for checkbox group", "Search:")
text: i18nc("@option:check", "Expand search to bookmarks, files and emails")
}
QQC2.CheckBox {
id: alignResultsToBottom
visible: !configGeneral.isDash
text: i18nc("@option:check", "Align search results to bottom")
}
RowLayout {
visible: configGeneral.isDash
Kirigami.FormData.label: i18nc("@label prefix for a checkbox toggling Dark Mode", "Appearance:")
spacing: Kirigami.Units.smallSpacing
QQC2.CheckBox {
id: forceDarkMode
text: i18nc("@option:check", "Prefer Dark Mode when available")
}
Kirigami.ContextualHelpButton {
toolTipText: xi18nc("@info:tooltip", "This feature uses the complementary colors from your colorscheme, which usually feature a dark background.")
}
}
}
}
@@ -0,0 +1,33 @@
/*
* SPDX-FileCopyrightText: 2026 Christoph Wolk <cwo.kde@posteo.net>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
pragma ComponentBehavior: Bound
import QtQuick
MouseArea {
id: hoverBlock // don't hover-activate until mouse is moved to not interfere with keyboard use
property bool mouseMoved: false
hoverEnabled: true
propagateComposedEvents: true // clicking should still work if hovering is blocked
onPositionChanged: if (!mouseMoved) {
mouseMoved = true
} else {
enabled = false // this immediately triggers other hover events when bound to their hoverEnabled
}
onPressed: event => {
enabled = false
event.accepted = false
}
function reset() {
mouseMoved = false
enabled = true
}
}
@@ -0,0 +1,91 @@
/*
* SPDX-FileCopyrightText: 2013-2015 Eike Hein <hein@kde.org>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
import QtQuick
import org.kde.kirigami as Kirigami
import org.kde.plasma.components as PlasmaComponents3
import "code/tools.js" as Tools
PlasmaComponents3.ItemDelegate {
id: item
required property int index
required property bool isSeparator
required property bool hasChildren
required property bool isParent
required property bool disabled
required property bool hasActionList
required property bool isNewlyInstalled
required property string favoriteId
required property var /*QVariantList*/ actionList
required property url url
required property string description
required property string decoration
required property string compactName
required property var model // for display, which would shadow ItemDelegate
required property var favoritesModel
required property var baseModel
property bool dialogDefaultRight: Application.layoutDirection !== Qt.RightToLeft
property bool dragActive: false
signal interactionConcluded
signal openCategory(bool keyboardInitiated)
text: model.display
icon.name: decoration
hoverEnabled: true
action: Kirigami.Action {
onTriggered: source => {
if (item.dragActive) { return }
if (!item.hasChildren) {
item.baseModel.trigger(item.index, "", null);
item.interactionConcluded()
} else {
item.openCategory(source instanceof KeyEvent)
}
}
}
function openActionMenu(x: real, y: real) : void {
const actionList = item.hasActionList ? item.actionList : [];
Tools.fillActionMenu(i18n, ActionMenu, actionList, item.favoritesModel, item.favoriteId);
if (!ActionMenu.actionList.length) {
return
}
ActionMenu.visualParent = item;
ActionMenu.delegate = item;
ActionMenu.open(x, y);
}
MouseArea {
id: mouseArea
anchors.fill: parent
acceptedButtons: Qt.RightButton
onPressed: mouse => {
if (item.hasActionList || item.favoriteId !== null) {
item.openActionMenu(mouse.x, mouse.y);
}
}
}
contentItem: null
Keys.onReturnPressed: event => action.trigger(event)
Keys.onEnterPressed: event => action.trigger(event)
Keys.onSpacePressed: event => action.trigger(event)
Keys.onMenuPressed: {
if (item.hasActionList || item.favoriteId !== null) {
item.openActionMenu()
}
}
}
@@ -0,0 +1,135 @@
/*
SPDX-FileCopyrightText: 2015 Eike Hein <hein@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Layouts
import org.kde.kirigami as Kirigami
import org.kde.ksvg as KSvg
import org.kde.plasma.components as PlasmaComponents3
ItemAbstractDelegate {
id: item
property alias iconSize: icon.implicitWidth
property int itemIndex: item.index
property var m: model
property bool showUnfavoritePlaceholder: false
property bool isDraggableFavorite: false
width: GridView.view.cellWidth
height: width
enabled: !item.disabled
favoritesModel: GridView.view.model.favoritesModel
baseModel: GridView.view.model
dragActive: dragHandler.active
Accessible.role: Accessible.MenuItem
Accessible.name: model.display ?? ""
DragHandler {
id: dragHandler
target: null
onActiveChanged: if (active) {
item.contentItem.grabToImage(function(result) {
item.Drag.imageSource = result.url
item.Drag.active = true
})
} else {
item.Drag.active = false
}
}
Drag.dragType: Drag.Automatic
Drag.mimeData: item.isDraggableFavorite ? {
'favoritedrag': '',
"text/uri-list" : [item.url]
} : {
"text/uri-list" : [item.url]
}
background.visible: false // we want the default background's spacing, but not the base color
contentItem: ColumnLayout {
spacing: Kirigami.Units.smallSpacing
visible: !item.showUnfavoritePlaceholder
Kirigami.Icon {
id: icon
Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom
implicitHeight: width
animated: false
source: item.model.decoration
Loader {
anchors {
right: parent.right
rightMargin: -item.rightPadding
top: parent.top
}
visible: active
active: item.isNewlyInstalled ?? false
sourceComponent: Kirigami.Badge {
text: i18nc("@label Newly-installed app, badge, keep short", "New!")
type: Kirigami.Badge.Type.Positive
Accessible.name: i18nc("@label Accessible name for badge", "Newly-installed application")
}
}
}
PlasmaComponents3.Label {
id: label
Layout.fillWidth: true
Layout.preferredHeight: label.lineCount === 1 ? label.implicitHeight * 2 : label.implicitHeight
horizontalAlignment: Text.AlignHCenter
maximumLineCount: 2
elide: Text.ElideMiddle
wrapMode: Text.Wrap
text: item.model.display ?? ""
textFormat: Text.PlainText
}
}
Loader {
active: item.showUnfavoritePlaceholder
anchors.fill: parent
sourceComponent: Item {
KSvg.FrameSvgItem {
anchors.fill: parent
imagePath: "widgets/viewitem"
prefix: "selected"
opacity: 0.5
Kirigami.Icon {
anchors.centerIn: parent
width: item.iconSize
height: width
source: "list-remove"
active: false
}
}
}
}
PlasmaComponents3.ToolTip {
text: item.model.description ?? ""
visible: item.hovered && !ActionMenu.opened
}
}
@@ -0,0 +1,373 @@
/*
SPDX-FileCopyrightText: 2015 Eike Hein <hein@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
pragma ComponentBehavior: Bound
import QtQuick
import org.kde.kirigami as Kirigami
import org.kde.ksvg as KSvg
import org.kde.plasma.components as PlasmaComponents
import org.kde.plasma.extras as PlasmaExtras
FocusScope {
id: itemGrid
signal keyNavLeft
signal keyNavRight
signal keyNavUp
signal keyNavDown
signal interactionConcluded()
property alias dropEnabled: dropAreaLoader.active
property bool hoverEnabled: true
property GridView view: gridView
property alias currentIndex: gridView.currentIndex
property alias currentItem: gridView.currentItem
property alias contentItem: gridView.contentItem
property alias count: gridView.count
property alias model: gridView.model
property alias cellWidth: gridView.cellWidth
property alias cellHeight: gridView.cellHeight
property alias iconSize: gridView.iconSize
onFocusChanged: {
if (!focus && !root.keyEventProxy.activeFocus) {
currentIndex = -1;
}
}
function currentRow() {
if (currentIndex === -1) {
return -1;
}
return Math.floor(currentIndex / Math.floor(width / itemGrid.cellWidth));
}
function currentCol() {
if (currentIndex === -1) {
return -1;
}
return currentIndex - (currentRow() * Math.floor(width / itemGrid.cellWidth));
}
function lastRow() {
var columns = Math.floor(width / itemGrid.cellWidth);
return Math.ceil(count / columns) - 1;
}
function tryActivate(row, col) {
if (count) {
var columns = Math.floor(width / itemGrid.cellWidth);
var rows = Math.ceil(count / columns);
row = Math.min(row, rows - 1);
col = Math.min(col, columns - 1);
currentIndex = Math.min(row ? ((Math.max(1, row) * columns) + col)
: col,
count - 1);
focus = true;
}
}
function forceLayout() {
gridView.forceLayout();
}
Loader {
id: dropAreaLoader
anchors.fill: parent
active: false
onActiveChanged: {
if (!active && "dropPlaceHolderIndex" in model) {
model.dropPlaceHolderIndex = -1;
}
}
sourceComponent : DropArea {
id: dropArea
anchors.fill: parent
onPositionChanged: event => {
let draggedItem = drag.source as ItemGridDelegate
if (gridView.animating || !draggedItem) {
return;
}
var x = Math.max(0, event.x - (width % itemGrid.cellWidth));
var cPos = mapToItem(gridView.contentItem, x, event.y);
var item = gridView.itemAt(cPos.x, cPos.y) as ItemGridDelegate;
if (item) {
if (draggedItem.parent === gridView.contentItem) {
if (item !== draggedItem) {
item.GridView.view.model.moveRow(draggedItem.itemIndex, item.itemIndex);
}
} else if (draggedItem.favoritesModel === itemGrid.model
&& !itemGrid.model.isFavorite(draggedItem.favoriteId)) {
var hasPlaceholder = (itemGrid.model.dropPlaceholderIndex !== -1);
itemGrid.model.dropPlaceholderIndex = item.itemIndex;
if (!hasPlaceholder) {
gridView.currentIndex = (item.itemIndex - 1);
}
}
} else if (draggedItem.parent !== gridView.contentItem
&& draggedItem.favoritesModel === itemGrid.model
&& !itemGrid.model.isFavorite(draggedItem.favoriteId)) {
var hasPlaceholder = (itemGrid.model.dropPlaceholderIndex !== -1);
itemGrid.model.dropPlaceholderIndex = hasPlaceholder ? itemGrid.model.count - 1 : itemGrid.model.count;
if (!hasPlaceholder) {
gridView.currentIndex = (itemGrid.model.count - 1);
}
} else {
itemGrid.model.dropPlaceholderIndex = -1;
gridView.currentIndex = -1;
}
}
onExited: {
if ("dropPlaceholderIndex" in itemGrid.model) {
itemGrid.model.dropPlaceholderIndex = -1;
gridView.currentIndex = -1;
}
}
onDropped: drop => {
let draggedItem = drag.source as ItemGridDelegate
if (draggedItem && draggedItem.parent !== gridView.contentItem && draggedItem.favoritesModel === itemGrid.model) {
itemGrid.model.addFavorite(draggedItem.favoriteId, itemGrid.model.dropPlaceholderIndex);
gridView.currentIndex = -1;
drop.accept(Qt.CopyAction)
} else if (draggedItem && draggedItem.parent !== gridView.contentItem && draggedItem.favoritesModel.isFavorite(draggedItem.favoriteId)) {
draggedItem.showUnfavoritePlaceholder = true
draggedItem.favoritesModel.removeFavorite(draggedItem.favoriteId)
drop.accept(Qt.MoveAction)
} else if (draggedItem && draggedItem.parent === gridView.contentItem) {
drop.accept(Qt.MoveAction)
}
}
}
}
Timer {
id: resetAnimationDurationTimer
interval: 120
repeat: false
onTriggered: {
gridView.animationDuration = interval - 20;
}
}
PlasmaComponents.ScrollView {
id: scrollArea
anchors.fill: parent
focus: true
PlasmaComponents.ScrollBar.horizontal.policy: PlasmaComponents.ScrollBar.AlwaysOff
GridView {
id: gridView
signal itemContainsMouseChanged(bool containsMouse)
property int iconSize: Kirigami.Units.iconSizes.huge
property bool animating: false
property int animationDuration: itemGrid.dropEnabled ? resetAnimationDurationTimer.interval : 0
focus: true
clip: height < contentHeight + topMargin + bottomMargin
currentIndex: -1
move: Transition {
enabled: itemGrid.dropEnabled
SequentialAnimation {
PropertyAction { target: gridView; property: "animating"; value: true }
NumberAnimation {
duration: gridView.animationDuration
properties: "x, y"
easing.type: Easing.OutQuad
}
PropertyAction { target: gridView; property: "animating"; value: false }
}
}
moveDisplaced: Transition {
enabled: itemGrid.dropEnabled
SequentialAnimation {
PropertyAction { target: gridView; property: "animating"; value: true }
NumberAnimation {
duration: gridView.animationDuration
properties: "x, y"
easing.type: Easing.OutQuad
}
PropertyAction { target: gridView; property: "animating"; value: false }
}
}
keyNavigationWraps: false
boundsBehavior: Flickable.StopAtBounds
delegate: ItemGridDelegate {
iconSize: gridView.iconSize
onInteractionConcluded: itemGrid.interactionConcluded()
hoverEnabled: itemGrid.hoverEnabled
onHoveredChanged: {
if (hovered && !ActionMenu.opened) {
gridView.currentIndex = index
} else if (GridView.isCurrentItem && !ActionMenu.opened) {
gridView.currentIndex = -1;
}
}
isDraggableFavorite: itemGrid.dropEnabled
showUnfavoritePlaceholder: Drag.active && itemGrid.dropEnabled && !(dropAreaLoader.item as DropArea).containsDrag
}
Connections {
target: ActionMenu
enabled: !!gridView.currentItem
function onClosed() {
if ((!gridView.currentItem as ItemGridDelegate)?.hovered) {
gridView.currentIndex = -1;
}
}
}
highlight: Item {
id: highlightItem
property bool isDropPlaceHolder: "dropPlaceholderIndex" in itemGrid.model && itemGrid.currentIndex === itemGrid.model.dropPlaceholderIndex
PlasmaExtras.Highlight {
visible: gridView.currentItem && !highlightItem.isDropPlaceHolder
hovered: true
pressed: (gridView.currentItem as ItemGridDelegate)?.pressed ?? false
anchors.fill: parent
}
KSvg.FrameSvgItem {
visible: gridView.currentItem && highlightItem.isDropPlaceHolder
anchors.fill: parent
imagePath: "widgets/viewitem"
prefix: "selected"
opacity: 0.5
Kirigami.Icon {
anchors.centerIn: parent
width: gridView.iconSize
height: width
source: "list-add"
active: false
}
}
}
highlightFollowsCurrentItem: true
highlightMoveDuration: 0
onCurrentIndexChanged: {
if (currentIndex !== -1) {
focus = true;
}
}
onCountChanged: {
animationDuration = 0;
resetAnimationDurationTimer.start();
}
onModelChanged: {
currentIndex = -1;
}
function handleLeftRightArrow(event: KeyEvent) : void {
let backArrowKey = (event.key === Qt.Key_Left && Application.layoutDirection === Qt.LeftToRight) ||
(event.key === Qt.Key_Right && Application.layoutDirection === Qt.RightToLeft)
let forwardArrowKey = (event.key === Qt.Key_Right && Application.layoutDirection === Qt.LeftToRight) ||
(event.key === Qt.Key_Left && Application.layoutDirection === Qt.RightToLeft)
if (backArrowKey) {
if (itemGrid.currentCol() !== 0) {
// GridView move..() already handles RtL
(event.key === Qt.Key_Left) ? moveCurrentIndexLeft() : moveCurrentIndexRight();
} else {
itemGrid.keyNavLeft();
}
} else if (forwardArrowKey) {
var columns = Math.floor(width / cellWidth);
if (itemGrid.currentCol() !== columns - 1 && currentIndex !== count -1) {
// GridView move..() already handles RtL
(event.key === Qt.Key_Left) ? moveCurrentIndexLeft() : moveCurrentIndexRight()
} else {
itemGrid.keyNavRight();
}
}
}
Keys.onLeftPressed: event => handleLeftRightArrow(event)
Keys.onRightPressed: event => handleLeftRightArrow(event)
Keys.onEnterPressed: Keys.returnPressed()
Keys.onReturnPressed: {
if (gridView.model.trigger) {
gridView.model.trigger(currentIndex, "", null)
itemGrid.interactionConcluded()
}
}
Keys.onUpPressed: event => {
if (itemGrid.currentRow() !== 0) {
event.accepted = true;
moveCurrentIndexUp();
positionViewAtIndex(currentIndex, GridView.Contain);
} else {
itemGrid.keyNavUp();
}
}
Keys.onDownPressed: event => {
if (itemGrid.currentRow() < itemGrid.lastRow()) {
// Fix moveCurrentIndexDown()'s lack of proper spatial nav down
// into partial columns.
event.accepted = true;
var columns = Math.floor(width / cellWidth);
var newIndex = currentIndex + columns;
currentIndex = Math.min(newIndex, count - 1);
positionViewAtIndex(currentIndex, GridView.Contain);
} else {
itemGrid.keyNavDown();
}
}
TapHandler {
onTapped: itemGrid.interactionConcluded()
}
}
}
}
@@ -0,0 +1,177 @@
/*
SPDX-FileCopyrightText: 2013-2015 Eike Hein <hein@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Layouts
import org.kde.kirigami as Kirigami
import org.kde.ksvg as KSvg
import org.kde.plasma.components as PlasmaComponents3
import org.kde.plasma.private.kicker as Kicker
import org.kde.plasma.core as PlasmaCore
import org.kde.plasma.plasmoid
ItemAbstractDelegate {
id: item
required property bool showIcons
property bool showDescriptionInTooltip: false
property alias containsMouse: toolTipArea.containsMouse
readonly property bool iconAndLabelsShouldlookSelected: pressed && !hasChildren
width: ListView.view.width
height: implicitHeight
// if it's not disabled and is either a leaf node or a node with children
enabled: !isSeparator && !disabled && (!isParent || (isParent && hasChildren))
hoverEnabled: false // containsMouse is more robust if the tooltip covers delegates
favoritesModel: ListView.view.model.favoritesModel
baseModel: ListView.view.model
dragActive: dragHandler.active
Accessible.role: isSeparator ? Accessible.Separator : Accessible.ListItem
Accessible.description: isParent
? i18nc("@action:inmenu accessible description for opening submenu", "Open category")
: i18nc("@action:inmenu accessible description for opening app or file", "Launch")
onHasChildrenChanged: {
if (!hasChildren && ListView.view.currentItem === item) {
ListView.view.currentIndex = -1;
}
}
contentItem: RowLayout {
id: row
spacing: Kirigami.Units.smallSpacing * 2
LayoutMirroring.enabled: (Application.layoutDirection === Qt.RightToLeft)
Kirigami.Icon {
id: icon
Layout.alignment: Qt.AlignVCenter
implicitWidth: Kirigami.Units.iconSizes.small
implicitHeight: implicitWidth
visible: item.showIcons & !item.isSeparator
animated: false
selected: item.iconAndLabelsShouldlookSelected
source: item.model.decoration
}
PlasmaComponents3.Label {
id: label
enabled: !item.isParent || (item.isParent && item.hasChildren)
LayoutMirroring.enabled: (Application.layoutDirection === Qt.RightToLeft)
visible: !item.isSeparator
Layout.fillWidth: true
Layout.alignment: Qt.AlignVCenter
verticalAlignment: Text.AlignVCenter
textFormat: Text.PlainText
wrapMode: Text.NoWrap
elide: Text.ElideRight
color: item.iconAndLabelsShouldlookSelected ? Kirigami.Theme.highlightedTextColor : Kirigami.Theme.textColor
text: item.model.display ?? ""
}
Loader {
visible: active
active: item.isNewlyInstalled ?? false
sourceComponent: Kirigami.Badge {
text: item.hasChildren ? "" : Accessible.name
type: Kirigami.Badge.Type.Positive
Accessible.name: i18nc("Newly-installed app, badge, keep short", "New!") // qmllint disable unqualified
Accessible.description: item.hasChildren ? i18nc("@info:whatsthis Accessible description for badge", "There is a newly-installed application in this category") // qmllint disable unqualified
: i18nc("@info:whatsthis Accessible description for badge", "Newly-installed application") // qmllint disable unqualified
}
}
Kirigami.Icon {
id: arrow
Layout.alignment: Qt.AlignVCenter
implicitWidth: visible ? Kirigami.Units.iconSizes.small : 0
implicitHeight: implicitWidth
visible: item.hasChildren && !item.isSeparator
opacity: (item.ListView.view.currentIndex === item.index) ? 1.0 : 0.4
selected: item.iconAndLabelsShouldlookSelected
source: item.dialogDefaultRight
? "go-next-symbolic"
: "go-next-rtl-symbolic"
}
Loader {
id: separatorLoader
Layout.alignment: Qt.AlignVCenter
Layout.fillWidth: true
active: item.isSeparator
visible: active
asynchronous: false
sourceComponent: separatorComponent
}
}
DragHandler {
id: dragHandler
target: null
onActiveChanged: {
if (active && item.url) {
// we need dragHelper and can't use attached Drag; submenus are destroyed too soon and Plasma crashes
if (!item.favoriteId) {
dragHelper.startDrag(kicker, item.url, item.decoration)
} else {
let type = item.favoritesModel instanceof Kicker.SimpleFavoritesModel
? "text/xx-kicker-simplefavorite-id"
: "text/xx-kicker-kastatsfavorite-id"
dragHelper.startDrag(kicker, item.url, item.decoration,
type, item.favoriteId)
}
}
}
}
Component {
id: separatorComponent
KSvg.SvgItem {
width: parent.width
imagePath: "widgets/line"
elementId: "horizontal-line"
}
}
PlasmaCore.ToolTipArea {
id: toolTipArea
// needs to be ToolTipArea, as ItemListDialog will clip (attached) ToolTip if the submenu
// has very few entries (and makes it feel glitchy then)
anchors.fill: parent
active: label.truncated || item.showDescriptionInTooltip
mainText: {
// if it's name (description) or description (name), we split them on separate lines
// but only if the compactName is available (e.g. for search results it's not)
let name = (Plasmoid.configuration.appNameFormat > 1 && item.compactName.length > 1) ? item.compactName : item.text
return label.truncated ? name ?? "" : ""
}
subText: item.showDescriptionInTooltip || Plasmoid.configuration.appNameFormat > 1 ? item.description ?? "" : ""
}
}
@@ -0,0 +1,91 @@
/*
SPDX-FileCopyrightText: 2013-2014 Eike Hein <hein@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Layouts
import org.kde.kirigami as Kirigami
import org.kde.plasma.core as PlasmaCore
import org.kde.plasma.plasmoid
import org.kde.plasma.private.kicker as Kicker
Kicker.SubMenu {
id: itemDialog
property alias model: funnelModel.sourceModel
property int index: -1
property bool aboutToBeDestroyed: false
property alias mainSearchField: itemListView.mainSearchField
signal interactionConcluded
visible: false
backgroundHints: Plasmoid.containmentDisplayHints & PlasmaCore.Types.ContainmentPrefersOpaqueBackground ? PlasmaCore.Dialog.SolidBackground : PlasmaCore.Dialog.StandardBackground
location: PlasmaCore.Types.Floating
offset: 0 // slightly overlap submenu to match QtWidgets menu behavior
LayoutMirroring.enabled: dialogMirrored
onWindowDeactivated: {
if (!aboutToBeDestroyed) {
interactionConcluded()
}
}
mainItem: ItemListView {
id: itemListView
height: implicitHeight
width: Math.min(Math.max(Layout.minimumWidth, implicitWidth), Layout.maximumWidth)
hoverEnabled: !hoverBlock.enabled
iconsEnabled: true
LayoutMirroring.enabled: itemDialog.LayoutMirroring.enabled
// force tooltip for recent files - the path is relevant no matter the display setting
showDescriptionInTooltip: (funnelModel.sourceModel as Kicker.RecentUsageModel)?.shownItems === Kicker.RecentUsageModel.OnlyDocs
dialog: itemDialog
model: funnelModel
onInteractionConcluded: itemDialog.interactionConcluded()
Kicker.FunnelModel {
id: funnelModel
property bool sorted: sourceModel?.sorted ?? false
Component.onCompleted: {
kicker.reset.connect(funnelModel.reset);
}
onCountChanged: {
if (sourceModel && count === 0) {
itemDialog.delayedDestroy();
}
}
onSourceModelChanged: {
hoverBlock.reset()
itemListView.currentIndex = -1;
itemListView.resetDelegateSizing();
}
}
HoverBlocker {
id: hoverBlock
anchors.fill: parent
z: 10
}
}
function delayedDestroy() {
aboutToBeDestroyed = true;
Qt.callLater(() => itemDialog.destroy());
}
}
@@ -0,0 +1,299 @@
/*
SPDX-FileCopyrightText: 2013-2014 Eike Hein <hein@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Layouts
import org.kde.kirigami as Kirigami
import org.kde.plasma.components as PlasmaComponents3
import org.kde.plasma.extras as PlasmaExtras
import org.kde.plasma.private.kicker as Kicker
PlasmaComponents3.ScrollView {
id: itemList
signal exited
signal keyNavigationAtListEnd
signal navigateLeftRequested
signal navigateRightRequested
signal interactionConcluded
property Item mainSearchField: null
property Kicker.SubMenu dialog: null
property Kicker.SubMenu childDialog: null
property bool iconsEnabled: false
property bool dynamicResize : true
property bool showDescriptionInTooltip: false
property int innerLeftMargin: 0
property int innerRightMargin: 0
property alias currentIndex: listView.currentIndex
property alias currentItem: listView.currentItem
property alias keyNavigationWraps: listView.keyNavigationWraps
property alias model: listView.model
property alias count: listView.count
property alias resetOnExitDelay: resetIndexTimer.interval
implicitWidth: listView.implicitWidth + leftPadding + rightPadding
implicitHeight: listView.contentHeight + topPadding + bottomPadding
Layout.minimumWidth: Kirigami.Units.gridUnit * 14
Layout.maximumWidth: Math.round(Layout.minimumWidth * 1.5)
Layout.maximumHeight: contentHeight
PlasmaComponents3.ScrollBar.horizontal.policy: PlasmaComponents3.ScrollBar.AlwaysOff
function resetDelegateSizing() { // only needed when submenus are reused, called from ItemListDialog
listView.maxDelegateImplicitWidth = 0
}
function subMenuForCurrentItem() {
if (!kicker.expanded || !itemList.model || itemList.currentIndex === -1 || ActionMenu.opened) {
return;
}
if (itemList && !(itemList.currentItem as ItemListDelegate).hasChildren) {
clearChildDialog();
} else if (!itemList.childDialog) {
itemList.childDialog = itemListDialogComponent.createObject(itemList, {
mainSearchField: mainSearchField,
visualParent: listView.currentItem,
model: model.modelForRow(listView.currentIndex),
visible: Qt.binding(() => itemList.Window.window.visible),
dialogMirrored: itemList.LayoutMirroring.enabled
});
itemList.childDialog.index = listView.currentIndex;
(itemList.childDialog as ItemListDialog).interactionConcluded.connect(itemList.interactionConcluded)
itemList.childDialog.mainItem.forceActiveFocus(Qt.TabFocusReason)
windowSystem.forceActive(itemList.childDialog.mainItem); // only for X11; TODO Plasma 6.8: remove
} else {
itemList.childDialog.model = model.modelForRow(itemList.currentIndex);
itemList.childDialog.visualParent = listView.currentItem;
itemList.childDialog.index = listView.currentIndex;
}
}
function clearChildDialog() {
if (childDialog) {
childDialog.delayedDestroy()
childDialog = null
}
}
Keys.priority: Keys.AfterItem
Keys.forwardTo: [itemList.mainSearchField]
onHoveredChanged: {
const parentItem = itemList.dialog?.visualParent as ItemListDelegate
if (hovered && parentItem) {
parentItem.ListView.view.currentIndex = parentItem.index
}
Qt.callLater( () =>{
if (ActionMenu.opened) {
return
} else if (hovered) {
resetIndexTimer.stop();
} else {
resetIndexTimer.start();
}
})
}
ListView {
id: listView
width: itemList.availableWidth
implicitHeight: contentHeight
implicitWidth: itemList.Layout.minimumWidth
anchors {
top: parent.top
left: parent.left
leftMargin: itemList.innerLeftMargin
}
property int maxDelegateImplicitWidth: 0 // used to set implicitWidth
Binding on implicitWidth {
value: listView.maxDelegateImplicitWidth
when: listView.maxDelegateImplicitWidth > 0 && itemList.dynamicResize
}
currentIndex: -1
focus: true
clip: height < contentHeight + topMargin + bottomMargin
boundsBehavior: Flickable.StopAtBounds
snapMode: ListView.SnapToItem
spacing: 0
keyNavigationEnabled: false
Binding on cacheBuffer {
when: itemList.dynamicResize
value: 10000 // load more delegates, to get their width right
}
Accessible.name: itemList.Accessible.name
Accessible.role: Accessible.List
delegate: ItemListDelegate {
width: listView.width - itemList.innerRightMargin
anchors.left: listView.contentItem.left
showIcons: itemList.iconsEnabled
showDescriptionInTooltip: itemList.showDescriptionInTooltip
dialogDefaultRight: !itemList.LayoutMirroring.enabled
onInteractionConcluded: itemList.interactionConcluded()
onOpenCategory: keyboardInitiated => {
listView.currentIndex = index
listView.openOrFocusSubmenu()
if (keyboardInitiated) { itemList.childDialog.mainItem.currentIndex = 0; }
}
onContainsMouseChanged: {
if (containsMouse && itemList.hoverEnabled && !isSeparator && !ActionMenu.opened) {
listView.currentIndex = index
itemList.forceActiveFocus()
dialogSpawnTimer.restart()
} else if (listView.currentIndex === index) {
dialogSpawnTimer.stop()
}
}
onImplicitWidthChanged: {
listView.maxDelegateImplicitWidth = Math.max(listView.maxDelegateImplicitWidth, implicitWidth)
}
}
highlight: PlasmaExtras.Highlight {
anchors.left: listView.contentItem.left
visible: !(listView.currentItem as ItemListDelegate)?.isSeparator
pressed: !!((listView.currentItem as ItemListDelegate)?.iconAndLabelsShouldlookSelected)
active: !!(listView.currentItem as ItemListDelegate)?.hovered
}
highlightMoveDuration: 0
onCountChanged: {
if (currentIndex == 0 && !itemList.mainSearchField.activeFocus) {
currentItem?.forceActiveFocus();
} else {
currentIndex = -1;
}
}
onCurrentIndexChanged: {
if (currentIndex === itemList.childDialog?.index) {
return;
} else if (currentIndex === -1 || !(currentItem as ItemListDelegate)?.hasChildren || !kicker.expanded) {
dialogSpawnTimer.stop();
itemList.clearChildDialog();
} else if (itemList.childDialog) {
dialogSpawnTimer.restart();
}
}
Connections {
target: ActionMenu
function onClosed() {
resetIndexTimer.restart()
}
}
function openOrFocusSubmenu() : void {
if (itemList.childDialog === null) {
itemList.subMenuForCurrentItem();
} else {
windowSystem.forceActive(itemList.childDialog.mainItem); // only for X11; TODO Plasma 6.8: remove
itemList.childDialog.requestActivate()
itemList.childDialog.mainItem.forceActiveFocus(Qt.TabFocusReason);
}
}
function handleLeftRightArrow(event: KeyEvent) : void {
let backArrowKey = (event.key === Qt.Key_Left && !itemList.LayoutMirroring.enabled) ||
(event.key === Qt.Key_Right && itemList.LayoutMirroring.enabled)
let forwardArrowKey = (event.key === Qt.Key_Right && !itemList.LayoutMirroring.enabled) ||
(event.key === Qt.Key_Left && itemList.LayoutMirroring.enabled)
if (backArrowKey) {
if (itemList.dialog != null) {
itemList.dialog.destroy();
} else {
itemList.navigateLeftRequested();
}
} else if (forwardArrowKey) {
if (listView.currentItem !== null && (listView.currentItem as ItemListDelegate).hasChildren) {
openOrFocusSubmenu()
itemList.childDialog.mainItem.currentIndex = 0;
}
}
}
function handleUpDownArrow(event: KeyEvent) : void {
let moveIndex = (event.key === Qt.Key_Up) ? listView.decrementCurrentIndex : listView.incrementCurrentIndex
if (!listView.keyNavigationWraps && ((event.key === Qt.Key_Up && listView.currentIndex == 0) ||
(event.key === Qt.Key_Down && listView.currentIndex == listView.count - 1))) {
itemList.keyNavigationAtListEnd();
} else {
moveIndex();
if (listView.currentItem !== null) {
if ((listView.currentItem as ItemListDelegate).isSeparator) {
moveIndex();
}
listView.currentItem.forceActiveFocus(Qt.TabFocusReason);
}
}
}
Keys.onLeftPressed: event => handleLeftRightArrow(event)
Keys.onRightPressed: event => handleLeftRightArrow(event)
Keys.onUpPressed: event => handleUpDownArrow(event)
Keys.onDownPressed: event => handleUpDownArrow(event)
Keys.onEscapePressed: itemList.interactionConcluded()
Keys.onPressed: event => {
if (event.key !== Qt.Key_Tab && event.text !== "") {
itemList.mainSearchField?.forceActiveFocus(Qt.ShortcutFocusReason);
}
}
Timer {
id: dialogSpawnTimer
interval: 100
repeat: false
onTriggered: itemList.subMenuForCurrentItem()
}
Timer {
id: resetIndexTimer
interval: (itemList.dialog != null) ? 50 : 150
repeat: false
onTriggered: {
if (itemList.focus && !(itemList.childDialog?.mainItem as ItemListView)?.hovered) {
itemList.currentIndex = -1;
itemList.exited();
}
}
}
Connections {
target: itemList.childDialog?.mainItem ?? null
function onHoveredChanged() {
const childListView = itemList.childDialog?.mainItem as ItemListView
if (childListView.hovered) {
resetIndexTimer.stop()
}
}
}
}
}
@@ -0,0 +1,269 @@
/*
SPDX-FileCopyrightText: 2015 Eike Hein <hein@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
pragma ComponentBehavior: Bound
import QtQuick
import org.kde.kirigami as Kirigami
import org.kde.ksvg as KSvg
import org.kde.plasma.components as PlasmaComponents
import org.kde.plasma.private.kicker as Kicker
PlasmaComponents.ScrollView {
id: itemMultiGrid
signal interactionConcluded()
anchors {
top: parent.top
}
width: parent.width
implicitHeight: itemColumn.implicitHeight
signal keyNavLeft(int subGridIndex)
signal keyNavRight(int subGridIndex)
signal keyNavUp()
signal keyNavDown()
property int cellSize
property int iconSize
property alias model: repeater.model
property alias count: repeater.count
property alias flickableItem: flickable
property ItemGridView firstGrid
function subGridAt(index) {
let subgrid = repeater.itemAt(index)
if (subgrid) {
return subgrid.itemGrid
}
}
function selectFirstElement() {
let foundAny = false
for (var i = 0; i < repeater.count; i++) {
let grid = subGridAt(i)
if (grid && grid.count > 0) {
if (!foundAny) {
itemMultiGrid.firstGrid = grid
grid.currentIndex = 0
foundAny = true
} else {
grid.currentIndex = -1
}
}
}
}
function tryActivate(row, col) { // FIXME TODO: Cleanup messy algo.
if (flickable.contentY > 0) {
row = 0;
}
var target = null;
var rows = 0;
for (var i = 0; i < repeater.count; i++) {
var grid = subGridAt(i);
if (rows <= row) {
target = grid;
rows += grid.lastRow() + 2; // Header counts as one.
} else {
break;
}
}
if (target) {
rows -= (target.lastRow() + 2);
target.tryActivate(row - rows, col);
}
}
onFocusChanged: {
if (!focus) {
for (var i = 0; i < repeater.count; i++) {
subGridAt(i).focus = false;
}
}
}
Flickable {
id: flickable
flickableDirection: Flickable.VerticalFlick
contentHeight: itemColumn.implicitHeight
Column {
id: itemColumn
width: itemMultiGrid.width - Kirigami.Units.gridUnit
Repeater {
id: repeater
delegate: Item {
id: gridDelegate
required property int index
width: itemColumn.width - Kirigami.Units.gridUnit
height: headerHeight + gridView.height + (index == repeater.count - 1 ? 0 : footerHeight)
readonly property int headerHeight: (gridViewLabel.height
+ gridViewLabelUnderline.height + Kirigami.Units.gridUnit)
readonly property int footerHeight: (Math.ceil(headerHeight / itemMultiGrid.cellSize) * itemMultiGrid.cellSize) - headerHeight
property alias itemGrid: gridView
visible: gridView.count > 0
Kirigami.Heading {
id: gridViewLabel
anchors.top: parent.top
x: Kirigami.Units.smallSpacing
width: parent.width - x
height: dummyHeading.height
elide: Text.ElideRight
wrapMode: Text.NoWrap
opacity: 1.0
color: "white" // FIXME TODO: Respect theming?
level: 1
text: repeater.model.modelForRow(gridDelegate.index).description
textFormat: Text.PlainText
}
KSvg.SvgItem {
id: gridViewLabelUnderline
anchors.top: gridViewLabel.bottom
width: parent.width - Kirigami.Units.gridUnit
imagePath: "widgets/line"
elementId: "horizontal-line"
}
TapHandler {
onTapped: itemMultiGrid.interactionConcluded()
}
ItemGridView {
id: gridView
anchors {
top: gridViewLabelUnderline.bottom
topMargin: Kirigami.Units.gridUnit
}
width: parent.width
height: Math.ceil(count / Math.floor(width / itemMultiGrid.cellSize)) * itemMultiGrid.cellSize
cellWidth: itemMultiGrid.cellSize
cellHeight: itemMultiGrid.cellSize
iconSize: itemMultiGrid.iconSize
hoverEnabled: itemMultiGrid.hoverEnabled
model: repeater.model.modelForRow(gridDelegate.index)
onFocusChanged: {
if (focus) {
itemMultiGrid.focus = true;
}
}
onInteractionConcluded: itemMultiGrid.interactionConcluded()
onCountChanged: itemMultiGrid.selectFirstElement()
onCurrentItemChanged: {
if (!currentItem) {
return;
}
if (gridDelegate.index == 0 && currentRow() === 0) {
flickable.contentY = 0;
return;
}
var y = currentItem.y;
y = contentItem.mapToItem(flickable.contentItem, 0, y).y;
if (y < flickable.contentY) {
flickable.contentY = y;
} else {
y += itemMultiGrid.cellSize;
y -= flickable.contentY;
y -= itemMultiGrid.height;
if (y > 0) {
flickable.contentY += y;
}
}
}
onKeyNavLeft: {
itemMultiGrid.keyNavLeft(gridDelegate.index);
currentIndex = -1
}
onKeyNavRight: {
itemMultiGrid.keyNavRight(gridDelegate.index);
currentIndex = -1
}
onKeyNavUp: {
if (gridDelegate.index > 0) {
for (var i = gridDelegate.index - 1; i >= 0; i--) {
if (itemMultiGrid.subGridAt(i).count > 0) {
itemMultiGrid.subGridAt(i).tryActivate(itemMultiGrid.subGridAt(i).lastRow(), currentCol());
break;
}
}
} else {
itemMultiGrid.keyNavUp();
}
currentIndex = -1
}
onKeyNavDown: {
if (gridDelegate.index < repeater.count - 1) {
for (var i = gridDelegate.index + 1; i < repeater.count; i++) {
if (itemMultiGrid.subGridAt(i).count > 0) {
itemMultiGrid.subGridAt(i).tryActivate(0, currentCol());
break;
}
}
} else {
itemMultiGrid.keyNavDown();
}
currentIndex = -1
}
Keys.onBacktabPressed: event => {
currentIndex = -1
event.accepted = false // pass to mainColumn handler
}
}
// HACK: Steal wheel events from the nested grid view and forward them to
// the ScrollView's internal WheelArea.
Kicker.WheelInterceptor {
anchors.fill: gridView
z: 1
destination: findWheelArea(itemMultiGrid)
}
}
}
}
}
}
@@ -0,0 +1,564 @@
/*
SPDX-FileCopyrightText: 2013-2015 Eike Hein <hein@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Layouts
import org.kde.kirigami as Kirigami
import org.kde.ksvg as KSvg
import org.kde.plasma.components as PlasmaComponents3
import org.kde.plasma.core as PlasmaCore
import org.kde.plasma.extras as PlasmaExtras
import org.kde.plasma.plasmoid
import org.kde.plasma.private.kicker as Kicker
PlasmaComponents3.ScrollView {
id: root
required property Kicker.KAStatsFavoritesModel globalFavorites
required property Kicker.SimpleFavoritesModel systemFavorites
required property Kicker.RootModel rootModel
required property Kicker.RunnerModel runnerModel
signal interactionConcluded
focus: true
// we never want a vertical scrollbar, the components handle those.
PlasmaComponents3.ScrollBar.vertical.policy: PlasmaComponents3.ScrollBar.AlwaysOff
// needs to be set explicitly as the default can cause loops
PlasmaComponents3.ScrollBar.horizontal.visible: Screen.width > 0 && contentWidth > (Screen.width - Kirigami.Units.largeSpacing * 4)
// ScrollBar's padding is only to make space for the scrollbar, so we don't need it here
Layout.minimumWidth: Math.min(Math.max(mainRow.Layout.minimumWidth, mainRow.implicitWidth), Screen.width - Kirigami.Units.largeSpacing * 4)
Layout.maximumWidth: Layout.minimumWidth
contentWidth: mainRow.implicitWidth
Layout.minimumHeight: Math.min(Math.max(sideBar.implicitHeight, rootList.implicitHeight + rootList.Layout.bottomMargin), Math.round(Screen.height * 0.9)) + topPadding + bottomPadding
Layout.maximumHeight: Layout.minimumHeight
function ensureVisible(item: Item) : void {
const actualItemX = item.x
const viewXPosition = (item.width <= contentItem.width)
? Math.round(actualItemX + item.width / 2 - contentItem.width / 2)
: actualItemX
const flickable = contentItem as Flickable
if (actualItemX < flickable.contentX) {
flickable.contentX = Math.max(0, viewXPosition)
} else if ((actualItemX + item.width) > (flickable.contentX + flickable.width)) {
flickable.contentX = Math.min(flickable.contentWidth - flickable.width, viewXPosition)
}
flickable.returnToBounds()
}
function focusRunnerColumn(column, focusTopElement = true) : void {
if (runnerColumns.visibleChildren.length <= column + 1) { // visibleChildren includes repeater
return
}
const targetList = runnerColumns.visibleChildren[column]
targetList.currentIndex = focusTopElement ? 0 : (targetList.count - 1)
targetList.giveFocus(Qt.TabFocusReason)
root.ensureVisible(targetList)
}
function focusRootList(focusTopElement = true) : void {
rootList.currentIndex = focusTopElement ? 0 : (rootList.model.count - 1)
rootList.forceActiveFocus(Qt.TabFocusReason)
}
function focusSideBar() : void {
sideBar.forceActiveFocus(Qt.TabFocusReason)
root.ensureVisible(sideBar)
}
function reset() {
rootList.currentIndex = -1;
hoverBlock.reset();
searchField.text = "";
searchField.focus = true;
}
DropArea {
id: unfavoriteDropArea
anchors.fill: parent
keys: ["favoritedrag"]
onDropped: drop => {
let draggedItem = drag.source as SideBarItem
if (draggedItem && draggedItem.favoritesModel.isFavorite(draggedItem.favoriteId)) {
draggedItem.showUnfavoritePlaceholder = true
draggedItem.favoritesModel.removeFavorite(draggedItem.favoriteId)
drop.accept(Qt.MoveAction)
}
}
}
RowLayout {
id: mainRow
anchors.fill: parent
spacing: 0
readonly property int minimumMainWidth: Math.max(searchField.defaultWidth, root.runnerModel.resultsPresent ? 0 : Math.min(rootList.implicitWidth, rootList.Layout.maximumWidth))
Layout.minimumWidth: (sideBar.visible ? sideBar.implicitWidth + sideBar.Layout.rightMargin : 0) + minimumMainWidth
LayoutMirroring.enabled: ((Plasmoid.location === PlasmaCore.Types.RightEdge)
|| (Application.layoutDirection === Qt.RightToLeft && Plasmoid.location !== PlasmaCore.Types.LeftEdge))
KSvg.FrameSvgItem {
id: sideBar
readonly property real innerMargin: 2
readonly property bool onTopPanel: Plasmoid.location === PlasmaCore.Types.TopEdge
visible: (root.globalFavorites.count + root.systemFavorites.count) > 0
Layout.fillHeight: true
Layout.rightMargin: Kirigami.Units.smallSpacing
implicitWidth: Math.max(favoriteApps.implicitWidth, favoriteSystemActions.implicitWidth) + margins.left + margins.right + sideBarScrollView.leftPadding + sideBarScrollView.rightPadding
implicitHeight: sideBarLayout.implicitHeight + margins.top + margins.bottom
imagePath: "widgets/frame"
prefix: "plain"
function handleLeftRightArrow(event: KeyEvent) : void {
let backArrowKey = (event.key === Qt.Key_Left && !mainRow.LayoutMirroring.enabled) ||
(event.key === Qt.Key_Right && mainRow.LayoutMirroring.enabled)
let forwardArrowKey = (event.key === Qt.Key_Right && !mainRow.LayoutMirroring.enabled) ||
(event.key === Qt.Key_Left && mainRow.LayoutMirroring.enabled)
if (backArrowKey & runnerColumns.visibleChildren.length > 1) {
root.focusRunnerColumn(runnerColumns.visibleChildren.length - 2, true)
} else if (forwardArrowKey) {
if (runnerColumns.visibleChildren.length > 1) {
root.focusRunnerColumn(0, true)
} else if (rootList.visible) {
root.focusRootList(true)
} else {
searchField.forceActiveFocus(Qt.TabFocusReason)
}
} else {
event.accepted = false
}
}
activeFocusOnTab: true
onActiveFocusChanged: if (activeFocus) {
let target = (onTopPanel && favoriteSystemActions.model.count) ? favoriteSystemActions : favoriteApps
target.forceActiveFocus(Qt.TabFocusReason)
}
KeyNavigation.right: rootList
PlasmaComponents3.ScrollView {
id: sideBarScrollView
anchors {
fill: parent
topMargin: sideBar.innerMargin
bottomMargin: sideBar.innerMargin
}
PlasmaComponents3.ScrollBar.horizontal.policy: PlasmaComponents3.ScrollBar.AlwaysOff
PlasmaComponents3.ScrollBar.vertical.visible: Screen.height > 0 && sideBarScrollView.contentHeight > Math.round(Screen.height * 0.9)
contentWidth: availableWidth
contentHeight: Math.max(sideBarLayout.implicitHeight + sideBarLayout.anchors.topMargin + sideBarLayout.anchors.bottomMargin, sideBar.height - 2 * sideBar.innerMargin)
function ensureVisible(item: Item) {
let flickable = (contentItem as Flickable)
let actualItemY = flickable.mapFromItem(item, 0, 0).y
let viewYPosition = (item.height <= contentItem.height)
? Math.round(actualItemY + item.height / 2 - contentItem.height / 2)
: actualItemY
if (actualItemY < flickable.contentY) {
flickable.contentY = Math.max(0, viewYPosition)
} else if ((actualItemY + item.height) > (flickable.contentY + flickable.height)) {
flickable.contentY = Math.min(flickable.contentHeight - flickable.height, viewYPosition)
}
flickable.returnToBounds()
}
ColumnLayout {
id: sideBarLayout
anchors {
fill: parent
topMargin: sideBar.margins.top - sideBar.innerMargin
leftMargin: sideBar.margins.left
rightMargin: sideBar.margins.right
bottomMargin: sideBar.margins.bottom - sideBar.innerMargin
}
Accessible.role: Accessible.List
Accessible.name: i18nc("@title:group accessible name for favorite group in sidebar", "Favorites")
Keys.onLeftPressed: event => sideBar.handleLeftRightArrow(event)
Keys.onRightPressed: event => sideBar.handleLeftRightArrow(event)
LayoutItemProxy {
target: sideBar.onTopPanel ? favoriteSystemActions : favoriteApps
}
KSvg.SvgItem {
id: sidebarSeparator
Layout.fillWidth: true
Layout.leftMargin: Kirigami.Units.smallSpacing
Layout.rightMargin: Layout.leftMargin
Layout.alignment: Qt.AlignHCenter
visible: (favoriteApps.model && favoriteApps.model.count
&& favoriteSystemActions.model && favoriteSystemActions.model.count)
imagePath: "widgets/line"
elementId: "horizontal-line"
}
LayoutItemProxy {
target: sideBar.onTopPanel ? favoriteApps : favoriteSystemActions
}
SideBarSection {
id: favoriteApps
Layout.fillHeight: true
Layout.alignment: Qt.AlignHCenter
KeyNavigation.up: favoriteSystemActions.bottomSideBarItem
KeyNavigation.down: favoriteSystemActions
model: root.globalFavorites
favoriteType: SideBarSection.FavoriteType.KAStats
onItemFocused: item => sideBarScrollView.ensureVisible(item)
onInteractionConcluded: root.interactionConcluded()
Binding {
target: root.globalFavorites
property: "iconSize"
value: Kirigami.Units.iconSizes.medium
restoreMode: Binding.RestoreBinding
}
}
SideBarSection {
id: favoriteSystemActions
Layout.alignment: Qt.AlignHCenter
model: root.systemFavorites
favoriteType: SideBarSection.FavoriteType.Simple
onItemFocused: item => sideBarScrollView.ensureVisible(item)
onInteractionConcluded: root.interactionConcluded()
KeyNavigation.up: favoriteApps.bottomSideBarItem
KeyNavigation.down: favoriteApps
}
}
}
}
ItemListView {
id: rootList
Layout.alignment: Qt.AlignTop
Layout.bottomMargin: searchField.implicitHeight + Kirigami.Units.smallSpacing
Layout.fillHeight: true
Layout.fillWidth: true
Layout.maximumHeight: implicitHeight
visible: searchField.text === ""
iconsEnabled: Plasmoid.configuration.showIconsRootLevel
hoverEnabled: !hoverBlock.enabled
mainSearchField: searchField
model: root.rootModel
LayoutMirroring.enabled: mainRow.LayoutMirroring.enabled
onExited: rootList.currentIndex = -1
onInteractionConcluded: root.interactionConcluded()
onKeyNavigationAtListEnd: {
searchField.focus = true;
}
onNavigateLeftRequested: {
if (!sideBar.visible) {
return
}
currentIndex = -1
root.focusSideBar()
}
}
RowLayout {
id: runnerColumns
Layout.fillHeight: true
visible: searchField.text !== "" && root.runnerModel.count > 0 && !initialDelayTimer.active && root.runnerModel.resultsPresent
spacing: 0
LayoutMirroring.enabled: mainRow.LayoutMirroring.enabled
Timer {
property bool active: false
id: initialDelayTimer
interval: 250 // match KRunner's delay for multi-runner queries
onRunningChanged: if (running && !root.runnerModel.resultsPresent) { active = true }
onTriggered: active = false
}
Repeater {
id: runnerColumnsRepeater
model: root.runnerModel
delegate: RunnerResultsList {
id: runnerMatches
Layout.fillHeight: true
Layout.fillWidth: true
visible: model.count > 0 || (model.querying && visible)
hoverEnabled: !hoverBlock.enabled
model: root.runnerModel.modelForRow(index)
mainSearchField: searchField
LayoutMirroring.enabled: runnerColumns.LayoutMirroring.enabled
function navigateToAdjacentColumn(forward = true) {
let currentColumnIndex = runnerColumns.visibleChildren.indexOf(runnerMatches)
let targetColumnIndex = currentColumnIndex + (forward ? 1 : -1)
if (currentColumnIndex < 0 || runnerColumns.visibleChildren.length <= 2) {
return
}
currentIndex = -1
if (targetColumnIndex >= 0 && targetColumnIndex < (runnerColumns.visibleChildren.length - 1)) {
root.focusRunnerColumn(targetColumnIndex)
} else if (sideBar.visible) {
root.focusSideBar()
} else {
root.focusRunnerColumn(forward ? 0 : runnerColumns.visibleChildren.length - 2)
}
}
onListActiveFocusChanged: {
if (!listActiveFocus) {
currentIndex = -1;
}
}
onInteractionConcluded: root.interactionConcluded()
onNavigateLeftRequested: navigateToAdjacentColumn(false)
onNavigateRightRequested: navigateToAdjacentColumn(true)
}
}
}
PlasmaExtras.PlaceholderMessage {
id: noMatchesPlaceholder
Layout.minimumWidth: mainRow.minimumMainWidth
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
visible: root.runnerModel.query !== "" && !root.runnerModel.resultsPresent && ((!root.runnerModel.querying && !initialDelayTimer.active) || visible)
iconName: "edit-none"
text: i18nc("@info:status", "No matches")
Binding {
searchField.width: noMatchesPlaceholder.width
when: noMatchesPlaceholder.visible
}
}
}
PlasmaExtras.SearchField {
id: searchField
readonly property int spacing: sideBar.width ? sideBar.Layout.rightMargin : 0
anchors.bottom: mainRow.bottom
anchors.left: parent.left
anchors.leftMargin: sideBar.visible ? sideBar.width + spacing : 0
readonly property real defaultWidth: Kirigami.Units.gridUnit * 14
width: runnerColumns.visible && root.runnerModel.resultsPresent
? runnerColumns.visibleChildren[0].width - (runnerColumns.visibleChildren.length > 2 ? Kirigami.Units.smallSpacing : 0)
: (rootList.visible ? rootList.width : mainRow.minimumMainWidth)
focus: !Kirigami.InputMethod.willShowOnActive
onTextChanged: {
initialDelayTimer.restart()
root.runnerModel.query = text;
}
onFocusChanged: {
if (focus) {
// FIXME: Cleanup arbitration between rootList/runnerCols here and in Keys.
if (rootList.visible) {
rootList.currentIndex = -1;
}
if (runnerColumns.visible) {
runnerColumnsRepeater.itemAt(0).currentIndex = -1;
}
}
}
states: [
State {
name: "right"
when: (Plasmoid.location === PlasmaCore.Types.RightEdge && Application.layoutDirection === Qt.LeftToRight)
|| (Plasmoid.location === PlasmaCore.Types.LeftEdge && Application.layoutDirection === Qt.RightToLeft)
AnchorChanges {
target: searchField
anchors.top: undefined
anchors.bottom: mainRow.bottom
anchors.left: undefined
anchors.right: parent.right
}
PropertyChanges {
searchField.anchors.leftMargin: undefined
searchField.anchors.rightMargin: sideBar.visible ? sideBar.width + spacing : 0
}
}
]
function handleUpDownArrow(event: KeyEvent) : void {
if (rootList.visible) {
root.focusRootList(event.key === Qt.Key_Down);
} else if (runnerColumns.visible) {
let index = runnerColumns.visibleChildren[0].currentIndex
root.focusRunnerColumn(0, event.key === Qt.Key_Down)
// First column, first entry is initially selected even when focus is on the search
// field, as Return will activate it. Down should immediately go to the second entry.
if (index === 0 && event.key === Qt.Key_Down) {
runnerColumns.visibleChildren[0].currentIndex = Math.min(index + 1, runnerColumns.visibleChildren[0].count - 1)
}
} else {
event.accepted = false
}
}
function handleLeftRightArrow(event: KeyEvent) : void {
let backArrowKey = (event.key === Qt.Key_Left && !mainRow.LayoutMirroring.enabled) ||
(event.key === Qt.Key_Right && mainRow.LayoutMirroring.enabled)
let forwardArrowKey = (event.key === Qt.Key_Right && !mainRow.LayoutMirroring.enabled) ||
(event.key === Qt.Key_Left && mainRow.LayoutMirroring.enabled)
if (backArrowKey) {
if (!sideBar.visible && !runnerColumns.visible) {
return;
}
if (runnerColumns.visibleChildren[0]?.length > 1) {
runnerColumns.visibleChildren[0].currentIndex = -1;
}
if (sideBar.visible) {
root.focusSideBar(true)
} else {
root.focusRunnerColumn(runnerColumns.visibleChildren.length - 2, true)
}
} else if (forwardArrowKey && runnerColumns.visibleChildren.length > 2) {
runnerColumns.visibleChildren[0].currentIndex = -1;
root.focusRunnerColumn(1, true)
} else {
event.accepted = false
}
}
function launchBestMatch() : void {
if (launchMatchTimer.running) {
launchMatchTimer.stop()
launchMatchTimer.triggered()
return
}
if (!root.runnerModel.querying || runnerColumns.visibleChildren[0]?.currentItem?.text.toLowerCase().includes(root.runnerModel.query.toLowerCase())) {
launchMatchTimer.triggered()
return
}
launchMatchTimer.start()
}
Timer {
id: launchMatchTimer
interval: 750
onTriggered: runnerColumns.visibleChildren[0]?.currentItem?.action.trigger()
}
Connections {
target: runnerColumns.visibleChildren[0] instanceof RunnerResultsList ? runnerColumns.visibleChildren[0] : null
enabled: launchMatchTimer.running
function onCurrentItemChanged() : void {
if (runnerColumns.visibleChildren[0]?.currentItem?.text.toLowerCase().includes(root.runnerModel.query.toLowerCase())) {
launchMatchTimer.stop()
Qt.callLater(launchMatchTimer.triggered) // callLater to resolve spurious binding loop
}
}
}
Connections {
target: root.runnerModel
enabled: launchMatchTimer.running || initialDelayTimer.active
function onQueryFinished() : void {
// queryFinish may be emitted for intermediate queries, ignore those
if (root.runnerModel.querying) { return }
initialDelayTimer.triggered()
if (!launchMatchTimer.running) { return }
launchMatchTimer.stop()
Qt.callLater(launchMatchTimer.triggered) // callLater to give bindings time to update
}
}
Keys.priority: Keys.AfterItem // arrow keys should move cursor first
Keys.onUpPressed: event => handleUpDownArrow(event)
Keys.onDownPressed: event => handleUpDownArrow(event)
Keys.onLeftPressed: event => handleLeftRightArrow(event)
Keys.onRightPressed: event => handleLeftRightArrow(event)
Keys.onEnterPressed: launchBestMatch()
Keys.onReturnPressed: launchBestMatch()
Keys.onEscapePressed: root.interactionConcluded()
function appendText(newText) {
focus = true;
text = text + newText;
}
}
Component.onCompleted: {
kicker.modelRefreshed.connect(() => {
const searchTerm = searchField.text
root.reset()
runnerModel.clear() // runnerModel is on a timer, clearing and setting query is too fast to work
searchField.text = searchTerm
});
kicker.reset.connect(reset)
rootModel.refresh();
}
HoverBlocker {
id: hoverBlock
anchors.fill: parent
onWidthChanged: hoverBlock.reset()
Connections {
target: root.runnerModel
function onQueryChanged() : void {
hoverBlock.reset()
}
}
}
}
@@ -0,0 +1,2 @@
#! /usr/bin/env bash
$XGETTEXT `find . -name \*.js -o -name \*.qml -o -name \*.cpp` -o $podir/plasma_applet_org.kde.plasma.kicker.pot
@@ -0,0 +1,137 @@
/*
SPDX-FileCopyrightText: 2013-2014 Eike Hein <hein@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
import QtQuick
import QtQuick.Layouts
import org.kde.kirigami as Kirigami
import org.kde.ksvg as KSvg
import org.kde.plasma.components as PlasmaComponents3
import org.kde.plasma.plasmoid
RowLayout {
id: runnerResultsList
signal keyNavigationAtListEnd
signal navigateLeftRequested
signal navigateRightRequested
signal interactionConcluded
required property int index
property bool hoverEnabled: true
property alias currentIndex: runnerMatches.currentIndex
property alias currentItem: runnerMatches.currentItem
property alias count: runnerMatches.count
property alias mainSearchField: runnerMatches.mainSearchField
property alias model: runnerMatches.model
property alias listActiveFocus: runnerMatches.activeFocus
readonly property bool isFirstColumn: runnerResultsList.parent.visibleChildren[0] === runnerResultsList
// the final visible child is the repeater, so need to subtract 2 to get the proper index
readonly property bool isLastColumn: runnerResultsList.parent.visibleChildren[runnerResultsList.parent.visibleChildren.length - 2] === runnerResultsList
// We may still be invisible when the results come in; set currentIndex later if needed
onIsFirstColumnChanged: if (isFirstColumn && runnerMatches.mainSearchField.focus) { runnerMatches.currentIndex = 0 }
spacing: Kirigami.Units.smallSpacing
function giveFocus(focusReason): void {
runnerMatches.forceActiveFocus(focusReason)
}
KSvg.SvgItem {
id: vertLine
Layout.fillHeight: true
visible: !runnerResultsList.isFirstColumn
imagePath: "widgets/line"
elementId: "vertical-line"
}
ColumnLayout {
id: runnerInnerColumn
Layout.fillHeight: true
Layout.fillWidth: true
Layout.minimumWidth: runnerMatches.Layout.minimumWidth
Layout.maximumWidth: runnerMatches.Layout.maximumWidth
spacing: Kirigami.Units.smallSpacing
PlasmaComponents3.Label {
id: header
Layout.fillWidth: true
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
textFormat: Text.PlainText
wrapMode: Text.NoWrap
elide: Text.ElideRight
font.weight: Font.Bold
text: (runnerMatches.model !== null) ? runnerMatches.model.name : ""
}
Item {
Layout.fillHeight: true
visible: Plasmoid.configuration.alignResultsToBottom
}
ItemListView {
id: runnerMatches
Layout.fillHeight: true
Layout.fillWidth: true
Layout.maximumHeight: Plasmoid.configuration.alignResultsToBottom ? contentHeight : -1
implicitWidth: Kirigami.Units.gridUnit * 17
Layout.minimumWidth: implicitWidth
Layout.maximumWidth: implicitWidth
innerRightMargin: runnerResultsList.isLastColumn ? 0 : Kirigami.Units.smallSpacing
Accessible.name: header.text
hoverEnabled: runnerResultsList.hoverEnabled
dynamicResize: false
iconsEnabled: true
showDescriptionInTooltip: true
keyNavigationWraps: !searchFieldPlaceholder.visible
LayoutMirroring.enabled: runnerResultsList.LayoutMirroring.enabled
resetOnExitDelay: 0
Connections {
target: runnerModel
function onAnyRunnerFinished () {
Qt.callLater( () => { // these come in quickly at the start
if (runnerMatches.activeFocus) {
return; // don't interfere if the user has already moved focus
}
if (searchFieldPlaceholder.visible && runnerMatches.mainSearchField.focus) {
runnerMatches.currentIndex = 0;
} else {
runnerMatches.currentIndex = -1;
}
})
}
}
onNavigateLeftRequested: runnerResultsList.navigateLeftRequested()
onNavigateRightRequested: runnerResultsList.navigateRightRequested()
onKeyNavigationAtListEnd: mainSearchField.forceActiveFocus(Qt.TabFocusReason)
onInteractionConcluded: runnerResultsList.interactionConcluded()
}
Item {
id: searchFieldPlaceholder
implicitHeight: runnerResultsList.mainSearchField.height
Layout.fillWidth: true
visible: runnerResultsList.isFirstColumn
}
}
}
@@ -0,0 +1,100 @@
/*
SPDX-FileCopyrightText: 2013-2015 Eike Hein <hein@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
pragma ComponentBehavior: Bound
import QtQuick
import org.kde.kirigami as Kirigami
import org.kde.plasma.components as PC3
import org.kde.plasma.extras as PlasmaExtras
import org.kde.ksvg as KSvg
ItemAbstractDelegate {
id: item
readonly property int itemIndex: model.index
readonly property bool isDropPlaceHolder: "dropPlaceholderIndex" in item.baseModel && item.itemIndex === item.baseModel.dropPlaceholderIndex
property bool showUnfavoritePlaceholder: false
Accessible.role: Accessible.ListItem
icon.source: item.decoration
icon.width: Kirigami.Units.iconSizes.medium
icon.height: Kirigami.Units.iconSizes.medium
hoverEnabled: true
dragActive: dragHandler.active
Keys.onSpacePressed: action.trigger()
background.visible: false // we want the default background's spacing, but not the base color
contentItem: Kirigami.Icon {
visible: !item.showUnfavoritePlaceholder && !item.isDropPlaceHolder
active: item.hovered
width: item.icon.width
height: item.icon.height
source: item.icon.source
}
Loader {
active: item.hovered || item.visualFocus || dragHandler.active || item.isDropPlaceHolder || item.showUnfavoritePlaceholder
anchors.fill: parent
sourceComponent: Item {
id: highlightItem
anchors.fill: parent
PlasmaExtras.Highlight {
anchors.fill: parent
visible: !item.isDropPlaceHolder && !item.showUnfavoritePlaceholder
hovered: true
pressed: item.pressed
}
KSvg.FrameSvgItem {
anchors.fill: parent
visible: item.isDropPlaceHolder || item.showUnfavoritePlaceholder
imagePath: "widgets/viewitem"
prefix: "selected"
opacity: 0.5
Kirigami.Icon {
anchors.centerIn: parent
width: item.icon.width
height: width
source: item.isDropPlaceHolder ? "list-add" : "list-remove"
active: false
}
}
}
}
DragHandler {
id: dragHandler
target: null
onActiveChanged: if (active) {
item.contentItem.grabToImage(function(result) {
item.Drag.imageSource = result.url
item.Drag.active = true // using a binding can cause loop warnings when unexpanding
})
} else {
item.Drag.active = false
}
}
Drag.dragType: Drag.Automatic
Drag.mimeData: {
'favoritedrag': '',
"text/uri-list" : [item.url]
}
PC3.ToolTip {
text: item.text
}
}
@@ -0,0 +1,142 @@
/*
SPDX-FileCopyrightText: 2013-2014 Eike Hein <hein@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
pragma ComponentBehavior: Bound
import QtQuick
import org.kde.kirigami as Kirigami
DropArea {
id: root
implicitWidth: repeater.count ? repeater.itemAt(0).implicitWidth : (Kirigami.Units.iconSizes.medium + Kirigami.Units.smallSpacing * 2)
implicitHeight: contentHeight
enum FavoriteType {
Simple,
KAStats
}
property int contentHeight: model ? (model.count * implicitWidth) + ((model.count - 1) * flow.spacing) : 0
property /*FavoriteType*/ int favoriteType
property alias model: repeater.model
readonly property SideBarItem bottomSideBarItem: repeater.itemAt(repeater.count - 1) as SideBarItem
readonly property string favoriteTypeMimeType: favoriteType === SideBarSection.FavoriteType.Simple ? "text/xx-kicker-simplefavorite-id" : "text/xx-kicker-kastatsfavorite-id"
signal interactionConcluded
signal itemFocused(Item item)
onActiveFocusChanged: (repeater.itemAt(0) ?? KeyNavigation.down).forceActiveFocus(Qt.TabFocusReason)
onPositionChanged: event => {
if (flow.animating) {
return;
}
const above = flow.childAt(event.x, event.y) as SideBarItem
const eventSource = event.source as SideBarItem
if (above && eventSource && above !== eventSource && eventSource.parent === flow) {
repeater.model.moveRow(eventSource.itemIndex, above.itemIndex);
event.accept(Qt.MoveAction)
} else if (eventSource && eventSource.favoritesModel.isFavorite(eventSource.favoriteId)) {
event.accept(Qt.MoveAction)
} else if (event.formats.includes(root.favoriteTypeMimeType) && !model.isFavorite(event.getDataAsString(root.favoriteTypeMimeType))) {
model.dropPlaceholderIndex = above?.itemIndex ?? 0;
event.accept(Qt.CopyAction)
} else {
model.dropPlaceholderIndex = -1;
event.accepted = false
}
}
onExited: {
if ("dropPlaceholderIndex" in model) {
model.dropPlaceholderIndex = -1;
}
}
onDropped: event => {
let draggedItem = drag.source as SideBarItem
if (event.formats.includes(root.favoriteTypeMimeType)) {
model.addFavorite(event.getDataAsString(root.favoriteTypeMimeType), model.dropPlaceholderIndex)
event.accept(Qt.CopyAction)
} else if (draggedItem && draggedItem.favoritesModel.isFavorite(draggedItem.favoriteId) && draggedItem.favoritesModel !== root.model) {
draggedItem.showUnfavoritePlaceholder = true
draggedItem.favoritesModel.removeFavorite(draggedItem.favoriteId)
event.accept(Qt.MoveAction)
}
}
Flow {
id: flow
anchors.fill: parent
property bool animating: false
property int animationDuration: resetAnimationDurationTimer.interval
move: Transition {
SequentialAnimation {
PropertyAction { target: flow; property: "animating"; value: true }
NumberAnimation {
duration: flow.animationDuration
properties: "x, y"
easing.type: Easing.OutQuad
}
PropertyAction { target: flow; property: "animating"; value: false }
}
}
spacing: 0
Repeater {
id: repeater
delegate: SideBarItem {
favoritesModel: repeater.model
baseModel: repeater.model
showUnfavoritePlaceholder: Drag.active && !root.containsDrag
Keys.onUpPressed: event => {
if (index > 0) {
repeater.itemAt(index - 1).forceActiveFocus(Qt.TabFocusReason)
} else {
event.accepted = false
}
}
Keys.onDownPressed: event => {
if (index + 1 < repeater.count) {
repeater.itemAt(index + 1).forceActiveFocus(Qt.TabFocusReason)
} else {
event.accepted = false
}
}
onInteractionConcluded: root.interactionConcluded()
onActiveFocusChanged: if (activeFocus) root.itemFocused(this)
}
onCountChanged: {
flow.animationDuration = 0;
resetAnimationDurationTimer.start();
}
}
}
Timer {
id: resetAnimationDurationTimer
interval: 150
repeat: false
onTriggered: {
flow.animationDuration = interval - 20;
}
}
}
@@ -0,0 +1,182 @@
/*
SPDX-FileCopyrightText: 2013 Aurélien Gâteau <agateau@kde.org>
SPDX-FileCopyrightText: 2013-2015 Eike Hein <hein@kde.org>
SPDX-FileCopyrightText: 2017 Ivan Cukic <ivan.cukic@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
.pragma library
function fillActionMenu(i18n, actionMenu, actionList, favoriteModel, favoriteId) {
// Accessing actionList can be a costly operation, so we don't
// access it until we need the menu.
const favoriteActions = createFavoriteActions(i18n, favoriteModel, favoriteId);
if (favoriteActions) {
if (actionList && actionList.length > 0) {
const actionListCopy = Array.from(actionList);
// same logic as in kickoff's openActionMenu() in
// AbstractKickoffItemDelegate
// Insert favoriteActions before the "Add to" actions (called
// "addLauncherActions" by libkicker)
const firstAddToActionIndex = actionListCopy.findIndex((action) =>
["addToDesktop", "addToTaskManager", "addToPanel"].includes(action?.actionId),
);
if (firstAddToActionIndex >= 0) {
actionListCopy.splice(firstAddToActionIndex, 0, ...favoriteActions);
} else {
// Or at the end (with a separator) if they're not found
actionListCopy.push({ type: "separator" }, ...favoriteActions);
}
// actionList = actions.concat(actionList); // this crashes Qt O.o
actionList = actionListCopy;
} else {
actionList = favoriteActions;
}
}
actionMenu.actionList = actionList;
}
function createFavoriteActions(i18n, favoriteModel, favoriteId) {
if (!favoriteModel || !favoriteModel.enabled || !favoriteId) {
return null;
}
if (favoriteModel.activities === undefined ||
favoriteModel.activities.activities.length <= 1) {
const action = {};
if (favoriteModel.isFavorite(favoriteId)) {
action.text = i18n("Remove from Favorites");
action.icon = "bookmark-remove";
action.actionId = "_kicker_favorite_remove";
} else if (favoriteModel.maxFavorites === -1 || favoriteModel.count < favoriteModel.maxFavorites) {
action.text = i18n("Add to Favorites");
action.icon = "bookmark-new";
action.actionId = "_kicker_favorite_add";
} else {
return null;
}
action.actionArgument = {
favoriteModel,
favoriteId,
};
return [action];
} else {
const actions = [];
const linkedActivities = favoriteModel.linkedActivitiesFor(favoriteId);
const activities = favoriteModel.activities.activities;
// Adding the item to link/unlink to all activities
const linkedToAllActivities = linkedActivities.includes(":global");
actions.push({
text: i18n("On All Activities"),
checkable: true,
actionId: linkedToAllActivities
? "_kicker_favorite_remove_from_activity"
: "_kicker_favorite_set_to_activity",
checked: linkedToAllActivities,
actionArgument: {
favoriteModel,
favoriteId,
favoriteActivity: "",
},
});
// Adding items for each activity separately
const addActivityItem = (activityId, activityName) => {
const linkedToThisActivity = linkedActivities.includes(activityId);
actions.push({
text: activityName,
checkable: true,
checked: linkedToThisActivity && !linkedToAllActivities,
actionId:
// If we are on all activities, and the user clicks just one
// specific activity, unlink from everything else
linkedToAllActivities ? "_kicker_favorite_set_to_activity" :
// If we are linked to the current activity, just unlink from
// that single one
linkedToThisActivity ? "_kicker_favorite_remove_from_activity" :
// Otherwise, link to this activity, but do not unlink from
// other ones
"_kicker_favorite_add_to_activity",
actionArgument: {
favoriteModel,
favoriteId,
favoriteActivity: activityId,
},
});
};
// Adding the item to link/unlink to the current activity
addActivityItem(favoriteModel.activities.currentActivity, i18n("On the Current Activity"));
actions.push({
type: "separator",
actionId: "_kicker_favorite_separator",
});
// Adding the items for each activity
activities.forEach(activityId => {
addActivityItem(activityId, favoriteModel.activityNameForId(activityId));
});
return [{
text: i18n("Show in Favorites"),
icon: "favorite",
subActions: actions,
}];
}
}
function triggerAction(model, index, actionId, actionArgument) {
if (actionId.startsWith("_kicker_favorite_")) {
handleFavoriteAction(actionId, actionArgument);
return;
}
const closeRequested = model.trigger(index, actionId, actionArgument);
return closeRequested;
}
function handleFavoriteAction(actionId, actionArgument) {
const { favoriteId, favoriteModel, favoriteActivity } = actionArgument;
if (favoriteModel === null || favoriteId === null) {
return null;
}
if (actionId === "_kicker_favorite_remove") {
favoriteModel.removeFavorite(favoriteId);
} else if (actionId === "_kicker_favorite_add") {
favoriteModel.addFavorite(favoriteId);
} else if (actionId === "_kicker_favorite_remove_from_activity") {
favoriteModel.removeFavoriteFrom(favoriteId, favoriteActivity);
} else if (actionId === "_kicker_favorite_add_to_activity") {
favoriteModel.addFavoriteTo(favoriteId, favoriteActivity);
} else if (actionId === "_kicker_favorite_set_to_activity") {
favoriteModel.setFavoriteOn(favoriteId, favoriteActivity);
}
}
@@ -0,0 +1,17 @@
/*
SPDX-FileCopyrightText: 2014 Eike Hein <hein@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
import QtQuick
import org.kde.plasma.configuration
ConfigModel {
ConfigCategory {
name: i18nc("@title:group for configuration dialog page", "General")
icon: "preferences-desktop-plasma"
source: "ConfigGeneral.qml"
}
}
@@ -0,0 +1,222 @@
/*
SPDX-FileCopyrightText: 2014-2015 Eike Hein <hein@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Layouts
import org.kde.kirigami as Kirigami
import org.kde.plasma.components as PlasmaComponents3
import org.kde.plasma.core as PlasmaCore
import org.kde.plasma.plasmoid
import org.kde.plasma.private.kicker as Kicker
PlasmoidItem {
id: kicker
anchors.fill: parent
signal reset
signal modelRefreshed
readonly property bool isDash: Plasmoid.pluginName === "org.kde.plasma.kickerdash"
switchWidth: isDash || !fullRepresentationItem ? 0 : fullRepresentationItem.Layout.minimumWidth
switchHeight: isDash || !fullRepresentationItem ? 0 : fullRepresentationItem.Layout.minimumHeight
// this is a bit of a hack to prevent Plasma from spawning a dialog on its own when we're Dash
preferredRepresentation: isDash ? fullRepresentation : null
compactRepresentation: isDash ? null : compactRepresentationComponent
fullRepresentation: isDash ? compactRepresentationComponent : menuRepresentationComponent
readonly property Component itemListDialogComponent: Component {
ItemListDialog {}
}
property Kicker.KAStatsFavoritesModel globalFavorites: rootModel.favoritesModel as Kicker.KAStatsFavoritesModel
property Kicker.SimpleFavoritesModel systemFavorites: rootModel.systemFavoritesModel as Kicker.SimpleFavoritesModel
Plasmoid.icon: Plasmoid.configuration.useCustomButtonImage ? Plasmoid.configuration.customButtonImage : Plasmoid.configuration.icon
onSystemFavoritesChanged: {
if (systemFavorites) {
systemFavorites.favorites = Plasmoid.configuration.favoriteSystemActions;
}
}
function action_menuedit() {
processRunner.runMenuEditor();
}
Component {
id: compactRepresentationComponent
CompactRepresentation {
dashWindowComponent: dashboardRepresentationComponent
toolTipSubText: kicker.toolTipSubText
}
}
Component {
id: menuRepresentationComponent
MenuRepresentation {
globalFavorites: kicker.globalFavorites
systemFavorites: kicker.systemFavorites
rootModel: rootModel
runnerModel: runnerModel
onInteractionConcluded: kicker.expanded = false
}
}
Component {
id: dashboardRepresentationComponent
DashboardRepresentation {
globalFavorites: kicker.globalFavorites
systemFavorites: kicker.systemFavorites
rootModel: rootModel
runnerModel: runnerModel
onInteractionConcluded: toggle()
}
}
Kicker.RootModel {
id: rootModel
autoPopulate: false
appNameFormat: kicker.isDash ? 0 : Plasmoid.configuration.appNameFormat // appNameFormat = 0 -> AppName Only
flat: kicker.isDash || Plasmoid.configuration.limitDepth
sorted: Plasmoid.configuration.alphaSort
showSeparators: !kicker.isDash && !sorted
showRootSeparator: !kicker.isDash
highlightNewlyInstalledApps: Plasmoid.configuration.highlightNewlyInstalledApps
// TODO: appletInterface property now can be ported to "applet" and have the real Applet* assigned directly
appletInterface: kicker
showAllApps: kicker.isDash
showAllAppsCategorized: true
showTopLevelItems: !kicker.isDash
showRecentApps: Plasmoid.configuration.showRecentApps
showRecentDocs: Plasmoid.configuration.showRecentDocs
showRecentFolders: Plasmoid.configuration.showRecentFolders
recentOrdering: Plasmoid.configuration.recentOrdering
onShowRecentAppsChanged: {
Plasmoid.configuration.showRecentApps = showRecentApps;
}
onShowRecentDocsChanged: {
Plasmoid.configuration.showRecentDocs = showRecentDocs;
}
onRecentOrderingChanged: {
Plasmoid.configuration.recentOrdering = recentOrdering;
}
Component.onCompleted: {
(favoritesModel as Kicker.KAStatsFavoritesModel).initForClient("org.kde.plasma.kicker.favorites.instance-" + Plasmoid.id)
if (!Plasmoid.configuration.favoritesPortedToKAstats) {
if (favoritesModel.count < 1) {
(favoritesModel as Kicker.KAStatsFavoritesModel).portOldFavorites(Plasmoid.configuration.favoriteApps);
}
Plasmoid.configuration.favoritesPortedToKAstats = true;
}
}
}
Connections {
target: kicker.globalFavorites
function onFavoritesChanged() {
Plasmoid.configuration.favoriteApps = kicker.globalFavorites.favorites;
}
}
Connections {
target: kicker.systemFavorites
function onFavoritesChanged() {
Plasmoid.configuration.favoriteSystemActions = kicker.systemFavorites.favorites;
}
}
Connections {
target: Plasmoid.configuration
function onFavoriteAppsChanged() {
kicker.globalFavorites.favorites = Plasmoid.configuration.favoriteApps;
}
function onFavoriteSystemActionsChanged() {
kicker.systemFavorites.favorites = Plasmoid.configuration.favoriteSystemActions;
}
}
Kicker.RunnerModel {
id: runnerModel
appletInterface: kicker
favoritesModel: kicker.globalFavorites as Kicker.KAStatsFavoritesModel
runners: {
const results = ["krunner_services",
"krunner_systemsettings",
"krunner_sessions",
"krunner_powerdevil",
"calculator",
"unitconverter"];
if (Plasmoid.configuration.useExtraRunners) {
results.push(...Plasmoid.configuration.extraRunners);
}
return results;
}
}
Kicker.DragHelper {
id: dragHelper
dragIconSize: Kirigami.Units.iconSizes.medium
}
Kicker.ProcessRunner {
id: processRunner
}
Kicker.WindowSystem { // only for X11; TODO Plasma 6.8: remove (also from plasma-workspace)
id: windowSystem
}
Connections {
target: kicker
function onExpandedChanged(expanded) {
if (!expanded) {
kicker.reset();
}
}
}
Plasmoid.contextualActions: [
PlasmaCore.Action {
text: i18nc("@action:inmenu launches kmenuedit", "Edit Applications…")
icon.name: "kmenuedit"
visible: Plasmoid.immutability !== PlasmaCore.Types.SystemImmutable
onTriggered: processRunner.runMenuEditor()
}
]
Component.onCompleted: {
if (Plasmoid.hasOwnProperty("activationTogglesExpanded")) {
Plasmoid.activationTogglesExpanded = !kicker.isDash
}
rootModel.refreshed.connect(modelRefreshed);
}
}
@@ -0,0 +1,100 @@
<?xml version="1.0" encoding="UTF-8"?>
<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
<kcfgfile name=""/>
<group name="General">
<entry name="icon" type="String">
<label>The name of the icon to use for the compact representation (e.g. on a small panel).</label>
<default>start-here-kde-symbolic</default>
</entry>
<entry name="useCustomButtonImage" type="Bool">
<label>Whether to use a custom image instead of an icon in the compact representation (e.g. on a small panel).</label>
<default>false</default>
</entry>
<entry name="customButtonImage" type="Url">
<label>The URL of the custom image to use instead of an icon in the compact representation (e.g. on a small panel).</label>
<default></default>
</entry>
<entry name="appNameFormat" type="Int">
<label>The format used in the display of application names: 0 = NameOnly, 1 = GenericNameOnly, 2 = NameAndGenericName, 3 = GenericNameAndName</label>
<default>0</default>
</entry>
<entry name="limitDepth" type="Bool">
<label>Whether to flatten top-level menu categories to a single level instead of displaying sub-categories.</label>
<default>false</default>
</entry>
<entry name="alphaSort" type="Bool">
<label>Whether to sort menu contents alphabetically or use manual/system sort order.</label>
<default>false</default>
</entry>
<entry name="recentOrdering" type="Int">
<label>How should the previously used apps/docs be ordered: 0 = RecentFirst, 1 = PopularFirst</label>
<default>0</default>
</entry>
<entry name="favoriteApps" type="StringList">
<label>List of general favorites. Supported values are menu id's (usually .desktop file names), special URLs that expand into default applications (e.g. preferred://browser), document URLs and KPeople contact URIs.</label>
<default>preferred://browser,org.kde.kontact.desktop,systemsettings.desktop,org.kde.dolphin.desktop,org.kde.discover</default>
</entry>
<entry name="favoriteSystemActions" type="StringList">
<label>List of system action favorites.</label>
<default>logout,reboot,shutdown</default>
</entry>
<entry name="favoritesPortedToKAstats" type="Bool">
<label>Are the favorites ported to use KActivitiesStats to allow per-activity favorites</label>
<default>false</default>
</entry>
<entry name="hiddenApplications" type="StringList">
<label>List of menu id's (usually .desktop file names) of apps that should not be shown in the menu.</label>
<default></default>
</entry>
<entry name="showRecentApps" type="Bool">
<label>Whether to show the "Recent Applications" category.</label>
<default>true</default>
</entry>
<entry name="showRecentDocs" type="Bool">
<label>Whether to show the "Recent Files" category.</label>
<default>true</default>
</entry>
<entry name="showRecentFolders" type="Bool">
<label>Whether to show the "Recent Places" category.</label>
<default>false</default>
</entry>
<entry name="useExtraRunners" type="Bool">
<label>Whether to use additional KRunner plugins to produce results in the search.</label>
<default>true</default>
</entry>
<entry name="extraRunners" type="StringList">
<label>The plugin id's of additional KRunner plugins to use. Only used if useExtraRunners is true.</label>
<default>krunner_shell,krunner_bookmarksrunner,baloosearch,locations</default>
</entry>
<entry name="alignResultsToBottom" type="Bool">
<label>Whether to align search results to the bottom of the menu representation (e.g. panel popup) instead of the top.</label>
<default>true</default>
</entry>
<entry name="showIconsRootLevel" type="Bool">
<label>Whether to show icons on the root level of the menu.</label>
<default>false</default>
</entry>
<entry name="highlightNewlyInstalledApps" type="Bool">
<label>Whether to highlight newly-installed applications</label>
<default>true</default>
</entry>
<entry name="forceDarkMode" type="Bool">
<label>Whether to force dark mode for the Dashboard.</label>
<default>true</default>
</entry>
<entry name="favoritesColumns" type="Int">
<label>The amount of columns in the Favorites Dashboard grid.</label>
<default>3</default>
</entry>
</group>
</kcfg>
@@ -0,0 +1,182 @@
{
"KPlugin": {
"Authors": [
{
"Email": "hein@kde.org",
"Name": "Eike Hein",
"Name[ar]": "إيكي هين",
"Name[az]": "Eike Hein",
"Name[be]": "Eike Hein",
"Name[bg]": "Eike Hein",
"Name[ca@valencia]": "Eike Hein",
"Name[ca]": "Eike Hein",
"Name[cs]": "Eike Hein",
"Name[da]": "Eike Hein",
"Name[de]": "Eike Hein",
"Name[el]": "Eike Hein",
"Name[en_GB]": "Eike Hein",
"Name[eo]": "Eike Hein",
"Name[es]": "Eike Hein",
"Name[et]": "Eike Hein",
"Name[eu]": "Eike Hein",
"Name[fi]": "Eike Hein",
"Name[fr]": "Eike Hein",
"Name[ga]": "Eike Hein",
"Name[gl]": "Eike Hein",
"Name[he]": "אייק היין",
"Name[hu]": "Eike Hein",
"Name[ia]": "Eike Hein",
"Name[id]": "Eike Hein",
"Name[ie]": "Eike Hein",
"Name[is]": "Eike Hein",
"Name[it]": "Eike Hein",
"Name[ja]": "Eike Hein",
"Name[ka]": "აიკე ჰაინი",
"Name[ko]": "Eike Hein",
"Name[lt]": "Eike Hein",
"Name[lv]": "Eike Hein",
"Name[nb]": "Eike Hein",
"Name[nl]": "Eike Hein",
"Name[nn]": "Eike Hein",
"Name[pa]": "ਇਕੀ ਹੀਇਨ",
"Name[pl]": "Eike Hein",
"Name[pt]": "Eike Hein",
"Name[pt_BR]": "Eike Hein",
"Name[ro]": "Eike Hein",
"Name[ru]": "Eike Hein",
"Name[sa]": "ऐके हेन",
"Name[sk]": "Eike Hein",
"Name[sl]": "Eike Hein",
"Name[sv]": "Eike Hein",
"Name[ta]": "எய்கே ஹைன்",
"Name[tr]": "Eike Hein",
"Name[ug]": "Eike Hein",
"Name[uk]": "Eike Hein",
"Name[vi]": "Eike Hein",
"Name[zh_CN]": "Eike Hein",
"Name[zh_TW]": "Eike Hein"
}
],
"BugReportUrl": "https://bugs.kde.org/enter_bug.cgi?product=plasmashell&component=Application%20Menu%20(Kicker)%20widget",
"Category": "Application Launchers",
"Description": "A launcher based on cascading popup menus",
"Description[ar]": "مطلق مبنيّ على قوائم منبثقة متتالية",
"Description[az]": "Pilləli açılan menyularla başladıcı",
"Description[be]": "Сродак запуску ў выглядзе каскаднага выплыўнога меню",
"Description[bg]": "Стартер с каскадни изскачащи менюта",
"Description[ca@valencia]": "Un iniciador basat en menús emergents en cascada",
"Description[ca]": "Un llançador basat en menús emergents en cascada",
"Description[cs]": "Spouštěč založený na vyskakovacích nabídkách v kaskádě",
"Description[da]": "En starter baseret på pop op-menuer i kaskader",
"Description[de]": "Ein Anwendungsstarter auf der Grundlage von kaskadierenden Aufklappmenüs",
"Description[el]": "Ένας εκκινητής βασισμένος σε αναδυόμενα μενού κλιμάκωσης",
"Description[en_GB]": "A launcher based on cascading popup menus",
"Description[eo]": "Lanĉilo bazita sur kaskadantaj ŝprucmenuoj",
"Description[es]": "Un lanzador basado en menús emergentes en cascada",
"Description[et]": "Kaskaadis hüpikmenüüsid kasutav käivitaja",
"Description[eu]": "Menu abiaratu agerkarietan oinarritutako abiarazle bat",
"Description[fi]": "Käynnistin, joka perustuu hierarkkisiin ponnahdusvalikoihin",
"Description[fr]": "Un lanceur reposant sur des menus contextuels en cascade",
"Description[ga]": "Lainseálaí bunaithe ar roghchláir aníos easghluaiseacha",
"Description[gl]": "Un iniciador baseado en menús emerxentes en fervenza.",
"Description[he]": "משגר יישומים מבוסס על תפריטים מדורגים",
"Description[hu]": "Felugró menükre épülő alkalmazásindító",
"Description[ia]": "Un lanceator basate sur menus de popup a cascada",
"Description[id]": "Sebuah peluncur berbasiskan pada menu sembul berkaskade",
"Description[is]": "Ræsir sem byggir á stölluðum sprettivalmyndum",
"Description[it]": "Un avviatore basato su menu a comparsa in cascata",
"Description[ja]": "ポップアップメニューを使用するランチャー",
"Description[ka]": "კასკადურ პოპაპ მენიუზე დაფუძნებული გამშვები",
"Description[ko]": "연계 팝업 메뉴에 기반한 실행기",
"Description[lt]": "Paleidyklė, pagrįsta pakopiniais iškylančiaisias meniu",
"Description[lv]": "Palaidējs ar kaskādē uznirstošām izvēlnēm",
"Description[nb]": "Starter basert på menyhierarki",
"Description[nl]": "Een starter gebaseerd op achter elkaar liggende popup-menu's",
"Description[nn]": "Startar basert på menyhierarki",
"Description[pl]": "Wielopoziomowe menu rozsuwane",
"Description[pt]": "Um iniciador de aplicações baseado em menus de cascata",
"Description[pt_BR]": "Um lançador com base em menus em cascata",
"Description[ro]": "Lansator bazat pe meniuri contextuale în cascadă",
"Description[ru]": "Меню запуска приложений на основе выпадающих меню",
"Description[sa]": "कैस्केडिंग् पॉपअप मेन्यू इत्यस्य आधारेण एकः प्रक्षेपकः",
"Description[sk]": "Spúšťač založený na kaskádových vyskakovacích ponukách",
"Description[sl]": "Zaganjalnik, ki temelji na kaskadnih pojavnih menijih",
"Description[sv]": "Ett startprogram baserat på kaskadmenyer",
"Description[ta]": "ஒன்றுக்குள் மற்றொன்று உட்பொதிந்த தெரித்தெழும் பட்டிகளை பயன்படுத்தும் ஏவி",
"Description[tr]": "Basamaklı açılır menü tabanlı bir başlatıcı",
"Description[ug]": "قەۋەتلىك قاڭقىش تىزىملىكى ئاساسىدىكى قوزغاتقۇچ",
"Description[uk]": "Засіб запуску, заснований на вкладених контекстних меню",
"Description[vi]": "Một trình khởi chạy dựa trên các trình đơn bật lên xếp tầng",
"Description[zh_CN]": "基于层叠弹出菜单设计的启动器",
"Description[zh_TW]": "基於彈出式串連選單的啟動器",
"EnabledByDefault": true,
"Icon": "start-here-kde",
"License": "GPL-2.0+",
"Name": "Application Menu",
"Name[ar]": "قائمة التّطبيقات",
"Name[az]": "Tətbiq menyusu",
"Name[be]": "Меню праграмы",
"Name[bg]": "Меню с приложения",
"Name[bs]": "Aplikacijski meni",
"Name[ca@valencia]": "Menú d'aplicacions",
"Name[ca]": "Menú d'aplicacions",
"Name[cs]": "Nabídka aplikací",
"Name[da]": "Programmenu",
"Name[de]": "Anwendungsmenü",
"Name[el]": "Μενού εφαρμογών",
"Name[en_GB]": "Application Menu",
"Name[eo]": "Aplikaĵomenuo",
"Name[es]": "Menú de aplicaciones",
"Name[et]": "Rakenduste menüü",
"Name[eu]": "Aplikazio-menua",
"Name[fi]": "Sovelluskäynnistin",
"Name[fr]": "Menu des applications",
"Name[ga]": "Roghchlár Feidhmchláir",
"Name[gl]": "Menú de aplicacións",
"Name[he]": "תפריט יישומים",
"Name[hu]": "Alkalmazásmenü",
"Name[ia]": "Menu de application",
"Name[id]": "Menu Aplikasi",
"Name[ie]": "Menú de application",
"Name[is]": "Forritavalmynd",
"Name[it]": "Menu dell'applicazione",
"Name[ja]": "アプリケーションメニュー",
"Name[ka]": "აპლიკაციების მენიუ",
"Name[ko]": "앱 메뉴",
"Name[lt]": "Programų meniu",
"Name[lv]": "Programmu izvēlne",
"Name[ml]": "പ്രയോഗസൂചിക",
"Name[mr]": "अनुप्रयोग मेन्यु",
"Name[nb]": "Programmeny",
"Name[nds]": "Programmmenü",
"Name[nl]": "Menu Toepassingen",
"Name[nn]": "Program­meny",
"Name[pa]": "ਐਪਲੀਕੇਸ਼ਨ ਮੇਨੂ",
"Name[pl]": "Menu rozsuwane programów",
"Name[pt]": "Menu de Aplicações (compacto)",
"Name[pt_BR]": "Menu de aplicativos",
"Name[ro]": "Meniu de aplicații",
"Name[ru]": "Классическое меню приложений",
"Name[sa]": "अनुप्रयोग मेनू",
"Name[sk]": "Ponuka aplikácií",
"Name[sl]": "Meni programa",
"Name[sr@ijekavian]": "мени програма",
"Name[sr@ijekavianlatin]": "meni programa",
"Name[sr@latin]": "meni programa",
"Name[sr]": "мени програма",
"Name[sv]": "Programmeny",
"Name[ta]": "செயலி பட்டி",
"Name[tg]": "Феҳристи барномаҳо",
"Name[tr]": "Uygulama Menüsü",
"Name[ug]": "پىروگرامما تىزىملىكى",
"Name[uk]": "Меню програм",
"Name[vi]": "Trình đơn ứng dụng",
"Name[zh_CN]": "应用程序菜单",
"Name[zh_TW]": "應用程式選單",
"Website": "https://www.kde.org/plasma-desktop"
},
"X-Plasma-API-Minimum-Version": "6.0",
"X-Plasma-Provides": [
"org.kde.plasma.launchermenu"
]
}
@@ -0,0 +1,276 @@
/*
SPDX-FileCopyrightText: 2011 Martin Gräßlin <mgraesslin@kde.org>
SPDX-FileCopyrightText: 2012 Gregor Taetzner <gregor@freenet.de>
SPDX-FileCopyrightText: 2014 Sebastian Kügler <sebas@kde.org>
SPDX-FileCopyrightText: 2015-2018 Eike Hein <hein@kde.org>
SPDX-FileCopyrightText: 2021 Mikel Johnson <mikel5764@gmail.com>
SPDX-FileCopyrightText: 2021 Noah Davis <noahadvs@gmail.com>
SPDX-FileCopyrightText: 2022 Nate Graham <nate@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Templates as T
import org.kde.plasma.core as PlasmaCore
import org.kde.plasma.components as PC3
import org.kde.plasma.extras as PlasmaExtras
import org.kde.kirigami as Kirigami
import "code/tools.js" as Tools
import org.kde.plasma.plasmoid
T.ItemDelegate {
id: root
enum AppNameFormat {
NameOnly,
GenericNameOnly,
NameAndGenericName,
GenericNameAndName
}
// model properties
required property var model
required property int index
required property url url
required property var decoration
required property string description
required property bool isMultilineText
readonly property Flickable view: ListView.view ?? GridView.view
property bool isCategoryListItem: false
property bool removalPlaceholderActive: false
readonly property bool hasActionList: model && (model.favoriteId !== null || ("hasActionList" in model && model.hasActionList === true))
property bool isSearchResult: false
readonly property bool isSeparator: model && (model.isSeparator === true)
property int separatorHeight: KickoffSingleton.lineSvg.horLineHeight + (2 * Kirigami.Units.smallSpacing)
property int itemHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, implicitContentHeight + topPadding + bottomPadding)
readonly property bool dragEnabled: enabled && !isCategoryListItem
&& Plasmoid.immutability !== PlasmaCore.Types.SystemImmutable
readonly property alias mouseArea: mouseArea
readonly property bool iconAndLabelsShouldlookSelected: down && !isCategoryListItem
property bool labelTruncated: false
property bool descriptionTruncated: false
property bool descriptionVisible: true
property Item dragIconItem: null
down: mouseArea.pressed || dragHandler.active
function openActionMenu(x = undefined, y = undefined) {
if (!hasActionList) { return; }
let actions = Array.from(model.actionList);
const favoriteActions = Tools.createFavoriteActions(
i18n, //i18n() function callback // qmllint disable unqualified
root.view.model.favoritesModel,
model.favoriteId,
);
if (favoriteActions) {
if (actions && actions.length > 0) {
// same logic as in kicker's fillActionMenu()
// Insert favoriteActions after the "Add to" actions (called
// "addLauncherActions" by libkicker)
const firstAddToActionIndex = actions.findIndex((action) =>
["addToDesktop", "addToTaskManager", "addToPanel"].includes(action?.actionId),
);
if (firstAddToActionIndex >= 0) {
actions.splice(firstAddToActionIndex, 0, ...favoriteActions);
} else {
// Or at the end (with a separator) if they're not found
actions.push({ type: "separator" }, ...favoriteActions);
}
} else {
actions = favoriteActions;
}
}
if (actions && actions.length > 0) {
ActionMenu.plasmoid = kickoff;
ActionMenu.menu.visualParent = root;
ActionMenu.actionList = actions;
if (x !== undefined && y !== undefined) {
ActionMenu.menu.open(x, y);
} else {
ActionMenu.menu.openRelative();
}
}
}
// The default Z value for delegates is 1. The default Z value for the section delegate is 2.
// The highlight gets a value of 3 while the drag is active and then goes back to the default value of 0.
z: Drag.active ? 4 : 1
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
implicitContentWidth + leftPadding + rightPadding)
implicitHeight: isSeparator ? separatorHeight : itemHeight
spacing: KickoffSingleton.fontMetrics.descent
enabled: !isSeparator && !model.disabled
hoverEnabled: false
text: model.compactNameWrapped ?? model.compactName ?? model.displayWrapped ?? model.display
Accessible.role: Accessible.ListItem
Accessible.description: root.description !== root.text ? root.description : ""
Accessible.onPressAction: {
root.forceActiveFocus() // trigger is focus guarded
action.trigger()
}
// Using an action so that it can be replaced or manually triggered
// using `model` () instead of `root.model` leads to errors about
// `model` not having the trigger() function
action: T.Action {
onTriggered: {
// Unless we're showing search results, eat the activation if we
// don't have focus, to prevent the return/enter key from
// inappropriately activating unfocused items
// Also block activation while dragging.
if ((!root.activeFocus && !root.isSearchResult) || dragHandler.active || touchDragHandler.active) {
return;
}
root.view.currentIndex = root.index
// if successfully triggered, close popup
if (root.view.model.trigger && root.view.model.trigger(root.index, "", null)) {
if (kickoff.hideOnWindowDeactivate) {
kickoff.expanded = false;
}
}
}
}
function performDrag(handler: DragHandler): void {
if (!handler.active) {
kickoff.dragSource.Drag.active = false;
kickoff.dragSource.Drag.imageSource = "";
kickoff.dragSource.sourceItem = null;
return;
}
root.dragIconItem.grabToImage(result => {
if (!handler.active) {
return;
}
kickoff.dragSource.sourceItem = root;
kickoff.dragSource.Drag.imageSource = result.url;
kickoff.dragSource.Drag.mimeData = {
"text/uri-list" : [root.url]
};
kickoff.dragSource.Drag.active = handler.active;
});
}
DragHandler {
id: dragHandler
acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad | PointerDevice.Stylus
enabled: root.dragEnabled && root.dragIconItem !== null
target: null // Using this Item fixes drag and drop causing delegates to reset to a 0 X position and overlapping each other.
onActiveChanged: root.performDrag(this)
}
DragHandler {
id: touchDragHandler
acceptedDevices: PointerDevice.TouchScreen
enabled: dragHandler.enabled
target: null
yAxis.enabled: false
onActiveChanged: root.performDrag(this)
}
MouseArea {
id: mouseArea
parent: root
anchors.fill: parent
anchors.margins: 1
// Flickable margins are not mirrored, so disable layout mirroring
LayoutMirroring.enabled: false
// Only for ListView since extending margins for GridView is hard
anchors.leftMargin: root.view instanceof ListView ? -root.view.leftMargin : anchors.margins
anchors.rightMargin: root.view instanceof ListView ? -root.view.rightMargin : anchors.margins
hoverEnabled: root.view
// When the movedWithWheel condition is broken, this ensures that
// onEntered is called again without moving the mouse.
&& !root.view.movedWithWheel
// Fix VerticalStackView animation causing view currentIndex
// to change while delegates are moving under the mouse cursor
&& kickoff.fullRepresentationItem && !kickoff.fullRepresentationItem.contentItem.busy && !kickoff.fullRepresentationItem.blockingHoverFocus
acceptedButtons: Qt.LeftButton | Qt.RightButton
onEntered: {
// - When the movedWithKeyboard condition is broken, we do not want to
// select the hovered item without moving the mouse.
// - Don't highlight separators.
// - Don't switch category items on hover if the setting isn't enabled
if (root.view.movedWithKeyboard || root.isSeparator
|| (root.isCategoryListItem && !Plasmoid.configuration.switchCategoryOnHover)) {
return
}
// forceActiveFocus() touches multiple items, so check for
// activeFocus first to be more efficient. Keep activeFocus
// stable if it's on the searchField to avoid unintentional
// activation with Space key presses.
if (!root.activeFocus && !kickoff.searchField?.activeFocus) {
root.forceActiveFocus(Qt.MouseFocusReason)
}
// No need to check currentIndex first because it's
// built into QQuickListView::setCurrentIndex() already
root.view.currentIndex = root.index
}
onPressed: mouse => {
// Select and focus on press to improve responsiveness and touch feedback
root.view.currentIndex = root.index
root.forceActiveFocus(Qt.MouseFocusReason)
// We normally try to open right click menus on press like Qt Widgets
if (mouse.button === Qt.RightButton) {
root.openActionMenu(mouseX, mouseY)
}
}
onClicked: mouse => {
if (mouse.button === Qt.LeftButton) {
root.action.trigger()
}
}
TapHandler {
acceptedDevices: PointerDevice.TouchScreen
onLongPressed: root.openActionMenu(point.position.x, point.position.y)
}
}
PC3.ToolTip.text: {
if (root.labelTruncated) {
return model?.display ?? ""
} else if (root.descriptionTruncated || (!root.descriptionVisible && (root.isSearchResult
|| Plasmoid.configuration.appNameFormat > 1))) {
return description
}
return ""
}
PC3.ToolTip.visible: mouseArea.containsMouse && PC3.ToolTip.text.length > 0
PC3.ToolTip.delay: Kirigami.Units.toolTipDelay
background: Loader {
active: (root.GridView?.isCurrentItem || root.ListView?.isCurrentItem) ?? false
sourceComponent: PlasmaExtras.Highlight {
anchors.fill: parent
z: (root.Drag.active ?? false) ? 3 : 0
hovered: true
pressed: root.down && !root.isCategoryListItem
active: root.view.activeFocus ||
(kickoff.contentArea === root && kickoff.searchField.activeFocus)
}
}
}
@@ -0,0 +1,92 @@
/*
SPDX-FileCopyrightText: 2013 Aurélien Gâteau <agateau@kde.org>
SPDX-FileCopyrightText: 2014-2015 Eike Hein <hein@kde.org>
SPDX-FileCopyrightText: 2021 Mikel Johnson <mikel5764@gmail.com>
SPDX-FileCopyrightText: 2021 Noah Davis <noahadvs@gmail.com>
SPDX-FileCopyrightText: 2024 ivan tkachenko <me@ratijas.tk>
SPDX-License-Identifier: GPL-2.0-or-later
*/
pragma ComponentBehavior: Bound
pragma Singleton // NOTE: Singletons are shared between all instances of a plasmoid
import QtQuick
import org.kde.plasma.plasmoid
import org.kde.plasma.extras as PlasmaExtras
import "code/tools.js" as Tools
Item {
id: root
property var actionList: null
// Only one action menu can be open at a time, so this should be safe to use.
property PlasmoidItem plasmoid: null
// Not a QQC1 Menu. It's actually a custom QObject that uses a QMenu.
readonly property PlasmaExtras.Menu menu: PlasmaExtras.Menu {
id: menu
visualParent: null
placement: PlasmaExtras.Menu.BottomPosedLeftAlignedPopup
}
visible: false
Instantiator {
active: root.actionList !== null
model: root.actionList
delegate: menuItemComponent
onObjectAdded: (index, object) => menu.addMenuItem(object)
onObjectRemoved: (index, object) => menu.removeMenuItem(object)
}
Component {
id: menuComponent
PlasmaExtras.Menu {}
}
Component {
id: menuItemComponent
PlasmaExtras.MenuItem {
id: menuItem
required property var modelData
readonly property PlasmaExtras.Menu subMenu: modelData.subActions
? menuComponent.createObject(this, { visualParent: action }) as PlasmaExtras.Menu
: null
text: modelData.text ?? ""
enabled: modelData.type !== "title" && (modelData.enabled ?? true)
separator: modelData.type === "separator"
section: modelData.type === "title"
icon: modelData.icon ?? null
checkable: modelData.checkable ?? false
checked: modelData.checked ?? false
readonly property Instantiator __instantiator: Instantiator {
active: menuItem.subMenu !== null
model: menuItem.modelData.subActions
delegate: menuItemComponent
onObjectAdded: (index, object) => menuItem.subMenu.addMenuItem(object)
onObjectRemoved: (index, object) => menuItem.subMenu.removeMenuItem(object)
}
onClicked: {
const modelActionTriggered = Tools.triggerAction(
menu.visualParent.view.model,
menu.visualParent.index,
modelData.actionId,
modelData.actionArgument
)
// close early (if marked as such) to be more responsive to user input
if (modelActionTriggered && root.plasmoid.hideOnWindowDeactivate) {
root.plasmoid.expanded = false
}
}
}
}
}
@@ -0,0 +1,309 @@
/*
* SPDX-FileCopyrightText: 2021 Noah Davis <noahadvs@gmail.com>
* SPDX-License-Identifier: LGPL-2.0-or-later
*/
pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Templates as T
import org.kde.plasma.private.kicker as Kicker
import org.kde.kirigami as Kirigami
import org.kde.plasma.plasmoid
import org.kde.plasma.extras as PlasmaExtras
BasePage {
id: root
property real flashFavorite: 0
// Flash favorites when adding one.
SequentialAnimation {
id: flashFavoriteAnimation
loops: 2
alwaysRunToEnd: true
NumberAnimation {
target: root
property: "flashFavorite"
from: 0
to: 1
duration: Kirigami.Units.veryLongDuration
easing.type: Easing.OutCubic
}
NumberAnimation {
target: root
property: "flashFavorite"
to: 0
duration: Kirigami.Units.veryLongDuration
easing.type: Easing.OutCubic
}
}
Connections {
target: kickoff.rootModel.favoritesModel
function onFavoriteAdded() : void {
flashFavoriteAnimation.restart();
}
}
sideBarComponent: KickoffListView {
id: sideBar
focus: true // needed for Loaders
model: kickoff.rootModel
isSidebar: true
// needed otherwise app displayed at top-level will show a first character as group.
section.property: ""
delegate: KickoffListDelegate {
id: sideBarDelegate
width: view.availableWidth
isCategoryListItem: true
background: PlasmaExtras.Highlight {
// I have to do this for it to actually fill the item for some reason
anchors.fill: parent
active: false
hovered: sideBarDelegate.mouseArea.containsMouse || (flashFavoriteAnimation.running && sideBarDelegate.index === 0) || ((dropAreaLoader.item as DropArea)?.containsAcceptableDrag ?? false) || sideBarDelegate.ListView.isCurrentItem
visible: !sideBarDelegate.isSeparator && hovered
opacity: flashFavoriteAnimation.running && sideBarDelegate.index === 0 ? root.flashFavorite : 1
}
component FavoritesDropArea: DropArea {
// should be "as AbstractKickoffItemDelegate", but the type system gets confused when changing view style at runtime
readonly property Item draggedItem: kickoff.dragSource.sourceItem
readonly property bool acceptableDrag: draggedItem && !kickoff.rootModel.favoritesModel.isFavorite(draggedItem.model.favoriteId)
readonly property bool containsAcceptableDrag: acceptableDrag && containsDrag
function evaluateEvent(event: DragEvent) : void {
if (acceptableDrag) {
event.accept(Qt.CopyAction)
} else {
event.accept(Qt.IgnoreAction)
}
}
}
Loader {
id: dropAreaLoader
anchors.fill: parent
active: sideBarDelegate.index === 0 && !!kickoff.dragSource.sourceItem
sourceComponent: FavoritesDropArea {
onPositionChanged: event => evaluateEvent(event)
onEntered: event => evaluateEvent(event)
onDropped: event => {
if (acceptableDrag && !sideBarDelegate.ListView.isCurrentItem) {
kickoff.rootModel.favoritesModel.addFavorite(draggedItem.model.favoriteId, sideBar.model.favoritesModel.count)
event.accept(Qt.CopyAction)
} else {
event.accept(Qt.IgnoreAction)
}
}
}
}
}
}
contentAreaComponent: VerticalStackView {
id: stackView
popEnter: Transition {
NumberAnimation {
property: "x"
from: 0.5 * root.width
to: 0
duration: Kirigami.Units.longDuration
easing.type: Easing.OutCubic
}
NumberAnimation {
property: "opacity"
from: 0.0
to: 1.0
duration: Kirigami.Units.longDuration
easing.type: Easing.OutCubic
}
}
pushEnter: Transition {
NumberAnimation {
property: "x"
from: 0.5 * -root.width
to: 0
duration: Kirigami.Units.longDuration
easing.type: Easing.OutCubic
}
NumberAnimation {
property: "opacity"
from: 0.0
to: 1.0
duration: Kirigami.Units.longDuration
easing.type: Easing.OutCubic
}
}
readonly property string preferredFavoritesViewObjectName: Plasmoid.configuration.favoritesDisplay === 0 ? "favoritesGridView" : "favoritesListView"
readonly property Component preferredFavoritesViewComponent: Plasmoid.configuration.favoritesDisplay === 0 ? favoritesGridViewComponent : favoritesListViewComponent
readonly property string preferredAllAppsViewObjectName: Plasmoid.configuration.applicationsDisplay === 0 ? "listOfGridsView" : "applicationsListView"
readonly property Component preferredAllAppsViewComponent: Plasmoid.configuration.applicationsDisplay === 0 ? listOfGridsViewComponent : applicationsListViewComponent
readonly property string preferredAppsViewObjectName: Plasmoid.configuration.applicationsDisplay === 0 ? "applicationsGridView" : "applicationsListView"
readonly property Component preferredAppsViewComponent: Plasmoid.configuration.applicationsDisplay === 0 ? applicationsGridViewComponent : applicationsListViewComponent
// NOTE: The 0 index modelForRow isn't supposed to be used. That's just how it works.
// But to trigger model data update, set initial value to 0
property int appsModelRow: 0
readonly property Kicker.AppsModel appsModel: kickoff.rootModel.modelForRow(appsModelRow)
Connections {
target: kickoff.rootModel
function onRefreshed() { // recalculate appsModel binding on rootModel refresh;
stackView.appsModelRowChanged() // modelForRow does not create dependency
}
}
focus: true
initialItem: preferredFavoritesViewComponent
function showSectionView(sectionName: string, parentView: KickoffListView): void {
stackView.push(applicationsSectionViewComponent, {
currentSection: sectionName,
parentView,
});
}
Component {
id: favoritesListViewComponent
DropAreaListView {
id: favoritesListView
objectName: "favoritesListView"
mainContentView: true
focus: true
model: kickoff.rootModel.favoritesModel
}
}
Component {
id: favoritesGridViewComponent
DropAreaGridView {
id: favoritesGridView
objectName: "favoritesGridView"
focus: true
model: kickoff.rootModel.favoritesModel
}
}
Component {
id: applicationsListViewComponent
KickoffListView {
id: applicationsListView
objectName: "applicationsListView"
mainContentView: true
model: stackView.appsModel
// we want to semantically switch between group and "", disabling grouping, workaround for QTBUG-121797
section.property: model && model.description === "KICKER_ALL_MODEL" ? "group" : "_unset"
section.criteria: ViewSection.FirstCharacter
hasSectionView: stackView.appsModelRow === 1
onShowSectionViewRequested: sectionName => {
stackView.showSectionView(sectionName, this);
}
}
}
Component {
id: applicationsSectionViewComponent
SectionView {
id: sectionView
model: stackView.appsModel.sections
onHideSectionViewRequested: index => {
stackView.pop();
stackView.currentItem.view.positionViewAtIndex(index, ListView.Beginning);
stackView.currentItem.currentIndex = index;
}
}
}
Component {
id: applicationsGridViewComponent
KickoffGridView {
id: applicationsGridView
objectName: "applicationsGridView"
model: stackView.appsModel
}
}
Component {
id: listOfGridsViewComponent
ListOfGridsView {
id: listOfGridsView
objectName: "listOfGridsView"
mainContentView: true
gridModel: stackView.appsModel
onShowSectionViewRequested: sectionName => {
stackView.showSectionView(sectionName, this);
}
}
}
onPreferredFavoritesViewComponentChanged: {
if (root.sideBarItem !== null && root.sideBarItem.currentIndex === 0) {
stackView.replace(stackView.preferredFavoritesViewComponent)
}
}
onPreferredAllAppsViewComponentChanged: {
if (root.sideBarItem !== null && root.sideBarItem.currentIndex === 1) {
stackView.replace(stackView.preferredAllAppsViewComponent)
}
}
onPreferredAppsViewComponentChanged: {
if (root.sideBarItem !== null && root.sideBarItem.currentIndex > 1) {
stackView.replace(stackView.preferredAppsViewComponent)
}
}
Connections {
target: root.sideBarItem
function onCurrentIndexChanged() {
// Only update row index if the condition is met.
// The 0 index modelForRow isn't supposed to be used. That's just how it works.
if (root.sideBarItem.currentIndex > 0) {
stackView.appsModelRow = root.sideBarItem.currentIndex
}
if (root.sideBarItem.currentIndex === 0
&& stackView.currentItem.objectName !== stackView.preferredFavoritesViewObjectName) {
stackView.replace(stackView.preferredFavoritesViewComponent)
} else if (root.sideBarItem.currentIndex === 1
&& stackView.currentItem.objectName !== stackView.preferredAllAppsViewObjectName) {
stackView.replace(stackView.preferredAllAppsViewComponent)
} else if (root.sideBarItem.currentIndex > 1
&& stackView.currentItem.objectName !== stackView.preferredAppsViewObjectName) {
stackView.replace(stackView.preferredAppsViewComponent)
}
}
}
Connections {
target: kickoff
function onExpandedChanged() {
if (!kickoff.expanded && kickoff.contentArea.currentItem) {
kickoff.contentArea.currentItem.forceActiveFocus()
}
}
}
}
// NormalPage doesn't get destroyed when deactivated, so the binding uses
// StackView.status and visible. This way the bindings are reset when
// NormalPage is Activated again.
Binding {
target: kickoff
property: "sideBar"
value: root.sideBarItem
when: root.T.StackView.status === T.StackView.Active && root.visible
restoreMode: Binding.RestoreBinding
}
Binding {
target: kickoff
property: "contentArea"
value: root.contentAreaItem.currentItem // NOT just root.contentAreaItem
when: root.T.StackView.status === T.StackView.Active && root.visible
restoreMode: Binding.RestoreBinding
}
}
@@ -0,0 +1,132 @@
/*
SPDX-FileCopyrightText: 2011 Martin Gräßlin <mgraesslin@kde.org>
SPDX-FileCopyrightText: 2012 Marco Martin <mart@kde.org>
SPDX-FileCopyrightText: 2015-2018 Eike Hein <hein@kde.org>
SPDX-FileCopyrightText: 2021 Mikel Johnson <mikel5764@gmail.com>
SPDX-FileCopyrightText: 2021 Noah Davis <noahadvs@gmail.com>
SPDX-License-Identifier: GPL-2.0-or-later
*/
pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Layouts
import QtQuick.Templates as T
import org.kde.ksvg as KSvg
import org.kde.plasma.plasmoid
import org.kde.plasma.workspace.trianglemousefilter
FocusScope {
id: root
property real preferredSideBarWidth: implicitSideBarWidth
property real preferredSideBarHeight: implicitSideBarHeight
property alias sideBarComponent: sideBarLoader.sourceComponent
property alias sideBarItem: sideBarLoader.item
property alias contentAreaComponent: contentAreaLoader.sourceComponent
property alias contentAreaItem: contentAreaLoader.item
property alias implicitSideBarWidth: sideBarLoader.implicitWidth
property alias implicitSideBarHeight: sideBarLoader.implicitHeight
implicitWidth: preferredSideBarWidth + separator.implicitWidth + contentAreaLoader.implicitWidth
implicitHeight: Math.max(preferredSideBarHeight, contentAreaLoader.implicitHeight)
TriangleMouseFilter {
id: sideBarFilter
active: Plasmoid.configuration.switchCategoryOnHover
anchors {
top: parent.top
left: parent.left
bottom: parent.bottom
}
LayoutMirroring.enabled: kickoff.sideBarOnRight
implicitWidth: root.preferredSideBarWidth
implicitHeight: root.preferredSideBarHeight
edge: kickoff.sideBarOnRight ? Qt.LeftEdge : Qt.RightEdge
blockFirstEnter: true
Loader {
id: sideBarLoader
anchors.fill: parent
// When positioned after the content area, Tab should go to the start of the footer focus chain
Keys.onTabPressed: event => {
(kickoff.paneSwap ? kickoff.footer.nextItemInFocusChain() : contentAreaLoader)
.forceActiveFocus(Qt.TabFocusReason);
}
Keys.onBacktabPressed: event => {
(kickoff.paneSwap ? contentAreaLoader : kickoff.header.pinButton)
.forceActiveFocus(Qt.BacktabFocusReason);
}
Keys.onLeftPressed: event => {
if (kickoff.sideBarOnRight) {
contentAreaLoader.forceActiveFocus();
}
}
Keys.onRightPressed: event => {
if (!kickoff.sideBarOnRight) {
contentAreaLoader.forceActiveFocus();
}
}
Keys.onUpPressed: event => {
kickoff.header.nextItemInFocusChain()
.forceActiveFocus(Qt.BacktabFocusReason);
}
Keys.onDownPressed: event => {
(kickoff.paneSwap ? kickoff.footer.leaveButtons.nextItemInFocusChain() : kickoff.footer.tabBar)
.forceActiveFocus(Qt.TabFocusReason);
}
}
}
KSvg.SvgItem {
id: separator
anchors {
top: parent.top
left: sideBarFilter.right
bottom: parent.bottom
}
LayoutMirroring.enabled: kickoff.sideBarOnRight
implicitWidth: naturalSize.width
implicitHeight: implicitWidth
elementId: "vertical-line"
svg: KickoffSingleton.lineSvg
}
Loader {
id: contentAreaLoader
focus: true
anchors {
top: parent.top
left: separator.right
right: parent.right
bottom: parent.bottom
}
LayoutMirroring.enabled: kickoff.sideBarOnRight
// When positioned after the sidebar, Tab should go to the start of the footer focus chain
Keys.onTabPressed: event => {
(kickoff.paneSwap ? sideBarLoader : kickoff.footer.nextItemInFocusChain())
.forceActiveFocus(Qt.TabFocusReason)
}
Keys.onBacktabPressed: event => {
(kickoff.paneSwap ? kickoff.header.avatar : sideBarLoader)
.forceActiveFocus(Qt.BacktabFocusReason)
}
Keys.onLeftPressed: event => {
if (!kickoff.sideBarOnRight) {
sideBarLoader.forceActiveFocus();
}
}
Keys.onRightPressed: event => {
if (kickoff.sideBarOnRight) {
sideBarLoader.forceActiveFocus();
}
}
Keys.onUpPressed: event => {
kickoff.searchField.forceActiveFocus(Qt.BacktabFocusReason);
}
Keys.onDownPressed: event => {
(kickoff.paneSwap ? kickoff.footer.tabBar : kickoff.footer.leaveButtons.nextItemInFocusChain())
.forceActiveFocus(Qt.TabFocusReason)
}
}
}
@@ -0,0 +1,40 @@
set_source_files_properties(KickoffSingleton.qml ActionMenu.qml PROPERTIES QT_QML_SINGLETON_TYPE TRUE)
plasma_add_applet(org.kde.plasma.kickoff
QML_SOURCES
config.qml
main.xml
AbstractKickoffItemDelegate.qml
ActionMenu.qml
ApplicationsPage.qml
BasePage.qml
ConfigGeneral.qml
DropAreaGridView.qml
DropAreaListView.qml
EmptyPage.qml
Footer.qml
FullRepresentation.qml
Header.qml
HorizontalStackView.qml
KickoffDropArea.qml
KickoffGridDelegate.qml
KickoffGridView.qml
KickoffListDelegate.qml
KickoffListView.qml
KickoffSingleton.qml
LeaveButtons.qml
ListOfGridsView.qml
ListOfGridsViewDelegate.qml
NormalPage.qml
PlacesPage.qml
SectionView.qml
VerticalStackView.qml
main.qml
RESOURCES
main.xml
GENERATE_APPLET_CLASS
QML_ARGS
NO_LINT # https://qt-project.atlassian.net/browse/QTBUG-145572
)
ecm_target_qml_sources(org.kde.plasma.kickoff SOURCES code/tools.js PATH code)
@@ -0,0 +1,331 @@
/*
SPDX-FileCopyrightText: 2013 David Edmundson <davidedmundson@kde.org>
SPDX-FileCopyrightText: 2021 Mikel Johnson <mikel5764@gmail.com>
SPDX-FileCopyrightText: 2022 Nate Graham <nate@kde.org>
SPDX-FileCopyrightText: 2022 ivan tkachenko <me@ratijas.tk>
SPDX-License-Identifier: GPL-2.0-or-later
*/
pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls as QQC2
import org.kde.plasma.core as PlasmaCore
import org.kde.ksvg as KSvg
import org.kde.iconthemes as KIconThemes
import org.kde.kirigami as Kirigami
import org.kde.kcmutils as KCM
import org.kde.config as KConfig
import org.kde.plasma.plasmoid
import "code/tools.js" as Tools
KCM.SimpleKCM {
id: root
property string cfg_menuLabel: menuLabel.text
property string cfg_icon: Plasmoid.configuration.icon
property alias cfg_appNameFormat: appNameFormat.currentIndex
property bool cfg_paneSwap: Plasmoid.configuration.paneSwap
property int cfg_favoritesDisplay: Plasmoid.configuration.favoritesDisplay
property int cfg_applicationsDisplay: Plasmoid.configuration.applicationsDisplay
property alias cfg_alphaSort: alphaSort.checked
property var cfg_systemFavorites: String(Plasmoid.configuration.systemFavorites)
property int cfg_primaryActions: Plasmoid.configuration.primaryActions
property alias cfg_showActionButtonCaptions: showActionButtonCaptions.checked
property alias cfg_compactMode: compactModeCheckbox.checked
property alias cfg_highlightNewlyInstalledApps: highlightNewlyInstalledAppsCheckbox.checked
property alias cfg_switchCategoryOnHover: switchCategoryOnHoverCheckbox.checked
Kirigami.FormLayout {
QQC2.Button {
id: iconButton
Kirigami.FormData.label: i18nc("@label prefix for icon-only button", "Icon:") // qmllint disable unqualified
implicitWidth: previewFrame.width + Kirigami.Units.smallSpacing * 2
implicitHeight: previewFrame.height + Kirigami.Units.smallSpacing * 2
hoverEnabled: true
Accessible.name: i18nc("@action:button", "Change Application Launcher's icon") // qmllint disable unqualified
Accessible.description: i18nc("@info:whatsthis", "Current icon is %1. Click to open menu to change the current icon or reset to the default icon.", root.cfg_icon) // qmllint disable unqualified
Accessible.role: Accessible.ButtonMenu
QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay
QQC2.ToolTip.text: i18nc("@info:tooltip", "Icon name is \"%1\"", root.cfg_icon) // qmllint disable unqualified
QQC2.ToolTip.visible: iconButton.hovered && root.cfg_icon.length > 0
KIconThemes.IconDialog {
id: iconDialog
onAccepted: {
root.cfg_icon = iconName || Tools.defaultIconName;
}
}
onPressed: iconMenu.opened ? iconMenu.close() : iconMenu.open()
KSvg.FrameSvgItem {
id: previewFrame
anchors.centerIn: parent
imagePath: Plasmoid.formFactor === PlasmaCore.Types.Vertical || Plasmoid.formFactor === PlasmaCore.Types.Horizontal
? "widgets/panel-background" : "widgets/background"
width: Kirigami.Units.iconSizes.large + fixedMargins.left + fixedMargins.right
height: Kirigami.Units.iconSizes.large + fixedMargins.top + fixedMargins.bottom
Kirigami.Icon {
anchors.centerIn: parent
width: Kirigami.Units.iconSizes.large
height: width
source: Tools.iconOrDefault(Plasmoid.formFactor, root.cfg_icon)
}
}
QQC2.Menu {
id: iconMenu
// Appear below the button
y: parent.height
QQC2.MenuItem {
text: i18nc("@item:inmenu Open icon chooser dialog", "Choose…") // qmllint disable unqualified
icon.name: "document-open-folder"
Accessible.description: i18nc("@info:whatsthis", "Choose an icon for Application Launcher") // qmllint disable unqualified
onClicked: iconDialog.open()
}
QQC2.MenuItem {
text: i18nc("@item:inmenu Reset icon to default", "Reset to default icon") // qmllint disable unqualified
icon.name: "edit-clear"
enabled: root.cfg_icon !== Tools.defaultIconName
onClicked: root.cfg_icon = Tools.defaultIconName
}
QQC2.MenuItem {
text: i18nc("@action:inmenu", "Remove icon") // qmllint disable unqualified
icon.name: "delete"
enabled: root.cfg_icon !== "" && menuLabel.text && Plasmoid.formFactor !== PlasmaCore.Types.Vertical
onClicked: root.cfg_icon = ""
}
}
}
Kirigami.ActionTextField {
id: menuLabel
enabled: Plasmoid.formFactor !== PlasmaCore.Types.Vertical
Kirigami.FormData.label: i18nc("@label:textbox", "Text label:") // qmllint disable unqualified
text: Plasmoid.configuration.menuLabel
placeholderText: i18nc("@info:placeholder", "Type here to add a text label") // qmllint disable unqualified
onTextEdited: {
root.cfg_menuLabel = menuLabel.text
// This is to make sure that we always have a icon if there is no text.
// If the user remove the icon and remove the text, without this, we'll have no icon and no text.
// This is to force the icon to be there.
if (!menuLabel.text) {
root.cfg_icon = root.cfg_icon || Tools.defaultIconName
}
}
rightActions: QQC2.Action {
icon.name: "edit-clear"
enabled: menuLabel.text !== ""
text: i18nc("@action:button", "Reset menu label") // qmllint disable unqualified
onTriggered: {
menuLabel.clear()
root.cfg_menuLabel = ""
root.cfg_icon = root.cfg_icon || Tools.defaultIconName
}
}
}
QQC2.Label {
Layout.fillWidth: true
Layout.maximumWidth: Kirigami.Units.gridUnit * 25
visible: Plasmoid.formFactor === PlasmaCore.Types.Vertical
text: i18nc("@info", "A text label cannot be set when the Panel is vertical.") // qmllint disable unqualified
wrapMode: Text.Wrap
font: Kirigami.Theme.smallFont
}
Item {
Kirigami.FormData.isSection: true
}
QQC2.ComboBox {
id: appNameFormat
Kirigami.FormData.label: i18nc("@label:listbox", "Show applications as:") // qmllint disable unqualified
model: [i18nc("@item:inlistbox", "Name only"), i18nc("@item:inlistbox", "Description only"), i18nc("@item:inlistbox", "Name (Description)"), i18nc("@item:inlistbox", "Description (Name)")] // qmllint disable unqualified
}
Item {
Kirigami.FormData.isSection: true
}
RowLayout {
Kirigami.FormData.label: i18nc("General options", "General:") // qmllint disable unqualified
spacing: Kirigami.Units.smallSpacing
QQC2.CheckBox {
id: alphaSort
text: i18nc("@option:check", "Sort applications alphabetically") // qmllint disable unqualified
}
Kirigami.ContextualHelpButton {
toolTipText: i18nc("@info:whatsthis", "This doesn't affect how applications are sorted in either search results or the favorites page.") // qmllint disable unqualified
}
}
QQC2.CheckBox {
id: compactModeCheckbox
text: i18nc("@option:check", "Use compact list item style") // qmllint disable unqualified
checked: Plasmoid.configuration.compactMode
}
QQC2.CheckBox {
id: highlightNewlyInstalledAppsCheckbox
text: i18nc("@option:check", "Highlight newly-installed applications") // qmllint disable unqualified
}
QQC2.CheckBox {
id: switchCategoryOnHoverCheckbox
text: i18nc("@option:check", "Switch sidebar categories when hovering over them") // qmllint disable unqualified
}
QQC2.Button {
enabled: KConfig.KAuthorized.authorizeControlModule("kcm_plasmasearch")
icon.name: "settings-configure"
text: i18nc("@action:button opens plasmasearch kcm", "Configure Search Plugins…") // qmllint disable unqualified
onClicked: KCM.KCMLauncher.openSystemSettings("kcm_plasmasearch")
}
Item {
Kirigami.FormData.isSection: true
}
QQC2.RadioButton {
id: paneSwapOff
Kirigami.FormData.label: i18nc("@label:group prefix for radio button group", "Sidebar position:") // qmllint disable unqualified
text: mirrored ? i18nc("@option:radio sidebar position", "Right") : i18nc("option:radio sidebar position", "Left") // qmllint disable unqualified
QQC2.ButtonGroup.group: paneSwapGroup
property int index: 0
checked: !Plasmoid.configuration.paneSwap
}
QQC2.RadioButton {
id: paneSwapOn
text: mirrored ? i18nc("@option:radio sidebar position", "Left") : i18nc("@option:radio sidebar position", "Right") // qmllint disable unqualified
QQC2.ButtonGroup.group: paneSwapGroup
property int index: 1
checked: Plasmoid.configuration.paneSwap
}
QQC2.RadioButton {
id: showFavoritesInGrid
Kirigami.FormData.label: i18nc("@title:group prefix for radio button group", "Show favorites:") // qmllint disable unqualified
text: i18nc("@option:radio Part of a sentence: 'Show favorites in a grid'", "In a grid") // qmllint disable unqualified
QQC2.ButtonGroup.group: favoritesDisplayGroup
property int index: 0
checked: Plasmoid.configuration.favoritesDisplay === index
}
QQC2.RadioButton {
id: showFavoritesInList
text: i18nc("@option:radio Part of a sentence: 'Show favorites in a list'", "In a list") // qmllint disable unqualified
QQC2.ButtonGroup.group: favoritesDisplayGroup
property int index: 1
checked: Plasmoid.configuration.favoritesDisplay === index
}
QQC2.RadioButton {
id: showAppsInGrid
Kirigami.FormData.label: i18nc("@title:group prefix for radio button group", "Show other applications:") // qmllint disable unqualified
text: i18nc("@option:radio Part of a sentence: 'Show other applications in a grid'", "In a grid") // qmllint disable unqualified
QQC2.ButtonGroup.group: applicationsDisplayGroup
property int index: 0
checked: Plasmoid.configuration.applicationsDisplay === index
}
QQC2.RadioButton {
id: showAppsInList
text: i18nc("@option:radio Part of a sentence: 'Show other applications in a list'", "In a list") // qmllint disable unqualified
QQC2.ButtonGroup.group: applicationsDisplayGroup
property int index: 1
checked: Plasmoid.configuration.applicationsDisplay === index
}
Item {
Kirigami.FormData.isSection: true
}
QQC2.RadioButton {
id: powerActionsButton
Kirigami.FormData.label: i18nc("@title:group prefix for radio button group", "Show buttons for:") // qmllint disable unqualified
text: i18nc("@option:radio Show buttons for", "Power") // qmllint disable unqualified
QQC2.ButtonGroup.group: radioGroup
property string actions: "suspend,hibernate,reboot,shutdown"
property int index: 0
checked: Plasmoid.configuration.primaryActions === index
}
QQC2.RadioButton {
id: sessionActionsButton
text: i18nc("@option:radio Show buttons for", "Session") // qmllint disable unqualified
QQC2.ButtonGroup.group: radioGroup
property string actions: "lock-screen,logout,save-session,switch-user"
property int index: 1
checked: Plasmoid.configuration.primaryActions === index
}
QQC2.RadioButton {
id: allActionsButton
text: i18nc("@option:radio Show buttons for", "Power and session") // qmllint disable unqualified
QQC2.ButtonGroup.group: radioGroup
property string actions: "lock-screen,logout,save-session,switch-user,suspend,hibernate,reboot,shutdown"
property int index: 3
checked: Plasmoid.configuration.primaryActions === index
}
QQC2.CheckBox {
id: showActionButtonCaptions
text: i18nc("@option:check", "Show action button captions") // qmllint disable unqualified
}
}
QQC2.ButtonGroup {
id: paneSwapGroup
onCheckedButtonChanged: {
if (checkedButton) {
root.cfg_paneSwap = checkedButton.index === 1
}
}
}
QQC2.ButtonGroup {
id: favoritesDisplayGroup
onCheckedButtonChanged: {
if (checkedButton) {
root.cfg_favoritesDisplay = checkedButton.index
}
}
}
QQC2.ButtonGroup {
id: applicationsDisplayGroup
onCheckedButtonChanged: {
if (checkedButton) {
root.cfg_applicationsDisplay = checkedButton.index
}
}
}
QQC2.ButtonGroup {
id: radioGroup
onCheckedButtonChanged: {
if (checkedButton) {
root.cfg_primaryActions = checkedButton.index
root.cfg_systemFavorites = checkedButton.actions
}
}
}
}
@@ -0,0 +1,20 @@
/*
* SPDX-FileCopyrightText: 2021 Noah Davis <noahadvs@gmail.com>
* SPDX-License-Identifier: LGPL-2.0-or-later
*/
pragma ComponentBehavior: Bound
import QtQuick
KickoffGridView {
id: root
KickoffDropArea {
z: -1
parent: root
anchors.fill: parent
targetView: root.view
scrollUpMargin: root.header.height * 2
scrollDownMargin: root.footer.height * 2
}
}
@@ -0,0 +1,20 @@
/*
* SPDX-FileCopyrightText: 2021 Noah Davis <noahadvs@gmail.com>
* SPDX-License-Identifier: LGPL-2.0-or-later
*/
pragma ComponentBehavior: Bound
import QtQuick
KickoffListView {
id: root
KickoffDropArea {
z: -1
parent: root
anchors.fill: parent
targetView: root.view
scrollUpMargin: root.header.height * 2
scrollDownMargin: root.footer.height * 2
}
}
@@ -0,0 +1,32 @@
/* SPDX-FileCopyrightText: 2021 Noah Davis <noahadvs@gmail.com>
* SPDX-License-Identifier: LGPL-2.0-or-later
*/
pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Templates as T
/**
* This is meant to be a very basic page that behaves like most pages do,
* but inherits no externally defined content or behavior.
*/
T.Page {
id: root
// implicitHeader/FooterWidth and implicitHeader/FooterHeight are 0 when header/footer is not visible
// using a custom implementation that only checks if defined.
property real implicitHeaderWidth2: header ? header.implicitWidth : 0
property real implicitHeaderHeight2: header ? header.implicitHeight : 0
property real implicitFooterWidth2: footer ? footer.implicitWidth : 0
property real implicitFooterHeight2: footer ? footer.implicitHeight : 0
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
contentWidth + leftPadding + rightPadding,
implicitHeaderWidth2,
implicitFooterWidth2)
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
contentHeight + topPadding + bottomPadding
+ (implicitHeaderHeight2 > 0 ? implicitHeaderHeight2 + spacing : 0)
+ (implicitFooterHeight2 > 0 ? implicitFooterHeight2 + spacing : 0))
Accessible.ignored: true
}
@@ -0,0 +1,213 @@
/*
* SPDX-FileCopyrightText: 2021 Mikel Johnson <mikel5764@gmail.com>
* SPDX-FileCopyrightText: 2021 Noah Davis <noahadvs@gmail.com>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
pragma ComponentBehavior: Bound
import QtQuick
import org.kde.ksvg as KSvg
import org.kde.plasma.components as PC3
import org.kde.plasma.extras as PlasmaExtras
import org.kde.kirigami as Kirigami
PlasmaExtras.PlasmoidHeading {
id: root
readonly property alias tabBar: tabBar
property real preferredTabBarWidth: 0
readonly property alias leaveButtons: leaveButtons
contentWidth: tabBar.implicitWidth + spacing
contentHeight: leaveButtons.implicitHeight
// We use an increased vertical padding to improve touch usability
leftPadding: kickoff.backgroundMetrics.leftPadding
rightPadding: kickoff.backgroundMetrics.rightPadding
topPadding: Kirigami.Units.smallSpacing * 2
bottomPadding: Kirigami.Units.smallSpacing * 2
topInset: 0
leftInset: 0
rightInset: 0
bottomInset: 0
spacing: kickoff.backgroundMetrics.spacing
position: PC3.ToolBar.Footer
PC3.TabBar {
id: tabBar
property real tabWidth: Math.max(applicationsTab.implicitWidth, placesTab.implicitWidth)
focus: true
width: root.preferredTabBarWidth > 0 ? root.preferredTabBarWidth : undefined
implicitWidth: contentWidth + leftPadding + rightPadding
implicitHeight: contentHeight + topPadding + bottomPadding
// This is needed to keep the separators horizontally aligned
leftPadding: mirrored ? root.spacing : 0
rightPadding: !mirrored ? root.spacing : 0
anchors {
top: parent.top
left: parent.left
bottom: parent.bottom
}
position: PC3.TabBar.Footer
contentItem: ListView {
id: tabBarListView
focus: true
model: tabBar.contentModel
currentIndex: tabBar.currentIndex
spacing: tabBar.spacing
orientation: ListView.Horizontal
boundsBehavior: Flickable.StopAtBounds
flickableDirection: Flickable.AutoFlickIfNeeded
snapMode: ListView.SnapToItem
highlightMoveDuration: Kirigami.Units.longDuration
highlightRangeMode: ListView.ApplyRange
preferredHighlightBegin: tabBar.tabWidth
preferredHighlightEnd: width - tabBar.tabWidth
highlight: KSvg.FrameSvgItem {
anchors.top: tabBarListView.contentItem.top
anchors.bottom: tabBarListView.contentItem.bottom
anchors.topMargin: -root.topPadding
anchors.bottomMargin: -root.bottomPadding
imagePath: "widgets/tabbar"
prefix: tabBar.position === PC3.TabBar.Header ? "north-active-tab" : "south-active-tab"
}
keyNavigationEnabled: false
}
PC3.TabButton {
id: applicationsTab
focus: true
width: tabBar.tabWidth
anchors.top: tabBarListView.contentItem.top
anchors.bottom: tabBarListView.contentItem.bottom
anchors.topMargin: -root.topPadding
anchors.bottomMargin: -root.bottomPadding
icon.width: Kirigami.Units.iconSizes.smallMedium
icon.height: Kirigami.Units.iconSizes.smallMedium
icon.name: "applications-all-symbolic"
text: i18nc("@title:tab kickoff sidebar tab", "Applications") // qmllint disable unqualified
Keys.onBacktabPressed: event => {
(kickoff.lastCentralPane || nextItemInFocusChain(false))
.forceActiveFocus(Qt.BacktabFocusReason)
}
}
PC3.TabButton {
id: placesTab
width: tabBar.tabWidth
anchors.top: tabBarListView.contentItem.top
anchors.bottom: tabBarListView.contentItem.bottom
anchors.topMargin: -root.topPadding
anchors.bottomMargin: -root.bottomPadding
icon.width: Kirigami.Units.iconSizes.smallMedium
icon.height: Kirigami.Units.iconSizes.smallMedium
icon.name: "compass"
text: i18nc("@title:tab kickoff sidebar tab", "Places") //Explore? // qmllint disable unqualified
}
Connections {
target: kickoff
function onExpandedChanged() {
if (!kickoff.expanded) {
tabBar.currentIndex = 0
}
}
}
Keys.onPressed: event => {
const Key_Next = Application.layoutDirection === Qt.RightToLeft ? Qt.Key_Left : Qt.Key_Right
const Key_Prev = Application.layoutDirection === Qt.RightToLeft ? Qt.Key_Right : Qt.Key_Left
if (event.key === Key_Next) {
if (currentIndex === count - 1) {
leaveButtons.nextItemInFocusChain().forceActiveFocus(Qt.TabFocusReason)
} else {
incrementCurrentIndex()
currentItem.forceActiveFocus(Qt.TabFocusReason)
}
event.accepted = true
} else if (event.key === Key_Prev && currentIndex > 0) {
decrementCurrentIndex()
currentItem.forceActiveFocus(Qt.BacktabFocusReason)
event.accepted = true
}
}
Keys.onUpPressed: event => {
kickoff.firstCentralPane.forceActiveFocus(Qt.BacktabFocusReason);
}
}
LeaveButtons {
id: leaveButtons
anchors {
top: parent.top
right: parent.right
bottom: parent.bottom
}
// available width for leaveButtons
maximumWidth: root.availableWidth - tabBar.width - root.spacing
Keys.onUpPressed: event => {
kickoff.lastCentralPane.forceActiveFocus(Qt.BacktabFocusReason);
}
}
Behavior on height {
enabled: kickoff.expanded
NumberAnimation {
duration: Kirigami.Units.longDuration
easing.type: Easing.InQuad
}
}
// Using item containing WheelHandler instead of MouseArea because
// MouseArea doesn't keep track to the total amount of rotation.
// Keeping track of the total amount of rotation makes it work
// better for touch pads.
Item {
id: mouseItem
parent: root
anchors.left: parent.left
height: root.height
width: tabBar.width
z: 1 // Has to be above contentItem to receive mouse wheel events
WheelHandler {
id: tabScrollHandler
acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad
onWheel: {
const shouldDec = rotation >= 15
const shouldInc = rotation <= -15
const shouldReset = (rotation > 0 && tabBar.currentIndex === 0) || (rotation < 0 && tabBar.currentIndex === tabBar.count - 1)
if (shouldDec) {
tabBar.decrementCurrentIndex();
rotation = 0
} else if (shouldInc) {
tabBar.incrementCurrentIndex();
rotation = 0
} else if (shouldReset) {
rotation = 0
}
}
}
}
Shortcut {
sequences: ["Ctrl+Tab", "Ctrl+Shift+Tab", StandardKey.NextChild, StandardKey.PreviousChild]
onActivated: {
tabBar.currentIndex = (tabBar.currentIndex === 0) ? 1 : 0;
}
}
}
@@ -0,0 +1,257 @@
/*
SPDX-FileCopyrightText: 2011 Martin Gräßlin <mgraesslin@kde.org>
SPDX-FileCopyrightText: 2012 Gregor Taetzner <gregor@freenet.de>
SPDX-FileCopyrightText: 2012 Marco Martin <mart@kde.org>
SPDX-FileCopyrightText: 2013 2014 David Edmundson <davidedmundson@kde.org>
SPDX-FileCopyrightText: 2014 Sebastian Kügler <sebas@kde.org>
SPDX-FileCopyrightText: 2021 Mikel Johnson <mikel5764@gmail.com>
SPDX-FileCopyrightText: 2021 Noah Davis <noahadvs@gmail.com>
SPDX-License-Identifier: GPL-2.0-or-later
*/
pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Templates as T
import QtQuick.Layouts
import org.kde.plasma.plasmoid
import org.kde.plasma.private.kicker as Kicker
import org.kde.kirigami as Kirigami
import org.kde.plasma.extras as PlasmaExtras
EmptyPage {
id: root
// kickoff is Kickoff.qml
leftPadding: -kickoff.backgroundMetrics.leftPadding
rightPadding: -kickoff.backgroundMetrics.rightPadding
topPadding: 0
bottomPadding: -kickoff.backgroundMetrics.bottomPadding
readonly property var appletInterface: kickoff
Layout.minimumWidth: implicitWidth
Layout.minimumHeight: implicitHeight
property alias normalPage: normalPage
property bool blockingHoverFocus: true
property var interceptedPosition: null
/* NOTE: Important things to know about keyboard input handling:
*
* - Key events are passed up to parent items until the end is reached.
* Be mindful of this when using `Keys.forwardTo`.
*
* - Keys defaults to BeforeItem while KeyNavigation defaults to AfterItem.
*
* - When Keys and KeyNavigation are using the same priority, it seems like
* the one declared first in the QML file gets priority over the other.
*
* - Except for Keys.onPressed, all Keys.on*Pressed signals automatically
* set `event.accepted = true`.
*
* - If you do `item.forceActiveFocus()` and `item` is a focus scope, the
* children of `item` won't necessarily get focus. It seems like
* `forceActiveFocus()` is better for forcing a specific thing to be focused
* while KeyNavigation is better at passing focus down to children of the
* thing you want to focus when dealing with focus scopes.
*
* - KeyNavigation uses BacktabFocusReason (TabFocusReason if mirrored) for left,
* TabFocusReason (BacktabFocusReason if mirrored) for right,
* BacktabFocusReason for up and TabFocusReason for down.
*
* - KeyNavigation does not seem to respect dynamic changes to focus chain
* rules in the reverse direction, which can lead to confusing results.
* It is therefore safer to use Keys for items whose position in the Tab
* order must be changed on demand. (Tested with Qt 5.15.8 on X11.)
*/
header: Header {
id: header
preferredNameAndIconWidth: normalPage.preferredSideBarWidth
Binding {
target: kickoff
property: "header"
value: header
restoreMode: Binding.RestoreBinding
}
}
contentItem: VerticalStackView {
id: contentItemStackView
focus: true
movementTransitionsEnabled: true
implicitHeight: normalPage.implicitHeight + topPadding + bottomPadding
implicitWidth: normalPage.implicitWidth + leftPadding + rightPadding
// Not using a component to prevent it from being destroyed
initialItem: NormalPage {
id: normalPage
objectName: "normalPage"
}
Component {
id: searchViewComponent
KickoffListView {
id: searchView
objectName: "searchView"
mainContentView: true
// Forces the function be re-run every time runnerModel.count changes.
// This is absolutely necessary to make the search view work reliably.
model: kickoff.runnerModel.count ? kickoff.runnerModel.modelForRow(0) : null
delegate: KickoffListDelegate {
width: view.availableWidth
isSearchResult: true
}
section.property: "group"
activeFocusOnTab: true
Keys.onTabPressed: event => {
kickoff.firstHeaderItem.forceActiveFocus(Qt.TabFocusReason);
}
Keys.onBacktabPressed: event => {
kickoff.lastHeaderItem.forceActiveFocus(Qt.BacktabFocusReason);
}
Keys.onUpPressed: event => {
kickoff.searchField.forceActiveFocus(Qt.BacktabFocusReason)
}
T.StackView.onStatusChanged: {
if (T.StackView.status === T.StackView.Activating || T.StackView.status === T.StackView.Activating) {
kickoff.sideBar = null
kickoff.contentArea = searchView
}
}
Loader {
anchors.centerIn: searchView.view
width: searchView.view.width - (Kirigami.Units.gridUnit * 4)
active: searchView.view.count === 0
visible: active
asynchronous: true
sourceComponent: PlasmaExtras.PlaceholderMessage {
id: emptyHint
iconName: "edit-none"
opacity: 0
text: i18nc("@info:status", "No matches") // qmllint disable unqualified
Connections {
target: kickoff.runnerModel
function onQueryFinished() {
showAnimation.restart()
}
}
NumberAnimation {
id: showAnimation
duration: Kirigami.Units.longDuration
easing.type: Easing.OutCubic
property: "opacity"
target: emptyHint
to: 1
}
}
}
}
}
Connections {
target: kickoff
function onExpandedChanged() {
if (!kickoff.expanded) {
root.blockingHoverFocus = true
root.interceptedPosition = null
}
}
}
Connections {
target: blockHoverFocusHandler
enabled: blockHoverFocusHandler.enabled && !root.interceptedPosition
function onPointChanged() {
root.interceptedPosition = blockHoverFocusHandler.point.position
}
}
Connections {
target: blockHoverFocusHandler
enabled: blockHoverFocusHandler.enabled && root.interceptedPosition && root.blockingHoverFocus
function onPointChanged() {
if (blockHoverFocusHandler.point.position === root.interceptedPosition) {
return;
}
root.blockingHoverFocus = false
}
}
HoverHandler {
id: blockHoverFocusHandler
enabled: !contentItemStackView.busy && (!root.interceptedPosition || root.blockingHoverFocus)
}
Keys.priority: Keys.AfterItem
// This is here rather than root because events are implicitly forwarded
// to parent items. Don't want to send multiple events to searchField.
Keys.forwardTo: kickoff.searchField
Connections {
target: root.header
function onSearchTextChanged() {
if ((root.header as Header).searchText.length === 0 &&
contentItemStackView.currentItem.objectName !== "normalPage") {
contentItemStackView.reverseTransitions = true
contentItemStackView.replace(normalPage)
} else if ((root.header as Header).searchText.length > 0) {
if (contentItemStackView.currentItem.objectName !== "searchView") {
contentItemStackView.reverseTransitions = false
contentItemStackView.replace(searchViewComponent)
} else {
contentItemStackView.contentItem.currentIndex = 0
}
}
root.blockingHoverFocus = true
root.interceptedPosition = null
}
}
}
Loader {
active: !!kickoff.dragSource.sourceItem
anchors.fill: parent
sourceComponent: DropArea {
id: favoriteRemoveDropArea
// should be "as AbstractKickoffItemDelegate", but the type system gets confused when changing view style at runtime
readonly property Item draggedItem: kickoff.dragSource.sourceItem
onEntered: event => {
if (draggedItem?.view.model instanceof Kicker.KAStatsFavoritesModel) {
event.accept (Qt.MoveAction)
draggedItem.removalPlaceholderActive = true
} else {
event.accepted = false
}
}
onDropped: event => {
if (draggedItem && kickoff.rootModel.favoritesModel.isFavorite(draggedItem.model.favoriteId) && draggedItem.view.model instanceof Kicker.KAStatsFavoritesModel) {
kickoff.rootModel.favoritesModel.removeFavorite(draggedItem.model.favoriteId);
event.accept(Qt.MoveAction)
} else {
draggedItem.removalPlaceholderActive = false
event.accepted = false
}
}
onExited: {
if (draggedItem) {
draggedItem.removalPlaceholderActive = false
}
}
}
}
Component.onCompleted: {
rootModel.refresh();
}
}
@@ -0,0 +1,309 @@
/*
SPDX-FileCopyrightText: 2014 Sebastian Kügler <sebas@kde.org>
SPDX-FileCopyrightText: 2020 Carl Schwan <carl@carlschwan.eu>
SPDX-FileCopyrightText: 2021 Mikel Johnson <mikel5764@gmail.com>
SPDX-FileCopyrightText: 2021 Noah Davis <noahadvs@gmail.com>
SPDX-License-Identifier: GPL-2.0-or-later
*/
pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Layouts
import org.kde.plasma.components as PC3
import org.kde.plasma.extras as PlasmaExtras
import org.kde.kirigami as Kirigami
import org.kde.kirigamiaddons.components as KirigamiComponents
import org.kde.coreaddons as KCoreAddons
import org.kde.kcmutils as KCM
import org.kde.config as KConfig
import org.kde.plasma.plasmoid
PlasmaExtras.PlasmoidHeading {
id: root
property alias searchText: searchField.text
property Item configureButton: configureButton
property Item pinButton: pinButton
property Item avatar: avatar
property real preferredNameAndIconWidth: 0
contentHeight: layoutContainer.height
+ kickoff.backgroundMetrics.topPadding
+ kickoff.backgroundMetrics.bottomPadding
KCoreAddons.KUser {
id: kuser
}
spacing: kickoff.backgroundMetrics.spacing
function tabSetFocus(event, invertedTarget, normalTarget) {
// Set input focus depending on whether layout order matches focus chain order
// normalTarget is optional
const reason = event.key == Qt.Key_Tab ? Qt.TabFocusReason : Qt.BacktabFocusReason
if (kickoff.paneSwap) {
invertedTarget.forceActiveFocus(reason)
} else if (normalTarget !== undefined) {
normalTarget.forceActiveFocus(reason)
} else {
event.accepted = false
}
}
contentItem: Item {
Item {
id: layoutContainer
height: Math.max(searchField.implicitHeight, configureButton.implicitHeight)
anchors {
verticalCenter: parent.verticalCenter
left: parent.left
leftMargin: kickoff.backgroundMetrics.leftPadding
right: parent.right
rightMargin: kickoff.backgroundMetrics.rightPadding
}
Keys.forwardTo: searchField.activeFocus ? null : searchField
RowLayout {
id: nameAndIcon
spacing: root.spacing
anchors.left: parent.left
LayoutMirroring.enabled: kickoff.sideBarOnRight
height: parent.height
width: root.preferredNameAndIconWidth - layoutContainer.anchors.leftMargin
KirigamiComponents.AvatarButton {
id: avatar
visible: KConfig.KAuthorized.authorizeControlModule("kcm_users")
Layout.fillHeight: true
Layout.minimumWidth: height
Layout.maximumWidth: height
text: i18nc("@action:button icon-only, for tooltip/Accessible", "Open user settings") // qmllint disable unqualified
name: kuser.fullName
// The icon property emits two signals in a row during which it
// changes to an empty URL and probably back to the same
// static file path, so we need QtQuick.Image not to cache it.
cache: false
source: kuser.faceIconUrl
Keys.onTabPressed: event => {
root.tabSetFocus(event, kickoff.firstCentralPane);
}
Keys.onBacktabPressed: event => {
root.tabSetFocus(event, nextItemInFocusChain());
}
Keys.onLeftPressed: event => {
if (kickoff.sideBarOnRight) {
searchField.forceActiveFocus(Application.layoutDirection == Qt.RightToLeft ? Qt.TabFocusReason : Qt.BacktabFocusReason)
}
}
Keys.onRightPressed: event => {
if (!kickoff.sideBarOnRight) {
searchField.forceActiveFocus(Application.layoutDirection == Qt.RightToLeft ? Qt.BacktabFocusReason : Qt.TabFocusReason)
}
}
Keys.onDownPressed: event => {
if (kickoff.sideBar) {
kickoff.sideBar.forceActiveFocus(Qt.TabFocusReason)
} else {
kickoff.contentArea.forceActiveFocus(Qt.TabFocusReason)
}
}
onClicked: KCM.KCMLauncher.openSystemSettings("kcm_users")
}
MouseArea {
id: nameAndInfoMouseArea
hoverEnabled: true
Layout.fillHeight: true
Layout.fillWidth: true
Kirigami.Heading {
id: nameLabel
anchors.fill: parent
opacity: parent.containsMouse ? 0 : 1
color: Kirigami.Theme.textColor
level: 4
text: kuser.fullName
textFormat: Text.PlainText
elide: Text.ElideRight
horizontalAlignment: kickoff.paneSwap ? Text.AlignRight : Text.AlignLeft
verticalAlignment: Text.AlignVCenter
Behavior on opacity {
NumberAnimation {
duration: Kirigami.Units.longDuration
easing.type: Easing.InOutQuad
}
}
}
Kirigami.Heading {
id: infoLabel
anchors.fill: parent
level: 5
opacity: parent.containsMouse ? 1 : 0
color: Kirigami.Theme.textColor
text: kuser.os !== "" ? `${kuser.loginName}@${kuser.host} (${kuser.os})` : `${kuser.loginName}@${kuser.host}`
textFormat: Text.PlainText
elide: Text.ElideRight
horizontalAlignment: kickoff.paneSwap ? Text.AlignRight : Text.AlignLeft
verticalAlignment: Text.AlignVCenter
Behavior on opacity {
NumberAnimation {
duration: Kirigami.Units.longDuration
easing.type: Easing.InOutQuad
}
}
}
PC3.ToolTip.text: infoLabel.text
PC3.ToolTip.delay: Kirigami.Units.toolTipDelay
PC3.ToolTip.visible: infoLabel.truncated && containsMouse
}
}
RowLayout {
id: rowLayout
spacing: root.spacing
height: parent.height
anchors {
left: nameAndIcon.right
right: parent.right
}
LayoutMirroring.enabled: kickoff.sideBarOnRight
Keys.onDownPressed: event => {
kickoff.contentArea.forceActiveFocus(Qt.TabFocusReason);
}
PlasmaExtras.SearchField {
id: searchField
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
Layout.fillWidth: true
Layout.leftMargin: kickoff.backgroundMetrics.leftPadding
focus: true
Binding {
target: kickoff
property: "searchField"
value: searchField
// there's only one header ever, so don't waste resources
restoreMode: Binding.RestoreNone
}
Connections {
target: kickoff
function onExpandedChanged() {
if (!kickoff.expanded) {
searchField.clear()
}
}
}
onTextEdited: {
searchField.forceActiveFocus(Qt.ShortcutFocusReason)
}
Keys.priority: Keys.AfterItem
Keys.forwardTo: {
if (kickoff.contentArea === null) {
return []
}
if (kickoff.contentArea instanceof ListOfGridsView) {
// forward to grid inside of list, or down will skip the whole grid'
return [kickoff.contentArea.view.currentItem?.view, kickoff.contentArea.view]
}
return kickoff.contentArea.view
}
Keys.onTabPressed: event => {
tabSetFocus(event, nextItemInFocusChain(false));
}
Keys.onBacktabPressed: event => {
tabSetFocus(event, nextItemInFocusChain());
}
Keys.onLeftPressed: event => {
if (activeFocus) {
(sideBarOnRight ? configureButton : avatar).forceActiveFocus(
Application.layoutDirection === Qt.RightToLeft ? Qt.TabFocusReason : Qt.BacktabFocusReason)
}
}
Keys.onRightPressed: event => {
if (activeFocus) {
(sideBarOnRight ? avatar : configureButton).forceActiveFocus(
Application.layoutDirection === Qt.RightToLeft ? Qt.BacktabFocusReason : Qt.TabFocusReason)
}
}
}
PC3.ToolButton {
id: configureButton
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
visible: Plasmoid.internalAction("configure").enabled
icon.name: "configure"
text: Plasmoid.internalAction("configure").text
display: PC3.ToolButton.IconOnly
PC3.ToolTip.text: text
PC3.ToolTip.delay: Kirigami.Units.toolTipDelay
PC3.ToolTip.visible: hovered
Keys.onTabPressed: event => {
tabSetFocus(event, nextItemInFocusChain(false));
}
Keys.onBacktabPressed: event => {
tabSetFocus(event, nextItemInFocusChain());
}
Keys.onLeftPressed: event => {
(kickoff.sideBarOnRight ? pinButton : searchField).forceActiveFocus(
Application.layoutDirection == Qt.RightToLeft ? Qt.TabFocusReason : Qt.BacktabFocusReason)
}
Keys.onRightPressed: event => {
(kickoff.sideBarOnRight ? searchField : pinButton).forceActiveFocus(
Application.layoutDirection == Qt.RightToLeft ? Qt.BacktabFocusReason : Qt.TabFocusReason)
}
onClicked: plasmoid.internalAction("configure").trigger()
}
PC3.ToolButton {
id: pinButton
checkable: true
checked: Plasmoid.configuration.pin
icon.name: "window-pin"
text: i18nc("@action:button Pin widget open if it loses focus, icon-only button, for tooltip/Accessible", "Keep Open") // qmllint disable unqualified
display: PC3.ToolButton.IconOnly
PC3.ToolTip.text: text
PC3.ToolTip.delay: Kirigami.Units.toolTipDelay
PC3.ToolTip.visible: hovered
Binding {
target: kickoff
property: "hideOnWindowDeactivate"
value: !Plasmoid.configuration.pin
// there should be no other bindings, so don't waste resources
restoreMode: Binding.RestoreNone
}
Keys.onTabPressed: event => {
tabSetFocus(event, nextItemInFocusChain(false), kickoff.firstCentralPane || nextItemInFocusChain());
}
Keys.onBacktabPressed: event => {
tabSetFocus(event, nameAndIcon.nextItemInFocusChain(false), nextItemInFocusChain(false));
}
Keys.onLeftPressed: event => {
if (!kickoff.sideBarOnRight) {
nextItemInFocusChain(false).forceActiveFocus(Application.layoutDirection == Qt.RightToLeft ? Qt.TabFocusReason : Qt.BacktabFocusReason)
}
}
Keys.onRightPressed: event => {
if (kickoff.sideBarOnRight) {
nextItemInFocusChain(false).forceActiveFocus(Application.layoutDirection == Qt.RightToLeft ? Qt.BacktabFocusReason : Qt.TabFocusReason)
}
}
onToggled: Plasmoid.configuration.pin = checked
}
}
}
}
}
@@ -0,0 +1,62 @@
/*
* SPDX-FileCopyrightText: 2021 Noah Davis <noahadvs@gmail.com>
* SPDX-License-Identifier: LGPL-2.0-or-later
*/
pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Templates as T
import org.kde.kirigami as Kirigami
T.StackView {
id: root
property bool reverseTransitions: false
property bool movementTransitionsEnabled: true
implicitWidth: implicitContentWidth + leftPadding + rightPadding
implicitHeight: implicitContentHeight + topPadding + bottomPadding
clip: busy
contentItem: currentItem
Accessible.ignored: true
popEnter: enterTransition
popExit: exitTransition
pushEnter: enterTransition
pushExit: exitTransition
replaceEnter: enterTransition
replaceExit: exitTransition
// Using NumberAnimation instead of XAnimator because the latter wasn't always smooth enough
Transition {
id: enterTransition
NumberAnimation {
property: "x"
from: (root.reverseTransitions ? -0.5 : 0.5) * (root.mirrored ? -1 : 1) * -root.width
to: 0
duration: root.movementTransitionsEnabled ? Kirigami.Units.longDuration : 0
easing.type: Easing.OutCubic
}
NumberAnimation {
property: "opacity"
from: 0.0
to: 1.0
duration: Kirigami.Units.longDuration
easing.type: Easing.OutCubic
}
}
Transition {
id: exitTransition
NumberAnimation {
property: "x"
from: 0
to: (root.reverseTransitions ? -0.5 : 0.5) * (root.mirrored ? -1 : 1) * root.width
duration: root.movementTransitionsEnabled ? Kirigami.Units.longDuration : 0
easing.type: Easing.OutCubic
}
NumberAnimation {
property: "opacity"
from: 1.0
to: 0.0
duration: Kirigami.Units.longDuration
easing.type: Easing.OutCubic
}
}
}
@@ -0,0 +1,123 @@
/*
* SPDX-FileCopyrightText: 2021 Noah Davis <noahadvs@gmail.com>
* SPDX-License-Identifier: LGPL-2.0-or-later
*/
pragma ComponentBehavior: Bound
import QtQuick
import org.kde.plasma.core as PlasmaCore
import org.kde.plasma.plasmoid
DropArea {
id: root
required property Flickable targetView
readonly property bool enableAutoScroll: targetView.height < targetView.contentHeight
property real scrollUpMargin: 0
property real scrollDownMargin: 0
enabled: Plasmoid.immutability !== PlasmaCore.Types.SystemImmutable
// We keep track of the index changes as we drag and drop an item
// to be able to undo them if the drag and drop ends outside the
// DropArea, which allows to drag and drop items outside kickoff
// without changing their order within the view.
property var dragMoves: []
onPositionChanged: drag => {
if (drag.source === kickoff.dragSource) {
const source = kickoff.dragSource.sourceItem
if (source === null) {
return
}
const view = source.view
if (source.view === root.targetView && !view.move.running && !view.moveDisplaced.running) {
const pos = mapToItem(view.contentItem, drag.x, drag.y)
const targetIndex = view.indexAt(pos.x, pos.y)
if (targetIndex >= 0 && targetIndex !== source.index) {
root.dragMoves.push([source.index, targetIndex])
view.model.moveRow(source.index, targetIndex)
// itemIndex changes directly after moving,
// we can just set the currentIndex to it then.
view.currentIndex = source.index
}
}
drag.accept(Qt.MoveAction)
}
}
onDropped: drag => {
if ((drag.source !== kickoff.dragSource || kickoff.dragSource.sourceItem === null) && drag.hasUrls) {
const pos = mapToItem(view.contentItem, drag.x, drag.y)
let targetIndex = view.indexAt(pos.x, pos.y)
if (targetIndex >= 0) {
for (const url of drag.urls) {
view.model.addFavoriteTo(url, ":current", targetIndex++)
}
} else {
for (const url of drag.urls) {
view.model.addFavoriteTo(url, ":current")
}
}
}
}
onEntered: {
root.dragMoves = []
}
onExited: {
while (root.dragMoves.length > 0) {
const [start, end] = root.dragMoves.pop()
view.model.moveRow(end, start)
}
view.currentIndex = -1
}
function moveRow(targetIndex) {
if (targetIndex < 0 || targetIndex >= targetView.count) {
return;
}
targetView.model.moveRow(targetView.currentIndex, targetIndex);
targetView.currentIndex = targetIndex;
}
Shortcut {
enabled: (root.targetView instanceof GridView && root.targetView.currentIndex >= root.targetView.columns)
|| (root.targetView instanceof ListView && root.targetView.currentIndex > 0)
sequence: "Ctrl+Shift+Up"
onActivated: root.moveRow(root.targetView.currentIndex - (root.targetView instanceof GridView ? root.targetView.columns : 1))
}
Shortcut {
enabled: (root.targetView instanceof GridView && root.targetView.currentIndex < root.targetView.count - root.targetView.columns)
|| (root.targetView instanceof ListView && root.targetView.currentIndex + 1 < root.targetView.count)
sequence: "Ctrl+Shift+Down"
onActivated: root.moveRow(root.targetView.currentIndex + (root.targetView instanceof GridView ? root.targetView.columns : 1))
}
Shortcut {
enabled: root.targetView instanceof GridView && root.targetView.currentIndex % root.targetView.columns > 0
sequence: "Ctrl+Shift+Left"
onActivated: root.moveRow(root.targetView.currentIndex - 1)
}
Shortcut {
enabled: root.targetView instanceof GridView && root.targetView.currentIndex % root.targetView.columns !== root.targetView.columns - 1
sequence: "Ctrl+Shift+Right"
onActivated: root.moveRow(root.targetView.currentIndex + 1)
}
SmoothedAnimation {
target: root.targetView
property: "contentY"
to: 0
velocity: 200
running: root.enableAutoScroll && root.containsDrag && root.drag.y <= root.scrollUpMargin
}
SmoothedAnimation {
target: root.targetView
property: "contentY"
to: root.targetView.contentHeight - root.targetView.height
velocity: 200
running: root.enableAutoScroll && root.containsDrag && root.drag.y >= root.height - root.scrollDownMargin
}
}
@@ -0,0 +1,83 @@
/*
SPDX-FileCopyrightText: 2011 Martin *Gräßlin <mgraesslin@kde.org>
SPDX-FileCopyrightText: 2012 Gregor Taetzner <gregor@freenet.de>
SPDX-FileCopyrightText: 2014 Sebastian Kügler <sebas@kde.org>
SPDX-FileCopyrightText: 2015-2018 Eike Hein <hein@kde.org>
SPDX-FileCopyrightText: 2021 Mikel Johnson <mikel5764@gmail.com>
SPDX-FileCopyrightText: 2021 Noah Davis <noahadvs@gmail.com>
SPDX-FileCopyrightText: 2022 Nate Graham <nate@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Layouts
import org.kde.plasma.components as PC3
import org.kde.kirigami as Kirigami
AbstractKickoffItemDelegate {
id: root
leftPadding: KickoffSingleton.listItemMetrics.margins.left
rightPadding: KickoffSingleton.listItemMetrics.margins.right
topPadding: Kirigami.Units.smallSpacing * 2
bottomPadding: Kirigami.Units.smallSpacing * 2
icon.width: Kirigami.Units.iconSizes.large
icon.height: Kirigami.Units.iconSizes.large
labelTruncated: label.truncated
descriptionVisible: false
dragIconItem: iconItem
contentItem: ColumnLayout {
spacing: root.spacing
Kirigami.Icon {
id: iconItem
implicitWidth: root.icon.width
implicitHeight: root.icon.height
Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom
animated: false
selected: root.iconAndLabelsShouldlookSelected
source: root.removalPlaceholderActive ? "list-remove" : (root.decoration || root.icon.name || root.icon.source)
Loader {
anchors {
right: parent.right
rightMargin: -root.rightPadding
top: parent.top
}
visible: active
active: (root.model?.isNewlyInstalled ?? false) && !root.removalPlaceholderActive
sourceComponent: Kirigami.Badge {
text: i18nc("@label Newly-installed app, badge, keep short", "New!") // qmllint disable unqualified
type: Kirigami.Badge.Type.Positive
Accessible.name: i18nc("@label Accessible name for badge", "Newly-installed application") // qmllint disable unqualified
}
}
}
PC3.Label {
id: label
visible: !root.removalPlaceholderActive
Layout.alignment: Qt.AlignHCenter | Qt.AlignTop
Layout.fillWidth: true
Layout.preferredHeight: label.lineCount === 1 ? label.implicitHeight * 2 : label.implicitHeight
text: root.text
textFormat: Text.PlainText
elide: Text.ElideRight
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignTop
maximumLineCount: 2
wrapMode: Text.Wrap
color: root.iconAndLabelsShouldlookSelected ? Kirigami.Theme.highlightedTextColor : Kirigami.Theme.textColor
}
}
}
@@ -0,0 +1,328 @@
/*
SPDX-FileCopyrightText: 2015 Eike Hein <hein@kde.org>
SPDX-FileCopyrightText: 2021 Mikel Johnson <mikel5764@gmail.com>
SPDX-FileCopyrightText: 2021 Noah Davis <noahadvs@gmail.com>
SPDX-License-Identifier: GPL-2.0-or-later
*/
pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Templates as T
import org.kde.plasma.components as PC3
import org.kde.plasma.extras as PlasmaExtras
import org.kde.kirigami as Kirigami
// ScrollView makes it difficult to control implicit size using the contentItem.
// Using EmptyPage instead.
EmptyPage {
id: root
property alias model: view.model
property alias count: view.count
property alias currentIndex: view.currentIndex
property alias currentItem: view.currentItem
property alias delegate: view.delegate
property alias blockTargetWheel: wheelHandler.blockTargetWheel
property alias view: view
clip: view.height < view.contentHeight
header: MouseArea {
implicitHeight: KickoffSingleton.listItemMetrics.margins.top
hoverEnabled: true
onEntered: {
if (containsMouse) {
const targetIndex = view.indexAt(mouseX + view.contentX, view.contentY)
if (targetIndex >= 0) {
view.currentIndex = targetIndex
view.forceActiveFocus(Qt.MouseFocusReason)
}
}
}
}
footer: MouseArea {
implicitHeight: KickoffSingleton.listItemMetrics.margins.bottom
hoverEnabled: true
onEntered: {
if (containsMouse) {
const targetIndex = view.indexAt(mouseX + view.contentX, view.height + view.contentY - 1)
if (targetIndex >= 0) {
view.currentIndex = targetIndex
view.forceActiveFocus(Qt.MouseFocusReason)
}
}
}
}
/* Not setting GridView as the contentItem because GridView has no way to
* set horizontal alignment. I don't want to use leftPadding/rightPadding
* for that because I'd have to change the implicitWidth formula and use a
* more complicated calculation to get the correct padding.
*/
GridView {
id: view
// Not storing them as properties somehow avoids a dubious warning
// about *Binding loop detected for property "rows"*
function availableWidth(): real {
return width - leftMargin - rightMargin;
}
function availableHeight(): real {
return height - topMargin - bottomMargin;
}
readonly property int columns: Math.floor(availableWidth() / cellWidth)
property int rows
Binding on rows {
value: Math.floor(view.availableHeight() / view.cellHeight)
delayed: true
}
property bool movedWithKeyboard: false
property bool movedWithWheel: false
// NOTE: parent is the contentItem that Control subclasses automatically
// create when no contentItem is set, but content is added.
height: parent.height
// There are lots of ways to try to center the content of a GridView
// and many of them have bad visual flaws. This way works pretty well.
// Not center aligning when there might be a scrollbar to keep click target positions consistent.
anchors.horizontalCenter: undefined
anchors.horizontalCenterOffset: if (kickoff.mayHaveGridWithScrollBar) {
if (root.mirrored) {
return verticalScrollBar.implicitWidth/2
} else {
return -verticalScrollBar.implicitWidth/2
}
} else {
return 0
}
width: Math.min(parent.width, Math.floor((parent.width - leftMargin - rightMargin - (kickoff.mayHaveGridWithScrollBar ? verticalScrollBar.implicitWidth : 0)) / cellWidth) * cellWidth + leftMargin + rightMargin)
states: [
State {
name: "centered"
when: !kickoff.mayHaveGridWithScrollBar
AnchorChanges {
target: view
anchors.horizontalCenter : parent.horizontalCenter
}
}
]
Accessible.description: i18nc("@info:whatsthis Accessible description", "Grid with %1 rows, %2 columns", rows, columns) // can't use i18np here
implicitWidth: {
let w = view.cellWidth * kickoff.minimumGridRowCount + leftMargin + rightMargin
if (kickoff.mayHaveGridWithScrollBar) {
w += verticalScrollBar.implicitWidth
}
return w
}
implicitHeight: view.cellHeight * kickoff.minimumGridRowCount + topMargin + bottomMargin
leftMargin: kickoff.backgroundMetrics.leftPadding
rightMargin: kickoff.backgroundMetrics.rightPadding
cellHeight: KickoffSingleton.gridCellSize
cellWidth: KickoffSingleton.gridCellSize
currentIndex: count > 0 ? 0 : -1
focus: true
interactive: height < contentHeight
pixelAligned: true
reuseItems: true
boundsBehavior: Flickable.StopAtBounds
// default keyboard navigation doesn't allow focus reasons to be used
// and eats up/down key events when at the beginning or end of the list.
keyNavigationEnabled: false
keyNavigationWraps: false
highlightFollowsCurrentItem: false
delegate: KickoffGridDelegate {
id: itemDelegate
width: view.cellWidth
Accessible.role: Accessible.Cell
}
move: normalTransition
moveDisplaced: normalTransition
Transition {
id: normalTransition
NumberAnimation {
duration: Kirigami.Units.shortDuration
properties: "x, y"
easing.type: Easing.OutCubic
}
}
PC3.ScrollBar.vertical: PC3.ScrollBar {
id: verticalScrollBar
parent: root
z: 2
height: root.height
anchors.right: parent.right
}
Kirigami.WheelHandler {
id: wheelHandler
target: view
filterMouseEvents: true
// `20 * Qt.styleHints.wheelScrollLines` is the default speed.
horizontalStepSize: 20 * Qt.styleHints.wheelScrollLines
verticalStepSize: 20 * Qt.styleHints.wheelScrollLines
onWheel: wheel => {
view.movedWithWheel = true
view.movedWithKeyboard = false
movedWithWheelTimer.restart()
}
}
Connections {
target: kickoff
function onExpandedChanged() {
if (!kickoff.expanded) {
view.currentIndex = 0
view.positionViewAtBeginning()
}
}
}
// Used to block hover events temporarily after using keyboard navigation.
// If you have one hand on the touch pad or mouse and another hand on the keyboard,
// it's easy to accidentally reset the highlight/focus position to the mouse position.
Timer {
id: movedWithKeyboardTimer
interval: 200
onTriggered: view.movedWithKeyboard = false
}
Timer {
id: movedWithWheelTimer
interval: 200
onTriggered: view.movedWithWheel = false
}
function focusCurrentItem(event, focusReason) {
currentItem.forceActiveFocus(focusReason)
positionViewAtIndex(currentIndex, GridView.Contain)
event.accepted = true
}
Keys.onMenuPressed: event => {
const delegate = currentItem as AbstractKickoffItemDelegate;
if (delegate !== null) {
delegate.forceActiveFocus(Qt.ShortcutFocusReason)
delegate.openActionMenu()
}
}
Keys.onPressed: event => {
const targetX = currentItem ? currentItem.x : contentX
let targetY = currentItem ? currentItem.y : contentY
let targetIndex = currentIndex
// supports mirroring
const atLeft = currentIndex % columns === (Application.layoutDirection == Qt.RightToLeft ? columns - 1 : 0)
// at the beginning of a line
const isLeading = currentIndex % columns === 0
// at the top of a given column and in the top row
const atTop = currentIndex < columns
// supports mirroring
const atRight = currentIndex % columns === (Application.layoutDirection == Qt.RightToLeft ? 0 : columns - 1)
// at the end of a line
const isTrailing = currentIndex % columns === columns - 1
// at bottom of a given column, not necessarily in the last row
let atBottom = currentIndex >= count - columns
// Implements the keyboard navigation described in https://www.w3.org/TR/wai-aria-practices-1.2/#grid
if (count > 0 && (event.key == Qt.Key_Return || event.key == Qt.Key_Enter)) {
(root.currentItem as AbstractKickoffItemDelegate).action.triggered();
root.currentItem.forceActiveFocus(Qt.ShortcutFocusReason);
event.accepted = true;
} else if (count > 1) {
switch (event.key) {
case Qt.Key_Left: if (!atLeft && !kickoff.searchField.activeFocus) {
moveCurrentIndexLeft()
focusCurrentItem(event, Qt.BacktabFocusReason)
} break
case Qt.Key_H: if (!atLeft && !kickoff.searchField.activeFocus && event.modifiers & Qt.ControlModifier) {
moveCurrentIndexLeft()
focusCurrentItem(event, Qt.BacktabFocusReason)
} break
case Qt.Key_Up: if (!atTop) {
moveCurrentIndexUp()
focusCurrentItem(event, Qt.BacktabFocusReason)
} break
case Qt.Key_K: if (!atTop && event.modifiers & Qt.ControlModifier) {
moveCurrentIndexUp()
focusCurrentItem(event, Qt.BacktabFocusReason)
} break
case Qt.Key_Right: if (!atRight && !kickoff.searchField.activeFocus) {
moveCurrentIndexRight()
focusCurrentItem(event, Qt.TabFocusReason)
} break
case Qt.Key_L: if (!atRight && !kickoff.searchField.activeFocus && event.modifiers & Qt.ControlModifier) {
moveCurrentIndexRight()
focusCurrentItem(event, Qt.TabFocusReason)
} break
case Qt.Key_Down: if (!atBottom) {
moveCurrentIndexDown()
focusCurrentItem(event, Qt.TabFocusReason)
} break
case Qt.Key_J: if (!atBottom && event.modifiers & Qt.ControlModifier) {
moveCurrentIndexDown()
focusCurrentItem(event, Qt.TabFocusReason)
} break
case Qt.Key_Home: if (event.modifiers === Qt.ControlModifier && currentIndex !== 0) {
currentIndex = 0
focusCurrentItem(event, Qt.BacktabFocusReason)
} else if (!isLeading) {
targetIndex -= currentIndex % columns
currentIndex = Math.max(targetIndex, 0)
focusCurrentItem(event, Qt.BacktabFocusReason)
} break
case Qt.Key_End: if (event.modifiers === Qt.ControlModifier && currentIndex !== count - 1) {
currentIndex = count - 1
focusCurrentItem(event, Qt.TabFocusReason)
} else if (!isTrailing) {
targetIndex += columns - 1 - (currentIndex % columns)
currentIndex = Math.min(targetIndex, count - 1)
focusCurrentItem(event, Qt.TabFocusReason)
} break
case Qt.Key_PageUp: if (!atTop) {
targetY = targetY - height + 1
targetIndex = indexAt(targetX, targetY)
// TODO: Find a more efficient, but accurate way to do this
while (targetIndex === -1) {
targetY += 1
targetIndex = indexAt(targetX, targetY)
}
currentIndex = Math.max(targetIndex, 0)
focusCurrentItem(event, Qt.BacktabFocusReason)
} break
case Qt.Key_PageDown: if (!atBottom) {
targetY = targetY + height - 1
targetIndex = indexAt(targetX, targetY)
// TODO: Find a more efficient, but accurate way to do this
while (targetIndex === -1) {
targetY -= 1
targetIndex = indexAt(targetX, targetY)
}
currentIndex = Math.min(targetIndex, count - 1)
focusCurrentItem(event, Qt.TabFocusReason)
} break
}
}
movedWithKeyboard = event.accepted
if (movedWithKeyboard) {
movedWithKeyboardTimer.restart()
}
}
}
}
@@ -0,0 +1,149 @@
/*
SPDX-FileCopyrightText: 2011 Martin *Gräßlin <mgraesslin@kde.org>
SPDX-FileCopyrightText: 2012 Gregor Taetzner <gregor@freenet.de>
SPDX-FileCopyrightText: 2014 Sebastian Kügler <sebas@kde.org>
SPDX-FileCopyrightText: 2015-2018 Eike Hein <hein@kde.org>
SPDX-FileCopyrightText: 2021 Mikel Johnson <mikel5764@gmail.com>
SPDX-FileCopyrightText: 2021 Noah Davis <noahadvs@gmail.com>
SPDX-FileCopyrightText: 2022 Nate Graham <nate@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Layouts
import org.kde.ksvg as KSvg
import org.kde.plasma.components as PC3
import org.kde.kirigami as Kirigami
import org.kde.plasma.plasmoid
AbstractKickoffItemDelegate {
id: root
property bool compact: Plasmoid.configuration.compactMode
leftPadding: KickoffSingleton.listItemMetrics.margins.left
+ (mirrored ? KickoffSingleton.fontMetrics.descent : 0)
rightPadding: KickoffSingleton.listItemMetrics.margins.right
+ (!mirrored ? KickoffSingleton.fontMetrics.descent : 0)
// Otherwise it's *too* compact :)
topPadding: compact && !isCategoryListItem ? Kirigami.Units.mediumSpacing : Kirigami.Units.smallSpacing
bottomPadding: compact && !isCategoryListItem ? Kirigami.Units.mediumSpacing : Kirigami.Units.smallSpacing
icon.width: compact || root.isCategoryListItem ? Kirigami.Units.iconSizes.smallMedium : Kirigami.Units.iconSizes.medium
icon.height: compact || root.isCategoryListItem ? Kirigami.Units.iconSizes.smallMedium : Kirigami.Units.iconSizes.medium
labelTruncated: label.truncated
descriptionTruncated: descriptionLabel.truncated
descriptionVisible: descriptionLabel.visible
dragIconItem: icon
contentItem: RowLayout {
id: row
spacing: KickoffSingleton.listItemMetrics.margins.left * 2
Kirigami.Icon {
id: icon
implicitWidth: root.icon.width
implicitHeight: root.icon.height
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
animated: false
selected: root.iconAndLabelsShouldlookSelected
source: root.removalPlaceholderActive ? "list-remove" : (root.decoration || root.icon.name || root.icon.source)
}
Item {
id: gridLayoutWrapper // exists to break implicitWidth propagation
implicitHeight: gridLayout.implicitHeight
Layout.fillWidth: true
GridLayout {
id: gridLayout
readonly property color textColor: root.iconAndLabelsShouldlookSelected ? Kirigami.Theme.highlightedTextColor : Kirigami.Theme.textColor
anchors.fill: parent
visible: !root.removalPlaceholderActive
rows: root.compact ? 1 : 2
columns: root.compact ? 2 : 1
rowSpacing: 0
columnSpacing: Kirigami.Units.largeSpacing
PC3.Label {
id: label
Layout.fillWidth: !descriptionLabel.visible
Layout.preferredWidth: Math.min(gridLayoutWrapper.width, implicitWidth)
text: root.text
textFormat: root.isMultilineText ? Text.StyledText : Text.PlainText
elide: Text.ElideRight
wrapMode: root.isMultilineText ? Text.WordWrap : Text.NoWrap
verticalAlignment: Text.AlignVCenter
maximumLineCount: root.isMultilineText ? Infinity : 1
color: gridLayout.textColor
}
PC3.Label {
id: descriptionLabel
Layout.fillWidth: true
visible: {
let isApplicationSearchResult = root.model?.group === "Applications" || root.model?.group === "System Settings"
let isSearchResultWithDescription = root.isSearchResult && (Plasmoid.configuration?.appNameFormat > 1 || !isApplicationSearchResult)
return text.length > 0 && (isSearchResultWithDescription || (text !== label.text && !root.isCategoryListItem && Plasmoid.configuration?.appNameFormat > 1))
}
opacity: 0.75
text: root.description
textFormat: Text.PlainText
font: Kirigami.Theme.smallFont
elide: Text.ElideRight
verticalAlignment: Text.AlignVCenter
horizontalAlignment: root.compact ? Text.AlignRight : Text.AlignLeft
maximumLineCount: 1
color: gridLayout.textColor
}
}
}
Loader {
Layout.preferredWidth: root.isCategoryListItem ? Kirigami.Units.largeSpacing : implicitWidth
Layout.preferredHeight: root.isCategoryListItem ? Kirigami.Units.largeSpacing : implicitHeight
visible: active
active: (root.model?.isNewlyInstalled ?? false) && !root.removalPlaceholderActive
sourceComponent: Kirigami.Badge {
text: root.isCategoryListItem ? "" : i18nc("Newly-installed app, badge, keep short", "New!")
type: Kirigami.Badge.Type.Positive
Accessible.description: root.isCategoryListItem
? i18n("There is a newly-installed application in this category")
: i18n("Newly-installed application")
}
}
}
Loader {
id: separatorLoader
anchors.left: root.left
anchors.right: root.right
anchors.verticalCenter: root.verticalCenter
active: root.isSeparator
asynchronous: false
sourceComponent: KSvg.SvgItem {
width: parent.width
height: KickoffSingleton.lineSvg.horLineHeight
svg: KickoffSingleton.lineSvg
elementId: "horizontal-line"
}
}
}

Some files were not shown because too many files have changed in this diff Show More