pax_global_header00006660000000000000000000000064150771654300014522gustar00rootroot0000000000000052 comment=5eb73ca40c92ed95ef580ca6b846160f9bf12969 budgie-display-configurator/000077500000000000000000000000001507716543000164705ustar00rootroot00000000000000budgie-display-configurator/.clang-format000066400000000000000000000052301507716543000210430ustar00rootroot00000000000000--- # SPDX-FileCopyrightText: 2019 Christoph Cullmann # SPDX-FileCopyrightText: 2019 Gernot Gebhard # # SPDX-License-Identifier: MIT # This file got automatically created by ECM, do not edit # See https://clang.llvm.org/docs/ClangFormatStyleOptions.html for the config options # and https://community.kde.org/Policies/Frameworks_Coding_Style#Clang-format_automatic_code_formatting # for clang-format tips & tricks --- Language: JavaScript DisableFormat: true --- Language: Json DisableFormat: false IndentWidth: 4 --- # Style for C++ Language: Cpp # base is WebKit coding style: https://webkit.org/code-style-guidelines/ # below are only things set that diverge from this style! BasedOnStyle: WebKit # enforce C++11 (e.g. for std::vector> Standard: Cpp11 # 4 spaces indent TabWidth: 4 # 2 * 80 wide lines ColumnLimit: 160 # sort includes inside line separated groups SortIncludes: true # break before braces on function, namespace and class definitions. BreakBeforeBraces: Linux # CrlInstruction *a; PointerAlignment: Right # horizontally aligns arguments after an open bracket. AlignAfterOpenBracket: Align # don't move all parameters to new line AllowAllParametersOfDeclarationOnNextLine: false # no single line functions AllowShortFunctionsOnASingleLine: None # no single line enums AllowShortEnumsOnASingleLine: false # always break before you encounter multi line strings AlwaysBreakBeforeMultilineStrings: true # don't move arguments to own lines if they are not all on the same BinPackArguments: false # don't move parameters to own lines if they are not all on the same BinPackParameters: false # In case we have an if statement with multiple lines the operator should be at the beginning of the line # but we do not want to break assignments BreakBeforeBinaryOperators: NonAssignment # format C++11 braced lists like function calls Cpp11BracedListStyle: true # do not put a space before C++11 braced lists SpaceBeforeCpp11BracedList: false # remove empty lines KeepEmptyLinesAtTheStartOfBlocks: false # no namespace indentation to keep indent level low NamespaceIndentation: None # we use template< without space. SpaceAfterTemplateKeyword: false # Always break after template declaration AlwaysBreakTemplateDeclarations: true # macros for which the opening brace stays attached. ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH, forever, Q_FOREVER, QBENCHMARK, QBENCHMARK_ONCE , wl_resource_for_each, wl_resource_for_each_safe ] # keep lambda formatting multi-line if not empty AllowShortLambdasOnASingleLine: Empty # We do not want clang-format to put all arguments on a new line AllowAllArgumentsOnNextLine: false budgie-display-configurator/.github/000077500000000000000000000000001507716543000200305ustar00rootroot00000000000000budgie-display-configurator/.github/README.md000066400000000000000000000007461507716543000213160ustar00rootroot00000000000000# budgie-display-configurator Graphical display configuration tool for Budgie Desktop 10.10. This will be replaced in the future when daemon bits are generalized and we have a new (MDI) control panel with a pluggable architecture ## Mirror Only This is a [mirror of our codebase on the Modern Desktop Initiative forge](https://forge.moderndesktop.dev/BuddiesOfBudgie/budgie-display-configurator). Issues, pull requests, or other matters filed against this repository will be ignored.budgie-display-configurator/.gitignore000066400000000000000000000016661507716543000204710ustar00rootroot00000000000000# ---> C++ # Prerequisites *.d # Compiled Object files *.slo *.lo *.o *.obj # Precompiled Headers *.gch *.pch # Compiled Dynamic libraries *.so *.dylib *.dll # Fortran module files *.mod *.smod # Compiled Static libraries *.lai *.la *.a *.lib # Executables *.exe *.out *.app # ---> Qt # C++ objects and libs *.slo *.lo *.o *.a *.la *.lai *.so *.so.* *.dll *.dylib # Qt-es object_script.*.Release object_script.*.Debug *_plugin_import.cpp /.qmake.cache /.qmake.stash *.pro.user *.pro.user.* *.qbs.user *.qbs.user.* *.moc moc_*.cpp moc_*.h qrc_*.cpp ui_*.h *.qmlc *.jsc Makefile* *build-* *.qm *.prl # Qt unit tests target_wrapper.* # QtCreator *.autosave # QtCreator Qml *.qmlproject.user *.qmlproject.user.* # QtCreator CMake CMakeLists.txt.user* # QtCreator 4.8< compilation database compile_commands.json # QtCreator local machine specific files for imported projects *creator.user* *_qmlcache.qrc # Extras .cache # Building build/budgie-display-configurator/.vscode/000077500000000000000000000000001507716543000200315ustar00rootroot00000000000000budgie-display-configurator/.vscode/launch.json000066400000000000000000000012601507716543000221750ustar00rootroot00000000000000{ // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "type": "lldb", "request": "launch", "name": "BudgieDisplayConfigurator", "program": "${workspaceFolder}/build/bin/org.buddiesofbudgie.DisplayConfig", "args": [], "cwd": "${workspaceFolder}", "env": { "QDBUS_DEBUG": "1" }, "preLaunchTask": "build", "reverseDebugging": true } ] }budgie-display-configurator/.vscode/settings.json000066400000000000000000000006451507716543000225710ustar00rootroot00000000000000{ "files.associations": { "*.bu": "yaml", "*.css": "tailwindcss", "optional": "cpp", "charconv": "cpp", "ranges": "cpp", "ratio": "cpp", "array": "cpp", "functional": "cpp", "tuple": "cpp", "type_traits": "cpp", "utility": "cpp", "compare": "cpp", "cstdint": "cpp", "string_view": "cpp", "format": "cpp", "initializer_list": "cpp", "span": "cpp" } }budgie-display-configurator/.vscode/tasks.json000066400000000000000000000006621507716543000220550ustar00rootroot00000000000000{ // See https://go.microsoft.com/fwlink/?LinkId=733558 // for the documentation about the tasks.json format "version": "2.0.0", "tasks": [ { "label": "build", "type": "shell", "command": "go-task build", "dependsOn": "setup" }, { "label": "setup", "type": "shell", "command": "go-task setup" } ] }budgie-display-configurator/CMakeLists.txt000066400000000000000000000033631507716543000212350ustar00rootroot00000000000000# SPDX-FileCopyrightText: Budgie Desktop Developers # # SPDX-License-Identifier: MPL-2.0 cmake_minimum_required(VERSION 3.20) project(budgie-display-configurator VERSION 0.0.1) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_CXX_STANDARD 23) set(KDE_COMPILERSETTINGS_LEVEL 6.0) set(PROJECT_DEP_VERSION "6.1.80") set(QT_MIN_VERSION "6.8") set(KF6_MIN_VERSION "6.6.0") find_package(ECM ${KF6_MIN_VERSION} REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH}) include(KDEInstallDirs) include(KDECMakeSettings) include(KDEClangFormat) include(KDEGitCommitHooks) include(FeatureSummary) include(ECMSetupVersion) include(KDECompilerSettings NO_POLICY_SCOPE) include(GenerateExportHeader) include(ECMGenerateHeaders) include(ECMFindQmlModule) include(ECMQmlModule) find_package(Qt6 ${QT6_MIN_VERSION} NO_MODULE COMPONENTS Core DBus Gui Quick QuickControls2 Widgets) set_package_properties( Qt6 PROPERTIES TYPE REQUIRED PURPOSE "Basic application components") find_package( KF6 ${KF6_MIN_VERSION} COMPONENTS ColorScheme CoreAddons I18n Kirigami QQC2DesktopStyle) set_package_properties( KF6 PROPERTIES TYPE REQUIRED PURPOSE "Basic application components") set_package_properties( KF6Kirigami PROPERTIES TYPE REQUIRED PURPOSE "Kirigami application UI framework") # TODO(JoshStrobl): Add ecm_setup_version call for version setting -- uses the incldue of ECMSetupVersion add_subdirectory(src) install(TARGETS org.buddiesofbudgie.DisplayConfig ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) install(PROGRAMS org.buddiesofbudgie.DisplayConfig.desktop DESTINATION ${KDE_INSTALL_APPDIR}) feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) budgie-display-configurator/LICENSE000066400000000000000000000405271507716543000175050ustar00rootroot00000000000000Mozilla Public License Version 2.0 ================================== 1. Definitions -------------- 1.1. "Contributor" means each individual or legal entity that creates, contributes to the creation of, or owns Covered Software. 1.2. "Contributor Version" means the combination of the Contributions of others (if any) used by a Contributor and that particular Contributor's Contribution. 1.3. "Contribution" means Covered Software of a particular Contributor. 1.4. "Covered Software" means Source Code Form to which the initial Contributor has attached the notice in Exhibit A, the Executable Form of such Source Code Form, and Modifications of such Source Code Form, in each case including portions thereof. 1.5. "Incompatible With Secondary Licenses" means (a) that the initial Contributor has attached the notice described in Exhibit B to the Covered Software; or (b) that the Covered Software was made available under the terms of version 1.1 or earlier of the License, but not also under the terms of a Secondary License. 1.6. "Executable Form" means any form of the work other than Source Code Form. 1.7. "Larger Work" means a work that combines Covered Software with other material, in a separate file or files, that is not Covered Software. 1.8. "License" means this document. 1.9. "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently, any and all of the rights conveyed by this License. 1.10. "Modifications" means any of the following: (a) any file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or (b) any new file in Source Code Form that contains any Covered Software. 1.11. "Patent Claims" of a Contributor means any patent claim(s), including without limitation, method, process, and apparatus claims, in any patent Licensable by such Contributor that would be infringed, but for the grant of the License, by the making, using, selling, offering for sale, having made, import, or transfer of either its Contributions or its Contributor Version. 1.12. "Secondary License" means either the GNU General Public License, Version 2.0, the GNU Lesser General Public License, Version 2.1, the GNU Affero General Public License, Version 3.0, or any later versions of those licenses. 1.13. "Source Code Form" means the form of the work preferred for making modifications. 1.14. "You" (or "Your") means an individual or a legal entity exercising rights under this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. 2. License Grants and Conditions -------------------------------- 2.1. Grants Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license: (a) under intellectual property rights (other than patent or trademark) Licensable by such Contributor to use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit its Contributions, either on an unmodified basis, with Modifications, or as part of a Larger Work; and (b) under Patent Claims of such Contributor to make, use, sell, offer for sale, have made, import, and otherwise transfer either its Contributions or its Contributor Version. 2.2. Effective Date The licenses granted in Section 2.1 with respect to any Contribution become effective for each Contribution on the date the Contributor first distributes such Contribution. 2.3. Limitations on Grant Scope The licenses granted in this Section 2 are the only rights granted under this License. No additional rights or licenses will be implied from the distribution or licensing of Covered Software under this License. Notwithstanding Section 2.1(b) above, no patent license is granted by a Contributor: (a) for any code that a Contributor has removed from Covered Software; or (b) for infringements caused by: (i) Your and any other third party's modifications of Covered Software, or (ii) the combination of its Contributions with other software (except as part of its Contributor Version); or (c) under Patent Claims infringed by Covered Software in the absence of its Contributions. This License does not grant any rights in the trademarks, service marks, or logos of any Contributor (except as may be necessary to comply with the notice requirements in Section 3.4). 2.4. Subsequent Licenses No Contributor makes additional grants as a result of Your choice to distribute the Covered Software under a subsequent version of this License (see Section 10.2) or under the terms of a Secondary License (if permitted under the terms of Section 3.3). 2.5. Representation Each Contributor represents that the Contributor believes its Contributions are its original creation(s) or it has sufficient rights to grant the rights to its Contributions conveyed by this License. 2.6. Fair Use This License is not intended to limit any rights You have under applicable copyright doctrines of fair use, fair dealing, or other equivalents. 2.7. Conditions Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in Section 2.1. 3. Responsibilities ------------------- 3.1. Distribution of Source Form All distribution of Covered Software in Source Code Form, including any Modifications that You create or to which You contribute, must be under the terms of this License. You must inform recipients that the Source Code Form of the Covered Software is governed by the terms of this License, and how they can obtain a copy of this License. You may not attempt to alter or restrict the recipients' rights in the Source Code Form. 3.2. Distribution of Executable Form If You distribute Covered Software in Executable Form then: (a) such Covered Software must also be made available in Source Code Form, as described in Section 3.1, and You must inform recipients of the Executable Form how they can obtain a copy of such Source Code Form by reasonable means in a timely manner, at a charge no more than the cost of distribution to the recipient; and (b) You may distribute such Executable Form under the terms of this License, or sublicense it under different terms, provided that the license for the Executable Form does not attempt to limit or alter the recipients' rights in the Source Code Form under this License. 3.3. Distribution of a Larger Work You may create and distribute a Larger Work under terms of Your choice, provided that You also comply with the requirements of this License for the Covered Software. If the Larger Work is a combination of Covered Software with a work governed by one or more Secondary Licenses, and the Covered Software is not Incompatible With Secondary Licenses, this License permits You to additionally distribute such Covered Software under the terms of such Secondary License(s), so that the recipient of the Larger Work may, at their option, further distribute the Covered Software under the terms of either this License or such Secondary License(s). 3.4. Notices You may not remove or alter the substance of any license notices (including copyright notices, patent notices, disclaimers of warranty, or limitations of liability) contained within the Source Code Form of the Covered Software, except that You may alter any license notices to the extent required to remedy known factual inaccuracies. 3.5. Application of Additional Terms You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, You may do so only on Your own behalf, and not on behalf of any Contributor. You must make it absolutely clear that any such warranty, support, indemnity, or liability obligation is offered by You alone, and You hereby agree to indemnify every Contributor for any liability incurred by such Contributor as a result of warranty, support, indemnity or liability terms You offer. You may include additional disclaimers of warranty and limitations of liability specific to any jurisdiction. 4. Inability to Comply Due to Statute or Regulation --------------------------------------------------- If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Software due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be placed in a text file included with all distributions of the Covered Software under this License. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. 5. Termination -------------- 5.1. The rights granted under this License will terminate automatically if You fail to comply with any of its terms. However, if You become compliant, then the rights granted under this License from a particular Contributor are reinstated (a) provisionally, unless and until such Contributor explicitly and finally terminates Your grants, and (b) on an ongoing basis, if such Contributor fails to notify You of the non-compliance by some reasonable means prior to 60 days after You have come back into compliance. Moreover, Your grants from a particular Contributor are reinstated on an ongoing basis if such Contributor notifies You of the non-compliance by some reasonable means, this is the first time You have received notice of non-compliance with this License from such Contributor, and You become compliant prior to 30 days after Your receipt of the notice. 5.2. If You initiate litigation against any entity by asserting a patent infringement claim (excluding declaratory judgment actions, counter-claims, and cross-claims) alleging that a Contributor Version directly or indirectly infringes any patent, then the rights granted to You by any and all Contributors for the Covered Software under Section 2.1 of this License shall terminate. 5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or Your distributors under this License prior to termination shall survive termination. ************************************************************************ * * * 6. Disclaimer of Warranty * * ------------------------- * * * * Covered Software is provided under this License on an "as is" * * basis, without warranty of any kind, either expressed, implied, or * * statutory, including, without limitation, warranties that the * * Covered Software is free of defects, merchantable, fit for a * * particular purpose or non-infringing. The entire risk as to the * * quality and performance of the Covered Software is with You. * * Should any Covered Software prove defective in any respect, You * * (not any Contributor) assume the cost of any necessary servicing, * * repair, or correction. This disclaimer of warranty constitutes an * * essential part of this License. No use of any Covered Software is * * authorized under this License except under this disclaimer. * * * ************************************************************************ ************************************************************************ * * * 7. Limitation of Liability * * -------------------------- * * * * Under no circumstances and under no legal theory, whether tort * * (including negligence), contract, or otherwise, shall any * * Contributor, or anyone who distributes Covered Software as * * permitted above, be liable to You for any direct, indirect, * * special, incidental, or consequential damages of any character * * including, without limitation, damages for lost profits, loss of * * goodwill, work stoppage, computer failure or malfunction, or any * * and all other commercial damages or losses, even if such party * * shall have been informed of the possibility of such damages. This * * limitation of liability shall not apply to liability for death or * * personal injury resulting from such party's negligence to the * * extent applicable law prohibits such limitation. Some * * jurisdictions do not allow the exclusion or limitation of * * incidental or consequential damages, so this exclusion and * * limitation may not apply to You. * * * ************************************************************************ 8. Litigation ------------- Any litigation relating to this License may be brought only in the courts of a jurisdiction where the defendant maintains its principal place of business and such litigation shall be governed by laws of that jurisdiction, without reference to its conflict-of-law provisions. Nothing in this Section shall prevent a party's ability to bring cross-claims or counter-claims. 9. Miscellaneous ---------------- This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not be used to construe this License against a Contributor. 10. Versions of the License --------------------------- 10.1. New Versions Mozilla Foundation is the license steward. Except as provided in Section 10.3, no one other than the license steward has the right to modify or publish new versions of this License. Each version will be given a distinguishing version number. 10.2. Effect of New Versions You may distribute the Covered Software under the terms of the version of the License under which You originally received the Covered Software, or under the terms of any subsequent version published by the license steward. 10.3. Modified Versions If you create software not governed by this License, and you want to create a new license for such software, you may create and use a modified version of this License if you rename the license and remove any references to the name of the license steward (except to note that such modified license differs from this License). 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses If You choose to distribute Source Code Form that is Incompatible With Secondary Licenses under the terms of this version of the License, the notice described in Exhibit B of this License must be attached. Exhibit A - Source Code Form License Notice ------------------------------------------- This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice. You may add additional accurate notices of copyright ownership. Exhibit B - "Incompatible With Secondary Licenses" Notice --------------------------------------------------------- This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0. budgie-display-configurator/README.md000066400000000000000000000003461507716543000177520ustar00rootroot00000000000000# Budgie Display Configurator Graphical display configuration tool for Budgie Desktop 10.10. This will be replaced in the future when daemon bits are generalized and we have a new (MDI) control panel with a pluggable architecturebudgie-display-configurator/Taskfile.yml000066400000000000000000000010011507716543000207450ustar00rootroot00000000000000version: "3" tasks: setup: desc: "Run cmake configuration" cmds: - cmake -S . -B build -G Ninja build: desc: "Run cmake build" cmds: - cmake --build build cook: desc: "Run cmake setup and build" cmds: - task: setup - task: build fmt: aliases: [clang-format, format] desc: "Run clang-format" dir: src cmds: - clang-format -i main.cpp **/*.{cpp,hpp} install: desc: "Run ninja install" cmds: - sudo ninja install -C buildbudgie-display-configurator/org.buddiesofbudgie.DisplayConfig.desktop000066400000000000000000000002371507716543000265310ustar00rootroot00000000000000[Desktop Entry] Name=Displays (New) Exec=org.buddiesofbudgie.DisplayConfig Icon=preferences-desktop-display Type=Application Terminal=false Categories=Utility budgie-display-configurator/src/000077500000000000000000000000001507716543000172575ustar00rootroot00000000000000budgie-display-configurator/src/.clang-format000066400000000000000000000146241507716543000216410ustar00rootroot00000000000000--- Language: Cpp # BasedOnStyle: Chromium AccessModifierOffset: -1 AlignAfterOpenBracket: AlwaysBreak AlignArrayOfStructures: None AlignConsecutiveAssignments: Enabled: true AcrossEmptyLines: false AcrossComments: false AlignCompound: false PadOperators: true AlignConsecutiveBitFields: Enabled: false AcrossEmptyLines: false AcrossComments: false AlignCompound: false PadOperators: false AlignConsecutiveDeclarations: Enabled: true AcrossEmptyLines: false AcrossComments: false AlignCompound: false PadOperators: false AlignConsecutiveMacros: Enabled: true AcrossEmptyLines: false AcrossComments: false AlignCompound: false PadOperators: false AlignEscapedNewlines: Left AlignOperands: Align AlignTrailingComments: Kind: Always OverEmptyLines: 0 AllowAllArgumentsOnNextLine: false AllowAllParametersOfDeclarationOnNextLine: false AllowShortBlocksOnASingleLine: Always AllowShortCaseLabelsOnASingleLine: false AllowShortEnumsOnASingleLine: false AllowShortFunctionsOnASingleLine: Inline AllowShortIfStatementsOnASingleLine: WithoutElse AllowShortLambdasOnASingleLine: All AllowShortLoopsOnASingleLine: true AlwaysBreakAfterDefinitionReturnType: None AlwaysBreakAfterReturnType: None AlwaysBreakBeforeMultilineStrings: true AlwaysBreakTemplateDeclarations: Yes AttributeMacros: - __capability BinPackArguments: true BinPackParameters: false BitFieldColonSpacing: Both BraceWrapping: AfterCaseLabel: false AfterClass: false AfterControlStatement: Never AfterEnum: false AfterExternBlock: false AfterFunction: false AfterNamespace: false AfterObjCDeclaration: false AfterStruct: false AfterUnion: false BeforeCatch: false BeforeElse: false BeforeLambdaBody: false BeforeWhile: false IndentBraces: false SplitEmptyFunction: true SplitEmptyRecord: true SplitEmptyNamespace: true BreakAfterAttributes: Never BreakAfterJavaFieldAnnotations: false BreakArrays: true BreakBeforeBinaryOperators: None BreakBeforeConceptDeclarations: Always BreakBeforeBraces: Attach BreakBeforeInlineASMColon: OnlyMultiline BreakBeforeTernaryOperators: true BreakConstructorInitializers: BeforeColon BreakInheritanceList: BeforeColon BreakStringLiterals: true ColumnLimit: 160 CommentPragmas: "^ IWYU pragma:" CompactNamespaces: false ConstructorInitializerIndentWidth: 4 ContinuationIndentWidth: 4 Cpp11BracedListStyle: true DerivePointerAlignment: false DisableFormat: false EmptyLineAfterAccessModifier: Never EmptyLineBeforeAccessModifier: LogicalBlock ExperimentalAutoDetectBinPacking: false FixNamespaceComments: false ForEachMacros: - foreach - Q_FOREACH - BOOST_FOREACH IfMacros: - KJ_IF_MAYBE IncludeBlocks: Regroup IncludeCategories: - Regex: '^' Priority: 2 SortPriority: 0 CaseSensitive: false - Regex: '^<.*\.h>' Priority: 1 SortPriority: 0 CaseSensitive: false - Regex: "^<.*" Priority: 2 SortPriority: 0 CaseSensitive: false - Regex: ".*" Priority: 3 SortPriority: 0 CaseSensitive: false IncludeIsMainRegex: "([-_](test|unittest))?$" IncludeIsMainSourceRegex: "" IndentAccessModifiers: true IndentCaseBlocks: false IndentCaseLabels: true IndentExternBlock: AfterExternBlock IndentGotoLabels: true IndentPPDirectives: None IndentRequiresClause: true IndentWidth: 2 IndentWrappedFunctionNames: false InsertBraces: false InsertNewlineAtEOF: true InsertTrailingCommas: None IntegerLiteralSeparator: Binary: 0 BinaryMinDigits: 0 Decimal: 0 DecimalMinDigits: 0 Hex: 0 HexMinDigits: 0 JavaScriptQuotes: Leave JavaScriptWrapImports: true KeepEmptyLinesAtTheStartOfBlocks: false LambdaBodyIndentation: Signature LineEnding: LF MacroBlockBegin: "" MacroBlockEnd: "" MaxEmptyLinesToKeep: 1 NamespaceIndentation: All ObjCBinPackProtocolList: Never ObjCBlockIndentWidth: 2 ObjCBreakBeforeNestedBlockParam: true ObjCSpaceAfterProperty: false ObjCSpaceBeforeProtocolList: true PackConstructorInitializers: NextLine PenaltyBreakAssignment: 2 PenaltyBreakBeforeFirstCallParameter: 1 PenaltyBreakComment: 300 PenaltyBreakFirstLessLess: 120 PenaltyBreakOpenParenthesis: 0 PenaltyBreakString: 1000 PenaltyBreakTemplateDeclaration: 10 PenaltyExcessCharacter: 1000000 PenaltyIndentedWhitespace: 0 PenaltyReturnTypeOnItsOwnLine: 200 PointerAlignment: Left PPIndentWidth: -1 QualifierAlignment: Leave RawStringFormats: - Language: Cpp Delimiters: - cc - CC - cpp - Cpp - CPP - "c++" - "C++" CanonicalDelimiter: "" BasedOnStyle: google - Language: TextProto Delimiters: - pb - PB - proto - PROTO EnclosingFunctions: - EqualsProto - EquivToProto - PARSE_PARTIAL_TEXT_PROTO - PARSE_TEST_PROTO - PARSE_TEXT_PROTO - ParseTextOrDie - ParseTextProtoOrDie - ParseTestProto - ParsePartialTestProto CanonicalDelimiter: pb BasedOnStyle: google ReferenceAlignment: Pointer ReflowComments: true RemoveBracesLLVM: false RemoveSemicolon: false RequiresClausePosition: OwnLine RequiresExpressionIndentation: OuterScope SeparateDefinitionBlocks: Leave ShortNamespaceLines: 1 SortIncludes: CaseSensitive SortJavaStaticImport: Before SortUsingDeclarations: LexicographicNumeric SpaceAfterCStyleCast: true SpaceAfterLogicalNot: false SpaceAfterTemplateKeyword: true SpaceAroundPointerQualifiers: Default SpaceBeforeAssignmentOperators: true SpaceBeforeCaseColon: false SpaceBeforeCpp11BracedList: true SpaceBeforeCtorInitializerColon: true SpaceBeforeInheritanceColon: true SpaceBeforeParens: ControlStatements SpaceBeforeParensOptions: AfterControlStatements: true AfterForeachMacros: true AfterFunctionDefinitionName: false AfterFunctionDeclarationName: false AfterIfMacros: true AfterOverloadedOperator: false AfterRequiresInClause: false AfterRequiresInExpression: false BeforeNonEmptyParentheses: false SpaceBeforeRangeBasedForLoopColon: true SpaceBeforeSquareBrackets: false SpaceInEmptyBlock: false SpaceInEmptyParentheses: false SpacesBeforeTrailingComments: 2 SpacesInAngles: Never SpacesInConditionalStatement: false SpacesInContainerLiterals: true SpacesInCStyleCastParentheses: false SpacesInLineCommentPrefix: Minimum: 1 Maximum: -1 SpacesInParentheses: false SpacesInSquareBrackets: false Standard: Auto StatementAttributeLikeMacros: - Q_EMIT StatementMacros: - Q_UNUSED - QT_REQUIRE_VERSION TabWidth: 8 UseTab: Never WhitespaceSensitiveMacros: - BOOST_PP_STRINGIZE - CF_SWIFT_NAME - NS_SWIFT_NAME - PP_STRINGIZE - STRINGIZE --- budgie-display-configurator/src/CMakeLists.txt000066400000000000000000000014701507716543000220210ustar00rootroot00000000000000# SPDX-FileCopyrightText: Budgie Desktop Developers # # SPDX-License-Identifier: MPL-2.0 add_subdirectory(libdisplayconfig) ecm_find_qmlmodule(org.kde.kirigami REQUIRED) add_executable(org.buddiesofbudgie.DisplayConfig) ecm_add_qml_module( org.buddiesofbudgie.DisplayConfig URI "org.buddiesofbudgie.DisplayConfig" GENERATE_PLUGIN_SOURCE ) target_sources(org.buddiesofbudgie.DisplayConfig PRIVATE main.cpp ) ecm_target_qml_sources(org.buddiesofbudgie.DisplayConfig SOURCES qml/Main.qml qml/LayoutManager.qml ) target_link_libraries(org.buddiesofbudgie.DisplayConfig PRIVATE Qt6::Core Qt6::DBus Qt6::Quick Qt6::Qml Qt6::Gui Qt6::QuickControls2 Qt6::Widgets KF6::ColorScheme KF6::CoreAddons KF6::I18n KF6::I18nQml libdisplayconfig ) budgie-display-configurator/src/libdisplayconfig/000077500000000000000000000000001507716543000226015ustar00rootroot00000000000000budgie-display-configurator/src/libdisplayconfig/CMakeLists.txt000066400000000000000000000020761507716543000253460ustar00rootroot00000000000000# SPDX-FileCopyrightText: Budgie Desktop Developers # # SPDX-License-Identifier: MPL-2.0 set(backend_SRCS) qt_add_dbus_interface(backend_SRCS dbus/schemas/DisplaySchema.BatchSystem.xml BatchSystemInterface) qt_add_dbus_interface(backend_SRCS dbus/schemas/DisplaySchema.Displays.xml DisplaysInterface) qt_add_dbus_interface(backend_SRCS dbus/schemas/DisplaySchema.Output.xml OutputInterface) qt_add_dbus_interface(backend_SRCS dbus/schemas/DisplaySchema.OutputMode.xml OutputModeInterface) add_library( libdisplayconfig STATIC backend.cpp backend.hpp enums/connectionstate.hpp layout.cpp layout.hpp models/layoutmodel.cpp models/layoutmodel.hpp models/outputmodel.cpp models/outputmodel.hpp output/output.cpp output/output.hpp ${backend_SRCS} ) generate_export_header(libdisplayconfig BASE_NAME LibDisplayConfig) target_include_directories(libdisplayconfig PRIVATE ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/enums ${CMAKE_CURRENT_SOURCE_DIR}/models) target_link_libraries(libdisplayconfig PRIVATE Qt::Core Qt::DBus Qt::Qml) budgie-display-configurator/src/libdisplayconfig/backend.cpp000066400000000000000000000045621507716543000247030ustar00rootroot00000000000000// SPDX-FileCopyrightText: Budgie Desktop Developers // SPDX-License-Identifier: MPL-2.0 #include "backend.hpp" #include #include #include #include "DisplaysInterface.h" Backend::Backend(QObject* parent) : QObject(parent) { qInfo() << "Initializing backend"; m_connection = QSharedPointer(new QDBusConnection(QDBusConnection::sessionBus())); if (!QDBusConnection::sessionBus().isConnected()) { qCritical() << "Failed to connect to session bus"; setConnectionState(ConnectionState::Failed); return; } qInfo() << "Connected to session bus"; m_outputs = new OutputModel(this); m_layout = new Layout(this); connect(); } Backend::~Backend() = default; void Backend::connect() { qInfo() << "Connecting to displays interface"; auto iface = new org::buddiesofbudgie::BudgieDaemon::Displays( QStringLiteral("org.buddiesofbudgie.BudgieDaemon"), QStringLiteral("/org/buddiesofbudgie/BudgieDaemon/Displays"), *m_connection.data(), this); if (!iface->isValid()) { qInfo() << "Failed to get displays interface"; setConnectionState(ConnectionState::Failed); return; } qInfo() << "Connected to displays interface"; m_layout->connect(iface); setConnectionState(ConnectionState::Connected); auto reply = iface->GetPrimaryOutput(); if (reply.isError()) { qInfo() << "Failed to get primary output"; setConnectionState(ConnectionState::Failed); return; } qInfo() << "Primary output: " << reply.value(); auto outputsReply = iface->GetAvailableOutputs(); outputsReply.waitForFinished(); if (!outputsReply.isError()) { const auto ids = outputsReply.value(); for (const auto& id : ids) { auto output = new Output(this, id); output->init(m_connection); auto sharedOutput = QSharedPointer(output); m_outputs->addOutput(sharedOutput); m_layout->addOutput(sharedOutput); } } else { qWarning() << "GetAvailableOutputs error:" << outputsReply.error(); } } ConnectionState::State Backend::connectionState() const { return m_connectionState; } OutputModel* Backend::outputs() const { return m_outputs; } Layout* Backend::layout() const { return m_layout; } void Backend::setConnectionState(ConnectionState::State daemonConnectionState) { m_connectionState = daemonConnectionState; Q_EMIT connectionStateChanged(); } budgie-display-configurator/src/libdisplayconfig/backend.hpp000066400000000000000000000024521507716543000247040ustar00rootroot00000000000000// SPDX-FileCopyrightText: Budgie Desktop Developers // SPDX-License-Identifier: MPL-2.0 #pragma once #include #include #include "enums/connectionstate.hpp" #include "layout.hpp" #include "models/outputmodel.hpp" class Backend : public QObject { Q_OBJECT Q_PROPERTY(ConnectionState::State connectionState READ connectionState NOTIFY connectionStateChanged) Q_PROPERTY(OutputModel* outputs READ outputs NOTIFY outputsChanged) Q_PROPERTY(Layout* layout READ layout NOTIFY layoutChanged) public: explicit Backend(QObject* parent = nullptr); ~Backend() override; void connect(); OutputModel* outputs() const; Layout* layout() const; ConnectionState::State connectionState() const; Q_SIGNALS: void connectionStateChanged(); void outputsChanged(); void layoutChanged(); public Q_SLOTS: void setConnectionState(ConnectionState::State connectionState); private: ConnectionState::State m_connectionState = ConnectionState::Disconnected; QSharedPointer m_connection = QSharedPointer(new QDBusConnection(QDBusConnection::sessionBus())); OutputModel* m_outputs; Layout* m_layout; }; budgie-display-configurator/src/libdisplayconfig/dbus/000077500000000000000000000000001507716543000235365ustar00rootroot00000000000000budgie-display-configurator/src/libdisplayconfig/dbus/schemas/000077500000000000000000000000001507716543000251615ustar00rootroot00000000000000budgie-display-configurator/src/libdisplayconfig/dbus/schemas/DisplaySchema.BatchSystem.xml000066400000000000000000000047241507716543000326650ustar00rootroot00000000000000 budgie-display-configurator/src/libdisplayconfig/dbus/schemas/DisplaySchema.Displays.xml000066400000000000000000000016621507716543000322250ustar00rootroot00000000000000 budgie-display-configurator/src/libdisplayconfig/dbus/schemas/DisplaySchema.Output.xml000066400000000000000000000046071507716543000317370ustar00rootroot00000000000000 budgie-display-configurator/src/libdisplayconfig/dbus/schemas/DisplaySchema.OutputMode.xml000066400000000000000000000016711507716543000325420ustar00rootroot00000000000000 budgie-display-configurator/src/libdisplayconfig/enums/000077500000000000000000000000001507716543000237305ustar00rootroot00000000000000budgie-display-configurator/src/libdisplayconfig/enums/connectionstate.hpp000066400000000000000000000013301507716543000276360ustar00rootroot00000000000000// SPDX-FileCopyrightText: Budgie Desktop Developers // SPDX-License-Identifier: MPL-2.0 #pragma once #include #include /** * @class ConnectionState * * This class defines the DaemonConnectionState enumeration. */ class ConnectionState : public QObject { Q_OBJECT QML_ELEMENT QML_UNCREATABLE("") public: /** * @brief The connection states of the Daemon. */ enum State { Failed = 0, /**< Failed state. */ Disconnected, /**< Disconnected from the daemon. */ Connecting, /**< Connecting to the daemon. */ Connected, /**< Connected to the daemon. */ Disconnecting /**< Disconnecting from the daemon. */ }; Q_ENUM(State); }; budgie-display-configurator/src/libdisplayconfig/layout.cpp000066400000000000000000000027711507716543000246310ustar00rootroot00000000000000// SPDX-FileCopyrightText: Budgie Desktop Developers // SPDX-License-Identifier: MPL-2.0 #include "layout.hpp" Layout::Layout(QObject* parent) : QObject(parent) { m_model = new LayoutModel(this); } Layout::~Layout() = default; void Layout::connect(org::buddiesofbudgie::BudgieDaemon::Displays* displaysInterface) { m_displaysInterface = displaysInterface; QObject::connect(m_model, &LayoutModel::orderChanged, this, &Layout::layoutOrderChanged); setGlobalRect(); } QRect Layout::globalRect() const { return m_globalRect; } LayoutModel* Layout::model() const { return m_model; } void Layout::addOutput(QSharedPointer output) { m_model->addOutput(output); } int Layout::selectedIndex() const { return m_selectedIndex; } QString Layout::selectedSerial() const { return m_selectedSerial; } void Layout::setGlobalRect() { auto globalRectReply = m_displaysInterface->GetGlobalRect(); if (globalRectReply.isError()) return; auto rect = globalRectReply.value(); m_globalRect = QRect( rect[QStringLiteral("X")].toInt(), rect[QStringLiteral("Y")].toInt(), rect[QStringLiteral("Width")].toInt(), rect[QStringLiteral("Height")].toInt()); Q_EMIT globalRectChanged(); } void Layout::setSelectedIndex(int index) { if (m_selectedIndex == index) { return; } m_selectedIndex = index; Q_EMIT selectedIndexChanged(); } void Layout::setSelectedSerial(const QString& serial) { if (m_selectedSerial == serial) { return; } m_selectedSerial = serial; Q_EMIT selectedSerialChanged(); } budgie-display-configurator/src/libdisplayconfig/layout.hpp000066400000000000000000000033141507716543000246300ustar00rootroot00000000000000// SPDX-FileCopyrightText: Budgie Desktop Developers // SPDX-License-Identifier: MPL-2.0 #pragma once #include #include #include "DisplaysInterface.h" #include "models/layoutmodel.hpp" class Layout : public QObject { Q_OBJECT Q_PROPERTY(LayoutModel* model READ model NOTIFY modelChanged) Q_PROPERTY(int selectedIndex READ selectedIndex WRITE setSelectedIndex NOTIFY selectedIndexChanged) Q_PROPERTY(QString selectedSerial READ selectedSerial WRITE setSelectedSerial NOTIFY selectedSerialChanged) Q_PROPERTY(QRect globalRect READ globalRect NOTIFY globalRectChanged) public: explicit Layout(QObject* parent = nullptr); ~Layout() override; void connect(org::buddiesofbudgie::BudgieDaemon::Displays* displaysInterface); QRect globalRect() const; LayoutModel* model() const; int selectedIndex() const; QString selectedSerial() const; // Population helper void addOutput(QSharedPointer output); Q_SIGNALS: void globalRectChanged(); void modelChanged(); void selectedIndexChanged(); void selectedSerialChanged(); // Emitted when the visual order changes due to drag-reorder void layoutOrderChanged(const QStringList& order); public Q_SLOTS: void setSelectedIndex(int index); void setSelectedSerial(const QString& serial); private: void setGlobalRect(); LayoutModel* m_model; org::buddiesofbudgie::BudgieDaemon::Displays* m_displaysInterface; QRect m_globalRect; int m_selectedIndex = -1; QString m_selectedSerial; }; budgie-display-configurator/src/libdisplayconfig/models/000077500000000000000000000000001507716543000240645ustar00rootroot00000000000000budgie-display-configurator/src/libdisplayconfig/models/layoutmodel.cpp000066400000000000000000000034361507716543000271340ustar00rootroot00000000000000// SPDX-FileCopyrightText: Budgie Desktop Developers // SPDX-License-Identifier: MPL-2.0 #include "layoutmodel.hpp" LayoutModel::LayoutModel(QObject* parent) : QAbstractListModel(parent) {} LayoutModel::~LayoutModel() = default; int LayoutModel::rowCount(const QModelIndex& parent) const { Q_UNUSED(parent); return m_items.size(); } QVariant LayoutModel::data(const QModelIndex& index, int role) const { if (!index.isValid() || index.row() < 0 || index.row() >= m_items.size()) { return QVariant(); } const auto output = m_items[index.row()].data(); switch (role) { case SerialRole: return output->serial(); case NameRole: return output->name(); case GeometryRole: return output->geometry(); default: return QVariant(); } } QHash LayoutModel::roleNames() const { QHash roles; roles[SerialRole] = "serial"; roles[NameRole] = "name"; roles[GeometryRole] = "geometry"; return roles; } void LayoutModel::addOutput(QSharedPointer output) { beginInsertRows(QModelIndex(), m_items.size(), m_items.size()); m_items.append(output); endInsertRows(); Q_EMIT orderChanged(currentOrder()); } void LayoutModel::moveItem(int from, int to) { if (from == to) { return; } if (from < 0 || from >= m_items.size() || to < 0 || to >= m_items.size()) { return; } const int sourceRow = from; const int destinationRow = to > from ? to + 1 : to; beginMoveRows(QModelIndex(), sourceRow, sourceRow, QModelIndex(), destinationRow); m_items.move(from, to); endMoveRows(); Q_EMIT orderChanged(currentOrder()); } QStringList LayoutModel::currentOrder() const { QStringList order; order.reserve(m_items.size()); for (const auto& item : m_items) { order.append(item->serial()); } return order; } budgie-display-configurator/src/libdisplayconfig/models/layoutmodel.hpp000066400000000000000000000017621507716543000271410ustar00rootroot00000000000000// SPDX-FileCopyrightText: Budgie Desktop Developers // SPDX-License-Identifier: MPL-2.0 #pragma once #include #include #include #include "output/output.hpp" class LayoutModel : public QAbstractListModel { Q_OBJECT public: explicit LayoutModel(QObject* parent = nullptr); ~LayoutModel() override; int rowCount(const QModelIndex& parent = QModelIndex()) const override; QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; QHash roleNames() const override; void addOutput(QSharedPointer output); Q_INVOKABLE void moveItem(int from, int to); QStringList currentOrder() const; enum Roles { SerialRole = Qt::UserRole + 1, NameRole, GeometryRole, }; Q_ENUM(Roles) Q_SIGNALS: void orderChanged(const QStringList& order); private: QList> m_items; }; budgie-display-configurator/src/libdisplayconfig/models/outputmodel.cpp000066400000000000000000000021001507716543000271420ustar00rootroot00000000000000// SPDX-FileCopyrightText: Budgie Desktop Developers // SPDX-License-Identifier: MPL-2.0 #include "outputmodel.hpp" OutputModel::OutputModel(QObject* parent) : QAbstractListModel(parent) {} OutputModel::~OutputModel() = default; void OutputModel::addOutput(QSharedPointer output) { beginInsertRows(QModelIndex(), m_outputs.size(), m_outputs.size()); m_outputs.append(output); endInsertRows(); } int OutputModel::rowCount(const QModelIndex& parent) const { Q_UNUSED(parent); return m_outputs.size(); } QVariant OutputModel::data(const QModelIndex& index, int role) const { Q_UNUSED(role); auto output = m_outputs[index.row()].data(); switch (role) { case SerialRole: return output->serial(); case NameRole: return output->name(); case GeometryRole: return output->geometry(); default: return QVariant(); } } QHash OutputModel::roleNames() const { QHash roles; roles[SerialRole] = "serial"; roles[NameRole] = "name"; roles[GeometryRole] = "geometry"; return roles; } budgie-display-configurator/src/libdisplayconfig/models/outputmodel.hpp000066400000000000000000000014611507716543000271600ustar00rootroot00000000000000// SPDX-FileCopyrightText: Budgie Desktop Developers // SPDX-License-Identifier: MPL-2.0 #pragma once #include #include "output/output.hpp" class OutputModel : public QAbstractListModel { Q_OBJECT public: explicit OutputModel(QObject* parent = nullptr); ~OutputModel() override; void addOutput(QSharedPointer output); int rowCount(const QModelIndex& parent = QModelIndex()) const override; QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; QHash roleNames() const override; enum Roles { SerialRole = Qt::UserRole + 1, NameRole, GeometryRole, }; Q_ENUM(Roles) private: QList> m_outputs; }; budgie-display-configurator/src/libdisplayconfig/output/000077500000000000000000000000001507716543000241415ustar00rootroot00000000000000budgie-display-configurator/src/libdisplayconfig/output/output.cpp000066400000000000000000000032161507716543000262070ustar00rootroot00000000000000// SPDX-FileCopyrightText: Budgie Desktop Developers // SPDX-License-Identifier: MPL-2.0 #include "output.hpp" Output::Output(QObject* parent, QString serial) : QObject(parent), m_serial(serial) {} Output::~Output() = default; void Output::onPropertyChanged(const QString& property, const QDBusVariant& value) { if (property == QStringLiteral("name")) { m_name = value.variant().toString(); Q_EMIT nameChanged(); } else if (property == QStringLiteral("geometry")) { m_geometry = value.variant().toRect(); Q_EMIT geometryChanged(); } } void Output::init(QSharedPointer connection) { const auto path = QStringLiteral("/org/buddiesofbudgie/BudgieDaemon/Displays/Outputs/%1").arg(m_serial); auto output = new org::buddiesofbudgie::BudgieDaemon::Output(QStringLiteral("org.buddiesofbudgie.BudgieDaemon"), path, *connection.data(), this); if (!output->isValid()) { qWarning() << "Output interface invalid for" << m_serial << "at" << path; m_output.clear(); return; } qInfo() << "Output interface valid for" << m_serial << "at" << path; m_output = QSharedPointer(output); connect(m_output.data(), &org::buddiesofbudgie::BudgieDaemon::Output::PropertyChanged, this, &Output::onPropertyChanged); } QRect Output::geometry() const { if (!m_output->isValid()) { return QRect(); } return QRect(m_output->x(), m_output->y(), m_output->width(), m_output->height()); } QString Output::name() const { return m_output->isValid() ? m_output->name() : QString(); } QString Output::serial() const { return m_output->isValid() ? m_output->serial() : QString(); } budgie-display-configurator/src/libdisplayconfig/output/output.hpp000066400000000000000000000017741507716543000262230ustar00rootroot00000000000000// SPDX-FileCopyrightText: Budgie Desktop Developers // SPDX-License-Identifier: MPL-2.0 #pragma once #include #include #include "OutputInterface.h" class Output : public QObject { Q_OBJECT Q_PROPERTY(QString serial READ serial NOTIFY serialChanged) Q_PROPERTY(QString name READ name NOTIFY nameChanged) Q_PROPERTY(QRect geometry READ geometry NOTIFY geometryChanged) public: explicit Output(QObject* parent = nullptr, QString serial = QString()); ~Output() override; QString serial() const; QString name() const; QRect geometry() const; void init(QSharedPointer connection); Q_SIGNALS: void serialChanged(); void nameChanged(); void geometryChanged(); public Q_SLOTS: void onPropertyChanged(const QString& property, const QDBusVariant& value); private: QString m_name; QRect m_geometry; QString m_serial; QSharedPointer m_output; }; budgie-display-configurator/src/main.cpp000066400000000000000000000067211507716543000207150ustar00rootroot00000000000000// SPDX-FileCopyrightText: Budgie Desktop Developers // SPDX-License-Identifier: MPL-2.0 #include #include #include #include #include #include #include #include #include #include #include "libdisplayconfig/backend.hpp" int main(int argc, char* argv[]) { qSetMessagePattern(QStringLiteral("[%{type}] %{if-debug}[%{file}:%{line} %{function}]%{endif}%{message}")); // Hardcoded (can be overridden using QT_LOGGING_RULES) so we can have a bunch of logging // But then filter out noise from QML / scenegraph QLoggingCategory::defaultCategory()->setEnabled(QtMsgType::QtDebugMsg, true); QLoggingCategory::defaultCategory()->setEnabled(QtMsgType::QtInfoMsg, true); QLoggingCategory::defaultCategory()->setEnabled(QtMsgType::QtWarningMsg, true); QLoggingCategory::defaultCategory()->setEnabled(QtMsgType::QtCriticalMsg, true); QLoggingCategory::defaultCategory()->setEnabled(QtMsgType::QtFatalMsg, true); QLoggingCategory::defaultCategory()->setFilterRules(QStringLiteral("*.debug=true")); QLoggingCategory::defaultCategory()->setFilterRules(QStringLiteral("qt.scenegraph.general=false")); // KIconTheme::initTheme(); KLocalizedString::setApplicationDomain("budgie-display-configurator"); QApplication::setOrganizationName(QStringLiteral("Buddies of Budgie")); QApplication::setOrganizationDomain(QStringLiteral("buddiesofbudgie.org")); QGuiApplication::setDesktopFileName(QStringLiteral("org.buddiesofbudgie.DisplayConfig")); QApplication app(argc, argv); QApplication::setWindowIcon(QIcon::fromTheme(QStringLiteral("preferences-desktop-display"))); if (qEnvironmentVariableIsEmpty("QT_QUICK_CONTROLS_STYLE")) { QQuickStyle::setStyle(QStringLiteral("org.kde.desktop")); } // #region Set up about data // Do explicit calls instead of constructing with all args // Makes it clearer what arg maps to what param KAboutData aboutData; aboutData.setComponentName(QStringLiteral("budgie-display-configurator")); aboutData.setVersion("0.1.0"); aboutData.setShortDescription(i18n("Display configurator for Budgie Desktop")); aboutData.setLicense(KAboutLicense::MPL_V2); aboutData.setCopyrightStatement(QStringLiteral("(c) 2025 Buddies of Budgie")); aboutData.setHomepage(QStringLiteral("https://buddiesofbudgie.org")); aboutData.setBugAddress("https://forge.moderndesktop.dev/BuddiesOfBudgie/budgie-display-configurator"); aboutData.addAuthor(QStringLiteral("Joshua Strobl"), i18n("Maintainer"), QStringLiteral("me@joshuastrobl.com"), QStringLiteral("https://joshuastrobl.com")); KAboutData::setApplicationData(aboutData); qmlRegisterSingletonType("org.buddiesofbudgie.DisplayConfig", 1, 0, "About", [](QQmlEngine* engine, QJSEngine*) -> QJSValue { return engine->toScriptValue(KAboutData::applicationData()); }); // #endregion // #region Set up backend Backend backend; qmlRegisterSingletonInstance("org.buddiesofbudgie.DisplayConfig", 1, 0, "Backend", &backend); // #endregion // KColorSchemeManager::instance(); QQmlApplicationEngine engine; auto ctx = new KLocalizedQmlContext(&engine); engine.rootContext()->setContextObject(ctx); QQmlEngine::setContextForObject(ctx, engine.rootContext()); engine.loadFromModule("org.buddiesofbudgie.DisplayConfig", "Main"); if (engine.rootObjects().isEmpty()) { return EXIT_FAILURE; } return app.exec(); } budgie-display-configurator/src/qml/000077500000000000000000000000001507716543000200505ustar00rootroot00000000000000budgie-display-configurator/src/qml/LayoutManager.qml000066400000000000000000000046101507716543000233340ustar00rootroot00000000000000// SPDX-FileCopyrightText: Budgie Desktop Developers // SPDX-License-Identifier: MPL-2.0 import QtQuick import QtQuick.Layouts import org.kde.kirigami as Kirigami Rectangle { Kirigami.Theme.colorSet: Kirigami.Theme.Window color: Kirigami.Theme.alternateBackgroundColor width: (Backend.layout.globalRect.width * 0.10) + (Kirigami.Units.largeSpacing * 2) height: (Backend.layout.globalRect.height * 0.10) + (Kirigami.Units.largeSpacing * 2) radius: Kirigami.Units.cornerRadius Component { id: outputDelegate Item { required property string serial required property string name required property rect geometry height: geometry.height * 0.10 width: geometry.width * 0.10 Rectangle { id: serial Kirigami.Theme.colorSet: Kirigami.Theme.Selection color: Kirigami.Theme.disabledTextColor radius: Kirigami.Units.cornerRadius height: geometry.height * 0.10 width: geometry.width * 0.10 x: geometry.x * 0.10 y: geometry.y * 0.10 ColumnLayout { anchors.fill: parent Kirigami.Heading { Layout.fillWidth: true horizontalAlignment: Text.AlignHCenter level: 1 Kirigami.Theme.inherit: true color: Kirigami.Theme.textColor text: name + " (" + serial + ")" } Kirigami.Heading { Layout.fillWidth: true horizontalAlignment: Text.AlignHCenter text: geometry.width + "x" + geometry.height } } } } } GridView { id: grid cellWidth: 100 cellHeight: 100 anchors.fill: parent anchors.margins: Kirigami.Units.largeSpacing width: parent.width height: parent.height model: Backend.layout.model delegate: outputDelegate highlight: Rectangle { Kirigami.Theme.colorSet: Kirigami.Theme.Selection Kirigami.Theme.inherit: false color: Kirigami.Theme.highlightColor radius: Kirigami.Units.cornerRadius } } } budgie-display-configurator/src/qml/Main.qml000066400000000000000000000010241507716543000214440ustar00rootroot00000000000000// SPDX-FileCopyrightText: Budgie Desktop Developers // SPDX-License-Identifier: MPL-2.0 import QtQuick import QtQuick.Layouts import QtQuick.Controls as Controls import org.kde.kirigami as Kirigami import org.buddiesofbudgie.DisplayConfig Kirigami.ApplicationWindow { id: root width: 400 height: 300 controlsVisible: false title: i18nc("@title:window", "Displays") pageStack.initialPage: Kirigami.Page { ColumnLayout { id: rootLayout LayoutManager {} } } }