diff --git a/local/recipes/kde/kf6-ktexteditor/recipe.toml b/local/recipes/kde/kf6-ktexteditor/recipe.toml index ba08c85947..c5559e1982 100644 --- a/local/recipes/kde/kf6-ktexteditor/recipe.toml +++ b/local/recipes/kde/kf6-ktexteditor/recipe.toml @@ -4,8 +4,13 @@ version = "6.28" #TODO: KTextEditor — KDE text editor component (KParts-based). Wraps katepart. [source] -tar = "https://download.kde.org/stable/frameworks/6.28/ktexteditor-6.28.0.tar.xz" -blake3 = "02213a950e80a6ae0b11b9fd40c0109617ced4772eee95ac106bf20c39d3277a" +# Vendored local fork (full-fork model): builds from the committed source/ +# tree (offline, reproducible). source/ = pristine upstream + the patches below +# BAKED IN. .patch files kept tracked so a version bump can re-apply them via +# sync-recipe-source.sh. +# upstream: https://download.kde.org/stable/frameworks/6.28/ktexteditor-6.28.0.tar.xz +# blake3: 02213a950e80a6ae0b11b9fd40c0109617ced4772eee95ac106bf20c39d3277a +path = "source" [build] template = "custom" diff --git a/local/recipes/kde/kf6-ktexteditor/source.tar b/local/recipes/kde/kf6-ktexteditor/source.tar new file mode 100644 index 0000000000..edd210997b Binary files /dev/null and b/local/recipes/kde/kf6-ktexteditor/source.tar differ diff --git a/local/recipes/kde/kf6-ktexteditor/source/.git-blame-ignore-revs b/local/recipes/kde/kf6-ktexteditor/source/.git-blame-ignore-revs new file mode 100644 index 0000000000..13e72a00f6 --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/.git-blame-ignore-revs @@ -0,0 +1,13 @@ +# clang-format/tidy +77f4552c61efde3f9a77ec5cd9ea051152584054 +564e503fec4c2aebe6cf80598e3a2b8a262d08f1 +0ad27d2f234f618067709682b838df80ec138cc0 +500024827b8d1dbdc4f0b901784c3537f8ddb15d +c4a419233b39530857442a65f89c12b35e33609d +b24ee34a2b9cce72b744c9f3af902b7317c44ee9 +84bcfe67060ca950908480fa7e218f3e825098f4 +f439d8008812e869ee22c7f70e8fc550871b939d +af631ae0b98a4fc6ac4dc4f9b9fa949009e3b480 +c74db883a7538fe07fa7e95a028dea6c50a9b092 +5506f7ced614646fef02684ced3f0f311960d73a +353beb5d2a42ae5d3584881ce7073fd1c21884d0 diff --git a/local/recipes/kde/kf6-ktexteditor/source/.gitignore b/local/recipes/kde/kf6-ktexteditor/source/.gitignore new file mode 100644 index 0000000000..7c52ac9719 --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/.gitignore @@ -0,0 +1,29 @@ +# Ignore the following files +*~ +*.[oa] +.clangd +*.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 +.cmake/ +/compile_commands.json +/.cache +cmake-build-debug* +.idea +.kateproject.build diff --git a/local/recipes/kde/kf6-ktexteditor/source/.gitlab-ci.yml b/local/recipes/kde/kf6-ktexteditor/source/.gitlab-ci.yml new file mode 100644 index 0000000000..8f9d57880e --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/.gitlab-ci.yml @@ -0,0 +1,12 @@ +# SPDX-FileCopyrightText: 2020 Volker Krause +# SPDX-License-Identifier: CC0-1.0 + +include: + - project: sysadmin/ci-utilities + file: + - /gitlab-templates/linux-qt6.yml + - /gitlab-templates/linux-qt6-next.yml + - /gitlab-templates/freebsd-qt6.yml + - /gitlab-templates/windows-qt6.yml + - /gitlab-templates/xml-lint.yml + - /gitlab-templates/yaml-lint.yml diff --git a/local/recipes/kde/kf6-ktexteditor/source/.kateconfig b/local/recipes/kde/kf6-ktexteditor/source/.kateconfig new file mode 100644 index 0000000000..6365ea05fc --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/.kateconfig @@ -0,0 +1 @@ +kate: indent-mode cstyle; indent-width 4; replace-tabs on; diff --git a/local/recipes/kde/kf6-ktexteditor/source/.kateproject b/local/recipes/kde/kf6-ktexteditor/source/.kateproject new file mode 100644 index 0000000000..a740941001 --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/.kateproject @@ -0,0 +1,5 @@ +{ + "name": "KTextEditor Framework" + + , "files": [ { "git": 1 } ] +} diff --git a/local/recipes/kde/kf6-ktexteditor/source/.kde-ci.yml b/local/recipes/kde/kf6-ktexteditor/source/.kde-ci.yml new file mode 100644 index 0000000000..0abe12fdf7 --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/.kde-ci.yml @@ -0,0 +1,27 @@ +Dependencies: + - 'on': ['Linux', 'FreeBSD', 'Windows', 'macOS'] + 'require': + 'frameworks/breeze-icons': '@same' + 'frameworks/extra-cmake-modules': '@same' + 'frameworks/karchive': '@same' + 'frameworks/kconfig': '@same' + 'frameworks/kguiaddons': '@same' + 'frameworks/ki18n': '@same' + 'frameworks/kjobwidgets': '@same' + 'frameworks/kio': '@same' + 'frameworks/kparts': '@same' + 'frameworks/sonnet': '@same' + 'frameworks/kxmlgui': '@same' + 'frameworks/kcolorscheme': '@same' + 'frameworks/syntax-highlighting': '@same' + + - 'on': ['Linux', 'FreeBSD', 'macOS'] + 'require': + 'frameworks/kauth': '@same' + +Options: + test-before-installing: True + require-passing-tests-on: ['Linux', 'FreeBSD', 'Windows'] + cppcheck-ignore-files: ['templates/'] + cmake-options: '-DWARNINGS_AS_ERRORS=ON' + enable-lsan: True diff --git a/local/recipes/kde/kf6-ktexteditor/source/.redbear-src-version b/local/recipes/kde/kf6-ktexteditor/source/.redbear-src-version new file mode 100644 index 0000000000..a6f8c804ce --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/.redbear-src-version @@ -0,0 +1 @@ +ktexteditor-6.28.0.tar.xz diff --git a/local/recipes/kde/kf6-ktexteditor/source/CMakeLists.txt b/local/recipes/kde/kf6-ktexteditor/source/CMakeLists.txt new file mode 100644 index 0000000000..1215ffb88a --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/CMakeLists.txt @@ -0,0 +1,139 @@ +cmake_minimum_required(VERSION 3.29) + +set(KF_VERSION "6.28.0") # handled by release scripts +set(KF_DEP_VERSION "6.28.0") # handled by release scripts +project(KTextEditor VERSION ${KF_VERSION}) + +# ECM setup +include(FeatureSummary) +find_package(ECM 6.28.0 NO_MODULE) +set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://commits.kde.org/extra-cmake-modules") +feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES) + +# add own modules to search path, too +set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) + +include(KDEInstallDirs) +include(KDECMakeSettings) +include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) +include(KDEGitCommitHooks) + +include(ECMSetupVersion) +include(ECMGenerateHeaders) +include(ECMGenerateExportHeader) +include(ECMGenerateQDoc) +include(CMakePackageConfigHelpers) +include(CheckFunctionExists) +include(CheckSymbolExists) +include(KDEPackageAppTemplates) +include(GenerateExportHeader) +include(ECMQtDeclareLoggingCategory) +include(ECMDeprecationSettings) + +option(ENABLE_PCH "Enable Precompiled Headers support" ON) +option(WARNINGS_AS_ERRORS "Warnings are errors -Werror" OFF) + +if (NOT WIN32 AND NOT HAIKU) + set(ENABLE_KAUTH_DEFAULT ON) +else() + set(ENABLE_KAUTH_DEFAULT OFF) +endif() +option(ENABLE_KAUTH "Enable KAuth integration" ${ENABLE_KAUTH_DEFAULT}) +add_feature_info(KAUTH ${ENABLE_KAUTH} "KAuth integration for editing system files") + +set(ktexteditor_version_header "${CMAKE_CURRENT_BINARY_DIR}/src/ktexteditor_version.h") +ecm_setup_version( + PROJECT + VARIABLE_PREFIX KTEXTEDITOR + VERSION_HEADER "${ktexteditor_version_header}" + PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF6TextEditorConfigVersion.cmake" + SOVERSION 6 +) + +# Dependencies +set(REQUIRED_QT_VERSION 6.9.0) + +# Required Qt components to build this framework +find_package(Qt6 ${REQUIRED_QT_VERSION} NO_MODULE REQUIRED Core Widgets Qml PrintSupport TextToSpeech) + +# Required Frameworks +find_package(KF6Archive ${KF_DEP_VERSION} REQUIRED) +find_package(KF6Config ${KF_DEP_VERSION} REQUIRED) +find_package(KF6GuiAddons ${KF_DEP_VERSION} REQUIRED) +find_package(KF6I18n ${KF_DEP_VERSION} REQUIRED) +find_package(KF6KIO ${KF_DEP_VERSION} REQUIRED) +find_package(KF6Parts ${KF_DEP_VERSION} REQUIRED) +find_package(KF6Sonnet ${KF_DEP_VERSION} REQUIRED) +find_package(KF6SyntaxHighlighting ${KF_DEP_VERSION} REQUIRED) +find_package(KF6ColorScheme ${KF_DEP_VERSION} REQUIRED) + +if (ENABLE_KAUTH) + find_package(KF6Auth ${KF_DEP_VERSION} REQUIRED) + set(HAVE_KAUTH ${KF6Auth_FOUND}) +else() + set(HAVE_KAUTH FALSE) +endif() + +# EditorConfig integration +find_package(EditorConfig) + +# forbid some old things +set(EXCLUDE_DEPRECATED_BEFORE_AND_AT 0 CACHE STRING "Control the range of deprecated API excluded from the build [default=0].") +ecm_set_disabled_deprecation_versions( + QT 6.3 + KF 6.27 +) + +# define which offscreen platform plugin to use for tests +set(OFFSCREEN_QPA "-platform" "offscreen") + +# Subdirectories +add_definitions(-DTRANSLATION_DOMAIN=\"ktexteditor6\") +ki18n_install(po) + +add_subdirectory(src) +if (BUILD_TESTING) + add_subdirectory(autotests) +endif() +add_subdirectory(templates) + +# Create a Config.cmake and a ConfigVersion.cmake file and install them +set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF6TextEditor") + +configure_package_config_file( + "${CMAKE_CURRENT_SOURCE_DIR}/KF6TextEditorConfig.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/KF6TextEditorConfig.cmake" + INSTALL_DESTINATION "${CMAKECONFIG_INSTALL_DIR}" +) + +install(FILES + "${CMAKE_CURRENT_BINARY_DIR}/KF6TextEditorConfig.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/KF6TextEditorConfigVersion.cmake" + DESTINATION "${CMAKECONFIG_INSTALL_DIR}" + COMPONENT Devel +) + +install(EXPORT + KF6TextEditorTargets + DESTINATION "${CMAKECONFIG_INSTALL_DIR}" + FILE KF6TextEditorTargets.cmake + NAMESPACE KF6:: +) + +install(FILES + "${ktexteditor_version_header}" + DESTINATION "${KDE_INSTALL_INCLUDEDIR_KF}/KTextEditor" + COMPONENT Devel +) + +# config.h +check_symbol_exists (fdatasync unistd.h HAVE_FDATASYNC) +configure_file (config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h) + +# let our config.h be found first in any case +include_directories (BEFORE ${CMAKE_CURRENT_BINARY_DIR}) + +include(ECMFeatureSummary) +ecm_feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) + +kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT) diff --git a/local/recipes/kde/kf6-ktexteditor/source/ExtraDesktop.sh b/local/recipes/kde/kf6-ktexteditor/source/ExtraDesktop.sh new file mode 100644 index 0000000000..0c46ec147b --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/ExtraDesktop.sh @@ -0,0 +1,4 @@ +#! /bin/sh +#This file outputs in a separate line each file with a .desktop syntax +#that needs to be translated but has a non .desktop extension +find -name \*.kdevtemplate -print diff --git a/local/recipes/kde/kf6-ktexteditor/source/KF6TextEditorConfig.cmake.in b/local/recipes/kde/kf6-ktexteditor/source/KF6TextEditorConfig.cmake.in new file mode 100644 index 0000000000..582b662563 --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/KF6TextEditorConfig.cmake.in @@ -0,0 +1,8 @@ +@PACKAGE_INIT@ + +# KF6 Deps +include(CMakeFindDependencyMacro) +find_dependency(KF6Parts "@KF_DEP_VERSION@") +find_dependency(KF6SyntaxHighlighting "@KF_DEP_VERSION@") + +include("${CMAKE_CURRENT_LIST_DIR}/KF6TextEditorTargets.cmake") diff --git a/local/recipes/kde/kf6-ktexteditor/source/LICENSES/BSD-2-Clause.txt b/local/recipes/kde/kf6-ktexteditor/source/LICENSES/BSD-2-Clause.txt new file mode 100644 index 0000000000..2d2bab1127 --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/LICENSES/BSD-2-Clause.txt @@ -0,0 +1,22 @@ +Copyright (c) . 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. + +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. diff --git a/local/recipes/kde/kf6-ktexteditor/source/LICENSES/CC0-1.0.txt b/local/recipes/kde/kf6-ktexteditor/source/LICENSES/CC0-1.0.txt new file mode 100644 index 0000000000..0e259d42c9 --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/LICENSES/CC0-1.0.txt @@ -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. diff --git a/local/recipes/kde/kf6-ktexteditor/source/LICENSES/LGPL-2.0-only.txt b/local/recipes/kde/kf6-ktexteditor/source/LICENSES/LGPL-2.0-only.txt new file mode 100644 index 0000000000..5c96471aaf --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/LICENSES/LGPL-2.0-only.txt @@ -0,0 +1,446 @@ +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! diff --git a/local/recipes/kde/kf6-ktexteditor/source/LICENSES/LGPL-2.0-or-later.txt b/local/recipes/kde/kf6-ktexteditor/source/LICENSES/LGPL-2.0-or-later.txt new file mode 100644 index 0000000000..5c96471aaf --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/LICENSES/LGPL-2.0-or-later.txt @@ -0,0 +1,446 @@ +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! diff --git a/local/recipes/kde/kf6-ktexteditor/source/LICENSES/MIT.txt b/local/recipes/kde/kf6-ktexteditor/source/LICENSES/MIT.txt new file mode 100644 index 0000000000..204b93da48 --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/LICENSES/MIT.txt @@ -0,0 +1,19 @@ +MIT License Copyright (c) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice (including the next +paragraph) shall be included in all copies or substantial portions of the +Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS +OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/local/recipes/kde/kf6-ktexteditor/source/README.md b/local/recipes/kde/kf6-ktexteditor/source/README.md new file mode 100644 index 0000000000..b1f0246700 --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/README.md @@ -0,0 +1,65 @@ +# KTextEditor + +Full text editor component + +## Introduction + +KTextEditor provides a powerful text editor component that you can embed in your +application, either as a KPart or using the KF6::TextEditor library (if you need +more control). + +The text editor component contains many useful features, from syntax +highlighting and automatic indentation to advanced scripting support, making it +suitable for everything from a simple embedded text-file editor to an advanced +IDE. + +## Usage + +If you are using CMake, you need to have + +```cmake +find_package(KF6TextEditor) +``` + +(or similar) in your CMakeLists.txt file, and you need to link to KF6::TextEditor. + +After that, you can use KTextEditor::Editor to create an editor instance, and +use that to manage KTextEditor::Document instances. + +```cpp +#include +#include +#include + +// get access to the global editor singleton +auto editor = KTextEditor::Editor::instance(); + +// create a new document +auto doc = editor->createDocument(this); + +// create a widget to display the document +auto view = doc->createView(yourWidgetParent); +``` + +See the documentation for these classes for more information. + +## Licensing + +Contributions to KTextEditor shall be licensed under [LGPLv2+](LICENSES/LGPL-2.0-or-later.txt). + +All files shall contain a proper "SPDX-License-Identifier: LGPL-2.0-or-later" identifier inside a header like: + +```cpp +/* + SPDX-FileCopyrightText: 2021 Christoph Cullmann + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ +``` + +## Further Documentation + +- @ref kte_design +- @ref kte_port_to_5 +- @ref kte_guidelines + diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/CMakeLists.txt b/local/recipes/kde/kf6-ktexteditor/source/autotests/CMakeLists.txt new file mode 100644 index 0000000000..f2ee225f91 --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/autotests/CMakeLists.txt @@ -0,0 +1,204 @@ +find_package(Qt6 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Test) +add_definitions(-DQT_FORCE_ASSERTS=1) + +include(ECMMarkAsTest) +include(ECMAddTests) + +set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} ) + +include_directories( + # for config.h + ${CMAKE_BINARY_DIR} + + # for generated ktexteditor headers + ${CMAKE_BINARY_DIR}/src/include + + # for normal sources + ${CMAKE_SOURCE_DIR}/src + ${CMAKE_SOURCE_DIR}/src/include + ${CMAKE_SOURCE_DIR}/src/buffer + ${CMAKE_SOURCE_DIR}/src/completion + ${CMAKE_SOURCE_DIR}/src/dialogs + ${CMAKE_SOURCE_DIR}/src/document + ${CMAKE_SOURCE_DIR}/src/script + ${CMAKE_SOURCE_DIR}/src/mode + ${CMAKE_SOURCE_DIR}/src/render + ${CMAKE_SOURCE_DIR}/src/search + ${CMAKE_SOURCE_DIR}/src/syntax + ${CMAKE_SOURCE_DIR}/src/undo + ${CMAKE_SOURCE_DIR}/src/utils + ${CMAKE_SOURCE_DIR}/src/view +) + +add_definitions(-DTEST_DATA_DIR=\"${CMAKE_SOURCE_DIR}/autotests/input/\") +add_definitions(-DJS_DATA_DIR=\"${CMAKE_SOURCE_DIR}/src/script/data/\") +add_definitions(-DJS_SCRIPTTESTER_DATA_DIR=\"${CMAKE_SOURCE_DIR}/src/scripttester/\") + +set (KTEXTEDITOR_TEST_LINK_LIBS KF6TextEditor + KF6::I18n + KF6::GuiAddons + KF6::SyntaxHighlighting + KF6::Codecs + KF6::Completion + Qt6::Qml +) + +if(ENABLE_PCH) + file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/pch.cpp "/*empty file*/") + file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/pch.h + "#pragma once\n" + "#include \n" + "#include \n" + "#include \n" + ) + add_library(kte_test_pch STATIC ${CMAKE_CURRENT_BINARY_DIR}/pch.cpp) + target_link_libraries(kte_test_pch ${KTEXTEDITOR_TEST_LINK_LIBS} Qt6::Test) + target_precompile_headers(kte_test_pch PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/pch.h) +endif() + +include(ECMMarkAsTest) + +# test executable for encoding +add_executable(kateencodingtest src/kateencodingtest.cpp) +target_link_libraries(kateencodingtest ${KTEXTEDITOR_TEST_LINK_LIBS}) +ecm_mark_as_test(kateencodingtest) + +# test macro for encoding tests +MACRO(KTEXTEDITOR_ENCODING_TEST _encoding _testname) + ADD_TEST (NAME encoding_${_testname}_create COMMAND kateencodingtest ${_encoding} ${CMAKE_SOURCE_DIR}/autotests/input/encoding/${_testname} ${CMAKE_CURRENT_BINARY_DIR}/${_testname} ) + ADD_TEST (NAME encoding_${_testname}_diff COMMAND ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/autotests/input/encoding/${_testname} ${CMAKE_CURRENT_BINARY_DIR}/${_testname} ) +ENDMACRO(KTEXTEDITOR_ENCODING_TEST) + +# add tests + +# this file is utf-8, simple +KTEXTEDITOR_ENCODING_TEST ("utf-8" "utf8.txt") + +# this file is latin15, but fallback should work! +KTEXTEDITOR_ENCODING_TEST ("utf-8" "latin15.txt") + +# this file is utf32, little endian, but fallback should work! +KTEXTEDITOR_ENCODING_TEST ("utf-8" "utf32.txt") + +# this file is utf16, little endian, but fallback should work! +KTEXTEDITOR_ENCODING_TEST ("utf-8" "utf16.txt") + +# this file is utf32, big endian, but fallback should work! +KTEXTEDITOR_ENCODING_TEST ("utf-8" "utf32be.txt") + +# this file is utf16, big endian, but fallback should work! +KTEXTEDITOR_ENCODING_TEST ("utf-8" "utf16be.txt") + +# cyrillic utf-8 +KTEXTEDITOR_ENCODING_TEST ("utf-8" "cyrillic_utf8.txt") + +# cyrillic cp1251 +KTEXTEDITOR_ENCODING_TEST ("utf-8" "cp1251.txt") + +# cyrillic koi8-r +KTEXTEDITOR_ENCODING_TEST ("utf-8" "koi8-r.txt") + +# one character latin-15 test, segfaulted +KTEXTEDITOR_ENCODING_TEST ("utf-8" "one-char-latin-15.txt") + +# utf8 bom only, shouldn't produce error +KTEXTEDITOR_ENCODING_TEST ("utf-8" "utf8-bom-only.txt") + +# latin15, but coincidentally contains utf8 bom. The "bom" should be treated as normal text +KTEXTEDITOR_ENCODING_TEST ("ISO 8859-15" "latin15-with-utf8-bom.txt") + +# test executable for indentation +add_executable(kateindenttest src/indenttest.cpp src/script_test_base.cpp src/testutils.cpp) +target_link_libraries(kateindenttest ${KTEXTEDITOR_TEST_LINK_LIBS} Qt6::Test) +ecm_mark_as_test(kateindenttest) +if(ENABLE_PCH) + target_precompile_headers(kateindenttest REUSE_FROM kte_test_pch) +endif() + +# test macro for indentation tests +MACRO(KTEXTEDITOR_INDENT_TEST _testname) + ADD_TEST (NAME kateindenttest_${_testname} COMMAND kateindenttest ${OFFSCREEN_QPA} ${_testname}) +ENDMACRO(KTEXTEDITOR_INDENT_TEST) + +# test different indenters separately to have smaller test chunks, that takes LONG +KTEXTEDITOR_INDENT_TEST ("testPython") +KTEXTEDITOR_INDENT_TEST ("testJulia") +KTEXTEDITOR_INDENT_TEST ("testCstyle") +KTEXTEDITOR_INDENT_TEST ("testCppstyle") +KTEXTEDITOR_INDENT_TEST ("testCMake") +KTEXTEDITOR_INDENT_TEST ("testRuby") +KTEXTEDITOR_INDENT_TEST ("testHaskell") +KTEXTEDITOR_INDENT_TEST ("testLatex") +KTEXTEDITOR_INDENT_TEST ("testPascal") +KTEXTEDITOR_INDENT_TEST ("testAda") +KTEXTEDITOR_INDENT_TEST ("testXml") +KTEXTEDITOR_INDENT_TEST ("testNormal") +KTEXTEDITOR_INDENT_TEST ("testReplicode") + +add_test( + NAME scripts_test + COMMAND ktexteditor_script_tester + ${CMAKE_CURRENT_SOURCE_DIR}/input/commands/ + ${CMAKE_CURRENT_SOURCE_DIR}/input/scripting/ +) + +macro(ktexteditor_unit_test_offscreen testname) + add_executable(${testname} src/${testname}.cpp ${ARGN}) + target_link_libraries(${testname} ${KTEXTEDITOR_TEST_LINK_LIBS} Qt6::Test) + ecm_mark_as_test(${testname}) + if(ENABLE_PCH) + target_precompile_headers(${testname} REUSE_FROM kte_test_pch) + endif() + ADD_TEST (NAME ${testname} COMMAND ${testname} ${OFFSCREEN_QPA}) +endmacro() + +ktexteditor_unit_test_offscreen(katetextbuffertest) +ktexteditor_unit_test_offscreen(range_test) +ktexteditor_unit_test_offscreen(cursorwords_test) +ktexteditor_unit_test_offscreen(undomanager_test) +ktexteditor_unit_test_offscreen(plaintextsearch_test) +ktexteditor_unit_test_offscreen(regexpsearch_test) +ktexteditor_unit_test_offscreen(scriptdocument_test) +ktexteditor_unit_test_offscreen(scripttester_test ../src/scripttester/scripttester.cpp) +ktexteditor_unit_test_offscreen(wordcompletiontest) +ktexteditor_unit_test_offscreen(searchbar_test) +ktexteditor_unit_test_offscreen(movingcursor_test) +ktexteditor_unit_test_offscreen(configinterface_test) +ktexteditor_unit_test_offscreen(kte_documentcursor) +ktexteditor_unit_test_offscreen(katedocument_test) +ktexteditor_unit_test_offscreen(movingrange_test) +ktexteditor_unit_test_offscreen(revision_test) +ktexteditor_unit_test_offscreen(modificationsystem_test) +ktexteditor_unit_test_offscreen(variable_test) +ktexteditor_unit_test_offscreen(templatehandler_test) +ktexteditor_unit_test_offscreen(evaluate_script_test) +ktexteditor_unit_test_offscreen(camelcursortest) +ktexteditor_unit_test_offscreen(encodingtest) +ktexteditor_unit_test_offscreen(indentdetect_test) +ktexteditor_unit_test_offscreen(multicursortest) +ktexteditor_unit_test_offscreen(katemodemanager_test src/katemodemanager_test_base.cpp) +ktexteditor_unit_test_offscreen(kateview_test) +ktexteditor_unit_test_offscreen(inlinenote_test) +ktexteditor_unit_test_offscreen(completion_test src/codecompletiontestmodel.cpp src/codecompletiontestmodels.cpp) +ktexteditor_unit_test_offscreen(bugs_test src/testutils.cpp) +ktexteditor_unit_test_offscreen(katefoldingtest) +ktexteditor_unit_test_offscreen(messagetest) +ktexteditor_unit_test_offscreen(swapfiletest) + +add_subdirectory(src/vimode) + + +# +# benchmarks, don't execute during normal testing +# they don't test additional stuff but only hang the CI +# +add_executable(katemodemanager_benchmark src/katemodemanager_test_base.cpp src/katemodemanager_benchmark.cpp) +ecm_mark_nongui_executable(katemodemanager_benchmark) +add_test(NAME katemodemanager_benchmark COMMAND katemodemanager_benchmark CONFIGURATIONS BENCHMARK) +target_link_libraries(katemodemanager_benchmark ${KTEXTEDITOR_TEST_LINK_LIBS} Qt6::Test) + +add_executable(bench_search src/benchmarks/bench_search.cpp) +target_link_libraries(bench_search PRIVATE ${KTEXTEDITOR_TEST_LINK_LIBS}) + +add_executable(example src/example.cpp) +target_link_libraries(example PRIVATE ${KTEXTEDITOR_TEST_LINK_LIBS}) diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/.clang-format b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/.clang-format new file mode 100644 index 0000000000..9d159247d5 --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/.clang-format @@ -0,0 +1,2 @@ +DisableFormat: true +SortIncludes: false diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/.gitignore b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/.gitignore new file mode 100644 index 0000000000..508061b4ec --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/.gitignore @@ -0,0 +1 @@ +actual diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/bug205447.txt b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/bug205447.txt new file mode 100644 index 0000000000..b0d12705e2 --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/bug205447.txt @@ -0,0 +1 @@ +𝐽 a 𝐽a 𝐽𝐽 a𝐽 aa a𝐽a 𝐽a𝐽 diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/bug311866.cpp b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/bug311866.cpp new file mode 100644 index 0000000000..d9b74126d7 --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/bug311866.cpp @@ -0,0 +1,6 @@ +int main() +{ + int this_line_is_safe=1; + int that_line_will_cause_havoc=1; +} + diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/bug313759.js b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/bug313759.js new file mode 100644 index 0000000000..efaeb25eef --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/bug313759.js @@ -0,0 +1,10 @@ +view.setCursorPosition(0, 0); +var count = document.lines() - 3; +for (var i = 0; i < count; ++i) + moveLinesDown(); +for (var i = 0; i < count; ++i) + moveLinesUp(); +for (var i = 0; i < count; ++i) + moveLinesDown(); +//for (var i = 0; i < count; ++i) +// moveLinesUp(); diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/bug313759.txt b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/bug313759.txt new file mode 100644 index 0000000000..88361355fe --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/bug313759.txt @@ -0,0 +1,503 @@ +XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXxx + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/bug313769.cpp b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/bug313769.cpp new file mode 100644 index 0000000000..9b67d6a2ed --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/bug313769.cpp @@ -0,0 +1,74 @@ +/* This file is part of the KDE libraries + SPDX-FileCopyrightText: 1999 Jochen Wilhelmy +*/ +//BEGIN includes +#include "kateview.h" +#include "kateview.moc" + +//#define VIEW_RANGE_DEBUG + +//END includes + +void KateView::blockFix(KTextEditor::Range& range) +{ + if (range.start().column() > range.end().column()) + { + int tmp = range.start().column(); + range.start().setColumn(range.end().column()); + range.end().setColumn(tmp); + } +} + +KateView::KateView( KateDocument *doc, QWidget *parent ) +{ + setComponentData ( KateGlobal::self()->componentData () ); + + // selection if for this view only and will invalidate if becoming empty + m_selection.setView (this); + + // use z depth defined in moving ranges interface + m_selection.setZDepth (-100000.0); + + KateGlobal::self()->registerView( this ); + + KTextEditor::ViewBarContainer *viewBarContainer=qobject_cast( KateGlobal::self()->container() ); + QWidget *bottomBarParent=viewBarContainer?viewBarContainer->getViewBarParent(this,KTextEditor::ViewBarContainer::BottomBar):0; + QWidget *topBarParent=viewBarContainer?viewBarContainer->getViewBarParent(this,KTextEditor::ViewBarContainer::TopBar):0; + + m_bottomViewBar=new KateViewBar (bottomBarParent!=0,KTextEditor::ViewBarContainer::BottomBar,bottomBarParent?bottomBarParent:this,this); + m_topViewBar=new KateViewBar (topBarParent!=0,KTextEditor::ViewBarContainer::TopBar,topBarParent?topBarParent:this,this); + + // ugly workaround: + // Force the layout to be left-to-right even on RTL desktop, as discussed + // on the mailing list. This will cause the lines and icons panel to be on + // the left, even for Arabic/Hebrew/Farsi/whatever users. + setLayoutDirection ( Qt::LeftToRight ); + + // layouting ;) + m_vBox = new QVBoxLayout (this); + m_vBox->setContentsMargins(0, 0, 0, 0); + m_vBox->setSpacing (0); + + // add top viewbar... + if (topBarParent) + viewBarContainer->addViewBarToLayout(this,m_topViewBar,KTextEditor::ViewBarContainer::TopBar); + else + m_vBox->addWidget(m_topViewBar); + + m_bottomViewBar->installEventFilter(m_viewInternal); + + // add KateMessageWidget for KTE::MessageInterface immediately above view + m_topMessageWidget = new KateMessageWidget(this); + m_vBox->addWidget(m_topMessageWidget); + m_topMessageWidget->hide(); + + // add hbox: KateIconBorder | KateViewInternal | KateScrollBar + QHBoxLayout *hbox = new QHBoxLayout (); + m_vBox->addLayout (hbox, 100); + hbox->setContentsMargins(0, 0, 0, 0); + hbox->setSpacing (0); + + QStyleOption option; + option.initFrom(this); + + if (style()->styleHint(QStyle::SH_ScrollView_FrameOnlyAroundContents, &option, this)) { diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/bug404713_line_height_issue.xml b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/bug404713_line_height_issue.xml new file mode 100644 index 0000000000..00a87ff446 --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/bug404713_line_height_issue.xml @@ -0,0 +1,190 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]> + + + Atari 2600 + + + + + Atari 7800 + + + + + + + + ATK inset + شكل ATK + Ustaŭka ATK + Сбор — ATK + ATK inset + vložka ATK + ATK-indsættelse + ATK-Inset + Ένθετο ATK + ATK inset + inserción ATK + ATK sartzapena + ATK-osio + ATK innskot + encart ATK + intlis ATK + conxunto ATK + תוספת ATK + ATK umetak + ATK betét + Folio intercalari ATK + Inset ATK + Inset ATK + ATK インセット + ATK беті + ATK inset + ATK inset + ATK ielaidums + ATK-innsats + ATK-invoegsel + ATK-innskot + encart ATK + Wstawka ATK + Suplemento ATK + Conjunto de entrada do ATK + Inset ATK + вкладка ATK + Vložka ATK + Vložka ATK + Inset ATK + АТК уметак + ATK-inlägg + ATK iç metni + вкладка ATK + Bộ dát ATK + ATK 嵌入对象 + ATK 內嵌 + ATK + Andrew Toolkit + + + + + electronic book document + مستند كتاب إلكتروني + elektronnaja kniha + Документ — електронна книга + document de llibre electrònic + dokument elektronické knihy + elektronisk bogdokument + Elektronisches Buch + Έγγραφο ηλεκτρονικού βιβλίου + electronic book document + documento de libro electrónico + liburu elektronikoaren dokumentua + elektroninen kirja + elektroniskbóka skjal + document livre électronique + leabhar leictreonach + documento de libro electrónico + מסמך מסוג ספר אלקטרוני + dokument elektroničke knjige + elektronikus könyvdokumentum + Documento de libro electronic + dokumen buku elektronik + Documento libro elettronico + 電子ブックドキュメント + электронды кітабы + 전자책 문서 + elektroninės knygos dokumentas + elektroniskās grāmatas dokuments + elektronisch boek + elektronisk bok-dokument + document libre electronic + Dokument książki elektronicznej + documento de livro eletrónico + Documento de livro eletrônico + document carte electronică + электронная книга + Dokument elektronickej knihy + dokument elektronske knjige + Dokument libri elektronik + документ електронске књиге + elektroniskt bokdokument + elektronik kitap belgesi + документ електронної книги + tài liệu cuốn sách điện tử + 电子书文档 + 電子書文件 + + + + + + + + + + + + + diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/commands/utils.js b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/commands/utils.js new file mode 100644 index 0000000000..36e59fc8a7 --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/commands/utils.js @@ -0,0 +1,336 @@ +loadScript(":/ktexteditor/script/commands/utils.js"); + +testCase("alignon", () => { + withInput( ' - foobar: lala, lili, lolo, lulu\n' + + '- baz: a, b, c, d\n' + + ' - quux: this, is, an, automated test\n' + + 'x - hello: world!', () => { + cmd(fn(view.alignOn, fn(document.documentRange)) + , ' - foobar: lala, lili, lolo, lulu\n' + + ' - baz: a, b, c, d\n' + + ' - quux: this, is, an, automated test\n' + + ' x - hello: world!'); + cmd(fn(view.alignOn, fn(document.documentRange), '-') + , ' - foobar: lala, lili, lolo, lulu\n' + + ' - baz: a, b, c, d\n' + + ' - quux: this, is, an, automated test\n' + + 'x - hello: world!'); + }); + + sequence(REUSE_LAST_EXPECTED_OUTPUT, () => { + cmd(fn(view.alignOn, fn(document.documentRange), ':\\s(.)') + , ' - foobar: lala, lili, lolo, lulu\n' + + ' - baz: a, b, c, d\n' + + ' - quux: this, is, an, automated test\n' + + 'x - hello: world!'); + + config({blockSelection: true}); + + cmd(fn(view.alignOn, new Range(1, 14, 2, 30), ',\\s(.)') + , ' - foobar: lala, lili, lolo, lulu\n' + + ' - baz: a, b, c, d\n' + + ' - quux: this, is, an, automated test\n' + + 'x - hello: world!'); + cmd(fn(view.alignOn, new Range(1, 19, 2, 30), ',\\s(.)') + , ' - foobar: lala, lili, lolo, lulu\n' + + ' - baz: a, b, c, d\n' + + ' - quux: this, is, an, automated test\n' + + 'x - hello: world!'); + cmd(fn(view.alignOn, new Range(1, 24, 2, 30), ',\\s(.)') + , ' - foobar: lala, lili, lolo, lulu\n' + + ' - baz: a, b, c, d\n' + + ' - quux: this, is, an, automated test\n' + + 'x - hello: world!'); + }) +}); + +testCase("block_selection", () => { + config({blockSelection: true}); + sequence( 'abc[defghijklm\n' + + 'nopqrs]tuvwxyz\n', () => { + cmd(view.removeSelectedText + , 'abc|[ghijklm\n' + + 'nop]tuvwxyz\n'); + type("PASS" + , 'abcPASS|[ghijklm\n' + + 'nopPASS]tuvwxyz\n'); + }) +}); + +testCase("moveLinesDown", () => { + config({blockSelection: false}); + + sequence( '1|\n2\n3', () => { + cmd(moveLinesDown, '2\n1|\n3'); + // bug_309977 + cmd(moveLinesDown, '2\n3\n1|', "Tests if it is possible to move a line to the last line of the document (if the last line is empty)."); + cmd(moveLinesDown, '2\n3\n1|'); + }); + + sequence( '1|\n2\n3\n', () => { + cmd(moveLinesDown, '2\n1|\n3\n'); + cmd(moveLinesDown, '2\n3\n1|\n'); + cmd(moveLinesDown, '2\n3\n\n1|'); + cmd(moveLinesDown, '2\n3\n\n1|'); + }); + + sequence( '|1\n2\n3\n', () => { + cmd(moveLinesDown, '2\n|1\n3\n'); + cmd(moveLinesDown, '2\n3\n|1\n'); + // bug_309977 + cmd(moveLinesDown, '2\n3\n\n|1'); + cmd(moveLinesDown, '2\n3\n\n|1'); + }); + + sequence( '[1]\n2\n3', () => { + cmd(moveLinesDown, '2\n[1]\n3'); + cmd(moveLinesDown, '2\n3\n[1]'); + cmd(moveLinesDown, '2\n3\n[1]'); + }); + + // bug_309978 + sequence( '[1]\n2\n3\n', () => { + cmd(moveLinesDown, '2\n[1]\n3\n'); + cmd(moveLinesDown, '2\n3\n[1]\n'); + cmd(moveLinesDown, '2\n3\n\n[1]'); + cmd(moveLinesDown, '2\n3\n\n[1]'); + }); + + sequence( '[1\n]2\n3', () => { + cmd(moveLinesDown, '2\n[1\n]3'); + cmd(moveLinesDown, '2\n3\n[1]'); + cmd(moveLinesDown, '2\n3\n[1]'); + }); + + sequence( '[1\n]2\n3\n', () => { + cmd(moveLinesDown, '2\n[1\n]3\n'); + cmd(moveLinesDown, '2\n3\n[1\n]'); + cmd(moveLinesDown, '2\n3\n\n[1]'); + cmd(moveLinesDown, '2\n3\n\n[1]'); + }); + + sequence( '1[\n]2\n3', () => { + cmd(moveLinesDown, '2\n1[\n]3'); + cmd(moveLinesDown, '2\n3\n1[]'); // TODO empty selection ! + cmd(moveLinesDown, '2\n3\n1|'); // empty selection is ignored in input... + cmd(moveLinesDown, '2\n3\n1|'); + }); + xcmd(moveLinesDown, '2\n1[\n]3', '2\n3\n1|'); // see above + + sequence( '1[\n]2\n3\n', () => { + cmd(moveLinesDown, '2\n1[\n]3\n'); + cmd(moveLinesDown, '2\n3\n1[\n]'); + cmd(moveLinesDown, '2\n3\n\n1[]'); // TODO empty selection ! + cmd(moveLinesDown, '2\n3\n\n1|'); // empty selection is ignored in input... + cmd(moveLinesDown, '2\n3\n\n1|'); + }); + xcmd(moveLinesDown, '2\n3\n1[\n]', '2\n3\n\n1|'); // see above + + + sequence( '[1\n2]\n3\n', () => { + cmd(moveLinesDown, '3\n[1\n2]\n'); + cmd(moveLinesDown, '3\n\n[1\n2]'); + cmd(moveLinesDown, '3\n\n[1\n2]'); + }); + + sequence( '1[S]\n2\n3\n', () => { + cmd(moveLinesDown, '2\n1[S]\n3\n'); + cmd(moveLinesDown, '2\n3\n1[S]\n'); + cmd(moveLinesDown, '2\n3\n\n1[S]'); + cmd(moveLinesDown, '2\n3\n\n1[S]'); + }); +}); + +testCase("moveLinesUp", () => { + config({blockSelection: false}); + + sequence( '2\n3\n1|', () => { + cmd(moveLinesUp, '2\n1|\n3'); + cmd(moveLinesUp, '1|\n2\n3'); + cmd(moveLinesUp, '1|\n2\n3'); + }); + + sequence( '2\n3\n1|\n', () => { + cmd(moveLinesUp, '2\n1|\n3\n'); + cmd(moveLinesUp, '1|\n2\n3\n'); + cmd(moveLinesUp, '1|\n2\n3\n'); + }); + + sequence( '2\n3\n|1', () => { + cmd(moveLinesUp, '2\n|1\n3'); + cmd(moveLinesUp, '|1\n2\n3'); + cmd(moveLinesUp, '|1\n2\n3'); + }); + + sequence( '2\n3\n|1\n', () => { + cmd(moveLinesUp, '2\n|1\n3\n'); + cmd(moveLinesUp, '|1\n2\n3\n'); + cmd(moveLinesUp, '|1\n2\n3\n'); + }); + + sequence( '2\n3\n[1]', () => { + cmd(moveLinesUp, '2\n[1]\n3'); + cmd(moveLinesUp, '[1]\n2\n3'); + cmd(moveLinesUp, '[1]\n2\n3'); + }); + + sequence( '2\n3\n[1]\n', () => { + cmd(moveLinesUp, '2\n[1]\n3\n'); + cmd(moveLinesUp, '[1]\n2\n3\n'); + cmd(moveLinesUp, '[1]\n2\n3\n'); + }); + + sequence( '2\n3[\n1]', () => { + cmd(moveLinesUp, '3[\n1]\n2'); + cmd(moveLinesUp, '3[\n1]\n2'); + }); + + sequence( '2\n3[\n1]\n', () => { + cmd(moveLinesUp, '3[\n1]\n2\n'); + cmd(moveLinesUp, '3[\n1]\n2\n'); + }); + + sequence( '2\n3\n[1\n]', () => { + cmd(moveLinesUp, '2\n[1\n]3\n'); + cmd(moveLinesUp, '[1\n]2\n3\n'); + cmd(moveLinesUp, '[1\n]2\n3\n'); + }); + + sequence( '2\n1[\n]3', () => { + cmd(moveLinesUp, '1[\n]2\n3'); + cmd(moveLinesUp, '1[\n]2\n3'); + }); + + sequence( '2\n1\n3[\n]', () => { + cmd(moveLinesUp, '2\n3[\n]1\n'); + cmd(moveLinesUp, '3[\n]2\n1\n'); + cmd(moveLinesUp, '3[\n]2\n1\n'); + }); + + sequence( '3\n\n[1\n2]', () => { + cmd(moveLinesUp, '3\n[1\n2]\n'); + cmd(moveLinesUp, '[1\n2]\n3\n'); + cmd(moveLinesUp, '[1\n2]\n3\n'); + }); + + sequence( '2\n3\n\n1[S]', () => { + cmd(moveLinesUp, '2\n3\n1[S]\n'); + cmd(moveLinesUp, '2\n1[S]\n3\n'); + cmd(moveLinesUp, '1[S]\n2\n3\n'); + cmd(moveLinesUp, '1[S]\n2\n3\n'); + }); +}); + +testCase("duplicateLinesDown", () => { + for (const [input, expectedOutput] of [ + ['|[1]\n2', '1\n|[1]\n2'], + ['|[1]\n2\n', '1\n|[1]\n2\n'], + ['|[1]\n2\n3', '1\n|[1]\n2\n3'], + + ['[1]|\n2', '1\n[1]|\n2'], + ['[1]|\n2\n', '1\n[1]|\n2\n'], + ['[1]|\n2\n3', '1\n[1]|\n2\n3'], + + ['1\n|[2]', '1\n2\n|[2]'], + ['1\n|[2]\n', '1\n2\n|[2]\n'], + ['1\n|[2]\n3', '1\n2\n|[2]\n3'], + + ['1\n[2]|', '1\n2\n[2]|'], + ['1\n[2]|\n', '1\n2\n[2]|\n'], + + ['1\n[2]|S', '1\n2S\n[2]|S'], + ['1\n[2]|S\n', '1\n2S\n[2]|S\n'], + ['1\n[2]|S\n3', '1\n2S\n[2]|S\n3'], + + ['1\n2|[S]', '1\n2S\n2|[S]'], + ['1\n2|[S]\n', '1\n2S\n2|[S]\n'], + ['1\n2|[S]\n3', '1\n2S\n2|[S]\n3'], + ]) { + cmd(duplicateLinesDown, input, expectedOutput); + cmd(duplicateLinesDown, + input.replace('[', '').replace(']', ''), + expectedOutput.replace('[', '').replace(']', '')); + } + + cmd(duplicateLinesDown, '[1\n]\n2', '1\n[1\n]\n2'); + cmd(duplicateLinesDown, '[1\n\n]2', '1\n\n[1\n\n]2'); + cmd(duplicateLinesDown, '[1\n\n2]', '1\n\n2\n[1\n\n2]'); + + cmd(duplicateLinesDown, '[1\n]\n2\n', '1\n[1\n]\n2\n'); + cmd(duplicateLinesDown, '[1\n\n]2\n', '1\n\n[1\n\n]2\n'); + cmd(duplicateLinesDown, '[1\n\n2]\n', '1\n\n2\n[1\n\n2]\n'); + cmd(duplicateLinesDown, '[1\n\n2\n]', '1\n\n2\n[1\n\n2\n]'); + + cmd(duplicateLinesDown, '1\n[2\n]3\n', '1\n2\n[2\n]3\n'); + + cmd(duplicateLinesDown, '1[\n]\n2', '1\n1[\n]\n2'); + cmd(duplicateLinesDown, '1[\n\n]2', '1\n\n1[\n\n]2'); + cmd(duplicateLinesDown, '1[\n\n2]', '1\n\n2\n1[\n\n2]'); + + cmd(duplicateLinesDown, '1[\n]\n2\n', '1\n1[\n]\n2\n'); + cmd(duplicateLinesDown, '1[\n\n]2\n', '1\n\n1[\n\n]2\n'); + cmd(duplicateLinesDown, '1[\n\n2]\n', '1\n\n2\n1[\n\n2]\n'); + cmd(duplicateLinesDown, '1[\n\n2\n]', '1\n\n2\n1[\n\n2\n]'); + + cmd(duplicateLinesDown, '1[\n2]\n3\n', '1\n2\n1[\n2]\n3\n'); + + cmd(duplicateLinesDown, '[1\n2\n3]\n4\n', '1\n2\n3\n[1\n2\n3]\n4\n'); + cmd(duplicateLinesDown, '[1\n2\n3\n]4\n', '1\n2\n3\n[1\n2\n3\n]4\n'); +}); + +testCase("duplicateLinesUp", () => { + for (const [input, expectedOutput] of [ + ['|[1]\n2', '|[1]\n1\n2'], + ['|[1]\n2\n', '|[1]\n1\n2\n'], + ['|[1]\n2\n3', '|[1]\n1\n2\n3'], + + ['[1]|\n2', '[1]|\n1\n2'], + ['[1]|\n2\n', '[1]|\n1\n2\n'], + ['[1]|\n2\n3', '[1]|\n1\n2\n3'], + + ['1\n|[2]', '1\n|[2]\n2'], + ['1\n|[2]\n', '1\n|[2]\n2\n'], + ['1\n|[2]\n3', '1\n|[2]\n2\n3'], + + ['1\n[2]|', '1\n[2]|\n2'], + ['1\n[2]|\n', '1\n[2]|\n2\n'], + + ['1\n[2]|S', '1\n[2]|S\n2S'], + ['1\n[2]|S\n', '1\n[2]|S\n2S\n'], + ['1\n[2]|S\n3', '1\n[2]|S\n2S\n3'], + + ['1\n2|[S]', '1\n2|[S]\n2S'], + ['1\n2|[S]\n', '1\n2|[S]\n2S\n'], + ['1\n2|[S]\n3', '1\n2|[S]\n2S\n3'], + ]) { + cmd(duplicateLinesUp, input, expectedOutput); + cmd(duplicateLinesUp, + input.replace('[', '').replace(']', ''), + expectedOutput.replace('[', '').replace(']', '')); + } + + cmd(duplicateLinesUp, '[1\n]\n2', '[1\n]1\n\n2'); + cmd(duplicateLinesUp, '[1\n\n]2', '[1\n\n]1\n\n2'); + cmd(duplicateLinesUp, '[1\n\n2]', '[1\n\n2]\n1\n\n2'); + + cmd(duplicateLinesUp, '[1\n]\n2\n', '[1\n]1\n\n2\n'); + cmd(duplicateLinesUp, '[1\n\n]2\n', '[1\n\n]1\n\n2\n'); + cmd(duplicateLinesUp, '[1\n\n2]\n', '[1\n\n2]\n1\n\n2\n'); + cmd(duplicateLinesUp, '[1\n\n2\n]', '[1\n\n2\n]1\n\n2\n'); + + cmd(duplicateLinesUp, '1\n[2\n]3\n', '1\n[2\n]2\n3\n'); + + cmd(duplicateLinesUp, '1[\n]\n2', '1[\n]1\n\n2'); + cmd(duplicateLinesUp, '1[\n\n]2', '1[\n\n]1\n\n2'); + cmd(duplicateLinesUp, '1[\n\n2]', '1[\n\n2]\n1\n\n2'); + + cmd(duplicateLinesUp, '1[\n]\n2\n', '1[\n]1\n\n2\n'); + cmd(duplicateLinesUp, '1[\n\n]2\n', '1[\n\n]1\n\n2\n'); + cmd(duplicateLinesUp, '1[\n\n2]\n', '1[\n\n2]\n1\n\n2\n'); + cmd(duplicateLinesUp, '1[\n\n2\n]', '1[\n\n2\n]1\n\n2\n'); + + cmd(duplicateLinesUp, '1[\n2]\n3\n', '1[\n2]\n1\n2\n3\n'); + + cmd(duplicateLinesUp, '[1\n2\n3]\n4\n', '[1\n2\n3]\n1\n2\n3\n4\n'); + cmd(duplicateLinesUp, '[1\n2\n3\n]4\n', '[1\n2\n3\n]1\n2\n3\n4\n'); +}); diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/encoding/cp1251.txt b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/encoding/cp1251.txt new file mode 100644 index 0000000000..eaac632856 --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/encoding/cp1251.txt @@ -0,0 +1,2 @@ +Testing + \ No newline at end of file diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/encoding/cyrillic_utf8.txt b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/encoding/cyrillic_utf8.txt new file mode 100644 index 0000000000..51888b2eb4 --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/encoding/cyrillic_utf8.txt @@ -0,0 +1,2 @@ +Testing +Тестовый текст раз два три \ No newline at end of file diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/encoding/koi8-r.txt b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/encoding/koi8-r.txt new file mode 100644 index 0000000000..eb61ad70e0 --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/encoding/koi8-r.txt @@ -0,0 +1,2 @@ +Testing + \ No newline at end of file diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/encoding/latin15-with-utf8-bom.txt b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/encoding/latin15-with-utf8-bom.txt new file mode 100644 index 0000000000..e71bfebd80 --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/encoding/latin15-with-utf8-bom.txt @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/encoding/latin15.txt b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/encoding/latin15.txt new file mode 100644 index 0000000000..974d9ab086 --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/encoding/latin15.txt @@ -0,0 +1,7 @@ +Test +Strae +Christoph +uerung +berall +Khler +$perlvar \ No newline at end of file diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/encoding/one-char-latin-15.txt b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/encoding/one-char-latin-15.txt new file mode 100644 index 0000000000..92a39f398b --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/encoding/one-char-latin-15.txt @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/encoding/utf16.txt b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/encoding/utf16.txt new file mode 100644 index 0000000000..9c4a0eccd4 Binary files /dev/null and b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/encoding/utf16.txt differ diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/encoding/utf16be.txt b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/encoding/utf16be.txt new file mode 100644 index 0000000000..ec14d6ad51 Binary files /dev/null and b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/encoding/utf16be.txt differ diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/encoding/utf32.txt b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/encoding/utf32.txt new file mode 100644 index 0000000000..b234c067d2 Binary files /dev/null and b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/encoding/utf32.txt differ diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/encoding/utf32be.txt b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/encoding/utf32be.txt new file mode 100644 index 0000000000..31e6e01e57 Binary files /dev/null and b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/encoding/utf32be.txt differ diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/encoding/utf8-bom-only.txt b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/encoding/utf8-bom-only.txt new file mode 100644 index 0000000000..5f282702bb --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/encoding/utf8-bom-only.txt @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/encoding/utf8.txt b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/encoding/utf8.txt new file mode 100644 index 0000000000..73c6f28d7f --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/encoding/utf8.txt @@ -0,0 +1,7 @@ +Test +Straße +Christoph +Äußerung +Überall +Köhler +$perlvar \ No newline at end of file diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/.kateconfig b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/.kateconfig new file mode 100644 index 0000000000..ea7a563066 --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/.kateconfig @@ -0,0 +1 @@ +kate: indent-mode r; replace-tabs true; indent-width 4; dynamic-word-wrap off; hl R Script; remove-trailing-spaces off; diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/bracketsBreak/expected b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/bracketsBreak/expected new file mode 100644 index 0000000000..abd6e9f746 --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/bracketsBreak/expected @@ -0,0 +1,3 @@ +test( + text +) diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/bracketsBreak/input.js b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/bracketsBreak/input.js new file mode 100644 index 0000000000..b8f5e4b2fe --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/bracketsBreak/input.js @@ -0,0 +1,3 @@ +v.setCursorPosition(0,5); +v.enter(); +v.type("text"); diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/bracketsBreak/origin b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/bracketsBreak/origin new file mode 100644 index 0000000000..8be63798f7 --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/bracketsBreak/origin @@ -0,0 +1 @@ +test() diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/closeBracket/expected b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/closeBracket/expected new file mode 100644 index 0000000000..abd6e9f746 --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/closeBracket/expected @@ -0,0 +1,3 @@ +test( + text +) diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/closeBracket/input.js b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/closeBracket/input.js new file mode 100644 index 0000000000..34cbccb372 --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/closeBracket/input.js @@ -0,0 +1,3 @@ +v.setCursorPosition(1,8); +v.enter(); +v.type(")"); diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/closeBracket/origin b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/closeBracket/origin new file mode 100644 index 0000000000..caf0815ab3 --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/closeBracket/origin @@ -0,0 +1,2 @@ +test( + text diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentAssign/expected b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentAssign/expected new file mode 100644 index 0000000000..745dd72c3d --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentAssign/expected @@ -0,0 +1,5 @@ +tmp <- + Thisisaverylongvariablename +test <- NA +test <- 'String' + diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentAssign/input.js b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentAssign/input.js new file mode 100644 index 0000000000..66f00db6a8 --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentAssign/input.js @@ -0,0 +1,8 @@ +v.setCursorPosition(0,6); +v.enter(); +v.type("Thisisaverylongvariablename"); +v.enter(); +v.type("test <- NA"); +v.enter(); +v.type("test <- 'String'"); +v.enter(); diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentAssign/origin b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentAssign/origin new file mode 100644 index 0000000000..ab62f32467 --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentAssign/origin @@ -0,0 +1 @@ +tmp <- diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentBracket/expected b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentBracket/expected new file mode 100644 index 0000000000..6b3f078f8f --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentBracket/expected @@ -0,0 +1,3 @@ +plot(y ~ x, + data = data) +somevariable diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentBracket/input.js b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentBracket/input.js new file mode 100644 index 0000000000..a0887b42fb --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentBracket/input.js @@ -0,0 +1,6 @@ +v.setCursorPosition(0,11); +v.enter(); +v.type("data = data"); +v.setCursorPosition(1,17); +v.enter(); +v.type("somevariable"); diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentBracket/origin b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentBracket/origin new file mode 100644 index 0000000000..71e2d99025 --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentBracket/origin @@ -0,0 +1 @@ +plot(y ~ x,) diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentFormula/expected b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentFormula/expected new file mode 100644 index 0000000000..cd2b22cc79 --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentFormula/expected @@ -0,0 +1,4 @@ +lm(Response ~ Var1 + + Var2 + + Var3, + anotherargument diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentFormula/input.js b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentFormula/input.js new file mode 100644 index 0000000000..c451d4cf11 --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentFormula/input.js @@ -0,0 +1,7 @@ +v.setCursorPosition(0,20); +v.enter(); +v.type("Var2 +") +v.enter(); +v.type("Var3,") +v.enter(); +v.type("anotherargument") diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentFormula/origin b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentFormula/origin new file mode 100644 index 0000000000..a026e91293 --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentFormula/origin @@ -0,0 +1 @@ +lm(Response ~ Var1 + diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentOperator/expected b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentOperator/expected new file mode 100644 index 0000000000..db0ecae1e9 --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentOperator/expected @@ -0,0 +1,4 @@ +ggplot(data = data) + + geom_line(aes(x = something, y = otherstuff)) + + coord_flip() + diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentOperator/input.js b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentOperator/input.js new file mode 100644 index 0000000000..bb4d9e4a94 --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentOperator/input.js @@ -0,0 +1,6 @@ +v.setCursorPosition(0,21); +v.enter(); +v.type("geom_line(aes(x = something, y = otherstuff)) +"); +v.enter(); +v.type("coord_flip()"); +v.enter(); diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentOperator/origin b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentOperator/origin new file mode 100644 index 0000000000..676ac05cd7 --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentOperator/origin @@ -0,0 +1 @@ +ggplot(data = data) + diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentpaste1/expected b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentpaste1/expected new file mode 100644 index 0000000000..17040fe9f4 --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentpaste1/expected @@ -0,0 +1,5 @@ +if(1) { + ggplot(data = data) + + geom_line(aes(x = something, y = otherstuff)) + + coord_flip() +} diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentpaste1/input.js b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentpaste1/input.js new file mode 100644 index 0000000000..60f37abf5c --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentpaste1/input.js @@ -0,0 +1,2 @@ +v.setCursorPosition(1, 4); +v.paste("ggplot(data = data) +\n geom_line(aes(x = something, y = otherstuff)) +\n coord_flip()"); diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentpaste1/origin b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentpaste1/origin new file mode 100644 index 0000000000..35acd0080f --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentpaste1/origin @@ -0,0 +1,3 @@ +if(1) { + +} diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentpaste2/expected b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentpaste2/expected new file mode 100644 index 0000000000..edfab9b04c --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentpaste2/expected @@ -0,0 +1,6 @@ +if(1) { + mult <- function(a,b) { + a*b + + } +} diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentpaste2/input.js b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentpaste2/input.js new file mode 100644 index 0000000000..567f22a864 --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentpaste2/input.js @@ -0,0 +1,2 @@ +v.setCursorPosition(1, 4); +v.paste("mult <- function(a,b) {\n a*b\n\n}"); diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentpaste2/origin b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentpaste2/origin new file mode 100644 index 0000000000..35acd0080f --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/indentpaste2/origin @@ -0,0 +1,3 @@ +if(1) { + +} diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/skipComment/expected b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/skipComment/expected new file mode 100644 index 0000000000..f40e80a062 --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/skipComment/expected @@ -0,0 +1,6 @@ +data %>% + select(-Column) %>% + #filter(ID == "id2") %>% + gather() %>% + drop_na() + diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/skipComment/input.js b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/skipComment/input.js new file mode 100644 index 0000000000..21738ef2b4 --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/skipComment/input.js @@ -0,0 +1,4 @@ +v.setCursorPosition(3,16); +v.enter(); +v.type("drop_na()"); +v.enter(); diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/skipComment/origin b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/skipComment/origin new file mode 100644 index 0000000000..3827ea386c --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/R/skipComment/origin @@ -0,0 +1,4 @@ +data %>% + select(-Column) %>% + #filter(ID == "id2") %>% + gather() %>% diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/ada/.kateconfig b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/ada/.kateconfig new file mode 100644 index 0000000000..a21afbc413 --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/ada/.kateconfig @@ -0,0 +1,2 @@ +kate: replace-tabs on; remove-trailing-spaces all; +kate: hl ada; indent-mode ada; indent-width 3; diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/ada/closepar2/expected b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/ada/closepar2/expected new file mode 100644 index 0000000000..021cc5c5e7 --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/ada/closepar2/expected @@ -0,0 +1,4 @@ +begin + f( + arg1 + ) diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/ada/closepar2/input.js b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/ada/closepar2/input.js new file mode 100644 index 0000000000..fa46c403d4 --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/ada/closepar2/input.js @@ -0,0 +1,5 @@ + +v.setCursorPosition(2,d.lineLength(2)); +v.enter(); +v.type(")"); + diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/ada/closepar2/origin b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/ada/closepar2/origin new file mode 100644 index 0000000000..f4ec0a36b3 --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/ada/closepar2/origin @@ -0,0 +1,3 @@ +begin + f( + arg1 diff --git a/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/ada/longtest/expected b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/ada/longtest/expected new file mode 100644 index 0000000000..5dda54ec13 --- /dev/null +++ b/local/recipes/kde/kf6-ktexteditor/source/autotests/input/indent/ada/longtest/expected @@ -0,0 +1,628 @@ +-- +-- + + +-- + +with text_io; +use text_io; + +with Ada.Integer_Text_IO; +use Ada.Integer_Text_IO; + + +package Package_With_Private is + + type Private_Type is private; + +private + + type Private_Type is array (1 .. 10) of Integer; + +end Package_With_Private; + + +procedure Range_1( i : integer ); -- forward declaration + + +Block_Name : -- CHECK: block labels are handled sensibly +declare + A_Variable : The_Type; +begin + Use A_Variable +end Block_Name; + +generic + Max: Positive; + type Element_T is private; +package Generic_Stack is + procedure Push (E: Element_T); + function Pop return Element_T; +end Generic_Stack; + + +procedure Generic_Swap is + generic + type Item is private; + procedure Exchange(X, Y: in out Item); + procedure Exchange(X, Y: in out Item) is + Temp: Item; + begin + Temp := X; + Result.Elements (i, Result.Elements'Last (2)) + := 3 + Right.Elements (i); + a := long_expression + + another_long_expression; -- CHECK: this should be indented + func + ( a, + b + ); + Y := func + ( a, + b + ); + Y := + func + ( a, + b + ); + end; + + A, B : Integer; + procedure Swap is new Exchange(integer); + +begin + A := 1; + B := 2; + Swap(A,B); + Ada.Float_Text_IO.put -- Float literal + (Item => gamma(i), Fore => 1, Aft => 1, Exp => 0); + new_line; + Ada.Float_Text_IO.put( -- Float literal + Item => gamma(i), Fore => 1, Aft => 1, Exp => 0); + new_line; + return( a+b ); + return( + a+b ); + return + ( a + +b); + +end Generic_Swap; + + +function SUBSTRING (DSTR: DYN_STRING; -- this is a forward reference + START : natural; + LENGTH : natural := 0) + return DYN_STRING; + +function SUBSTRING (DSTR: DYN_STRING; + LENGTH : natural := 0) + return DYN_STRING is + DS: DYN_STRING; + L : natural := LENGTH; + + type Degrees is new Float range -273.15 .. Float'Last; + Temperature : Degrees; + + type Car is record + Identity : Long_Long_Integer; + Number_Wheels : Positive range 1 .. 10; + Paint : Color; + Horse_Power_kW : Float range 0.0 .. 2_000.0; + Consumption : Float range 0.0 .. 100.0; + end record; + + BMW : Car := + (Identity => 2007_752_83992434, + Number_Wheels => 5, + Horse_Power_kW => 190.0, + Consumption => 10.1, + Paint => Blue); + + type Directions is (North, South, East, West); + Heading : Directions; + +begin + put_line("It works!"); + + case long_expression + + Another_long_expression is + when 89 ==> + s1; + s2; +<> -- CHECK: label should be aligned with begin +# + when 1 => + Walk_The_Dog; + + when 16#5# ==> + a := 5; + a := 9; + f(18); + s1; + +#include "fred" + + when 5 => + case Heading is + when North => + Y := Y + 1; + when South => + Y := Y - 1; + when East => + X := X + 1; + when West => + X := X - 1; + end case; + + when 8 | 10 => + + Sell_All_Stock; + + when others => + + if Temperature >= 40.0 then + Put_Line ("Wow!"); + Put_Line ("It's extremely hot"); + elsif Temperature >= 30.0 then + Put_Line ("It's hot"); + elsif Temperature >= 20.0 then + Put_Line ("It's warm"); + elsif Temperature >= 10.0 then + Put_Line ("It's cool"); + elsif Temperature >= 0.0 then + Put_Line ("It's cold"); + else + Put_Line ("It's freezing"); + end if; + + end case; + + DS3.DATA(1..DS3.SIZE):= DS1.DATA(1..DS1.SIZE) + & DS2.DATA(1..DS2.SIZE); + return DS3; -- CHECK: should align with DS3 above +end main; + + +procedure Quadratic_Equation + (A, B, C : Float; -- By default it is "in". + R1, R2 : out Float; + Valid : out Boolean) +is + Z : Float; + + type Discriminated_Record (Size : Natural) is + record + A : String (1 .. Size); + B : Integer; + end record; + +begin + Z := B**2 - 4.0 * A * C; + + if At_Location > In_Text'Last + or else At_Location + Pattern'Length - 1 > + In_Text'Last + or else Slided_Text_T (In_Text ( + At_Location .. At_Location + Pattern'Length - 1)) /= + Slided_Pattern + then + Valid := False; -- Being out parameter, it should be modified at least once. + R1 := 0.0; + R2 := 0.0; +<> + else + Valid := True; + R1 := (-B + Sqrt (Z)) / (2.0 * A); + R2 := (-B - Sqrt (Z)) / (2.0 * A); + end if; +end Quadratic_Equation; + + +procedure Error_Handling_4 is + + Float_Error : exception; + + type DEVICE is (PRINTER, DISK, DRUM); + type STATE is (OPEN, CLOSED); + + type PERIPHERAL(UNIT : DEVICE := DISK) is + record + STATUS : STATE; + case UNIT is + when PRINTER => + LINE_COUNT : INTEGER range 1 .. PAGE_SIZE; + when others => + CYLINDER : CYLINDER_INDEX; + TRACK : TRACK_NUMBER; + end case; + end record; + + + function Square_Root (X : in Float) return Float is + use Ada.Numerics.Elementary_Functions; + begin + if (X < 0.0) then + raise Float_Error; + else + return Sqrt (X); + end if; + end Square_Root; + +begin + + begin + C := Square_Root (A ** 2 + B ** 2); + + T_IO.Put ("C is "); + F_IO.Put + (Item => C, + Fore => (F_IO.Default_Fore + + 1 ), + Aft => F_IO.Default_Aft, + Exp => F_IO.Default_Exp); + exception + when Constraint_Error => + T_IO.Put ("C cannot be calculated!"); + end; + + return; +end Error_Handling_4; + + +procedure Range_1 is + type Range_Type is range -5 .. 10; + + Default_String : constant String := "This is the long string returned by" & + " default. It is broken into multiple" & + " Ada source lines for convenience."; + + Another_Default_String : constant String := + "This is the long string returned by" & + " default. It is broken into multiple" & + " Ada source lines for convenience."; + + type Op_Codes_In_Column is + ( Push, + Pop, + Add ); + + package T_IO renames Ada.Text_IO; + package I_IO is + new Ada.Text_IO.Integer_IO (Range_Type); + + a: real; + + +begin + for A in Range_Type loop + I_IO.Put (Item => A, + Width => 3, -- CHECK: params should line up + Base => 10); + + if A < Range_Type'Last then + Process_Each_Page: + loop + + declare + package Float_100_Stack is new Generic_Stack (100, Float); + use Float_100_Stack; + begin + Push (45.8); + end; + + Process_All_The_Lines_On_This_Page: + loop + s1; + exit Process_All_The_Lines_On_This_Page when Line_Number = Max_Lines_On_Page; + s2; + Look_For_Sentinel_Value: + loop + s3; + exit Look_For_Sentinel_Value when Current_Symbol = Sentinel; + s4; + end loop Look_For_Sentinel_Value; + s5; + end loop Process_All_The_Lines_On_This_Page; + s6; + exit Process_Each_Page when Page_Number = Maximum_Pages; + s7; + end loop Process_Each_Page; + else + T_IO.New_Line; + + -- comment below scans back to here !!?? + for I in A'Range (1) loop + for J in A'Range (2) loop + Sum := 0.0; + for R in A'Range (2) loop + Sum := Sum + A.all (I, R) * B.all (R, J); + end loop; + C.all (I, J) := Sum + + second_part_of_long_expression + + third_part_of_long_expression; + if Input_Found then + Count_Characters; + + else --not Input_Found + Reset_State; + Character_Total := + First_Part_Total * First_Part_Scale_Factor + + Second_Part_Total * Second_Part_Scale_Factor + + Default_String'Length + Delimiter_Size; + end if; + + end loop; + end loop; + end if; + end loop; +end Range_1; + +-- generic instantiation -- TODO: wrong, ... +-- ... statementIndent() scans back to for R in A'Range ... ??? ... +-- ... because it skips over the ends + +package Day_Of_Month_IO is -- TODO: scans back to beginning of file: generic? should have stopped at 'procedure' + new Ada.Text_IO.Integer_IO (Day_Of_Month); + +procedure f; + +-- CHECK: these should be recognised as forward procedures ... +procedure Day_Of (Day, Month, Year : in Integer; + Result : out Integer); +procedure x; +procedure x1; + +procedure TRAVERSE_TREE; +procedure INCREMENT(X : in out INTEGER); +procedure RIGHT_INDENT(MARGIN : out LINE_SIZE); -- see 3.5.4 +procedure SWITCH(FROM, TO : in out LINK); -- see 3.8.1 + +function RANDOM return PROBABILITY; -- see 3.5.7 + +function MIN_CELL(X : LINK) return CELL; -- see 3.8.1 +function NEXT_FRAME(K : POSITIVE) return FRAME; -- see 3.8 +function DOT_PRODUCT(LEFT,RIGHT: VECTOR) return REAL; -- see 3.6 + +function "*"(LEFT,RIGHT : MATRIX) return MATRIX; -- see 3.6 + +procedure Nesting is + + procedure Triple is + + procedure Second_Layer(Persistence : in out Persistence_View; + Stream : not null access Root_Stream_Type'Class) + is + + procedure Bottom_Layer is + begin + Put_Line("This is the Bottom Layer talking."); + Do_Something; + + if Test then + goto Exit_Use_Goto; + end if; + Do_Something_Else; + <