├── .flatpak-manifest.json ├── .flatpak-manifest.json.license ├── .git-blame-ignore-revs ├── .gitignore ├── .gitlab-ci.yml ├── .kde-ci.yml ├── CMakeLists.txt ├── CMakePresets.json ├── COPYING ├── COPYING.DOC ├── COPYING.LIB ├── LICENSES ├── CC0-1.0.txt └── GPL-2.0-or-later.txt ├── Mainpage.dox ├── TODO ├── android ├── AndroidManifest.xml └── res │ ├── drawable │ └── icon.png │ └── values │ └── strings.xml ├── calgebra ├── CMakeLists.txt ├── main.cpp └── test_calgebra.py ├── cmake ├── COPYING-CMAKE-SCRIPTS └── FindReadline.cmake ├── doc ├── CMakeLists.txt ├── commands.docbook ├── index.docbook ├── kalgebra-2dgraph-window.png ├── kalgebra-3dgraph-window.png ├── kalgebra-console-window.png ├── kalgebra-dictionary-window.png ├── kalgebra-main-window.png └── view-fullscreen.png ├── icons ├── 64-apps-kalgebra.png ├── CMakeLists.txt └── sc-apps-kalgebra.svgz ├── logo.png ├── mobile ├── CMakeLists.txt ├── Messages.sh ├── clipboard.cpp ├── clipboard.h ├── content │ ├── resources │ │ └── kde-edu-logo.png │ └── ui │ │ ├── About.qml │ │ ├── Console.qml │ │ ├── Dictionary.qml │ │ ├── Plot2D.qml │ │ ├── Plot3D.qml │ │ ├── TableResultPage.qml │ │ ├── Tables.qml │ │ ├── VariablesView.qml │ │ ├── controls │ │ ├── AddButton.qml │ │ ├── AddPlotDialog.qml │ │ ├── ExpressionInput.qml │ │ └── RealInput.qml │ │ └── main.qml ├── kalgebramobile.cpp ├── kalgebramobile.h ├── main.cpp ├── org.kde.kalgebramobile.appdata.xml ├── org.kde.kalgebramobile.desktop └── resources.qrc ├── plasmoids ├── CMakeLists.txt └── graphsplasmoid │ ├── contents │ └── ui │ │ ├── config.ui │ │ └── main.qml │ └── metadata.json ├── po ├── ar │ ├── kalgebra.po │ └── kalgebramobile.po ├── ast │ ├── kalgebra.po │ └── kalgebramobile.po ├── be │ └── kalgebra.po ├── bg │ ├── kalgebra.po │ └── kalgebramobile.po ├── bs │ └── kalgebra.po ├── ca │ ├── docs │ │ └── kalgebra │ │ │ ├── commands.docbook │ │ │ ├── index.docbook │ │ │ ├── kalgebra-2dgraph-window.png │ │ │ ├── kalgebra-3dgraph-window.png │ │ │ ├── kalgebra-dictionary-window.png │ │ │ └── kalgebra-main-window.png │ ├── kalgebra.po │ └── kalgebramobile.po ├── ca@valencia │ ├── kalgebra.po │ └── kalgebramobile.po ├── cs │ ├── kalgebra.po │ └── kalgebramobile.po ├── csb │ └── kalgebra.po ├── da │ └── kalgebra.po ├── de │ ├── docs │ │ └── kalgebra │ │ │ ├── commands.docbook │ │ │ ├── index.docbook │ │ │ └── kalgebra-main-window.png │ ├── kalgebra.po │ └── kalgebramobile.po ├── el │ ├── kalgebra.po │ └── kalgebramobile.po ├── en_GB │ ├── kalgebra.po │ └── kalgebramobile.po ├── eo │ ├── kalgebra.po │ └── kalgebramobile.po ├── es │ ├── docs │ │ └── kalgebra │ │ │ ├── commands.docbook │ │ │ ├── index.docbook │ │ │ └── kalgebra-main-window.png │ ├── kalgebra.po │ └── kalgebramobile.po ├── et │ ├── docs │ │ └── kalgebra │ │ │ ├── commands.docbook │ │ │ └── index.docbook │ ├── kalgebra.po │ └── kalgebramobile.po ├── eu │ ├── kalgebra.po │ └── kalgebramobile.po ├── fa │ └── kalgebra.po ├── fi │ ├── kalgebra.po │ └── kalgebramobile.po ├── fr │ ├── kalgebra.po │ └── kalgebramobile.po ├── ga │ └── kalgebra.po ├── gl │ ├── kalgebra.po │ └── kalgebramobile.po ├── he │ ├── kalgebra.po │ └── kalgebramobile.po ├── hi │ ├── kalgebra.po │ └── kalgebramobile.po ├── hne │ └── kalgebra.po ├── hr │ └── kalgebra.po ├── hu │ ├── kalgebra.po │ └── kalgebramobile.po ├── ia │ ├── kalgebra.po │ └── kalgebramobile.po ├── it │ ├── docs │ │ └── kalgebra │ │ │ ├── commands.docbook │ │ │ └── index.docbook │ ├── kalgebra.po │ └── kalgebramobile.po ├── ja │ ├── kalgebra.po │ └── kalgebramobile.po ├── ka │ ├── kalgebra.po │ └── kalgebramobile.po ├── kk │ └── kalgebra.po ├── km │ └── kalgebra.po ├── ko │ ├── kalgebra.po │ └── kalgebramobile.po ├── lt │ ├── kalgebra.po │ └── kalgebramobile.po ├── lv │ ├── kalgebra.po │ └── kalgebramobile.po ├── mai │ └── kalgebra.po ├── ml │ ├── kalgebra.po │ └── kalgebramobile.po ├── mr │ └── kalgebra.po ├── nb │ └── kalgebra.po ├── nds │ └── kalgebra.po ├── nl │ ├── docs │ │ └── kalgebra │ │ │ ├── commands.docbook │ │ │ └── index.docbook │ ├── kalgebra.po │ └── kalgebramobile.po ├── nn │ ├── kalgebra.po │ └── kalgebramobile.po ├── oc │ └── kalgebra.po ├── pa │ ├── kalgebra.po │ └── kalgebramobile.po ├── pl │ ├── kalgebra.po │ └── kalgebramobile.po ├── pt │ ├── docs │ │ └── kalgebra │ │ │ ├── commands.docbook │ │ │ └── index.docbook │ ├── kalgebra.po │ └── kalgebramobile.po ├── pt_BR │ ├── docs │ │ └── kalgebra │ │ │ ├── commands.docbook │ │ │ ├── index.docbook │ │ │ └── kalgebra-main-window.png │ ├── kalgebra.po │ └── kalgebramobile.po ├── ro │ └── kalgebra.po ├── ru │ ├── docs │ │ └── kalgebra │ │ │ ├── commands.docbook │ │ │ ├── index.docbook │ │ │ └── kalgebra-main-window.png │ ├── kalgebra.po │ └── kalgebramobile.po ├── sa │ ├── kalgebra.po │ └── kalgebramobile.po ├── se │ └── kalgebra.po ├── si │ └── kalgebra.po ├── sk │ ├── kalgebra.po │ └── kalgebramobile.po ├── sl │ ├── docs │ │ └── kalgebra │ │ │ ├── commands.docbook │ │ │ └── index.docbook │ ├── kalgebra.po │ └── kalgebramobile.po ├── sv │ ├── docs │ │ └── kalgebra │ │ │ ├── commands.docbook │ │ │ └── index.docbook │ ├── kalgebra.po │ └── kalgebramobile.po ├── te │ └── kalgebra.po ├── tg │ └── kalgebra.po ├── tr │ ├── kalgebra.po │ └── kalgebramobile.po ├── ug │ └── kalgebra.po ├── uk │ ├── docs │ │ └── kalgebra │ │ │ ├── commands.docbook │ │ │ ├── index.docbook │ │ │ ├── kalgebra-2dgraph-window.png │ │ │ ├── kalgebra-3dgraph-window.png │ │ │ ├── kalgebra-console-window.png │ │ │ ├── kalgebra-dictionary-window.png │ │ │ └── kalgebra-main-window.png │ ├── kalgebra.po │ └── kalgebramobile.po ├── zh_CN │ ├── kalgebra.po │ └── kalgebramobile.po └── zh_TW │ ├── kalgebra.po │ └── kalgebramobile.po ├── snapcraft.yaml ├── src ├── CMakeLists.txt ├── Messages.sh ├── askname.h ├── consolehtml.cpp ├── consolehtml.h ├── consolemodel.cpp ├── consolemodel.h ├── dictionary.cpp ├── dictionary.h ├── functionedit.cpp ├── functionedit.h ├── kalgebra.cpp ├── kalgebra.h ├── kalgebra.xml ├── main.cpp ├── org.kde.kalgebra.appdata.xml ├── org.kde.kalgebra.desktop ├── varedit.cpp ├── varedit.h ├── variablesdelegate.cpp ├── variablesdelegate.h ├── viewportwidget.cpp └── viewportwidget.h └── utils ├── CMakeLists.txt └── main.cpp /.flatpak-manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "org.kde.kalgebra", 3 | "runtime": "org.kde.Platform", 4 | "runtime-version": "6.9", 5 | "sdk": "org.kde.Sdk", 6 | "base": "io.qt.qtwebengine.BaseApp", 7 | "base-version": "6.9", 8 | "command": "kalgebra", 9 | "rename-icon": "kalgebra", 10 | "copy-icon": true, 11 | "finish-args": [ 12 | "--share=ipc", 13 | "--socket=fallback-x11", 14 | "--socket=wayland", 15 | "--device=dri" 16 | ], 17 | "separate-locales": false, 18 | "modules": [ 19 | { 20 | "name": "analitza", 21 | "buildsystem": "cmake-ninja", 22 | "sources": [ 23 | { 24 | "type": "git", 25 | "url": "https://invent.kde.org/education/analitza", 26 | "branch": "master" 27 | } 28 | ], 29 | "modules": [ 30 | { 31 | "name": "eigen", 32 | "buildsystem": "cmake-ninja", 33 | "builddir": true, 34 | "sources": [ 35 | { 36 | "type": "archive", 37 | "url": "https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.tar.bz2", 38 | "sha256": "b4c198460eba6f28d34894e3a5710998818515104d6e74e5cc331ce31e46e626", 39 | "x-checker-data": { 40 | "type": "anitya", 41 | "project-id": 666, 42 | "stable-only": true, 43 | "url-template": "https://gitlab.com/libeigen/eigen/-/archive/$version/eigen-$version.tar.bz2" 44 | } 45 | } 46 | ] 47 | } 48 | ] 49 | }, 50 | { 51 | "name": "kalgebra", 52 | "buildsystem": "cmake-ninja", 53 | "sources": [ 54 | { 55 | "type": "dir", 56 | "path": "." 57 | } 58 | ], 59 | "post-install": [ 60 | "install -D /usr/share/icons/breeze/apps/48/kalgebra.svg /app/share/icons/hicolor/scalable/apps/kalgebra.svg" 61 | ] 62 | } 63 | ] 64 | } 65 | -------------------------------------------------------------------------------- /.flatpak-manifest.json.license: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: None 2 | # SPDX-License-Identifier: CC0-1.0 3 | -------------------------------------------------------------------------------- /.git-blame-ignore-revs: -------------------------------------------------------------------------------- 1 | 69c4d87479370e90fb195b39f15303a5f4568960 -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore the following files 2 | *~ 3 | *.[oa] 4 | *.diff 5 | *.kate-swp 6 | *.kdev4 7 | .kdev_include_paths 8 | *.kdevelop.pcs 9 | *.moc 10 | *.moc.cpp 11 | *.orig 12 | *.user 13 | .*.swp 14 | .swp.* 15 | Doxyfile 16 | Makefile 17 | avail 18 | random_seed 19 | /build*/ 20 | CMakeLists.txt.user* 21 | *.unc-backup* 22 | .cmake/ 23 | /.clang-format 24 | /compile_commands.json 25 | .clangd 26 | .cache 27 | .idea 28 | /cmake-build* 29 | /.vscode/ 30 | -------------------------------------------------------------------------------- /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2021 Laurent Montel 2 | # SPDX-License-Identifier: CC0-1.0 3 | 4 | include: 5 | - project: sysadmin/ci-utilities 6 | file: 7 | - /gitlab-templates/linux-qt6.yml 8 | - /gitlab-templates/linux-qt6-next.yml 9 | - /gitlab-templates/freebsd-qt6.yml 10 | - /gitlab-templates/android-qt6.yml 11 | - /gitlab-templates/flatpak.yml 12 | - /gitlab-templates/clang-format.yml 13 | - /gitlab-templates/xml-lint.yml 14 | - /gitlab-templates/yaml-lint.yml 15 | -------------------------------------------------------------------------------- /.kde-ci.yml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: None 2 | # SPDX-License-Identifier: CC0-1.0 3 | 4 | Dependencies: 5 | - 'on': ['Linux/Qt6', 'Linux/Qt6Next', 'FreeBSD/Qt6', 'Android/Qt6'] 6 | 'require': 7 | 'frameworks/extra-cmake-modules': '@latest-kf6' 8 | 'frameworks/ki18n': '@latest-kf6' 9 | 'frameworks/kcoreaddons': '@latest-kf6' 10 | 'education/analitza': '@same' 11 | - 'on': ['Linux/Qt6', 'Linux/Qt6Next', 'FreeBSD/Qt6'] 12 | 'require': 13 | 'frameworks/kconfigwidgets': '@latest-kf6' 14 | 'frameworks/kwidgetsaddons': '@latest-kf6' 15 | 'frameworks/kdoctools': '@latest-kf6' 16 | 'frameworks/kio': '@latest-kf6' 17 | 'frameworks/kxmlgui': '@latest-kf6' 18 | 'plasma/libplasma': '@latest-kf6' 19 | - 'on': ['Android/Qt6'] 20 | 'require': 21 | 'frameworks/kirigami': '@latest-kf6' 22 | 23 | Options: 24 | require-passing-tests-on: ['@all'] 25 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.16) 2 | 3 | # KDE Application Version, managed by release script 4 | set(RELEASE_SERVICE_VERSION_MAJOR "25") 5 | set(RELEASE_SERVICE_VERSION_MINOR "07") 6 | set(RELEASE_SERVICE_VERSION_MICRO "70") 7 | set(RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}") 8 | 9 | project(kalgebra VERSION ${RELEASE_SERVICE_VERSION}) 10 | set(KF_MIN_VERSION "6.3.0") 11 | set(KDE_COMPILERSETTINGS_LEVEL "6.3.0") 12 | find_package(ECM ${KF_MIN_VERSION} REQUIRED NO_MODULE) 13 | set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${ECM_MODULE_PATH}) 14 | 15 | include(KDEInstallDirs) 16 | include(KDECompilerSettings NO_POLICY_SCOPE) 17 | include(KDECMakeSettings) 18 | include(ECMInstallIcons) 19 | include(ECMSetupVersion) 20 | include(FeatureSummary) 21 | include(ECMAddAppIcon) 22 | include(ECMDeprecationSettings) 23 | if (NOT ANDROID) 24 | include(KDEClangFormat) 25 | include(KDEGitCommitHooks) 26 | endif() 27 | set(QT_REQUIRED_VERSION "6.5.0") 28 | 29 | find_package(Qt6 ${QT_REQUIRED_VERSION} REQUIRED NO_MODULE COMPONENTS Qml Quick Xml Svg PrintSupport Test OpenGLWidgets) 30 | find_package(Analitza6 REQUIRED) 31 | 32 | ecm_set_disabled_deprecation_versions(QT 6.8.0 33 | KF 6.5.0 34 | ) 35 | 36 | 37 | set(MOBILE_BACKEND "kde" CACHE STRING "Backend to install, currently. Check /mobile/plugins/widgets/*") 38 | 39 | include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR}) 40 | 41 | set(CURSES_NEED_NCURSES TRUE) 42 | find_package(Curses) 43 | find_package(Readline) 44 | 45 | ecm_setup_version(${RELEASE_SERVICE_VERSION} VARIABLE_PREFIX KALGEBRA VERSION_HEADER kalgebra_version.h) 46 | 47 | set_package_properties(Readline PROPERTIES TYPE OPTIONAL 48 | PURPOSE "Allows KAlgebra to provide a console interface." 49 | URL "https://tiswww.case.edu/php/chet/readline/rltop.html") 50 | set_package_properties(Curses PROPERTIES TYPE OPTIONAL 51 | PURPOSE "Allows KAlgebra to provide a console interface." 52 | URL "https://www.gnu.org/software/ncurses/") 53 | 54 | find_package(KF6 ${KF_MIN_VERSION} REQUIRED COMPONENTS I18n CoreAddons) 55 | find_package(KF6 ${KF_MIN_VERSION} OPTIONAL_COMPONENTS ConfigWidgets WidgetsAddons KIO DocTools XmlGui) 56 | find_package(Plasma) 57 | find_package(Qt6WebEngineWidgets) 58 | 59 | if(KF6DocTools_FOUND AND Qt6WebEngineWidgets_FOUND AND KF6ConfigWidgets_FOUND AND KF6WidgetsAddons_FOUND AND KF6KIO_FOUND AND NOT CMAKE_SYSTEM MATCHES Android*) 60 | add_subdirectory(src) 61 | endif() 62 | 63 | if (Plasma_FOUND AND NOT CMAKE_SYSTEM MATCHES Android*) 64 | add_subdirectory(plasmoids) 65 | endif() 66 | 67 | add_subdirectory(icons) 68 | add_subdirectory(mobile) 69 | 70 | if(READLINE_FOUND AND CURSES_FOUND) 71 | add_subdirectory(calgebra) 72 | endif() 73 | 74 | if(KF6DocTools_FOUND) 75 | add_subdirectory(utils) 76 | 77 | add_custom_target(commandsdoc 78 | ${CMAKE_CURRENT_BINARY_DIR}/utils/docbook_analitzacommands commands.docbook 79 | DEPENDS docbook_analitzacommands 80 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/doc/ 81 | COMMENT "Generating commands docbook information" 82 | ) 83 | 84 | add_subdirectory(doc) 85 | endif() 86 | 87 | ki18n_install(po) 88 | if (KF6DocTools_FOUND) 89 | kdoctools_install(po) 90 | endif() 91 | feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) 92 | 93 | if (NOT ANDROID) 94 | file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES src/*.cpp src/*.h mobile/*.cpp mobile/*.h utils/*.cpp utils/*.h) 95 | kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES}) 96 | 97 | kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT) 98 | endif() 99 | -------------------------------------------------------------------------------- /CMakePresets.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "configurePresets": [ 4 | { 5 | "name": "dev", 6 | "displayName": "Build as debug", 7 | "generator": "Ninja", 8 | "binaryDir": "${sourceDir}/build", 9 | "cacheVariables": { 10 | "CMAKE_BUILD_TYPE": "Debug", 11 | "CMAKE_EXPORT_COMPILE_COMMANDS": "ON" 12 | } 13 | }, 14 | { 15 | "name": "asan", 16 | "displayName": "Build with Asan support.", 17 | "generator": "Ninja", 18 | "binaryDir": "${sourceDir}/build-asan", 19 | "cacheVariables": { 20 | "CMAKE_BUILD_TYPE": "Debug", 21 | "ECM_ENABLE_SANITIZERS" : "'address;undefined'", 22 | "CMAKE_EXPORT_COMPILE_COMMANDS": "ON" 23 | } 24 | }, 25 | { 26 | "name": "unity", 27 | "displayName": "Build with CMake unity support.", 28 | "generator": "Ninja", 29 | "binaryDir": "${sourceDir}/build-unity", 30 | "cacheVariables": { 31 | "CMAKE_BUILD_TYPE": "Debug", 32 | "CMAKE_UNITY_BUILD": "ON", 33 | "CMAKE_EXPORT_COMPILE_COMMANDS": "ON" 34 | } 35 | }, 36 | { 37 | "name": "release", 38 | "displayName": "Build as release mode.", 39 | "generator": "Ninja", 40 | "binaryDir": "${sourceDir}/build-release", 41 | "cacheVariables": { 42 | "CMAKE_BUILD_TYPE": "Release" 43 | } 44 | }, 45 | { 46 | "name": "profile", 47 | "displayName": "profile", 48 | "generator": "Ninja", 49 | "binaryDir": "${sourceDir}/build-profile", 50 | "cacheVariables": { 51 | "CMAKE_BUILD_TYPE": "RelWithDebInfo", 52 | "CMAKE_EXPORT_COMPILE_COMMANDS": "ON" 53 | } 54 | }, 55 | { 56 | "name": "clazy", 57 | "displayName": "clazy", 58 | "generator": "Ninja", 59 | "binaryDir": "${sourceDir}/build-clazy", 60 | "cacheVariables": { 61 | "CMAKE_BUILD_TYPE": "Debug" 62 | }, 63 | "environment": { 64 | "CXX": "clazy", 65 | "CCACHE_DISABLE": "ON" 66 | } 67 | } 68 | ], 69 | "buildPresets": [ 70 | { 71 | "name": "dev", 72 | "configurePreset": "dev" 73 | }, 74 | { 75 | "name": "clazy", 76 | "configurePreset": "clazy", 77 | "environment": { 78 | "CLAZY_CHECKS" : "level0,level1,detaching-member,ifndef-define-typo,isempty-vs-count,qrequiredresult-candidates,reserve-candidates,signal-with-return-value,unneeded-cast,function-args-by-ref,function-args-by-value,returning-void-expression,no-ctor-missing-parent-argument,isempty-vs-count,qhash-with-char-pointer-key,raw-environment-function,qproperty-type-mismatch,old-style-connect,qstring-allocations,container-inside-loop,heap-allocated-small-trivial-type,inefficient-qlist,qstring-varargs,level2,detaching-member,heap-allocated-small-trivial-type,isempty-vs-count,qstring-varargs,qvariant-template-instantiation,raw-environment-function,reserve-candidates,signal-with-return-value,thread-with-slots,no-ctor-missing-parent-argument,no-missing-typeinfo", 79 | "CCACHE_DISABLE" : "ON" 80 | } 81 | } 82 | ] 83 | } 84 | -------------------------------------------------------------------------------- /LICENSES/CC0-1.0.txt: -------------------------------------------------------------------------------- 1 | Creative Commons Legal Code 2 | 3 | CC0 1.0 Universal 4 | 5 | CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE 6 | LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN 7 | ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS 8 | INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES 9 | REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS 10 | PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM 11 | THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED 12 | HEREUNDER. 13 | 14 | Statement of Purpose 15 | 16 | The laws of most jurisdictions throughout the world automatically confer 17 | exclusive Copyright and Related Rights (defined below) upon the creator 18 | and subsequent owner(s) (each and all, an "owner") of an original work of 19 | authorship and/or a database (each, a "Work"). 20 | 21 | Certain owners wish to permanently relinquish those rights to a Work for 22 | the purpose of contributing to a commons of creative, cultural and 23 | scientific works ("Commons") that the public can reliably and without fear 24 | of later claims of infringement build upon, modify, incorporate in other 25 | works, reuse and redistribute as freely as possible in any form whatsoever 26 | and for any purposes, including without limitation commercial purposes. 27 | These owners may contribute to the Commons to promote the ideal of a free 28 | culture and the further production of creative, cultural and scientific 29 | works, or to gain reputation or greater distribution for their Work in 30 | part through the use and efforts of others. 31 | 32 | For these and/or other purposes and motivations, and without any 33 | expectation of additional consideration or compensation, the person 34 | associating CC0 with a Work (the "Affirmer"), to the extent that he or she 35 | is an owner of Copyright and Related Rights in the Work, voluntarily 36 | elects to apply CC0 to the Work and publicly distribute the Work under its 37 | terms, with knowledge of his or her Copyright and Related Rights in the 38 | Work and the meaning and intended legal effect of CC0 on those rights. 39 | 40 | 1. Copyright and Related Rights. A Work made available under CC0 may be 41 | protected by copyright and related or neighboring rights ("Copyright and 42 | Related Rights"). Copyright and Related Rights include, but are not 43 | limited to, the following: 44 | 45 | i. the right to reproduce, adapt, distribute, perform, display, 46 | communicate, and translate a Work; 47 | ii. moral rights retained by the original author(s) and/or performer(s); 48 | iii. publicity and privacy rights pertaining to a person's image or 49 | likeness depicted in a Work; 50 | iv. rights protecting against unfair competition in regards to a Work, 51 | subject to the limitations in paragraph 4(a), below; 52 | v. rights protecting the extraction, dissemination, use and reuse of data 53 | in a Work; 54 | vi. database rights (such as those arising under Directive 96/9/EC of the 55 | European Parliament and of the Council of 11 March 1996 on the legal 56 | protection of databases, and under any national implementation 57 | thereof, including any amended or successor version of such 58 | directive); and 59 | vii. other similar, equivalent or corresponding rights throughout the 60 | world based on applicable law or treaty, and any national 61 | implementations thereof. 62 | 63 | 2. Waiver. To the greatest extent permitted by, but not in contravention 64 | of, applicable law, Affirmer hereby overtly, fully, permanently, 65 | irrevocably and unconditionally waives, abandons, and surrenders all of 66 | Affirmer's Copyright and Related Rights and associated claims and causes 67 | of action, whether now known or unknown (including existing as well as 68 | future claims and causes of action), in the Work (i) in all territories 69 | worldwide, (ii) for the maximum duration provided by applicable law or 70 | treaty (including future time extensions), (iii) in any current or future 71 | medium and for any number of copies, and (iv) for any purpose whatsoever, 72 | including without limitation commercial, advertising or promotional 73 | purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each 74 | member of the public at large and to the detriment of Affirmer's heirs and 75 | successors, fully intending that such Waiver shall not be subject to 76 | revocation, rescission, cancellation, termination, or any other legal or 77 | equitable action to disrupt the quiet enjoyment of the Work by the public 78 | as contemplated by Affirmer's express Statement of Purpose. 79 | 80 | 3. Public License Fallback. Should any part of the Waiver for any reason 81 | be judged legally invalid or ineffective under applicable law, then the 82 | Waiver shall be preserved to the maximum extent permitted taking into 83 | account Affirmer's express Statement of Purpose. In addition, to the 84 | extent the Waiver is so judged Affirmer hereby grants to each affected 85 | person a royalty-free, non transferable, non sublicensable, non exclusive, 86 | irrevocable and unconditional license to exercise Affirmer's Copyright and 87 | Related Rights in the Work (i) in all territories worldwide, (ii) for the 88 | maximum duration provided by applicable law or treaty (including future 89 | time extensions), (iii) in any current or future medium and for any number 90 | of copies, and (iv) for any purpose whatsoever, including without 91 | limitation commercial, advertising or promotional purposes (the 92 | "License"). The License shall be deemed effective as of the date CC0 was 93 | applied by Affirmer to the Work. Should any part of the License for any 94 | reason be judged legally invalid or ineffective under applicable law, such 95 | partial invalidity or ineffectiveness shall not invalidate the remainder 96 | of the License, and in such case Affirmer hereby affirms that he or she 97 | will not (i) exercise any of his or her remaining Copyright and Related 98 | Rights in the Work or (ii) assert any associated claims and causes of 99 | action with respect to the Work, in either case contrary to Affirmer's 100 | express Statement of Purpose. 101 | 102 | 4. Limitations and Disclaimers. 103 | 104 | a. No trademark or patent rights held by Affirmer are waived, abandoned, 105 | surrendered, licensed or otherwise affected by this document. 106 | b. Affirmer offers the Work as-is and makes no representations or 107 | warranties of any kind concerning the Work, express, implied, 108 | statutory or otherwise, including without limitation warranties of 109 | title, merchantability, fitness for a particular purpose, non 110 | infringement, or the absence of latent or other defects, accuracy, or 111 | the present or absence of errors, whether or not discoverable, all to 112 | the greatest extent permissible under applicable law. 113 | c. Affirmer disclaims responsibility for clearing rights of other persons 114 | that may apply to the Work or any use thereof, including without 115 | limitation any person's Copyright and Related Rights in the Work. 116 | Further, Affirmer disclaims responsibility for obtaining any necessary 117 | consents, permissions or other rights required for any use of the 118 | Work. 119 | d. Affirmer understands and acknowledges that Creative Commons is not a 120 | party to this document and has no duty or obligation with respect to 121 | this CC0 or use of the Work. 122 | -------------------------------------------------------------------------------- /Mainpage.dox: -------------------------------------------------------------------------------- 1 | /** @mainpage KAlgebra 2 | 3 | Here you will find the API documentation both for KAlgebra's Analitza library and KAlgebra code. 4 | 5 | */ 6 | -------------------------------------------------------------------------------- /TODO: -------------------------------------------------------------------------------- 1 | 2 | Analitza: 3 | - Partial derivatives 4 | - Simplification for x^3*3/x-> 3*x^2 5 | 6 | Expression: 7 | - Copy on write for m_tree 8 | 9 | 2D: 10 | - Shared functions Console <-> 2D 11 | - Sort 2D functions 12 | - Moving on small viewport step is too large. 13 | - Review keyBindings for zooming out. 14 | 15 | Doc: 16 | - Document about piecewise 17 | - Document about anything else 18 | -------------------------------------------------------------------------------- /android/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /android/res/drawable/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/kalgebra/592b574f5b0210b2a52e8c9cdcacb2d2278b9e88/android/res/drawable/icon.png -------------------------------------------------------------------------------- /android/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | KAlgebra 4 | 5 | -------------------------------------------------------------------------------- /calgebra/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include(CheckFunctionExists) 2 | include(CMakePushCheckState) 3 | 4 | include_directories(${READLINE_INCLUDE_DIR} ${CURSES_INCLUDE_DIR}) 5 | 6 | # check if we have recent version of Readline 7 | cmake_push_check_state(RESET) 8 | set(CMAKE_REQUIRED_LIBRARIES ${READLINE_LIBRARY} ${CURSES_LIBRARIES}) 9 | check_function_exists(free_history_entry HAVE_FREE_HISTORY_ENTRY) 10 | cmake_pop_check_state() 11 | if(HAVE_FREE_HISTORY_ENTRY) 12 | add_definitions(-DHAVE_FREE_HISTORY_ENTRY) 13 | endif() 14 | 15 | add_executable(calgebra main.cpp) 16 | target_link_libraries(calgebra Qt::Core ${READLINE_LIBRARY} KF6::Analitza) 17 | 18 | install(TARGETS calgebra ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) 19 | 20 | -------------------------------------------------------------------------------- /calgebra/main.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************************* 2 | * Copyright (C) 2007 by Aleix Pol * 3 | * * 4 | * This program is free software; you can redistribute it and/or * 5 | * modify it under the terms of the GNU General Public License * 6 | * as published by the Free Software Foundation; either version 2 * 7 | * of the License, or (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the Free Software * 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 17 | *************************************************************************************/ 18 | 19 | #include 20 | #include 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | using namespace std; 28 | 29 | using Analitza::Expression; 30 | 31 | Analitza::Analyzer a; 32 | 33 | enum CalcType { 34 | Evaluate, 35 | Calculate 36 | }; 37 | 38 | static const char *prompt = ">>> "; 39 | static const char *insidePrompt = "... "; 40 | 41 | struct Config { 42 | CalcType calcType; 43 | bool showElapsedType; 44 | }; 45 | static Config configuration; 46 | 47 | void calculate(const Expression &e, CalcType t) 48 | { 49 | Expression ans; 50 | a.setExpression(e); 51 | if (e.isCorrect()) { 52 | QElapsedTimer time; 53 | if (configuration.showElapsedType) 54 | time.start(); 55 | 56 | if (t == Calculate) 57 | ans = a.calculate(); 58 | else 59 | ans = a.evaluate(); 60 | 61 | if (configuration.showElapsedType) 62 | qDebug() << "Ellapsed time: " << time.elapsed(); 63 | } 64 | 65 | if (a.isCorrect()) { 66 | qDebug() << qPrintable(ans.toString()); 67 | a.insertVariable(QStringLiteral("ans"), ans); 68 | } else { 69 | const QStringList errors = a.errors(); 70 | qDebug() << "Error:"; 71 | for (const QString &err : errors) 72 | qDebug() << " -" << qPrintable(err); 73 | } 74 | } 75 | 76 | int main(int argc, char *argv[]) 77 | { 78 | configuration.calcType = Evaluate; 79 | configuration.showElapsedType = false; 80 | 81 | for (int i = 1; i < argc; ++i) { 82 | QByteArray arg = argv[i]; 83 | if (arg == "--print-time") 84 | configuration.showElapsedType = true; 85 | else if (arg == "--calculate") 86 | configuration.calcType = Calculate; 87 | else if (arg == "--evaluate") 88 | configuration.calcType = Evaluate; 89 | else if (arg == "--help" || arg == "-h") { 90 | qDebug() << "This is KAlgebra console version"; 91 | qDebug() << "Use: " << argv[0] << "[Options] ..."; 92 | qDebug() << "\t--evaluate:\tTries to simplify symbolically before calculating"; 93 | qDebug() << "\t--calculate:\tCalculates straight away. If some symbol is missing, it will fail"; 94 | qDebug() << "\t--print-time:\tOutputs the ellapsed time of an operation"; 95 | qDebug() << "\t--help:\t\twill print this help"; 96 | qDebug() << "\t...\t\tfiles that will be executed first"; 97 | return 0; 98 | } else { 99 | QFile f(QString::fromUtf8(arg)); 100 | if (!f.open(QIODevice::ReadOnly)) { 101 | qWarning() << "File not found: " << arg; 102 | return 1; 103 | } 104 | 105 | QTextStream str(&f); 106 | a.importScript(&str); 107 | 108 | if (!a.isCorrect()) { 109 | const QStringList errors = a.errors(); 110 | qDebug() << "Error:"; 111 | for (const QString &err : errors) 112 | qDebug() << " -" << qPrintable(err); 113 | } 114 | } 115 | } 116 | 117 | bool done = false; 118 | bool inside = false; 119 | 120 | using_history(); 121 | QString entry; 122 | while (!done) { 123 | char *expr; 124 | if (inside) 125 | expr = readline(insidePrompt); 126 | else 127 | expr = readline(prompt); 128 | 129 | if (!expr) 130 | done = true; 131 | else if (*expr == 0) { 132 | inside = false; 133 | entry.clear(); 134 | } else { 135 | add_history(expr); 136 | entry += QString::fromUtf8(expr); 137 | 138 | if (Expression::isCompleteExpression(entry)) { 139 | Expression e(entry); 140 | // qDebug() << entry << e.toString(); 141 | calculate(e, configuration.calcType); 142 | inside = false; 143 | entry.clear(); 144 | } else { 145 | inside = true; 146 | } 147 | } 148 | } 149 | 150 | for (int i = 0; i < history_get_history_state()->length; i++) { 151 | HIST_ENTRY *he = remove_history(i); 152 | #ifdef HAVE_FREE_HISTORY_ENTRY 153 | free_history_entry(he); 154 | #else 155 | free((void *)he->line); 156 | free(he); 157 | #endif 158 | } 159 | qDebug("\nExit."); 160 | return 0; 161 | } 162 | -------------------------------------------------------------------------------- /calgebra/test_calgebra.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import subprocess 3 | 4 | input="fib:=n->piecewise { eq(n,0)?0, eq(n,1)?1, ?fib(n-1)+fib(n-2) }\n" 5 | 6 | i=15 7 | for a in range(i,29): 8 | input += "fib(%d)\n" % (a) 9 | p = subprocess.Popen(["calgebra", "--calculate", "--print-time"], shell=False, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) 10 | 11 | output=p.communicate(input) 12 | for line in output[1].split('\n'): 13 | theLine = line.split('time:') 14 | if len(theLine)>1: 15 | #print str(i)+", "+theLine[1] 16 | print theLine[1] 17 | i+=1 18 | 19 | -------------------------------------------------------------------------------- /cmake/COPYING-CMAKE-SCRIPTS: -------------------------------------------------------------------------------- 1 | Redistribution and use in source and binary forms, with or without 2 | modification, are permitted provided that the following conditions 3 | are met: 4 | 5 | 1. Redistributions of source code must retain the copyright 6 | notice, this list of conditions and the following disclaimer. 7 | 2. Redistributions in binary form must reproduce the copyright 8 | notice, this list of conditions and the following disclaimer in the 9 | documentation and/or other materials provided with the distribution. 10 | 3. The name of the author may not be used to endorse or promote products 11 | derived from this software without specific prior written permission. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 14 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 15 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 16 | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 17 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 18 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 19 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 20 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | -------------------------------------------------------------------------------- /cmake/FindReadline.cmake: -------------------------------------------------------------------------------- 1 | # GNU Readline library finder 2 | if(READLINE_INCLUDE_DIR AND READLINE_LIBRARY) 3 | set(READLINE_FOUND TRUE) 4 | else(READLINE_INCLUDE_DIR AND READLINE_LIBRARY) 5 | FIND_PATH(READLINE_INCLUDE_DIR readline/readline.h) 6 | 7 | FIND_LIBRARY(READLINE_LIBRARY NAMES readline) 8 | include(FindPackageHandleStandardArgs) 9 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(Readline DEFAULT_MSG READLINE_INCLUDE_DIR READLINE_LIBRARY ) 10 | 11 | MARK_AS_ADVANCED(READLINE_INCLUDE_DIR READLINE_LIBRARY) 12 | endif(READLINE_INCLUDE_DIR AND READLINE_LIBRARY) 13 | -------------------------------------------------------------------------------- /doc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ########### install files ############### 2 | # 3 | 4 | kdoctools_create_handbook(index.docbook INSTALL_DESTINATION ${KDE_INSTALL_DOCBUNDLEDIR}/en SUBDIR kalgebra) 5 | -------------------------------------------------------------------------------- /doc/kalgebra-2dgraph-window.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/kalgebra/592b574f5b0210b2a52e8c9cdcacb2d2278b9e88/doc/kalgebra-2dgraph-window.png -------------------------------------------------------------------------------- /doc/kalgebra-3dgraph-window.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/kalgebra/592b574f5b0210b2a52e8c9cdcacb2d2278b9e88/doc/kalgebra-3dgraph-window.png -------------------------------------------------------------------------------- /doc/kalgebra-console-window.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/kalgebra/592b574f5b0210b2a52e8c9cdcacb2d2278b9e88/doc/kalgebra-console-window.png -------------------------------------------------------------------------------- /doc/kalgebra-dictionary-window.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/kalgebra/592b574f5b0210b2a52e8c9cdcacb2d2278b9e88/doc/kalgebra-dictionary-window.png -------------------------------------------------------------------------------- /doc/kalgebra-main-window.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/kalgebra/592b574f5b0210b2a52e8c9cdcacb2d2278b9e88/doc/kalgebra-main-window.png -------------------------------------------------------------------------------- /doc/view-fullscreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/kalgebra/592b574f5b0210b2a52e8c9cdcacb2d2278b9e88/doc/view-fullscreen.png -------------------------------------------------------------------------------- /icons/64-apps-kalgebra.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/kalgebra/592b574f5b0210b2a52e8c9cdcacb2d2278b9e88/icons/64-apps-kalgebra.png -------------------------------------------------------------------------------- /icons/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ecm_install_icons(ICONS 2 | 64-apps-kalgebra.png 3 | sc-apps-kalgebra.svgz 4 | DESTINATION ${KDE_INSTALL_ICONDIR} THEME hicolor ) 5 | 6 | -------------------------------------------------------------------------------- /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/kalgebra/592b574f5b0210b2a52e8c9cdcacb2d2278b9e88/logo.png -------------------------------------------------------------------------------- /mobile/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | qt_add_resources(KALGEBRAMOBILE_SRCS resources.qrc) 2 | 3 | add_executable(kalgebramobile 4 | ../src/consolemodel.cpp 5 | clipboard.cpp 6 | kalgebramobile.cpp 7 | main.cpp 8 | ${KALGEBRAMOBILE_SRCS}) 9 | 10 | target_link_libraries(kalgebramobile 11 | PRIVATE 12 | Qt6::Qml 13 | Qt6::Quick 14 | Qt6::Gui 15 | KF6::CoreAddons 16 | KF6::I18n 17 | KF6::Analitza 18 | KF6::AnalitzaGui 19 | KF6::AnalitzaPlot 20 | ) 21 | 22 | set(DESKTOPFILE_INSTALL ${KDE_INSTALL_APPDIR}) 23 | 24 | if(ANDROID) 25 | # Material requires QtSvg for icons 26 | # if we don't link it here explicitly, androiddeployqt doesn't bring it 27 | find_package(Qt6Svg REQUIRED) 28 | find_package(Qt6QuickControls2 REQUIRED) 29 | find_package(KF6Kirigami REQUIRED) 30 | kirigami_package_breeze_icons(ICONS list-add) 31 | target_link_libraries(kalgebramobile PRIVATE Qt::Svg KF6::Kirigami Qt::QuickControls2) 32 | else() 33 | find_package(Qt6Widgets REQUIRED) 34 | target_link_libraries(kalgebramobile PRIVATE Qt::Widgets) 35 | endif() 36 | 37 | install(TARGETS kalgebramobile ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) 38 | install(PROGRAMS org.kde.kalgebramobile.desktop DESTINATION ${DESKTOPFILE_INSTALL} ) 39 | install(FILES org.kde.kalgebramobile.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR}) 40 | -------------------------------------------------------------------------------- /mobile/Messages.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | $XGETTEXT `find . -name \*.cpp -o -name \*.qml -o -name \*.js` -o $podir/kalgebramobile.pot 3 | -------------------------------------------------------------------------------- /mobile/clipboard.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Aleix Pol Gonzalez 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Library General Public License 15 | * along with this library; see the file COPYING.LIB. If not, write to 16 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #include "clipboard.h" 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | Clipboard::Clipboard(QObject *parent) 27 | : QObject(parent) 28 | , m_clipboard(QGuiApplication::clipboard()) 29 | , m_mode(QClipboard::Clipboard) 30 | { 31 | connect(m_clipboard, &QClipboard::changed, this, &Clipboard::clipboardChanged); 32 | } 33 | 34 | void Clipboard::setMode(QClipboard::Mode mode) 35 | { 36 | m_mode = mode; 37 | Q_EMIT modeChanged(m_mode); 38 | } 39 | 40 | void Clipboard::clipboardChanged(QClipboard::Mode m) 41 | { 42 | if (m == m_mode) { 43 | Q_EMIT contentChanged(); 44 | } 45 | } 46 | 47 | void Clipboard::clear() 48 | { 49 | m_clipboard->clear(m_mode); 50 | } 51 | 52 | QClipboard::Mode Clipboard::mode() const 53 | { 54 | return m_mode; 55 | } 56 | 57 | QVariant Clipboard::contentFormat(const QString &format) const 58 | { 59 | const QMimeData *data = m_clipboard->mimeData(m_mode); 60 | QVariant ret; 61 | if (format == QStringLiteral("text/uri-list")) { 62 | QVariantList retList; 63 | const auto urls = data->urls(); 64 | for (const QUrl &url : urls) 65 | retList += url; 66 | ret = retList; 67 | } else if (format.startsWith(QStringLiteral("text/"))) { 68 | ret = data->text(); 69 | } else if (format.startsWith(QStringLiteral("image/"))) { 70 | ret = data->imageData(); 71 | } else 72 | ret = data->data(format.isEmpty() ? data->formats().first() : format); 73 | 74 | return ret; 75 | } 76 | 77 | QVariant Clipboard::content() const 78 | { 79 | return contentFormat(m_clipboard->mimeData(m_mode)->formats().first()); 80 | } 81 | 82 | void Clipboard::setContent(const QVariant &content) 83 | { 84 | QMimeData *mimeData = new QMimeData; 85 | switch (content.userType()) { 86 | case QMetaType::QString: 87 | mimeData->setText(content.toString()); 88 | break; 89 | case QMetaType::QColor: 90 | mimeData->setColorData(content.toString()); 91 | break; 92 | case QMetaType::QPixmap: 93 | case QMetaType::QImage: 94 | mimeData->setImageData(content); 95 | break; 96 | default: 97 | if (content.userType() == QMetaType::QVariantList) { 98 | const QVariantList list = content.toList(); 99 | QList urls; 100 | bool wasUrlList = true; 101 | for (const QVariant &url : list) { 102 | if (url.userType() != QMetaType::QUrl) { 103 | wasUrlList = false; 104 | break; 105 | } 106 | urls += url.toUrl(); 107 | } 108 | if (wasUrlList) { 109 | mimeData->setUrls(urls); 110 | break; 111 | } 112 | } 113 | if (content.canConvert()) { 114 | mimeData->setText(content.toString()); 115 | } else { 116 | mimeData->setData(QStringLiteral("application/octet-stream"), content.toByteArray()); 117 | qWarning() << "Couldn't figure out the content type, storing as application/octet-stream"; 118 | } 119 | break; 120 | } 121 | m_clipboard->setMimeData(mimeData, m_mode); 122 | } 123 | 124 | QStringList Clipboard::formats() const 125 | { 126 | return m_clipboard->mimeData(m_mode)->formats(); 127 | } 128 | 129 | #include "moc_clipboard.cpp" 130 | -------------------------------------------------------------------------------- /mobile/clipboard.h: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2014 by Aleix Pol 2 | // SPDX-License-Identifier: GPL-2.0-or-later 3 | 4 | #ifndef CLIPBOARD_H 5 | #define CLIPBOARD_H 6 | 7 | #include 8 | #include 9 | 10 | class ClipboardPrivate; 11 | 12 | class Clipboard : public QObject 13 | { 14 | Q_OBJECT 15 | /** 16 | * Controls the state this object will be monitoring and extracting its contents from. 17 | */ 18 | Q_PROPERTY(QClipboard::Mode mode READ mode WRITE setMode NOTIFY modeChanged) 19 | 20 | /** 21 | * Provides the contents currently in the clipboard and lets modify them. 22 | */ 23 | Q_PROPERTY(QVariant content READ content WRITE setContent NOTIFY contentChanged) 24 | 25 | /** 26 | * Figure out the nature of the contents in the clipboard. 27 | */ 28 | Q_PROPERTY(QStringList formats READ formats NOTIFY contentChanged) 29 | 30 | public: 31 | explicit Clipboard(QObject *parent = nullptr); 32 | 33 | QClipboard::Mode mode() const; 34 | void setMode(QClipboard::Mode mode); 35 | 36 | Q_SCRIPTABLE QVariant contentFormat(const QString &format) const; 37 | QVariant content() const; 38 | void setContent(const QVariant &content); 39 | 40 | QStringList formats() const; 41 | 42 | Q_SCRIPTABLE void clear(); 43 | 44 | Q_SIGNALS: 45 | void modeChanged(QClipboard::Mode mode); 46 | void contentChanged(); 47 | 48 | private Q_SLOTS: 49 | void clipboardChanged(QClipboard::Mode m); 50 | 51 | private: 52 | QClipboard *m_clipboard; 53 | QClipboard::Mode m_mode; 54 | }; 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /mobile/content/resources/kde-edu-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/kalgebra/592b574f5b0210b2a52e8c9cdcacb2d2278b9e88/mobile/content/resources/kde-edu-logo.png -------------------------------------------------------------------------------- /mobile/content/ui/About.qml: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2015 by Aleix Pol 2 | // SPDX-License-Identifier: GPL-2.0-or-later 3 | 4 | import QtQuick 2.0 5 | import org.kde.kirigamiaddons.formcard 1.0 as FormCard 6 | import org.kde.analitza 1.0 7 | import org.kde.kalgebra.mobile 1.0 8 | 9 | FormCard.AboutPage { 10 | aboutData: About 11 | } 12 | -------------------------------------------------------------------------------- /mobile/content/ui/Dictionary.qml: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2015 by Aleix Pol 2 | // SPDX-License-Identifier: GPL-2.0-or-later 3 | 4 | import QtQuick 5 | import QtQuick.Layouts 6 | import org.kde.analitza 7 | import org.kde.kirigami as Kirigami 8 | import org.kde.kalgebra.mobile 9 | import QtQuick.Controls 10 | 11 | Kirigami.Page { 12 | id: page 13 | 14 | title: i18nc("@title:window", "Dictionary") 15 | 16 | function updateGraph() { 17 | view.model.clear(); 18 | view.resetViewport(); 19 | view.addFunction(operators.data(operators.index(chosebox.currentIndex,3)), App.variables); 20 | } 21 | ColumnLayout { 22 | anchors.fill: parent 23 | spacing: 15 24 | 25 | Kirigami.FormLayout { 26 | id: layout 27 | 28 | ComboBox { 29 | id: chosebox 30 | Kirigami.FormData.label: i18n("Name:") 31 | textRole: "name" 32 | 33 | model: OperatorsModel { 34 | id: operators 35 | } 36 | 37 | onCurrentIndexChanged: { 38 | page.updateGraph(); 39 | } 40 | } 41 | Label { 42 | text: operators.data(operators.index(chosebox.currentIndex,1)) 43 | Kirigami.FormData.label: i18n("%1:", operators.headerData(1,Qt.Horizontal)) 44 | } 45 | Label { 46 | text: operators.data(operators.index(chosebox.currentIndex,2)) 47 | Kirigami.FormData.label: i18n("%1:", operators.headerData(2,Qt.Horizontal)) 48 | } 49 | Label { 50 | text: operators.data(operators.index(chosebox.currentIndex,3)) 51 | Kirigami.FormData.label: i18n("%1:", operators.headerData(3,Qt.Horizontal)) 52 | } 53 | } 54 | Rectangle { 55 | color: 'white' 56 | Layout.fillWidth: true 57 | Layout.fillHeight: true 58 | 59 | Graph2D { 60 | id: view 61 | anchors { 62 | fill: parent 63 | } 64 | model: PlotsModel { 65 | id: plotsModel 66 | } 67 | Component.onCompleted: { 68 | page.updateGraph(); 69 | } 70 | } 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /mobile/content/ui/Plot2D.qml: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2015 by Aleix Pol 2 | // SPDX-License-Identifier: GPL-2.0-or-later 3 | 4 | import QtCore 5 | import QtQuick 6 | import QtQuick.Layouts 7 | import QtQuick.Dialogs 8 | import QtQuick.Controls as QQC2 9 | import org.kde.kirigami as Kirigami 10 | import org.kde.analitza 11 | import org.kde.kalgebra.mobile 12 | 13 | Kirigami.Page { 14 | id: page 15 | 16 | leftPadding: 0 17 | rightPadding: 0 18 | topPadding: 0 19 | bottomPadding: 0 20 | 21 | title: i18nc("@title:window", "2D Plot") 22 | 23 | FileDialog { 24 | id: fileDialog 25 | currentFolder: StandardPaths.standardLocations(StandardPaths.HomeLocation)[0] 26 | onAccepted: proceed() 27 | 28 | property var proceed 29 | } 30 | 31 | actions: [ 32 | QQC2.Action { 33 | icon.name: 'list-add' 34 | text: i18n('Add Plot') 35 | onTriggered: plotDialog.open() 36 | }, 37 | QQC2.Action { 38 | text: i18n("Save") 39 | icon.name: 'document-save' 40 | onTriggered: { 41 | fileDialog.title = text 42 | fileDialog.proceed = function() { 43 | var ret = view.save(fileDialog.fileUrl) 44 | console.log("saved 2D", fileDialog.fileUrl, ret) 45 | } 46 | fileDialog.nameFilters = view.filters 47 | fileDialog.selectExisting = false 48 | fileDialog.open() 49 | } 50 | }, 51 | QQC2.Action { 52 | text: i18n("View Grid") 53 | icon.name: 'view-grid' 54 | checkable: true 55 | checked: view.showGrid 56 | onToggled: view.showGrid = checked 57 | }, 58 | QQC2.Action { 59 | icon.name: 'view-restore' 60 | text: i18n("Reset Viewport") 61 | onTriggered: view.resetViewport() 62 | } 63 | //custom viewport? 64 | ] 65 | 66 | Rectangle { 67 | anchors.fill: parent 68 | color: 'white' 69 | 70 | Graph2D { 71 | id: view 72 | anchors.fill: parent 73 | model: App.functionsModel() 74 | AddPlotDialog { 75 | id: plotDialog 76 | text: "sin x" 77 | dimension: 2 78 | } 79 | } 80 | } 81 | } -------------------------------------------------------------------------------- /mobile/content/ui/Plot3D.qml: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2015 by Aleix Pol 2 | // SPDX-License-Identifier: GPL-2.0-or-later 3 | 4 | import QtCore 5 | import QtQuick 6 | import QtQuick.Layouts 7 | import QtQuick.Dialogs 8 | import QtQuick.Controls 9 | import org.kde.kirigami as Kirigami 10 | import org.kde.analitza 11 | import org.kde.kalgebra.mobile 12 | 13 | Kirigami.Page { 14 | id: page 15 | 16 | leftPadding: 0 17 | rightPadding: 0 18 | topPadding: 0 19 | bottomPadding: 0 20 | 21 | title: i18nc("@title:window", "3D Plot") 22 | 23 | FileDialog { 24 | id: fileDialog 25 | currentFolder: StandardPaths.standardLocations(StandardPaths.HomeLocation)[0] 26 | onAccepted: proceed() 27 | 28 | property var proceed 29 | } 30 | 31 | actions: [ 32 | Kirigami.Action { 33 | icon.name: 'list-add' 34 | text: i18n('Add Plot') 35 | onTriggered: plotDialog.open() 36 | }, 37 | Kirigami.Action { 38 | text: i18n("Save") 39 | icon.name: 'document-save' 40 | onTriggered: { 41 | fileDialog.title = text 42 | fileDialog.proceed = function() { 43 | var ret = view.save(fileDialog.fileUrl) 44 | console.log("saved 3D", fileDialog.fileUrl, ret) 45 | } 46 | fileDialog.nameFilters = view.filters 47 | fileDialog.selectExisting = false 48 | fileDialog.open() 49 | } 50 | }, 51 | Kirigami.Action { 52 | icon.name: 'view-restore' 53 | text: i18n("Reset Viewport") 54 | onTriggered: view.resetViewport() 55 | } 56 | ] 57 | 58 | 59 | Graph3D { 60 | id: view 61 | anchors.fill: parent 62 | model: App.functionsModel() 63 | AddPlotDialog { 64 | id: plotDialog 65 | text: "sin x*sin y" 66 | dimension: 4 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /mobile/content/ui/TableResultPage.qml: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Carl Schwan 2 | // SPDX-License-Identifier: GPL-2.0-or-later 3 | 4 | import QtQuick 5 | import org.kde.kirigami as Kirigami 6 | import org.kde.kirigamiaddons.delegates as Delegates 7 | 8 | Kirigami.ScrollablePage { 9 | title: i18n("Results") 10 | 11 | required property var results 12 | 13 | ListView { 14 | currentIndex: -1 15 | model: results 16 | delegate: Delegates.RoundedItemDelegate { 17 | required property int index 18 | required property string element 19 | 20 | text: element 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /mobile/content/ui/Tables.qml: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2015 by Aleix Pol 2 | // SPDX-License-Identifier: GPL-2.0-or-later 3 | 4 | import QtQuick 5 | import QtQuick.Layouts 6 | import org.kde.analitza 7 | import QtQuick.Controls as QQC2 8 | import org.kde.kirigami as Kirigami 9 | import org.kde.kalgebra.mobile 10 | 11 | Kirigami.ScrollablePage { 12 | title: i18n("Value tables") 13 | 14 | property ListModel resultsModel: ListModel {} 15 | 16 | function showResults() { 17 | applicationWindow().pageStack.push("qrc:/TableResultPage.qml", { 18 | 'results': resultsModel 19 | }); 20 | } 21 | 22 | function calculateTable() { 23 | resultsModel.clear(); 24 | 25 | var tmp = a.unusedVariableName() 26 | const lambda = a.dependenciesToLambda(input.text); 27 | if (lambda === "") { 28 | resultsModel.append( { element: i18n("Errors: Invalid expression %1", input.text) } ); 29 | showResults(); 30 | return; 31 | } 32 | var ret = a.insertVariable(tmp, lambda) 33 | var ffrom = from.realValue, fto=to.realValue, fstep=step.realValue; 34 | // console.log("chancho (" + ffrom + ", " + fto + " : " + fstep + ") " + ret); 35 | if((fto-ffrom>0)!=(fstep>0)) { 36 | fstep *= -1; 37 | step.text = fstep 38 | } 39 | // console.log("chancho2 (" + ffrom + ", " + fto + " : " + fstep + ") " + ret); 40 | 41 | if(fstep===0) { 42 | resultsModel.append( { element: i18n("Errors: The step cannot be 0") } ); 43 | } else if(ffrom === fto) { 44 | resultsModel.append( { element: i18n("Errors: The start and end are the same") } ); 45 | } else if(!a.isCorrect) { 46 | resultsModel.append( { element: i18n("Errors: %1", ret ? ret : a.errors) } ); 47 | } else { 48 | 49 | for (var i=0, c=Math.abs((ffrom-fto)/fstep); i<=c && a.isCorrect; i++) { 50 | const idx = ffrom + i * fstep; 51 | const expr = a.executeFunc(tmp, [ idx ]); 52 | if (typeof(expr) === "string") { 53 | resultsModel.append( { element: i18n("error: %1", expr) } ); 54 | } else { 55 | resultsModel.append( { element: idx +" = "+ expr.expression } ); 56 | } 57 | } 58 | } 59 | 60 | a.removeVariable(tmp); 61 | showResults(); 62 | } 63 | 64 | actions: QQC2.Action { 65 | icon.name: 'dialog-ok' 66 | text: i18nc("@action:button Run table", "Run") 67 | onTriggered: calculateTable() 68 | } 69 | 70 | Analitza { 71 | id: a 72 | variables: App.variables 73 | } 74 | 75 | Kirigami.FormLayout { 76 | ExpressionInput { 77 | Kirigami.FormData.label: i18n("Input") 78 | id: input 79 | text: "sin x"; 80 | Layout.fillWidth: true 81 | onAddOperation: calculateTable(); 82 | } 83 | RealInput { 84 | id: from; 85 | text: "0"; 86 | Kirigami.FormData.label: i18n("From:") 87 | Layout.fillWidth: true; 88 | onAccepted: calculateTable() 89 | } 90 | RealInput { 91 | id: to; 92 | text: "10"; 93 | Kirigami.FormData.label: i18n("To:") 94 | Layout.fillWidth: true; 95 | onAccepted: calculateTable() 96 | } 97 | 98 | RealInput { 99 | id: step; 100 | Kirigami.FormData.label: i18n("Step") 101 | text: "1"; 102 | Layout.fillWidth: true; 103 | onAccepted: calculateTable() 104 | } 105 | QQC2.Button { 106 | text: i18n("Run") 107 | onClicked: calculateTable() 108 | visible: !Kirigami.Settings.isMobile 109 | } 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /mobile/content/ui/VariablesView.qml: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2015 by Aleix Pol 2 | // SPDX-License-Identifier: GPL-2.0-or-later 3 | 4 | import QtQuick 5 | import org.kde.analitza 6 | import org.kde.kirigami as Kirigami 7 | import org.kde.kirigamiaddons.delegates as Delegates 8 | import org.kde.kalgebra.mobile 9 | 10 | Kirigami.ScrollablePage { 11 | title: i18n("Variables") 12 | 13 | ListView { 14 | model: VariablesModel { variables: App.variables } 15 | currentIndex: -1 16 | delegate: Delegates.RoundedItemDelegate { 17 | required property int index 18 | required property string whatsThis 19 | 20 | text: whatsThis 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /mobile/content/ui/controls/AddButton.qml: -------------------------------------------------------------------------------- 1 | /************************************************************************************* 2 | * Copyright (C) 2015 by Aleix Pol * 3 | * * 4 | * This program is free software; you can redistribute it and/or * 5 | * modify it under the terms of the GNU General Public License * 6 | * as published by the Free Software Foundation; either version 2 * 7 | * of the License, or (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the Free Software * 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 17 | *************************************************************************************/ 18 | 19 | import org.kde.kirigami 2.0 as Kirigami 20 | import QtQuick 2.1 21 | 22 | Item 23 | { 24 | id: root 25 | signal clicked 26 | 27 | readonly property var act: Kirigami.Action { 28 | id: action 29 | icon.name: "list-add" 30 | onTriggered: root.clicked() 31 | } 32 | 33 | Component.onCompleted: { 34 | var page = parent 35 | for (; page && page.title === undefined; page = page.parent) {} 36 | 37 | page.mainAction = action 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /mobile/content/ui/controls/AddPlotDialog.qml: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2021 Swapnil Tripathi 2 | // SPDX-FileCopyrightText: 2023 Carl Schwan 3 | // SPDX-License-Identifier: GPL-2.0-or-later 4 | 5 | import QtQuick 6 | import QtQuick.Controls as QQC2 7 | import QtQuick.Layouts 8 | 9 | import org.kde.kirigami as Kirigami 10 | import org.kde.kirigamiaddons.delegates as Delegates 11 | import org.kde.kirigamiaddons.components as Components 12 | 13 | import org.kde.analitza 14 | import org.kde.kalgebra.mobile 15 | 16 | QQC2.Dialog { 17 | id: root 18 | 19 | property alias text: input.text 20 | required property int dimension 21 | 22 | width: Math.min(parent.width - Kirigami.Units.gridUnit * 2, Kirigami.Units.gridUnit * 30) 23 | height: Math.min(parent.height - Kirigami.Units.gridUnit * 2, Kirigami.Units.gridUnit * 30) 24 | 25 | x: Math.round((parent.width - width) / 2) 26 | y: Math.round((parent.height - height) / 2) 27 | z: Kirigami.OverlayZStacking.z 28 | 29 | parent: applicationWindow().QQC2.Overlay.overlay 30 | 31 | background: Components.DialogRoundedBackground {} 32 | 33 | padding: 0 34 | modal: true 35 | 36 | contentItem: ColumnLayout { 37 | spacing: 0 38 | RowLayout { 39 | Layout.fillWidth: true 40 | Layout.margins: Kirigami.Units.smallSpacing 41 | spacing: Kirigami.Units.smallSpacing 42 | 43 | ExpressionInput { 44 | id: input 45 | Layout.fillWidth: true 46 | focus: true 47 | Component.onCompleted: selectAll() 48 | onAddOperation: { 49 | input.selectAll() 50 | App.functionsModel().addFunction(operation, root.dimension, App.variables) 51 | } 52 | } 53 | 54 | QQC2.Button { 55 | icon.name: "list-add" 56 | text: i18nc("@action:button", "Add") 57 | display: QQC2.Button.IconOnly 58 | onClicked: { 59 | input.selectAll() 60 | App.functionsModel().addFunction(input.text, root.dimension, App.variables) 61 | } 62 | 63 | QQC2.ToolTip.text: text 64 | QQC2.ToolTip.visible: hovered 65 | QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay 66 | } 67 | 68 | QQC2.Button { 69 | text: i18nc("@action:button", "Examples") 70 | onClicked: { 71 | if (menu.visible) { 72 | menu.hide() 73 | } else { 74 | menu.popup(this, 0, height) 75 | } 76 | } 77 | 78 | QQC2.ToolTip.text: text 79 | QQC2.ToolTip.visible: hovered 80 | QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay 81 | 82 | QQC2.Menu { 83 | id: menu 84 | Repeater { 85 | model: App.examples(root.dimension) 86 | delegate: QQC2.MenuItem { 87 | text: modelData 88 | onClicked: { 89 | input.text = modelData 90 | input.selectAll() 91 | input.focus = true 92 | } 93 | } 94 | } 95 | } 96 | } 97 | 98 | QQC2.Button { 99 | icon.name: "edit-clear-all" 100 | text: i18nc("@action:button", "Clear All") 101 | onClicked: { 102 | App.functionsModel().clear(); 103 | view.resetViewport(); 104 | } 105 | 106 | QQC2.ToolTip.text: text 107 | QQC2.ToolTip.visible: hovered 108 | QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay 109 | } 110 | 111 | QQC2.ToolButton { 112 | icon.name: "dialog-close" 113 | text: i18nc("@action:button", "Close dialog") 114 | display: QQC2.Button.IconOnly 115 | onClicked: { 116 | root.close() 117 | } 118 | 119 | QQC2.ToolTip.text: text 120 | QQC2.ToolTip.visible: hovered 121 | QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay 122 | } 123 | } 124 | 125 | Kirigami.Separator { 126 | Layout.fillWidth: true 127 | } 128 | 129 | QQC2.ScrollView { 130 | Layout.fillWidth: true 131 | Layout.fillHeight: true 132 | 133 | ListView { 134 | id: plotView 135 | 136 | model: App.functionsModel() 137 | delegate: Delegates.RoundedItemDelegate { 138 | id: plotDelegate 139 | 140 | required property int index 141 | required property string description 142 | 143 | text: description 144 | 145 | contentItem: RowLayout { 146 | Delegates.DefaultContentItem { 147 | itemDelegate: plotDelegate 148 | Layout.fillWidth: true 149 | } 150 | 151 | QQC2.ToolButton { 152 | icon.name: "list-remove" 153 | text: i18nc("@action:button", "Remove plot") 154 | display: QQC2.Button.IconOnly 155 | 156 | onClicked: App.functionsModel().removeRows(plotDelegate.index, 1); 157 | 158 | QQC2.ToolTip.text: text 159 | QQC2.ToolTip.visible: hovered 160 | QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay 161 | } 162 | } 163 | } 164 | 165 | Kirigami.PlaceholderMessage { 166 | width: parent.width - Kirigami.Units.gridUnit * 4 167 | anchors.centerIn: parent 168 | text: i18nc("@info", "No plot available") 169 | visible: plotView.count === 0 170 | } 171 | } 172 | } 173 | } 174 | } 175 | -------------------------------------------------------------------------------- /mobile/content/ui/controls/ExpressionInput.qml: -------------------------------------------------------------------------------- 1 | /************************************************************************************* 2 | * Copyright (C) 2015 by Aleix Pol * 3 | * * 4 | * This program is free software; you can redistribute it and/or * 5 | * modify it under the terms of the GNU General Public License * 6 | * as published by the Free Software Foundation; either version 2 * 7 | * of the License, or (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the Free Software * 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 17 | *************************************************************************************/ 18 | 19 | import QtQuick 20 | import QtQuick.Window 21 | import QtQuick.Controls as QQC2 22 | import org.kde.kirigami as Kirigami 23 | import org.kde.kirigamiaddons.delegates as Delegates 24 | import org.kde.analitza 25 | import QtQuick.Layouts 26 | import org.kde.kalgebra.mobile 27 | 28 | QQC2.TextArea 29 | { 30 | id: field 31 | signal addOperation(operation: string) 32 | 33 | readonly property string currentWord: field.cursorPosition <= field.text.length ? operators.lastWord(field.cursorPosition, field.text) : "" 34 | property var history: [] 35 | property int historyPos: 0 36 | 37 | Layout.preferredHeight: Kirigami.Units.gridUnit * 2 38 | 39 | placeholderText: i18n("Expression to calculate...") 40 | inputMethodHints: /*Qt.ImhPreferNumbers |*/ Qt.ImhNoPredictiveText | Qt.ImhNoAutoUppercase 41 | 42 | AlgebraHighlighter { 43 | textDocument: field.textDocument 44 | } 45 | 46 | Keys.forwardTo: view.visible && view.currentIndex >= 0 ? [ view.currentItem ] : null 47 | Keys.onTabPressed: view.incrementCurrentIndex() 48 | Keys.onUpPressed: { 49 | if (view.count > 0) { 50 | view.decrementCurrentIndex() 51 | } else { 52 | if (historyPos < (history.length - 1)) 53 | historyPos++ 54 | text = history[history.length - 1 - historyPos] 55 | } 56 | } 57 | Keys.onDownPressed: { 58 | if (view.count > 0) { 59 | view.incrementCurrentIndex() 60 | } else { 61 | if (historyPos > 0) 62 | historyPos-- 63 | text = history[history.length - 1 - historyPos] 64 | } 65 | } 66 | Keys.onReturnPressed: { 67 | view.currentIndex = -1; 68 | historyPos = -1 69 | history.push(text) 70 | addOperation(text); 71 | field.text = ''; 72 | } 73 | 74 | QQC2.Popup { 75 | id: popup 76 | visible: view.count > 0 77 | parent: QQC2.Overlay.overlay 78 | 79 | readonly property point fieldPos: field.parent.mapToGlobal(field.x, field.y) 80 | x: fieldPos.x 81 | y: fieldPos.y - popup.height 82 | width: field.width 83 | height: Math.min(Kirigami.Units.gridUnit * 13, view.count * Kirigami.Units.gridUnit * 2 + popup.topPadding + popup.bottomPadding) 84 | 85 | ListView { 86 | id: view 87 | currentIndex: -1 88 | anchors.fill: parent 89 | keyNavigationWraps: true 90 | clip: true 91 | model: field.currentWord.length > 0 ? filterModel : [] 92 | 93 | QSortFilterProxyModel { 94 | id: filterModel 95 | sourceModel: OperatorsModel { id: operators } 96 | filterRegularExpression: new RegExp("^" + field.currentWord) 97 | filterCaseSensitivity: Qt.CaseInsensitive 98 | } 99 | 100 | delegate: Delegates.RoundedItemDelegate { 101 | required property int index 102 | required property string description 103 | required property string name 104 | required property bool isVariable 105 | 106 | text: name + " - " + description 107 | highlighted: view.currentIndex === index 108 | width: ListView.view.width 109 | 110 | function complete() { 111 | let toInsert = name.substr(field.currentWord.length); 112 | if(isVariable) 113 | toInsert += '('; 114 | field.insert(field.cursorPosition, toInsert) 115 | } 116 | 117 | onClicked: complete() 118 | Keys.onReturnPressed: complete() 119 | } 120 | } 121 | } 122 | } 123 | 124 | -------------------------------------------------------------------------------- /mobile/content/ui/controls/RealInput.qml: -------------------------------------------------------------------------------- 1 | /************************************************************************************* 2 | * Copyright (C) 2015 by Aleix Pol * 3 | * * 4 | * This program is free software; you can redistribute it and/or * 5 | * modify it under the terms of the GNU General Public License * 6 | * as published by the Free Software Foundation; either version 2 * 7 | * of the License, or (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the Free Software * 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 17 | *************************************************************************************/ 18 | 19 | import QtQuick.Controls 2.0 20 | import QtQuick 2.0 21 | 22 | TextField 23 | { 24 | id: input 25 | 26 | readonly property real realValue: Number.fromLocaleString(locale, text) 27 | validator: DoubleValidator {} 28 | inputMethodHints: Qt.ImhPreferNumbers 29 | } 30 | -------------------------------------------------------------------------------- /mobile/content/ui/main.qml: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2015 by Aleix Pol 2 | // SPDX-License-Identifier: GPL-2.0-or-later 3 | 4 | import QtQuick 5 | import QtQuick.Layouts 6 | import QtQuick.Controls as QQC2 7 | import QtQuick.Templates as T 8 | import org.kde.kirigami as Kirigami 9 | import org.kde.kirigamiaddons.delegates as Delegates 10 | import org.kde.analitza 11 | import org.kde.kalgebra.mobile 12 | 13 | Kirigami.ApplicationWindow 14 | { 15 | id: rootItem 16 | height: 800 17 | width: Kirigami.Units.gridUnit * 70 18 | visible: true 19 | 20 | readonly property int columnWidth: Kirigami.Units.gridUnit * 13 21 | wideScreen: width > columnWidth * 5 22 | 23 | Kirigami.PagePool { 24 | id: mainPagePool 25 | } 26 | 27 | globalDrawer: Kirigami.OverlayDrawer { 28 | id: drawer 29 | 30 | edge: Qt.application.layoutDirection === Qt.RightToLeft ? Qt.RightEdge : Qt.LeftEdge 31 | 32 | modal: !rootItem.wideScreen 33 | onModalChanged: drawerOpen = !modal 34 | handleVisible: modal 35 | width: contentItem ? columnWidth : 0 36 | 37 | leftPadding: 0 38 | rightPadding: 0 39 | topPadding: 0 40 | bottomPadding: 0 41 | 42 | Kirigami.Theme.colorSet: Kirigami.Theme.View 43 | Kirigami.Theme.inherit: false 44 | 45 | drawerOpen: true 46 | 47 | readonly property list actions: [ 48 | Kirigami.PagePoolAction { 49 | icon.name: "utilities-terminal" 50 | text: i18n("Calculator") 51 | page: "qrc:/Console.qml" 52 | pagePool: mainPagePool 53 | }, 54 | Kirigami.PagePoolAction { 55 | id: show2dPlotAction 56 | icon.name: "draw-bezier-curves" 57 | text: i18n("Graph 2D") 58 | page: "qrc:/Plot2D.qml" 59 | pagePool: mainPagePool 60 | }, 61 | Kirigami.PagePoolAction { 62 | id: show3dPlotAction 63 | icon.name: "adjustrgb" 64 | text: i18n("Graph 3D") 65 | page: "qrc:/Plot3D.qml" 66 | pagePool: mainPagePool 67 | }, 68 | Kirigami.PagePoolAction { 69 | icon.name: "kspread" 70 | text: i18n("Value Tables") 71 | page: "qrc:/Tables.qml" 72 | pagePool: mainPagePool 73 | }, 74 | Kirigami.PagePoolAction { 75 | icon.name: "document-properties" 76 | text: i18n("Variables") 77 | page: "qrc:/VariablesView.qml" 78 | pagePool: mainPagePool 79 | }, 80 | Kirigami.PagePoolAction { 81 | icon.name: "documentation" 82 | text: i18n("Dictionary") 83 | page: "qrc:/Dictionary.qml" 84 | pagePool: mainPagePool 85 | }, 86 | Kirigami.PagePoolAction { 87 | icon.name: "help-about" 88 | text: i18n("About KAlgebra") 89 | page: "qrc:/About.qml" 90 | pagePool: mainPagePool 91 | } 92 | ] 93 | 94 | contentItem: ColumnLayout { 95 | spacing: 0 96 | 97 | QQC2.ToolBar { 98 | Layout.fillWidth: true 99 | Layout.preferredHeight: rootItem.pageStack.globalToolBar.preferredHeight 100 | Layout.bottomMargin: Math.round(Kirigami.Units.smallSpacing / 2) 101 | 102 | leftPadding: Kirigami.Units.smallSpacing 103 | rightPadding: Kirigami.Units.smallSpacing 104 | topPadding: Kirigami.Units.smallSpacing 105 | bottomPadding: Kirigami.Units.smallSpacing 106 | 107 | contentItem: Kirigami.Heading { 108 | text: i18n("KAlgebra") 109 | } 110 | } 111 | 112 | Repeater { 113 | delegate: Delegates.RoundedItemDelegate { 114 | required property var modelData 115 | action: modelData 116 | Layout.fillWidth: true 117 | } 118 | model: drawer.actions 119 | } 120 | 121 | Item { 122 | Layout.fillHeight: true 123 | } 124 | } 125 | } 126 | 127 | readonly property Component customDrawer: Kirigami.OverlayDrawer { 128 | leftPadding: 0 129 | rightPadding: 0 130 | topPadding: 0 131 | bottomPadding: 0 132 | 133 | edge: Qt.application.layoutDirection == Qt.RightToLeft ? Qt.LeftEdge : Qt.RightEdge 134 | modal: !rootItem.wideScreen 135 | onModalChanged: drawerOpen = !modal 136 | drawerOpen: true 137 | onContentItemChanged: if (contentItem) { 138 | contentItem.visible = (mainPagePool.lastLoadedItem.drawerContent !== undefined); 139 | } 140 | width: mainPagePool.lastLoadedItem.drawerContent ? columnWidth : 0 141 | 142 | contentItem: mainPagePool.lastLoadedItem.drawerContent ?? null 143 | handleVisible: mainPagePool.lastLoadedItem.drawerContent !== undefined 144 | 145 | Kirigami.Theme.colorSet: Kirigami.Theme.View 146 | Kirigami.Theme.inherit: false 147 | } 148 | 149 | readonly property Component normalDrawer: Kirigami.ContextDrawer {} 150 | 151 | Component.onCompleted: if (Kirigami.Settings.isMobile) { 152 | contextDrawer = normalDrawer.createObject(rootItem); 153 | } else { 154 | contextDrawer = customDrawer.createObject(rootItem); 155 | } 156 | 157 | pageStack.initialPage: mainPagePool.loadPage("qrc:/Console.qml") 158 | } 159 | -------------------------------------------------------------------------------- /mobile/kalgebramobile.cpp: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2010 by Aleix Pol 2 | // SPDX-License-Identifier: GPL-2.0-or-later 3 | 4 | #include "kalgebramobile.h" 5 | 6 | #include 7 | #include 8 | 9 | #include "../src/consolemodel.h" 10 | 11 | #include "clipboard.h" 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | using namespace Analitza; 20 | 21 | KAlgebraMobile *KAlgebraMobile::s_self = nullptr; 22 | KAlgebraMobile *KAlgebraMobile::self() 23 | { 24 | return s_self; 25 | } 26 | 27 | Q_DECLARE_METATYPE(QSharedPointer) 28 | 29 | class AlgebraHighlighterQml : public AlgebraHighlighter 30 | { 31 | Q_OBJECT 32 | Q_PROPERTY(QQuickTextDocument *textDocument READ textDocument WRITE setTextDocument NOTIFY textDocumentChanged) 33 | public: 34 | AlgebraHighlighterQml() 35 | : AlgebraHighlighter(nullptr) 36 | { 37 | } 38 | 39 | QQuickTextDocument *textDocument() const 40 | { 41 | return m_textDocument; 42 | } 43 | void setTextDocument(QQuickTextDocument *textDocument) 44 | { 45 | if (textDocument == m_textDocument) { 46 | return; 47 | } 48 | 49 | m_textDocument = textDocument; 50 | setDocument(m_textDocument->textDocument()); 51 | Q_EMIT textDocumentChanged(textDocument); 52 | } 53 | 54 | Q_SIGNALS: 55 | void textDocumentChanged(QQuickTextDocument *textDocument); 56 | 57 | private: 58 | QQuickTextDocument *m_textDocument = nullptr; 59 | }; 60 | 61 | KAlgebraMobile::KAlgebraMobile(QObject *parent) 62 | : QObject(parent) 63 | , m_functionsModel(nullptr) 64 | , m_vars(new Analitza::Variables) 65 | { 66 | Q_ASSERT(s_self == nullptr); 67 | s_self = this; 68 | 69 | const auto uri = "org.kde.kalgebra.mobile"; 70 | qmlRegisterType("org.kde.kalgebra.mobile", 1, 0, "ConsoleModel"); 71 | qmlRegisterType("org.kde.kalgebra.mobile", 1, 0, "QSortFilterProxyModel"); 72 | qmlRegisterUncreatableType("org.kde.kalgebra.mobile", 1, 0, "QAbstractItemModel", QStringLiteral("no")); 73 | qmlRegisterType(uri, 1, 0, "Clipboard"); 74 | qmlRegisterType(uri, 1, 0, "AlgebraHighlighter"); 75 | 76 | qmlRegisterAnonymousType("Kalgebra", 1); 77 | qmlRegisterUncreatableType("org.kde.kalgebra.mobile", 1, 0, "Expression", QStringLiteral("because")); 78 | qRegisterMetaType>("QSharedPointer"); 79 | } 80 | 81 | PlotsModel *KAlgebraMobile::functionsModel() 82 | { 83 | if (!m_functionsModel) { 84 | m_functionsModel = new Analitza::PlotsModel(this); 85 | connect(m_functionsModel, &QAbstractItemModel::rowsRemoved, this, &KAlgebraMobile::functionRemoved); 86 | connect(m_functionsModel, &QAbstractItemModel::rowsInserted, this, &KAlgebraMobile::functionInserted); 87 | connect(m_functionsModel, &QAbstractItemModel::dataChanged, this, &KAlgebraMobile::functionModified); 88 | } 89 | 90 | return m_functionsModel; 91 | } 92 | 93 | void KAlgebraMobile::functionInserted(const QModelIndex &parent, int start, int end) 94 | { 95 | Q_ASSERT(!parent.isValid()); 96 | for (int i = start; i <= end; i++) { 97 | QModelIndex idx = functionsModel()->index(i, 1); 98 | m_vars->modify(idx.sibling(i, 0).data().toString(), Analitza::Expression(idx.data().toString())); 99 | } 100 | } 101 | 102 | void KAlgebraMobile::functionRemoved(const QModelIndex &parent, int start, int end) 103 | { 104 | Q_ASSERT(!parent.isValid()); 105 | for (int i = start; i <= end; i++) { 106 | QModelIndex idx = functionsModel()->index(i); 107 | m_vars->remove(functionsModel()->data(idx, Qt::DisplayRole).toString()); 108 | } 109 | } 110 | 111 | void KAlgebraMobile::functionModified(const QModelIndex &idxA, const QModelIndex &idxB) 112 | { 113 | if (idxB.column() == 1) { 114 | for (int i = idxA.row(); i < idxB.row(); ++i) { 115 | QModelIndex idx = functionsModel()->index(i, 1); 116 | m_vars->modify(idx.sibling(i, 0).data().toString(), Analitza::Expression(idx.data().toString())); 117 | } 118 | } // else TODO: figure out how to control a "rename" 119 | } 120 | 121 | QSharedPointer KAlgebraMobile::variables() const 122 | { 123 | return m_vars; 124 | } 125 | 126 | QStringList KAlgebraMobile::examples(Dimension dim) const 127 | { 128 | return PlotsFactory::self()->examples(dim); 129 | } 130 | 131 | #include "kalgebramobile.moc" 132 | #include "moc_kalgebramobile.cpp" 133 | -------------------------------------------------------------------------------- /mobile/kalgebramobile.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************* 2 | * Copyright (C) 2010 by Aleix Pol * 3 | * * 4 | * This program is free software; you can redistribute it and/or * 5 | * modify it under the terms of the GNU General Public License * 6 | * as published by the Free Software Foundation; either version 2 * 7 | * of the License, or (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the Free Software * 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 17 | *************************************************************************************/ 18 | 19 | #ifndef KALGEBRAMOBILE_H 20 | #define KALGEBRAMOBILE_H 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | class QModelIndex; 28 | namespace Analitza 29 | { 30 | class PlotsModel; 31 | } 32 | 33 | class KAlgebraMobile : public QObject 34 | { 35 | Q_OBJECT 36 | Q_PROPERTY(QSharedPointer variables READ variables NOTIFY variablesChanged) 37 | public: 38 | explicit KAlgebraMobile(QObject *parent = nullptr); 39 | 40 | static KAlgebraMobile *self(); 41 | void notifyVariablesChanged() 42 | { 43 | variablesChanged(); 44 | } 45 | 46 | public Q_SLOTS: 47 | Analitza::PlotsModel *functionsModel(); 48 | QSharedPointer variables() const; 49 | QStringList examples(Analitza::Dimension dimension) const; 50 | 51 | private Q_SLOTS: 52 | void functionRemoved(const QModelIndex &parent, int start, int end); 53 | void functionModified(const QModelIndex &idxA, const QModelIndex &idxB); 54 | void functionInserted(const QModelIndex &parent, int start, int end); 55 | 56 | Q_SIGNALS: 57 | void variablesChanged(); 58 | 59 | private: 60 | static KAlgebraMobile *s_self; 61 | 62 | Analitza::PlotsModel *m_functionsModel; 63 | QSharedPointer m_vars; 64 | }; 65 | 66 | #endif // KALGEBRAMOBILE_H 67 | -------------------------------------------------------------------------------- /mobile/main.cpp: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2010 by Aleix Pol 2 | // SPDX-License-Identifier: GPL-2.0-or-later 3 | 4 | #include 5 | #ifdef Q_OS_ANDROID 6 | #include 7 | #else 8 | #include 9 | #endif 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | #include "kalgebra_version.h" 22 | #include "kalgebramobile.h" 23 | 24 | Q_DECL_EXPORT int main(int argc, char *argv[]) 25 | { 26 | #ifdef Q_OS_ANDROID 27 | QQuickStyle::setStyle(QStringLiteral("Material")); 28 | #endif 29 | #ifdef Q_OS_ANDROID 30 | QGuiApplication app(argc, argv); 31 | #else 32 | QApplication app(argc, argv); 33 | #endif 34 | KLocalizedString::setApplicationDomain("kalgebramobile"); 35 | KAboutData about(QStringLiteral("kalgebramobile"), 36 | QStringLiteral("KAlgebra"), 37 | QStringLiteral(KALGEBRA_VERSION_STRING), 38 | i18n("A portable calculator"), 39 | KAboutLicense::GPL, 40 | i18n("(C) 2006-2023 Aleix Pol i Gonzalez")); 41 | about.addAuthor(i18n("Aleix Pol i Gonzalez"), i18nc("@info:credit", "Maintainer"), QStringLiteral("aleixpol@kde.org")); 42 | about.setTranslator(i18nc("NAME OF TRANSLATORS", "Your names"), i18nc("EMAIL OF TRANSLATORS", "Your emails")); 43 | KAboutData::setApplicationData(about); 44 | QGuiApplication::setWindowIcon(QIcon::fromTheme(QStringLiteral("kalgebra"))); 45 | 46 | { 47 | QCommandLineParser parser; 48 | about.setupCommandLine(&parser); 49 | parser.process(app); 50 | about.processCommandLine(&parser); 51 | } 52 | 53 | KAlgebraMobile widget; 54 | 55 | QQmlApplicationEngine engine; 56 | 57 | qmlRegisterSingletonInstance("org.kde.kalgebra.mobile", 1, 0, "App", &widget); 58 | qmlRegisterSingletonType("org.kde.kalgebra.mobile", 1, 0, "About", [](QQmlEngine *engine, QJSEngine *) -> QJSValue { 59 | return engine->toScriptValue(KAboutData::applicationData()); 60 | }); 61 | engine.rootContext()->setContextObject(new KLocalizedContext(&engine)); 62 | engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); 63 | return app.exec(); 64 | } 65 | -------------------------------------------------------------------------------- /mobile/resources.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | content/resources/kde-edu-logo.png 4 | ../icons/64-apps-kalgebra.png 5 | ../icons/sc-apps-kalgebra.svgz 6 | content/ui/main.qml 7 | content/ui/About.qml 8 | content/ui/TableResultPage.qml 9 | content/ui/Console.qml 10 | content/ui/Dictionary.qml 11 | content/ui/Plot2D.qml 12 | content/ui/Plot3D.qml 13 | content/ui/Tables.qml 14 | content/ui/VariablesView.qml 15 | content/ui/controls/RealInput.qml 16 | content/ui/controls/ExpressionInput.qml 17 | content/ui/controls/AddButton.qml 18 | content/ui/controls/AddPlotDialog.qml 19 | 20 | 21 | -------------------------------------------------------------------------------- /plasmoids/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | plasma_install_package(graphsplasmoid org.kde.graphsplasmoid) 2 | -------------------------------------------------------------------------------- /plasmoids/graphsplasmoid/contents/ui/config.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | nowplayingConfig 4 | 5 | 6 | 7 | 0 8 | 0 9 | 351 10 | 341 11 | 12 | 13 | 14 | 15 | 16 | 17 | Function 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /plasmoids/graphsplasmoid/contents/ui/main.qml: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 Aleix Pol Gonzalez 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU Library General Public License as 6 | * published by the Free Software Foundation; either version 2 or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details 13 | * 14 | * You should have received a copy of the GNU Library General Public 15 | * License along with this program; if not, write to the 16 | * Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | import QtQuick 21 | import org.kde.plasma.plasmoid 22 | import org.kde.plasma.components as PlasmaComponents 23 | import org.kde.kirigami as Kirigami 24 | import org.kde.analitza 25 | 26 | PlasmoidItem { 27 | width: Kirigami.Units.gridUnit * 15 28 | height: Kirigami.Units.gridUnit * 15 29 | 30 | property Component compactRepresentation: Component { 31 | PlasmaComponents.Button { 32 | icon.source: "kalgebra" 33 | onClicked: plasmoid.togglePopup() 34 | } 35 | } 36 | property string displayedFunction 37 | onDisplayedFunctionChanged: { 38 | plots.clear() 39 | view.addFunction(displayedFunction) 40 | } 41 | 42 | PlasmaComponents.TextField { 43 | id: input 44 | anchors { 45 | top: parent.top 46 | left: parent.left 47 | right: parent.right 48 | } 49 | onAccepted: { 50 | displayedFunction = text 51 | plasmoid.writeConfig("function", text) 52 | } 53 | } 54 | 55 | Component.onCompleted: { 56 | plasmoid.addEventListener('ConfigChanged', function() { 57 | displayedFunction = plasmoid.readConfig("function") 58 | input.text = displayedFunction 59 | }); 60 | } 61 | 62 | Graph2D { 63 | id: view 64 | anchors { 65 | fill: parent 66 | topMargin: input.height 67 | } 68 | 69 | model: PlotsModel { id: plots } 70 | 71 | ticksShown: false 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /plasmoids/graphsplasmoid/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "KPackageStructure": "Plasma/Applet", 3 | "KPlugin": { 4 | "Authors": [ 5 | { 6 | "Email": "aleixpol@kde.org", 7 | "Name": "Aleix Pol Gonzalez", 8 | "Name[ar]": "ألكس بول غنزالز", 9 | "Name[ast]": "Aleix Pol i Gonzàlez", 10 | "Name[bg]": "Aleix Pol Gonzalez", 11 | "Name[ca@valencia]": "Aleix Pol Gonzalez", 12 | "Name[ca]": "Aleix Pol Gonzalez", 13 | "Name[cs]": "Aleix Pol Gonzalez", 14 | "Name[de]": "Aleix Pol Gonzalez", 15 | "Name[en_GB]": "Aleix Pol Gonzalez", 16 | "Name[eo]": "Aleix Pol Gonzalez", 17 | "Name[es]": "Aleix Pol Gonzalez", 18 | "Name[eu]": "Aleix Pol Gonzalez", 19 | "Name[fi]": "Aleix Pol Gonzalez", 20 | "Name[fr]": "Aleix Pol Gonzalez", 21 | "Name[gl]": "Aleix Pol i Gonzàlez", 22 | "Name[he]": "אלש פול גונזלז", 23 | "Name[hu]": "Aleix Pol Gonzalez", 24 | "Name[ia]": "Aleix Pol Gonzalez", 25 | "Name[is]": "Aleix Pol Gonzalez", 26 | "Name[it]": "Aleix Pol Gonzalez", 27 | "Name[ka]": "Aleix Pol Gonzalez", 28 | "Name[ko]": "Aleix Pol Gonzalez", 29 | "Name[lv]": "Aleix Pol Gonzalez", 30 | "Name[nl]": "Aleix Pol Gonzalez", 31 | "Name[nn]": "Aleix Pol Gonzalez", 32 | "Name[pl]": "Aleix Pol Gonzalez", 33 | "Name[pt]": "Aleix Pol Gonzalez", 34 | "Name[pt_BR]": "Aleix Pol Gonzalez", 35 | "Name[ru]": "Aleix Pol Gonzalez", 36 | "Name[sa]": "एलेक्स पोल गोन्जालेज", 37 | "Name[sl]": "Aleix Pol Gonzalez", 38 | "Name[sv]": "Aleix Pol Gonzalez", 39 | "Name[tr]": "Aleix Pol Gonzalez", 40 | "Name[uk]": "Aleix Pol Gonzalez", 41 | "Name[x-test]": "xxAleix Pol Gonzalezxx", 42 | "Name[zh_TW]": "Aleix Pol Gonzalez" 43 | } 44 | ], 45 | "Category": "Education", 46 | "Description": "Put the weirdest plots on your desktop!", 47 | "Description[ar]": "ضع أغرب الرسوم على سطح مكتبك!", 48 | "Description[bg]": "Поставете най-яките графики на работния си плот!", 49 | "Description[ca@valencia]": "Poseu les gràfiques més estranyes al vostre escriptori!", 50 | "Description[ca]": "Poseu les gràfiques més estranyes al vostre escriptori!", 51 | "Description[cs]": "Přidejte na svou plochu ty nejdivnější grafy.", 52 | "Description[de]": "Erstellt Plots für Ihre Arbeitsfläche.", 53 | "Description[el]": "Βάλτε τις πιο περίεργες γραφικές απεικονίσεις στην επιφάνεια εργασίας σας!", 54 | "Description[en_GB]": "Put the weirdest plots on your desktop!", 55 | "Description[eo]": "Metu la plej diboĉajn grafeojn sur via labortablo!", 56 | "Description[es]": "Traza las gráficas más retorcidas en su escritorio", 57 | "Description[eu]": "Ipini zure mahaigainean trazatu bitxienak!", 58 | "Description[fi]": "Pane mitä ihmeellisimpiä kuvaajia työpöydällesi!", 59 | "Description[fr]": "Placez les tracés les plus étranges sur votre bureau !", 60 | "Description[gl]": "Poña as gráficas máis charramangueiras no seu escritorio!", 61 | "Description[he]": "יצירת שרטוטים הזויים לשולחן העבודה שלך!", 62 | "Description[hu]": "Tegye a legfurább görbéket az asztalára!", 63 | "Description[ia]": "Pone le tracias plus bizzarre su tu scriptorio!", 64 | "Description[is]": "Settu skrítnustu gröfin þín á skjáborðið!", 65 | "Description[it]": "Metti i grafici più strani sul tuo desktop!", 66 | "Description[ka]": "დადეთ უცნაური გრაფიკები სამუშაო მაგიდის ფონად!", 67 | "Description[ko]": "데스크톱에 재미있는 플롯을 그리십시오!", 68 | "Description[lv]": "Izveidojiet visdīvainākos grafikus savā datorā!", 69 | "Description[nl]": "Zet de wonderlijkste plots op uw bureaublad!", 70 | "Description[nn]": "Lag dei merkelegast tenkjelege plotta!", 71 | "Description[pl]": "Rysuj najdziwniejsze wykresy na swoim pulpicie!", 72 | "Description[pt]": "Coloque os gráficos mais estranhos no seu ecrã!", 73 | "Description[pt_BR]": "Coloque os gráficos mais estranhos na sua área de trabalho!", 74 | "Description[ru]": "Разместите на рабочем столе причудливые графики!", 75 | "Description[sa]": "विचित्रतमाः कथानकाः स्वस्य डेस्कटॉप् मध्ये स्थापयन्तु!", 76 | "Description[sl]": "Postavite najbolj čudaške grafe na vaše namizje!", 77 | "Description[sv]": "Rita riktigt konstiga diagram på skrivbordet.", 78 | "Description[tr]": "Masaüstüne en tuhaf çizimleri koyun!", 79 | "Description[uk]": "Розташуйте на вашій стільниці найвигадливіше креслення!", 80 | "Description[x-test]": "xxPut the weirdest plots on your desktop!xx", 81 | "Description[zh_TW]": "把您所想得到的詭異繪圖放在桌面上吧!", 82 | "EnabledByDefault": true, 83 | "Icon": "kalgebra", 84 | "Id": "org.kde.graphsplasmoid", 85 | "License": "GPL", 86 | "Name": "2D Plots", 87 | "Name[ar]": "رسوم ثنائية البعد", 88 | "Name[bg]": "Двумерни графики", 89 | "Name[bs]": "2D crtanja", 90 | "Name[ca@valencia]": "Gràfiques en 2D", 91 | "Name[ca]": "Gràfiques en 2D", 92 | "Name[cs]": "2D grafy", 93 | "Name[da]": "2D-plot", 94 | "Name[de]": "2D-Plots", 95 | "Name[el]": "2D Γραφικές απεικονίσεις", 96 | "Name[en_GB]": "2D Plots", 97 | "Name[eo]": "2D-desegnaĵoj", 98 | "Name[es]": "Gráficas 2D", 99 | "Name[et]": "2D joonised", 100 | "Name[eu]": "2Dko trazatuak", 101 | "Name[fa]": "نمودار دو بعدی", 102 | "Name[fi]": "2D-kuvaajat", 103 | "Name[fr]": "Tracés 2D", 104 | "Name[gl]": "Gráficas en 2D", 105 | "Name[he]": "שרטוטים דו־ממדיים", 106 | "Name[hu]": "2D görbék", 107 | "Name[ia]": "2Plots (Tracias)", 108 | "Name[is]": "Tvívítt graf", 109 | "Name[it]": "Grafici 2D", 110 | "Name[ka]": "2D გრაფიკები", 111 | "Name[kk]": "2D графиктер", 112 | "Name[km]": "ការ​គ្រោង​ធ្វេមាត្រ", 113 | "Name[ko]": "2차원 플롯", 114 | "Name[lt]": "2D grafikai", 115 | "Name[lv]": "2D koordinātu plakne", 116 | "Name[nb]": "2D-plott", 117 | "Name[nds]": "2D-Plots", 118 | "Name[nl]": "2d-plots", 119 | "Name[nn]": "2D-plott", 120 | "Name[pa]": "2ਡੀ ਪਲਾਟ", 121 | "Name[pl]": "Wykresy 2D", 122 | "Name[pt]": "Gráficos 2D", 123 | "Name[pt_BR]": "Gráficos em 2D", 124 | "Name[ru]": "Двумерный график", 125 | "Name[sa]": "2D प्लॉट्स", 126 | "Name[sk]": "2D zákresy", 127 | "Name[sl]": "2D grafi", 128 | "Name[sv]": "Tvådimensionella diagram", 129 | "Name[te]": "2D ప్లాట్", 130 | "Name[tr]": "2B Çizimler", 131 | "Name[uk]": "Плоскі графіки", 132 | "Name[x-test]": "xx2D Plotsxx", 133 | "Name[zh_CN]": "二维绘图", 134 | "Name[zh_TW]": "2D 繪圖", 135 | "Version": "1.0", 136 | "Website": "https://edu.kde.org/kalgebra" 137 | }, 138 | "X-Plasma-API": "declarativeappletscript", 139 | "X-Plasma-API-Minimum-Version": "6.0", 140 | "X-Plasma-MainScript": "ui/main.qml" 141 | } 142 | -------------------------------------------------------------------------------- /po/ast/kalgebramobile.po: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 This file is copyright: 2 | # This file is distributed under the same license as the kalgebra package. 3 | # 4 | # SPDX-FileCopyrightText: 2023 Enol P. 5 | msgid "" 6 | msgstr "" 7 | "Project-Id-Version: kalgebra\n" 8 | "Report-Msgid-Bugs-To: https://bugs.kde.org\n" 9 | "POT-Creation-Date: 2025-01-13 00:37+0000\n" 10 | "PO-Revision-Date: 2023-11-07 21:26+0100\n" 11 | "Last-Translator: Enol P. \n" 12 | "Language-Team: \n" 13 | "Language: ast\n" 14 | "MIME-Version: 1.0\n" 15 | "Content-Type: text/plain; charset=UTF-8\n" 16 | "Content-Transfer-Encoding: 8bit\n" 17 | "Plural-Forms: nplurals=2; plural=n != 1;\n" 18 | "X-Generator: Lokalize 23.08.2\n" 19 | 20 | #: content/ui/Console.qml:19 content/ui/main.qml:50 21 | #, kde-format 22 | msgid "Calculator" 23 | msgstr "" 24 | 25 | #: content/ui/Console.qml:40 content/ui/main.qml:108 26 | #, kde-format 27 | msgid "KAlgebra" 28 | msgstr "KAlgebra" 29 | 30 | #: content/ui/Console.qml:62 31 | #, kde-format 32 | msgctxt "@action:button" 33 | msgid "Load Script" 34 | msgstr "" 35 | 36 | #: content/ui/Console.qml:66 content/ui/Console.qml:76 37 | #, kde-format 38 | msgid "Script (*.kal)" 39 | msgstr "" 40 | 41 | #: content/ui/Console.qml:72 42 | #, kde-format 43 | msgctxt "@action:button" 44 | msgid "Save Script" 45 | msgstr "" 46 | 47 | #: content/ui/Console.qml:83 48 | #, kde-format 49 | msgctxt "@action:button" 50 | msgid "Export Log" 51 | msgstr "" 52 | 53 | #: content/ui/Console.qml:87 54 | #, kde-format 55 | msgid "HTML (*.html)" 56 | msgstr "" 57 | 58 | #: content/ui/Console.qml:94 59 | #, kde-format 60 | msgctxt "@action:button" 61 | msgid "Evaluate" 62 | msgstr "" 63 | 64 | #: content/ui/Console.qml:94 65 | #, kde-format 66 | msgctxt "@action:button" 67 | msgid "Calculate" 68 | msgstr "" 69 | 70 | #: content/ui/Console.qml:100 71 | #, kde-format 72 | msgctxt "@action:button" 73 | msgid "Clear Log" 74 | msgstr "" 75 | 76 | #: content/ui/Console.qml:131 77 | #, kde-format 78 | msgid "2D Plot" 79 | msgstr "" 80 | 81 | #: content/ui/Console.qml:140 82 | #, kde-format 83 | msgid "3D Plot" 84 | msgstr "" 85 | 86 | #: content/ui/Console.qml:149 87 | #, kde-format 88 | msgid "Copy \"%1\"" 89 | msgstr "" 90 | 91 | #: content/ui/Console.qml:187 92 | #, kde-format 93 | msgctxt "@info" 94 | msgid "Empty console history" 95 | msgstr "" 96 | 97 | #: content/ui/controls/AddPlotDialog.qml:56 98 | #, kde-format 99 | msgctxt "@action:button" 100 | msgid "Add" 101 | msgstr "" 102 | 103 | #: content/ui/controls/AddPlotDialog.qml:69 104 | #, kde-format 105 | msgctxt "@action:button" 106 | msgid "Examples" 107 | msgstr "" 108 | 109 | #: content/ui/controls/AddPlotDialog.qml:100 110 | #, kde-format 111 | msgctxt "@action:button" 112 | msgid "Clear All" 113 | msgstr "" 114 | 115 | #: content/ui/controls/AddPlotDialog.qml:113 116 | #, kde-format 117 | msgctxt "@action:button" 118 | msgid "Close dialog" 119 | msgstr "" 120 | 121 | #: content/ui/controls/AddPlotDialog.qml:153 122 | #, kde-format 123 | msgctxt "@action:button" 124 | msgid "Remove plot" 125 | msgstr "" 126 | 127 | #: content/ui/controls/AddPlotDialog.qml:168 128 | #, kde-format 129 | msgctxt "@info" 130 | msgid "No plot available" 131 | msgstr "" 132 | 133 | #: content/ui/controls/ExpressionInput.qml:39 134 | #, kde-format 135 | msgid "Expression to calculate..." 136 | msgstr "" 137 | 138 | #: content/ui/Dictionary.qml:14 139 | #, kde-format 140 | msgctxt "@title:window" 141 | msgid "Dictionary" 142 | msgstr "" 143 | 144 | #: content/ui/Dictionary.qml:30 145 | #, kde-format 146 | msgid "Name:" 147 | msgstr "" 148 | 149 | #: content/ui/Dictionary.qml:43 content/ui/Dictionary.qml:47 150 | #: content/ui/Dictionary.qml:51 151 | #, kde-format 152 | msgid "%1:" 153 | msgstr "" 154 | 155 | #: content/ui/main.qml:57 156 | #, kde-format 157 | msgid "Graph 2D" 158 | msgstr "" 159 | 160 | #: content/ui/main.qml:64 161 | #, kde-format 162 | msgid "Graph 3D" 163 | msgstr "" 164 | 165 | #: content/ui/main.qml:70 166 | #, kde-format 167 | msgid "Value Tables" 168 | msgstr "" 169 | 170 | #: content/ui/main.qml:76 content/ui/VariablesView.qml:11 171 | #, kde-format 172 | msgid "Variables" 173 | msgstr "" 174 | 175 | #: content/ui/main.qml:82 176 | #, kde-format 177 | msgid "Dictionary" 178 | msgstr "" 179 | 180 | #: content/ui/main.qml:88 181 | #, kde-format 182 | msgid "About KAlgebra" 183 | msgstr "" 184 | 185 | #: content/ui/Plot2D.qml:21 186 | #, kde-format 187 | msgctxt "@title:window" 188 | msgid "2D Plot" 189 | msgstr "" 190 | 191 | #: content/ui/Plot2D.qml:38 content/ui/Plot3D.qml:38 192 | #, kde-format 193 | msgid "Save" 194 | msgstr "" 195 | 196 | #: content/ui/Plot2D.qml:52 197 | #, kde-format 198 | msgid "View Grid" 199 | msgstr "" 200 | 201 | #: content/ui/Plot2D.qml:60 content/ui/Plot3D.qml:53 202 | #, kde-format 203 | msgid "Reset Viewport" 204 | msgstr "" 205 | 206 | #: content/ui/Plot3D.qml:21 207 | #, kde-format 208 | msgctxt "@title:window" 209 | msgid "3D Plot" 210 | msgstr "" 211 | 212 | #: content/ui/TableResultPage.qml:9 213 | #, kde-format 214 | msgid "Results" 215 | msgstr "" 216 | 217 | #: content/ui/Tables.qml:12 218 | #, kde-format 219 | msgid "Value tables" 220 | msgstr "" 221 | 222 | #: content/ui/Tables.qml:28 223 | #, kde-format 224 | msgid "Errors: Invalid expression %1" 225 | msgstr "" 226 | 227 | #: content/ui/Tables.qml:42 228 | #, kde-format 229 | msgid "Errors: The step cannot be 0" 230 | msgstr "" 231 | 232 | #: content/ui/Tables.qml:44 233 | #, kde-format 234 | msgid "Errors: The start and end are the same" 235 | msgstr "" 236 | 237 | #: content/ui/Tables.qml:46 238 | #, kde-format 239 | msgid "Errors: %1" 240 | msgstr "" 241 | 242 | #: content/ui/Tables.qml:53 243 | #, kde-format 244 | msgid "error: %1" 245 | msgstr "" 246 | 247 | #: content/ui/Tables.qml:66 248 | #, kde-format 249 | msgctxt "@action:button Run table" 250 | msgid "Run" 251 | msgstr "" 252 | 253 | #: content/ui/Tables.qml:77 254 | #, kde-format 255 | msgid "Input" 256 | msgstr "" 257 | 258 | #: content/ui/Tables.qml:86 259 | #, kde-format 260 | msgid "From:" 261 | msgstr "" 262 | 263 | #: content/ui/Tables.qml:93 264 | #, kde-format 265 | msgid "To:" 266 | msgstr "" 267 | 268 | #: content/ui/Tables.qml:100 269 | #, kde-format 270 | msgid "Step" 271 | msgstr "" 272 | 273 | #: content/ui/Tables.qml:106 274 | #, kde-format 275 | msgid "Run" 276 | msgstr "" 277 | 278 | #: main.cpp:38 279 | #, kde-format 280 | msgid "A portable calculator" 281 | msgstr "" 282 | 283 | #: main.cpp:40 284 | #, kde-format 285 | msgid "(C) 2006-2023 Aleix Pol i Gonzalez" 286 | msgstr "" 287 | 288 | #: main.cpp:41 289 | #, kde-format 290 | msgid "Aleix Pol i Gonzalez" 291 | msgstr "" 292 | 293 | #: main.cpp:41 294 | #, kde-format 295 | msgctxt "@info:credit" 296 | msgid "Maintainer" 297 | msgstr "" 298 | 299 | #: main.cpp:42 300 | #, kde-format 301 | msgctxt "NAME OF TRANSLATORS" 302 | msgid "Your names" 303 | msgstr "" 304 | 305 | #: main.cpp:42 306 | #, kde-format 307 | msgctxt "EMAIL OF TRANSLATORS" 308 | msgid "Your emails" 309 | msgstr "" 310 | -------------------------------------------------------------------------------- /po/ca/docs/kalgebra/kalgebra-2dgraph-window.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/kalgebra/592b574f5b0210b2a52e8c9cdcacb2d2278b9e88/po/ca/docs/kalgebra/kalgebra-2dgraph-window.png -------------------------------------------------------------------------------- /po/ca/docs/kalgebra/kalgebra-3dgraph-window.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/kalgebra/592b574f5b0210b2a52e8c9cdcacb2d2278b9e88/po/ca/docs/kalgebra/kalgebra-3dgraph-window.png -------------------------------------------------------------------------------- /po/ca/docs/kalgebra/kalgebra-dictionary-window.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/kalgebra/592b574f5b0210b2a52e8c9cdcacb2d2278b9e88/po/ca/docs/kalgebra/kalgebra-dictionary-window.png -------------------------------------------------------------------------------- /po/ca/docs/kalgebra/kalgebra-main-window.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/kalgebra/592b574f5b0210b2a52e8c9cdcacb2d2278b9e88/po/ca/docs/kalgebra/kalgebra-main-window.png -------------------------------------------------------------------------------- /po/de/docs/kalgebra/kalgebra-main-window.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/kalgebra/592b574f5b0210b2a52e8c9cdcacb2d2278b9e88/po/de/docs/kalgebra/kalgebra-main-window.png -------------------------------------------------------------------------------- /po/es/docs/kalgebra/kalgebra-main-window.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/kalgebra/592b574f5b0210b2a52e8c9cdcacb2d2278b9e88/po/es/docs/kalgebra/kalgebra-main-window.png -------------------------------------------------------------------------------- /po/hi/kalgebramobile.po: -------------------------------------------------------------------------------- 1 | # Hindi translations for kalgebra package. 2 | # Copyright (C) 2024 This file is copyright: 3 | # This file is distributed under the same license as the kalgebra package. 4 | # Kali , 2024. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: kalgebra\n" 9 | "Report-Msgid-Bugs-To: https://bugs.kde.org\n" 10 | "POT-Creation-Date: 2025-01-13 00:37+0000\n" 11 | "PO-Revision-Date: 2024-12-15 15:57+0530\n" 12 | "Last-Translator: Kali \n" 13 | "Language-Team: Hindi \n" 14 | "Language: hi\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Plural-Forms: nplurals=2; plural=(n!=1);\n" 19 | 20 | #: content/ui/Console.qml:19 content/ui/main.qml:50 21 | #, kde-format 22 | msgid "Calculator" 23 | msgstr "" 24 | 25 | #: content/ui/Console.qml:40 content/ui/main.qml:108 26 | #, kde-format 27 | msgid "KAlgebra" 28 | msgstr "" 29 | 30 | #: content/ui/Console.qml:62 31 | #, kde-format 32 | msgctxt "@action:button" 33 | msgid "Load Script" 34 | msgstr "" 35 | 36 | #: content/ui/Console.qml:66 content/ui/Console.qml:76 37 | #, kde-format 38 | msgid "Script (*.kal)" 39 | msgstr "" 40 | 41 | #: content/ui/Console.qml:72 42 | #, kde-format 43 | msgctxt "@action:button" 44 | msgid "Save Script" 45 | msgstr "" 46 | 47 | #: content/ui/Console.qml:83 48 | #, kde-format 49 | msgctxt "@action:button" 50 | msgid "Export Log" 51 | msgstr "" 52 | 53 | #: content/ui/Console.qml:87 54 | #, kde-format 55 | msgid "HTML (*.html)" 56 | msgstr "" 57 | 58 | #: content/ui/Console.qml:94 59 | #, kde-format 60 | msgctxt "@action:button" 61 | msgid "Evaluate" 62 | msgstr "" 63 | 64 | #: content/ui/Console.qml:94 65 | #, kde-format 66 | msgctxt "@action:button" 67 | msgid "Calculate" 68 | msgstr "" 69 | 70 | #: content/ui/Console.qml:100 71 | #, kde-format 72 | msgctxt "@action:button" 73 | msgid "Clear Log" 74 | msgstr "" 75 | 76 | #: content/ui/Console.qml:131 77 | #, kde-format 78 | msgid "2D Plot" 79 | msgstr "" 80 | 81 | #: content/ui/Console.qml:140 82 | #, kde-format 83 | msgid "3D Plot" 84 | msgstr "" 85 | 86 | #: content/ui/Console.qml:149 87 | #, kde-format 88 | msgid "Copy \"%1\"" 89 | msgstr "" 90 | 91 | #: content/ui/Console.qml:187 92 | #, kde-format 93 | msgctxt "@info" 94 | msgid "Empty console history" 95 | msgstr "" 96 | 97 | #: content/ui/controls/AddPlotDialog.qml:56 98 | #, kde-format 99 | msgctxt "@action:button" 100 | msgid "Add" 101 | msgstr "" 102 | 103 | #: content/ui/controls/AddPlotDialog.qml:69 104 | #, kde-format 105 | msgctxt "@action:button" 106 | msgid "Examples" 107 | msgstr "" 108 | 109 | #: content/ui/controls/AddPlotDialog.qml:100 110 | #, kde-format 111 | msgctxt "@action:button" 112 | msgid "Clear All" 113 | msgstr "" 114 | 115 | #: content/ui/controls/AddPlotDialog.qml:113 116 | #, kde-format 117 | msgctxt "@action:button" 118 | msgid "Close dialog" 119 | msgstr "" 120 | 121 | #: content/ui/controls/AddPlotDialog.qml:153 122 | #, kde-format 123 | msgctxt "@action:button" 124 | msgid "Remove plot" 125 | msgstr "" 126 | 127 | #: content/ui/controls/AddPlotDialog.qml:168 128 | #, kde-format 129 | msgctxt "@info" 130 | msgid "No plot available" 131 | msgstr "" 132 | 133 | #: content/ui/controls/ExpressionInput.qml:39 134 | #, kde-format 135 | msgid "Expression to calculate..." 136 | msgstr "" 137 | 138 | #: content/ui/Dictionary.qml:14 139 | #, kde-format 140 | msgctxt "@title:window" 141 | msgid "Dictionary" 142 | msgstr "" 143 | 144 | #: content/ui/Dictionary.qml:30 145 | #, kde-format 146 | msgid "Name:" 147 | msgstr "" 148 | 149 | #: content/ui/Dictionary.qml:43 content/ui/Dictionary.qml:47 150 | #: content/ui/Dictionary.qml:51 151 | #, kde-format 152 | msgid "%1:" 153 | msgstr "" 154 | 155 | #: content/ui/main.qml:57 156 | #, kde-format 157 | msgid "Graph 2D" 158 | msgstr "" 159 | 160 | #: content/ui/main.qml:64 161 | #, kde-format 162 | msgid "Graph 3D" 163 | msgstr "" 164 | 165 | #: content/ui/main.qml:70 166 | #, kde-format 167 | msgid "Value Tables" 168 | msgstr "" 169 | 170 | #: content/ui/main.qml:76 content/ui/VariablesView.qml:11 171 | #, kde-format 172 | msgid "Variables" 173 | msgstr "" 174 | 175 | #: content/ui/main.qml:82 176 | #, kde-format 177 | msgid "Dictionary" 178 | msgstr "" 179 | 180 | #: content/ui/main.qml:88 181 | #, kde-format 182 | msgid "About KAlgebra" 183 | msgstr "" 184 | 185 | #: content/ui/Plot2D.qml:21 186 | #, kde-format 187 | msgctxt "@title:window" 188 | msgid "2D Plot" 189 | msgstr "" 190 | 191 | #: content/ui/Plot2D.qml:38 content/ui/Plot3D.qml:38 192 | #, kde-format 193 | msgid "Save" 194 | msgstr "" 195 | 196 | #: content/ui/Plot2D.qml:52 197 | #, kde-format 198 | msgid "View Grid" 199 | msgstr "" 200 | 201 | #: content/ui/Plot2D.qml:60 content/ui/Plot3D.qml:53 202 | #, kde-format 203 | msgid "Reset Viewport" 204 | msgstr "" 205 | 206 | #: content/ui/Plot3D.qml:21 207 | #, kde-format 208 | msgctxt "@title:window" 209 | msgid "3D Plot" 210 | msgstr "" 211 | 212 | #: content/ui/TableResultPage.qml:9 213 | #, kde-format 214 | msgid "Results" 215 | msgstr "" 216 | 217 | #: content/ui/Tables.qml:12 218 | #, kde-format 219 | msgid "Value tables" 220 | msgstr "" 221 | 222 | #: content/ui/Tables.qml:28 223 | #, kde-format 224 | msgid "Errors: Invalid expression %1" 225 | msgstr "" 226 | 227 | #: content/ui/Tables.qml:42 228 | #, kde-format 229 | msgid "Errors: The step cannot be 0" 230 | msgstr "" 231 | 232 | #: content/ui/Tables.qml:44 233 | #, kde-format 234 | msgid "Errors: The start and end are the same" 235 | msgstr "" 236 | 237 | #: content/ui/Tables.qml:46 238 | #, kde-format 239 | msgid "Errors: %1" 240 | msgstr "" 241 | 242 | #: content/ui/Tables.qml:53 243 | #, kde-format 244 | msgid "error: %1" 245 | msgstr "" 246 | 247 | #: content/ui/Tables.qml:66 248 | #, kde-format 249 | msgctxt "@action:button Run table" 250 | msgid "Run" 251 | msgstr "" 252 | 253 | #: content/ui/Tables.qml:77 254 | #, kde-format 255 | msgid "Input" 256 | msgstr "" 257 | 258 | #: content/ui/Tables.qml:86 259 | #, kde-format 260 | msgid "From:" 261 | msgstr "" 262 | 263 | #: content/ui/Tables.qml:93 264 | #, kde-format 265 | msgid "To:" 266 | msgstr "" 267 | 268 | #: content/ui/Tables.qml:100 269 | #, kde-format 270 | msgid "Step" 271 | msgstr "" 272 | 273 | #: content/ui/Tables.qml:106 274 | #, kde-format 275 | msgid "Run" 276 | msgstr "" 277 | 278 | #: main.cpp:38 279 | #, kde-format 280 | msgid "A portable calculator" 281 | msgstr "" 282 | 283 | #: main.cpp:40 284 | #, kde-format 285 | msgid "(C) 2006-2023 Aleix Pol i Gonzalez" 286 | msgstr "" 287 | 288 | #: main.cpp:41 289 | #, kde-format 290 | msgid "Aleix Pol i Gonzalez" 291 | msgstr "" 292 | 293 | #: main.cpp:41 294 | #, kde-format 295 | msgctxt "@info:credit" 296 | msgid "Maintainer" 297 | msgstr "" 298 | 299 | #: main.cpp:42 300 | #, kde-format 301 | msgctxt "NAME OF TRANSLATORS" 302 | msgid "Your names" 303 | msgstr "" 304 | 305 | #: main.cpp:42 306 | #, kde-format 307 | msgctxt "EMAIL OF TRANSLATORS" 308 | msgid "Your emails" 309 | msgstr "" 310 | -------------------------------------------------------------------------------- /po/ja/kalgebramobile.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: kalgebramobile\n" 4 | "Report-Msgid-Bugs-To: https://bugs.kde.org\n" 5 | "POT-Creation-Date: 2025-01-13 00:37+0000\n" 6 | "PO-Revision-Date: 2018-08-01 23:02-0700\n" 7 | "Last-Translator: Japanese KDE translation team \n" 8 | "Language-Team: Japanese \n" 9 | "Language: ja\n" 10 | "MIME-Version: 1.0\n" 11 | "Content-Type: text/plain; charset=UTF-8\n" 12 | "Content-Transfer-Encoding: 8bit\n" 13 | "Plural-Forms: nplurals=1; plural=0;\n" 14 | "X-Accelerator-Marker: &\n" 15 | "X-Text-Markup: kde4\n" 16 | 17 | #: content/ui/Console.qml:19 content/ui/main.qml:50 18 | #, kde-format 19 | msgid "Calculator" 20 | msgstr "" 21 | 22 | #: content/ui/Console.qml:40 content/ui/main.qml:108 23 | #, kde-format 24 | msgid "KAlgebra" 25 | msgstr "" 26 | 27 | #: content/ui/Console.qml:62 28 | #, kde-format 29 | msgctxt "@action:button" 30 | msgid "Load Script" 31 | msgstr "" 32 | 33 | #: content/ui/Console.qml:66 content/ui/Console.qml:76 34 | #, kde-format 35 | msgid "Script (*.kal)" 36 | msgstr "" 37 | 38 | #: content/ui/Console.qml:72 39 | #, kde-format 40 | msgctxt "@action:button" 41 | msgid "Save Script" 42 | msgstr "" 43 | 44 | #: content/ui/Console.qml:83 45 | #, kde-format 46 | msgctxt "@action:button" 47 | msgid "Export Log" 48 | msgstr "" 49 | 50 | #: content/ui/Console.qml:87 51 | #, kde-format 52 | msgid "HTML (*.html)" 53 | msgstr "" 54 | 55 | #: content/ui/Console.qml:94 56 | #, kde-format 57 | msgctxt "@action:button" 58 | msgid "Evaluate" 59 | msgstr "" 60 | 61 | #: content/ui/Console.qml:94 62 | #, kde-format 63 | msgctxt "@action:button" 64 | msgid "Calculate" 65 | msgstr "" 66 | 67 | #: content/ui/Console.qml:100 68 | #, kde-format 69 | msgctxt "@action:button" 70 | msgid "Clear Log" 71 | msgstr "" 72 | 73 | #: content/ui/Console.qml:131 74 | #, kde-format 75 | msgid "2D Plot" 76 | msgstr "" 77 | 78 | #: content/ui/Console.qml:140 79 | #, kde-format 80 | msgid "3D Plot" 81 | msgstr "" 82 | 83 | #: content/ui/Console.qml:149 84 | #, kde-format 85 | msgid "Copy \"%1\"" 86 | msgstr "" 87 | 88 | #: content/ui/Console.qml:187 89 | #, kde-format 90 | msgctxt "@info" 91 | msgid "Empty console history" 92 | msgstr "" 93 | 94 | #: content/ui/controls/AddPlotDialog.qml:56 95 | #, kde-format 96 | msgctxt "@action:button" 97 | msgid "Add" 98 | msgstr "" 99 | 100 | #: content/ui/controls/AddPlotDialog.qml:69 101 | #, kde-format 102 | msgctxt "@action:button" 103 | msgid "Examples" 104 | msgstr "" 105 | 106 | #: content/ui/controls/AddPlotDialog.qml:100 107 | #, kde-format 108 | msgctxt "@action:button" 109 | msgid "Clear All" 110 | msgstr "" 111 | 112 | #: content/ui/controls/AddPlotDialog.qml:113 113 | #, kde-format 114 | msgctxt "@action:button" 115 | msgid "Close dialog" 116 | msgstr "" 117 | 118 | #: content/ui/controls/AddPlotDialog.qml:153 119 | #, kde-format 120 | msgctxt "@action:button" 121 | msgid "Remove plot" 122 | msgstr "" 123 | 124 | #: content/ui/controls/AddPlotDialog.qml:168 125 | #, kde-format 126 | msgctxt "@info" 127 | msgid "No plot available" 128 | msgstr "" 129 | 130 | #: content/ui/controls/ExpressionInput.qml:39 131 | #, kde-format 132 | msgid "Expression to calculate..." 133 | msgstr "" 134 | 135 | #: content/ui/Dictionary.qml:14 136 | #, kde-format 137 | msgctxt "@title:window" 138 | msgid "Dictionary" 139 | msgstr "" 140 | 141 | #: content/ui/Dictionary.qml:30 142 | #, kde-format 143 | msgid "Name:" 144 | msgstr "" 145 | 146 | #: content/ui/Dictionary.qml:43 content/ui/Dictionary.qml:47 147 | #: content/ui/Dictionary.qml:51 148 | #, kde-format 149 | msgid "%1:" 150 | msgstr "" 151 | 152 | #: content/ui/main.qml:57 153 | #, kde-format 154 | msgid "Graph 2D" 155 | msgstr "" 156 | 157 | #: content/ui/main.qml:64 158 | #, kde-format 159 | msgid "Graph 3D" 160 | msgstr "" 161 | 162 | #: content/ui/main.qml:70 163 | #, kde-format 164 | msgid "Value Tables" 165 | msgstr "" 166 | 167 | #: content/ui/main.qml:76 content/ui/VariablesView.qml:11 168 | #, kde-format 169 | msgid "Variables" 170 | msgstr "" 171 | 172 | #: content/ui/main.qml:82 173 | #, kde-format 174 | msgid "Dictionary" 175 | msgstr "" 176 | 177 | #: content/ui/main.qml:88 178 | #, kde-format 179 | msgid "About KAlgebra" 180 | msgstr "" 181 | 182 | #: content/ui/Plot2D.qml:21 183 | #, kde-format 184 | msgctxt "@title:window" 185 | msgid "2D Plot" 186 | msgstr "" 187 | 188 | #: content/ui/Plot2D.qml:38 content/ui/Plot3D.qml:38 189 | #, kde-format 190 | msgid "Save" 191 | msgstr "" 192 | 193 | #: content/ui/Plot2D.qml:52 194 | #, kde-format 195 | msgid "View Grid" 196 | msgstr "" 197 | 198 | #: content/ui/Plot2D.qml:60 content/ui/Plot3D.qml:53 199 | #, kde-format 200 | msgid "Reset Viewport" 201 | msgstr "" 202 | 203 | #: content/ui/Plot3D.qml:21 204 | #, kde-format 205 | msgctxt "@title:window" 206 | msgid "3D Plot" 207 | msgstr "" 208 | 209 | #: content/ui/TableResultPage.qml:9 210 | #, kde-format 211 | msgid "Results" 212 | msgstr "" 213 | 214 | #: content/ui/Tables.qml:12 215 | #, kde-format 216 | msgid "Value tables" 217 | msgstr "" 218 | 219 | #: content/ui/Tables.qml:28 220 | #, kde-format 221 | msgid "Errors: Invalid expression %1" 222 | msgstr "" 223 | 224 | #: content/ui/Tables.qml:42 225 | #, kde-format 226 | msgid "Errors: The step cannot be 0" 227 | msgstr "" 228 | 229 | #: content/ui/Tables.qml:44 230 | #, kde-format 231 | msgid "Errors: The start and end are the same" 232 | msgstr "" 233 | 234 | #: content/ui/Tables.qml:46 235 | #, kde-format 236 | msgid "Errors: %1" 237 | msgstr "" 238 | 239 | #: content/ui/Tables.qml:53 240 | #, kde-format 241 | msgid "error: %1" 242 | msgstr "" 243 | 244 | #: content/ui/Tables.qml:66 245 | #, kde-format 246 | msgctxt "@action:button Run table" 247 | msgid "Run" 248 | msgstr "" 249 | 250 | #: content/ui/Tables.qml:77 251 | #, kde-format 252 | msgid "Input" 253 | msgstr "" 254 | 255 | #: content/ui/Tables.qml:86 256 | #, kde-format 257 | msgid "From:" 258 | msgstr "" 259 | 260 | #: content/ui/Tables.qml:93 261 | #, kde-format 262 | msgid "To:" 263 | msgstr "" 264 | 265 | #: content/ui/Tables.qml:100 266 | #, kde-format 267 | msgid "Step" 268 | msgstr "" 269 | 270 | #: content/ui/Tables.qml:106 271 | #, kde-format 272 | msgid "Run" 273 | msgstr "" 274 | 275 | #: main.cpp:38 276 | #, kde-format 277 | msgid "A portable calculator" 278 | msgstr "" 279 | 280 | #: main.cpp:40 281 | #, kde-format 282 | msgid "(C) 2006-2023 Aleix Pol i Gonzalez" 283 | msgstr "" 284 | 285 | #: main.cpp:41 286 | #, kde-format 287 | msgid "Aleix Pol i Gonzalez" 288 | msgstr "" 289 | 290 | #: main.cpp:41 291 | #, kde-format 292 | msgctxt "@info:credit" 293 | msgid "Maintainer" 294 | msgstr "" 295 | 296 | #: main.cpp:42 297 | #, kde-format 298 | msgctxt "NAME OF TRANSLATORS" 299 | msgid "Your names" 300 | msgstr "" 301 | 302 | #: main.cpp:42 303 | #, kde-format 304 | msgctxt "EMAIL OF TRANSLATORS" 305 | msgid "Your emails" 306 | msgstr "" 307 | -------------------------------------------------------------------------------- /po/ko/kalgebramobile.po: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2024 This file is copyright: 2 | # This file is distributed under the same license as the kalgebra package. 3 | # SPDX-FileCopyrightText: 2020, 2021, 2022, 2023, 2024, 2025 Shinjo Park 4 | # 5 | msgid "" 6 | msgstr "" 7 | "Project-Id-Version: kalgebra\n" 8 | "Report-Msgid-Bugs-To: https://bugs.kde.org\n" 9 | "POT-Creation-Date: 2025-01-13 00:37+0000\n" 10 | "PO-Revision-Date: 2025-04-06 22:15+0200\n" 11 | "Last-Translator: Shinjo Park \n" 12 | "Language-Team: Korean \n" 13 | "Language: ko\n" 14 | "MIME-Version: 1.0\n" 15 | "Content-Type: text/plain; charset=UTF-8\n" 16 | "Content-Transfer-Encoding: 8bit\n" 17 | "Plural-Forms: nplurals=1; plural=0;\n" 18 | "X-Generator: Lokalize 23.08.5\n" 19 | 20 | #: content/ui/Console.qml:19 content/ui/main.qml:50 21 | #, kde-format 22 | msgid "Calculator" 23 | msgstr "계산기" 24 | 25 | #: content/ui/Console.qml:40 content/ui/main.qml:108 26 | #, kde-format 27 | msgid "KAlgebra" 28 | msgstr "KAlgebra" 29 | 30 | #: content/ui/Console.qml:62 31 | #, kde-format 32 | msgctxt "@action:button" 33 | msgid "Load Script" 34 | msgstr "스크립트 열기" 35 | 36 | #: content/ui/Console.qml:66 content/ui/Console.qml:76 37 | #, kde-format 38 | msgid "Script (*.kal)" 39 | msgstr "스크립트 (*.kal)" 40 | 41 | #: content/ui/Console.qml:72 42 | #, kde-format 43 | msgctxt "@action:button" 44 | msgid "Save Script" 45 | msgstr "스크립트 저장" 46 | 47 | #: content/ui/Console.qml:83 48 | #, kde-format 49 | msgctxt "@action:button" 50 | msgid "Export Log" 51 | msgstr "로그 내보내기" 52 | 53 | #: content/ui/Console.qml:87 54 | #, kde-format 55 | msgid "HTML (*.html)" 56 | msgstr "HTML (*.html)" 57 | 58 | #: content/ui/Console.qml:94 59 | #, kde-format 60 | msgctxt "@action:button" 61 | msgid "Evaluate" 62 | msgstr "평가" 63 | 64 | #: content/ui/Console.qml:94 65 | #, kde-format 66 | msgctxt "@action:button" 67 | msgid "Calculate" 68 | msgstr "계산" 69 | 70 | #: content/ui/Console.qml:100 71 | #, kde-format 72 | msgctxt "@action:button" 73 | msgid "Clear Log" 74 | msgstr "기록 비우기" 75 | 76 | #: content/ui/Console.qml:131 77 | #, kde-format 78 | msgid "2D Plot" 79 | msgstr "2D 그래프" 80 | 81 | #: content/ui/Console.qml:140 82 | #, kde-format 83 | msgid "3D Plot" 84 | msgstr "3D 그래프" 85 | 86 | #: content/ui/Console.qml:149 87 | #, kde-format 88 | msgid "Copy \"%1\"" 89 | msgstr "\"%1\" 복사" 90 | 91 | #: content/ui/Console.qml:187 92 | #, kde-format 93 | msgctxt "@info" 94 | msgid "Empty console history" 95 | msgstr "콘솔 기록 비우기" 96 | 97 | #: content/ui/controls/AddPlotDialog.qml:56 98 | #, kde-format 99 | msgctxt "@action:button" 100 | msgid "Add" 101 | msgstr "추가" 102 | 103 | #: content/ui/controls/AddPlotDialog.qml:69 104 | #, kde-format 105 | msgctxt "@action:button" 106 | msgid "Examples" 107 | msgstr "예제" 108 | 109 | #: content/ui/controls/AddPlotDialog.qml:100 110 | #, kde-format 111 | msgctxt "@action:button" 112 | msgid "Clear All" 113 | msgstr "모두 지우기" 114 | 115 | #: content/ui/controls/AddPlotDialog.qml:113 116 | #, kde-format 117 | msgctxt "@action:button" 118 | msgid "Close dialog" 119 | msgstr "대화 상자 닫기" 120 | 121 | #: content/ui/controls/AddPlotDialog.qml:153 122 | #, kde-format 123 | msgctxt "@action:button" 124 | msgid "Remove plot" 125 | msgstr "플롯 삭제" 126 | 127 | #: content/ui/controls/AddPlotDialog.qml:168 128 | #, kde-format 129 | msgctxt "@info" 130 | msgid "No plot available" 131 | msgstr "플롯을 사용할 수 없음" 132 | 133 | #: content/ui/controls/ExpressionInput.qml:39 134 | #, kde-format 135 | msgid "Expression to calculate..." 136 | msgstr "계산할 수식..." 137 | 138 | #: content/ui/Dictionary.qml:14 139 | #, kde-format 140 | msgctxt "@title:window" 141 | msgid "Dictionary" 142 | msgstr "사전" 143 | 144 | #: content/ui/Dictionary.qml:30 145 | #, kde-format 146 | msgid "Name:" 147 | msgstr "이름:" 148 | 149 | #: content/ui/Dictionary.qml:43 content/ui/Dictionary.qml:47 150 | #: content/ui/Dictionary.qml:51 151 | #, kde-format 152 | msgid "%1:" 153 | msgstr "%1:" 154 | 155 | #: content/ui/main.qml:57 156 | #, kde-format 157 | msgid "Graph 2D" 158 | msgstr "2D 그래프" 159 | 160 | #: content/ui/main.qml:64 161 | #, kde-format 162 | msgid "Graph 3D" 163 | msgstr "3D 그래프" 164 | 165 | #: content/ui/main.qml:70 166 | #, kde-format 167 | msgid "Value Tables" 168 | msgstr "값 표" 169 | 170 | #: content/ui/main.qml:76 content/ui/VariablesView.qml:11 171 | #, kde-format 172 | msgid "Variables" 173 | msgstr "변수" 174 | 175 | #: content/ui/main.qml:82 176 | #, kde-format 177 | msgid "Dictionary" 178 | msgstr "사전" 179 | 180 | #: content/ui/main.qml:88 181 | #, kde-format 182 | msgid "About KAlgebra" 183 | msgstr "KAlgebra 정보" 184 | 185 | #: content/ui/Plot2D.qml:21 186 | #, kde-format 187 | msgctxt "@title:window" 188 | msgid "2D Plot" 189 | msgstr "2D 플롯" 190 | 191 | #: content/ui/Plot2D.qml:38 content/ui/Plot3D.qml:38 192 | #, kde-format 193 | msgid "Save" 194 | msgstr "저장" 195 | 196 | #: content/ui/Plot2D.qml:52 197 | #, kde-format 198 | msgid "View Grid" 199 | msgstr "격자 표시" 200 | 201 | #: content/ui/Plot2D.qml:60 content/ui/Plot3D.qml:53 202 | #, kde-format 203 | msgid "Reset Viewport" 204 | msgstr "뷰포트 초기화" 205 | 206 | #: content/ui/Plot3D.qml:21 207 | #, kde-format 208 | msgctxt "@title:window" 209 | msgid "3D Plot" 210 | msgstr "3D 플롯" 211 | 212 | #: content/ui/TableResultPage.qml:9 213 | #, kde-format 214 | msgid "Results" 215 | msgstr "결과" 216 | 217 | #: content/ui/Tables.qml:12 218 | #, kde-format 219 | msgid "Value tables" 220 | msgstr "값 표" 221 | 222 | #: content/ui/Tables.qml:28 223 | #, kde-format 224 | msgid "Errors: Invalid expression %1" 225 | msgstr "오류: 잘못된 표현식 %1" 226 | 227 | #: content/ui/Tables.qml:42 228 | #, kde-format 229 | msgid "Errors: The step cannot be 0" 230 | msgstr "오류: 단계는 0일 수 없음" 231 | 232 | #: content/ui/Tables.qml:44 233 | #, kde-format 234 | msgid "Errors: The start and end are the same" 235 | msgstr "오류: 시작과 끝이 동일함" 236 | 237 | #: content/ui/Tables.qml:46 238 | #, kde-format 239 | msgid "Errors: %1" 240 | msgstr "오류: %1" 241 | 242 | #: content/ui/Tables.qml:53 243 | #, kde-format 244 | msgid "error: %1" 245 | msgstr "오류: %1" 246 | 247 | #: content/ui/Tables.qml:66 248 | #, kde-format 249 | msgctxt "@action:button Run table" 250 | msgid "Run" 251 | msgstr "실행" 252 | 253 | #: content/ui/Tables.qml:77 254 | #, kde-format 255 | msgid "Input" 256 | msgstr "입력" 257 | 258 | #: content/ui/Tables.qml:86 259 | #, kde-format 260 | msgid "From:" 261 | msgstr "시작:" 262 | 263 | #: content/ui/Tables.qml:93 264 | #, kde-format 265 | msgid "To:" 266 | msgstr "끝:" 267 | 268 | #: content/ui/Tables.qml:100 269 | #, kde-format 270 | msgid "Step" 271 | msgstr "단계" 272 | 273 | #: content/ui/Tables.qml:106 274 | #, kde-format 275 | msgid "Run" 276 | msgstr "실행" 277 | 278 | #: main.cpp:38 279 | #, kde-format 280 | msgid "A portable calculator" 281 | msgstr "포터블 계산기" 282 | 283 | #: main.cpp:40 284 | #, kde-format 285 | msgid "(C) 2006-2023 Aleix Pol i Gonzalez" 286 | msgstr "(C) 2006-2023 Aleix Pol i Gonzalez" 287 | 288 | #: main.cpp:41 289 | #, kde-format 290 | msgid "Aleix Pol i Gonzalez" 291 | msgstr "Aleix Pol i Gonzalez" 292 | 293 | #: main.cpp:41 294 | #, kde-format 295 | msgctxt "@info:credit" 296 | msgid "Maintainer" 297 | msgstr "관리자" 298 | 299 | #: main.cpp:42 300 | #, kde-format 301 | msgctxt "NAME OF TRANSLATORS" 302 | msgid "Your names" 303 | msgstr "박신조" 304 | 305 | #: main.cpp:42 306 | #, kde-format 307 | msgctxt "EMAIL OF TRANSLATORS" 308 | msgid "Your emails" 309 | msgstr "kde@peremen.name" 310 | 311 | #~ msgid "KAlgebra Mobile" 312 | #~ msgstr "KAlgebra 모바일" 313 | 314 | #~ msgid "A simple scientific calculator" 315 | #~ msgstr "간단한 공학용 계산기" 316 | -------------------------------------------------------------------------------- /po/lt/kalgebramobile.po: -------------------------------------------------------------------------------- 1 | # Lithuanian translations for kalgebra package. 2 | # Copyright (C) 2019 This file is copyright: 3 | # This file is distributed under the same license as the kalgebra package. 4 | # Automatically generated, 2019. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: kalgebra\n" 9 | "Report-Msgid-Bugs-To: https://bugs.kde.org\n" 10 | "POT-Creation-Date: 2025-01-13 00:37+0000\n" 11 | "PO-Revision-Date: 2019-03-08 03:26+0100\n" 12 | "Last-Translator: Automatically generated\n" 13 | "Language-Team: lt\n" 14 | "Language: lt\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Plural-Forms: nplurals=4; plural=(n==1 ? 0 : n%10>=2 && (n%100<10 || n" 19 | "%100>=20) ? 1 : n%10==0 || (n%100>10 && n%100<20) ? 2 : 3);\n" 20 | 21 | #: content/ui/Console.qml:19 content/ui/main.qml:50 22 | #, kde-format 23 | msgid "Calculator" 24 | msgstr "" 25 | 26 | #: content/ui/Console.qml:40 content/ui/main.qml:108 27 | #, kde-format 28 | msgid "KAlgebra" 29 | msgstr "" 30 | 31 | #: content/ui/Console.qml:62 32 | #, kde-format 33 | msgctxt "@action:button" 34 | msgid "Load Script" 35 | msgstr "" 36 | 37 | #: content/ui/Console.qml:66 content/ui/Console.qml:76 38 | #, kde-format 39 | msgid "Script (*.kal)" 40 | msgstr "" 41 | 42 | #: content/ui/Console.qml:72 43 | #, kde-format 44 | msgctxt "@action:button" 45 | msgid "Save Script" 46 | msgstr "" 47 | 48 | #: content/ui/Console.qml:83 49 | #, kde-format 50 | msgctxt "@action:button" 51 | msgid "Export Log" 52 | msgstr "" 53 | 54 | #: content/ui/Console.qml:87 55 | #, kde-format 56 | msgid "HTML (*.html)" 57 | msgstr "" 58 | 59 | #: content/ui/Console.qml:94 60 | #, kde-format 61 | msgctxt "@action:button" 62 | msgid "Evaluate" 63 | msgstr "" 64 | 65 | #: content/ui/Console.qml:94 66 | #, kde-format 67 | msgctxt "@action:button" 68 | msgid "Calculate" 69 | msgstr "" 70 | 71 | #: content/ui/Console.qml:100 72 | #, kde-format 73 | msgctxt "@action:button" 74 | msgid "Clear Log" 75 | msgstr "" 76 | 77 | #: content/ui/Console.qml:131 78 | #, kde-format 79 | msgid "2D Plot" 80 | msgstr "" 81 | 82 | #: content/ui/Console.qml:140 83 | #, kde-format 84 | msgid "3D Plot" 85 | msgstr "" 86 | 87 | #: content/ui/Console.qml:149 88 | #, kde-format 89 | msgid "Copy \"%1\"" 90 | msgstr "" 91 | 92 | #: content/ui/Console.qml:187 93 | #, kde-format 94 | msgctxt "@info" 95 | msgid "Empty console history" 96 | msgstr "" 97 | 98 | #: content/ui/controls/AddPlotDialog.qml:56 99 | #, kde-format 100 | msgctxt "@action:button" 101 | msgid "Add" 102 | msgstr "" 103 | 104 | #: content/ui/controls/AddPlotDialog.qml:69 105 | #, kde-format 106 | msgctxt "@action:button" 107 | msgid "Examples" 108 | msgstr "" 109 | 110 | #: content/ui/controls/AddPlotDialog.qml:100 111 | #, kde-format 112 | msgctxt "@action:button" 113 | msgid "Clear All" 114 | msgstr "" 115 | 116 | #: content/ui/controls/AddPlotDialog.qml:113 117 | #, kde-format 118 | msgctxt "@action:button" 119 | msgid "Close dialog" 120 | msgstr "" 121 | 122 | #: content/ui/controls/AddPlotDialog.qml:153 123 | #, kde-format 124 | msgctxt "@action:button" 125 | msgid "Remove plot" 126 | msgstr "" 127 | 128 | #: content/ui/controls/AddPlotDialog.qml:168 129 | #, kde-format 130 | msgctxt "@info" 131 | msgid "No plot available" 132 | msgstr "" 133 | 134 | #: content/ui/controls/ExpressionInput.qml:39 135 | #, kde-format 136 | msgid "Expression to calculate..." 137 | msgstr "" 138 | 139 | #: content/ui/Dictionary.qml:14 140 | #, kde-format 141 | msgctxt "@title:window" 142 | msgid "Dictionary" 143 | msgstr "" 144 | 145 | #: content/ui/Dictionary.qml:30 146 | #, kde-format 147 | msgid "Name:" 148 | msgstr "" 149 | 150 | #: content/ui/Dictionary.qml:43 content/ui/Dictionary.qml:47 151 | #: content/ui/Dictionary.qml:51 152 | #, kde-format 153 | msgid "%1:" 154 | msgstr "" 155 | 156 | #: content/ui/main.qml:57 157 | #, kde-format 158 | msgid "Graph 2D" 159 | msgstr "" 160 | 161 | #: content/ui/main.qml:64 162 | #, kde-format 163 | msgid "Graph 3D" 164 | msgstr "" 165 | 166 | #: content/ui/main.qml:70 167 | #, kde-format 168 | msgid "Value Tables" 169 | msgstr "" 170 | 171 | #: content/ui/main.qml:76 content/ui/VariablesView.qml:11 172 | #, kde-format 173 | msgid "Variables" 174 | msgstr "" 175 | 176 | #: content/ui/main.qml:82 177 | #, kde-format 178 | msgid "Dictionary" 179 | msgstr "" 180 | 181 | #: content/ui/main.qml:88 182 | #, kde-format 183 | msgid "About KAlgebra" 184 | msgstr "" 185 | 186 | #: content/ui/Plot2D.qml:21 187 | #, kde-format 188 | msgctxt "@title:window" 189 | msgid "2D Plot" 190 | msgstr "" 191 | 192 | #: content/ui/Plot2D.qml:38 content/ui/Plot3D.qml:38 193 | #, kde-format 194 | msgid "Save" 195 | msgstr "" 196 | 197 | #: content/ui/Plot2D.qml:52 198 | #, kde-format 199 | msgid "View Grid" 200 | msgstr "" 201 | 202 | #: content/ui/Plot2D.qml:60 content/ui/Plot3D.qml:53 203 | #, kde-format 204 | msgid "Reset Viewport" 205 | msgstr "" 206 | 207 | #: content/ui/Plot3D.qml:21 208 | #, kde-format 209 | msgctxt "@title:window" 210 | msgid "3D Plot" 211 | msgstr "" 212 | 213 | #: content/ui/TableResultPage.qml:9 214 | #, kde-format 215 | msgid "Results" 216 | msgstr "" 217 | 218 | #: content/ui/Tables.qml:12 219 | #, kde-format 220 | msgid "Value tables" 221 | msgstr "" 222 | 223 | #: content/ui/Tables.qml:28 224 | #, kde-format 225 | msgid "Errors: Invalid expression %1" 226 | msgstr "" 227 | 228 | #: content/ui/Tables.qml:42 229 | #, kde-format 230 | msgid "Errors: The step cannot be 0" 231 | msgstr "" 232 | 233 | #: content/ui/Tables.qml:44 234 | #, kde-format 235 | msgid "Errors: The start and end are the same" 236 | msgstr "" 237 | 238 | #: content/ui/Tables.qml:46 239 | #, kde-format 240 | msgid "Errors: %1" 241 | msgstr "" 242 | 243 | #: content/ui/Tables.qml:53 244 | #, kde-format 245 | msgid "error: %1" 246 | msgstr "" 247 | 248 | #: content/ui/Tables.qml:66 249 | #, kde-format 250 | msgctxt "@action:button Run table" 251 | msgid "Run" 252 | msgstr "" 253 | 254 | #: content/ui/Tables.qml:77 255 | #, kde-format 256 | msgid "Input" 257 | msgstr "" 258 | 259 | #: content/ui/Tables.qml:86 260 | #, kde-format 261 | msgid "From:" 262 | msgstr "" 263 | 264 | #: content/ui/Tables.qml:93 265 | #, kde-format 266 | msgid "To:" 267 | msgstr "" 268 | 269 | #: content/ui/Tables.qml:100 270 | #, kde-format 271 | msgid "Step" 272 | msgstr "" 273 | 274 | #: content/ui/Tables.qml:106 275 | #, kde-format 276 | msgid "Run" 277 | msgstr "" 278 | 279 | #: main.cpp:38 280 | #, kde-format 281 | msgid "A portable calculator" 282 | msgstr "" 283 | 284 | #: main.cpp:40 285 | #, kde-format 286 | msgid "(C) 2006-2023 Aleix Pol i Gonzalez" 287 | msgstr "" 288 | 289 | #: main.cpp:41 290 | #, kde-format 291 | msgid "Aleix Pol i Gonzalez" 292 | msgstr "" 293 | 294 | #: main.cpp:41 295 | #, kde-format 296 | msgctxt "@info:credit" 297 | msgid "Maintainer" 298 | msgstr "" 299 | 300 | #: main.cpp:42 301 | #, kde-format 302 | msgctxt "NAME OF TRANSLATORS" 303 | msgid "Your names" 304 | msgstr "" 305 | 306 | #: main.cpp:42 307 | #, kde-format 308 | msgctxt "EMAIL OF TRANSLATORS" 309 | msgid "Your emails" 310 | msgstr "" 311 | -------------------------------------------------------------------------------- /po/ml/kalgebramobile.po: -------------------------------------------------------------------------------- 1 | # Malayalam translations for kalgebra package. 2 | # Copyright (C) 2019 This file is copyright: 3 | # This file is distributed under the same license as the kalgebra package. 4 | # Automatically generated, 2019. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: kalgebra\n" 9 | "Report-Msgid-Bugs-To: https://bugs.kde.org\n" 10 | "POT-Creation-Date: 2025-01-13 00:37+0000\n" 11 | "PO-Revision-Date: 2019-12-12 21:33+0000\n" 12 | "Last-Translator: Vivek KJ Pazhedath \n" 13 | "Language-Team: Swathanthra|സ്വതന്ത്ര Malayalam|മലയാളം Computing|കമ്പ്യൂട്ടിങ്ങ് \n" 15 | "Language: ml\n" 16 | "MIME-Version: 1.0\n" 17 | "Content-Type: text/plain; charset=UTF-8\n" 18 | "Content-Transfer-Encoding: 8bit\n" 19 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 20 | 21 | #: content/ui/Console.qml:19 content/ui/main.qml:50 22 | #, kde-format 23 | msgid "Calculator" 24 | msgstr "" 25 | 26 | #: content/ui/Console.qml:40 content/ui/main.qml:108 27 | #, kde-format 28 | msgid "KAlgebra" 29 | msgstr "" 30 | 31 | #: content/ui/Console.qml:62 32 | #, kde-format 33 | msgctxt "@action:button" 34 | msgid "Load Script" 35 | msgstr "" 36 | 37 | #: content/ui/Console.qml:66 content/ui/Console.qml:76 38 | #, kde-format 39 | msgid "Script (*.kal)" 40 | msgstr "" 41 | 42 | #: content/ui/Console.qml:72 43 | #, kde-format 44 | msgctxt "@action:button" 45 | msgid "Save Script" 46 | msgstr "" 47 | 48 | #: content/ui/Console.qml:83 49 | #, kde-format 50 | msgctxt "@action:button" 51 | msgid "Export Log" 52 | msgstr "" 53 | 54 | #: content/ui/Console.qml:87 55 | #, kde-format 56 | msgid "HTML (*.html)" 57 | msgstr "" 58 | 59 | #: content/ui/Console.qml:94 60 | #, kde-format 61 | msgctxt "@action:button" 62 | msgid "Evaluate" 63 | msgstr "" 64 | 65 | #: content/ui/Console.qml:94 66 | #, kde-format 67 | msgctxt "@action:button" 68 | msgid "Calculate" 69 | msgstr "" 70 | 71 | #: content/ui/Console.qml:100 72 | #, kde-format 73 | msgctxt "@action:button" 74 | msgid "Clear Log" 75 | msgstr "" 76 | 77 | #: content/ui/Console.qml:131 78 | #, kde-format 79 | msgid "2D Plot" 80 | msgstr "" 81 | 82 | #: content/ui/Console.qml:140 83 | #, kde-format 84 | msgid "3D Plot" 85 | msgstr "" 86 | 87 | #: content/ui/Console.qml:149 88 | #, kde-format 89 | msgid "Copy \"%1\"" 90 | msgstr "" 91 | 92 | #: content/ui/Console.qml:187 93 | #, kde-format 94 | msgctxt "@info" 95 | msgid "Empty console history" 96 | msgstr "" 97 | 98 | #: content/ui/controls/AddPlotDialog.qml:56 99 | #, kde-format 100 | msgctxt "@action:button" 101 | msgid "Add" 102 | msgstr "" 103 | 104 | #: content/ui/controls/AddPlotDialog.qml:69 105 | #, kde-format 106 | msgctxt "@action:button" 107 | msgid "Examples" 108 | msgstr "" 109 | 110 | #: content/ui/controls/AddPlotDialog.qml:100 111 | #, kde-format 112 | msgctxt "@action:button" 113 | msgid "Clear All" 114 | msgstr "" 115 | 116 | #: content/ui/controls/AddPlotDialog.qml:113 117 | #, kde-format 118 | msgctxt "@action:button" 119 | msgid "Close dialog" 120 | msgstr "" 121 | 122 | #: content/ui/controls/AddPlotDialog.qml:153 123 | #, kde-format 124 | msgctxt "@action:button" 125 | msgid "Remove plot" 126 | msgstr "" 127 | 128 | #: content/ui/controls/AddPlotDialog.qml:168 129 | #, kde-format 130 | msgctxt "@info" 131 | msgid "No plot available" 132 | msgstr "" 133 | 134 | #: content/ui/controls/ExpressionInput.qml:39 135 | #, kde-format 136 | msgid "Expression to calculate..." 137 | msgstr "" 138 | 139 | #: content/ui/Dictionary.qml:14 140 | #, kde-format 141 | msgctxt "@title:window" 142 | msgid "Dictionary" 143 | msgstr "" 144 | 145 | #: content/ui/Dictionary.qml:30 146 | #, kde-format 147 | msgid "Name:" 148 | msgstr "" 149 | 150 | #: content/ui/Dictionary.qml:43 content/ui/Dictionary.qml:47 151 | #: content/ui/Dictionary.qml:51 152 | #, kde-format 153 | msgid "%1:" 154 | msgstr "" 155 | 156 | #: content/ui/main.qml:57 157 | #, kde-format 158 | msgid "Graph 2D" 159 | msgstr "" 160 | 161 | #: content/ui/main.qml:64 162 | #, kde-format 163 | msgid "Graph 3D" 164 | msgstr "" 165 | 166 | #: content/ui/main.qml:70 167 | #, kde-format 168 | msgid "Value Tables" 169 | msgstr "" 170 | 171 | #: content/ui/main.qml:76 content/ui/VariablesView.qml:11 172 | #, kde-format 173 | msgid "Variables" 174 | msgstr "" 175 | 176 | #: content/ui/main.qml:82 177 | #, kde-format 178 | msgid "Dictionary" 179 | msgstr "" 180 | 181 | #: content/ui/main.qml:88 182 | #, kde-format 183 | msgid "About KAlgebra" 184 | msgstr "" 185 | 186 | #: content/ui/Plot2D.qml:21 187 | #, kde-format 188 | msgctxt "@title:window" 189 | msgid "2D Plot" 190 | msgstr "" 191 | 192 | #: content/ui/Plot2D.qml:38 content/ui/Plot3D.qml:38 193 | #, kde-format 194 | msgid "Save" 195 | msgstr "" 196 | 197 | #: content/ui/Plot2D.qml:52 198 | #, kde-format 199 | msgid "View Grid" 200 | msgstr "" 201 | 202 | #: content/ui/Plot2D.qml:60 content/ui/Plot3D.qml:53 203 | #, kde-format 204 | msgid "Reset Viewport" 205 | msgstr "" 206 | 207 | #: content/ui/Plot3D.qml:21 208 | #, kde-format 209 | msgctxt "@title:window" 210 | msgid "3D Plot" 211 | msgstr "" 212 | 213 | #: content/ui/TableResultPage.qml:9 214 | #, kde-format 215 | msgid "Results" 216 | msgstr "" 217 | 218 | #: content/ui/Tables.qml:12 219 | #, kde-format 220 | msgid "Value tables" 221 | msgstr "" 222 | 223 | #: content/ui/Tables.qml:28 224 | #, kde-format 225 | msgid "Errors: Invalid expression %1" 226 | msgstr "" 227 | 228 | #: content/ui/Tables.qml:42 229 | #, kde-format 230 | msgid "Errors: The step cannot be 0" 231 | msgstr "" 232 | 233 | #: content/ui/Tables.qml:44 234 | #, kde-format 235 | msgid "Errors: The start and end are the same" 236 | msgstr "" 237 | 238 | #: content/ui/Tables.qml:46 239 | #, kde-format 240 | msgid "Errors: %1" 241 | msgstr "" 242 | 243 | #: content/ui/Tables.qml:53 244 | #, kde-format 245 | msgid "error: %1" 246 | msgstr "" 247 | 248 | #: content/ui/Tables.qml:66 249 | #, kde-format 250 | msgctxt "@action:button Run table" 251 | msgid "Run" 252 | msgstr "" 253 | 254 | #: content/ui/Tables.qml:77 255 | #, kde-format 256 | msgid "Input" 257 | msgstr "" 258 | 259 | #: content/ui/Tables.qml:86 260 | #, kde-format 261 | msgid "From:" 262 | msgstr "" 263 | 264 | #: content/ui/Tables.qml:93 265 | #, kde-format 266 | msgid "To:" 267 | msgstr "" 268 | 269 | #: content/ui/Tables.qml:100 270 | #, kde-format 271 | msgid "Step" 272 | msgstr "" 273 | 274 | #: content/ui/Tables.qml:106 275 | #, kde-format 276 | msgid "Run" 277 | msgstr "" 278 | 279 | #: main.cpp:38 280 | #, kde-format 281 | msgid "A portable calculator" 282 | msgstr "" 283 | 284 | #: main.cpp:40 285 | #, kde-format 286 | msgid "(C) 2006-2023 Aleix Pol i Gonzalez" 287 | msgstr "" 288 | 289 | #: main.cpp:41 290 | #, kde-format 291 | msgid "Aleix Pol i Gonzalez" 292 | msgstr "" 293 | 294 | #: main.cpp:41 295 | #, kde-format 296 | msgctxt "@info:credit" 297 | msgid "Maintainer" 298 | msgstr "" 299 | 300 | #: main.cpp:42 301 | #, kde-format 302 | msgctxt "NAME OF TRANSLATORS" 303 | msgid "Your names" 304 | msgstr "" 305 | 306 | #: main.cpp:42 307 | #, kde-format 308 | msgctxt "EMAIL OF TRANSLATORS" 309 | msgid "Your emails" 310 | msgstr "shijualexonline@gmail.com,snalledam@dataone.in,vivekkj2004@gmail.com" 311 | -------------------------------------------------------------------------------- /po/pt_BR/docs/kalgebra/kalgebra-main-window.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/kalgebra/592b574f5b0210b2a52e8c9cdcacb2d2278b9e88/po/pt_BR/docs/kalgebra/kalgebra-main-window.png -------------------------------------------------------------------------------- /po/ru/docs/kalgebra/kalgebra-main-window.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/kalgebra/592b574f5b0210b2a52e8c9cdcacb2d2278b9e88/po/ru/docs/kalgebra/kalgebra-main-window.png -------------------------------------------------------------------------------- /po/uk/docs/kalgebra/kalgebra-2dgraph-window.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/kalgebra/592b574f5b0210b2a52e8c9cdcacb2d2278b9e88/po/uk/docs/kalgebra/kalgebra-2dgraph-window.png -------------------------------------------------------------------------------- /po/uk/docs/kalgebra/kalgebra-3dgraph-window.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/kalgebra/592b574f5b0210b2a52e8c9cdcacb2d2278b9e88/po/uk/docs/kalgebra/kalgebra-3dgraph-window.png -------------------------------------------------------------------------------- /po/uk/docs/kalgebra/kalgebra-console-window.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/kalgebra/592b574f5b0210b2a52e8c9cdcacb2d2278b9e88/po/uk/docs/kalgebra/kalgebra-console-window.png -------------------------------------------------------------------------------- /po/uk/docs/kalgebra/kalgebra-dictionary-window.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/kalgebra/592b574f5b0210b2a52e8c9cdcacb2d2278b9e88/po/uk/docs/kalgebra/kalgebra-dictionary-window.png -------------------------------------------------------------------------------- /po/uk/docs/kalgebra/kalgebra-main-window.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/kalgebra/592b574f5b0210b2a52e8c9cdcacb2d2278b9e88/po/uk/docs/kalgebra/kalgebra-main-window.png -------------------------------------------------------------------------------- /po/zh_CN/kalgebramobile.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: kdeorg\n" 4 | "Report-Msgid-Bugs-To: https://bugs.kde.org\n" 5 | "POT-Creation-Date: 2025-01-13 00:37+0000\n" 6 | "PO-Revision-Date: 2024-04-22 15:58\n" 7 | "Last-Translator: \n" 8 | "Language-Team: Chinese Simplified\n" 9 | "Language: zh_CN\n" 10 | "MIME-Version: 1.0\n" 11 | "Content-Type: text/plain; charset=UTF-8\n" 12 | "Content-Transfer-Encoding: 8bit\n" 13 | "Plural-Forms: nplurals=1; plural=0;\n" 14 | "X-Crowdin-Project: kdeorg\n" 15 | "X-Crowdin-Project-ID: 269464\n" 16 | "X-Crowdin-Language: zh-CN\n" 17 | "X-Crowdin-File: /kf6-trunk/messages/kalgebra/kalgebramobile.pot\n" 18 | "X-Crowdin-File-ID: 46357\n" 19 | 20 | #: content/ui/Console.qml:19 content/ui/main.qml:50 21 | #, kde-format 22 | msgid "Calculator" 23 | msgstr "计算器" 24 | 25 | #: content/ui/Console.qml:40 content/ui/main.qml:108 26 | #, kde-format 27 | msgid "KAlgebra" 28 | msgstr "KAlgebra" 29 | 30 | #: content/ui/Console.qml:62 31 | #, kde-format 32 | msgctxt "@action:button" 33 | msgid "Load Script" 34 | msgstr "加载脚本" 35 | 36 | #: content/ui/Console.qml:66 content/ui/Console.qml:76 37 | #, kde-format 38 | msgid "Script (*.kal)" 39 | msgstr "脚本 (*.kal)" 40 | 41 | #: content/ui/Console.qml:72 42 | #, kde-format 43 | msgctxt "@action:button" 44 | msgid "Save Script" 45 | msgstr "保存脚本" 46 | 47 | #: content/ui/Console.qml:83 48 | #, kde-format 49 | msgctxt "@action:button" 50 | msgid "Export Log" 51 | msgstr "导出日志" 52 | 53 | #: content/ui/Console.qml:87 54 | #, kde-format 55 | msgid "HTML (*.html)" 56 | msgstr "HTML (*.html)" 57 | 58 | #: content/ui/Console.qml:94 59 | #, kde-format 60 | msgctxt "@action:button" 61 | msgid "Evaluate" 62 | msgstr "求值" 63 | 64 | #: content/ui/Console.qml:94 65 | #, kde-format 66 | msgctxt "@action:button" 67 | msgid "Calculate" 68 | msgstr "计算" 69 | 70 | #: content/ui/Console.qml:100 71 | #, kde-format 72 | msgctxt "@action:button" 73 | msgid "Clear Log" 74 | msgstr "清除日志" 75 | 76 | #: content/ui/Console.qml:131 77 | #, kde-format 78 | msgid "2D Plot" 79 | msgstr "2D 绘图" 80 | 81 | #: content/ui/Console.qml:140 82 | #, kde-format 83 | msgid "3D Plot" 84 | msgstr "3D 绘图" 85 | 86 | #: content/ui/Console.qml:149 87 | #, kde-format 88 | msgid "Copy \"%1\"" 89 | msgstr "复制“%1”" 90 | 91 | #: content/ui/Console.qml:187 92 | #, kde-format 93 | msgctxt "@info" 94 | msgid "Empty console history" 95 | msgstr "清空控制台历史" 96 | 97 | #: content/ui/controls/AddPlotDialog.qml:56 98 | #, kde-format 99 | msgctxt "@action:button" 100 | msgid "Add" 101 | msgstr "添加" 102 | 103 | #: content/ui/controls/AddPlotDialog.qml:69 104 | #, kde-format 105 | msgctxt "@action:button" 106 | msgid "Examples" 107 | msgstr "示例" 108 | 109 | #: content/ui/controls/AddPlotDialog.qml:100 110 | #, kde-format 111 | msgctxt "@action:button" 112 | msgid "Clear All" 113 | msgstr "清除全部" 114 | 115 | #: content/ui/controls/AddPlotDialog.qml:113 116 | #, kde-format 117 | msgctxt "@action:button" 118 | msgid "Close dialog" 119 | msgstr "关闭对话" 120 | 121 | #: content/ui/controls/AddPlotDialog.qml:153 122 | #, kde-format 123 | msgctxt "@action:button" 124 | msgid "Remove plot" 125 | msgstr "移除图表" 126 | 127 | #: content/ui/controls/AddPlotDialog.qml:168 128 | #, kde-format 129 | msgctxt "@info" 130 | msgid "No plot available" 131 | msgstr "没有可用的图表" 132 | 133 | #: content/ui/controls/ExpressionInput.qml:39 134 | #, kde-format 135 | msgid "Expression to calculate..." 136 | msgstr "要计算的表达式…" 137 | 138 | #: content/ui/Dictionary.qml:14 139 | #, kde-format 140 | msgctxt "@title:window" 141 | msgid "Dictionary" 142 | msgstr "词典" 143 | 144 | #: content/ui/Dictionary.qml:30 145 | #, kde-format 146 | msgid "Name:" 147 | msgstr "名称:" 148 | 149 | #: content/ui/Dictionary.qml:43 content/ui/Dictionary.qml:47 150 | #: content/ui/Dictionary.qml:51 151 | #, kde-format 152 | msgid "%1:" 153 | msgstr "%1:" 154 | 155 | #: content/ui/main.qml:57 156 | #, kde-format 157 | msgid "Graph 2D" 158 | msgstr "二维图" 159 | 160 | #: content/ui/main.qml:64 161 | #, kde-format 162 | msgid "Graph 3D" 163 | msgstr "三维图" 164 | 165 | #: content/ui/main.qml:70 166 | #, kde-format 167 | msgid "Value Tables" 168 | msgstr "数值表" 169 | 170 | #: content/ui/main.qml:76 content/ui/VariablesView.qml:11 171 | #, kde-format 172 | msgid "Variables" 173 | msgstr "变量" 174 | 175 | #: content/ui/main.qml:82 176 | #, kde-format 177 | msgid "Dictionary" 178 | msgstr "词典" 179 | 180 | #: content/ui/main.qml:88 181 | #, kde-format 182 | msgid "About KAlgebra" 183 | msgstr "关于 KAlgebra" 184 | 185 | #: content/ui/Plot2D.qml:21 186 | #, kde-format 187 | msgctxt "@title:window" 188 | msgid "2D Plot" 189 | msgstr "2D 绘图" 190 | 191 | #: content/ui/Plot2D.qml:38 content/ui/Plot3D.qml:38 192 | #, kde-format 193 | msgid "Save" 194 | msgstr "保存" 195 | 196 | #: content/ui/Plot2D.qml:52 197 | #, kde-format 198 | msgid "View Grid" 199 | msgstr "查看网格" 200 | 201 | #: content/ui/Plot2D.qml:60 content/ui/Plot3D.qml:53 202 | #, kde-format 203 | msgid "Reset Viewport" 204 | msgstr "重置可视区域" 205 | 206 | #: content/ui/Plot3D.qml:21 207 | #, kde-format 208 | msgctxt "@title:window" 209 | msgid "3D Plot" 210 | msgstr "3D 绘图" 211 | 212 | #: content/ui/TableResultPage.qml:9 213 | #, kde-format 214 | msgid "Results" 215 | msgstr "结果" 216 | 217 | #: content/ui/Tables.qml:12 218 | #, kde-format 219 | msgid "Value tables" 220 | msgstr "数值表" 221 | 222 | #: content/ui/Tables.qml:28 223 | #, kde-format 224 | msgid "Errors: Invalid expression %1" 225 | msgstr "错误:无效表达式 %1" 226 | 227 | #: content/ui/Tables.qml:42 228 | #, kde-format 229 | msgid "Errors: The step cannot be 0" 230 | msgstr "错误: 步长不能为0" 231 | 232 | #: content/ui/Tables.qml:44 233 | #, kde-format 234 | msgid "Errors: The start and end are the same" 235 | msgstr "错误:起始和终止相同" 236 | 237 | #: content/ui/Tables.qml:46 238 | #, kde-format 239 | msgid "Errors: %1" 240 | msgstr "错误:%1" 241 | 242 | #: content/ui/Tables.qml:53 243 | #, kde-format 244 | msgid "error: %1" 245 | msgstr "错误:%1" 246 | 247 | #: content/ui/Tables.qml:66 248 | #, kde-format 249 | msgctxt "@action:button Run table" 250 | msgid "Run" 251 | msgstr "执行" 252 | 253 | #: content/ui/Tables.qml:77 254 | #, kde-format 255 | msgid "Input" 256 | msgstr "输入" 257 | 258 | #: content/ui/Tables.qml:86 259 | #, kde-format 260 | msgid "From:" 261 | msgstr "从:" 262 | 263 | #: content/ui/Tables.qml:93 264 | #, kde-format 265 | msgid "To:" 266 | msgstr "到:" 267 | 268 | #: content/ui/Tables.qml:100 269 | #, kde-format 270 | msgid "Step" 271 | msgstr "步长" 272 | 273 | #: content/ui/Tables.qml:106 274 | #, kde-format 275 | msgid "Run" 276 | msgstr "执行" 277 | 278 | #: main.cpp:38 279 | #, kde-format 280 | msgid "A portable calculator" 281 | msgstr "一个轻便的计算器" 282 | 283 | #: main.cpp:40 284 | #, kde-format 285 | msgid "(C) 2006-2023 Aleix Pol i Gonzalez" 286 | msgstr "" 287 | 288 | #: main.cpp:41 289 | #, kde-format 290 | msgid "Aleix Pol i Gonzalez" 291 | msgstr "" 292 | 293 | #: main.cpp:41 294 | #, kde-format 295 | msgctxt "@info:credit" 296 | msgid "Maintainer" 297 | msgstr "" 298 | 299 | #: main.cpp:42 300 | #, kde-format 301 | msgctxt "NAME OF TRANSLATORS" 302 | msgid "Your names" 303 | msgstr "KDE 中国" 304 | 305 | #: main.cpp:42 306 | #, kde-format 307 | msgctxt "EMAIL OF TRANSLATORS" 308 | msgid "Your emails" 309 | msgstr "kde-china@kde.org" 310 | -------------------------------------------------------------------------------- /snapcraft.yaml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2024, 2025 Scarlett Moore 2 | # 3 | # SPDX-License-Identifier: CC0-1.0 4 | --- 5 | name: kalgebra 6 | confinement: strict 7 | grade: stable 8 | base: core24 9 | adopt-info: kalgebra 10 | apps: 11 | kalgebra: 12 | extensions: 13 | - kde-neon-6 14 | common-id: org.kde.kalgebra 15 | desktop: usr/share/applications/org.kde.kalgebra.desktop 16 | command: usr/bin/kalgebra 17 | plugs: 18 | - audio-record 19 | - browser-support 20 | environment: 21 | QTWEBENGINE_DISABLE_SANDBOX: 1 22 | ALSA_CONFIG_PATH: "$SNAP/kf6/etc/asound.conf" 23 | package-repositories: 24 | - type: apt 25 | components: 26 | - main 27 | suites: 28 | - noble 29 | key-id: 444DABCF3667D0283F894EDDE6D4736255751E5D 30 | url: http://origin.archive.neon.kde.org/user 31 | key-server: keyserver.ubuntu.com 32 | parts: 33 | analitza: 34 | source: https://invent.kde.org/education/analitza.git 35 | plugin: cmake 36 | stage-packages: 37 | - rsync 38 | - libpopt0 39 | cmake-parameters: 40 | - -DCMAKE_INSTALL_PREFIX=/usr 41 | - -DCMAKE_BUILD_TYPE=Release 42 | - -DQT_MAJOR_VERSION=6 43 | - -DBUILD_WITH_QT6=ON 44 | - -DBUILD_TESTING=OFF 45 | - -DCMAKE_INSTALL_SYSCONFDIR=/etc 46 | - -DCMAKE_INSTALL_LOCALSTATEDIR=/var 47 | - -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON 48 | - -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF 49 | - -DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON 50 | - -DCMAKE_INSTALL_RUNSTATEDIR=/run 51 | - -DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=ON 52 | - -DCMAKE_VERBOSE_MAKEFILE=ON 53 | - -DCMAKE_INSTALL_LIBDIR=lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR 54 | - --log-level=STATUS 55 | - -DCMAKE_LIBRARY_PATH=lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR 56 | override-stage: | 57 | craftctl default 58 | rsync -a --ignore-existing $CRAFT_PART_INSTALL/ / 59 | build-environment: &build-environment 60 | - PKG_CONFIG_PATH: "/snap/ffmpeg-2404-sdk/current/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/pkgconfig" 61 | - LD_LIBRARY_PATH: "$CRAFT_STAGE/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR:/snap/ffmpeg-2404-sdk/current/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR:/snap/kde-qt6-core24-sdk/current/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/libproxy:${LD_LIBRARY_PATH}" 62 | prime: 63 | - -usr/bin/rsync 64 | kalgebra: 65 | after: 66 | - analitza 67 | parse-info: 68 | - usr/share/metainfo/org.kde.kalgebra.appdata.xml 69 | plugin: cmake 70 | source: . 71 | source-type: local 72 | cmake-parameters: 73 | - -DCMAKE_INSTALL_PREFIX=/usr 74 | - -DCMAKE_BUILD_TYPE=Release 75 | - -DQT_MAJOR_VERSION=6 76 | - -DBUILD_WITH_QT6=ON 77 | - -DBUILD_TESTING=OFF 78 | - -DCMAKE_INSTALL_SYSCONFDIR=/etc 79 | - -DCMAKE_INSTALL_LOCALSTATEDIR=/var 80 | - -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON 81 | - -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF 82 | - -DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON 83 | - -DCMAKE_INSTALL_RUNSTATEDIR=/run 84 | - -DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=ON 85 | - -DCMAKE_VERBOSE_MAKEFILE=ON 86 | - -DCMAKE_INSTALL_LIBDIR=lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR 87 | - --log-level=STATUS 88 | - -DCMAKE_LIBRARY_PATH=lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR 89 | build-environment: *build-environment 90 | prime: 91 | - -usr/lib/*/cmake/* 92 | - -usr/include/* 93 | - -usr/share/ECM/* 94 | - -usr/share/man/* 95 | - -usr/bin/X11 96 | - -usr/lib/gcc/$CRAFT_ARCH_TRIPLET_BUILD_FOR/6.0.0 97 | - -usr/lib/aspell/* 98 | - -usr/share/lintian 99 | gpu-2404: 100 | after: [kalgebra] 101 | source: https://github.com/canonical/gpu-snap.git 102 | plugin: dump 103 | override-prime: | 104 | craftctl default 105 | ${CRAFT_PART_SRC}/bin/gpu-2404-cleanup mesa-2404 106 | prime: 107 | - bin/gpu-2404-wrapper 108 | cleanup: 109 | after: 110 | - kalgebra 111 | plugin: nil 112 | build-snaps: 113 | - core24 114 | - kf6-core24 115 | override-prime: | 116 | set -eux 117 | for snap in "core24" "kf6-core24"; do 118 | cd "/snap/$snap/current" && find . -type f,l -exec rm -rf "${CRAFT_PRIME}/{}" \; 119 | done 120 | -------------------------------------------------------------------------------- /src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(kalgebra) 2 | target_sources(kalgebra PRIVATE 3 | askname.h 4 | consolehtml.cpp 5 | consolehtml.h 6 | consolemodel.cpp 7 | consolemodel.h 8 | dictionary.cpp 9 | dictionary.h 10 | functionedit.cpp 11 | functionedit.h 12 | kalgebra.cpp 13 | kalgebra.h 14 | main.cpp 15 | varedit.cpp 16 | varedit.h 17 | variablesdelegate.cpp 18 | variablesdelegate.h 19 | viewportwidget.cpp 20 | viewportwidget.h 21 | ) 22 | 23 | file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/../icons/*-apps-kalgebra.png") 24 | ecm_add_app_icon(kalgebra ICONS ${ICONS_SRCS}) 25 | 26 | target_link_libraries(kalgebra Qt::Widgets Qt::PrintSupport Qt::WebEngineWidgets KF6::I18n 27 | KF6::CoreAddons KF6::WidgetsAddons KF6::ConfigWidgets 28 | KF6::XmlGui # HelpMenu 29 | KF6::KIOCore 30 | KF6::I18n 31 | KF6::Analitza KF6::AnalitzaWidgets KF6::AnalitzaGui KF6::AnalitzaPlot Qt6::OpenGLWidgets) 32 | 33 | install(TARGETS kalgebra ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) 34 | install(PROGRAMS org.kde.kalgebra.desktop DESTINATION ${KDE_INSTALL_APPDIR} ) 35 | install(FILES kalgebra.xml DESTINATION ${KDE_INSTALL_DATADIR}/katepart5/syntax ) 36 | install(FILES org.kde.kalgebra.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR}) 37 | 38 | -------------------------------------------------------------------------------- /src/Messages.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | $XGETTEXT *.cpp -o $podir/kalgebra.pot 3 | -------------------------------------------------------------------------------- /src/askname.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************* 2 | * Copyright (C) 2009 by Aleix Pol * 3 | * * 4 | * This program is free software; you can redistribute it and/or * 5 | * modify it under the terms of the GNU General Public License * 6 | * as published by the Free Software Foundation; either version 2 * 7 | * of the License, or (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the Free Software * 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 17 | *************************************************************************************/ 18 | 19 | #ifndef ASKNAME_H 20 | #define ASKNAME_H 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | class AskName : public QDialog 30 | { 31 | public: 32 | AskName(const QString &text, QWidget *parent) 33 | : QDialog(parent) 34 | { 35 | edit = new QLineEdit(this); 36 | edit->setValidator(new QRegularExpressionValidator(QRegularExpression(QStringLiteral("[a-zA-Z][\\w]*")), edit)); 37 | 38 | QDialogButtonBox *buttonBox; 39 | QVBoxLayout *items = new QVBoxLayout(this); 40 | items->addWidget(new QLabel(text, this)); 41 | items->addWidget(edit); 42 | // items->addItem(new QSpacerItem()); 43 | items->addWidget(buttonBox = new QDialogButtonBox(QDialogButtonBox::Cancel | QDialogButtonBox::Ok, Qt::Horizontal, this)); 44 | 45 | connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept); 46 | connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject); 47 | } 48 | 49 | QString name() const 50 | { 51 | return edit->text(); 52 | } 53 | 54 | private: 55 | QLineEdit *edit; 56 | }; 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /src/consolehtml.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************* 2 | * Copyright (C) 2007 by Aleix Pol * 3 | * * 4 | * This program is free software; you can redistribute it and/or * 5 | * modify it under the terms of the GNU General Public License * 6 | * as published by the Free Software Foundation; either version 2 * 7 | * of the License, or (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the Free Software * 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 17 | *************************************************************************************/ 18 | 19 | #ifndef CONSOLE_H 20 | #define CONSOLE_H 21 | 22 | #include 23 | #include 24 | 25 | #include "consolemodel.h" 26 | #include 27 | 28 | class ConsoleModel; 29 | 30 | class InlineOptions 31 | { 32 | public: 33 | virtual ~InlineOptions() 34 | { 35 | } 36 | 37 | virtual QString id() const = 0; 38 | virtual QString caption() const = 0; 39 | virtual bool matchesExpression(const Analitza::Expression &exp) const = 0; 40 | virtual void triggerOption(const Analitza::Expression &exp) = 0; 41 | }; 42 | 43 | /** 44 | * The Console widget is able to receive an operation, solve it and show the value. 45 | * It also is able to load scripts and save logs. 46 | * @author Aleix Pol Gonzalez 47 | */ 48 | 49 | class ConsoleHtml : public QWebEngineView 50 | { 51 | Q_OBJECT 52 | public: 53 | /** Constructor. Creates a console widget. */ 54 | ConsoleHtml(QWidget *parent = nullptr); 55 | 56 | /** Destructor. */ 57 | ~ConsoleHtml() override; 58 | 59 | /** Retrieves a pointer to the Analitza calculator associated. */ 60 | Analitza::Analyzer *analitza(); 61 | 62 | /** Sets a @p newMode console mode. */ 63 | void setMode(ConsoleModel::ConsoleMode newMode); 64 | 65 | /** Retrieves the console mode. */ 66 | ConsoleModel::ConsoleMode mode() const; 67 | 68 | void addOptionsObserver(InlineOptions *opt) 69 | { 70 | m_options += opt; 71 | } 72 | 73 | void contextMenuEvent(QContextMenuEvent *ev) override; 74 | 75 | public Q_SLOTS: 76 | /** Adds the operation defined by the expression @p e. */ 77 | bool addOperation(const Analitza::Expression &e, const QString &input); 78 | 79 | /** Loads a script from @p path. */ 80 | bool loadScript(const QUrl &path); 81 | 82 | /** Save a script yo @p path. */ 83 | bool saveScript(const QUrl &path) const; 84 | 85 | /** Saves a log to @p path. */ 86 | bool saveLog(const QUrl &path) const; 87 | 88 | /** Flushes the contents. */ 89 | void clear(); 90 | 91 | /** Copies the selected text to the clipboard */ 92 | void copy() const; 93 | 94 | void openClickedUrl(const QUrl &url); 95 | 96 | void setActualUrl(const QUrl &url); 97 | 98 | Q_SIGNALS: 99 | /** Emits a notification that tells that the widget status. */ 100 | void status(const QString &msg); 101 | 102 | /** Emits that something has changed. */ 103 | void changed(); 104 | 105 | /** Emits the selected code to be pasted somewhere */ 106 | void paste(const QString &code); 107 | 108 | private Q_SLOTS: 109 | void modifyVariable(const QString &name, const Analitza::Expression &exp); 110 | void removeVariable(const QString &name); 111 | void paste(); 112 | 113 | private: 114 | void includeOperation(const Analitza::Expression &expression, const Analitza::Expression &result); 115 | void updateView(); 116 | 117 | QString m_optionsString; 118 | QUrl m_actualUrl; 119 | QList m_options; 120 | QScopedPointer m_model; 121 | }; 122 | 123 | #endif 124 | -------------------------------------------------------------------------------- /src/consolemodel.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************* 2 | * Copyright (C) 2007-2017 by Aleix Pol * 3 | * * 4 | * This program is free software; you can redistribute it and/or * 5 | * modify it under the terms of the GNU General Public License * 6 | * as published by the Free Software Foundation; either version 2 * 7 | * of the License, or (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the Free Software * 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 17 | *************************************************************************************/ 18 | 19 | #ifndef CONSOLEMODEL_H 20 | #define CONSOLEMODEL_H 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | class ConsoleModel : public QObject 28 | { 29 | Q_OBJECT 30 | Q_PROPERTY(ConsoleMode mode READ mode WRITE setMode NOTIFY modeChanged) 31 | Q_PROPERTY(QSharedPointer variables READ variables WRITE setVariables NOTIFY variablesChanged) 32 | public: 33 | ConsoleModel(QObject *parent = nullptr); 34 | 35 | /** This enumeration controles the way the console will calculate and show his results. */ 36 | enum ConsoleMode { 37 | Evaluation, /**< Simplifies the expression, tries to simplify when sees a variable not defined. */ 38 | Calculation /**< Calculates everything, if it finds a not defined variable shows an error. */ 39 | }; 40 | Q_ENUM(ConsoleMode) 41 | 42 | Q_SCRIPTABLE bool addOperation(const QString &input); 43 | bool addOperation(const Analitza::Expression &e, const QString &input); 44 | 45 | Q_SCRIPTABLE bool loadScript(const QUrl &path); 46 | Q_SCRIPTABLE bool saveScript(const QUrl &path); 47 | Q_SCRIPTABLE void clear(); 48 | Q_SCRIPTABLE bool saveLog(const QUrl &path) const; 49 | 50 | Q_SCRIPTABLE static QString readContent(const QUrl &url); 51 | 52 | QByteArray css() const; 53 | 54 | ConsoleMode mode() const 55 | { 56 | return m_mode; 57 | } 58 | void setMode(ConsoleMode mode); 59 | 60 | QSharedPointer variables() const 61 | { 62 | return a.variables(); 63 | } 64 | void setVariables(const QSharedPointer &vars); 65 | Analitza::Analyzer *analyzer() 66 | { 67 | return &a; 68 | } 69 | 70 | QList htmlLog() const 71 | { 72 | return m_htmlLog; 73 | } 74 | 75 | Q_SIGNALS: 76 | void message(const QString &msg, const Analitza::Expression &operation, const Analitza::Expression &result); 77 | void updateView(); 78 | void modeChanged(ConsoleModel::ConsoleMode mode); 79 | void operationSuccessful(const Analitza::Expression &expression, const Analitza::Expression &result); 80 | void variablesChanged(); 81 | 82 | private: 83 | void addMessage(const QString &msg, const Analitza::Expression &operation, const Analitza::Expression &result); 84 | 85 | QList m_htmlLog; 86 | Analitza::Analyzer a; 87 | ConsoleMode m_mode = Evaluation; 88 | QList m_script; 89 | }; 90 | 91 | #endif 92 | -------------------------------------------------------------------------------- /src/dictionary.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************************* 2 | * Copyright (C) 2007 by Aleix Pol * 3 | * * 4 | * This program is free software; you can redistribute it and/or * 5 | * modify it under the terms of the GNU General Public License * 6 | * as published by the Free Software Foundation; either version 2 * 7 | * of the License, or (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the Free Software * 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 17 | *************************************************************************************/ 18 | 19 | #include "dictionary.h" 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | 34 | Dictionary::Dictionary(QWidget *p) 35 | : QWidget(p) 36 | { 37 | m_ops = new OperatorsModel(this); 38 | m_sortProxy = new QSortFilterProxyModel(this); 39 | m_sortProxy->setSourceModel(m_ops); 40 | m_sortProxy->sort(2, Qt::AscendingOrder); 41 | m_sortProxy->setFilterKeyColumn(2); 42 | 43 | m_vars = QSharedPointer(new Analitza::Variables); 44 | 45 | QGroupBox *descr = new QGroupBox(i18n("Information"), this); 46 | descr->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); 47 | QFormLayout *descrLayo = new QFormLayout; 48 | QVBoxLayout *graphLayo = new QVBoxLayout(this); 49 | m_name = new QLabel(descr); 50 | m_descr = new QLabel(descr); 51 | m_sample = new QLabel(descr); 52 | m_example = new QLabel(descr); 53 | m_funcs = new Analitza::PlotsModel(descr); 54 | m_graph = new Analitza::PlotsView2D(descr); 55 | m_graph->setTicksShown(Qt::Orientation(0)); 56 | m_graph->setModel(m_funcs); 57 | m_graph->setReadOnly(true); 58 | m_graph->setViewport(QRect(QPoint(-30, 7), QPoint(30, -7))); 59 | m_graph->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); 60 | 61 | m_name->setIndent(10); 62 | m_descr->setIndent(10); 63 | m_sample->setIndent(10); 64 | m_example->setIndent(10); 65 | 66 | m_example->setTextInteractionFlags(Qt::TextSelectableByMouse); 67 | 68 | descrLayo->addRow(i18n("%1", m_ops->headerData(0, Qt::Horizontal).toString()), m_name); 69 | descrLayo->addRow(i18n("%1", m_ops->headerData(1, Qt::Horizontal).toString()), m_descr); 70 | descrLayo->addRow(i18n("%1", m_ops->headerData(2, Qt::Horizontal).toString()), m_sample); 71 | descrLayo->addRow(i18n("%1", m_ops->headerData(3, Qt::Horizontal).toString()), m_example); 72 | descrLayo->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow); 73 | graphLayo->addWidget(descr); 74 | graphLayo->addWidget(m_graph); 75 | descr->setLayout(descrLayo); 76 | 77 | m_funcs->clear(); 78 | // connect(m_list, SIGNAL(clicked(QModelIndex)), this, SLOT(activated(QModelIndex))); 79 | } 80 | 81 | Dictionary::~Dictionary() 82 | { 83 | } 84 | 85 | void Dictionary::activated(const QModelIndex &idx, const QModelIndex &prev) 86 | { 87 | Q_UNUSED(prev); 88 | 89 | m_funcs->clear(); 90 | if (idx.isValid()) { 91 | QModelIndex nameIdx, descriptionIdx, sampleIdx, exampleIdx; 92 | nameIdx = idx.sibling(idx.row(), 0); 93 | descriptionIdx = idx.sibling(idx.row(), 1); 94 | sampleIdx = idx.sibling(idx.row(), 2); 95 | exampleIdx = idx.sibling(idx.row(), 3); 96 | 97 | QString name = m_sortProxy->data(nameIdx).toString(); 98 | QString description = m_sortProxy->data(descriptionIdx).toString(); 99 | QString sample = m_sortProxy->data(sampleIdx).toString(); 100 | QString example = m_sortProxy->data(exampleIdx).toString(); 101 | 102 | Analitza::Expression e(example, false); 103 | 104 | m_name->setText(name); 105 | m_descr->setText(description); 106 | m_sample->setText(sample); 107 | m_example->setText(example); 108 | 109 | m_funcs->addPlot(Analitza::PlotsFactory::self()->requestPlot(e, Analitza::Dim2D, m_vars).create(QColor(0, 150, 0), QStringLiteral("dict"))); 110 | } else { 111 | m_name->setText(QString()); 112 | m_descr->setText(QString()); 113 | m_sample->setText(QString()); 114 | m_example->setText(QString()); 115 | } 116 | } 117 | 118 | void Dictionary::setFilter(const QString &filter) 119 | { 120 | m_sortProxy->setFilterFixedString(filter); 121 | } 122 | 123 | #include "moc_dictionary.cpp" 124 | -------------------------------------------------------------------------------- /src/dictionary.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************* 2 | * Copyright (C) 2007 by Aleix Pol * 3 | * * 4 | * This program is free software; you can redistribute it and/or * 5 | * modify it under the terms of the GNU General Public License * 6 | * as published by the Free Software Foundation; either version 2 * 7 | * of the License, or (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the Free Software * 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 17 | *************************************************************************************/ 18 | 19 | #ifndef DICTIONARY_H 20 | #define DICTIONARY_H 21 | 22 | #include 23 | #include 24 | 25 | namespace Analitza 26 | { 27 | class Variables; 28 | class PlotsView2D; 29 | class PlotsModel; 30 | } 31 | 32 | class QLabel; 33 | class QModelIndex; 34 | class OperatorsModel; 35 | 36 | /** 37 | @author Aleix Pol 38 | */ 39 | class Dictionary : public QWidget 40 | { 41 | Q_OBJECT 42 | public: 43 | Dictionary(QWidget *p = nullptr); 44 | virtual ~Dictionary(); 45 | 46 | QSortFilterProxyModel *model() const 47 | { 48 | return m_sortProxy; 49 | } 50 | 51 | public Q_SLOTS: 52 | void activated(const QModelIndex &prev, const QModelIndex &); 53 | void setFilter(const QString &); 54 | 55 | private: 56 | QLabel *m_name; 57 | QLabel *m_descr; 58 | QLabel *m_sample; 59 | QLabel *m_example; 60 | 61 | Analitza::PlotsView2D *m_graph; 62 | Analitza::PlotsModel *m_funcs; 63 | OperatorsModel *m_ops; 64 | QSharedPointer m_vars; 65 | QSortFilterProxyModel *m_sortProxy; 66 | }; 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /src/functionedit.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************* 2 | * Copyright (C) 2007 by Aleix Pol * 3 | * * 4 | * This program is free software; you can redistribute it and/or * 5 | * modify it under the terms of the GNU General Public License * 6 | * as published by the Free Software Foundation; either version 2 * 7 | * of the License, or (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the Free Software * 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 17 | *************************************************************************************/ 18 | 19 | #ifndef FUNCTIONEDIT_H 20 | #define FUNCTIONEDIT_H 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | #include 28 | 29 | class QTabWidget; 30 | namespace Analitza 31 | { 32 | class Variables; 33 | class Expression; 34 | class PlotsView2D; 35 | class PlotsModel; 36 | class PlaneCurve; 37 | class ExpressionEdit; 38 | } 39 | 40 | /** 41 | * The FunctionEdit dialog provides a way to specify functions. 42 | * @author Aleix Pol i Gonzalez 43 | */ 44 | 45 | class FunctionEdit : public QWidget 46 | { 47 | Q_OBJECT 48 | public: 49 | /** Constructor. */ 50 | explicit FunctionEdit(QWidget *parent = nullptr); 51 | 52 | /** Destructor. */ 53 | ~FunctionEdit(); 54 | 55 | /** Retrieves the resulting expression text. */ 56 | Analitza::Expression expression() const; 57 | 58 | Analitza::PlaneCurve *createFunction() const; 59 | 60 | /** Sets an expression text to the ExpressionEdit widget. */ 61 | void setFunction(const QString &newText); 62 | 63 | /** Retrieves the selected color for the function */ 64 | QColor color() const 65 | { 66 | return m_color->color(); 67 | } 68 | 69 | /** Sets the selected color for the function.*/ 70 | void setColor(const QColor &newColor); 71 | 72 | /** Returns whether we are editing or adding a function. */ 73 | bool editing() const 74 | { 75 | return m_modmode; 76 | } 77 | 78 | /** Sets whether we are editing or adding a function. */ 79 | void setEditing(bool m); 80 | 81 | /** Sets a name to the function. (Not used YET) */ 82 | void setName(const QString &name) 83 | { 84 | m_name->setText(name); 85 | } 86 | 87 | /** Retrieves a name for the function. (Not used YET) */ 88 | QString name() const 89 | { 90 | return m_name->text(); 91 | } 92 | 93 | /** Sets the variables class to be used with the graph functions*/ 94 | void setVariables(const QSharedPointer &v) 95 | { 96 | m_vars = v; 97 | } 98 | 99 | QSharedPointer variables() const 100 | { 101 | return m_vars; 102 | } 103 | 104 | void setOptionsShown(bool shown); 105 | 106 | void resizeEvent(QResizeEvent *ev) override; 107 | 108 | public Q_SLOTS: 109 | /** Clears the dialog. */ 110 | void clear(); 111 | 112 | Q_SIGNALS: 113 | /** Tells that the result has been accepted. */ 114 | void accept(); 115 | 116 | /** asks the currently edited plot to be removed. */ 117 | void removeEditingPlot(); 118 | 119 | private Q_SLOTS: 120 | void edit(); 121 | void ok(); 122 | void colorChange(int); 123 | void updateUplimit(); 124 | void updateDownlimit(); 125 | 126 | private: 127 | void setState(const QString &text, bool negative); 128 | void focusInEvent(QFocusEvent *) override; 129 | 130 | Analitza::ExpressionEdit *m_func; 131 | Analitza::ExpressionEdit *m_uplimit, *m_downlimit; 132 | double m_calcUplimit, m_calcDownlimit; 133 | QLineEdit *m_name; 134 | QPushButton *m_ok; 135 | QLabel *m_valid; 136 | QLabel *m_validIcon; 137 | Analitza::PlotsView2D *m_graph; 138 | KColorCombo *m_color; 139 | Analitza::PlotsModel *m_funcsModel; 140 | QSharedPointer m_vars; 141 | 142 | bool m_modmode; 143 | QTabWidget *m_viewTabs; 144 | QPushButton *m_remove; 145 | }; 146 | 147 | #endif 148 | -------------------------------------------------------------------------------- /src/kalgebra.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************* 2 | * Copyright (C) 2007 by Aleix Pol * 3 | * * 4 | * This program is free software; you can redistribute it and/or * 5 | * modify it under the terms of the GNU General Public License * 6 | * as published by the Free Software Foundation; either version 2 * 7 | * of the License, or (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the Free Software * 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 17 | *************************************************************************************/ 18 | 19 | #ifndef KALGEBRA_H 20 | #define KALGEBRA_H 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | namespace Analitza 30 | { 31 | class PlotsView2D; 32 | class PlotsView3DES; 33 | class PlotsModel; 34 | class VariablesModel; 35 | class ExpressionEdit; 36 | } 37 | 38 | class ConsoleHtml; 39 | class FunctionEdit; 40 | class KRecentFilesAction; 41 | 42 | namespace Analitza 43 | { 44 | class Expression; 45 | } 46 | 47 | class KAlgebra : public QMainWindow 48 | { 49 | Q_OBJECT 50 | public: 51 | KAlgebra(QWidget *parent = nullptr); 52 | ~KAlgebra(); 53 | 54 | void add2D(const Analitza::Expression &exp); 55 | void add3D(const Analitza::Expression &exp); 56 | 57 | private: 58 | QLabel *m_status; 59 | QTabWidget *m_tabs; 60 | 61 | // consoleeWidget 62 | QMenu *c_menu; 63 | KRecentFilesAction *c_recentScripts; 64 | Analitza::ExpressionEdit *c_exp; 65 | ConsoleHtml *c_results; 66 | QTreeView *c_variables; 67 | QDockWidget *c_dock_vars; 68 | Analitza::VariablesModel *c_varsModel; 69 | 70 | // graf 2d 71 | QMenu *b_menu; 72 | Analitza::PlotsModel *b_funcsModel; 73 | QTreeView *b_funcs; 74 | QTabWidget *b_tools; 75 | Analitza::PlotsView2D *m_graph2d; 76 | QDockWidget *b_dock_funcs; 77 | FunctionEdit *b_funced; 78 | Analitza::VariablesModel *b_varsModel; 79 | 80 | // graph 3d 81 | QMenu *t_menu; 82 | Analitza::ExpressionEdit *t_exp; 83 | Analitza::PlotsView3DES *m_graph3d; 84 | Analitza::PlotsModel *t_model3d; 85 | 86 | // Dictionary 87 | QDockWidget *d_dock; 88 | QListView *d_list; 89 | QLineEdit *d_filter; 90 | 91 | private Q_SLOTS: 92 | void newInstance(); 93 | void fullScreen(bool isFull); 94 | 95 | void initializeRecentScripts(); 96 | void operate(); 97 | void loadScript(); 98 | void loadScript(const QUrl &path); 99 | void saveScript(); 100 | void saveLog(); 101 | void updateInformation(); 102 | void consoleCalculate(); 103 | void consoleEvaluate(); 104 | void insertAns(); 105 | 106 | void select(const QModelIndex &idx); 107 | void new_func(); 108 | void remove_func(); 109 | void edit_func(const QModelIndex &); 110 | void edit_var(const QModelIndex &); 111 | void toggleSquares(); 112 | void toggleKeepAspect(); 113 | void set_res_low(); 114 | void set_res_std(); 115 | void set_res_fine(); 116 | void set_res_vfine(); 117 | void valueChanged(); 118 | void varsContextMenu(const QPoint &); 119 | 120 | void new_func3d(); 121 | void set_dots(); 122 | void set_lines(); 123 | void set_solid(); 124 | void save3DGraph(); 125 | 126 | void saveGraph(); 127 | void functools(int); 128 | 129 | void dictionaryFilterChanged(const QString &filter); 130 | 131 | void changeStatusBar(const QString &); 132 | void tabChanged(int); 133 | }; 134 | 135 | #endif 136 | -------------------------------------------------------------------------------- /src/kalgebra.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | piecewise 23 | list 24 | vector 25 | ? 26 | 27 | 28 | 29 | e 30 | euler 31 | false 32 | pi 33 | true 34 | ans 35 | 36 | 37 | 38 | @ 39 | abs 40 | and 41 | approx 42 | arccos 43 | arccosh 44 | arccot 45 | arcsc 46 | arcsch 47 | arcsec 48 | arcsech 49 | arcsin 50 | arcsinh 51 | arctan 52 | arctanh 53 | card 54 | ceiling 55 | cos 56 | cosh 57 | cot 58 | coth 59 | csc 60 | csch 61 | diff 62 | divide 63 | eq 64 | exp 65 | factorial 66 | factorof 67 | floor 68 | fmod 69 | gcd 70 | geq 71 | gt 72 | implies 73 | lcm 74 | leq 75 | ln 76 | log 77 | lt 78 | max 79 | min 80 | minus 81 | neq 82 | not 83 | or 84 | plus 85 | power 86 | product 87 | quotient 88 | rem 89 | root 90 | scalarprod 91 | sec 92 | sech 93 | selector 94 | sin 95 | sinh 96 | sum em> 97 | tan 98 | tanh 99 | times 100 | union 101 | xor 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | -------------------------------------------------------------------------------- /src/main.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************************* 2 | * Copyright (C) 2007 by Aleix Pol * 3 | * * 4 | * This program is free software; you can redistribute it and/or * 5 | * modify it under the terms of the GNU General Public License * 6 | * as published by the Free Software Foundation; either version 2 * 7 | * of the License, or (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the Free Software * 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 17 | *************************************************************************************/ 18 | 19 | #include "kalgebra.h" 20 | #include "kalgebra_version.h" 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | int main(int argc, char *argv[]) 27 | { 28 | QApplication app(argc, argv); 29 | KLocalizedString::setApplicationDomain("kalgebra"); 30 | KAboutData about(QStringLiteral("kalgebra"), 31 | QStringLiteral("KAlgebra"), 32 | QStringLiteral(KALGEBRA_VERSION_STRING), 33 | i18n("A portable calculator"), 34 | KAboutLicense::GPL, 35 | i18n("(C) 2006-2016 Aleix Pol i Gonzalez")); 36 | about.addAuthor(i18n("Aleix Pol i Gonzalez"), QString(), QStringLiteral("aleixpol@kde.org")); 37 | about.setTranslator(i18nc("NAME OF TRANSLATORS", "Your names"), i18nc("EMAIL OF TRANSLATORS", "Your emails")); 38 | KAboutData::setApplicationData(about); 39 | 40 | { 41 | QCommandLineParser parser; 42 | about.setupCommandLine(&parser); 43 | parser.process(app); 44 | about.processCommandLine(&parser); 45 | } 46 | QApplication::setWindowIcon(QIcon::fromTheme(QStringLiteral("kalgebra"))); 47 | 48 | KAlgebra widget; 49 | widget.show(); 50 | 51 | return app.exec(); 52 | } 53 | -------------------------------------------------------------------------------- /src/org.kde.kalgebra.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=KAlgebra 3 | Name[ar]=جبرك 4 | Name[ast]=KAlgebra 5 | Name[bg]=KAlgebra 6 | Name[bs]=Kalgebra 7 | Name[ca]=KAlgebra 8 | Name[ca@valencia]=KAlgebra 9 | Name[cs]=KAlgebra 10 | Name[csb]=KAlgebra 11 | Name[da]=KAlgebra 12 | Name[de]=KAlgebra 13 | Name[el]=KAlgebra 14 | Name[en_GB]=KAlgebra 15 | Name[eo]=KAlgebra 16 | Name[es]=KAlgebra 17 | Name[et]=KAlgebra 18 | Name[eu]=KAlgebra 19 | Name[fa]=KAlgebra 20 | Name[fi]=KAlgebra 21 | Name[fr]=KAlgebra 22 | Name[ga]=KAlgebra 23 | Name[gl]=KAlgebra 24 | Name[gu]=KAlgebra 25 | Name[he]=KAlgebra 26 | Name[hi]=के-अलजेब्रा 27 | Name[hne]=के-अलजेब्रा 28 | Name[hr]=KAlgebra 29 | Name[hu]=KAlgebra 30 | Name[ia]=KAlgebra 31 | Name[is]=KAlgebra 32 | Name[it]=KAlgebra 33 | Name[ja]=KAlgebra 34 | Name[ka]=KAlgebra 35 | Name[kk]=KAlgebra 36 | Name[km]=KAlgebra 37 | Name[ko]=KAlgebra 38 | Name[lt]=KAlgebra 39 | Name[lv]=KAlgebra 40 | Name[ml]=കെ-ആള്‍ജിബ്ര 41 | Name[mr]=के-एल्जिब्रा 42 | Name[nb]=KAlgebra 43 | Name[nds]=KAlgebra 44 | Name[ne]=केडीई बीजगणित 45 | Name[nl]=KAlgebra 46 | Name[nn]=KAlgebra 47 | Name[pa]=ਕੇ-ਐਲਜਬਰਾ 48 | Name[pl]=KAlgebra 49 | Name[pt]=KAlgebra 50 | Name[pt_BR]=KAlgebra 51 | Name[ro]=KAlgebra 52 | Name[ru]=KAlgebra 53 | Name[sa]=KAlgebra 54 | Name[si]=KAlgebra 55 | Name[sk]=KAlgebra 56 | Name[sl]=KAlgebra 57 | Name[sv]=Kalgebra 58 | Name[te]=కె అల్జీబ్రా 59 | Name[tr]=K Cebir 60 | Name[ug]=KAlgebra 61 | Name[uk]=KАлгебра 62 | Name[x-test]=xxKAlgebraxx 63 | Name[zh_CN]=KAlgebra 64 | Name[zh_TW]=數學_KAlgebra 65 | GenericName=Graph Calculator 66 | GenericName[ar]=حاسبة رسومية 67 | GenericName[bg]=Графичен калкулатор 68 | GenericName[bs]=Graf kalkulator 69 | GenericName[ca]=Calculadora gràfica 70 | GenericName[ca@valencia]=Calculadora gràfica 71 | GenericName[cs]=Kalkulačka grafů 72 | GenericName[csb]=Kalkùlator 73 | GenericName[da]=Diagramberegner 74 | GenericName[de]=Graphenrechner 75 | GenericName[el]=Γραφικός υπολογιστής 76 | GenericName[en_GB]=Graph Calculator 77 | GenericName[eo]=Kalkulilo de grafikaĵoj 78 | GenericName[es]=Calculadora gráfica 79 | GenericName[et]=Graafikute arvutaja 80 | GenericName[eu]=Grafikoen kalkulagailua 81 | GenericName[fa]=ماشین حساب گراف 82 | GenericName[fi]=Graafinen laskin 83 | GenericName[fr]=Calculatrice graphique 84 | GenericName[ga]=Áireamhán Grafach 85 | GenericName[gl]=Calculadora gráfica 86 | GenericName[gu]=આલેખ કેલ્ક્યુલેટર 87 | GenericName[he]=מחשבון גרפי 88 | GenericName[hi]=ग्राफ गणक 89 | GenericName[hne]=ग्राफ गनक 90 | GenericName[hu]=Függvényszámító 91 | GenericName[ia]=Calculator Graphic 92 | GenericName[is]=Reiknivél fyrir gröf 93 | GenericName[it]=Calcolatrice grafica 94 | GenericName[ja]=グラフ計算機 95 | GenericName[ka]=გრაფიკული კალკულატორი 96 | GenericName[kk]=График калькуляторы 97 | GenericName[km]=ម៉ាស៊ីន​គិតលេខ​ក្រាហ្វិក​ 98 | GenericName[ko]=그래핑 계산기 99 | GenericName[lt]=Grafinis skaičiuotuvas 100 | GenericName[lv]=Grafiku kalkulators 101 | GenericName[ml]=ഗ്രാഫ് ഗണനി 102 | GenericName[mr]=आलेख गणकयंत्र 103 | GenericName[nb]=Grafikk-kalkulator 104 | GenericName[nds]=Funkschonenreekner 105 | GenericName[ne]=ग्राफ गणकयन्त्र 106 | GenericName[nl]=Rekenmachine met grafieken 107 | GenericName[nn]=Ein grafkalkulator 108 | GenericName[pa]=ਗਰਾਫ਼ ਕੈਲਕੂਲੇਟਰ 109 | GenericName[pl]=Kalkulator wykresów 110 | GenericName[pt]=Calculadora Gráfica 111 | GenericName[pt_BR]=Calculadora gráfica 112 | GenericName[ru]=Графический калькулятор 113 | GenericName[sa]=आलेख गणक 114 | GenericName[sk]=Grafická kalkulačka 115 | GenericName[sl]=Računalo z grafi 116 | GenericName[sv]=Grafräknare 117 | GenericName[te]=రేఖాచిత్ర గనన యంత్రము 118 | GenericName[tr]=Grafik Hesap Makinesi 119 | GenericName[uk]=Графічний калькулятор 120 | GenericName[x-test]=xxGraph Calculatorxx 121 | GenericName[zh_CN]=图形计算器 122 | GenericName[zh_TW]=圖形計算器 123 | Comment=Math Expression Solver and Plotter 124 | Comment[ar]=حلّال ورسّام التعابير الرياضية 125 | Comment[bg]=Решаване на математически задачи 126 | Comment[bs]=Matematski Sistem za rješavanje i crtač 127 | Comment[ca]=Soluciona i representa gràficament expressions matemàtiques 128 | Comment[ca@valencia]=Soluciona i representa gràficament expressions matemàtiques 129 | Comment[cs]=Řešitel a souřadnicový zapisovač matematických výrazů 130 | Comment[csb]=Rozrzeszëwôcz matematicznëch równaniów ë rësowôcz grafów 131 | Comment[da]=Løser og plotter til matematiske udtryk 132 | Comment[de]=Mathematische Gleichungslösung und -zeichnung 133 | Comment[el]=Σχεδιαστής και επιλυτής μαθηματικών εκφράσεων 134 | Comment[en_GB]=Mathematical Expression Solver and Plotter 135 | Comment[eo]=Solvilo kaj desegnilo de matematikaj esprimoj 136 | Comment[es]=Resuelve y dibuja expresiones matemáticas 137 | Comment[et]=Matemaatiliste avaldiste lahendaja ja joonistaja 138 | Comment[eu]=Matematika adierazpenen ebazlea edo trazatzailea 139 | Comment[fa]=حل‌کننده عبارت ریاضی و رسام 140 | Comment[fi]=Matemaattisten yhtälöiden ratkaisut ja kuvaajat 141 | Comment[fr]=Traceur et résolveur d'expressions mathématiques 142 | Comment[ga]=Réiteoir agus Breacaire Sloinn Mhatamaiticiúla 143 | Comment[gl]=Ferramenta para resolver e debuxar expresións matemáticas 144 | Comment[gu]=ગાણિતિક સૂત્રો ઉકેલનાર અને આલેખનાર 145 | Comment[he]=פותר ומשרטט ביטויים מתמטיים 146 | Comment[hi]=गणित एक्सप्रेशन सुलझाने वाला तथा प्लॉटर 147 | Comment[hne]=गनित एक्सप्रेसन सुलझाने वाला अउ प्लाटर 148 | Comment[hr]=Rješavač i crtač za matematičke izraze 149 | Comment[hu]=Matematikai egyenletek megoldása, görberajzolás 150 | Comment[ia]=Resolvitor e traciator de expression mathematic 151 | Comment[is]=Stærðfræðilausnir og plottun 152 | Comment[it]=Risolutore e disegnatore di espressioni matematiche 153 | Comment[ja]=数式ソルバー&プロッタ 154 | Comment[ka]=მათემატიკური გამოსახულებების ამომხსნელი და გრაფიკების მხატავი 155 | Comment[kk]=Математикалық өрнегін есептеп графигін салу 156 | Comment[km]=ឧបករណ៍​គូស​ក្រាហ្វិក និង​កម្មវិធី​ដោះស្រាយ​កន្សោម​​​គណិត 157 | Comment[ko]=수식 계산기와 그래핑 도구 158 | Comment[lt]=Matematinių reiškinių sprendikas ir grafikų braižiklis 159 | Comment[lv]=Matemātisko izteiksmju risinātājs un attēlotājs 160 | Comment[ml]=ഗണിതസൂത്ര പരിഹാരകനും പ്ലോട്ടറും 161 | Comment[nb]=Matematisk uttrykksløser og plotter 162 | Comment[nds]=Löser för mathemaatsche Utdrück un Bagenschriever 163 | Comment[ne]=म्याथ अभिव्यक्ति समाधानकर्ता र प्लोटर 164 | Comment[nl]=Oplossen en plotten van wiskundige expressies 165 | Comment[nn]=Matteoppgåveløysar og grafplottar 166 | Comment[pl]=Rozwiązywanie równań i rysowanie wykresów 167 | Comment[pt]=Resolução e Desenho de Expressões Matemáticas 168 | Comment[pt_BR]=Solucionador e visualizador de expressões matemáticas 169 | Comment[ru]=Решение и построение графиков математических выражений 170 | Comment[sa]=गणित अभिव्यक्ति समाधानकर्ता एवं प्लॉटर 171 | Comment[sk]=Riešiteľ a zapisovač matematických výrazov 172 | Comment[sl]=Reševalnik matematičnih enačb in risalnik grafov 173 | Comment[sv]=Lösning och uppritning av matematiska uttryck 174 | Comment[tr]=Matematiksel ifade çözücü ve çizici 175 | Comment[ug]=ماتېماتىكىلىق ئىپادىلەرنى يېشىش ۋە سىزىش قورالى 176 | Comment[uk]=Розв’язувач математичних виразів та графопобудовник 177 | Comment[x-test]=xxMath Expression Solver and Plotterxx 178 | Comment[zh_CN]=解数学式与绘图的工具 179 | Comment[zh_TW]=數學解題與繪圖 180 | Exec=kalgebra %u 181 | MimeType=application/x-kalgebra; 182 | Icon=kalgebra 183 | Type=Application 184 | X-DocPath=kalgebra/index.html 185 | Categories=Qt;KDE;Education;Math;Science; 186 | X-DBUS-ServiceName=org.kde.kalgebra 187 | -------------------------------------------------------------------------------- /src/varedit.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************************* 2 | * Copyright (C) 2007 by Aleix Pol * 3 | * * 4 | * This program is free software; you can redistribute it and/or * 5 | * modify it under the terms of the GNU General Public License * 6 | * as published by the Free Software Foundation; either version 2 * 7 | * of the License, or (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the Free Software * 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 17 | *************************************************************************************/ 18 | 19 | #include "varedit.h" 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | VarEdit::VarEdit(QWidget *parent, bool modal) 31 | : QDialog(parent) 32 | , vars(nullptr) 33 | , m_correct(false) 34 | { 35 | setWindowTitle(i18n("Add/Edit a variable")); 36 | setModal(modal); 37 | 38 | m_buttonBox = new QDialogButtonBox(this); 39 | m_buttonBox->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); 40 | m_removeBtn = m_buttonBox->addButton(i18n("Remove Variable"), QDialogButtonBox::DestructiveRole); 41 | m_removeBtn->setIcon(QIcon::fromTheme(QStringLiteral("edit-table-delete-row"))); 42 | 43 | connect(m_removeBtn, &QAbstractButton::clicked, this, &VarEdit::removeVariable); 44 | 45 | connect(m_buttonBox, &QDialogButtonBox::accepted, this, &VarEdit::accept); 46 | connect(m_buttonBox, &QDialogButtonBox::rejected, this, &VarEdit::reject); 47 | 48 | m_exp = new Analitza::ExpressionEdit(this); 49 | connect(m_exp, &QPlainTextEdit::textChanged, this, &VarEdit::edit); 50 | connect(m_exp, &Analitza::ExpressionEdit::returnPressed, this, &VarEdit::ok); 51 | 52 | m_valid = new QLabel(this); 53 | 54 | QVBoxLayout *topLayout = new QVBoxLayout(this); 55 | topLayout->addWidget(m_exp); 56 | topLayout->addWidget(m_valid); 57 | topLayout->addWidget(m_buttonBox); 58 | 59 | m_exp->setFocus(); 60 | } 61 | 62 | void VarEdit::setName(const QString &newVar) 63 | { 64 | m_var = newVar; 65 | setWindowTitle(i18n("Edit '%1' value", newVar)); 66 | if (!vars) 67 | m_exp->setText(i18n("not available")); 68 | else { 69 | m_exp->setExpression(Analitza::Expression(vars->value(newVar)->copy())); 70 | } 71 | m_removeBtn->setEnabled(vars && canRemove(newVar)); 72 | } 73 | 74 | bool VarEdit::canRemove(const QString &name) const 75 | { 76 | QHash::const_iterator it = vars->constBegin(), itEnd = vars->constEnd(); 77 | for (; it != itEnd; ++it) { 78 | QStringList deps = AnalitzaUtils::dependencies(*it, QStringList()); 79 | if (deps.contains(name)) { 80 | return false; 81 | } 82 | } 83 | return true; 84 | } 85 | 86 | Analitza::Expression VarEdit::val() 87 | { 88 | Analitza::Expression val; 89 | Analitza::Analyzer a(vars); 90 | 91 | a.setExpression(m_exp->expression()); 92 | 93 | if (a.isCorrect()) { 94 | a.simplify(); 95 | val = a.expression(); 96 | } 97 | 98 | m_correct = a.isCorrect(); 99 | if (m_correct) { 100 | m_valid->setText(i18n("%1 := %2", m_var, val.toString())); 101 | m_valid->setToolTip(QString()); 102 | } else { 103 | m_valid->setText(i18n("WRONG")); 104 | m_valid->setToolTip(a.errors().join(QStringLiteral("\n"))); 105 | } 106 | m_buttonBox->button(QDialogButtonBox::Ok)->setEnabled(m_correct); 107 | m_exp->setCorrect(m_correct); 108 | 109 | return val; 110 | } 111 | 112 | void VarEdit::edit() 113 | { 114 | val(); 115 | } 116 | 117 | void VarEdit::ok() 118 | { 119 | if (m_correct) 120 | accept(); 121 | } 122 | 123 | void VarEdit::setAnalitza(Analitza::Analyzer *na) 124 | { 125 | vars = na->variables(); 126 | m_exp->setAnalitza(na); 127 | } 128 | 129 | void VarEdit::removeVariable() 130 | { 131 | vars->remove(m_var); 132 | close(); 133 | } 134 | 135 | #include "moc_varedit.cpp" 136 | -------------------------------------------------------------------------------- /src/varedit.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************* 2 | * Copyright (C) 2007 by Aleix Pol * 3 | * * 4 | * This program is free software; you can redistribute it and/or * 5 | * modify it under the terms of the GNU General Public License * 6 | * as published by the Free Software Foundation; either version 2 * 7 | * of the License, or (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the Free Software * 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 17 | *************************************************************************************/ 18 | 19 | #ifndef VAREDIT_H 20 | #define VAREDIT_H 21 | 22 | #include 23 | #include 24 | 25 | class QDialogButtonBox; 26 | namespace Analitza 27 | { 28 | class Analyzer; 29 | class Variables; 30 | class Expression; 31 | class ExpressionEdit; 32 | } 33 | 34 | /** 35 | * The VarEdit provides a dialog to allow users to edit/create a variable. 36 | * @author Aleix Pol i Gonzalez 37 | */ 38 | 39 | class VarEdit : public QDialog 40 | { 41 | Q_OBJECT 42 | public: 43 | /** Constructor. Creates a variable editing dialog. */ 44 | explicit VarEdit(QWidget *parent = nullptr, bool modal = false); 45 | 46 | /** Sets the editing variable name */ 47 | void setName(const QString &newVar); 48 | 49 | /** Sets an Analitza which will evaluate it. It may be interesting because variables can change. */ 50 | void setAnalitza(Analitza::Analyzer *na); 51 | 52 | /** Returns the resulting variable expression */ 53 | Analitza::Expression val(); 54 | 55 | private: 56 | bool canRemove(const QString &name) const; 57 | 58 | Analitza::ExpressionEdit *m_exp; 59 | 60 | QLabel *m_valid; 61 | QSharedPointer vars; 62 | bool m_correct; 63 | QString m_var; 64 | QDialogButtonBox *m_buttonBox; 65 | QPushButton *m_removeBtn; 66 | 67 | private Q_SLOTS: 68 | void edit(); 69 | void ok(); 70 | void removeVariable(); 71 | }; 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /src/variablesdelegate.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************************* 2 | * Copyright (C) 2009 by Aleix Pol * 3 | * * 4 | * This program is free software; you can redistribute it and/or * 5 | * modify it under the terms of the GNU General Public License * 6 | * as published by the Free Software Foundation; either version 2 * 7 | * of the License, or (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the Free Software * 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 17 | *************************************************************************************/ 18 | 19 | #include "variablesdelegate.h" 20 | 21 | #include 22 | 23 | QWidget *VariablesDelegate::createEditor(QWidget *p, const QStyleOptionViewItem &opt, const QModelIndex &idx) const 24 | { 25 | QVariant val = idx.model()->data(idx); 26 | if (val.metaType().id() == QMetaType::Double) { 27 | QDoubleSpinBox *spin = new QDoubleSpinBox(p); 28 | spin->setDecimals(10); 29 | return spin; 30 | } else 31 | return QItemDelegate::createEditor(p, opt, idx); 32 | } 33 | 34 | void VariablesDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const 35 | { 36 | QDoubleSpinBox *spin = qobject_cast(editor); 37 | if (spin) 38 | spin->setValue(index.model()->data(index).value()); 39 | else 40 | QItemDelegate::setEditorData(editor, index); 41 | } 42 | -------------------------------------------------------------------------------- /src/variablesdelegate.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************* 2 | * Copyright (C) 2009 by Aleix Pol * 3 | * * 4 | * This program is free software; you can redistribute it and/or * 5 | * modify it under the terms of the GNU General Public License * 6 | * as published by the Free Software Foundation; either version 2 * 7 | * of the License, or (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the Free Software * 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 17 | *************************************************************************************/ 18 | 19 | #ifndef VARIABLESDELEGATE_H 20 | #define VARIABLESDELEGATE_H 21 | 22 | #include 23 | 24 | class VariablesDelegate : public QItemDelegate 25 | { 26 | public: 27 | VariablesDelegate(QObject *parent = nullptr) 28 | : QItemDelegate(parent) 29 | { 30 | } 31 | QWidget *createEditor(QWidget *, const QStyleOptionViewItem &, const QModelIndex &) const override; 32 | void setEditorData(QWidget *editor, const QModelIndex &index) const override; 33 | }; 34 | 35 | #endif // VARIABLESDELEGATE_H 36 | -------------------------------------------------------------------------------- /src/viewportwidget.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************************* 2 | * Copyright (C) 2009 by Aleix Pol * 3 | * * 4 | * This program is free software; you can redistribute it and/or * 5 | * modify it under the terms of the GNU General Public License * 6 | * as published by the Free Software Foundation; either version 2 * 7 | * of the License, or (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the Free Software * 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 17 | *************************************************************************************/ 18 | 19 | #include "viewportwidget.h" 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | ViewportWidget::ViewportWidget(QWidget *parent) 28 | : QWidget(parent) 29 | { 30 | m_top = new QDoubleSpinBox(this); 31 | m_left = new QDoubleSpinBox(this); 32 | m_width = new QDoubleSpinBox(this); 33 | m_height = new QDoubleSpinBox(this); 34 | 35 | // const double LIMIT=std::numeric_limits::max(); 36 | // Can't use limit, because otherwise Qt uses the value for the sizeHint and 37 | // we get a huge window 38 | const double LIMIT = 5000; 39 | m_top->setRange(-LIMIT, LIMIT); 40 | m_left->setRange(-LIMIT, LIMIT); 41 | m_width->setRange(0, LIMIT); 42 | m_height->setRange(0, LIMIT); 43 | 44 | QVBoxLayout *upperLayout = new QVBoxLayout; 45 | QFormLayout *layout = new QFormLayout; 46 | layout->addRow(i18n("Left:"), m_left); 47 | layout->addRow(i18n("Top:"), m_top); 48 | layout->addRow(i18n("Width:"), m_width); 49 | layout->addRow(i18n("Height:"), m_height); 50 | 51 | QPushButton *apply = new QPushButton(QIcon::fromTheme(QStringLiteral("dialog-ok-apply")), i18n("Apply"), this); 52 | connect(apply, &QAbstractButton::clicked, this, &ViewportWidget::emitViewport); 53 | 54 | upperLayout->addLayout(layout); 55 | upperLayout->addWidget(apply); 56 | setLayout(upperLayout); 57 | } 58 | 59 | QRectF ViewportWidget::viewport() const 60 | { 61 | return QRectF(m_left->value(), m_top->value(), m_width->value(), -m_height->value()); 62 | } 63 | 64 | void ViewportWidget::setViewport(const QRectF ¤t) 65 | { 66 | m_top->setValue(current.top()); 67 | m_left->setValue(current.left()); 68 | m_width->setValue(current.width()); 69 | m_height->setValue(-current.height()); 70 | } 71 | 72 | void ViewportWidget::emitViewport() 73 | { 74 | Q_EMIT viewportChange(viewport()); 75 | } 76 | 77 | #include "moc_viewportwidget.cpp" 78 | -------------------------------------------------------------------------------- /src/viewportwidget.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************* 2 | * Copyright (C) 2009 by Aleix Pol * 3 | * * 4 | * This program is free software; you can redistribute it and/or * 5 | * modify it under the terms of the GNU General Public License * 6 | * as published by the Free Software Foundation; either version 2 * 7 | * of the License, or (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the Free Software * 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 17 | *************************************************************************************/ 18 | 19 | #ifndef VIEWPORTWIDGET_H 20 | #define VIEWPORTWIDGET_H 21 | 22 | #include 23 | class QDoubleSpinBox; 24 | 25 | class ViewportWidget : public QWidget 26 | { 27 | Q_OBJECT 28 | public: 29 | explicit ViewportWidget(QWidget *parent = nullptr); 30 | 31 | QRectF viewport() const; 32 | 33 | public Q_SLOTS: 34 | void setViewport(const QRectF ¤t); 35 | 36 | private Q_SLOTS: 37 | void emitViewport(); 38 | 39 | Q_SIGNALS: 40 | void viewportChange(const QRectF &newViewport); 41 | 42 | private: 43 | QDoubleSpinBox *m_left; 44 | QDoubleSpinBox *m_top; 45 | QDoubleSpinBox *m_width; 46 | QDoubleSpinBox *m_height; 47 | }; 48 | 49 | #endif // VIEWPORTDIALOG_H 50 | -------------------------------------------------------------------------------- /utils/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(docbook_analitzacommands main.cpp) 2 | target_link_libraries(docbook_analitzacommands KF6::AnalitzaGui Qt::Widgets Qt::Core) 3 | -------------------------------------------------------------------------------- /utils/main.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************************* 2 | * Copyright (C) 2010 by Aleix Pol * 3 | * * 4 | * This program is free software; you can redistribute it and/or * 5 | * modify it under the terms of the GNU General Public License * 6 | * as published by the Free Software Foundation; either version 2 * 7 | * of the License, or (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the Free Software * 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 17 | *************************************************************************************/ 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | int main(int argc, char **argv) 26 | { 27 | QApplication app(argc, argv); 28 | OperatorsModel m; 29 | 30 | QFile f(app.arguments().constLast()); 31 | bool fileopened = f.open(QFile::WriteOnly); 32 | Q_ASSERT(fileopened); 33 | 34 | QTextStream str(&f); 35 | 36 | str << ""; 39 | str << "\n" 40 | "Commands supported by KAlgebra\n"; 41 | 42 | int rows = m.rowCount(), cols = m.columnCount(); 43 | QStringList colHeaders; 44 | for (int i = 0; i < cols; i++) 45 | colHeaders += m.headerData(i, Qt::Horizontal).toString(); 46 | 47 | for (int i = 0; i < rows; i++) { 48 | QString id = m.index(i, 0).data().toString(); 49 | str << "\t" << id << "\n"; 50 | for (int c = 0; c < cols; c++) 51 | str << QStringLiteral("\t\t%1: %2").arg(colHeaders[c], m.index(i, c).data().toString().toHtmlEscaped()) << '\n'; 52 | 53 | str << "\t\n"; 54 | } 55 | str << "\n"; 56 | 57 | return 0; 58 | } 59 | --------------------------------------------------------------------------------