diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..8f1db95565484a3d2bd403ab511f8f63c733bf85 --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +# Ignore the following files +.vscode +/build*/ +/cmake-build* +*.user +*.qm +CMakeLists.txt.user* + +# debian files +obj-*-linux-gnu/ diff --git a/CMakeLists.txt b/CMakeLists.txt index bf089b547a3d2ce9bb2bc32a3d7502bfb145f18d..be68b125186eed2b59d80d0fa6392e32f62ef5c8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.16) project(ukui-window-switch) @@ -11,18 +11,13 @@ find_package(KF5WindowSystem REQUIRED) get_target_property(QT_QMAKE_EXECUTABLE ${Qt5Core_QMAKE_EXECUTABLE} IMPORTED_LOCATION) macro(query_qmake args output) - exec_program(${QT_QMAKE_EXECUTABLE} ARGS -query ${args} OUTPUT_VARIABLE ${output} RETURN_VALUE exitCode) - - if(NOT ${exitCode} EQUAL 0) + execute_process(COMMAND ${QT_QMAKE_EXECUTABLE} -query ${args} OUTPUT_VARIABLE ${output} RESULT_VARIABLE test1 RESULT_VARIABLE result OUTPUT_STRIP_TRAILING_WHITESPACE) + if(NOT ${result} EQUAL 0) message(FATAL_ERROR "exec ${QT_QMAKE_EXECUTABLE} failed, with args: ${args}, error message: ${output}") endif() endmacro() query_qmake("QT_INSTALL_PLUGINS" QT_INSTALL_PLUGINS) -message("QT_INSTALL_PLUGINS=${QT_INSTALL_PLUGINS}") - -set(INSTALL_PATH "${QT_INSTALL_PLUGINS}/kwin/effects/plugins") - add_subdirectory(windowsview) -add_subdirectory(windowswitchers) +#add_subdirectory(windowswitchers) diff --git a/CMakeLists.txt.user b/CMakeLists.txt.user deleted file mode 100644 index c0d1b08a476e054074d42d94f2d6816284074f51..0000000000000000000000000000000000000000 --- a/CMakeLists.txt.user +++ /dev/null @@ -1,497 +0,0 @@ - - - - - - EnvironmentId - {6953e0c1-7dc6-486f-8ffd-28db0c8992aa} - - - ProjectExplorer.Project.ActiveTarget - 0 - - - ProjectExplorer.Project.EditorSettings - - true - false - true - - Cpp - - CppGlobal - - - - QmlJS - - QmlJSGlobal - - - 2 - UTF-8 - false - 4 - false - 80 - true - true - 1 - true - false - 0 - true - true - 0 - 8 - true - 1 - true - true - true - false - - - - ProjectExplorer.Project.PluginSettings - - - - ProjectExplorer.Project.Target.0 - - Desktop - Desktop - {76092915-5083-4ddc-9112-1cc8c92827c9} - 0 - 0 - 0 - - - CMAKE_BUILD_TYPE:STRING=Debug - CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx} - CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C} - CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX} - QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable} - - /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/build-ukui-kwin-effects-Desktop-Debug - - - - - all - - true - CMakeProjectManager.MakeStep - - 1 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - - - clean - - true - CMakeProjectManager.MakeStep - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - CMakeProjectManager.CMakeBuildConfiguration - - 1 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - - ProjectExplorer.CustomExecutableRunConfiguration - - - false - - false - true - false - false - true - - - - 1 - - - - ProjectExplorer.Project.Target.1 - - Imported Kit - Imported Kit - {504d3be3-6b2d-4db5-a195-1080fa7a925c} - 0 - 0 - 0 - - - CMAKE_BUILD_TYPE:STRING=Debug - CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx} - CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C} - CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX} - QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable} - - /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/ukui-kwin-effects/build - - - - - all - - true - CMakeProjectManager.MakeStep - - 1 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - - - clean - - true - CMakeProjectManager.MakeStep - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - CMakeProjectManager.CMakeBuildConfiguration - - 1 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - - ProjectExplorer.CustomExecutableRunConfiguration - - - false - - false - true - false - false - true - - - - 1 - - - - ProjectExplorer.Project.Target.2 - - Imported Kit - Imported Kit - {4f89b1b7-3b43-4d7e-bd95-6122966b238a} - 0 - 0 - 0 - - - CMAKE_BUILD_TYPE:STRING=Build - CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx} - CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C} - CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX} - QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable} - - /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/ukui-kwin-effects/buildm - - - - - all - - true - CMakeProjectManager.MakeStep - - 1 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - - - clean - - true - CMakeProjectManager.MakeStep - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Build - CMakeProjectManager.CMakeBuildConfiguration - - 1 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - - ProjectExplorer.CustomExecutableRunConfiguration - - - false - - false - true - false - false - true - - - - 1 - - - - ProjectExplorer.Project.TargetCount - 3 - - - ProjectExplorer.Project.Updater.FileVersion - 22 - - - Version - 22 - - diff --git a/COPYING b/COPYING new file mode 100644 index 0000000000000000000000000000000000000000..5bc8fb2c8f757e34a0d8f4644f589d57609e213f --- /dev/null +++ b/COPYING @@ -0,0 +1,481 @@ + GNU LIBRARY GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1991 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the library GPL. It is + numbered 2 because it goes with version 2 of the ordinary GPL.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Library General Public License, applies to some +specially designated Free Software Foundation software, and to any +other libraries whose authors decide to use it. You can use it for +your libraries, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if +you distribute copies of the library, or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link a program with the library, you must provide +complete object files to the recipients so that they can relink them +with the library, after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + Our method of protecting your rights has two steps: (1) copyright +the library, and (2) offer you this license which gives you legal +permission to copy, distribute and/or modify the library. + + Also, for each distributor's protection, we want to make certain +that everyone understands that there is no warranty for this free +library. If the library is modified by someone else and passed on, we +want its recipients to know that what they have is not the original +version, so that any problems introduced by others will not reflect on +the original authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that companies distributing free +software will individually obtain patent licenses, thus in effect +transforming the program into proprietary software. To prevent this, +we have made it clear that any patent must be licensed for everyone's +free use or not licensed at all. + + Most GNU software, including some libraries, is covered by the ordinary +GNU General Public License, which was designed for utility programs. This +license, the GNU Library General Public License, applies to certain +designated libraries. This license is quite different from the ordinary +one; be sure to read it in full, and don't assume that anything in it is +the same as in the ordinary license. + + The reason we have a separate public license for some libraries is that +they blur the distinction we usually make between modifying or adding to a +program and simply using it. Linking a program with a library, without +changing the library, is in some sense simply using the library, and is +analogous to running a utility program or application program. However, in +a textual and legal sense, the linked executable is a combined work, a +derivative of the original library, and the ordinary General Public License +treats it as such. + + Because of this blurred distinction, using the ordinary General +Public License for libraries did not effectively promote software +sharing, because most developers did not use the libraries. We +concluded that weaker conditions might promote sharing better. + + However, unrestricted linking of non-free programs would deprive the +users of those programs of all benefit from the free status of the +libraries themselves. This Library General Public License is intended to +permit developers of non-free programs to use free libraries, while +preserving your freedom as a user of such programs to change the free +libraries that are incorporated in them. (We have not seen how to achieve +this as regards changes in header files, but we have achieved it as regards +changes in the actual functions of the Library.) The hope is that this +will lead to faster development of free libraries. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, while the latter only +works together with the library. + + Note that it is possible for a library to be covered by the ordinary +General Public License rather than by this special one. + + GNU LIBRARY GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library which +contains a notice placed by the copyright holder or other authorized +party saying it may be distributed under the terms of this Library +General Public License (also called "this License"). Each licensee is +addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also compile or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + c) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + d) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the source code distributed need not include anything that is normally +distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Library General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! diff --git a/README.md b/README.md index bd962edbd61153e921a8d03e9cff494a5c77c0b0..8437e4dfce3ce91be000c087bf60f3c487993a90 100644 --- a/README.md +++ b/README.md @@ -1,83 +1,99 @@ -# ukui-kwin-effects -![build](http://gitlab2.kylin.com/kylin-desktop/ukui-kwin-effects/-/tree/master) -Multitask view runs in Kylin system. +# ukui-window-switch -[Badges] +ukui-window-switch is a MultitaskView runs in Kylin Operating System. ## Introduction -For diversified adaptation, Multitask view is divided into two versions: PC version and TM version. -[PC version] - Multitask view provides a convenient and fast interactive interface, which can make it convenient for users to switch virtual desktop and find the desired window, so as to improve users' production efficiency and work efficiency. -[TM version] - Multitask view is convenient for users to manage the opened windows and improve the sense of interactive experience through different dynamic effects. In the tablet mode, you can control the wake-up and closing of the window, which is the necessary path to close the application in the tablet mode. - -### Features -Common features of multitask views: - 1. Load as a plugin of ukui-kwin; - 2. It is necessary to turn on the compositor; -[PC version] - The following are the features of the multitask view in PC mode: + +MultitaskView supports both PC and Pad. + + - PC + + MultitaskView provides a convenient and fast interactive interface, which makes it convenient to switch between virtual desktops and locate the window you want, so as to improve your production efficiency and working efficiency. + + - Pad + + MultitaskView is convenient to manage the opened windows, it also improves interactive experience through different animations. In Pad mode, you can choose to wake up or close any windows shown in MultitaskView. + +## Features + +Common features of multitaskView: + + 1. Loaded as a plugin of kwin; + 2. Run with compositor; + + - PC + + The following are the features of the MultitaskView in PC mode: 1. Add the functions of creating, deleting, exchanging virtual desktop and managing window content in virtual desktop; 2. The window is of equal height and slides up and down, and one line places the window with the greatest possibility; 3. Support small window dragging to different virtual desktops; 4. Dual screen mode adaptation; -[TM version] + + - Pad + 1. Display the contents of the window with equal height and width, and can only slide left and right; 2. Add all clear function; 3. Support sliding up, closing, arousing, closing, arousing and other dynamic effects; 4. Adapt to different system modes and desktop states; + ## Requirements -Please use the version after 0430 for ukui panel and ukui kwin. + +Please use the version after 0430 for ukui panel and kwin. ## Installation -Obtain the package (ukui-kwin-effects) of multitask view from the warehouse source and execute "sudo apt install ukui-kwin-effects". + +Obtain the package (ukui-window-switch) of MultitaskView from the warehouse source and execute "sudo apt install ukui-window-switch". + Please ensure that the installed version meets the installation conditions of the new version!!!! ## Usage [Open operation mode] - 1. Slide from the bottom of the screen to bring up the multitask view; - 2. Click the second button on the left side of the taskbar to evoke the multitask view; - 3. Win + Tab shortcut key evokes multitask view; + 1. Slide from the bottom of the screen to bring up the MultitaskView; + 2. Click the second button on the left side of the taskbar to evoke the MultitaskView; + 3. Win + Tab shortcut key evokes MultitaskView; [Close operation mode] - 1. When the multitask view is open, click ESC to close the multitask view; - 2. When the multitask view is open, click the blank space of the multitask view to close the multitask view; - 3. When the multitask view is open, use the shortcut key "menu + Tab" to close the multitask view; - 4. In PC mode only and multitask view is on, click virtual desktop to close multitask view; - 5. When the multitask view is open, click the thumbnail window to close the multitask view; - 6. Passively trigger to close the multitask view. When a new window is activated, the multitask view will be closed automatically; + 1. When the MultitaskView is open, click ESC to close the MultitaskView; + 2. When the MultitaskView is open, click the blank space of the MultitaskView to close the MultitaskView; + 3. When the MultitaskView is open, use the shortcut key "menu + Tab" to close the MultitaskView; + 4. In PC mode only and MultitaskView is on, click virtual desktop to close MultitaskView; + 5. When the MultitaskView is open, click the thumbnail window to close the MultitaskView; + 6. Passively trigger to close the MultitaskView. When a new window is activated, the MultitaskView will be closed automatically; ## Development -The multitask view is divided into two parts: the view module is developed with QML language and the back end is developed with C++ language. -The view module is divided into PC mode and tablet mode. + +The MultitaskView is divided into two parts: the view module is developed with QML language and the backend is developed with C++ language. +The view module is divided into PC mode and Pad mode. The development and commissioning shall be carried out according to the following steps: -1.cd ukui-kwin-effects -2.mkdir build -3.cd build -4.cmake .. -5.sudo make install -6.ukui-kwin --replace & + +1. cd ukui-window-switch +2. mkdir build +3. cd build +4. cmake .. +5. sudo make install +6. kwin --replace & + ## Debuglog + The log is stored in the log of kwin. The viewing method is as follows: -1.cd .log (or cd .config/ukui-kwin/log) -2.tail -f ukui_kwin_0.log + +1. cd ~/.log (or cd .config/kwin/log) +2. tail -f kwin_0.log ## Changelog + You can view the record of each change in the changelog in Debian directory. ## FAQ -1. The multitask view always shows no application window? + +1. The MultitaskView always shows no application window? Please ensure that the current version of kwin is installed correctly -2. Shortcut keys cannot evoke multitask view? - If ukui window switch is already installed in the system, please execute the following steps first: - sudo dpkg -P ukui-window-switch - After that: - sudo rm -rf .config/kglobalshortcutsrc - Final execution: +2. Shortcut keys cannot evoke MultitaskView? + rm -rf ~/.config/kglobalshortcutsrc reboot -3. Does the multitask view provide a DBUS interface and how to use it? +3. Does the MultitaskView provide a DBUS interface and how to use it? Please use d-feet - In the session, find "org.ukui.kwin" -> "/multitaskview" -> org.ukui.kWin.MultitaskView->show() + In the session, find "org.kde.kwin" -> "/MultitaskView" -> org.kde.kWin.MultitaskView->show() Please ensure that the installed versions of kwin and ukui panel support the new version of multitask diff --git a/build/.cmake/api/v1/query/client-vscode/query.json b/build/.cmake/api/v1/query/client-vscode/query.json deleted file mode 100644 index b9dc05e0712c6227c704f43da144bbab7241fd4f..0000000000000000000000000000000000000000 --- a/build/.cmake/api/v1/query/client-vscode/query.json +++ /dev/null @@ -1 +0,0 @@ -{"requests":[{"kind":"cache","version":2},{"kind":"codemodel","version":2},{"kind":"toolchains","version":1}]} \ No newline at end of file diff --git a/build/.cmake/api/v1/reply/cache-v2-b23ccf4369602b55edc1.json b/build/.cmake/api/v1/reply/cache-v2-b23ccf4369602b55edc1.json deleted file mode 100644 index d6c4b9487767706ab8543a9ff67ed136190bb36c..0000000000000000000000000000000000000000 --- a/build/.cmake/api/v1/reply/cache-v2-b23ccf4369602b55edc1.json +++ /dev/null @@ -1,3715 +0,0 @@ -{ - "entries" : - [ - { - "name" : "CMAKE_ADDR2LINE", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a program." - } - ], - "type" : "FILEPATH", - "value" : "/bin/addr2line" - }, - { - "name" : "CMAKE_AR", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a program." - } - ], - "type" : "FILEPATH", - "value" : "/bin/ar" - }, - { - "name" : "CMAKE_BUILD_TYPE", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "No help, variable specified on the command line." - } - ], - "type" : "STRING", - "value" : "Debug" - }, - { - "name" : "CMAKE_CACHEFILE_DIR", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "This is the directory where this CMakeCache.txt was created" - } - ], - "type" : "INTERNAL", - "value" : "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build" - }, - { - "name" : "CMAKE_CACHE_MAJOR_VERSION", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Major version of cmake used to create the current loaded cache" - } - ], - "type" : "INTERNAL", - "value" : "3" - }, - { - "name" : "CMAKE_CACHE_MINOR_VERSION", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Minor version of cmake used to create the current loaded cache" - } - ], - "type" : "INTERNAL", - "value" : "16" - }, - { - "name" : "CMAKE_CACHE_PATCH_VERSION", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Patch version of cmake used to create the current loaded cache" - } - ], - "type" : "INTERNAL", - "value" : "3" - }, - { - "name" : "CMAKE_COMMAND", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Path to CMake executable." - } - ], - "type" : "INTERNAL", - "value" : "/usr/bin/cmake" - }, - { - "name" : "CMAKE_CPACK_COMMAND", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Path to cpack program executable." - } - ], - "type" : "INTERNAL", - "value" : "/usr/bin/cpack" - }, - { - "name" : "CMAKE_CTEST_COMMAND", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Path to ctest program executable." - } - ], - "type" : "INTERNAL", - "value" : "/usr/bin/ctest" - }, - { - "name" : "CMAKE_CXX_COMPILER", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "CXX compiler" - } - ], - "type" : "FILEPATH", - "value" : "/bin/c++" - }, - { - "name" : "CMAKE_CXX_COMPILER_AR", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "A wrapper around 'ar' adding the appropriate '--plugin' option for the GCC compiler" - } - ], - "type" : "FILEPATH", - "value" : "/bin/gcc-ar-9" - }, - { - "name" : "CMAKE_CXX_COMPILER_RANLIB", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "A wrapper around 'ranlib' adding the appropriate '--plugin' option for the GCC compiler" - } - ], - "type" : "FILEPATH", - "value" : "/bin/gcc-ranlib-9" - }, - { - "name" : "CMAKE_CXX_FLAGS", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the CXX compiler during all build types." - } - ], - "type" : "STRING", - "value" : "" - }, - { - "name" : "CMAKE_CXX_FLAGS_DEBUG", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the CXX compiler during DEBUG builds." - } - ], - "type" : "STRING", - "value" : "-g" - }, - { - "name" : "CMAKE_CXX_FLAGS_MINSIZEREL", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the CXX compiler during MINSIZEREL builds." - } - ], - "type" : "STRING", - "value" : "-Os -DNDEBUG" - }, - { - "name" : "CMAKE_CXX_FLAGS_RELEASE", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the CXX compiler during RELEASE builds." - } - ], - "type" : "STRING", - "value" : "-O3 -DNDEBUG" - }, - { - "name" : "CMAKE_CXX_FLAGS_RELWITHDEBINFO", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the CXX compiler during RELWITHDEBINFO builds." - } - ], - "type" : "STRING", - "value" : "-O2 -g -DNDEBUG" - }, - { - "name" : "CMAKE_C_COMPILER", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "No help, variable specified on the command line." - } - ], - "type" : "FILEPATH", - "value" : "/bin/c99-gcc" - }, - { - "name" : "CMAKE_C_COMPILER_AR", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "A wrapper around 'ar' adding the appropriate '--plugin' option for the GCC compiler" - } - ], - "type" : "FILEPATH", - "value" : "/bin/gcc-ar-9" - }, - { - "name" : "CMAKE_C_COMPILER_RANLIB", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "A wrapper around 'ranlib' adding the appropriate '--plugin' option for the GCC compiler" - } - ], - "type" : "FILEPATH", - "value" : "/bin/gcc-ranlib-9" - }, - { - "name" : "CMAKE_C_FLAGS", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the C compiler during all build types." - } - ], - "type" : "STRING", - "value" : "" - }, - { - "name" : "CMAKE_C_FLAGS_DEBUG", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the C compiler during DEBUG builds." - } - ], - "type" : "STRING", - "value" : "-g" - }, - { - "name" : "CMAKE_C_FLAGS_MINSIZEREL", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the C compiler during MINSIZEREL builds." - } - ], - "type" : "STRING", - "value" : "-Os -DNDEBUG" - }, - { - "name" : "CMAKE_C_FLAGS_RELEASE", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the C compiler during RELEASE builds." - } - ], - "type" : "STRING", - "value" : "-O3 -DNDEBUG" - }, - { - "name" : "CMAKE_C_FLAGS_RELWITHDEBINFO", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the C compiler during RELWITHDEBINFO builds." - } - ], - "type" : "STRING", - "value" : "-O2 -g -DNDEBUG" - }, - { - "name" : "CMAKE_DLLTOOL", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a program." - } - ], - "type" : "FILEPATH", - "value" : "CMAKE_DLLTOOL-NOTFOUND" - }, - { - "name" : "CMAKE_EXECUTABLE_FORMAT", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Executable file format" - } - ], - "type" : "INTERNAL", - "value" : "ELF" - }, - { - "name" : "CMAKE_EXE_LINKER_FLAGS", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the linker during all build types." - } - ], - "type" : "STRING", - "value" : "" - }, - { - "name" : "CMAKE_EXE_LINKER_FLAGS_DEBUG", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the linker during DEBUG builds." - } - ], - "type" : "STRING", - "value" : "" - }, - { - "name" : "CMAKE_EXE_LINKER_FLAGS_MINSIZEREL", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the linker during MINSIZEREL builds." - } - ], - "type" : "STRING", - "value" : "" - }, - { - "name" : "CMAKE_EXE_LINKER_FLAGS_RELEASE", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the linker during RELEASE builds." - } - ], - "type" : "STRING", - "value" : "" - }, - { - "name" : "CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the linker during RELWITHDEBINFO builds." - } - ], - "type" : "STRING", - "value" : "" - }, - { - "name" : "CMAKE_EXPORT_COMPILE_COMMANDS", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "No help, variable specified on the command line." - } - ], - "type" : "BOOL", - "value" : "TRUE" - }, - { - "name" : "CMAKE_EXTRA_GENERATOR", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Name of external makefile project generator." - } - ], - "type" : "INTERNAL", - "value" : "" - }, - { - "name" : "CMAKE_GENERATOR", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Name of generator." - } - ], - "type" : "INTERNAL", - "value" : "Ninja" - }, - { - "name" : "CMAKE_GENERATOR_INSTANCE", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Generator instance identifier." - } - ], - "type" : "INTERNAL", - "value" : "" - }, - { - "name" : "CMAKE_GENERATOR_PLATFORM", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Name of generator platform." - } - ], - "type" : "INTERNAL", - "value" : "" - }, - { - "name" : "CMAKE_GENERATOR_TOOLSET", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Name of generator toolset." - } - ], - "type" : "INTERNAL", - "value" : "" - }, - { - "name" : "CMAKE_HAVE_CONNECT", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Have function connect" - } - ], - "type" : "INTERNAL", - "value" : "1" - }, - { - "name" : "CMAKE_HAVE_GETHOSTBYNAME", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Have function gethostbyname" - } - ], - "type" : "INTERNAL", - "value" : "1" - }, - { - "name" : "CMAKE_HAVE_REMOVE", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Have function remove" - } - ], - "type" : "INTERNAL", - "value" : "1" - }, - { - "name" : "CMAKE_HAVE_SHMAT", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Have function shmat" - } - ], - "type" : "INTERNAL", - "value" : "1" - }, - { - "name" : "CMAKE_HOME_DIRECTORY", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Source directory with the top level CMakeLists.txt file for this project" - } - ], - "type" : "INTERNAL", - "value" : "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch" - }, - { - "name" : "CMAKE_INSTALL_PREFIX", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Install path prefix, prepended onto install directories." - } - ], - "type" : "PATH", - "value" : "/usr/local" - }, - { - "name" : "CMAKE_INSTALL_SO_NO_EXE", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Install .so files without execute permission." - } - ], - "type" : "INTERNAL", - "value" : "1" - }, - { - "name" : "CMAKE_LIB_ICE_HAS_ICECONNECTIONNUMBER", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Have library ICE" - } - ], - "type" : "INTERNAL", - "value" : "1" - }, - { - "name" : "CMAKE_LINKER", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a program." - } - ], - "type" : "FILEPATH", - "value" : "/bin/ld" - }, - { - "name" : "CMAKE_MAKE_PROGRAM", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Program used to build from build.ninja files." - } - ], - "type" : "FILEPATH", - "value" : "/usr/bin/ninja" - }, - { - "name" : "CMAKE_MODULE_LINKER_FLAGS", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the linker during the creation of modules during all build types." - } - ], - "type" : "STRING", - "value" : "" - }, - { - "name" : "CMAKE_MODULE_LINKER_FLAGS_DEBUG", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the linker during the creation of modules during DEBUG builds." - } - ], - "type" : "STRING", - "value" : "" - }, - { - "name" : "CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the linker during the creation of modules during MINSIZEREL builds." - } - ], - "type" : "STRING", - "value" : "" - }, - { - "name" : "CMAKE_MODULE_LINKER_FLAGS_RELEASE", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the linker during the creation of modules during RELEASE builds." - } - ], - "type" : "STRING", - "value" : "" - }, - { - "name" : "CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the linker during the creation of modules during RELWITHDEBINFO builds." - } - ], - "type" : "STRING", - "value" : "" - }, - { - "name" : "CMAKE_NM", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a program." - } - ], - "type" : "FILEPATH", - "value" : "/bin/nm" - }, - { - "name" : "CMAKE_NUMBER_OF_MAKEFILES", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "number of local generators" - } - ], - "type" : "INTERNAL", - "value" : "3" - }, - { - "name" : "CMAKE_OBJCOPY", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a program." - } - ], - "type" : "FILEPATH", - "value" : "/bin/objcopy" - }, - { - "name" : "CMAKE_OBJDUMP", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a program." - } - ], - "type" : "FILEPATH", - "value" : "/bin/objdump" - }, - { - "name" : "CMAKE_PLATFORM_INFO_INITIALIZED", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Platform information initialized" - } - ], - "type" : "INTERNAL", - "value" : "1" - }, - { - "name" : "CMAKE_PROJECT_DESCRIPTION", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Value Computed by CMake" - } - ], - "type" : "STATIC", - "value" : "" - }, - { - "name" : "CMAKE_PROJECT_HOMEPAGE_URL", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Value Computed by CMake" - } - ], - "type" : "STATIC", - "value" : "" - }, - { - "name" : "CMAKE_PROJECT_NAME", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Value Computed by CMake" - } - ], - "type" : "STATIC", - "value" : "ukui-window-switch" - }, - { - "name" : "CMAKE_RANLIB", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a program." - } - ], - "type" : "FILEPATH", - "value" : "/bin/ranlib" - }, - { - "name" : "CMAKE_READELF", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a program." - } - ], - "type" : "FILEPATH", - "value" : "/bin/readelf" - }, - { - "name" : "CMAKE_ROOT", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Path to CMake installation." - } - ], - "type" : "INTERNAL", - "value" : "/usr/share/cmake-3.16" - }, - { - "name" : "CMAKE_SHARED_LINKER_FLAGS", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the linker during the creation of shared libraries during all build types." - } - ], - "type" : "STRING", - "value" : "" - }, - { - "name" : "CMAKE_SHARED_LINKER_FLAGS_DEBUG", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the linker during the creation of shared libraries during DEBUG builds." - } - ], - "type" : "STRING", - "value" : "" - }, - { - "name" : "CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the linker during the creation of shared libraries during MINSIZEREL builds." - } - ], - "type" : "STRING", - "value" : "" - }, - { - "name" : "CMAKE_SHARED_LINKER_FLAGS_RELEASE", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the linker during the creation of shared libraries during RELEASE builds." - } - ], - "type" : "STRING", - "value" : "" - }, - { - "name" : "CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the linker during the creation of shared libraries during RELWITHDEBINFO builds." - } - ], - "type" : "STRING", - "value" : "" - }, - { - "name" : "CMAKE_SKIP_INSTALL_RPATH", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "If set, runtime paths are not added when installing shared libraries, but are added when building." - } - ], - "type" : "BOOL", - "value" : "NO" - }, - { - "name" : "CMAKE_SKIP_RPATH", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "If set, runtime paths are not added when using shared libraries." - } - ], - "type" : "BOOL", - "value" : "NO" - }, - { - "name" : "CMAKE_STATIC_LINKER_FLAGS", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the linker during the creation of static libraries during all build types." - } - ], - "type" : "STRING", - "value" : "" - }, - { - "name" : "CMAKE_STATIC_LINKER_FLAGS_DEBUG", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the linker during the creation of static libraries during DEBUG builds." - } - ], - "type" : "STRING", - "value" : "" - }, - { - "name" : "CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the linker during the creation of static libraries during MINSIZEREL builds." - } - ], - "type" : "STRING", - "value" : "" - }, - { - "name" : "CMAKE_STATIC_LINKER_FLAGS_RELEASE", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the linker during the creation of static libraries during RELEASE builds." - } - ], - "type" : "STRING", - "value" : "" - }, - { - "name" : "CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the linker during the creation of static libraries during RELWITHDEBINFO builds." - } - ], - "type" : "STRING", - "value" : "" - }, - { - "name" : "CMAKE_STRIP", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a program." - } - ], - "type" : "FILEPATH", - "value" : "/bin/strip" - }, - { - "name" : "CMAKE_UNAME", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "uname command" - } - ], - "type" : "INTERNAL", - "value" : "/usr/bin/uname" - }, - { - "name" : "CMAKE_VERBOSE_MAKEFILE", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "If this value is on, makefiles will be generated without the .SILENT directive, and all commands will be echoed to the console during the make. This is useful for debugging only. With Visual Studio IDE projects all commands are done without /nologo." - } - ], - "type" : "BOOL", - "value" : "FALSE" - }, - { - "name" : "ECM_DIR", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "The directory containing a CMake configuration file for ECM." - } - ], - "type" : "PATH", - "value" : "/usr/share/ECM/cmake" - }, - { - "name" : "EGL_DIR", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "The directory containing a CMake configuration file for EGL." - } - ], - "type" : "PATH", - "value" : "EGL_DIR-NOTFOUND" - }, - { - "name" : "FIND_PACKAGE_MESSAGE_DETAILS_Gettext", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Details about finding Gettext" - } - ], - "type" : "INTERNAL", - "value" : "[/usr/bin/msgmerge][/usr/bin/msgfmt][v0.19.8.1()]" - }, - { - "name" : "FIND_PACKAGE_MESSAGE_DETAILS_OpenGL", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Details about finding OpenGL" - } - ], - "type" : "INTERNAL", - "value" : "[/usr/lib/aarch64-linux-gnu/libOpenGL.so][/usr/lib/aarch64-linux-gnu/libGLX.so][/usr/include][c ][v()]" - }, - { - "name" : "FIND_PACKAGE_MESSAGE_DETAILS_PkgConfig", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Details about finding PkgConfig" - } - ], - "type" : "INTERNAL", - "value" : "[/usr/bin/pkg-config][v0.29.1()]" - }, - { - "name" : "FIND_PACKAGE_MESSAGE_DETAILS_X11", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Details about finding X11" - } - ], - "type" : "INTERNAL", - "value" : "[/usr/include][/usr/lib/aarch64-linux-gnu/libX11.so][c ][v()]" - }, - { - "name" : "FREETYPE_INCLUDE_DIR_freetype2", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a file." - } - ], - "type" : "PATH", - "value" : "/usr/include/freetype2" - }, - { - "name" : "FREETYPE_INCLUDE_DIR_ft2build", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a file." - } - ], - "type" : "PATH", - "value" : "/usr/include/freetype2" - }, - { - "name" : "FREETYPE_LIBRARY_DEBUG", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a library." - } - ], - "type" : "FILEPATH", - "value" : "FREETYPE_LIBRARY_DEBUG-NOTFOUND" - }, - { - "name" : "FREETYPE_LIBRARY_RELEASE", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a library." - } - ], - "type" : "FILEPATH", - "value" : "/usr/lib/aarch64-linux-gnu/libfreetype.so" - }, - { - "name" : "Fontconfig_INCLUDE_DIR", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a file." - } - ], - "type" : "PATH", - "value" : "/usr/include" - }, - { - "name" : "Fontconfig_LIBRARY", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a library." - } - ], - "type" : "FILEPATH", - "value" : "/usr/lib/aarch64-linux-gnu/libfontconfig.so" - }, - { - "name" : "GETTEXT_MSGFMT_EXECUTABLE", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Path to a program." - } - ], - "type" : "FILEPATH", - "value" : "/usr/bin/msgfmt" - }, - { - "name" : "GETTEXT_MSGMERGE_EXECUTABLE", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Path to a program." - } - ], - "type" : "FILEPATH", - "value" : "/usr/bin/msgmerge" - }, - { - "name" : "KF5Config_DIR", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "The directory containing a CMake configuration file for KF5Config." - } - ], - "type" : "PATH", - "value" : "/usr/lib/aarch64-linux-gnu/cmake/KF5Config" - }, - { - "name" : "KF5CoreAddons_DIR", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "The directory containing a CMake configuration file for KF5CoreAddons." - } - ], - "type" : "PATH", - "value" : "/usr/lib/aarch64-linux-gnu/cmake/KF5CoreAddons" - }, - { - "name" : "KF5GlobalAccel_DIR", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "The directory containing a CMake configuration file for KF5GlobalAccel." - } - ], - "type" : "PATH", - "value" : "/usr/lib/aarch64-linux-gnu/cmake/KF5GlobalAccel" - }, - { - "name" : "KF5I18n_DIR", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "The directory containing a CMake configuration file for KF5I18n." - } - ], - "type" : "PATH", - "value" : "/usr/lib/aarch64-linux-gnu/cmake/KF5I18n" - }, - { - "name" : "KF5WindowSystem_DIR", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "The directory containing a CMake configuration file for KF5WindowSystem." - } - ], - "type" : "PATH", - "value" : "/usr/lib/aarch64-linux-gnu/cmake/KF5WindowSystem" - }, - { - "name" : "KI18N_PYTHON_EXECUTABLE", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Path to a program." - } - ], - "type" : "FILEPATH", - "value" : "/usr/bin/python3" - }, - { - "name" : "OPENGL_EGL_INCLUDE_DIR", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a file." - } - ], - "type" : "PATH", - "value" : "/usr/include" - }, - { - "name" : "OPENGL_GLX_INCLUDE_DIR", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a file." - } - ], - "type" : "PATH", - "value" : "/usr/include" - }, - { - "name" : "OPENGL_INCLUDE_DIR", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a file." - } - ], - "type" : "PATH", - "value" : "/usr/include" - }, - { - "name" : "OPENGL_egl_LIBRARY", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a library." - } - ], - "type" : "FILEPATH", - "value" : "/usr/lib/aarch64-linux-gnu/libEGL.so" - }, - { - "name" : "OPENGL_gl_LIBRARY", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a library." - } - ], - "type" : "FILEPATH", - "value" : "/usr/lib/aarch64-linux-gnu/libGL.so" - }, - { - "name" : "OPENGL_glu_LIBRARY", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a library." - } - ], - "type" : "FILEPATH", - "value" : "/usr/lib/aarch64-linux-gnu/libGLU.so" - }, - { - "name" : "OPENGL_glx_LIBRARY", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a library." - } - ], - "type" : "FILEPATH", - "value" : "/usr/lib/aarch64-linux-gnu/libGLX.so" - }, - { - "name" : "OPENGL_opengl_LIBRARY", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a library." - } - ], - "type" : "FILEPATH", - "value" : "/usr/lib/aarch64-linux-gnu/libOpenGL.so" - }, - { - "name" : "OPENGL_xmesa_INCLUDE_DIR", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a file." - } - ], - "type" : "PATH", - "value" : "OPENGL_xmesa_INCLUDE_DIR-NOTFOUND" - }, - { - "name" : "PKG_CONFIG_EXECUTABLE", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "pkg-config executable" - } - ], - "type" : "FILEPATH", - "value" : "/usr/bin/pkg-config" - }, - { - "name" : "PKG_FONTCONFIG_CFLAGS", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "-I/usr/include/uuid;-I/usr/include/freetype2;-I/usr/include/libpng16" - }, - { - "name" : "PKG_FONTCONFIG_CFLAGS_I", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "" - }, - { - "name" : "PKG_FONTCONFIG_CFLAGS_OTHER", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "" - }, - { - "name" : "PKG_FONTCONFIG_FOUND", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "1" - }, - { - "name" : "PKG_FONTCONFIG_INCLUDEDIR", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "/usr/include" - }, - { - "name" : "PKG_FONTCONFIG_INCLUDE_DIRS", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "/usr/include/uuid;/usr/include/freetype2;/usr/include/libpng16" - }, - { - "name" : "PKG_FONTCONFIG_LDFLAGS", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "-lfontconfig;-lfreetype" - }, - { - "name" : "PKG_FONTCONFIG_LDFLAGS_OTHER", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "" - }, - { - "name" : "PKG_FONTCONFIG_LIBDIR", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "/usr/lib/aarch64-linux-gnu" - }, - { - "name" : "PKG_FONTCONFIG_LIBRARIES", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "fontconfig;freetype" - }, - { - "name" : "PKG_FONTCONFIG_LIBRARY_DIRS", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "" - }, - { - "name" : "PKG_FONTCONFIG_LIBS", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "" - }, - { - "name" : "PKG_FONTCONFIG_LIBS_L", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "" - }, - { - "name" : "PKG_FONTCONFIG_LIBS_OTHER", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "" - }, - { - "name" : "PKG_FONTCONFIG_LIBS_PATHS", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "" - }, - { - "name" : "PKG_FONTCONFIG_MODULE_NAME", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "fontconfig" - }, - { - "name" : "PKG_FONTCONFIG_PREFIX", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "/usr" - }, - { - "name" : "PKG_FONTCONFIG_STATIC_CFLAGS", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "-I/usr/include/uuid;-I/usr/include/freetype2;-I/usr/include/libpng16" - }, - { - "name" : "PKG_FONTCONFIG_STATIC_CFLAGS_I", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "" - }, - { - "name" : "PKG_FONTCONFIG_STATIC_CFLAGS_OTHER", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "" - }, - { - "name" : "PKG_FONTCONFIG_STATIC_INCLUDE_DIRS", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "/usr/include/uuid;/usr/include/freetype2;/usr/include/libpng16" - }, - { - "name" : "PKG_FONTCONFIG_STATIC_LDFLAGS", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "-lfontconfig;-luuid;-lexpat;-lfreetype;-lpng16;-lm;-lz;-lm;-lz" - }, - { - "name" : "PKG_FONTCONFIG_STATIC_LDFLAGS_OTHER", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "" - }, - { - "name" : "PKG_FONTCONFIG_STATIC_LIBDIR", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "" - }, - { - "name" : "PKG_FONTCONFIG_STATIC_LIBRARIES", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "fontconfig;uuid;expat;freetype;png16;m;z;m;z" - }, - { - "name" : "PKG_FONTCONFIG_STATIC_LIBRARY_DIRS", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "" - }, - { - "name" : "PKG_FONTCONFIG_STATIC_LIBS", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "" - }, - { - "name" : "PKG_FONTCONFIG_STATIC_LIBS_L", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "" - }, - { - "name" : "PKG_FONTCONFIG_STATIC_LIBS_OTHER", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "" - }, - { - "name" : "PKG_FONTCONFIG_STATIC_LIBS_PATHS", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "" - }, - { - "name" : "PKG_FONTCONFIG_VERSION", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "2.13.1" - }, - { - "name" : "PKG_FONTCONFIG_fontconfig_INCLUDEDIR", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "" - }, - { - "name" : "PKG_FONTCONFIG_fontconfig_LIBDIR", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "" - }, - { - "name" : "PKG_FONTCONFIG_fontconfig_PREFIX", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "" - }, - { - "name" : "PKG_FONTCONFIG_fontconfig_VERSION", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "" - }, - { - "name" : "QGSettings_CFLAGS", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "-I/usr/include/aarch64-linux-gnu/qt5/QGSettings" - }, - { - "name" : "QGSettings_CFLAGS_I", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "" - }, - { - "name" : "QGSettings_CFLAGS_OTHER", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "" - }, - { - "name" : "QGSettings_FOUND", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "1" - }, - { - "name" : "QGSettings_INCLUDEDIR", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "/usr/include/aarch64-linux-gnu/qt5/QGSettings" - }, - { - "name" : "QGSettings_INCLUDE_DIRS", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "/usr/include/aarch64-linux-gnu/qt5/QGSettings" - }, - { - "name" : "QGSettings_LDFLAGS", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "-lgsettings-qt" - }, - { - "name" : "QGSettings_LDFLAGS_OTHER", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "" - }, - { - "name" : "QGSettings_LIBDIR", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "/usr/lib/aarch64-linux-gnu" - }, - { - "name" : "QGSettings_LIBRARIES", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "gsettings-qt" - }, - { - "name" : "QGSettings_LIBRARY_DIRS", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "" - }, - { - "name" : "QGSettings_LIBS", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "" - }, - { - "name" : "QGSettings_LIBS_L", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "" - }, - { - "name" : "QGSettings_LIBS_OTHER", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "" - }, - { - "name" : "QGSettings_LIBS_PATHS", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "" - }, - { - "name" : "QGSettings_MODULE_NAME", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "gsettings-qt" - }, - { - "name" : "QGSettings_PREFIX", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "/usr" - }, - { - "name" : "QGSettings_STATIC_CFLAGS", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "-I/usr/include/aarch64-linux-gnu/qt5/QGSettings" - }, - { - "name" : "QGSettings_STATIC_CFLAGS_I", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "" - }, - { - "name" : "QGSettings_STATIC_CFLAGS_OTHER", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "" - }, - { - "name" : "QGSettings_STATIC_INCLUDE_DIRS", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "/usr/include/aarch64-linux-gnu/qt5/QGSettings" - }, - { - "name" : "QGSettings_STATIC_LDFLAGS", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "-lgsettings-qt" - }, - { - "name" : "QGSettings_STATIC_LDFLAGS_OTHER", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "" - }, - { - "name" : "QGSettings_STATIC_LIBDIR", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "" - }, - { - "name" : "QGSettings_STATIC_LIBRARIES", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "gsettings-qt" - }, - { - "name" : "QGSettings_STATIC_LIBRARY_DIRS", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "" - }, - { - "name" : "QGSettings_STATIC_LIBS", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "" - }, - { - "name" : "QGSettings_STATIC_LIBS_L", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "" - }, - { - "name" : "QGSettings_STATIC_LIBS_OTHER", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "" - }, - { - "name" : "QGSettings_STATIC_LIBS_PATHS", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "" - }, - { - "name" : "QGSettings_VERSION", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "1.0.0" - }, - { - "name" : "QGSettings_gsettings-qt_INCLUDEDIR", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "" - }, - { - "name" : "QGSettings_gsettings-qt_LIBDIR", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "" - }, - { - "name" : "QGSettings_gsettings-qt_PREFIX", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "" - }, - { - "name" : "QGSettings_gsettings-qt_VERSION", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "" - }, - { - "name" : "Qt5Core_DIR", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "The directory containing a CMake configuration file for Qt5Core." - } - ], - "type" : "PATH", - "value" : "/usr/lib/aarch64-linux-gnu/cmake/Qt5Core" - }, - { - "name" : "Qt5DBus_DIR", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "The directory containing a CMake configuration file for Qt5DBus." - } - ], - "type" : "PATH", - "value" : "/usr/lib/aarch64-linux-gnu/cmake/Qt5DBus" - }, - { - "name" : "Qt5Gui_DIR", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "The directory containing a CMake configuration file for Qt5Gui." - } - ], - "type" : "PATH", - "value" : "/usr/lib/aarch64-linux-gnu/cmake/Qt5Gui" - }, - { - "name" : "Qt5LinguistTools_DIR", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "The directory containing a CMake configuration file for Qt5LinguistTools." - } - ], - "type" : "PATH", - "value" : "/usr/lib/aarch64-linux-gnu/cmake/Qt5LinguistTools" - }, - { - "name" : "Qt5Network_DIR", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "The directory containing a CMake configuration file for Qt5Network." - } - ], - "type" : "PATH", - "value" : "/usr/lib/aarch64-linux-gnu/cmake/Qt5Network" - }, - { - "name" : "Qt5Qml_DIR", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "The directory containing a CMake configuration file for Qt5Qml." - } - ], - "type" : "PATH", - "value" : "/usr/lib/aarch64-linux-gnu/cmake/Qt5Qml" - }, - { - "name" : "Qt5QuickWidgets_DIR", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "The directory containing a CMake configuration file for Qt5QuickWidgets." - } - ], - "type" : "PATH", - "value" : "/usr/lib/aarch64-linux-gnu/cmake/Qt5QuickWidgets" - }, - { - "name" : "Qt5Quick_DIR", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "The directory containing a CMake configuration file for Qt5Quick." - } - ], - "type" : "PATH", - "value" : "/usr/lib/aarch64-linux-gnu/cmake/Qt5Quick" - }, - { - "name" : "Qt5Widgets_DIR", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "The directory containing a CMake configuration file for Qt5Widgets." - } - ], - "type" : "PATH", - "value" : "/usr/lib/aarch64-linux-gnu/cmake/Qt5Widgets" - }, - { - "name" : "Qt5X11Extras_DIR", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "The directory containing a CMake configuration file for Qt5X11Extras." - } - ], - "type" : "PATH", - "value" : "/usr/lib/aarch64-linux-gnu/cmake/Qt5X11Extras" - }, - { - "name" : "Qt5Xml_DIR", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "The directory containing a CMake configuration file for Qt5Xml." - } - ], - "type" : "PATH", - "value" : "/usr/lib/aarch64-linux-gnu/cmake/Qt5Xml" - }, - { - "name" : "Qt5_DIR", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "The directory containing a CMake configuration file for Qt5." - } - ], - "type" : "PATH", - "value" : "/usr/lib/aarch64-linux-gnu/cmake/Qt5" - }, - { - "name" : "X11_ICE_INCLUDE_PATH", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a file." - } - ], - "type" : "PATH", - "value" : "/usr/include" - }, - { - "name" : "X11_ICE_LIB", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a library." - } - ], - "type" : "FILEPATH", - "value" : "/usr/lib/aarch64-linux-gnu/libICE.so" - }, - { - "name" : "X11_LIBRARIES", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "(This variable does not exist and should not be used)" - } - ], - "type" : "UNINITIALIZED", - "value" : "" - }, - { - "name" : "X11_LIB_X11_SOLO", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Have library /usr/lib/aarch64-linux-gnu/libX11.so;/usr/lib/aarch64-linux-gnu/libXext.so" - } - ], - "type" : "INTERNAL", - "value" : "1" - }, - { - "name" : "X11_SM_INCLUDE_PATH", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a file." - } - ], - "type" : "PATH", - "value" : "/usr/include" - }, - { - "name" : "X11_SM_LIB", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a library." - } - ], - "type" : "FILEPATH", - "value" : "/usr/lib/aarch64-linux-gnu/libSM.so" - }, - { - "name" : "X11_X11_INCLUDE_PATH", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a file." - } - ], - "type" : "PATH", - "value" : "/usr/include" - }, - { - "name" : "X11_X11_LIB", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a library." - } - ], - "type" : "FILEPATH", - "value" : "/usr/lib/aarch64-linux-gnu/libX11.so" - }, - { - "name" : "X11_XRes_INCLUDE_PATH", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a file." - } - ], - "type" : "PATH", - "value" : "/usr/include" - }, - { - "name" : "X11_XRes_LIB", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a library." - } - ], - "type" : "FILEPATH", - "value" : "/usr/lib/aarch64-linux-gnu/libXRes.so" - }, - { - "name" : "X11_XShm_INCLUDE_PATH", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a file." - } - ], - "type" : "PATH", - "value" : "/usr/include" - }, - { - "name" : "X11_XSync_INCLUDE_PATH", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a file." - } - ], - "type" : "PATH", - "value" : "/usr/include" - }, - { - "name" : "X11_Xaccessrules_INCLUDE_PATH", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a file." - } - ], - "type" : "PATH", - "value" : "/usr/include" - }, - { - "name" : "X11_Xaccessstr_INCLUDE_PATH", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a file." - } - ], - "type" : "PATH", - "value" : "/usr/include" - }, - { - "name" : "X11_Xau_INCLUDE_PATH", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a file." - } - ], - "type" : "PATH", - "value" : "/usr/include" - }, - { - "name" : "X11_Xau_LIB", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a library." - } - ], - "type" : "FILEPATH", - "value" : "/usr/lib/aarch64-linux-gnu/libXau.so" - }, - { - "name" : "X11_Xcomposite_INCLUDE_PATH", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a file." - } - ], - "type" : "PATH", - "value" : "/usr/include" - }, - { - "name" : "X11_Xcomposite_LIB", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a library." - } - ], - "type" : "FILEPATH", - "value" : "/usr/lib/aarch64-linux-gnu/libXcomposite.so" - }, - { - "name" : "X11_Xcursor_INCLUDE_PATH", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a file." - } - ], - "type" : "PATH", - "value" : "/usr/include" - }, - { - "name" : "X11_Xcursor_LIB", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a library." - } - ], - "type" : "FILEPATH", - "value" : "/usr/lib/aarch64-linux-gnu/libXcursor.so" - }, - { - "name" : "X11_Xdamage_INCLUDE_PATH", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a file." - } - ], - "type" : "PATH", - "value" : "/usr/include" - }, - { - "name" : "X11_Xdamage_LIB", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a library." - } - ], - "type" : "FILEPATH", - "value" : "/usr/lib/aarch64-linux-gnu/libXdamage.so" - }, - { - "name" : "X11_Xdmcp_INCLUDE_PATH", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a file." - } - ], - "type" : "PATH", - "value" : "/usr/include" - }, - { - "name" : "X11_Xdmcp_LIB", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a library." - } - ], - "type" : "FILEPATH", - "value" : "/usr/lib/aarch64-linux-gnu/libXdmcp.so" - }, - { - "name" : "X11_Xext_INCLUDE_PATH", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a file." - } - ], - "type" : "PATH", - "value" : "/usr/include" - }, - { - "name" : "X11_Xext_LIB", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a library." - } - ], - "type" : "FILEPATH", - "value" : "/usr/lib/aarch64-linux-gnu/libXext.so" - }, - { - "name" : "X11_Xfixes_INCLUDE_PATH", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a file." - } - ], - "type" : "PATH", - "value" : "/usr/include" - }, - { - "name" : "X11_Xfixes_LIB", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a library." - } - ], - "type" : "FILEPATH", - "value" : "/usr/lib/aarch64-linux-gnu/libXfixes.so" - }, - { - "name" : "X11_Xft_INCLUDE_PATH", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a file." - } - ], - "type" : "PATH", - "value" : "/usr/include" - }, - { - "name" : "X11_Xft_LIB", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a library." - } - ], - "type" : "FILEPATH", - "value" : "/usr/lib/aarch64-linux-gnu/libXft.so" - }, - { - "name" : "X11_Xi_INCLUDE_PATH", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a file." - } - ], - "type" : "PATH", - "value" : "/usr/include" - }, - { - "name" : "X11_Xi_LIB", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a library." - } - ], - "type" : "FILEPATH", - "value" : "/usr/lib/aarch64-linux-gnu/libXi.so" - }, - { - "name" : "X11_Xinerama_INCLUDE_PATH", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a file." - } - ], - "type" : "PATH", - "value" : "/usr/include" - }, - { - "name" : "X11_Xinerama_LIB", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a library." - } - ], - "type" : "FILEPATH", - "value" : "/usr/lib/aarch64-linux-gnu/libXinerama.so" - }, - { - "name" : "X11_Xkb_INCLUDE_PATH", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a file." - } - ], - "type" : "PATH", - "value" : "/usr/include" - }, - { - "name" : "X11_Xkblib_INCLUDE_PATH", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a file." - } - ], - "type" : "PATH", - "value" : "/usr/include" - }, - { - "name" : "X11_Xlib_INCLUDE_PATH", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a file." - } - ], - "type" : "PATH", - "value" : "/usr/include" - }, - { - "name" : "X11_Xmu_INCLUDE_PATH", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a file." - } - ], - "type" : "PATH", - "value" : "X11_Xmu_INCLUDE_PATH-NOTFOUND" - }, - { - "name" : "X11_Xmu_LIB", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a library." - } - ], - "type" : "FILEPATH", - "value" : "X11_Xmu_LIB-NOTFOUND" - }, - { - "name" : "X11_Xpm_INCLUDE_PATH", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a file." - } - ], - "type" : "PATH", - "value" : "X11_Xpm_INCLUDE_PATH-NOTFOUND" - }, - { - "name" : "X11_Xpm_LIB", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a library." - } - ], - "type" : "FILEPATH", - "value" : "X11_Xpm_LIB-NOTFOUND" - }, - { - "name" : "X11_Xrandr_INCLUDE_PATH", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a file." - } - ], - "type" : "PATH", - "value" : "/usr/include" - }, - { - "name" : "X11_Xrandr_LIB", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a library." - } - ], - "type" : "FILEPATH", - "value" : "/usr/lib/aarch64-linux-gnu/libXrandr.so" - }, - { - "name" : "X11_Xrender_INCLUDE_PATH", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a file." - } - ], - "type" : "PATH", - "value" : "/usr/include" - }, - { - "name" : "X11_Xrender_LIB", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a library." - } - ], - "type" : "FILEPATH", - "value" : "/usr/lib/aarch64-linux-gnu/libXrender.so" - }, - { - "name" : "X11_Xshape_INCLUDE_PATH", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a file." - } - ], - "type" : "PATH", - "value" : "/usr/include" - }, - { - "name" : "X11_Xss_INCLUDE_PATH", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a file." - } - ], - "type" : "PATH", - "value" : "/usr/include" - }, - { - "name" : "X11_Xss_LIB", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a library." - } - ], - "type" : "FILEPATH", - "value" : "/usr/lib/aarch64-linux-gnu/libXss.so" - }, - { - "name" : "X11_Xt_INCLUDE_PATH", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a file." - } - ], - "type" : "PATH", - "value" : "/usr/include" - }, - { - "name" : "X11_Xt_LIB", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a library." - } - ], - "type" : "FILEPATH", - "value" : "/usr/lib/aarch64-linux-gnu/libXt.so" - }, - { - "name" : "X11_Xtst_INCLUDE_PATH", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a file." - } - ], - "type" : "PATH", - "value" : "/usr/include" - }, - { - "name" : "X11_Xtst_LIB", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a library." - } - ], - "type" : "FILEPATH", - "value" : "/usr/lib/aarch64-linux-gnu/libXtst.so" - }, - { - "name" : "X11_Xutil_INCLUDE_PATH", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a file." - } - ], - "type" : "PATH", - "value" : "/usr/include" - }, - { - "name" : "X11_Xv_INCLUDE_PATH", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a file." - } - ], - "type" : "PATH", - "value" : "/usr/include" - }, - { - "name" : "X11_Xv_LIB", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a library." - } - ], - "type" : "FILEPATH", - "value" : "/usr/lib/aarch64-linux-gnu/libXv.so" - }, - { - "name" : "X11_Xxf86misc_INCLUDE_PATH", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a file." - } - ], - "type" : "PATH", - "value" : "X11_Xxf86misc_INCLUDE_PATH-NOTFOUND" - }, - { - "name" : "X11_Xxf86misc_LIB", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a library." - } - ], - "type" : "FILEPATH", - "value" : "X11_Xxf86misc_LIB-NOTFOUND" - }, - { - "name" : "X11_Xxf86vm_INCLUDE_PATH", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a file." - } - ], - "type" : "PATH", - "value" : "X11_Xxf86vm_INCLUDE_PATH-NOTFOUND" - }, - { - "name" : "X11_Xxf86vm_LIB", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a library." - } - ], - "type" : "FILEPATH", - "value" : "X11_Xxf86vm_LIB-NOTFOUND" - }, - { - "name" : "X11_dpms_INCLUDE_PATH", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a file." - } - ], - "type" : "PATH", - "value" : "/usr/include" - }, - { - "name" : "X11_xkbfile_INCLUDE_PATH", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a file." - } - ], - "type" : "PATH", - "value" : "/usr/include" - }, - { - "name" : "X11_xkbfile_LIB", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a library." - } - ], - "type" : "FILEPATH", - "value" : "/usr/lib/aarch64-linux-gnu/libxkbfile.so" - }, - { - "name" : "__pkg_config_arguments_PKG_FONTCONFIG", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "QUIET;fontconfig" - }, - { - "name" : "__pkg_config_arguments_QGSettings", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "REQUIRED;gsettings-qt" - }, - { - "name" : "__pkg_config_checked_PKG_FONTCONFIG", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "1" - }, - { - "name" : "__pkg_config_checked_QGSettings", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "1" - }, - { - "name" : "pkgcfg_lib_PKG_FONTCONFIG_fontconfig", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a library." - } - ], - "type" : "FILEPATH", - "value" : "/usr/lib/aarch64-linux-gnu/libfontconfig.so" - }, - { - "name" : "pkgcfg_lib_PKG_FONTCONFIG_freetype", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a library." - } - ], - "type" : "FILEPATH", - "value" : "/usr/lib/aarch64-linux-gnu/libfreetype.so" - }, - { - "name" : "pkgcfg_lib_QGSettings_gsettings-qt", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a library." - } - ], - "type" : "FILEPATH", - "value" : "/usr/lib/aarch64-linux-gnu/libgsettings-qt.so" - }, - { - "name" : "prefix_result", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "/usr/lib/aarch64-linux-gnu" - }, - { - "name" : "ukui-window-switch_BINARY_DIR", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Value Computed by CMake" - } - ], - "type" : "STATIC", - "value" : "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build" - }, - { - "name" : "ukui-window-switch_SOURCE_DIR", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Value Computed by CMake" - } - ], - "type" : "STATIC", - "value" : "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch" - }, - { - "name" : "windowsview_LIB_DEPENDS", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Dependencies for the target" - } - ], - "type" : "STATIC", - "value" : "general;Qt5::Core;general;Qt5::Gui;general;Qt5::Widgets;general;Qt5::Quick;general;Qt5::QuickWidgets;general;KF5::ConfigCore;general;KF5::WindowSystem;general;KF5::CoreAddons;general;KF5::GlobalAccel;general;Qt5::X11Extras;general;gsettings-qt;" - } - ], - "kind" : "cache", - "version" : - { - "major" : 2, - "minor" : 0 - } -} diff --git a/build/.cmake/api/v1/reply/codemodel-v2-62e3c06f278d6272a639.json b/build/.cmake/api/v1/reply/codemodel-v2-62e3c06f278d6272a639.json deleted file mode 100644 index 56c1e3d3b4aa0221a29fd9859e45f5eaa4f0eb2a..0000000000000000000000000000000000000000 --- a/build/.cmake/api/v1/reply/codemodel-v2-62e3c06f278d6272a639.json +++ /dev/null @@ -1,146 +0,0 @@ -{ - "configurations" : - [ - { - "directories" : - [ - { - "build" : ".", - "childIndexes" : - [ - 1, - 2 - ], - "hasInstallRule" : true, - "minimumCMakeVersion" : - { - "string" : "3.5" - }, - "projectIndex" : 0, - "source" : ".", - "targetIndexes" : - [ - 1, - 4 - ] - }, - { - "build" : "windowsview", - "hasInstallRule" : true, - "minimumCMakeVersion" : - { - "string" : "3.5" - }, - "parentIndex" : 0, - "projectIndex" : 0, - "source" : "windowsview", - "targetIndexes" : - [ - 0, - 2, - 3, - 5, - 6 - ] - }, - { - "build" : "windowswitchers", - "hasInstallRule" : true, - "minimumCMakeVersion" : - { - "string" : "3.5" - }, - "parentIndex" : 0, - "projectIndex" : 0, - "source" : "windowswitchers" - } - ], - "name" : "Debug", - "projects" : - [ - { - "directoryIndexes" : - [ - 0, - 1, - 2 - ], - "name" : "ukui-window-switch", - "targetIndexes" : - [ - 0, - 1, - 2, - 3, - 4, - 5, - 6 - ] - } - ], - "targets" : - [ - { - "directoryIndex" : 1, - "id" : "KF5Config_QCH::@5fc5302a0d3a0cad8215", - "jsonFile" : "target-KF5Config_QCH-Debug-cd1b715b5a6149536908.json", - "name" : "KF5Config_QCH", - "projectIndex" : 0 - }, - { - "directoryIndex" : 0, - "id" : "KF5CoreAddons_QCH::@6890427a1f51a3e7e1df", - "jsonFile" : "target-KF5CoreAddons_QCH-Debug-264984cd311e34d7a8c8.json", - "name" : "KF5CoreAddons_QCH", - "projectIndex" : 0 - }, - { - "directoryIndex" : 1, - "id" : "KF5GlobalAccel_QCH::@5fc5302a0d3a0cad8215", - "jsonFile" : "target-KF5GlobalAccel_QCH-Debug-aef93c79f0c1414b7358.json", - "name" : "KF5GlobalAccel_QCH", - "projectIndex" : 0 - }, - { - "directoryIndex" : 1, - "id" : "KF5I18n_QCH::@5fc5302a0d3a0cad8215", - "jsonFile" : "target-KF5I18n_QCH-Debug-7f850787b6a7c8cba396.json", - "name" : "KF5I18n_QCH", - "projectIndex" : 0 - }, - { - "directoryIndex" : 0, - "id" : "KF5WindowSystem_QCH::@6890427a1f51a3e7e1df", - "jsonFile" : "target-KF5WindowSystem_QCH-Debug-9b5e3b81275280c9b659.json", - "name" : "KF5WindowSystem_QCH", - "projectIndex" : 0 - }, - { - "directoryIndex" : 1, - "id" : "windowsview::@5fc5302a0d3a0cad8215", - "jsonFile" : "target-windowsview-Debug-9ff11bb8b062b413468b.json", - "name" : "windowsview", - "projectIndex" : 0 - }, - { - "directoryIndex" : 1, - "id" : "windowsview_autogen::@5fc5302a0d3a0cad8215", - "jsonFile" : "target-windowsview_autogen-Debug-a0cfbbc130121d9a6082.json", - "name" : "windowsview_autogen", - "projectIndex" : 0 - } - ] - } - ], - "kind" : "codemodel", - "paths" : - { - "build" : "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build", - "source" : "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch" - }, - "version" : - { - "major" : 2, - "minor" : 0 - } -} diff --git a/build/.cmake/api/v1/reply/index-2022-06-19T03-03-11-0889.json b/build/.cmake/api/v1/reply/index-2022-06-19T03-03-11-0889.json deleted file mode 100644 index 3937e1070637c2ae87f3077ad768d963c70d1bf3..0000000000000000000000000000000000000000 --- a/build/.cmake/api/v1/reply/index-2022-06-19T03-03-11-0889.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "cmake" : - { - "generator" : - { - "name" : "Ninja" - }, - "paths" : - { - "cmake" : "/usr/bin/cmake", - "cpack" : "/usr/bin/cpack", - "ctest" : "/usr/bin/ctest", - "root" : "/usr/share/cmake-3.16" - }, - "version" : - { - "isDirty" : false, - "major" : 3, - "minor" : 16, - "patch" : 3, - "string" : "3.16.3", - "suffix" : "" - } - }, - "objects" : - [ - { - "jsonFile" : "codemodel-v2-62e3c06f278d6272a639.json", - "kind" : "codemodel", - "version" : - { - "major" : 2, - "minor" : 0 - } - }, - { - "jsonFile" : "cache-v2-b23ccf4369602b55edc1.json", - "kind" : "cache", - "version" : - { - "major" : 2, - "minor" : 0 - } - } - ], - "reply" : - { - "client-vscode" : - { - "query.json" : - { - "requests" : - [ - { - "kind" : "cache", - "version" : 2 - }, - { - "kind" : "codemodel", - "version" : 2 - }, - { - "kind" : "toolchains", - "version" : 1 - } - ], - "responses" : - [ - { - "jsonFile" : "cache-v2-b23ccf4369602b55edc1.json", - "kind" : "cache", - "version" : - { - "major" : 2, - "minor" : 0 - } - }, - { - "jsonFile" : "codemodel-v2-62e3c06f278d6272a639.json", - "kind" : "codemodel", - "version" : - { - "major" : 2, - "minor" : 0 - } - }, - { - "error" : "unknown request kind 'toolchains'" - } - ] - } - } - } -} diff --git a/build/.cmake/api/v1/reply/target-KF5Config_QCH-Debug-cd1b715b5a6149536908.json b/build/.cmake/api/v1/reply/target-KF5Config_QCH-Debug-cd1b715b5a6149536908.json deleted file mode 100644 index 6ad19da01fbe433a9f8a31f068922d380cc2197c..0000000000000000000000000000000000000000 --- a/build/.cmake/api/v1/reply/target-KF5Config_QCH-Debug-cd1b715b5a6149536908.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "backtrace" : 5, - "backtraceGraph" : - { - "commands" : - [ - "add_custom_target", - "include", - "find_package" - ], - "files" : - [ - "/usr/lib/aarch64-linux-gnu/cmake/KF5Config/KF5ConfigQchTargets.cmake", - "/usr/lib/aarch64-linux-gnu/cmake/KF5Config/KF5ConfigConfig.cmake", - "windowsview/CMakeLists.txt" - ], - "nodes" : - [ - { - "file" : 2 - }, - { - "command" : 2, - "file" : 2, - "line" : 23, - "parent" : 0 - }, - { - "file" : 1, - "parent" : 1 - }, - { - "command" : 1, - "file" : 1, - "line" : 40, - "parent" : 2 - }, - { - "file" : 0, - "parent" : 3 - }, - { - "command" : 0, - "file" : 0, - "line" : 5, - "parent" : 4 - } - ] - }, - "id" : "KF5Config_QCH::@5fc5302a0d3a0cad8215", - "name" : "KF5Config_QCH", - "paths" : - { - "build" : "windowsview", - "source" : "windowsview" - }, - "sources" : [], - "type" : "UTILITY" -} diff --git a/build/.cmake/api/v1/reply/target-KF5CoreAddons_QCH-Debug-264984cd311e34d7a8c8.json b/build/.cmake/api/v1/reply/target-KF5CoreAddons_QCH-Debug-264984cd311e34d7a8c8.json deleted file mode 100644 index db0e3f3243611c5d2e418f69d5558d5e013cef81..0000000000000000000000000000000000000000 --- a/build/.cmake/api/v1/reply/target-KF5CoreAddons_QCH-Debug-264984cd311e34d7a8c8.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "backtrace" : 5, - "backtraceGraph" : - { - "commands" : - [ - "add_custom_target", - "include", - "find_package" - ], - "files" : - [ - "/usr/lib/aarch64-linux-gnu/cmake/KF5CoreAddons/KF5CoreAddonsQchTargets.cmake", - "/usr/lib/aarch64-linux-gnu/cmake/KF5CoreAddons/KF5CoreAddonsConfig.cmake", - "CMakeLists.txt" - ], - "nodes" : - [ - { - "file" : 2 - }, - { - "command" : 2, - "file" : 2, - "line" : 9, - "parent" : 0 - }, - { - "file" : 1, - "parent" : 1 - }, - { - "command" : 1, - "file" : 1, - "line" : 78, - "parent" : 2 - }, - { - "file" : 0, - "parent" : 3 - }, - { - "command" : 0, - "file" : 0, - "line" : 5, - "parent" : 4 - } - ] - }, - "id" : "KF5CoreAddons_QCH::@6890427a1f51a3e7e1df", - "name" : "KF5CoreAddons_QCH", - "paths" : - { - "build" : ".", - "source" : "." - }, - "sources" : [], - "type" : "UTILITY" -} diff --git a/build/.cmake/api/v1/reply/target-KF5GlobalAccel_QCH-Debug-aef93c79f0c1414b7358.json b/build/.cmake/api/v1/reply/target-KF5GlobalAccel_QCH-Debug-aef93c79f0c1414b7358.json deleted file mode 100644 index 38c1d9d1e47879cd7a9a8bc3cd2b461fc9aaf8ba..0000000000000000000000000000000000000000 --- a/build/.cmake/api/v1/reply/target-KF5GlobalAccel_QCH-Debug-aef93c79f0c1414b7358.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "backtrace" : 5, - "backtraceGraph" : - { - "commands" : - [ - "add_custom_target", - "include", - "find_package" - ], - "files" : - [ - "/usr/lib/aarch64-linux-gnu/cmake/KF5GlobalAccel/KF5GlobalAccelQchTargets.cmake", - "/usr/lib/aarch64-linux-gnu/cmake/KF5GlobalAccel/KF5GlobalAccelConfig.cmake", - "windowsview/CMakeLists.txt" - ], - "nodes" : - [ - { - "file" : 2 - }, - { - "command" : 2, - "file" : 2, - "line" : 24, - "parent" : 0 - }, - { - "file" : 1, - "parent" : 1 - }, - { - "command" : 1, - "file" : 1, - "line" : 44, - "parent" : 2 - }, - { - "file" : 0, - "parent" : 3 - }, - { - "command" : 0, - "file" : 0, - "line" : 5, - "parent" : 4 - } - ] - }, - "id" : "KF5GlobalAccel_QCH::@5fc5302a0d3a0cad8215", - "name" : "KF5GlobalAccel_QCH", - "paths" : - { - "build" : "windowsview", - "source" : "windowsview" - }, - "sources" : [], - "type" : "UTILITY" -} diff --git a/build/.cmake/api/v1/reply/target-KF5I18n_QCH-Debug-7f850787b6a7c8cba396.json b/build/.cmake/api/v1/reply/target-KF5I18n_QCH-Debug-7f850787b6a7c8cba396.json deleted file mode 100644 index 2da780a4ba251e40bcc28c715620d94d68392c85..0000000000000000000000000000000000000000 --- a/build/.cmake/api/v1/reply/target-KF5I18n_QCH-Debug-7f850787b6a7c8cba396.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "backtrace" : 5, - "backtraceGraph" : - { - "commands" : - [ - "add_custom_target", - "include", - "find_package" - ], - "files" : - [ - "/usr/lib/aarch64-linux-gnu/cmake/KF5I18n/KF5I18nQchTargets.cmake", - "/usr/lib/aarch64-linux-gnu/cmake/KF5I18n/KF5I18nConfig.cmake", - "windowsview/CMakeLists.txt" - ], - "nodes" : - [ - { - "file" : 2 - }, - { - "command" : 2, - "file" : 2, - "line" : 25, - "parent" : 0 - }, - { - "file" : 1, - "parent" : 1 - }, - { - "command" : 1, - "file" : 1, - "line" : 42, - "parent" : 2 - }, - { - "file" : 0, - "parent" : 3 - }, - { - "command" : 0, - "file" : 0, - "line" : 5, - "parent" : 4 - } - ] - }, - "id" : "KF5I18n_QCH::@5fc5302a0d3a0cad8215", - "name" : "KF5I18n_QCH", - "paths" : - { - "build" : "windowsview", - "source" : "windowsview" - }, - "sources" : [], - "type" : "UTILITY" -} diff --git a/build/.cmake/api/v1/reply/target-KF5WindowSystem_QCH-Debug-9b5e3b81275280c9b659.json b/build/.cmake/api/v1/reply/target-KF5WindowSystem_QCH-Debug-9b5e3b81275280c9b659.json deleted file mode 100644 index 68b4b3dac5d80c41a738dc6bcaa603294ca21198..0000000000000000000000000000000000000000 --- a/build/.cmake/api/v1/reply/target-KF5WindowSystem_QCH-Debug-9b5e3b81275280c9b659.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "backtrace" : 5, - "backtraceGraph" : - { - "commands" : - [ - "add_custom_target", - "include", - "find_package" - ], - "files" : - [ - "/usr/lib/aarch64-linux-gnu/cmake/KF5WindowSystem/KF5WindowSystemQchTargets.cmake", - "/usr/lib/aarch64-linux-gnu/cmake/KF5WindowSystem/KF5WindowSystemConfig.cmake", - "CMakeLists.txt" - ], - "nodes" : - [ - { - "file" : 2 - }, - { - "command" : 2, - "file" : 2, - "line" : 10, - "parent" : 0 - }, - { - "file" : 1, - "parent" : 1 - }, - { - "command" : 1, - "file" : 1, - "line" : 42, - "parent" : 2 - }, - { - "file" : 0, - "parent" : 3 - }, - { - "command" : 0, - "file" : 0, - "line" : 5, - "parent" : 4 - } - ] - }, - "id" : "KF5WindowSystem_QCH::@6890427a1f51a3e7e1df", - "name" : "KF5WindowSystem_QCH", - "paths" : - { - "build" : ".", - "source" : "." - }, - "sources" : [], - "type" : "UTILITY" -} diff --git a/build/.cmake/api/v1/reply/target-windowsview-Debug-9ff11bb8b062b413468b.json b/build/.cmake/api/v1/reply/target-windowsview-Debug-9ff11bb8b062b413468b.json deleted file mode 100644 index bc0b91212771f6836022ec638b5e230336f49641..0000000000000000000000000000000000000000 --- a/build/.cmake/api/v1/reply/target-windowsview-Debug-9ff11bb8b062b413468b.json +++ /dev/null @@ -1,429 +0,0 @@ -{ - "artifacts" : - [ - { - "path" : "windowsview/libwindowsview.so" - } - ], - "backtrace" : 1, - "backtraceGraph" : - { - "commands" : - [ - "add_library", - "install", - "target_link_libraries", - "include_directories" - ], - "files" : - [ - "windowsview/CMakeLists.txt", - "CMakeLists.txt" - ], - "nodes" : - [ - { - "file" : 0 - }, - { - "command" : 0, - "file" : 0, - "line" : 40, - "parent" : 0 - }, - { - "command" : 1, - "file" : 0, - "line" : 64, - "parent" : 0 - }, - { - "command" : 2, - "file" : 0, - "line" : 47, - "parent" : 0 - }, - { - "file" : 1 - }, - { - "command" : 3, - "file" : 1, - "line" : 7, - "parent" : 4 - }, - { - "command" : 3, - "file" : 0, - "line" : 45, - "parent" : 0 - } - ] - }, - "compileGroups" : - [ - { - "compileCommandFragments" : - [ - { - "fragment" : "-g -fPIC " - }, - { - "backtrace" : 3, - "fragment" : "-fPIC" - }, - { - "fragment" : "-std=gnu++14" - } - ], - "defines" : - [ - { - "backtrace" : 3, - "define" : "KCOREADDONS_LIB" - }, - { - "backtrace" : 3, - "define" : "QT_CORE_LIB" - }, - { - "backtrace" : 3, - "define" : "QT_DBUS_LIB" - }, - { - "backtrace" : 3, - "define" : "QT_GUI_LIB" - }, - { - "backtrace" : 3, - "define" : "QT_NETWORK_LIB" - }, - { - "backtrace" : 3, - "define" : "QT_QML_LIB" - }, - { - "backtrace" : 3, - "define" : "QT_QUICKWIDGETS_LIB" - }, - { - "backtrace" : 3, - "define" : "QT_QUICK_LIB" - }, - { - "backtrace" : 3, - "define" : "QT_WIDGETS_LIB" - }, - { - "backtrace" : 3, - "define" : "QT_X11EXTRAS_LIB" - }, - { - "define" : "windowsview_EXPORTS" - } - ], - "includes" : - [ - { - "path" : "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/windowsview" - }, - { - "path" : "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/windowsview" - }, - { - "backtrace" : 0, - "path" : "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/windowsview/windowsview_autogen/include" - }, - { - "backtrace" : 5, - "path" : "/usr/include/aarch64-linux-gnu/qt5/QGSettings" - }, - { - "backtrace" : 6, - "path" : "/usr/include/kwin" - }, - { - "backtrace" : 3, - "isSystem" : true, - "path" : "/usr/include/aarch64-linux-gnu/qt5" - }, - { - "backtrace" : 3, - "isSystem" : true, - "path" : "/usr/include/aarch64-linux-gnu/qt5/QtCore" - }, - { - "backtrace" : 3, - "isSystem" : true, - "path" : "/usr/lib/aarch64-linux-gnu/qt5/mkspecs/linux-g++" - }, - { - "backtrace" : 3, - "isSystem" : true, - "path" : "/usr/include/aarch64-linux-gnu/qt5/QtGui" - }, - { - "backtrace" : 3, - "isSystem" : true, - "path" : "/usr/include/aarch64-linux-gnu/qt5/QtWidgets" - }, - { - "backtrace" : 3, - "isSystem" : true, - "path" : "/usr/include/aarch64-linux-gnu/qt5/QtQuick" - }, - { - "backtrace" : 3, - "isSystem" : true, - "path" : "/usr/include/aarch64-linux-gnu/qt5/QtQml" - }, - { - "backtrace" : 3, - "isSystem" : true, - "path" : "/usr/include/aarch64-linux-gnu/qt5/QtNetwork" - }, - { - "backtrace" : 3, - "isSystem" : true, - "path" : "/usr/include/aarch64-linux-gnu/qt5/QtQuickWidgets" - }, - { - "backtrace" : 3, - "isSystem" : true, - "path" : "/usr/include/KF5/KConfigCore" - }, - { - "backtrace" : 3, - "isSystem" : true, - "path" : "/usr/include/KF5" - }, - { - "backtrace" : 3, - "isSystem" : true, - "path" : "/usr/include/KF5/KWindowSystem" - }, - { - "backtrace" : 3, - "isSystem" : true, - "path" : "/usr/include/KF5/KCoreAddons" - }, - { - "backtrace" : 3, - "isSystem" : true, - "path" : "/usr/include/KF5/KGlobalAccel" - }, - { - "backtrace" : 3, - "isSystem" : true, - "path" : "/usr/include/aarch64-linux-gnu/qt5/QtDBus" - }, - { - "backtrace" : 3, - "isSystem" : true, - "path" : "/usr/include/aarch64-linux-gnu/qt5/QtX11Extras" - } - ], - "language" : "CXX", - "sourceIndexes" : - [ - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7 - ] - } - ], - "dependencies" : - [ - { - "backtrace" : 0, - "id" : "windowsview_autogen::@5fc5302a0d3a0cad8215" - } - ], - "id" : "windowsview::@5fc5302a0d3a0cad8215", - "install" : - { - "destinations" : - [ - { - "backtrace" : 2, - "path" : "/usr/lib/aarch64-linux-gnu/qt5/plugins/kwin/effects/plugins" - } - ], - "prefix" : - { - "path" : "/usr/local" - } - }, - "link" : - { - "commandFragments" : - [ - { - "fragment" : "", - "role" : "flags" - }, - { - "backtrace" : 3, - "fragment" : "/usr/lib/aarch64-linux-gnu/libQt5QuickWidgets.so.5.12.8", - "role" : "libraries" - }, - { - "backtrace" : 3, - "fragment" : "/usr/lib/aarch64-linux-gnu/libKF5ConfigCore.so.5.68.0", - "role" : "libraries" - }, - { - "backtrace" : 3, - "fragment" : "/usr/lib/aarch64-linux-gnu/libKF5WindowSystem.so.5.68.0", - "role" : "libraries" - }, - { - "backtrace" : 3, - "fragment" : "/usr/lib/aarch64-linux-gnu/libKF5CoreAddons.so.5.68.0", - "role" : "libraries" - }, - { - "backtrace" : 3, - "fragment" : "/usr/lib/aarch64-linux-gnu/libKF5GlobalAccel.so.5.68.0", - "role" : "libraries" - }, - { - "backtrace" : 3, - "fragment" : "/usr/lib/aarch64-linux-gnu/libQt5X11Extras.so.5.12.8", - "role" : "libraries" - }, - { - "fragment" : "-lgsettings-qt", - "role" : "libraries" - }, - { - "backtrace" : 3, - "fragment" : "/usr/lib/aarch64-linux-gnu/libQt5Quick.so.5.12.8", - "role" : "libraries" - }, - { - "fragment" : "/usr/lib/aarch64-linux-gnu/libQt5Qml.so.5.12.8", - "role" : "libraries" - }, - { - "fragment" : "/usr/lib/aarch64-linux-gnu/libQt5Network.so.5.12.8", - "role" : "libraries" - }, - { - "backtrace" : 3, - "fragment" : "/usr/lib/aarch64-linux-gnu/libQt5Widgets.so.5.12.8", - "role" : "libraries" - }, - { - "backtrace" : 3, - "fragment" : "/usr/lib/aarch64-linux-gnu/libQt5Gui.so.5.12.8", - "role" : "libraries" - }, - { - "fragment" : "/usr/lib/aarch64-linux-gnu/libQt5DBus.so.5.12.8", - "role" : "libraries" - }, - { - "backtrace" : 3, - "fragment" : "/usr/lib/aarch64-linux-gnu/libQt5Core.so.5.12.8", - "role" : "libraries" - } - ], - "language" : "CXX" - }, - "name" : "windowsview", - "nameOnDisk" : "libwindowsview.so", - "paths" : - { - "build" : "windowsview", - "source" : "windowsview" - }, - "sourceGroups" : - [ - { - "name" : "Source Files", - "sourceIndexes" : - [ - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7 - ] - }, - { - "name" : "", - "sourceIndexes" : - [ - 8 - ] - } - ], - "sources" : - [ - { - "backtrace" : 0, - "compileGroupIndex" : 0, - "isGenerated" : true, - "path" : "build/windowsview/windowsview_autogen/mocs_compilation.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "windowsview/desktopbackground.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "windowsview/icontheme.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "windowsview/multitaskviewmodel.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "windowsview/multitaskviewmanager.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "windowsview/dbusservice.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "windowsview/multitaskviewmanagerpluginfactory.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "isGenerated" : true, - "path" : "build/windowsview/qrc_data.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 0, - "path" : "windowsview/data.qrc", - "sourceGroupIndex" : 1 - } - ], - "type" : "MODULE_LIBRARY" -} diff --git a/build/.cmake/api/v1/reply/target-windowsview_autogen-Debug-a0cfbbc130121d9a6082.json b/build/.cmake/api/v1/reply/target-windowsview_autogen-Debug-a0cfbbc130121d9a6082.json deleted file mode 100644 index b163b9b56fa53d534b3a9f4932cb333e7c79399c..0000000000000000000000000000000000000000 --- a/build/.cmake/api/v1/reply/target-windowsview_autogen-Debug-a0cfbbc130121d9a6082.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "backtrace" : 0, - "backtraceGraph" : - { - "commands" : [], - "files" : - [ - "windowsview/CMakeLists.txt" - ], - "nodes" : - [ - { - "file" : 0 - } - ] - }, - "id" : "windowsview_autogen::@5fc5302a0d3a0cad8215", - "isGeneratorProvided" : true, - "name" : "windowsview_autogen", - "paths" : - { - "build" : "windowsview", - "source" : "windowsview" - }, - "sourceGroups" : - [ - { - "name" : "", - "sourceIndexes" : - [ - 0 - ] - }, - { - "name" : "CMake Rules", - "sourceIndexes" : - [ - 1 - ] - } - ], - "sources" : - [ - { - "backtrace" : 0, - "isGenerated" : true, - "path" : "build/windowsview/CMakeFiles/windowsview_autogen", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 0, - "isGenerated" : true, - "path" : "build/windowsview/CMakeFiles/windowsview_autogen.rule", - "sourceGroupIndex" : 1 - } - ], - "type" : "UTILITY" -} diff --git a/build/CMakeCache.txt b/build/CMakeCache.txt deleted file mode 100644 index 90c54342eeaebe0f7d2dbcd1e715b9bbf70571b1..0000000000000000000000000000000000000000 --- a/build/CMakeCache.txt +++ /dev/null @@ -1,919 +0,0 @@ -# This is the CMakeCache file. -# For build in directory: /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build -# It was generated by CMake: /usr/bin/cmake -# You can edit this file to change values found and used by cmake. -# If you do not want to change any of the values, simply exit the editor. -# If you do want to change a value, simply edit, save, and exit the editor. -# The syntax for the file is as follows: -# KEY:TYPE=VALUE -# KEY is the name of a variable in the cache. -# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!. -# VALUE is the current value for the KEY. - -######################## -# EXTERNAL cache entries -######################## - -//Path to a program. -CMAKE_ADDR2LINE:FILEPATH=/bin/addr2line - -//Path to a program. -CMAKE_AR:FILEPATH=/bin/ar - -//No help, variable specified on the command line. -CMAKE_BUILD_TYPE:STRING=Debug - -//CXX compiler -CMAKE_CXX_COMPILER:FILEPATH=/bin/c++ - -//A wrapper around 'ar' adding the appropriate '--plugin' option -// for the GCC compiler -CMAKE_CXX_COMPILER_AR:FILEPATH=/bin/gcc-ar-9 - -//A wrapper around 'ranlib' adding the appropriate '--plugin' option -// for the GCC compiler -CMAKE_CXX_COMPILER_RANLIB:FILEPATH=/bin/gcc-ranlib-9 - -//Flags used by the CXX compiler during all build types. -CMAKE_CXX_FLAGS:STRING= - -//Flags used by the CXX compiler during DEBUG builds. -CMAKE_CXX_FLAGS_DEBUG:STRING=-g - -//Flags used by the CXX compiler during MINSIZEREL builds. -CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG - -//Flags used by the CXX compiler during RELEASE builds. -CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG - -//Flags used by the CXX compiler during RELWITHDEBINFO builds. -CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG - -//No help, variable specified on the command line. -CMAKE_C_COMPILER:FILEPATH=/bin/c99-gcc - -//A wrapper around 'ar' adding the appropriate '--plugin' option -// for the GCC compiler -CMAKE_C_COMPILER_AR:FILEPATH=/bin/gcc-ar-9 - -//A wrapper around 'ranlib' adding the appropriate '--plugin' option -// for the GCC compiler -CMAKE_C_COMPILER_RANLIB:FILEPATH=/bin/gcc-ranlib-9 - -//Flags used by the C compiler during all build types. -CMAKE_C_FLAGS:STRING= - -//Flags used by the C compiler during DEBUG builds. -CMAKE_C_FLAGS_DEBUG:STRING=-g - -//Flags used by the C compiler during MINSIZEREL builds. -CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG - -//Flags used by the C compiler during RELEASE builds. -CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG - -//Flags used by the C compiler during RELWITHDEBINFO builds. -CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG - -//Path to a program. -CMAKE_DLLTOOL:FILEPATH=CMAKE_DLLTOOL-NOTFOUND - -//Flags used by the linker during all build types. -CMAKE_EXE_LINKER_FLAGS:STRING= - -//Flags used by the linker during DEBUG builds. -CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during MINSIZEREL builds. -CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during RELEASE builds. -CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during RELWITHDEBINFO builds. -CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//No help, variable specified on the command line. -CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE - -//Install path prefix, prepended onto install directories. -CMAKE_INSTALL_PREFIX:PATH=/usr/local - -//Path to a program. -CMAKE_LINKER:FILEPATH=/bin/ld - -//Program used to build from build.ninja files. -CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/ninja - -//Flags used by the linker during the creation of modules during -// all build types. -CMAKE_MODULE_LINKER_FLAGS:STRING= - -//Flags used by the linker during the creation of modules during -// DEBUG builds. -CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during the creation of modules during -// MINSIZEREL builds. -CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during the creation of modules during -// RELEASE builds. -CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during the creation of modules during -// RELWITHDEBINFO builds. -CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//Path to a program. -CMAKE_NM:FILEPATH=/bin/nm - -//Path to a program. -CMAKE_OBJCOPY:FILEPATH=/bin/objcopy - -//Path to a program. -CMAKE_OBJDUMP:FILEPATH=/bin/objdump - -//Value Computed by CMake -CMAKE_PROJECT_DESCRIPTION:STATIC= - -//Value Computed by CMake -CMAKE_PROJECT_HOMEPAGE_URL:STATIC= - -//Value Computed by CMake -CMAKE_PROJECT_NAME:STATIC=ukui-window-switch - -//Path to a program. -CMAKE_RANLIB:FILEPATH=/bin/ranlib - -//Path to a program. -CMAKE_READELF:FILEPATH=/bin/readelf - -//Flags used by the linker during the creation of shared libraries -// during all build types. -CMAKE_SHARED_LINKER_FLAGS:STRING= - -//Flags used by the linker during the creation of shared libraries -// during DEBUG builds. -CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during the creation of shared libraries -// during MINSIZEREL builds. -CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during the creation of shared libraries -// during RELEASE builds. -CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during the creation of shared libraries -// during RELWITHDEBINFO builds. -CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//If set, runtime paths are not added when installing shared libraries, -// but are added when building. -CMAKE_SKIP_INSTALL_RPATH:BOOL=NO - -//If set, runtime paths are not added when using shared libraries. -CMAKE_SKIP_RPATH:BOOL=NO - -//Flags used by the linker during the creation of static libraries -// during all build types. -CMAKE_STATIC_LINKER_FLAGS:STRING= - -//Flags used by the linker during the creation of static libraries -// during DEBUG builds. -CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during the creation of static libraries -// during MINSIZEREL builds. -CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during the creation of static libraries -// during RELEASE builds. -CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during the creation of static libraries -// during RELWITHDEBINFO builds. -CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//Path to a program. -CMAKE_STRIP:FILEPATH=/bin/strip - -//If this value is on, makefiles will be generated without the -// .SILENT directive, and all commands will be echoed to the console -// during the make. This is useful for debugging only. With Visual -// Studio IDE projects all commands are done without /nologo. -CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE - -//The directory containing a CMake configuration file for ECM. -ECM_DIR:PATH=/usr/share/ECM/cmake - -//The directory containing a CMake configuration file for EGL. -EGL_DIR:PATH=EGL_DIR-NOTFOUND - -//Path to a file. -FREETYPE_INCLUDE_DIR_freetype2:PATH=/usr/include/freetype2 - -//Path to a file. -FREETYPE_INCLUDE_DIR_ft2build:PATH=/usr/include/freetype2 - -//Path to a library. -FREETYPE_LIBRARY_DEBUG:FILEPATH=FREETYPE_LIBRARY_DEBUG-NOTFOUND - -//Path to a library. -FREETYPE_LIBRARY_RELEASE:FILEPATH=/usr/lib/aarch64-linux-gnu/libfreetype.so - -//Path to a file. -Fontconfig_INCLUDE_DIR:PATH=/usr/include - -//Path to a library. -Fontconfig_LIBRARY:FILEPATH=/usr/lib/aarch64-linux-gnu/libfontconfig.so - -//Path to a program. -GETTEXT_MSGFMT_EXECUTABLE:FILEPATH=/usr/bin/msgfmt - -//Path to a program. -GETTEXT_MSGMERGE_EXECUTABLE:FILEPATH=/usr/bin/msgmerge - -//The directory containing a CMake configuration file for KF5Config. -KF5Config_DIR:PATH=/usr/lib/aarch64-linux-gnu/cmake/KF5Config - -//The directory containing a CMake configuration file for KF5CoreAddons. -KF5CoreAddons_DIR:PATH=/usr/lib/aarch64-linux-gnu/cmake/KF5CoreAddons - -//The directory containing a CMake configuration file for KF5GlobalAccel. -KF5GlobalAccel_DIR:PATH=/usr/lib/aarch64-linux-gnu/cmake/KF5GlobalAccel - -//The directory containing a CMake configuration file for KF5I18n. -KF5I18n_DIR:PATH=/usr/lib/aarch64-linux-gnu/cmake/KF5I18n - -//The directory containing a CMake configuration file for KF5WindowSystem. -KF5WindowSystem_DIR:PATH=/usr/lib/aarch64-linux-gnu/cmake/KF5WindowSystem - -//Path to a program. -KI18N_PYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3 - -//Path to a file. -OPENGL_EGL_INCLUDE_DIR:PATH=/usr/include - -//Path to a file. -OPENGL_GLX_INCLUDE_DIR:PATH=/usr/include - -//Path to a file. -OPENGL_INCLUDE_DIR:PATH=/usr/include - -//Path to a library. -OPENGL_egl_LIBRARY:FILEPATH=/usr/lib/aarch64-linux-gnu/libEGL.so - -//Path to a library. -OPENGL_gl_LIBRARY:FILEPATH=/usr/lib/aarch64-linux-gnu/libGL.so - -//Path to a library. -OPENGL_glu_LIBRARY:FILEPATH=/usr/lib/aarch64-linux-gnu/libGLU.so - -//Path to a library. -OPENGL_glx_LIBRARY:FILEPATH=/usr/lib/aarch64-linux-gnu/libGLX.so - -//Path to a library. -OPENGL_opengl_LIBRARY:FILEPATH=/usr/lib/aarch64-linux-gnu/libOpenGL.so - -//Path to a file. -OPENGL_xmesa_INCLUDE_DIR:PATH=OPENGL_xmesa_INCLUDE_DIR-NOTFOUND - -//pkg-config executable -PKG_CONFIG_EXECUTABLE:FILEPATH=/usr/bin/pkg-config - -//The directory containing a CMake configuration file for Qt5Core. -Qt5Core_DIR:PATH=/usr/lib/aarch64-linux-gnu/cmake/Qt5Core - -//The directory containing a CMake configuration file for Qt5DBus. -Qt5DBus_DIR:PATH=/usr/lib/aarch64-linux-gnu/cmake/Qt5DBus - -//The directory containing a CMake configuration file for Qt5Gui. -Qt5Gui_DIR:PATH=/usr/lib/aarch64-linux-gnu/cmake/Qt5Gui - -//The directory containing a CMake configuration file for Qt5LinguistTools. -Qt5LinguistTools_DIR:PATH=/usr/lib/aarch64-linux-gnu/cmake/Qt5LinguistTools - -//The directory containing a CMake configuration file for Qt5Network. -Qt5Network_DIR:PATH=/usr/lib/aarch64-linux-gnu/cmake/Qt5Network - -//The directory containing a CMake configuration file for Qt5Qml. -Qt5Qml_DIR:PATH=/usr/lib/aarch64-linux-gnu/cmake/Qt5Qml - -//The directory containing a CMake configuration file for Qt5QuickWidgets. -Qt5QuickWidgets_DIR:PATH=/usr/lib/aarch64-linux-gnu/cmake/Qt5QuickWidgets - -//The directory containing a CMake configuration file for Qt5Quick. -Qt5Quick_DIR:PATH=/usr/lib/aarch64-linux-gnu/cmake/Qt5Quick - -//The directory containing a CMake configuration file for Qt5Widgets. -Qt5Widgets_DIR:PATH=/usr/lib/aarch64-linux-gnu/cmake/Qt5Widgets - -//The directory containing a CMake configuration file for Qt5X11Extras. -Qt5X11Extras_DIR:PATH=/usr/lib/aarch64-linux-gnu/cmake/Qt5X11Extras - -//The directory containing a CMake configuration file for Qt5Xml. -Qt5Xml_DIR:PATH=/usr/lib/aarch64-linux-gnu/cmake/Qt5Xml - -//The directory containing a CMake configuration file for Qt5. -Qt5_DIR:PATH=/usr/lib/aarch64-linux-gnu/cmake/Qt5 - -//Path to a file. -X11_ICE_INCLUDE_PATH:PATH=/usr/include - -//Path to a library. -X11_ICE_LIB:FILEPATH=/usr/lib/aarch64-linux-gnu/libICE.so - -//Path to a file. -X11_SM_INCLUDE_PATH:PATH=/usr/include - -//Path to a library. -X11_SM_LIB:FILEPATH=/usr/lib/aarch64-linux-gnu/libSM.so - -//Path to a file. -X11_X11_INCLUDE_PATH:PATH=/usr/include - -//Path to a library. -X11_X11_LIB:FILEPATH=/usr/lib/aarch64-linux-gnu/libX11.so - -//Path to a file. -X11_XRes_INCLUDE_PATH:PATH=/usr/include - -//Path to a library. -X11_XRes_LIB:FILEPATH=/usr/lib/aarch64-linux-gnu/libXRes.so - -//Path to a file. -X11_XShm_INCLUDE_PATH:PATH=/usr/include - -//Path to a file. -X11_XSync_INCLUDE_PATH:PATH=/usr/include - -//Path to a file. -X11_Xaccessrules_INCLUDE_PATH:PATH=/usr/include - -//Path to a file. -X11_Xaccessstr_INCLUDE_PATH:PATH=/usr/include - -//Path to a file. -X11_Xau_INCLUDE_PATH:PATH=/usr/include - -//Path to a library. -X11_Xau_LIB:FILEPATH=/usr/lib/aarch64-linux-gnu/libXau.so - -//Path to a file. -X11_Xcomposite_INCLUDE_PATH:PATH=/usr/include - -//Path to a library. -X11_Xcomposite_LIB:FILEPATH=/usr/lib/aarch64-linux-gnu/libXcomposite.so - -//Path to a file. -X11_Xcursor_INCLUDE_PATH:PATH=/usr/include - -//Path to a library. -X11_Xcursor_LIB:FILEPATH=/usr/lib/aarch64-linux-gnu/libXcursor.so - -//Path to a file. -X11_Xdamage_INCLUDE_PATH:PATH=/usr/include - -//Path to a library. -X11_Xdamage_LIB:FILEPATH=/usr/lib/aarch64-linux-gnu/libXdamage.so - -//Path to a file. -X11_Xdmcp_INCLUDE_PATH:PATH=/usr/include - -//Path to a library. -X11_Xdmcp_LIB:FILEPATH=/usr/lib/aarch64-linux-gnu/libXdmcp.so - -//Path to a file. -X11_Xext_INCLUDE_PATH:PATH=/usr/include - -//Path to a library. -X11_Xext_LIB:FILEPATH=/usr/lib/aarch64-linux-gnu/libXext.so - -//Path to a file. -X11_Xfixes_INCLUDE_PATH:PATH=/usr/include - -//Path to a library. -X11_Xfixes_LIB:FILEPATH=/usr/lib/aarch64-linux-gnu/libXfixes.so - -//Path to a file. -X11_Xft_INCLUDE_PATH:PATH=/usr/include - -//Path to a library. -X11_Xft_LIB:FILEPATH=/usr/lib/aarch64-linux-gnu/libXft.so - -//Path to a file. -X11_Xi_INCLUDE_PATH:PATH=/usr/include - -//Path to a library. -X11_Xi_LIB:FILEPATH=/usr/lib/aarch64-linux-gnu/libXi.so - -//Path to a file. -X11_Xinerama_INCLUDE_PATH:PATH=/usr/include - -//Path to a library. -X11_Xinerama_LIB:FILEPATH=/usr/lib/aarch64-linux-gnu/libXinerama.so - -//Path to a file. -X11_Xkb_INCLUDE_PATH:PATH=/usr/include - -//Path to a file. -X11_Xkblib_INCLUDE_PATH:PATH=/usr/include - -//Path to a file. -X11_Xlib_INCLUDE_PATH:PATH=/usr/include - -//Path to a file. -X11_Xmu_INCLUDE_PATH:PATH=X11_Xmu_INCLUDE_PATH-NOTFOUND - -//Path to a library. -X11_Xmu_LIB:FILEPATH=X11_Xmu_LIB-NOTFOUND - -//Path to a file. -X11_Xpm_INCLUDE_PATH:PATH=X11_Xpm_INCLUDE_PATH-NOTFOUND - -//Path to a library. -X11_Xpm_LIB:FILEPATH=X11_Xpm_LIB-NOTFOUND - -//Path to a file. -X11_Xrandr_INCLUDE_PATH:PATH=/usr/include - -//Path to a library. -X11_Xrandr_LIB:FILEPATH=/usr/lib/aarch64-linux-gnu/libXrandr.so - -//Path to a file. -X11_Xrender_INCLUDE_PATH:PATH=/usr/include - -//Path to a library. -X11_Xrender_LIB:FILEPATH=/usr/lib/aarch64-linux-gnu/libXrender.so - -//Path to a file. -X11_Xshape_INCLUDE_PATH:PATH=/usr/include - -//Path to a file. -X11_Xss_INCLUDE_PATH:PATH=/usr/include - -//Path to a library. -X11_Xss_LIB:FILEPATH=/usr/lib/aarch64-linux-gnu/libXss.so - -//Path to a file. -X11_Xt_INCLUDE_PATH:PATH=/usr/include - -//Path to a library. -X11_Xt_LIB:FILEPATH=/usr/lib/aarch64-linux-gnu/libXt.so - -//Path to a file. -X11_Xtst_INCLUDE_PATH:PATH=/usr/include - -//Path to a library. -X11_Xtst_LIB:FILEPATH=/usr/lib/aarch64-linux-gnu/libXtst.so - -//Path to a file. -X11_Xutil_INCLUDE_PATH:PATH=/usr/include - -//Path to a file. -X11_Xv_INCLUDE_PATH:PATH=/usr/include - -//Path to a library. -X11_Xv_LIB:FILEPATH=/usr/lib/aarch64-linux-gnu/libXv.so - -//Path to a file. -X11_Xxf86misc_INCLUDE_PATH:PATH=X11_Xxf86misc_INCLUDE_PATH-NOTFOUND - -//Path to a library. -X11_Xxf86misc_LIB:FILEPATH=X11_Xxf86misc_LIB-NOTFOUND - -//Path to a file. -X11_Xxf86vm_INCLUDE_PATH:PATH=X11_Xxf86vm_INCLUDE_PATH-NOTFOUND - -//Path to a library. -X11_Xxf86vm_LIB:FILEPATH=X11_Xxf86vm_LIB-NOTFOUND - -//Path to a file. -X11_dpms_INCLUDE_PATH:PATH=/usr/include - -//Path to a file. -X11_xkbfile_INCLUDE_PATH:PATH=/usr/include - -//Path to a library. -X11_xkbfile_LIB:FILEPATH=/usr/lib/aarch64-linux-gnu/libxkbfile.so - -//Path to a library. -pkgcfg_lib_PKG_FONTCONFIG_fontconfig:FILEPATH=/usr/lib/aarch64-linux-gnu/libfontconfig.so - -//Path to a library. -pkgcfg_lib_PKG_FONTCONFIG_freetype:FILEPATH=/usr/lib/aarch64-linux-gnu/libfreetype.so - -//Path to a library. -pkgcfg_lib_QGSettings_gsettings-qt:FILEPATH=/usr/lib/aarch64-linux-gnu/libgsettings-qt.so - -//Value Computed by CMake -ukui-window-switch_BINARY_DIR:STATIC=/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build - -//Value Computed by CMake -ukui-window-switch_SOURCE_DIR:STATIC=/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch - -//Dependencies for the target -windowsview_LIB_DEPENDS:STATIC=general;Qt5::Core;general;Qt5::Gui;general;Qt5::Widgets;general;Qt5::Quick;general;Qt5::QuickWidgets;general;KF5::ConfigCore;general;KF5::WindowSystem;general;KF5::CoreAddons;general;KF5::GlobalAccel;general;Qt5::X11Extras;general;gsettings-qt; - - -######################## -# INTERNAL cache entries -######################## - -//ADVANCED property for variable: CMAKE_ADDR2LINE -CMAKE_ADDR2LINE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_AR -CMAKE_AR-ADVANCED:INTERNAL=1 -//This is the directory where this CMakeCache.txt was created -CMAKE_CACHEFILE_DIR:INTERNAL=/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build -//Major version of cmake used to create the current loaded cache -CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3 -//Minor version of cmake used to create the current loaded cache -CMAKE_CACHE_MINOR_VERSION:INTERNAL=16 -//Patch version of cmake used to create the current loaded cache -CMAKE_CACHE_PATCH_VERSION:INTERNAL=3 -//Path to CMake executable. -CMAKE_COMMAND:INTERNAL=/usr/bin/cmake -//Path to cpack program executable. -CMAKE_CPACK_COMMAND:INTERNAL=/usr/bin/cpack -//Path to ctest program executable. -CMAKE_CTEST_COMMAND:INTERNAL=/usr/bin/ctest -//ADVANCED property for variable: CMAKE_CXX_COMPILER -CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_COMPILER_AR -CMAKE_CXX_COMPILER_AR-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_COMPILER_RANLIB -CMAKE_CXX_COMPILER_RANLIB-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS -CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_DEBUG -CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_MINSIZEREL -CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELEASE -CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO -CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_COMPILER -CMAKE_C_COMPILER-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_COMPILER_AR -CMAKE_C_COMPILER_AR-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_COMPILER_RANLIB -CMAKE_C_COMPILER_RANLIB-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS -CMAKE_C_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG -CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL -CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE -CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO -CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_DLLTOOL -CMAKE_DLLTOOL-ADVANCED:INTERNAL=1 -//Executable file format -CMAKE_EXECUTABLE_FORMAT:INTERNAL=ELF -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS -CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG -CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL -CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE -CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS -CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1 -//Name of external makefile project generator. -CMAKE_EXTRA_GENERATOR:INTERNAL= -//Name of generator. -CMAKE_GENERATOR:INTERNAL=Ninja -//Generator instance identifier. -CMAKE_GENERATOR_INSTANCE:INTERNAL= -//Name of generator platform. -CMAKE_GENERATOR_PLATFORM:INTERNAL= -//Name of generator toolset. -CMAKE_GENERATOR_TOOLSET:INTERNAL= -//Have function connect -CMAKE_HAVE_CONNECT:INTERNAL=1 -//Have function gethostbyname -CMAKE_HAVE_GETHOSTBYNAME:INTERNAL=1 -//Have function remove -CMAKE_HAVE_REMOVE:INTERNAL=1 -//Have function shmat -CMAKE_HAVE_SHMAT:INTERNAL=1 -//Source directory with the top level CMakeLists.txt file for this -// project -CMAKE_HOME_DIRECTORY:INTERNAL=/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch -//Install .so files without execute permission. -CMAKE_INSTALL_SO_NO_EXE:INTERNAL=1 -//Have library ICE -CMAKE_LIB_ICE_HAS_ICECONNECTIONNUMBER:INTERNAL=1 -//ADVANCED property for variable: CMAKE_LINKER -CMAKE_LINKER-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MAKE_PROGRAM -CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS -CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG -CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL -CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE -CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_NM -CMAKE_NM-ADVANCED:INTERNAL=1 -//number of local generators -CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=3 -//ADVANCED property for variable: CMAKE_OBJCOPY -CMAKE_OBJCOPY-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_OBJDUMP -CMAKE_OBJDUMP-ADVANCED:INTERNAL=1 -//Platform information initialized -CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_RANLIB -CMAKE_RANLIB-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_READELF -CMAKE_READELF-ADVANCED:INTERNAL=1 -//Path to CMake installation. -CMAKE_ROOT:INTERNAL=/usr/share/cmake-3.16 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS -CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG -CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL -CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE -CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH -CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SKIP_RPATH -CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS -CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG -CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL -CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE -CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STRIP -CMAKE_STRIP-ADVANCED:INTERNAL=1 -//uname command -CMAKE_UNAME:INTERNAL=/usr/bin/uname -//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE -CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 -//Details about finding Gettext -FIND_PACKAGE_MESSAGE_DETAILS_Gettext:INTERNAL=[/usr/bin/msgmerge][/usr/bin/msgfmt][v0.19.8.1()] -//Details about finding OpenGL -FIND_PACKAGE_MESSAGE_DETAILS_OpenGL:INTERNAL=[/usr/lib/aarch64-linux-gnu/libOpenGL.so][/usr/lib/aarch64-linux-gnu/libGLX.so][/usr/include][c ][v()] -//Details about finding PkgConfig -FIND_PACKAGE_MESSAGE_DETAILS_PkgConfig:INTERNAL=[/usr/bin/pkg-config][v0.29.1()] -//Details about finding X11 -FIND_PACKAGE_MESSAGE_DETAILS_X11:INTERNAL=[/usr/include][/usr/lib/aarch64-linux-gnu/libX11.so][c ][v()] -//ADVANCED property for variable: FREETYPE_INCLUDE_DIR_freetype2 -FREETYPE_INCLUDE_DIR_freetype2-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: FREETYPE_INCLUDE_DIR_ft2build -FREETYPE_INCLUDE_DIR_ft2build-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: FREETYPE_LIBRARY_DEBUG -FREETYPE_LIBRARY_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: FREETYPE_LIBRARY_RELEASE -FREETYPE_LIBRARY_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: Fontconfig_INCLUDE_DIR -Fontconfig_INCLUDE_DIR-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: Fontconfig_LIBRARY -Fontconfig_LIBRARY-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: OPENGL_EGL_INCLUDE_DIR -OPENGL_EGL_INCLUDE_DIR-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: OPENGL_GLX_INCLUDE_DIR -OPENGL_GLX_INCLUDE_DIR-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: OPENGL_INCLUDE_DIR -OPENGL_INCLUDE_DIR-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: OPENGL_egl_LIBRARY -OPENGL_egl_LIBRARY-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: OPENGL_gl_LIBRARY -OPENGL_gl_LIBRARY-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: OPENGL_glu_LIBRARY -OPENGL_glu_LIBRARY-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: OPENGL_glx_LIBRARY -OPENGL_glx_LIBRARY-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: OPENGL_opengl_LIBRARY -OPENGL_opengl_LIBRARY-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: OPENGL_xmesa_INCLUDE_DIR -OPENGL_xmesa_INCLUDE_DIR-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: PKG_CONFIG_EXECUTABLE -PKG_CONFIG_EXECUTABLE-ADVANCED:INTERNAL=1 -PKG_FONTCONFIG_CFLAGS:INTERNAL=-I/usr/include/uuid;-I/usr/include/freetype2;-I/usr/include/libpng16 -PKG_FONTCONFIG_CFLAGS_I:INTERNAL= -PKG_FONTCONFIG_CFLAGS_OTHER:INTERNAL= -PKG_FONTCONFIG_FOUND:INTERNAL=1 -PKG_FONTCONFIG_INCLUDEDIR:INTERNAL=/usr/include -PKG_FONTCONFIG_INCLUDE_DIRS:INTERNAL=/usr/include/uuid;/usr/include/freetype2;/usr/include/libpng16 -PKG_FONTCONFIG_LDFLAGS:INTERNAL=-lfontconfig;-lfreetype -PKG_FONTCONFIG_LDFLAGS_OTHER:INTERNAL= -PKG_FONTCONFIG_LIBDIR:INTERNAL=/usr/lib/aarch64-linux-gnu -PKG_FONTCONFIG_LIBRARIES:INTERNAL=fontconfig;freetype -PKG_FONTCONFIG_LIBRARY_DIRS:INTERNAL= -PKG_FONTCONFIG_LIBS:INTERNAL= -PKG_FONTCONFIG_LIBS_L:INTERNAL= -PKG_FONTCONFIG_LIBS_OTHER:INTERNAL= -PKG_FONTCONFIG_LIBS_PATHS:INTERNAL= -PKG_FONTCONFIG_MODULE_NAME:INTERNAL=fontconfig -PKG_FONTCONFIG_PREFIX:INTERNAL=/usr -PKG_FONTCONFIG_STATIC_CFLAGS:INTERNAL=-I/usr/include/uuid;-I/usr/include/freetype2;-I/usr/include/libpng16 -PKG_FONTCONFIG_STATIC_CFLAGS_I:INTERNAL= -PKG_FONTCONFIG_STATIC_CFLAGS_OTHER:INTERNAL= -PKG_FONTCONFIG_STATIC_INCLUDE_DIRS:INTERNAL=/usr/include/uuid;/usr/include/freetype2;/usr/include/libpng16 -PKG_FONTCONFIG_STATIC_LDFLAGS:INTERNAL=-lfontconfig;-luuid;-lexpat;-lfreetype;-lpng16;-lm;-lz;-lm;-lz -PKG_FONTCONFIG_STATIC_LDFLAGS_OTHER:INTERNAL= -PKG_FONTCONFIG_STATIC_LIBDIR:INTERNAL= -PKG_FONTCONFIG_STATIC_LIBRARIES:INTERNAL=fontconfig;uuid;expat;freetype;png16;m;z;m;z -PKG_FONTCONFIG_STATIC_LIBRARY_DIRS:INTERNAL= -PKG_FONTCONFIG_STATIC_LIBS:INTERNAL= -PKG_FONTCONFIG_STATIC_LIBS_L:INTERNAL= -PKG_FONTCONFIG_STATIC_LIBS_OTHER:INTERNAL= -PKG_FONTCONFIG_STATIC_LIBS_PATHS:INTERNAL= -PKG_FONTCONFIG_VERSION:INTERNAL=2.13.1 -PKG_FONTCONFIG_fontconfig_INCLUDEDIR:INTERNAL= -PKG_FONTCONFIG_fontconfig_LIBDIR:INTERNAL= -PKG_FONTCONFIG_fontconfig_PREFIX:INTERNAL= -PKG_FONTCONFIG_fontconfig_VERSION:INTERNAL= -QGSettings_CFLAGS:INTERNAL=-I/usr/include/aarch64-linux-gnu/qt5/QGSettings -QGSettings_CFLAGS_I:INTERNAL= -QGSettings_CFLAGS_OTHER:INTERNAL= -QGSettings_FOUND:INTERNAL=1 -QGSettings_INCLUDEDIR:INTERNAL=/usr/include/aarch64-linux-gnu/qt5/QGSettings -QGSettings_INCLUDE_DIRS:INTERNAL=/usr/include/aarch64-linux-gnu/qt5/QGSettings -QGSettings_LDFLAGS:INTERNAL=-lgsettings-qt -QGSettings_LDFLAGS_OTHER:INTERNAL= -QGSettings_LIBDIR:INTERNAL=/usr/lib/aarch64-linux-gnu -QGSettings_LIBRARIES:INTERNAL=gsettings-qt -QGSettings_LIBRARY_DIRS:INTERNAL= -QGSettings_LIBS:INTERNAL= -QGSettings_LIBS_L:INTERNAL= -QGSettings_LIBS_OTHER:INTERNAL= -QGSettings_LIBS_PATHS:INTERNAL= -QGSettings_MODULE_NAME:INTERNAL=gsettings-qt -QGSettings_PREFIX:INTERNAL=/usr -QGSettings_STATIC_CFLAGS:INTERNAL=-I/usr/include/aarch64-linux-gnu/qt5/QGSettings -QGSettings_STATIC_CFLAGS_I:INTERNAL= -QGSettings_STATIC_CFLAGS_OTHER:INTERNAL= -QGSettings_STATIC_INCLUDE_DIRS:INTERNAL=/usr/include/aarch64-linux-gnu/qt5/QGSettings -QGSettings_STATIC_LDFLAGS:INTERNAL=-lgsettings-qt -QGSettings_STATIC_LDFLAGS_OTHER:INTERNAL= -QGSettings_STATIC_LIBDIR:INTERNAL= -QGSettings_STATIC_LIBRARIES:INTERNAL=gsettings-qt -QGSettings_STATIC_LIBRARY_DIRS:INTERNAL= -QGSettings_STATIC_LIBS:INTERNAL= -QGSettings_STATIC_LIBS_L:INTERNAL= -QGSettings_STATIC_LIBS_OTHER:INTERNAL= -QGSettings_STATIC_LIBS_PATHS:INTERNAL= -QGSettings_VERSION:INTERNAL=1.0.0 -QGSettings_gsettings-qt_INCLUDEDIR:INTERNAL= -QGSettings_gsettings-qt_LIBDIR:INTERNAL= -QGSettings_gsettings-qt_PREFIX:INTERNAL= -QGSettings_gsettings-qt_VERSION:INTERNAL= -//ADVANCED property for variable: X11_ICE_INCLUDE_PATH -X11_ICE_INCLUDE_PATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_ICE_LIB -X11_ICE_LIB-ADVANCED:INTERNAL=1 -//Have library /usr/lib/aarch64-linux-gnu/libX11.so;/usr/lib/aarch64-linux-gnu/libXext.so -X11_LIB_X11_SOLO:INTERNAL=1 -//ADVANCED property for variable: X11_SM_INCLUDE_PATH -X11_SM_INCLUDE_PATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_SM_LIB -X11_SM_LIB-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_X11_INCLUDE_PATH -X11_X11_INCLUDE_PATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_X11_LIB -X11_X11_LIB-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_XRes_INCLUDE_PATH -X11_XRes_INCLUDE_PATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_XRes_LIB -X11_XRes_LIB-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_XShm_INCLUDE_PATH -X11_XShm_INCLUDE_PATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_XSync_INCLUDE_PATH -X11_XSync_INCLUDE_PATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_Xaccessrules_INCLUDE_PATH -X11_Xaccessrules_INCLUDE_PATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_Xaccessstr_INCLUDE_PATH -X11_Xaccessstr_INCLUDE_PATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_Xau_INCLUDE_PATH -X11_Xau_INCLUDE_PATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_Xau_LIB -X11_Xau_LIB-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_Xcomposite_INCLUDE_PATH -X11_Xcomposite_INCLUDE_PATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_Xcomposite_LIB -X11_Xcomposite_LIB-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_Xcursor_INCLUDE_PATH -X11_Xcursor_INCLUDE_PATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_Xcursor_LIB -X11_Xcursor_LIB-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_Xdamage_INCLUDE_PATH -X11_Xdamage_INCLUDE_PATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_Xdamage_LIB -X11_Xdamage_LIB-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_Xdmcp_INCLUDE_PATH -X11_Xdmcp_INCLUDE_PATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_Xdmcp_LIB -X11_Xdmcp_LIB-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_Xext_INCLUDE_PATH -X11_Xext_INCLUDE_PATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_Xext_LIB -X11_Xext_LIB-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_Xfixes_INCLUDE_PATH -X11_Xfixes_INCLUDE_PATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_Xfixes_LIB -X11_Xfixes_LIB-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_Xft_INCLUDE_PATH -X11_Xft_INCLUDE_PATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_Xft_LIB -X11_Xft_LIB-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_Xi_INCLUDE_PATH -X11_Xi_INCLUDE_PATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_Xi_LIB -X11_Xi_LIB-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_Xinerama_INCLUDE_PATH -X11_Xinerama_INCLUDE_PATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_Xinerama_LIB -X11_Xinerama_LIB-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_Xkb_INCLUDE_PATH -X11_Xkb_INCLUDE_PATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_Xkblib_INCLUDE_PATH -X11_Xkblib_INCLUDE_PATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_Xlib_INCLUDE_PATH -X11_Xlib_INCLUDE_PATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_Xmu_INCLUDE_PATH -X11_Xmu_INCLUDE_PATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_Xmu_LIB -X11_Xmu_LIB-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_Xpm_INCLUDE_PATH -X11_Xpm_INCLUDE_PATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_Xpm_LIB -X11_Xpm_LIB-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_Xrandr_INCLUDE_PATH -X11_Xrandr_INCLUDE_PATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_Xrandr_LIB -X11_Xrandr_LIB-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_Xrender_INCLUDE_PATH -X11_Xrender_INCLUDE_PATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_Xrender_LIB -X11_Xrender_LIB-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_Xshape_INCLUDE_PATH -X11_Xshape_INCLUDE_PATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_Xss_INCLUDE_PATH -X11_Xss_INCLUDE_PATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_Xss_LIB -X11_Xss_LIB-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_Xt_INCLUDE_PATH -X11_Xt_INCLUDE_PATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_Xt_LIB -X11_Xt_LIB-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_Xtst_INCLUDE_PATH -X11_Xtst_INCLUDE_PATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_Xtst_LIB -X11_Xtst_LIB-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_Xutil_INCLUDE_PATH -X11_Xutil_INCLUDE_PATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_Xv_INCLUDE_PATH -X11_Xv_INCLUDE_PATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_Xv_LIB -X11_Xv_LIB-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_Xxf86misc_INCLUDE_PATH -X11_Xxf86misc_INCLUDE_PATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_Xxf86misc_LIB -X11_Xxf86misc_LIB-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_Xxf86vm_INCLUDE_PATH -X11_Xxf86vm_INCLUDE_PATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_Xxf86vm_LIB -X11_Xxf86vm_LIB-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_dpms_INCLUDE_PATH -X11_dpms_INCLUDE_PATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_xkbfile_INCLUDE_PATH -X11_xkbfile_INCLUDE_PATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: X11_xkbfile_LIB -X11_xkbfile_LIB-ADVANCED:INTERNAL=1 -__pkg_config_arguments_PKG_FONTCONFIG:INTERNAL=QUIET;fontconfig -__pkg_config_arguments_QGSettings:INTERNAL=REQUIRED;gsettings-qt -__pkg_config_checked_PKG_FONTCONFIG:INTERNAL=1 -__pkg_config_checked_QGSettings:INTERNAL=1 -//ADVANCED property for variable: pkgcfg_lib_PKG_FONTCONFIG_fontconfig -pkgcfg_lib_PKG_FONTCONFIG_fontconfig-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: pkgcfg_lib_PKG_FONTCONFIG_freetype -pkgcfg_lib_PKG_FONTCONFIG_freetype-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: pkgcfg_lib_QGSettings_gsettings-qt -pkgcfg_lib_QGSettings_gsettings-qt-ADVANCED:INTERNAL=1 -prefix_result:INTERNAL=/usr/lib/aarch64-linux-gnu - diff --git a/build/CMakeFiles/3.16.3/CMakeCCompiler.cmake b/build/CMakeFiles/3.16.3/CMakeCCompiler.cmake deleted file mode 100644 index 1cf9eb3eb2f5b7b9451e6b3a34b6a7198c91b98e..0000000000000000000000000000000000000000 --- a/build/CMakeFiles/3.16.3/CMakeCCompiler.cmake +++ /dev/null @@ -1,76 +0,0 @@ -set(CMAKE_C_COMPILER "/bin/c99-gcc") -set(CMAKE_C_COMPILER_ARG1 "") -set(CMAKE_C_COMPILER_ID "GNU") -set(CMAKE_C_COMPILER_VERSION "9.3.0") -set(CMAKE_C_COMPILER_VERSION_INTERNAL "") -set(CMAKE_C_COMPILER_WRAPPER "") -set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "99") -set(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert") -set(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes") -set(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros") -set(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert") - -set(CMAKE_C_PLATFORM_ID "Linux") -set(CMAKE_C_SIMULATE_ID "") -set(CMAKE_C_COMPILER_FRONTEND_VARIANT "") -set(CMAKE_C_SIMULATE_VERSION "") - - - -set(CMAKE_AR "/bin/ar") -set(CMAKE_C_COMPILER_AR "/bin/gcc-ar-9") -set(CMAKE_RANLIB "/bin/ranlib") -set(CMAKE_C_COMPILER_RANLIB "/bin/gcc-ranlib-9") -set(CMAKE_LINKER "/bin/ld") -set(CMAKE_MT "") -set(CMAKE_COMPILER_IS_GNUCC 1) -set(CMAKE_C_COMPILER_LOADED 1) -set(CMAKE_C_COMPILER_WORKS TRUE) -set(CMAKE_C_ABI_COMPILED TRUE) -set(CMAKE_COMPILER_IS_MINGW ) -set(CMAKE_COMPILER_IS_CYGWIN ) -if(CMAKE_COMPILER_IS_CYGWIN) - set(CYGWIN 1) - set(UNIX 1) -endif() - -set(CMAKE_C_COMPILER_ENV_VAR "CC") - -if(CMAKE_COMPILER_IS_MINGW) - set(MINGW 1) -endif() -set(CMAKE_C_COMPILER_ID_RUN 1) -set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m) -set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) -set(CMAKE_C_LINKER_PREFERENCE 10) - -# Save compiler ABI information. -set(CMAKE_C_SIZEOF_DATA_PTR "8") -set(CMAKE_C_COMPILER_ABI "ELF") -set(CMAKE_C_LIBRARY_ARCHITECTURE "aarch64-linux-gnu") - -if(CMAKE_C_SIZEOF_DATA_PTR) - set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}") -endif() - -if(CMAKE_C_COMPILER_ABI) - set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}") -endif() - -if(CMAKE_C_LIBRARY_ARCHITECTURE) - set(CMAKE_LIBRARY_ARCHITECTURE "aarch64-linux-gnu") -endif() - -set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "") -if(CMAKE_C_CL_SHOWINCLUDES_PREFIX) - set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}") -endif() - - - - - -set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES "/usr/lib/gcc/aarch64-linux-gnu/9/include;/usr/local/include;/usr/include/aarch64-linux-gnu;/usr/include") -set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "gcc;gcc_s;c;gcc;gcc_s") -set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/aarch64-linux-gnu/9;/usr/lib/aarch64-linux-gnu;/usr/lib;/lib/aarch64-linux-gnu;/lib") -set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") diff --git a/build/CMakeFiles/3.16.3/CMakeCXXCompiler.cmake b/build/CMakeFiles/3.16.3/CMakeCXXCompiler.cmake deleted file mode 100644 index 19508d5c338c5ba615efe53b872b3ba278a62b34..0000000000000000000000000000000000000000 --- a/build/CMakeFiles/3.16.3/CMakeCXXCompiler.cmake +++ /dev/null @@ -1,88 +0,0 @@ -set(CMAKE_CXX_COMPILER "/bin/c++") -set(CMAKE_CXX_COMPILER_ARG1 "") -set(CMAKE_CXX_COMPILER_ID "GNU") -set(CMAKE_CXX_COMPILER_VERSION "9.3.0") -set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "") -set(CMAKE_CXX_COMPILER_WRAPPER "") -set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "14") -set(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17;cxx_std_20") -set(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters") -set(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates") -set(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates") -set(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17") -set(CMAKE_CXX20_COMPILE_FEATURES "cxx_std_20") - -set(CMAKE_CXX_PLATFORM_ID "Linux") -set(CMAKE_CXX_SIMULATE_ID "") -set(CMAKE_CXX_COMPILER_FRONTEND_VARIANT "") -set(CMAKE_CXX_SIMULATE_VERSION "") - - - -set(CMAKE_AR "/bin/ar") -set(CMAKE_CXX_COMPILER_AR "/bin/gcc-ar-9") -set(CMAKE_RANLIB "/bin/ranlib") -set(CMAKE_CXX_COMPILER_RANLIB "/bin/gcc-ranlib-9") -set(CMAKE_LINKER "/bin/ld") -set(CMAKE_MT "") -set(CMAKE_COMPILER_IS_GNUCXX 1) -set(CMAKE_CXX_COMPILER_LOADED 1) -set(CMAKE_CXX_COMPILER_WORKS TRUE) -set(CMAKE_CXX_ABI_COMPILED TRUE) -set(CMAKE_COMPILER_IS_MINGW ) -set(CMAKE_COMPILER_IS_CYGWIN ) -if(CMAKE_COMPILER_IS_CYGWIN) - set(CYGWIN 1) - set(UNIX 1) -endif() - -set(CMAKE_CXX_COMPILER_ENV_VAR "CXX") - -if(CMAKE_COMPILER_IS_MINGW) - set(MINGW 1) -endif() -set(CMAKE_CXX_COMPILER_ID_RUN 1) -set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;CPP) -set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) - -foreach (lang C OBJC OBJCXX) - if (CMAKE_${lang}_COMPILER_ID_RUN) - foreach(extension IN LISTS CMAKE_${lang}_SOURCE_FILE_EXTENSIONS) - list(REMOVE_ITEM CMAKE_CXX_SOURCE_FILE_EXTENSIONS ${extension}) - endforeach() - endif() -endforeach() - -set(CMAKE_CXX_LINKER_PREFERENCE 30) -set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1) - -# Save compiler ABI information. -set(CMAKE_CXX_SIZEOF_DATA_PTR "8") -set(CMAKE_CXX_COMPILER_ABI "ELF") -set(CMAKE_CXX_LIBRARY_ARCHITECTURE "aarch64-linux-gnu") - -if(CMAKE_CXX_SIZEOF_DATA_PTR) - set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}") -endif() - -if(CMAKE_CXX_COMPILER_ABI) - set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}") -endif() - -if(CMAKE_CXX_LIBRARY_ARCHITECTURE) - set(CMAKE_LIBRARY_ARCHITECTURE "aarch64-linux-gnu") -endif() - -set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "") -if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX) - set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}") -endif() - - - - - -set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "/usr/include/c++/9;/usr/include/aarch64-linux-gnu/c++/9;/usr/include/c++/9/backward;/usr/lib/gcc/aarch64-linux-gnu/9/include;/usr/local/include;/usr/include/aarch64-linux-gnu;/usr/include") -set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "stdc++;m;gcc_s;gcc;c;gcc_s;gcc") -set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/aarch64-linux-gnu/9;/usr/lib/aarch64-linux-gnu;/usr/lib;/lib/aarch64-linux-gnu;/lib") -set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") diff --git a/build/CMakeFiles/3.16.3/CMakeDetermineCompilerABI_C.bin b/build/CMakeFiles/3.16.3/CMakeDetermineCompilerABI_C.bin deleted file mode 100755 index 0e5682cbb143e4e6bc4523c6a4f318c7d2d2af15..0000000000000000000000000000000000000000 Binary files a/build/CMakeFiles/3.16.3/CMakeDetermineCompilerABI_C.bin and /dev/null differ diff --git a/build/CMakeFiles/3.16.3/CMakeDetermineCompilerABI_CXX.bin b/build/CMakeFiles/3.16.3/CMakeDetermineCompilerABI_CXX.bin deleted file mode 100755 index 89f34c232ac0eac2baf52fc86bdcb3899ad2dbe7..0000000000000000000000000000000000000000 Binary files a/build/CMakeFiles/3.16.3/CMakeDetermineCompilerABI_CXX.bin and /dev/null differ diff --git a/build/CMakeFiles/3.16.3/CMakeSystem.cmake b/build/CMakeFiles/3.16.3/CMakeSystem.cmake deleted file mode 100644 index bad1d9bf628339f90b35f9ade6dbcf6d36066854..0000000000000000000000000000000000000000 --- a/build/CMakeFiles/3.16.3/CMakeSystem.cmake +++ /dev/null @@ -1,15 +0,0 @@ -set(CMAKE_HOST_SYSTEM "Linux-5.4.18-35-generic") -set(CMAKE_HOST_SYSTEM_NAME "Linux") -set(CMAKE_HOST_SYSTEM_VERSION "5.4.18-35-generic") -set(CMAKE_HOST_SYSTEM_PROCESSOR "aarch64") - - - -set(CMAKE_SYSTEM "Linux-5.4.18-35-generic") -set(CMAKE_SYSTEM_NAME "Linux") -set(CMAKE_SYSTEM_VERSION "5.4.18-35-generic") -set(CMAKE_SYSTEM_PROCESSOR "aarch64") - -set(CMAKE_CROSSCOMPILING "FALSE") - -set(CMAKE_SYSTEM_LOADED 1) diff --git a/build/CMakeFiles/3.16.3/CompilerIdC/CMakeCCompilerId.c b/build/CMakeFiles/3.16.3/CompilerIdC/CMakeCCompilerId.c deleted file mode 100644 index d884b50908c9852aad6d3b60781f4e529edc4d50..0000000000000000000000000000000000000000 --- a/build/CMakeFiles/3.16.3/CompilerIdC/CMakeCCompilerId.c +++ /dev/null @@ -1,671 +0,0 @@ -#ifdef __cplusplus -# error "A C++ compiler has been selected for C." -#endif - -#if defined(__18CXX) -# define ID_VOID_MAIN -#endif -#if defined(__CLASSIC_C__) -/* cv-qualifiers did not exist in K&R C */ -# define const -# define volatile -#endif - - -/* Version number components: V=Version, R=Revision, P=Patch - Version date components: YYYY=Year, MM=Month, DD=Day */ - -#if defined(__INTEL_COMPILER) || defined(__ICC) -# define COMPILER_ID "Intel" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# if defined(__GNUC__) -# define SIMULATE_ID "GNU" -# endif - /* __INTEL_COMPILER = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) -# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) -# if defined(__INTEL_COMPILER_UPDATE) -# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) -# else -# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) -# endif -# if defined(__INTEL_COMPILER_BUILD_DATE) - /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ -# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) -# endif -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif -# if defined(__GNUC__) -# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) -# elif defined(__GNUG__) -# define SIMULATE_VERSION_MAJOR DEC(__GNUG__) -# endif -# if defined(__GNUC_MINOR__) -# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) -# endif -# if defined(__GNUC_PATCHLEVEL__) -# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) -# endif - -#elif defined(__PATHCC__) -# define COMPILER_ID "PathScale" -# define COMPILER_VERSION_MAJOR DEC(__PATHCC__) -# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) -# if defined(__PATHCC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) -# endif - -#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) -# define COMPILER_ID "Embarcadero" -# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) -# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) -# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) - -#elif defined(__BORLANDC__) -# define COMPILER_ID "Borland" - /* __BORLANDC__ = 0xVRR */ -# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) -# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) - -#elif defined(__WATCOMC__) && __WATCOMC__ < 1200 -# define COMPILER_ID "Watcom" - /* __WATCOMC__ = VVRR */ -# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) -# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) -# if (__WATCOMC__ % 10) > 0 -# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) -# endif - -#elif defined(__WATCOMC__) -# define COMPILER_ID "OpenWatcom" - /* __WATCOMC__ = VVRP + 1100 */ -# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) -# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) -# if (__WATCOMC__ % 10) > 0 -# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) -# endif - -#elif defined(__SUNPRO_C) -# define COMPILER_ID "SunPro" -# if __SUNPRO_C >= 0x5100 - /* __SUNPRO_C = 0xVRRP */ -# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12) -# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF) -# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) -# else - /* __SUNPRO_CC = 0xVRP */ -# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8) -# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF) -# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) -# endif - -#elif defined(__HP_cc) -# define COMPILER_ID "HP" - /* __HP_cc = VVRRPP */ -# define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000) -# define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100) -# define COMPILER_VERSION_PATCH DEC(__HP_cc % 100) - -#elif defined(__DECC) -# define COMPILER_ID "Compaq" - /* __DECC_VER = VVRRTPPPP */ -# define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000) -# define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100) -# define COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000) - -#elif defined(__IBMC__) && defined(__COMPILER_VER__) -# define COMPILER_ID "zOS" - /* __IBMC__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) - -#elif defined(__ibmxl__) && defined(__clang__) -# define COMPILER_ID "XLClang" -# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__) -# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__) -# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__) -# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__) - - -#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ >= 800 -# define COMPILER_ID "XL" - /* __IBMC__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) - -#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ < 800 -# define COMPILER_ID "VisualAge" - /* __IBMC__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) - -#elif defined(__PGI) -# define COMPILER_ID "PGI" -# define COMPILER_VERSION_MAJOR DEC(__PGIC__) -# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) -# if defined(__PGIC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) -# endif - -#elif defined(_CRAYC) -# define COMPILER_ID "Cray" -# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) -# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) - -#elif defined(__TI_COMPILER_VERSION__) -# define COMPILER_ID "TI" - /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ -# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) -# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) -# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) - -#elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version) -# define COMPILER_ID "Fujitsu" - -#elif defined(__ghs__) -# define COMPILER_ID "GHS" -/* __GHS_VERSION_NUMBER = VVVVRP */ -# ifdef __GHS_VERSION_NUMBER -# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100) -# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10) -# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10) -# endif - -#elif defined(__TINYC__) -# define COMPILER_ID "TinyCC" - -#elif defined(__BCC__) -# define COMPILER_ID "Bruce" - -#elif defined(__SCO_VERSION__) -# define COMPILER_ID "SCO" - -#elif defined(__ARMCC_VERSION) && !defined(__clang__) -# define COMPILER_ID "ARMCC" -#if __ARMCC_VERSION >= 1000000 - /* __ARMCC_VERSION = VRRPPPP */ - # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) - # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) - # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) -#else - /* __ARMCC_VERSION = VRPPPP */ - # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) - # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) - # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) -#endif - - -#elif defined(__clang__) && defined(__apple_build_version__) -# define COMPILER_ID "AppleClang" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# define COMPILER_VERSION_MAJOR DEC(__clang_major__) -# define COMPILER_VERSION_MINOR DEC(__clang_minor__) -# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif -# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) - -#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION) -# define COMPILER_ID "ARMClang" - # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000) - # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100) - # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION % 10000) -# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION) - -#elif defined(__clang__) -# define COMPILER_ID "Clang" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# define COMPILER_VERSION_MAJOR DEC(__clang_major__) -# define COMPILER_VERSION_MINOR DEC(__clang_minor__) -# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif - -#elif defined(__GNUC__) -# define COMPILER_ID "GNU" -# define COMPILER_VERSION_MAJOR DEC(__GNUC__) -# if defined(__GNUC_MINOR__) -# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) -# endif -# if defined(__GNUC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) -# endif - -#elif defined(_MSC_VER) -# define COMPILER_ID "MSVC" - /* _MSC_VER = VVRR */ -# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) -# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) -# if defined(_MSC_FULL_VER) -# if _MSC_VER >= 1400 - /* _MSC_FULL_VER = VVRRPPPPP */ -# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) -# else - /* _MSC_FULL_VER = VVRRPPPP */ -# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) -# endif -# endif -# if defined(_MSC_BUILD) -# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) -# endif - -#elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) -# define COMPILER_ID "ADSP" -#if defined(__VISUALDSPVERSION__) - /* __VISUALDSPVERSION__ = 0xVVRRPP00 */ -# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24) -# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF) -# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF) -#endif - -#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) -# define COMPILER_ID "IAR" -# if defined(__VER__) && defined(__ICCARM__) -# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) -# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) -# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) -# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) -# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__)) -# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100) -# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100)) -# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__) -# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) -# endif - -#elif defined(__SDCC_VERSION_MAJOR) || defined(SDCC) -# define COMPILER_ID "SDCC" -# if defined(__SDCC_VERSION_MAJOR) -# define COMPILER_VERSION_MAJOR DEC(__SDCC_VERSION_MAJOR) -# define COMPILER_VERSION_MINOR DEC(__SDCC_VERSION_MINOR) -# define COMPILER_VERSION_PATCH DEC(__SDCC_VERSION_PATCH) -# else - /* SDCC = VRP */ -# define COMPILER_VERSION_MAJOR DEC(SDCC/100) -# define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10) -# define COMPILER_VERSION_PATCH DEC(SDCC % 10) -# endif - - -/* These compilers are either not known or too old to define an - identification macro. Try to identify the platform and guess that - it is the native compiler. */ -#elif defined(__hpux) || defined(__hpua) -# define COMPILER_ID "HP" - -#else /* unknown compiler */ -# define COMPILER_ID "" -#endif - -/* Construct the string literal in pieces to prevent the source from - getting matched. Store it in a pointer rather than an array - because some compilers will just produce instructions to fill the - array rather than assigning a pointer to a static array. */ -char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; -#ifdef SIMULATE_ID -char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; -#endif - -#ifdef __QNXNTO__ -char const* qnxnto = "INFO" ":" "qnxnto[]"; -#endif - -#if defined(__CRAYXE) || defined(__CRAYXC) -char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; -#endif - -#define STRINGIFY_HELPER(X) #X -#define STRINGIFY(X) STRINGIFY_HELPER(X) - -/* Identify known platforms by name. */ -#if defined(__linux) || defined(__linux__) || defined(linux) -# define PLATFORM_ID "Linux" - -#elif defined(__CYGWIN__) -# define PLATFORM_ID "Cygwin" - -#elif defined(__MINGW32__) -# define PLATFORM_ID "MinGW" - -#elif defined(__APPLE__) -# define PLATFORM_ID "Darwin" - -#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) -# define PLATFORM_ID "Windows" - -#elif defined(__FreeBSD__) || defined(__FreeBSD) -# define PLATFORM_ID "FreeBSD" - -#elif defined(__NetBSD__) || defined(__NetBSD) -# define PLATFORM_ID "NetBSD" - -#elif defined(__OpenBSD__) || defined(__OPENBSD) -# define PLATFORM_ID "OpenBSD" - -#elif defined(__sun) || defined(sun) -# define PLATFORM_ID "SunOS" - -#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) -# define PLATFORM_ID "AIX" - -#elif defined(__hpux) || defined(__hpux__) -# define PLATFORM_ID "HP-UX" - -#elif defined(__HAIKU__) -# define PLATFORM_ID "Haiku" - -#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) -# define PLATFORM_ID "BeOS" - -#elif defined(__QNX__) || defined(__QNXNTO__) -# define PLATFORM_ID "QNX" - -#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) -# define PLATFORM_ID "Tru64" - -#elif defined(__riscos) || defined(__riscos__) -# define PLATFORM_ID "RISCos" - -#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) -# define PLATFORM_ID "SINIX" - -#elif defined(__UNIX_SV__) -# define PLATFORM_ID "UNIX_SV" - -#elif defined(__bsdos__) -# define PLATFORM_ID "BSDOS" - -#elif defined(_MPRAS) || defined(MPRAS) -# define PLATFORM_ID "MP-RAS" - -#elif defined(__osf) || defined(__osf__) -# define PLATFORM_ID "OSF1" - -#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) -# define PLATFORM_ID "SCO_SV" - -#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) -# define PLATFORM_ID "ULTRIX" - -#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) -# define PLATFORM_ID "Xenix" - -#elif defined(__WATCOMC__) -# if defined(__LINUX__) -# define PLATFORM_ID "Linux" - -# elif defined(__DOS__) -# define PLATFORM_ID "DOS" - -# elif defined(__OS2__) -# define PLATFORM_ID "OS2" - -# elif defined(__WINDOWS__) -# define PLATFORM_ID "Windows3x" - -# else /* unknown platform */ -# define PLATFORM_ID -# endif - -#elif defined(__INTEGRITY) -# if defined(INT_178B) -# define PLATFORM_ID "Integrity178" - -# else /* regular Integrity */ -# define PLATFORM_ID "Integrity" -# endif - -#else /* unknown platform */ -# define PLATFORM_ID - -#endif - -/* For windows compilers MSVC and Intel we can determine - the architecture of the compiler being used. This is because - the compilers do not have flags that can change the architecture, - but rather depend on which compiler is being used -*/ -#if defined(_WIN32) && defined(_MSC_VER) -# if defined(_M_IA64) -# define ARCHITECTURE_ID "IA64" - -# elif defined(_M_X64) || defined(_M_AMD64) -# define ARCHITECTURE_ID "x64" - -# elif defined(_M_IX86) -# define ARCHITECTURE_ID "X86" - -# elif defined(_M_ARM64) -# define ARCHITECTURE_ID "ARM64" - -# elif defined(_M_ARM) -# if _M_ARM == 4 -# define ARCHITECTURE_ID "ARMV4I" -# elif _M_ARM == 5 -# define ARCHITECTURE_ID "ARMV5I" -# else -# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) -# endif - -# elif defined(_M_MIPS) -# define ARCHITECTURE_ID "MIPS" - -# elif defined(_M_SH) -# define ARCHITECTURE_ID "SHx" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__WATCOMC__) -# if defined(_M_I86) -# define ARCHITECTURE_ID "I86" - -# elif defined(_M_IX86) -# define ARCHITECTURE_ID "X86" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) -# if defined(__ICCARM__) -# define ARCHITECTURE_ID "ARM" - -# elif defined(__ICCRX__) -# define ARCHITECTURE_ID "RX" - -# elif defined(__ICCRH850__) -# define ARCHITECTURE_ID "RH850" - -# elif defined(__ICCRL78__) -# define ARCHITECTURE_ID "RL78" - -# elif defined(__ICCRISCV__) -# define ARCHITECTURE_ID "RISCV" - -# elif defined(__ICCAVR__) -# define ARCHITECTURE_ID "AVR" - -# elif defined(__ICC430__) -# define ARCHITECTURE_ID "MSP430" - -# elif defined(__ICCV850__) -# define ARCHITECTURE_ID "V850" - -# elif defined(__ICC8051__) -# define ARCHITECTURE_ID "8051" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__ghs__) -# if defined(__PPC64__) -# define ARCHITECTURE_ID "PPC64" - -# elif defined(__ppc__) -# define ARCHITECTURE_ID "PPC" - -# elif defined(__ARM__) -# define ARCHITECTURE_ID "ARM" - -# elif defined(__x86_64__) -# define ARCHITECTURE_ID "x64" - -# elif defined(__i386__) -# define ARCHITECTURE_ID "X86" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif -#else -# define ARCHITECTURE_ID -#endif - -/* Convert integer to decimal digit literals. */ -#define DEC(n) \ - ('0' + (((n) / 10000000)%10)), \ - ('0' + (((n) / 1000000)%10)), \ - ('0' + (((n) / 100000)%10)), \ - ('0' + (((n) / 10000)%10)), \ - ('0' + (((n) / 1000)%10)), \ - ('0' + (((n) / 100)%10)), \ - ('0' + (((n) / 10)%10)), \ - ('0' + ((n) % 10)) - -/* Convert integer to hex digit literals. */ -#define HEX(n) \ - ('0' + ((n)>>28 & 0xF)), \ - ('0' + ((n)>>24 & 0xF)), \ - ('0' + ((n)>>20 & 0xF)), \ - ('0' + ((n)>>16 & 0xF)), \ - ('0' + ((n)>>12 & 0xF)), \ - ('0' + ((n)>>8 & 0xF)), \ - ('0' + ((n)>>4 & 0xF)), \ - ('0' + ((n) & 0xF)) - -/* Construct a string literal encoding the version number components. */ -#ifdef COMPILER_VERSION_MAJOR -char const info_version[] = { - 'I', 'N', 'F', 'O', ':', - 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', - COMPILER_VERSION_MAJOR, -# ifdef COMPILER_VERSION_MINOR - '.', COMPILER_VERSION_MINOR, -# ifdef COMPILER_VERSION_PATCH - '.', COMPILER_VERSION_PATCH, -# ifdef COMPILER_VERSION_TWEAK - '.', COMPILER_VERSION_TWEAK, -# endif -# endif -# endif - ']','\0'}; -#endif - -/* Construct a string literal encoding the internal version number. */ -#ifdef COMPILER_VERSION_INTERNAL -char const info_version_internal[] = { - 'I', 'N', 'F', 'O', ':', - 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', - 'i','n','t','e','r','n','a','l','[', - COMPILER_VERSION_INTERNAL,']','\0'}; -#endif - -/* Construct a string literal encoding the version number components. */ -#ifdef SIMULATE_VERSION_MAJOR -char const info_simulate_version[] = { - 'I', 'N', 'F', 'O', ':', - 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', - SIMULATE_VERSION_MAJOR, -# ifdef SIMULATE_VERSION_MINOR - '.', SIMULATE_VERSION_MINOR, -# ifdef SIMULATE_VERSION_PATCH - '.', SIMULATE_VERSION_PATCH, -# ifdef SIMULATE_VERSION_TWEAK - '.', SIMULATE_VERSION_TWEAK, -# endif -# endif -# endif - ']','\0'}; -#endif - -/* Construct the string literal in pieces to prevent the source from - getting matched. Store it in a pointer rather than an array - because some compilers will just produce instructions to fill the - array rather than assigning a pointer to a static array. */ -char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; -char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; - - - - -#if !defined(__STDC__) -# if (defined(_MSC_VER) && !defined(__clang__)) \ - || (defined(__ibmxl__) || defined(__IBMC__)) -# define C_DIALECT "90" -# else -# define C_DIALECT -# endif -#elif __STDC_VERSION__ >= 201000L -# define C_DIALECT "11" -#elif __STDC_VERSION__ >= 199901L -# define C_DIALECT "99" -#else -# define C_DIALECT "90" -#endif -const char* info_language_dialect_default = - "INFO" ":" "dialect_default[" C_DIALECT "]"; - -/*--------------------------------------------------------------------------*/ - -#ifdef ID_VOID_MAIN -void main() {} -#else -# if defined(__CLASSIC_C__) -int main(argc, argv) int argc; char *argv[]; -# else -int main(int argc, char* argv[]) -# endif -{ - int require = 0; - require += info_compiler[argc]; - require += info_platform[argc]; - require += info_arch[argc]; -#ifdef COMPILER_VERSION_MAJOR - require += info_version[argc]; -#endif -#ifdef COMPILER_VERSION_INTERNAL - require += info_version_internal[argc]; -#endif -#ifdef SIMULATE_ID - require += info_simulate[argc]; -#endif -#ifdef SIMULATE_VERSION_MAJOR - require += info_simulate_version[argc]; -#endif -#if defined(__CRAYXE) || defined(__CRAYXC) - require += info_cray[argc]; -#endif - require += info_language_dialect_default[argc]; - (void)argv; - return require; -} -#endif diff --git a/build/CMakeFiles/3.16.3/CompilerIdC/a.out b/build/CMakeFiles/3.16.3/CompilerIdC/a.out deleted file mode 100755 index 8e267b33588c3366a9a64b0db5967f4364e0a0c6..0000000000000000000000000000000000000000 Binary files a/build/CMakeFiles/3.16.3/CompilerIdC/a.out and /dev/null differ diff --git a/build/CMakeFiles/3.16.3/CompilerIdCXX/CMakeCXXCompilerId.cpp b/build/CMakeFiles/3.16.3/CompilerIdCXX/CMakeCXXCompilerId.cpp deleted file mode 100644 index 69cfdba6bc7bccb09bf234388908de035caa0969..0000000000000000000000000000000000000000 --- a/build/CMakeFiles/3.16.3/CompilerIdCXX/CMakeCXXCompilerId.cpp +++ /dev/null @@ -1,660 +0,0 @@ -/* This source file must have a .cpp extension so that all C++ compilers - recognize the extension without flags. Borland does not know .cxx for - example. */ -#ifndef __cplusplus -# error "A C compiler has been selected for C++." -#endif - - -/* Version number components: V=Version, R=Revision, P=Patch - Version date components: YYYY=Year, MM=Month, DD=Day */ - -#if defined(__COMO__) -# define COMPILER_ID "Comeau" - /* __COMO_VERSION__ = VRR */ -# define COMPILER_VERSION_MAJOR DEC(__COMO_VERSION__ / 100) -# define COMPILER_VERSION_MINOR DEC(__COMO_VERSION__ % 100) - -#elif defined(__INTEL_COMPILER) || defined(__ICC) -# define COMPILER_ID "Intel" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# if defined(__GNUC__) -# define SIMULATE_ID "GNU" -# endif - /* __INTEL_COMPILER = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) -# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) -# if defined(__INTEL_COMPILER_UPDATE) -# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) -# else -# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) -# endif -# if defined(__INTEL_COMPILER_BUILD_DATE) - /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ -# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) -# endif -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif -# if defined(__GNUC__) -# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) -# elif defined(__GNUG__) -# define SIMULATE_VERSION_MAJOR DEC(__GNUG__) -# endif -# if defined(__GNUC_MINOR__) -# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) -# endif -# if defined(__GNUC_PATCHLEVEL__) -# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) -# endif - -#elif defined(__PATHCC__) -# define COMPILER_ID "PathScale" -# define COMPILER_VERSION_MAJOR DEC(__PATHCC__) -# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) -# if defined(__PATHCC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) -# endif - -#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) -# define COMPILER_ID "Embarcadero" -# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) -# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) -# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) - -#elif defined(__BORLANDC__) -# define COMPILER_ID "Borland" - /* __BORLANDC__ = 0xVRR */ -# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) -# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) - -#elif defined(__WATCOMC__) && __WATCOMC__ < 1200 -# define COMPILER_ID "Watcom" - /* __WATCOMC__ = VVRR */ -# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) -# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) -# if (__WATCOMC__ % 10) > 0 -# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) -# endif - -#elif defined(__WATCOMC__) -# define COMPILER_ID "OpenWatcom" - /* __WATCOMC__ = VVRP + 1100 */ -# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) -# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) -# if (__WATCOMC__ % 10) > 0 -# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) -# endif - -#elif defined(__SUNPRO_CC) -# define COMPILER_ID "SunPro" -# if __SUNPRO_CC >= 0x5100 - /* __SUNPRO_CC = 0xVRRP */ -# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12) -# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF) -# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) -# else - /* __SUNPRO_CC = 0xVRP */ -# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8) -# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF) -# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) -# endif - -#elif defined(__HP_aCC) -# define COMPILER_ID "HP" - /* __HP_aCC = VVRRPP */ -# define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000) -# define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100) -# define COMPILER_VERSION_PATCH DEC(__HP_aCC % 100) - -#elif defined(__DECCXX) -# define COMPILER_ID "Compaq" - /* __DECCXX_VER = VVRRTPPPP */ -# define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000) -# define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100) -# define COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000) - -#elif defined(__IBMCPP__) && defined(__COMPILER_VER__) -# define COMPILER_ID "zOS" - /* __IBMCPP__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) - -#elif defined(__ibmxl__) && defined(__clang__) -# define COMPILER_ID "XLClang" -# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__) -# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__) -# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__) -# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__) - - -#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ >= 800 -# define COMPILER_ID "XL" - /* __IBMCPP__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) - -#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ < 800 -# define COMPILER_ID "VisualAge" - /* __IBMCPP__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) - -#elif defined(__PGI) -# define COMPILER_ID "PGI" -# define COMPILER_VERSION_MAJOR DEC(__PGIC__) -# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) -# if defined(__PGIC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) -# endif - -#elif defined(_CRAYC) -# define COMPILER_ID "Cray" -# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) -# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) - -#elif defined(__TI_COMPILER_VERSION__) -# define COMPILER_ID "TI" - /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ -# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) -# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) -# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) - -#elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version) -# define COMPILER_ID "Fujitsu" - -#elif defined(__ghs__) -# define COMPILER_ID "GHS" -/* __GHS_VERSION_NUMBER = VVVVRP */ -# ifdef __GHS_VERSION_NUMBER -# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100) -# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10) -# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10) -# endif - -#elif defined(__SCO_VERSION__) -# define COMPILER_ID "SCO" - -#elif defined(__ARMCC_VERSION) && !defined(__clang__) -# define COMPILER_ID "ARMCC" -#if __ARMCC_VERSION >= 1000000 - /* __ARMCC_VERSION = VRRPPPP */ - # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) - # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) - # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) -#else - /* __ARMCC_VERSION = VRPPPP */ - # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) - # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) - # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) -#endif - - -#elif defined(__clang__) && defined(__apple_build_version__) -# define COMPILER_ID "AppleClang" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# define COMPILER_VERSION_MAJOR DEC(__clang_major__) -# define COMPILER_VERSION_MINOR DEC(__clang_minor__) -# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif -# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) - -#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION) -# define COMPILER_ID "ARMClang" - # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000) - # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100) - # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION % 10000) -# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION) - -#elif defined(__clang__) -# define COMPILER_ID "Clang" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# define COMPILER_VERSION_MAJOR DEC(__clang_major__) -# define COMPILER_VERSION_MINOR DEC(__clang_minor__) -# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif - -#elif defined(__GNUC__) || defined(__GNUG__) -# define COMPILER_ID "GNU" -# if defined(__GNUC__) -# define COMPILER_VERSION_MAJOR DEC(__GNUC__) -# else -# define COMPILER_VERSION_MAJOR DEC(__GNUG__) -# endif -# if defined(__GNUC_MINOR__) -# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) -# endif -# if defined(__GNUC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) -# endif - -#elif defined(_MSC_VER) -# define COMPILER_ID "MSVC" - /* _MSC_VER = VVRR */ -# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) -# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) -# if defined(_MSC_FULL_VER) -# if _MSC_VER >= 1400 - /* _MSC_FULL_VER = VVRRPPPPP */ -# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) -# else - /* _MSC_FULL_VER = VVRRPPPP */ -# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) -# endif -# endif -# if defined(_MSC_BUILD) -# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) -# endif - -#elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) -# define COMPILER_ID "ADSP" -#if defined(__VISUALDSPVERSION__) - /* __VISUALDSPVERSION__ = 0xVVRRPP00 */ -# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24) -# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF) -# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF) -#endif - -#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) -# define COMPILER_ID "IAR" -# if defined(__VER__) && defined(__ICCARM__) -# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) -# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) -# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) -# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) -# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__)) -# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100) -# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100)) -# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__) -# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) -# endif - - -/* These compilers are either not known or too old to define an - identification macro. Try to identify the platform and guess that - it is the native compiler. */ -#elif defined(__hpux) || defined(__hpua) -# define COMPILER_ID "HP" - -#else /* unknown compiler */ -# define COMPILER_ID "" -#endif - -/* Construct the string literal in pieces to prevent the source from - getting matched. Store it in a pointer rather than an array - because some compilers will just produce instructions to fill the - array rather than assigning a pointer to a static array. */ -char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; -#ifdef SIMULATE_ID -char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; -#endif - -#ifdef __QNXNTO__ -char const* qnxnto = "INFO" ":" "qnxnto[]"; -#endif - -#if defined(__CRAYXE) || defined(__CRAYXC) -char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; -#endif - -#define STRINGIFY_HELPER(X) #X -#define STRINGIFY(X) STRINGIFY_HELPER(X) - -/* Identify known platforms by name. */ -#if defined(__linux) || defined(__linux__) || defined(linux) -# define PLATFORM_ID "Linux" - -#elif defined(__CYGWIN__) -# define PLATFORM_ID "Cygwin" - -#elif defined(__MINGW32__) -# define PLATFORM_ID "MinGW" - -#elif defined(__APPLE__) -# define PLATFORM_ID "Darwin" - -#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) -# define PLATFORM_ID "Windows" - -#elif defined(__FreeBSD__) || defined(__FreeBSD) -# define PLATFORM_ID "FreeBSD" - -#elif defined(__NetBSD__) || defined(__NetBSD) -# define PLATFORM_ID "NetBSD" - -#elif defined(__OpenBSD__) || defined(__OPENBSD) -# define PLATFORM_ID "OpenBSD" - -#elif defined(__sun) || defined(sun) -# define PLATFORM_ID "SunOS" - -#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) -# define PLATFORM_ID "AIX" - -#elif defined(__hpux) || defined(__hpux__) -# define PLATFORM_ID "HP-UX" - -#elif defined(__HAIKU__) -# define PLATFORM_ID "Haiku" - -#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) -# define PLATFORM_ID "BeOS" - -#elif defined(__QNX__) || defined(__QNXNTO__) -# define PLATFORM_ID "QNX" - -#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) -# define PLATFORM_ID "Tru64" - -#elif defined(__riscos) || defined(__riscos__) -# define PLATFORM_ID "RISCos" - -#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) -# define PLATFORM_ID "SINIX" - -#elif defined(__UNIX_SV__) -# define PLATFORM_ID "UNIX_SV" - -#elif defined(__bsdos__) -# define PLATFORM_ID "BSDOS" - -#elif defined(_MPRAS) || defined(MPRAS) -# define PLATFORM_ID "MP-RAS" - -#elif defined(__osf) || defined(__osf__) -# define PLATFORM_ID "OSF1" - -#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) -# define PLATFORM_ID "SCO_SV" - -#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) -# define PLATFORM_ID "ULTRIX" - -#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) -# define PLATFORM_ID "Xenix" - -#elif defined(__WATCOMC__) -# if defined(__LINUX__) -# define PLATFORM_ID "Linux" - -# elif defined(__DOS__) -# define PLATFORM_ID "DOS" - -# elif defined(__OS2__) -# define PLATFORM_ID "OS2" - -# elif defined(__WINDOWS__) -# define PLATFORM_ID "Windows3x" - -# else /* unknown platform */ -# define PLATFORM_ID -# endif - -#elif defined(__INTEGRITY) -# if defined(INT_178B) -# define PLATFORM_ID "Integrity178" - -# else /* regular Integrity */ -# define PLATFORM_ID "Integrity" -# endif - -#else /* unknown platform */ -# define PLATFORM_ID - -#endif - -/* For windows compilers MSVC and Intel we can determine - the architecture of the compiler being used. This is because - the compilers do not have flags that can change the architecture, - but rather depend on which compiler is being used -*/ -#if defined(_WIN32) && defined(_MSC_VER) -# if defined(_M_IA64) -# define ARCHITECTURE_ID "IA64" - -# elif defined(_M_X64) || defined(_M_AMD64) -# define ARCHITECTURE_ID "x64" - -# elif defined(_M_IX86) -# define ARCHITECTURE_ID "X86" - -# elif defined(_M_ARM64) -# define ARCHITECTURE_ID "ARM64" - -# elif defined(_M_ARM) -# if _M_ARM == 4 -# define ARCHITECTURE_ID "ARMV4I" -# elif _M_ARM == 5 -# define ARCHITECTURE_ID "ARMV5I" -# else -# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) -# endif - -# elif defined(_M_MIPS) -# define ARCHITECTURE_ID "MIPS" - -# elif defined(_M_SH) -# define ARCHITECTURE_ID "SHx" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__WATCOMC__) -# if defined(_M_I86) -# define ARCHITECTURE_ID "I86" - -# elif defined(_M_IX86) -# define ARCHITECTURE_ID "X86" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) -# if defined(__ICCARM__) -# define ARCHITECTURE_ID "ARM" - -# elif defined(__ICCRX__) -# define ARCHITECTURE_ID "RX" - -# elif defined(__ICCRH850__) -# define ARCHITECTURE_ID "RH850" - -# elif defined(__ICCRL78__) -# define ARCHITECTURE_ID "RL78" - -# elif defined(__ICCRISCV__) -# define ARCHITECTURE_ID "RISCV" - -# elif defined(__ICCAVR__) -# define ARCHITECTURE_ID "AVR" - -# elif defined(__ICC430__) -# define ARCHITECTURE_ID "MSP430" - -# elif defined(__ICCV850__) -# define ARCHITECTURE_ID "V850" - -# elif defined(__ICC8051__) -# define ARCHITECTURE_ID "8051" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__ghs__) -# if defined(__PPC64__) -# define ARCHITECTURE_ID "PPC64" - -# elif defined(__ppc__) -# define ARCHITECTURE_ID "PPC" - -# elif defined(__ARM__) -# define ARCHITECTURE_ID "ARM" - -# elif defined(__x86_64__) -# define ARCHITECTURE_ID "x64" - -# elif defined(__i386__) -# define ARCHITECTURE_ID "X86" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif -#else -# define ARCHITECTURE_ID -#endif - -/* Convert integer to decimal digit literals. */ -#define DEC(n) \ - ('0' + (((n) / 10000000)%10)), \ - ('0' + (((n) / 1000000)%10)), \ - ('0' + (((n) / 100000)%10)), \ - ('0' + (((n) / 10000)%10)), \ - ('0' + (((n) / 1000)%10)), \ - ('0' + (((n) / 100)%10)), \ - ('0' + (((n) / 10)%10)), \ - ('0' + ((n) % 10)) - -/* Convert integer to hex digit literals. */ -#define HEX(n) \ - ('0' + ((n)>>28 & 0xF)), \ - ('0' + ((n)>>24 & 0xF)), \ - ('0' + ((n)>>20 & 0xF)), \ - ('0' + ((n)>>16 & 0xF)), \ - ('0' + ((n)>>12 & 0xF)), \ - ('0' + ((n)>>8 & 0xF)), \ - ('0' + ((n)>>4 & 0xF)), \ - ('0' + ((n) & 0xF)) - -/* Construct a string literal encoding the version number components. */ -#ifdef COMPILER_VERSION_MAJOR -char const info_version[] = { - 'I', 'N', 'F', 'O', ':', - 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', - COMPILER_VERSION_MAJOR, -# ifdef COMPILER_VERSION_MINOR - '.', COMPILER_VERSION_MINOR, -# ifdef COMPILER_VERSION_PATCH - '.', COMPILER_VERSION_PATCH, -# ifdef COMPILER_VERSION_TWEAK - '.', COMPILER_VERSION_TWEAK, -# endif -# endif -# endif - ']','\0'}; -#endif - -/* Construct a string literal encoding the internal version number. */ -#ifdef COMPILER_VERSION_INTERNAL -char const info_version_internal[] = { - 'I', 'N', 'F', 'O', ':', - 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', - 'i','n','t','e','r','n','a','l','[', - COMPILER_VERSION_INTERNAL,']','\0'}; -#endif - -/* Construct a string literal encoding the version number components. */ -#ifdef SIMULATE_VERSION_MAJOR -char const info_simulate_version[] = { - 'I', 'N', 'F', 'O', ':', - 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', - SIMULATE_VERSION_MAJOR, -# ifdef SIMULATE_VERSION_MINOR - '.', SIMULATE_VERSION_MINOR, -# ifdef SIMULATE_VERSION_PATCH - '.', SIMULATE_VERSION_PATCH, -# ifdef SIMULATE_VERSION_TWEAK - '.', SIMULATE_VERSION_TWEAK, -# endif -# endif -# endif - ']','\0'}; -#endif - -/* Construct the string literal in pieces to prevent the source from - getting matched. Store it in a pointer rather than an array - because some compilers will just produce instructions to fill the - array rather than assigning a pointer to a static array. */ -char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; -char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; - - - - -#if defined(__INTEL_COMPILER) && defined(_MSVC_LANG) && _MSVC_LANG < 201403L -# if defined(__INTEL_CXX11_MODE__) -# if defined(__cpp_aggregate_nsdmi) -# define CXX_STD 201402L -# else -# define CXX_STD 201103L -# endif -# else -# define CXX_STD 199711L -# endif -#elif defined(_MSC_VER) && defined(_MSVC_LANG) -# define CXX_STD _MSVC_LANG -#else -# define CXX_STD __cplusplus -#endif - -const char* info_language_dialect_default = "INFO" ":" "dialect_default[" -#if CXX_STD > 201703L - "20" -#elif CXX_STD >= 201703L - "17" -#elif CXX_STD >= 201402L - "14" -#elif CXX_STD >= 201103L - "11" -#else - "98" -#endif -"]"; - -/*--------------------------------------------------------------------------*/ - -int main(int argc, char* argv[]) -{ - int require = 0; - require += info_compiler[argc]; - require += info_platform[argc]; -#ifdef COMPILER_VERSION_MAJOR - require += info_version[argc]; -#endif -#ifdef COMPILER_VERSION_INTERNAL - require += info_version_internal[argc]; -#endif -#ifdef SIMULATE_ID - require += info_simulate[argc]; -#endif -#ifdef SIMULATE_VERSION_MAJOR - require += info_simulate_version[argc]; -#endif -#if defined(__CRAYXE) || defined(__CRAYXC) - require += info_cray[argc]; -#endif - require += info_language_dialect_default[argc]; - (void)argv; - return require; -} diff --git a/build/CMakeFiles/3.16.3/CompilerIdCXX/a.out b/build/CMakeFiles/3.16.3/CompilerIdCXX/a.out deleted file mode 100755 index fc5f46e152f2150f21c5e7cdddf305c4d1702557..0000000000000000000000000000000000000000 Binary files a/build/CMakeFiles/3.16.3/CompilerIdCXX/a.out and /dev/null differ diff --git a/build/CMakeFiles/CMakeOutput.log b/build/CMakeFiles/CMakeOutput.log deleted file mode 100644 index 9affeb9230572e4e177930b8b3924591dacf912c..0000000000000000000000000000000000000000 --- a/build/CMakeFiles/CMakeOutput.log +++ /dev/null @@ -1,463 +0,0 @@ -The system is: Linux - 5.4.18-35-generic - aarch64 -Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded. -Compiler: /bin/c99-gcc -Build flags: -Id flags: - -The output was: -0 - - -Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "a.out" - -The C compiler identification is GNU, found in "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/CMakeFiles/3.16.3/CompilerIdC/a.out" - -Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded. -Compiler: /bin/c++ -Build flags: -Id flags: - -The output was: -0 - - -Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "a.out" - -The CXX compiler identification is GNU, found in "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/CMakeFiles/3.16.3/CompilerIdCXX/a.out" - -Determining if the C compiler works passed with the following output: -Change Dir: /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/CMakeFiles/CMakeTmp - -Run Build Command(s):/usr/bin/ninja cmTC_6ca8b && [1/2] Building C object CMakeFiles/cmTC_6ca8b.dir/testCCompiler.c.o -[2/2] Linking C executable cmTC_6ca8b - - - -Detecting C compiler ABI info compiled with the following output: -Change Dir: /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/CMakeFiles/CMakeTmp - -Run Build Command(s):/usr/bin/ninja cmTC_4a003 && [1/2] Building C object CMakeFiles/cmTC_4a003.dir/CMakeCCompilerABI.c.o -Using built-in specs. -COLLECT_GCC=gcc -Target: aarch64-linux-gnu -Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.3.0-17kylin1~20.04' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=aarch64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --enable-fix-cortex-a53-843419 --disable-werror --enable-checking=release --build=aarch64-linux-gnu --host=aarch64-linux-gnu --target=aarch64-linux-gnu -Thread model: posix -gcc version 9.3.0 (Ubuntu 9.3.0-17kylin1~20.04) -COLLECT_GCC_OPTIONS='-std=c99' '-v' '-o' 'CMakeFiles/cmTC_4a003.dir/CMakeCCompilerABI.c.o' '-c' '-mlittle-endian' '-mabi=lp64' - /usr/lib/gcc/aarch64-linux-gnu/9/cc1 -quiet -v -imultiarch aarch64-linux-gnu /usr/share/cmake-3.16/Modules/CMakeCCompilerABI.c -quiet -dumpbase CMakeCCompilerABI.c -mlittle-endian -mabi=lp64 -auxbase-strip CMakeFiles/cmTC_4a003.dir/CMakeCCompilerABI.c.o -std=c99 -version -fasynchronous-unwind-tables -fstack-protector-strong -Wformat -Wformat-security -fstack-clash-protection -o /tmp/ccwtI2UM.s -GNU C99 (Ubuntu 9.3.0-17kylin1~20.04) version 9.3.0 (aarch64-linux-gnu) - compiled by GNU C version 9.3.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.22.1-GMP - -GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 -ignoring nonexistent directory "/usr/local/include/aarch64-linux-gnu" -ignoring nonexistent directory "/usr/lib/gcc/aarch64-linux-gnu/9/include-fixed" -ignoring nonexistent directory "/usr/lib/gcc/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/include" -#include "..." search starts here: -#include <...> search starts here: - /usr/lib/gcc/aarch64-linux-gnu/9/include - /usr/local/include - /usr/include/aarch64-linux-gnu - /usr/include -End of search list. -GNU C99 (Ubuntu 9.3.0-17kylin1~20.04) version 9.3.0 (aarch64-linux-gnu) - compiled by GNU C version 9.3.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.22.1-GMP - -GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 -Compiler executable checksum: 572f716ee81e7aecbb5b057a3e004245 -COLLECT_GCC_OPTIONS='-std=c99' '-v' '-o' 'CMakeFiles/cmTC_4a003.dir/CMakeCCompilerABI.c.o' '-c' '-mlittle-endian' '-mabi=lp64' - as -v -EL -mabi=lp64 -o CMakeFiles/cmTC_4a003.dir/CMakeCCompilerABI.c.o /tmp/ccwtI2UM.s -GNU assembler version 2.34 (aarch64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.34 -COMPILER_PATH=/usr/lib/gcc/aarch64-linux-gnu/9/:/usr/lib/gcc/aarch64-linux-gnu/9/:/usr/lib/gcc/aarch64-linux-gnu/:/usr/lib/gcc/aarch64-linux-gnu/9/:/usr/lib/gcc/aarch64-linux-gnu/ -LIBRARY_PATH=/usr/lib/gcc/aarch64-linux-gnu/9/:/usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/:/usr/lib/gcc/aarch64-linux-gnu/9/../../../../lib/:/lib/aarch64-linux-gnu/:/lib/../lib/:/usr/lib/aarch64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/aarch64-linux-gnu/9/../../../:/lib/:/usr/lib/ -COLLECT_GCC_OPTIONS='-std=c99' '-v' '-o' 'CMakeFiles/cmTC_4a003.dir/CMakeCCompilerABI.c.o' '-c' '-mlittle-endian' '-mabi=lp64' -[2/2] Linking C executable cmTC_4a003 -Using built-in specs. -COLLECT_GCC=gcc -COLLECT_LTO_WRAPPER=/usr/lib/gcc/aarch64-linux-gnu/9/lto-wrapper -Target: aarch64-linux-gnu -Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.3.0-17kylin1~20.04' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=aarch64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --enable-fix-cortex-a53-843419 --disable-werror --enable-checking=release --build=aarch64-linux-gnu --host=aarch64-linux-gnu --target=aarch64-linux-gnu -Thread model: posix -gcc version 9.3.0 (Ubuntu 9.3.0-17kylin1~20.04) -COMPILER_PATH=/usr/lib/gcc/aarch64-linux-gnu/9/:/usr/lib/gcc/aarch64-linux-gnu/9/:/usr/lib/gcc/aarch64-linux-gnu/:/usr/lib/gcc/aarch64-linux-gnu/9/:/usr/lib/gcc/aarch64-linux-gnu/ -LIBRARY_PATH=/usr/lib/gcc/aarch64-linux-gnu/9/:/usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/:/usr/lib/gcc/aarch64-linux-gnu/9/../../../../lib/:/lib/aarch64-linux-gnu/:/lib/../lib/:/usr/lib/aarch64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/aarch64-linux-gnu/9/../../../:/lib/:/usr/lib/ -COLLECT_GCC_OPTIONS='-std=c99' '-v' '-o' 'cmTC_4a003' '-mlittle-endian' '-mabi=lp64' - /usr/lib/gcc/aarch64-linux-gnu/9/collect2 -plugin /usr/lib/gcc/aarch64-linux-gnu/9/liblto_plugin.so -plugin-opt=/usr/lib/gcc/aarch64-linux-gnu/9/lto-wrapper -plugin-opt=-fresolution=/tmp/ccHOmD34.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --eh-frame-hdr --hash-style=gnu --as-needed -dynamic-linker /lib/ld-linux-aarch64.so.1 -X -EL -maarch64linux --fix-cortex-a53-843419 -pie -z now -z relro -o cmTC_4a003 /usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/Scrt1.o /usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/crti.o /usr/lib/gcc/aarch64-linux-gnu/9/crtbeginS.o -L/usr/lib/gcc/aarch64-linux-gnu/9 -L/usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu -L/usr/lib/gcc/aarch64-linux-gnu/9/../../../../lib -L/lib/aarch64-linux-gnu -L/lib/../lib -L/usr/lib/aarch64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/aarch64-linux-gnu/9/../../.. CMakeFiles/cmTC_4a003.dir/CMakeCCompilerABI.c.o -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/lib/gcc/aarch64-linux-gnu/9/crtendS.o /usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/crtn.o -COLLECT_GCC_OPTIONS='-std=c99' '-v' '-o' 'cmTC_4a003' '-mlittle-endian' '-mabi=lp64' - - - -Parsed C implicit include dir info from above output: rv=done - found start of include info - found start of implicit include info - add: [/usr/lib/gcc/aarch64-linux-gnu/9/include] - add: [/usr/local/include] - add: [/usr/include/aarch64-linux-gnu] - add: [/usr/include] - end of search list found - collapse include dir [/usr/lib/gcc/aarch64-linux-gnu/9/include] ==> [/usr/lib/gcc/aarch64-linux-gnu/9/include] - collapse include dir [/usr/local/include] ==> [/usr/local/include] - collapse include dir [/usr/include/aarch64-linux-gnu] ==> [/usr/include/aarch64-linux-gnu] - collapse include dir [/usr/include] ==> [/usr/include] - implicit include dirs: [/usr/lib/gcc/aarch64-linux-gnu/9/include;/usr/local/include;/usr/include/aarch64-linux-gnu;/usr/include] - - -Parsed C implicit link information from above output: - link line regex: [^( *|.*[/\])(ld|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\]+-)?ld|collect2)[^/\]*( |$)] - ignore line: [Change Dir: /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/CMakeFiles/CMakeTmp] - ignore line: [] - ignore line: [Run Build Command(s):/usr/bin/ninja cmTC_4a003 && [1/2] Building C object CMakeFiles/cmTC_4a003.dir/CMakeCCompilerABI.c.o] - ignore line: [Using built-in specs.] - ignore line: [COLLECT_GCC=gcc] - ignore line: [Target: aarch64-linux-gnu] - ignore line: [Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.3.0-17kylin1~20.04' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c ada c++ go d fortran objc obj-c++ gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=aarch64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --enable-fix-cortex-a53-843419 --disable-werror --enable-checking=release --build=aarch64-linux-gnu --host=aarch64-linux-gnu --target=aarch64-linux-gnu] - ignore line: [Thread model: posix] - ignore line: [gcc version 9.3.0 (Ubuntu 9.3.0-17kylin1~20.04) ] - ignore line: [COLLECT_GCC_OPTIONS='-std=c99' '-v' '-o' 'CMakeFiles/cmTC_4a003.dir/CMakeCCompilerABI.c.o' '-c' '-mlittle-endian' '-mabi=lp64'] - ignore line: [ /usr/lib/gcc/aarch64-linux-gnu/9/cc1 -quiet -v -imultiarch aarch64-linux-gnu /usr/share/cmake-3.16/Modules/CMakeCCompilerABI.c -quiet -dumpbase CMakeCCompilerABI.c -mlittle-endian -mabi=lp64 -auxbase-strip CMakeFiles/cmTC_4a003.dir/CMakeCCompilerABI.c.o -std=c99 -version -fasynchronous-unwind-tables -fstack-protector-strong -Wformat -Wformat-security -fstack-clash-protection -o /tmp/ccwtI2UM.s] - ignore line: [GNU C99 (Ubuntu 9.3.0-17kylin1~20.04) version 9.3.0 (aarch64-linux-gnu)] - ignore line: [ compiled by GNU C version 9.3.0 GMP version 6.2.0 MPFR version 4.0.2 MPC version 1.1.0 isl version isl-0.22.1-GMP] - ignore line: [] - ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072] - ignore line: [ignoring nonexistent directory "/usr/local/include/aarch64-linux-gnu"] - ignore line: [ignoring nonexistent directory "/usr/lib/gcc/aarch64-linux-gnu/9/include-fixed"] - ignore line: [ignoring nonexistent directory "/usr/lib/gcc/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/include"] - ignore line: [#include "..." search starts here:] - ignore line: [#include <...> search starts here:] - ignore line: [ /usr/lib/gcc/aarch64-linux-gnu/9/include] - ignore line: [ /usr/local/include] - ignore line: [ /usr/include/aarch64-linux-gnu] - ignore line: [ /usr/include] - ignore line: [End of search list.] - ignore line: [GNU C99 (Ubuntu 9.3.0-17kylin1~20.04) version 9.3.0 (aarch64-linux-gnu)] - ignore line: [ compiled by GNU C version 9.3.0 GMP version 6.2.0 MPFR version 4.0.2 MPC version 1.1.0 isl version isl-0.22.1-GMP] - ignore line: [] - ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072] - ignore line: [Compiler executable checksum: 572f716ee81e7aecbb5b057a3e004245] - ignore line: [COLLECT_GCC_OPTIONS='-std=c99' '-v' '-o' 'CMakeFiles/cmTC_4a003.dir/CMakeCCompilerABI.c.o' '-c' '-mlittle-endian' '-mabi=lp64'] - ignore line: [ as -v -EL -mabi=lp64 -o CMakeFiles/cmTC_4a003.dir/CMakeCCompilerABI.c.o /tmp/ccwtI2UM.s] - ignore line: [GNU assembler version 2.34 (aarch64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.34] - ignore line: [COMPILER_PATH=/usr/lib/gcc/aarch64-linux-gnu/9/:/usr/lib/gcc/aarch64-linux-gnu/9/:/usr/lib/gcc/aarch64-linux-gnu/:/usr/lib/gcc/aarch64-linux-gnu/9/:/usr/lib/gcc/aarch64-linux-gnu/] - ignore line: [LIBRARY_PATH=/usr/lib/gcc/aarch64-linux-gnu/9/:/usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/:/usr/lib/gcc/aarch64-linux-gnu/9/../../../../lib/:/lib/aarch64-linux-gnu/:/lib/../lib/:/usr/lib/aarch64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/aarch64-linux-gnu/9/../../../:/lib/:/usr/lib/] - ignore line: [COLLECT_GCC_OPTIONS='-std=c99' '-v' '-o' 'CMakeFiles/cmTC_4a003.dir/CMakeCCompilerABI.c.o' '-c' '-mlittle-endian' '-mabi=lp64'] - ignore line: [[2/2] Linking C executable cmTC_4a003] - ignore line: [Using built-in specs.] - ignore line: [COLLECT_GCC=gcc] - ignore line: [COLLECT_LTO_WRAPPER=/usr/lib/gcc/aarch64-linux-gnu/9/lto-wrapper] - ignore line: [Target: aarch64-linux-gnu] - ignore line: [Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.3.0-17kylin1~20.04' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c ada c++ go d fortran objc obj-c++ gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=aarch64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --enable-fix-cortex-a53-843419 --disable-werror --enable-checking=release --build=aarch64-linux-gnu --host=aarch64-linux-gnu --target=aarch64-linux-gnu] - ignore line: [Thread model: posix] - ignore line: [gcc version 9.3.0 (Ubuntu 9.3.0-17kylin1~20.04) ] - ignore line: [COMPILER_PATH=/usr/lib/gcc/aarch64-linux-gnu/9/:/usr/lib/gcc/aarch64-linux-gnu/9/:/usr/lib/gcc/aarch64-linux-gnu/:/usr/lib/gcc/aarch64-linux-gnu/9/:/usr/lib/gcc/aarch64-linux-gnu/] - ignore line: [LIBRARY_PATH=/usr/lib/gcc/aarch64-linux-gnu/9/:/usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/:/usr/lib/gcc/aarch64-linux-gnu/9/../../../../lib/:/lib/aarch64-linux-gnu/:/lib/../lib/:/usr/lib/aarch64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/aarch64-linux-gnu/9/../../../:/lib/:/usr/lib/] - ignore line: [COLLECT_GCC_OPTIONS='-std=c99' '-v' '-o' 'cmTC_4a003' '-mlittle-endian' '-mabi=lp64'] - link line: [ /usr/lib/gcc/aarch64-linux-gnu/9/collect2 -plugin /usr/lib/gcc/aarch64-linux-gnu/9/liblto_plugin.so -plugin-opt=/usr/lib/gcc/aarch64-linux-gnu/9/lto-wrapper -plugin-opt=-fresolution=/tmp/ccHOmD34.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --eh-frame-hdr --hash-style=gnu --as-needed -dynamic-linker /lib/ld-linux-aarch64.so.1 -X -EL -maarch64linux --fix-cortex-a53-843419 -pie -z now -z relro -o cmTC_4a003 /usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/Scrt1.o /usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/crti.o /usr/lib/gcc/aarch64-linux-gnu/9/crtbeginS.o -L/usr/lib/gcc/aarch64-linux-gnu/9 -L/usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu -L/usr/lib/gcc/aarch64-linux-gnu/9/../../../../lib -L/lib/aarch64-linux-gnu -L/lib/../lib -L/usr/lib/aarch64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/aarch64-linux-gnu/9/../../.. CMakeFiles/cmTC_4a003.dir/CMakeCCompilerABI.c.o -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/lib/gcc/aarch64-linux-gnu/9/crtendS.o /usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/crtn.o] - arg [/usr/lib/gcc/aarch64-linux-gnu/9/collect2] ==> ignore - arg [-plugin] ==> ignore - arg [/usr/lib/gcc/aarch64-linux-gnu/9/liblto_plugin.so] ==> ignore - arg [-plugin-opt=/usr/lib/gcc/aarch64-linux-gnu/9/lto-wrapper] ==> ignore - arg [-plugin-opt=-fresolution=/tmp/ccHOmD34.res] ==> ignore - arg [-plugin-opt=-pass-through=-lgcc] ==> ignore - arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore - arg [-plugin-opt=-pass-through=-lc] ==> ignore - arg [-plugin-opt=-pass-through=-lgcc] ==> ignore - arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore - arg [--build-id] ==> ignore - arg [--eh-frame-hdr] ==> ignore - arg [--hash-style=gnu] ==> ignore - arg [--as-needed] ==> ignore - arg [-dynamic-linker] ==> ignore - arg [/lib/ld-linux-aarch64.so.1] ==> ignore - arg [-X] ==> ignore - arg [-EL] ==> ignore - arg [-maarch64linux] ==> ignore - arg [--fix-cortex-a53-843419] ==> ignore - arg [-pie] ==> ignore - arg [-znow] ==> ignore - arg [-zrelro] ==> ignore - arg [-o] ==> ignore - arg [cmTC_4a003] ==> ignore - arg [/usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/Scrt1.o] ==> ignore - arg [/usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/crti.o] ==> ignore - arg [/usr/lib/gcc/aarch64-linux-gnu/9/crtbeginS.o] ==> ignore - arg [-L/usr/lib/gcc/aarch64-linux-gnu/9] ==> dir [/usr/lib/gcc/aarch64-linux-gnu/9] - arg [-L/usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu] ==> dir [/usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu] - arg [-L/usr/lib/gcc/aarch64-linux-gnu/9/../../../../lib] ==> dir [/usr/lib/gcc/aarch64-linux-gnu/9/../../../../lib] - arg [-L/lib/aarch64-linux-gnu] ==> dir [/lib/aarch64-linux-gnu] - arg [-L/lib/../lib] ==> dir [/lib/../lib] - arg [-L/usr/lib/aarch64-linux-gnu] ==> dir [/usr/lib/aarch64-linux-gnu] - arg [-L/usr/lib/../lib] ==> dir [/usr/lib/../lib] - arg [-L/usr/lib/gcc/aarch64-linux-gnu/9/../../..] ==> dir [/usr/lib/gcc/aarch64-linux-gnu/9/../../..] - arg [CMakeFiles/cmTC_4a003.dir/CMakeCCompilerABI.c.o] ==> ignore - arg [-lgcc] ==> lib [gcc] - arg [--push-state] ==> ignore - arg [--as-needed] ==> ignore - arg [-lgcc_s] ==> lib [gcc_s] - arg [--pop-state] ==> ignore - arg [-lc] ==> lib [c] - arg [-lgcc] ==> lib [gcc] - arg [--push-state] ==> ignore - arg [--as-needed] ==> ignore - arg [-lgcc_s] ==> lib [gcc_s] - arg [--pop-state] ==> ignore - arg [/usr/lib/gcc/aarch64-linux-gnu/9/crtendS.o] ==> ignore - arg [/usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/crtn.o] ==> ignore - collapse library dir [/usr/lib/gcc/aarch64-linux-gnu/9] ==> [/usr/lib/gcc/aarch64-linux-gnu/9] - collapse library dir [/usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu] ==> [/usr/lib/aarch64-linux-gnu] - collapse library dir [/usr/lib/gcc/aarch64-linux-gnu/9/../../../../lib] ==> [/usr/lib] - collapse library dir [/lib/aarch64-linux-gnu] ==> [/lib/aarch64-linux-gnu] - collapse library dir [/lib/../lib] ==> [/lib] - collapse library dir [/usr/lib/aarch64-linux-gnu] ==> [/usr/lib/aarch64-linux-gnu] - collapse library dir [/usr/lib/../lib] ==> [/usr/lib] - collapse library dir [/usr/lib/gcc/aarch64-linux-gnu/9/../../..] ==> [/usr/lib] - implicit libs: [gcc;gcc_s;c;gcc;gcc_s] - implicit dirs: [/usr/lib/gcc/aarch64-linux-gnu/9;/usr/lib/aarch64-linux-gnu;/usr/lib;/lib/aarch64-linux-gnu;/lib] - implicit fwks: [] - - -Determining if the CXX compiler works passed with the following output: -Change Dir: /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/CMakeFiles/CMakeTmp - -Run Build Command(s):/usr/bin/ninja cmTC_af0a1 && [1/2] Building CXX object CMakeFiles/cmTC_af0a1.dir/testCXXCompiler.cxx.o -[2/2] Linking CXX executable cmTC_af0a1 - - - -Detecting CXX compiler ABI info compiled with the following output: -Change Dir: /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/CMakeFiles/CMakeTmp - -Run Build Command(s):/usr/bin/ninja cmTC_fb431 && [1/2] Building CXX object CMakeFiles/cmTC_fb431.dir/CMakeCXXCompilerABI.cpp.o -Using built-in specs. -COLLECT_GCC=/bin/c++ -Target: aarch64-linux-gnu -Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.3.0-17kylin1~20.04' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=aarch64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --enable-fix-cortex-a53-843419 --disable-werror --enable-checking=release --build=aarch64-linux-gnu --host=aarch64-linux-gnu --target=aarch64-linux-gnu -Thread model: posix -gcc version 9.3.0 (Ubuntu 9.3.0-17kylin1~20.04) -COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_fb431.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mlittle-endian' '-mabi=lp64' - /usr/lib/gcc/aarch64-linux-gnu/9/cc1plus -quiet -v -imultiarch aarch64-linux-gnu -D_GNU_SOURCE /usr/share/cmake-3.16/Modules/CMakeCXXCompilerABI.cpp -quiet -dumpbase CMakeCXXCompilerABI.cpp -mlittle-endian -mabi=lp64 -auxbase-strip CMakeFiles/cmTC_fb431.dir/CMakeCXXCompilerABI.cpp.o -version -fasynchronous-unwind-tables -fstack-protector-strong -Wformat -Wformat-security -fstack-clash-protection -o /tmp/ccDSCUEh.s -GNU C++14 (Ubuntu 9.3.0-17kylin1~20.04) version 9.3.0 (aarch64-linux-gnu) - compiled by GNU C version 9.3.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.22.1-GMP - -GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 -ignoring duplicate directory "/usr/include/aarch64-linux-gnu/c++/9" -ignoring nonexistent directory "/usr/local/include/aarch64-linux-gnu" -ignoring nonexistent directory "/usr/lib/gcc/aarch64-linux-gnu/9/include-fixed" -ignoring nonexistent directory "/usr/lib/gcc/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/include" -#include "..." search starts here: -#include <...> search starts here: - /usr/include/c++/9 - /usr/include/aarch64-linux-gnu/c++/9 - /usr/include/c++/9/backward - /usr/lib/gcc/aarch64-linux-gnu/9/include - /usr/local/include - /usr/include/aarch64-linux-gnu - /usr/include -End of search list. -GNU C++14 (Ubuntu 9.3.0-17kylin1~20.04) version 9.3.0 (aarch64-linux-gnu) - compiled by GNU C version 9.3.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.22.1-GMP - -GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 -Compiler executable checksum: 7e550932d330b6b5f073e21d4328add5 -COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_fb431.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mlittle-endian' '-mabi=lp64' - as -v -EL -mabi=lp64 -o CMakeFiles/cmTC_fb431.dir/CMakeCXXCompilerABI.cpp.o /tmp/ccDSCUEh.s -GNU assembler version 2.34 (aarch64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.34 -COMPILER_PATH=/usr/lib/gcc/aarch64-linux-gnu/9/:/usr/lib/gcc/aarch64-linux-gnu/9/:/usr/lib/gcc/aarch64-linux-gnu/:/usr/lib/gcc/aarch64-linux-gnu/9/:/usr/lib/gcc/aarch64-linux-gnu/ -LIBRARY_PATH=/usr/lib/gcc/aarch64-linux-gnu/9/:/usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/:/usr/lib/gcc/aarch64-linux-gnu/9/../../../../lib/:/lib/aarch64-linux-gnu/:/lib/../lib/:/usr/lib/aarch64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/aarch64-linux-gnu/9/../../../:/lib/:/usr/lib/ -COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_fb431.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mlittle-endian' '-mabi=lp64' -[2/2] Linking CXX executable cmTC_fb431 -Using built-in specs. -COLLECT_GCC=/bin/c++ -COLLECT_LTO_WRAPPER=/usr/lib/gcc/aarch64-linux-gnu/9/lto-wrapper -Target: aarch64-linux-gnu -Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.3.0-17kylin1~20.04' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=aarch64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --enable-fix-cortex-a53-843419 --disable-werror --enable-checking=release --build=aarch64-linux-gnu --host=aarch64-linux-gnu --target=aarch64-linux-gnu -Thread model: posix -gcc version 9.3.0 (Ubuntu 9.3.0-17kylin1~20.04) -COMPILER_PATH=/usr/lib/gcc/aarch64-linux-gnu/9/:/usr/lib/gcc/aarch64-linux-gnu/9/:/usr/lib/gcc/aarch64-linux-gnu/:/usr/lib/gcc/aarch64-linux-gnu/9/:/usr/lib/gcc/aarch64-linux-gnu/ -LIBRARY_PATH=/usr/lib/gcc/aarch64-linux-gnu/9/:/usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/:/usr/lib/gcc/aarch64-linux-gnu/9/../../../../lib/:/lib/aarch64-linux-gnu/:/lib/../lib/:/usr/lib/aarch64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/aarch64-linux-gnu/9/../../../:/lib/:/usr/lib/ -COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_fb431' '-shared-libgcc' '-mlittle-endian' '-mabi=lp64' - /usr/lib/gcc/aarch64-linux-gnu/9/collect2 -plugin /usr/lib/gcc/aarch64-linux-gnu/9/liblto_plugin.so -plugin-opt=/usr/lib/gcc/aarch64-linux-gnu/9/lto-wrapper -plugin-opt=-fresolution=/tmp/cctNTQ5y.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id --eh-frame-hdr --hash-style=gnu --as-needed -dynamic-linker /lib/ld-linux-aarch64.so.1 -X -EL -maarch64linux --fix-cortex-a53-843419 -pie -z now -z relro -o cmTC_fb431 /usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/Scrt1.o /usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/crti.o /usr/lib/gcc/aarch64-linux-gnu/9/crtbeginS.o -L/usr/lib/gcc/aarch64-linux-gnu/9 -L/usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu -L/usr/lib/gcc/aarch64-linux-gnu/9/../../../../lib -L/lib/aarch64-linux-gnu -L/lib/../lib -L/usr/lib/aarch64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/aarch64-linux-gnu/9/../../.. CMakeFiles/cmTC_fb431.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/aarch64-linux-gnu/9/crtendS.o /usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/crtn.o -COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_fb431' '-shared-libgcc' '-mlittle-endian' '-mabi=lp64' - - - -Parsed CXX implicit include dir info from above output: rv=done - found start of include info - found start of implicit include info - add: [/usr/include/c++/9] - add: [/usr/include/aarch64-linux-gnu/c++/9] - add: [/usr/include/c++/9/backward] - add: [/usr/lib/gcc/aarch64-linux-gnu/9/include] - add: [/usr/local/include] - add: [/usr/include/aarch64-linux-gnu] - add: [/usr/include] - end of search list found - collapse include dir [/usr/include/c++/9] ==> [/usr/include/c++/9] - collapse include dir [/usr/include/aarch64-linux-gnu/c++/9] ==> [/usr/include/aarch64-linux-gnu/c++/9] - collapse include dir [/usr/include/c++/9/backward] ==> [/usr/include/c++/9/backward] - collapse include dir [/usr/lib/gcc/aarch64-linux-gnu/9/include] ==> [/usr/lib/gcc/aarch64-linux-gnu/9/include] - collapse include dir [/usr/local/include] ==> [/usr/local/include] - collapse include dir [/usr/include/aarch64-linux-gnu] ==> [/usr/include/aarch64-linux-gnu] - collapse include dir [/usr/include] ==> [/usr/include] - implicit include dirs: [/usr/include/c++/9;/usr/include/aarch64-linux-gnu/c++/9;/usr/include/c++/9/backward;/usr/lib/gcc/aarch64-linux-gnu/9/include;/usr/local/include;/usr/include/aarch64-linux-gnu;/usr/include] - - -Parsed CXX implicit link information from above output: - link line regex: [^( *|.*[/\])(ld|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\]+-)?ld|collect2)[^/\]*( |$)] - ignore line: [Change Dir: /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/CMakeFiles/CMakeTmp] - ignore line: [] - ignore line: [Run Build Command(s):/usr/bin/ninja cmTC_fb431 && [1/2] Building CXX object CMakeFiles/cmTC_fb431.dir/CMakeCXXCompilerABI.cpp.o] - ignore line: [Using built-in specs.] - ignore line: [COLLECT_GCC=/bin/c++] - ignore line: [Target: aarch64-linux-gnu] - ignore line: [Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.3.0-17kylin1~20.04' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c ada c++ go d fortran objc obj-c++ gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=aarch64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --enable-fix-cortex-a53-843419 --disable-werror --enable-checking=release --build=aarch64-linux-gnu --host=aarch64-linux-gnu --target=aarch64-linux-gnu] - ignore line: [Thread model: posix] - ignore line: [gcc version 9.3.0 (Ubuntu 9.3.0-17kylin1~20.04) ] - ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_fb431.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mlittle-endian' '-mabi=lp64'] - ignore line: [ /usr/lib/gcc/aarch64-linux-gnu/9/cc1plus -quiet -v -imultiarch aarch64-linux-gnu -D_GNU_SOURCE /usr/share/cmake-3.16/Modules/CMakeCXXCompilerABI.cpp -quiet -dumpbase CMakeCXXCompilerABI.cpp -mlittle-endian -mabi=lp64 -auxbase-strip CMakeFiles/cmTC_fb431.dir/CMakeCXXCompilerABI.cpp.o -version -fasynchronous-unwind-tables -fstack-protector-strong -Wformat -Wformat-security -fstack-clash-protection -o /tmp/ccDSCUEh.s] - ignore line: [GNU C++14 (Ubuntu 9.3.0-17kylin1~20.04) version 9.3.0 (aarch64-linux-gnu)] - ignore line: [ compiled by GNU C version 9.3.0 GMP version 6.2.0 MPFR version 4.0.2 MPC version 1.1.0 isl version isl-0.22.1-GMP] - ignore line: [] - ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072] - ignore line: [ignoring duplicate directory "/usr/include/aarch64-linux-gnu/c++/9"] - ignore line: [ignoring nonexistent directory "/usr/local/include/aarch64-linux-gnu"] - ignore line: [ignoring nonexistent directory "/usr/lib/gcc/aarch64-linux-gnu/9/include-fixed"] - ignore line: [ignoring nonexistent directory "/usr/lib/gcc/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/include"] - ignore line: [#include "..." search starts here:] - ignore line: [#include <...> search starts here:] - ignore line: [ /usr/include/c++/9] - ignore line: [ /usr/include/aarch64-linux-gnu/c++/9] - ignore line: [ /usr/include/c++/9/backward] - ignore line: [ /usr/lib/gcc/aarch64-linux-gnu/9/include] - ignore line: [ /usr/local/include] - ignore line: [ /usr/include/aarch64-linux-gnu] - ignore line: [ /usr/include] - ignore line: [End of search list.] - ignore line: [GNU C++14 (Ubuntu 9.3.0-17kylin1~20.04) version 9.3.0 (aarch64-linux-gnu)] - ignore line: [ compiled by GNU C version 9.3.0 GMP version 6.2.0 MPFR version 4.0.2 MPC version 1.1.0 isl version isl-0.22.1-GMP] - ignore line: [] - ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072] - ignore line: [Compiler executable checksum: 7e550932d330b6b5f073e21d4328add5] - ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_fb431.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mlittle-endian' '-mabi=lp64'] - ignore line: [ as -v -EL -mabi=lp64 -o CMakeFiles/cmTC_fb431.dir/CMakeCXXCompilerABI.cpp.o /tmp/ccDSCUEh.s] - ignore line: [GNU assembler version 2.34 (aarch64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.34] - ignore line: [COMPILER_PATH=/usr/lib/gcc/aarch64-linux-gnu/9/:/usr/lib/gcc/aarch64-linux-gnu/9/:/usr/lib/gcc/aarch64-linux-gnu/:/usr/lib/gcc/aarch64-linux-gnu/9/:/usr/lib/gcc/aarch64-linux-gnu/] - ignore line: [LIBRARY_PATH=/usr/lib/gcc/aarch64-linux-gnu/9/:/usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/:/usr/lib/gcc/aarch64-linux-gnu/9/../../../../lib/:/lib/aarch64-linux-gnu/:/lib/../lib/:/usr/lib/aarch64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/aarch64-linux-gnu/9/../../../:/lib/:/usr/lib/] - ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_fb431.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mlittle-endian' '-mabi=lp64'] - ignore line: [[2/2] Linking CXX executable cmTC_fb431] - ignore line: [Using built-in specs.] - ignore line: [COLLECT_GCC=/bin/c++] - ignore line: [COLLECT_LTO_WRAPPER=/usr/lib/gcc/aarch64-linux-gnu/9/lto-wrapper] - ignore line: [Target: aarch64-linux-gnu] - ignore line: [Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.3.0-17kylin1~20.04' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c ada c++ go d fortran objc obj-c++ gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=aarch64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --enable-fix-cortex-a53-843419 --disable-werror --enable-checking=release --build=aarch64-linux-gnu --host=aarch64-linux-gnu --target=aarch64-linux-gnu] - ignore line: [Thread model: posix] - ignore line: [gcc version 9.3.0 (Ubuntu 9.3.0-17kylin1~20.04) ] - ignore line: [COMPILER_PATH=/usr/lib/gcc/aarch64-linux-gnu/9/:/usr/lib/gcc/aarch64-linux-gnu/9/:/usr/lib/gcc/aarch64-linux-gnu/:/usr/lib/gcc/aarch64-linux-gnu/9/:/usr/lib/gcc/aarch64-linux-gnu/] - ignore line: [LIBRARY_PATH=/usr/lib/gcc/aarch64-linux-gnu/9/:/usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/:/usr/lib/gcc/aarch64-linux-gnu/9/../../../../lib/:/lib/aarch64-linux-gnu/:/lib/../lib/:/usr/lib/aarch64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/aarch64-linux-gnu/9/../../../:/lib/:/usr/lib/] - ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_fb431' '-shared-libgcc' '-mlittle-endian' '-mabi=lp64'] - link line: [ /usr/lib/gcc/aarch64-linux-gnu/9/collect2 -plugin /usr/lib/gcc/aarch64-linux-gnu/9/liblto_plugin.so -plugin-opt=/usr/lib/gcc/aarch64-linux-gnu/9/lto-wrapper -plugin-opt=-fresolution=/tmp/cctNTQ5y.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id --eh-frame-hdr --hash-style=gnu --as-needed -dynamic-linker /lib/ld-linux-aarch64.so.1 -X -EL -maarch64linux --fix-cortex-a53-843419 -pie -z now -z relro -o cmTC_fb431 /usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/Scrt1.o /usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/crti.o /usr/lib/gcc/aarch64-linux-gnu/9/crtbeginS.o -L/usr/lib/gcc/aarch64-linux-gnu/9 -L/usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu -L/usr/lib/gcc/aarch64-linux-gnu/9/../../../../lib -L/lib/aarch64-linux-gnu -L/lib/../lib -L/usr/lib/aarch64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/aarch64-linux-gnu/9/../../.. CMakeFiles/cmTC_fb431.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/aarch64-linux-gnu/9/crtendS.o /usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/crtn.o] - arg [/usr/lib/gcc/aarch64-linux-gnu/9/collect2] ==> ignore - arg [-plugin] ==> ignore - arg [/usr/lib/gcc/aarch64-linux-gnu/9/liblto_plugin.so] ==> ignore - arg [-plugin-opt=/usr/lib/gcc/aarch64-linux-gnu/9/lto-wrapper] ==> ignore - arg [-plugin-opt=-fresolution=/tmp/cctNTQ5y.res] ==> ignore - arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore - arg [-plugin-opt=-pass-through=-lgcc] ==> ignore - arg [-plugin-opt=-pass-through=-lc] ==> ignore - arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore - arg [-plugin-opt=-pass-through=-lgcc] ==> ignore - arg [--build-id] ==> ignore - arg [--eh-frame-hdr] ==> ignore - arg [--hash-style=gnu] ==> ignore - arg [--as-needed] ==> ignore - arg [-dynamic-linker] ==> ignore - arg [/lib/ld-linux-aarch64.so.1] ==> ignore - arg [-X] ==> ignore - arg [-EL] ==> ignore - arg [-maarch64linux] ==> ignore - arg [--fix-cortex-a53-843419] ==> ignore - arg [-pie] ==> ignore - arg [-znow] ==> ignore - arg [-zrelro] ==> ignore - arg [-o] ==> ignore - arg [cmTC_fb431] ==> ignore - arg [/usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/Scrt1.o] ==> ignore - arg [/usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/crti.o] ==> ignore - arg [/usr/lib/gcc/aarch64-linux-gnu/9/crtbeginS.o] ==> ignore - arg [-L/usr/lib/gcc/aarch64-linux-gnu/9] ==> dir [/usr/lib/gcc/aarch64-linux-gnu/9] - arg [-L/usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu] ==> dir [/usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu] - arg [-L/usr/lib/gcc/aarch64-linux-gnu/9/../../../../lib] ==> dir [/usr/lib/gcc/aarch64-linux-gnu/9/../../../../lib] - arg [-L/lib/aarch64-linux-gnu] ==> dir [/lib/aarch64-linux-gnu] - arg [-L/lib/../lib] ==> dir [/lib/../lib] - arg [-L/usr/lib/aarch64-linux-gnu] ==> dir [/usr/lib/aarch64-linux-gnu] - arg [-L/usr/lib/../lib] ==> dir [/usr/lib/../lib] - arg [-L/usr/lib/gcc/aarch64-linux-gnu/9/../../..] ==> dir [/usr/lib/gcc/aarch64-linux-gnu/9/../../..] - arg [CMakeFiles/cmTC_fb431.dir/CMakeCXXCompilerABI.cpp.o] ==> ignore - arg [-lstdc++] ==> lib [stdc++] - arg [-lm] ==> lib [m] - arg [-lgcc_s] ==> lib [gcc_s] - arg [-lgcc] ==> lib [gcc] - arg [-lc] ==> lib [c] - arg [-lgcc_s] ==> lib [gcc_s] - arg [-lgcc] ==> lib [gcc] - arg [/usr/lib/gcc/aarch64-linux-gnu/9/crtendS.o] ==> ignore - arg [/usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/crtn.o] ==> ignore - collapse library dir [/usr/lib/gcc/aarch64-linux-gnu/9] ==> [/usr/lib/gcc/aarch64-linux-gnu/9] - collapse library dir [/usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu] ==> [/usr/lib/aarch64-linux-gnu] - collapse library dir [/usr/lib/gcc/aarch64-linux-gnu/9/../../../../lib] ==> [/usr/lib] - collapse library dir [/lib/aarch64-linux-gnu] ==> [/lib/aarch64-linux-gnu] - collapse library dir [/lib/../lib] ==> [/lib] - collapse library dir [/usr/lib/aarch64-linux-gnu] ==> [/usr/lib/aarch64-linux-gnu] - collapse library dir [/usr/lib/../lib] ==> [/usr/lib] - collapse library dir [/usr/lib/gcc/aarch64-linux-gnu/9/../../..] ==> [/usr/lib] - implicit libs: [stdc++;m;gcc_s;gcc;c;gcc_s;gcc] - implicit dirs: [/usr/lib/gcc/aarch64-linux-gnu/9;/usr/lib/aarch64-linux-gnu;/usr/lib;/lib/aarch64-linux-gnu;/lib] - implicit fwks: [] - - -Determining if the function XOpenDisplay exists in the /usr/lib/aarch64-linux-gnu/libX11.so;/usr/lib/aarch64-linux-gnu/libXext.so passed with the following output: -Change Dir: /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/CMakeFiles/CMakeTmp - -Run Build Command(s):/usr/bin/ninja cmTC_0359c && [1/2] Building C object CMakeFiles/cmTC_0359c.dir/CheckFunctionExists.c.o -[2/2] Linking C executable cmTC_0359c - - - -Determining if the function gethostbyname exists passed with the following output: -Change Dir: /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/CMakeFiles/CMakeTmp - -Run Build Command(s):/usr/bin/ninja cmTC_90499 && [1/2] Building C object CMakeFiles/cmTC_90499.dir/CheckFunctionExists.c.o -[2/2] Linking C executable cmTC_90499 - - - -Determining if the function connect exists passed with the following output: -Change Dir: /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/CMakeFiles/CMakeTmp - -Run Build Command(s):/usr/bin/ninja cmTC_5640e && [1/2] Building C object CMakeFiles/cmTC_5640e.dir/CheckFunctionExists.c.o -[2/2] Linking C executable cmTC_5640e - - - -Determining if the function remove exists passed with the following output: -Change Dir: /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/CMakeFiles/CMakeTmp - -Run Build Command(s):/usr/bin/ninja cmTC_c7688 && [1/2] Building C object CMakeFiles/cmTC_c7688.dir/CheckFunctionExists.c.o -[2/2] Linking C executable cmTC_c7688 - - - -Determining if the function shmat exists passed with the following output: -Change Dir: /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/CMakeFiles/CMakeTmp - -Run Build Command(s):/usr/bin/ninja cmTC_b7cd4 && [1/2] Building C object CMakeFiles/cmTC_b7cd4.dir/CheckFunctionExists.c.o -[2/2] Linking C executable cmTC_b7cd4 - - - -Determining if the function IceConnectionNumber exists in the ICE passed with the following output: -Change Dir: /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/CMakeFiles/CMakeTmp - -Run Build Command(s):/usr/bin/ninja cmTC_c18a5 && [1/2] Building C object CMakeFiles/cmTC_c18a5.dir/CheckFunctionExists.c.o -[2/2] Linking C executable cmTC_c18a5 - - - diff --git a/build/CMakeFiles/TargetDirectories.txt b/build/CMakeFiles/TargetDirectories.txt deleted file mode 100644 index b31c3928d34ad5e4a504e1c942dc8b539810e8bd..0000000000000000000000000000000000000000 --- a/build/CMakeFiles/TargetDirectories.txt +++ /dev/null @@ -1,25 +0,0 @@ -/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/CMakeFiles/install/strip.dir -/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/CMakeFiles/install/local.dir -/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/CMakeFiles/edit_cache.dir -/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/CMakeFiles/KF5WindowSystem_QCH.dir -/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/CMakeFiles/install.dir -/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/CMakeFiles/list_install_components.dir -/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/CMakeFiles/rebuild_cache.dir -/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/CMakeFiles/KF5CoreAddons_QCH.dir -/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/windowsview/CMakeFiles/install/local.dir -/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/windowsview/CMakeFiles/install.dir -/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/windowsview/CMakeFiles/list_install_components.dir -/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/windowsview/CMakeFiles/rebuild_cache.dir -/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/windowsview/CMakeFiles/edit_cache.dir -/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/windowsview/CMakeFiles/windowsview.dir -/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/windowsview/CMakeFiles/KF5GlobalAccel_QCH.dir -/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/windowsview/CMakeFiles/install/strip.dir -/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/windowsview/CMakeFiles/KF5I18n_QCH.dir -/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/windowsview/CMakeFiles/KF5Config_QCH.dir -/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/windowsview/CMakeFiles/windowsview_autogen.dir -/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/windowswitchers/CMakeFiles/install/strip.dir -/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/windowswitchers/CMakeFiles/install/local.dir -/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/windowswitchers/CMakeFiles/install.dir -/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/windowswitchers/CMakeFiles/list_install_components.dir -/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/windowswitchers/CMakeFiles/rebuild_cache.dir -/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/windowswitchers/CMakeFiles/edit_cache.dir diff --git a/build/CMakeFiles/clean_additional.cmake b/build/CMakeFiles/clean_additional.cmake deleted file mode 100644 index 0e639a0435e21eb8895ac1d314c0ce6f38e4995c..0000000000000000000000000000000000000000 --- a/build/CMakeFiles/clean_additional.cmake +++ /dev/null @@ -1,7 +0,0 @@ -# Additional clean files - -file(REMOVE_RECURSE - "windowsview/CMakeFiles/windowsview_autogen.dir/AutogenUsed.txt" - "windowsview/CMakeFiles/windowsview_autogen.dir/ParseCache.txt" - "windowsview/windowsview_autogen" -) diff --git a/build/CMakeFiles/cmake.check_cache b/build/CMakeFiles/cmake.check_cache deleted file mode 100644 index 3dccd731726d7faa8b29d8d7dba3b981a53ca497..0000000000000000000000000000000000000000 --- a/build/CMakeFiles/cmake.check_cache +++ /dev/null @@ -1 +0,0 @@ -# This file is generated by cmake for dependency checking of the CMakeCache.txt file diff --git a/build/build.ninja b/build/build.ninja deleted file mode 100644 index 76c5d45b79149c57a18d4ef8b7e7def17027af6f..0000000000000000000000000000000000000000 --- a/build/build.ninja +++ /dev/null @@ -1,458 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Ninja" Generator, CMake Version 3.16 - -# This file contains all the build statements describing the -# compilation DAG. - -# ============================================================================= -# Write statements declared in CMakeLists.txt: -# -# Which is the root file. -# ============================================================================= - -# ============================================================================= -# Project: ukui-window-switch -# Configuration: Debug -# ============================================================================= - -############################################# -# Minimal version of Ninja required by this file - -ninja_required_version = 1.5 - -# ============================================================================= -# Include auxiliary files. - - -############################################# -# Include rules file. - -include rules.ninja - - -############################################# -# Utility command for install/strip - -build CMakeFiles/install/strip.util: CUSTOM_COMMAND all - COMMAND = cd /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build && /usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake - DESC = Installing the project stripped... - pool = console - restat = 1 - -build install/strip: phony CMakeFiles/install/strip.util - - -############################################# -# Utility command for install/local - -build CMakeFiles/install/local.util: CUSTOM_COMMAND all - COMMAND = cd /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build && /usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake - DESC = Installing only the local directory... - pool = console - restat = 1 - -build install/local: phony CMakeFiles/install/local.util - - -############################################# -# Utility command for edit_cache - -build CMakeFiles/edit_cache.util: CUSTOM_COMMAND - COMMAND = cd /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build && /usr/bin/cmake -E echo No\ interactive\ CMake\ dialog\ available. - DESC = No interactive CMake dialog available... - restat = 1 - -build edit_cache: phony CMakeFiles/edit_cache.util - - -############################################# -# Utility command for KF5WindowSystem_QCH - -build KF5WindowSystem_QCH: phony - - -############################################# -# Utility command for install - -build CMakeFiles/install.util: CUSTOM_COMMAND all - COMMAND = cd /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build && /usr/bin/cmake -P cmake_install.cmake - DESC = Install the project... - pool = console - restat = 1 - -build install: phony CMakeFiles/install.util - - -############################################# -# Utility command for list_install_components - -build list_install_components: phony - - -############################################# -# Utility command for rebuild_cache - -build CMakeFiles/rebuild_cache.util: CUSTOM_COMMAND - COMMAND = cd /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build && /usr/bin/cmake -S/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch -B/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build - DESC = Running CMake to regenerate build system... - pool = console - restat = 1 - -build rebuild_cache: phony CMakeFiles/rebuild_cache.util - - -############################################# -# Utility command for KF5CoreAddons_QCH - -build KF5CoreAddons_QCH: phony - -# ============================================================================= -# Write statements declared in CMakeLists.txt: -# /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/CMakeLists.txt -# ============================================================================= - - -############################################# -# Utility command for install/local - -build windowsview/CMakeFiles/install/local.util: CUSTOM_COMMAND windowsview/all - COMMAND = cd /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/windowsview && /usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake - DESC = Installing only the local directory... - pool = console - restat = 1 - -build windowsview/install/local: phony windowsview/CMakeFiles/install/local.util - - -############################################# -# Utility command for install - -build windowsview/CMakeFiles/install.util: CUSTOM_COMMAND windowsview/all - COMMAND = cd /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/windowsview && /usr/bin/cmake -P cmake_install.cmake - DESC = Install the project... - pool = console - restat = 1 - -build windowsview/install: phony windowsview/CMakeFiles/install.util - - -############################################# -# Utility command for list_install_components - -build windowsview/list_install_components: phony - - -############################################# -# Utility command for rebuild_cache - -build windowsview/CMakeFiles/rebuild_cache.util: CUSTOM_COMMAND - COMMAND = cd /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/windowsview && /usr/bin/cmake -S/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch -B/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build - DESC = Running CMake to regenerate build system... - pool = console - restat = 1 - -build windowsview/rebuild_cache: phony windowsview/CMakeFiles/rebuild_cache.util - - -############################################# -# Utility command for edit_cache - -build windowsview/CMakeFiles/edit_cache.util: CUSTOM_COMMAND - COMMAND = cd /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/windowsview && /usr/bin/cmake -E echo No\ interactive\ CMake\ dialog\ available. - DESC = No interactive CMake dialog available... - restat = 1 - -build windowsview/edit_cache: phony windowsview/CMakeFiles/edit_cache.util - -# ============================================================================= -# Object build statements for MODULE_LIBRARY target windowsview - - -############################################# -# Order-only phony target for windowsview - -build cmake_object_order_depends_target_windowsview: phony || windowsview/qrc_data.cpp windowsview/windowsview_autogen - -build windowsview/CMakeFiles/windowsview.dir/windowsview_autogen/mocs_compilation.cpp.o: CXX_COMPILER__windowsview windowsview/windowsview_autogen/mocs_compilation.cpp || cmake_object_order_depends_target_windowsview - DEFINES = -DKCOREADDONS_LIB -DQT_CORE_LIB -DQT_DBUS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_QML_LIB -DQT_QUICKWIDGETS_LIB -DQT_QUICK_LIB -DQT_WIDGETS_LIB -DQT_X11EXTRAS_LIB -Dwindowsview_EXPORTS - DEP_FILE = windowsview/CMakeFiles/windowsview.dir/windowsview_autogen/mocs_compilation.cpp.o.d - FLAGS = -g -fPIC -fPIC -std=gnu++14 - INCLUDES = -Iwindowsview -I../windowsview -Iwindowsview/windowsview_autogen/include -I/usr/include/aarch64-linux-gnu/qt5/QGSettings -I/usr/include/kwin -isystem /usr/include/aarch64-linux-gnu/qt5 -isystem /usr/include/aarch64-linux-gnu/qt5/QtCore -isystem /usr/lib/aarch64-linux-gnu/qt5/mkspecs/linux-g++ -isystem /usr/include/aarch64-linux-gnu/qt5/QtGui -isystem /usr/include/aarch64-linux-gnu/qt5/QtWidgets -isystem /usr/include/aarch64-linux-gnu/qt5/QtQuick -isystem /usr/include/aarch64-linux-gnu/qt5/QtQml -isystem /usr/include/aarch64-linux-gnu/qt5/QtNetwork -isystem /usr/include/aarch64-linux-gnu/qt5/QtQuickWidgets -isystem /usr/include/KF5/KConfigCore -isystem /usr/include/KF5 -isystem /usr/include/KF5/KWindowSystem -isystem /usr/include/KF5/KCoreAddons -isystem /usr/include/KF5/KGlobalAccel -isystem /usr/include/aarch64-linux-gnu/qt5/QtDBus -isystem /usr/include/aarch64-linux-gnu/qt5/QtX11Extras - OBJECT_DIR = windowsview/CMakeFiles/windowsview.dir - OBJECT_FILE_DIR = windowsview/CMakeFiles/windowsview.dir/windowsview_autogen - -build windowsview/CMakeFiles/windowsview.dir/desktopbackground.cpp.o: CXX_COMPILER__windowsview ../windowsview/desktopbackground.cpp || cmake_object_order_depends_target_windowsview - DEFINES = -DKCOREADDONS_LIB -DQT_CORE_LIB -DQT_DBUS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_QML_LIB -DQT_QUICKWIDGETS_LIB -DQT_QUICK_LIB -DQT_WIDGETS_LIB -DQT_X11EXTRAS_LIB -Dwindowsview_EXPORTS - DEP_FILE = windowsview/CMakeFiles/windowsview.dir/desktopbackground.cpp.o.d - FLAGS = -g -fPIC -fPIC -std=gnu++14 - INCLUDES = -Iwindowsview -I../windowsview -Iwindowsview/windowsview_autogen/include -I/usr/include/aarch64-linux-gnu/qt5/QGSettings -I/usr/include/kwin -isystem /usr/include/aarch64-linux-gnu/qt5 -isystem /usr/include/aarch64-linux-gnu/qt5/QtCore -isystem /usr/lib/aarch64-linux-gnu/qt5/mkspecs/linux-g++ -isystem /usr/include/aarch64-linux-gnu/qt5/QtGui -isystem /usr/include/aarch64-linux-gnu/qt5/QtWidgets -isystem /usr/include/aarch64-linux-gnu/qt5/QtQuick -isystem /usr/include/aarch64-linux-gnu/qt5/QtQml -isystem /usr/include/aarch64-linux-gnu/qt5/QtNetwork -isystem /usr/include/aarch64-linux-gnu/qt5/QtQuickWidgets -isystem /usr/include/KF5/KConfigCore -isystem /usr/include/KF5 -isystem /usr/include/KF5/KWindowSystem -isystem /usr/include/KF5/KCoreAddons -isystem /usr/include/KF5/KGlobalAccel -isystem /usr/include/aarch64-linux-gnu/qt5/QtDBus -isystem /usr/include/aarch64-linux-gnu/qt5/QtX11Extras - OBJECT_DIR = windowsview/CMakeFiles/windowsview.dir - OBJECT_FILE_DIR = windowsview/CMakeFiles/windowsview.dir - -build windowsview/CMakeFiles/windowsview.dir/icontheme.cpp.o: CXX_COMPILER__windowsview ../windowsview/icontheme.cpp || cmake_object_order_depends_target_windowsview - DEFINES = -DKCOREADDONS_LIB -DQT_CORE_LIB -DQT_DBUS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_QML_LIB -DQT_QUICKWIDGETS_LIB -DQT_QUICK_LIB -DQT_WIDGETS_LIB -DQT_X11EXTRAS_LIB -Dwindowsview_EXPORTS - DEP_FILE = windowsview/CMakeFiles/windowsview.dir/icontheme.cpp.o.d - FLAGS = -g -fPIC -fPIC -std=gnu++14 - INCLUDES = -Iwindowsview -I../windowsview -Iwindowsview/windowsview_autogen/include -I/usr/include/aarch64-linux-gnu/qt5/QGSettings -I/usr/include/kwin -isystem /usr/include/aarch64-linux-gnu/qt5 -isystem /usr/include/aarch64-linux-gnu/qt5/QtCore -isystem /usr/lib/aarch64-linux-gnu/qt5/mkspecs/linux-g++ -isystem /usr/include/aarch64-linux-gnu/qt5/QtGui -isystem /usr/include/aarch64-linux-gnu/qt5/QtWidgets -isystem /usr/include/aarch64-linux-gnu/qt5/QtQuick -isystem /usr/include/aarch64-linux-gnu/qt5/QtQml -isystem /usr/include/aarch64-linux-gnu/qt5/QtNetwork -isystem /usr/include/aarch64-linux-gnu/qt5/QtQuickWidgets -isystem /usr/include/KF5/KConfigCore -isystem /usr/include/KF5 -isystem /usr/include/KF5/KWindowSystem -isystem /usr/include/KF5/KCoreAddons -isystem /usr/include/KF5/KGlobalAccel -isystem /usr/include/aarch64-linux-gnu/qt5/QtDBus -isystem /usr/include/aarch64-linux-gnu/qt5/QtX11Extras - OBJECT_DIR = windowsview/CMakeFiles/windowsview.dir - OBJECT_FILE_DIR = windowsview/CMakeFiles/windowsview.dir - -build windowsview/CMakeFiles/windowsview.dir/multitaskviewmodel.cpp.o: CXX_COMPILER__windowsview ../windowsview/multitaskviewmodel.cpp || cmake_object_order_depends_target_windowsview - DEFINES = -DKCOREADDONS_LIB -DQT_CORE_LIB -DQT_DBUS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_QML_LIB -DQT_QUICKWIDGETS_LIB -DQT_QUICK_LIB -DQT_WIDGETS_LIB -DQT_X11EXTRAS_LIB -Dwindowsview_EXPORTS - DEP_FILE = windowsview/CMakeFiles/windowsview.dir/multitaskviewmodel.cpp.o.d - FLAGS = -g -fPIC -fPIC -std=gnu++14 - INCLUDES = -Iwindowsview -I../windowsview -Iwindowsview/windowsview_autogen/include -I/usr/include/aarch64-linux-gnu/qt5/QGSettings -I/usr/include/kwin -isystem /usr/include/aarch64-linux-gnu/qt5 -isystem /usr/include/aarch64-linux-gnu/qt5/QtCore -isystem /usr/lib/aarch64-linux-gnu/qt5/mkspecs/linux-g++ -isystem /usr/include/aarch64-linux-gnu/qt5/QtGui -isystem /usr/include/aarch64-linux-gnu/qt5/QtWidgets -isystem /usr/include/aarch64-linux-gnu/qt5/QtQuick -isystem /usr/include/aarch64-linux-gnu/qt5/QtQml -isystem /usr/include/aarch64-linux-gnu/qt5/QtNetwork -isystem /usr/include/aarch64-linux-gnu/qt5/QtQuickWidgets -isystem /usr/include/KF5/KConfigCore -isystem /usr/include/KF5 -isystem /usr/include/KF5/KWindowSystem -isystem /usr/include/KF5/KCoreAddons -isystem /usr/include/KF5/KGlobalAccel -isystem /usr/include/aarch64-linux-gnu/qt5/QtDBus -isystem /usr/include/aarch64-linux-gnu/qt5/QtX11Extras - OBJECT_DIR = windowsview/CMakeFiles/windowsview.dir - OBJECT_FILE_DIR = windowsview/CMakeFiles/windowsview.dir - -build windowsview/CMakeFiles/windowsview.dir/multitaskviewmanager.cpp.o: CXX_COMPILER__windowsview ../windowsview/multitaskviewmanager.cpp || cmake_object_order_depends_target_windowsview - DEFINES = -DKCOREADDONS_LIB -DQT_CORE_LIB -DQT_DBUS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_QML_LIB -DQT_QUICKWIDGETS_LIB -DQT_QUICK_LIB -DQT_WIDGETS_LIB -DQT_X11EXTRAS_LIB -Dwindowsview_EXPORTS - DEP_FILE = windowsview/CMakeFiles/windowsview.dir/multitaskviewmanager.cpp.o.d - FLAGS = -g -fPIC -fPIC -std=gnu++14 - INCLUDES = -Iwindowsview -I../windowsview -Iwindowsview/windowsview_autogen/include -I/usr/include/aarch64-linux-gnu/qt5/QGSettings -I/usr/include/kwin -isystem /usr/include/aarch64-linux-gnu/qt5 -isystem /usr/include/aarch64-linux-gnu/qt5/QtCore -isystem /usr/lib/aarch64-linux-gnu/qt5/mkspecs/linux-g++ -isystem /usr/include/aarch64-linux-gnu/qt5/QtGui -isystem /usr/include/aarch64-linux-gnu/qt5/QtWidgets -isystem /usr/include/aarch64-linux-gnu/qt5/QtQuick -isystem /usr/include/aarch64-linux-gnu/qt5/QtQml -isystem /usr/include/aarch64-linux-gnu/qt5/QtNetwork -isystem /usr/include/aarch64-linux-gnu/qt5/QtQuickWidgets -isystem /usr/include/KF5/KConfigCore -isystem /usr/include/KF5 -isystem /usr/include/KF5/KWindowSystem -isystem /usr/include/KF5/KCoreAddons -isystem /usr/include/KF5/KGlobalAccel -isystem /usr/include/aarch64-linux-gnu/qt5/QtDBus -isystem /usr/include/aarch64-linux-gnu/qt5/QtX11Extras - OBJECT_DIR = windowsview/CMakeFiles/windowsview.dir - OBJECT_FILE_DIR = windowsview/CMakeFiles/windowsview.dir - -build windowsview/CMakeFiles/windowsview.dir/dbusservice.cpp.o: CXX_COMPILER__windowsview ../windowsview/dbusservice.cpp || cmake_object_order_depends_target_windowsview - DEFINES = -DKCOREADDONS_LIB -DQT_CORE_LIB -DQT_DBUS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_QML_LIB -DQT_QUICKWIDGETS_LIB -DQT_QUICK_LIB -DQT_WIDGETS_LIB -DQT_X11EXTRAS_LIB -Dwindowsview_EXPORTS - DEP_FILE = windowsview/CMakeFiles/windowsview.dir/dbusservice.cpp.o.d - FLAGS = -g -fPIC -fPIC -std=gnu++14 - INCLUDES = -Iwindowsview -I../windowsview -Iwindowsview/windowsview_autogen/include -I/usr/include/aarch64-linux-gnu/qt5/QGSettings -I/usr/include/kwin -isystem /usr/include/aarch64-linux-gnu/qt5 -isystem /usr/include/aarch64-linux-gnu/qt5/QtCore -isystem /usr/lib/aarch64-linux-gnu/qt5/mkspecs/linux-g++ -isystem /usr/include/aarch64-linux-gnu/qt5/QtGui -isystem /usr/include/aarch64-linux-gnu/qt5/QtWidgets -isystem /usr/include/aarch64-linux-gnu/qt5/QtQuick -isystem /usr/include/aarch64-linux-gnu/qt5/QtQml -isystem /usr/include/aarch64-linux-gnu/qt5/QtNetwork -isystem /usr/include/aarch64-linux-gnu/qt5/QtQuickWidgets -isystem /usr/include/KF5/KConfigCore -isystem /usr/include/KF5 -isystem /usr/include/KF5/KWindowSystem -isystem /usr/include/KF5/KCoreAddons -isystem /usr/include/KF5/KGlobalAccel -isystem /usr/include/aarch64-linux-gnu/qt5/QtDBus -isystem /usr/include/aarch64-linux-gnu/qt5/QtX11Extras - OBJECT_DIR = windowsview/CMakeFiles/windowsview.dir - OBJECT_FILE_DIR = windowsview/CMakeFiles/windowsview.dir - -build windowsview/CMakeFiles/windowsview.dir/multitaskviewmanagerpluginfactory.cpp.o: CXX_COMPILER__windowsview ../windowsview/multitaskviewmanagerpluginfactory.cpp || cmake_object_order_depends_target_windowsview - DEFINES = -DKCOREADDONS_LIB -DQT_CORE_LIB -DQT_DBUS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_QML_LIB -DQT_QUICKWIDGETS_LIB -DQT_QUICK_LIB -DQT_WIDGETS_LIB -DQT_X11EXTRAS_LIB -Dwindowsview_EXPORTS - DEP_FILE = windowsview/CMakeFiles/windowsview.dir/multitaskviewmanagerpluginfactory.cpp.o.d - FLAGS = -g -fPIC -fPIC -std=gnu++14 - INCLUDES = -Iwindowsview -I../windowsview -Iwindowsview/windowsview_autogen/include -I/usr/include/aarch64-linux-gnu/qt5/QGSettings -I/usr/include/kwin -isystem /usr/include/aarch64-linux-gnu/qt5 -isystem /usr/include/aarch64-linux-gnu/qt5/QtCore -isystem /usr/lib/aarch64-linux-gnu/qt5/mkspecs/linux-g++ -isystem /usr/include/aarch64-linux-gnu/qt5/QtGui -isystem /usr/include/aarch64-linux-gnu/qt5/QtWidgets -isystem /usr/include/aarch64-linux-gnu/qt5/QtQuick -isystem /usr/include/aarch64-linux-gnu/qt5/QtQml -isystem /usr/include/aarch64-linux-gnu/qt5/QtNetwork -isystem /usr/include/aarch64-linux-gnu/qt5/QtQuickWidgets -isystem /usr/include/KF5/KConfigCore -isystem /usr/include/KF5 -isystem /usr/include/KF5/KWindowSystem -isystem /usr/include/KF5/KCoreAddons -isystem /usr/include/KF5/KGlobalAccel -isystem /usr/include/aarch64-linux-gnu/qt5/QtDBus -isystem /usr/include/aarch64-linux-gnu/qt5/QtX11Extras - OBJECT_DIR = windowsview/CMakeFiles/windowsview.dir - OBJECT_FILE_DIR = windowsview/CMakeFiles/windowsview.dir - -build windowsview/CMakeFiles/windowsview.dir/qrc_data.cpp.o: CXX_COMPILER__windowsview windowsview/qrc_data.cpp || cmake_object_order_depends_target_windowsview - DEFINES = -DKCOREADDONS_LIB -DQT_CORE_LIB -DQT_DBUS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_QML_LIB -DQT_QUICKWIDGETS_LIB -DQT_QUICK_LIB -DQT_WIDGETS_LIB -DQT_X11EXTRAS_LIB -Dwindowsview_EXPORTS - DEP_FILE = windowsview/CMakeFiles/windowsview.dir/qrc_data.cpp.o.d - FLAGS = -g -fPIC -fPIC -std=gnu++14 - INCLUDES = -Iwindowsview -I../windowsview -Iwindowsview/windowsview_autogen/include -I/usr/include/aarch64-linux-gnu/qt5/QGSettings -I/usr/include/kwin -isystem /usr/include/aarch64-linux-gnu/qt5 -isystem /usr/include/aarch64-linux-gnu/qt5/QtCore -isystem /usr/lib/aarch64-linux-gnu/qt5/mkspecs/linux-g++ -isystem /usr/include/aarch64-linux-gnu/qt5/QtGui -isystem /usr/include/aarch64-linux-gnu/qt5/QtWidgets -isystem /usr/include/aarch64-linux-gnu/qt5/QtQuick -isystem /usr/include/aarch64-linux-gnu/qt5/QtQml -isystem /usr/include/aarch64-linux-gnu/qt5/QtNetwork -isystem /usr/include/aarch64-linux-gnu/qt5/QtQuickWidgets -isystem /usr/include/KF5/KConfigCore -isystem /usr/include/KF5 -isystem /usr/include/KF5/KWindowSystem -isystem /usr/include/KF5/KCoreAddons -isystem /usr/include/KF5/KGlobalAccel -isystem /usr/include/aarch64-linux-gnu/qt5/QtDBus -isystem /usr/include/aarch64-linux-gnu/qt5/QtX11Extras - OBJECT_DIR = windowsview/CMakeFiles/windowsview.dir - OBJECT_FILE_DIR = windowsview/CMakeFiles/windowsview.dir - - -# ============================================================================= -# Link build statements for MODULE_LIBRARY target windowsview - - -############################################# -# Link the shared module windowsview/libwindowsview.so - -build windowsview/libwindowsview.so: CXX_MODULE_LIBRARY_LINKER__windowsview windowsview/CMakeFiles/windowsview.dir/windowsview_autogen/mocs_compilation.cpp.o windowsview/CMakeFiles/windowsview.dir/desktopbackground.cpp.o windowsview/CMakeFiles/windowsview.dir/icontheme.cpp.o windowsview/CMakeFiles/windowsview.dir/multitaskviewmodel.cpp.o windowsview/CMakeFiles/windowsview.dir/multitaskviewmanager.cpp.o windowsview/CMakeFiles/windowsview.dir/dbusservice.cpp.o windowsview/CMakeFiles/windowsview.dir/multitaskviewmanagerpluginfactory.cpp.o windowsview/CMakeFiles/windowsview.dir/qrc_data.cpp.o | /usr/lib/aarch64-linux-gnu/libQt5QuickWidgets.so.5.12.8 /usr/lib/aarch64-linux-gnu/libKF5ConfigCore.so.5.68.0 /usr/lib/aarch64-linux-gnu/libKF5WindowSystem.so.5.68.0 /usr/lib/aarch64-linux-gnu/libKF5CoreAddons.so.5.68.0 /usr/lib/aarch64-linux-gnu/libKF5GlobalAccel.so.5.68.0 /usr/lib/aarch64-linux-gnu/libQt5X11Extras.so.5.12.8 /usr/lib/aarch64-linux-gnu/libQt5Quick.so.5.12.8 /usr/lib/aarch64-linux-gnu/libQt5Qml.so.5.12.8 /usr/lib/aarch64-linux-gnu/libQt5Network.so.5.12.8 /usr/lib/aarch64-linux-gnu/libQt5Widgets.so.5.12.8 /usr/lib/aarch64-linux-gnu/libQt5Gui.so.5.12.8 /usr/lib/aarch64-linux-gnu/libQt5DBus.so.5.12.8 /usr/lib/aarch64-linux-gnu/libQt5Core.so.5.12.8 || windowsview/windowsview_autogen - LANGUAGE_COMPILE_FLAGS = -g - LINK_LIBRARIES = /usr/lib/aarch64-linux-gnu/libQt5QuickWidgets.so.5.12.8 /usr/lib/aarch64-linux-gnu/libKF5ConfigCore.so.5.68.0 /usr/lib/aarch64-linux-gnu/libKF5WindowSystem.so.5.68.0 /usr/lib/aarch64-linux-gnu/libKF5CoreAddons.so.5.68.0 /usr/lib/aarch64-linux-gnu/libKF5GlobalAccel.so.5.68.0 /usr/lib/aarch64-linux-gnu/libQt5X11Extras.so.5.12.8 -lgsettings-qt /usr/lib/aarch64-linux-gnu/libQt5Quick.so.5.12.8 /usr/lib/aarch64-linux-gnu/libQt5Qml.so.5.12.8 /usr/lib/aarch64-linux-gnu/libQt5Network.so.5.12.8 /usr/lib/aarch64-linux-gnu/libQt5Widgets.so.5.12.8 /usr/lib/aarch64-linux-gnu/libQt5Gui.so.5.12.8 /usr/lib/aarch64-linux-gnu/libQt5DBus.so.5.12.8 /usr/lib/aarch64-linux-gnu/libQt5Core.so.5.12.8 - OBJECT_DIR = windowsview/CMakeFiles/windowsview.dir - POST_BUILD = : - PRE_LINK = : - TARGET_FILE = windowsview/libwindowsview.so - TARGET_PDB = windowsview.so.dbg - - -############################################# -# Utility command for KF5GlobalAccel_QCH - -build windowsview/KF5GlobalAccel_QCH: phony - - -############################################# -# Utility command for install/strip - -build windowsview/CMakeFiles/install/strip.util: CUSTOM_COMMAND windowsview/all - COMMAND = cd /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/windowsview && /usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake - DESC = Installing the project stripped... - pool = console - restat = 1 - -build windowsview/install/strip: phony windowsview/CMakeFiles/install/strip.util - - -############################################# -# Utility command for KF5I18n_QCH - -build windowsview/KF5I18n_QCH: phony - - -############################################# -# Utility command for KF5Config_QCH - -build windowsview/KF5Config_QCH: phony - - -############################################# -# Utility command for windowsview_autogen - -build windowsview/windowsview_autogen: phony windowsview/CMakeFiles/windowsview_autogen windowsview/windowsview_autogen/mocs_compilation.cpp - - -############################################# -# Custom command for windowsview/qrc_data.cpp - -build windowsview/qrc_data.cpp: CUSTOM_COMMAND ../windowsview/qml/Controller.js ../windowsview/qml/TabletController.js ../windowsview/images/default-background.jpg ../windowsview/images/all-clean-click.svg ../windowsview/images/all-clean-default.svg ../windowsview/images/all-clean-hover.svg ../windowsview/images/ukui-taskview-close-click.svg ../windowsview/images/ukui-taskview-close-default.svg ../windowsview/images/ukui-taskview-close-hover.svg ../windowsview/qml/PreviewWindow.qml ../windowsview/qml/multitaskview.qml ../windowsview/qml/AppArea.qml ../windowsview/qml/DesktopArea.qml ../windowsview/qml/TabletMultitaskView.qml ../windowsview/qml/TabletViewRootWindow.qml ../windowsview/qml/TabletScrollViewArea.qml ../windowsview/qml/TabletPreviewWindow.qml ../windowsview/images/tablet_delete.svg ../windowsview/qml/TabletViewMain.qml ../windowsview/qml/TabletViewClearAllWindowButton.qml ../windowsview/qml/TabletViewCloseButton.qml ../windowsview/qml/CloseButton.qml windowsview/data.qrc.depends ../windowsview/data.qrc || windowsview/windowsview_autogen - COMMAND = cd /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/windowsview && /usr/lib/qt5/bin/rcc --name data --output /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/windowsview/qrc_data.cpp /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/windowsview/data.qrc - DESC = Generating qrc_data.cpp - restat = 1 - - -############################################# -# Custom command for windowsview/CMakeFiles/windowsview_autogen - -build windowsview/CMakeFiles/windowsview_autogen windowsview/windowsview_autogen/mocs_compilation.cpp: CUSTOM_COMMAND - COMMAND = cd /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/windowsview && /usr/bin/cmake -E cmake_autogen /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/windowsview/CMakeFiles/windowsview_autogen.dir/AutogenInfo.json Debug - DESC = Automatic MOC and UIC for target windowsview - restat = 1 - -# ============================================================================= -# Write statements declared in CMakeLists.txt: -# /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/CMakeLists.txt -# ============================================================================= - - -############################################# -# Utility command for install/strip - -build windowswitchers/CMakeFiles/install/strip.util: CUSTOM_COMMAND windowswitchers/all - COMMAND = cd /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/windowswitchers && /usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake - DESC = Installing the project stripped... - pool = console - restat = 1 - -build windowswitchers/install/strip: phony windowswitchers/CMakeFiles/install/strip.util - - -############################################# -# Utility command for install/local - -build windowswitchers/CMakeFiles/install/local.util: CUSTOM_COMMAND windowswitchers/all - COMMAND = cd /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/windowswitchers && /usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake - DESC = Installing only the local directory... - pool = console - restat = 1 - -build windowswitchers/install/local: phony windowswitchers/CMakeFiles/install/local.util - - -############################################# -# Utility command for install - -build windowswitchers/CMakeFiles/install.util: CUSTOM_COMMAND windowswitchers/all - COMMAND = cd /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/windowswitchers && /usr/bin/cmake -P cmake_install.cmake - DESC = Install the project... - pool = console - restat = 1 - -build windowswitchers/install: phony windowswitchers/CMakeFiles/install.util - - -############################################# -# Utility command for list_install_components - -build windowswitchers/list_install_components: phony - - -############################################# -# Utility command for rebuild_cache - -build windowswitchers/CMakeFiles/rebuild_cache.util: CUSTOM_COMMAND - COMMAND = cd /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/windowswitchers && /usr/bin/cmake -S/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch -B/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build - DESC = Running CMake to regenerate build system... - pool = console - restat = 1 - -build windowswitchers/rebuild_cache: phony windowswitchers/CMakeFiles/rebuild_cache.util - - -############################################# -# Utility command for edit_cache - -build windowswitchers/CMakeFiles/edit_cache.util: CUSTOM_COMMAND - COMMAND = cd /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/windowswitchers && /usr/bin/cmake -E echo No\ interactive\ CMake\ dialog\ available. - DESC = No interactive CMake dialog available... - restat = 1 - -build windowswitchers/edit_cache: phony windowswitchers/CMakeFiles/edit_cache.util - -# ============================================================================= -# Target aliases. - -build KF5Config_QCH: phony windowsview/KF5Config_QCH - -build KF5GlobalAccel_QCH: phony windowsview/KF5GlobalAccel_QCH - -build KF5I18n_QCH: phony windowsview/KF5I18n_QCH - -build libwindowsview.so: phony windowsview/libwindowsview.so - -build windowsview: phony windowsview/libwindowsview.so - -build windowsview_autogen: phony windowsview/windowsview_autogen - -# ============================================================================= -# Folder targets. - -# ============================================================================= - -############################################# -# Folder: /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build - -build all: phony windowsview/all windowswitchers/all - -# ============================================================================= - -############################################# -# Folder: /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/windowsview - -build windowsview/all: phony windowsview/libwindowsview.so - -# ============================================================================= - -############################################# -# Folder: /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/windowswitchers - -build windowswitchers/all: phony - -# ============================================================================= -# Built-in targets - - -############################################# -# Make the all target the default. - -default all - -############################################# -# Re-run CMake if any of its inputs changed. - -build build.ninja: RERUN_CMAKE | ../CMakeLists.txt ../windowsview/CMakeLists.txt ../windowsview/data.qrc ../windowswitchers/CMakeLists.txt /usr/lib/aarch64-linux-gnu/cmake/KF5Config/KF5ConfigCompilerTargets-debian.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5Config/KF5ConfigCompilerTargets.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5Config/KF5ConfigConfig.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5Config/KF5ConfigConfigVersion.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5Config/KF5ConfigMacros.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5Config/KF5ConfigQchTargets.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5Config/KF5ConfigTargets-debian.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5Config/KF5ConfigTargets.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5CoreAddons/KF5CoreAddonsConfig.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5CoreAddons/KF5CoreAddonsConfigVersion.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5CoreAddons/KF5CoreAddonsMacros.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5CoreAddons/KF5CoreAddonsQchTargets.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5CoreAddons/KF5CoreAddonsTargets-debian.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5CoreAddons/KF5CoreAddonsTargets.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5CoreAddons/KF5CoreAddonsToolingTargets-debian.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5CoreAddons/KF5CoreAddonsToolingTargets.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5GlobalAccel/KF5GlobalAccelConfig.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5GlobalAccel/KF5GlobalAccelConfigVersion.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5GlobalAccel/KF5GlobalAccelQchTargets.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5GlobalAccel/KF5GlobalAccelTargets-debian.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5GlobalAccel/KF5GlobalAccelTargets.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5I18n/KF5I18nConfig.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5I18n/KF5I18nConfigVersion.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5I18n/KF5I18nMacros.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5I18n/KF5I18nQchTargets.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5I18n/KF5I18nTargets-debian.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5I18n/KF5I18nTargets.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5WindowSystem/KF5WindowSystemConfig.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5WindowSystem/KF5WindowSystemConfigVersion.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5WindowSystem/KF5WindowSystemQchTargets.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5WindowSystem/KF5WindowSystemTargets-debian.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5WindowSystem/KF5WindowSystemTargets.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5/Qt5Config.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5/Qt5ConfigVersion.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5/Qt5ModuleLocation.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Core/Qt5CoreConfig.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Core/Qt5CoreConfigExtras.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Core/Qt5CoreConfigExtrasMkspecDir.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Core/Qt5CoreConfigVersion.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Core/Qt5CoreMacros.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5DBus/Qt5DBusConfig.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5DBus/Qt5DBusConfigExtras.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5DBus/Qt5DBusConfigVersion.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5DBus/Qt5DBusMacros.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5GuiConfig.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5GuiConfigVersion.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QComposePlatformInputContextPlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QEglFSEmulatorIntegrationPlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QEglFSIntegrationPlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QEglFSKmsEglDeviceIntegrationPlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QEglFSKmsGbmIntegrationPlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QEglFSX11IntegrationPlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QEvdevKeyboardPlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QEvdevMousePlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QEvdevTabletPlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QEvdevTouchScreenPlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QGifPlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QICOPlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QIbusPlatformInputContextPlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QJpegPlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QLibInputPlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QLinuxFbIntegrationPlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QMinimalEglIntegrationPlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QMinimalIntegrationPlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QOffscreenIntegrationPlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QTuioTouchPlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QVncIntegrationPlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QXcbEglIntegrationPlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QXcbGlxIntegrationPlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QXcbIntegrationPlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5LinguistTools/Qt5LinguistToolsConfig.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5LinguistTools/Qt5LinguistToolsConfigVersion.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5LinguistTools/Qt5LinguistToolsMacros.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Network/Qt5NetworkConfig.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Network/Qt5NetworkConfigVersion.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Network/Qt5Network_QConnmanEnginePlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Network/Qt5Network_QGenericEnginePlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Network/Qt5Network_QNetworkManagerEnginePlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Qml/Qt5QmlConfig.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Qml/Qt5QmlConfigExtras.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Qml/Qt5QmlConfigVersion.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Qml/Qt5Qml_QDebugMessageServiceFactory.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Qml/Qt5Qml_QLocalClientConnectionFactory.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Qml/Qt5Qml_QQmlDebugServerFactory.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Qml/Qt5Qml_QQmlDebuggerServiceFactory.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Qml/Qt5Qml_QQmlInspectorServiceFactory.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Qml/Qt5Qml_QQmlNativeDebugConnectorFactory.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Qml/Qt5Qml_QQmlNativeDebugServiceFactory.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Qml/Qt5Qml_QQmlPreviewServiceFactory.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Qml/Qt5Qml_QQmlProfilerServiceFactory.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Qml/Qt5Qml_QQuickProfilerAdapterFactory.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Qml/Qt5Qml_QTcpServerConnectionFactory.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Quick/Qt5QuickConfig.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Quick/Qt5QuickConfigVersion.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5QuickWidgets/Qt5QuickWidgetsConfig.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5QuickWidgets/Qt5QuickWidgetsConfigVersion.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Widgets/Qt5WidgetsConfigExtras.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Widgets/Qt5WidgetsConfigVersion.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Widgets/Qt5WidgetsMacros.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5X11Extras/Qt5X11ExtrasConfig.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5X11Extras/Qt5X11ExtrasConfigVersion.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Xml/Qt5XmlConfig.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Xml/Qt5XmlConfigVersion.cmake /usr/share/ECM/cmake/ECMConfig.cmake /usr/share/ECM/cmake/ECMConfigVersion.cmake /usr/share/ECM/modules/ECMUseFindModules.cmake /usr/share/cmake-3.16/Modules/CMakeCInformation.cmake /usr/share/cmake-3.16/Modules/CMakeCXXInformation.cmake /usr/share/cmake-3.16/Modules/CMakeCheckCompilerFlagCommonPatterns.cmake /usr/share/cmake-3.16/Modules/CMakeCommonLanguageInclude.cmake /usr/share/cmake-3.16/Modules/CMakeFindDependencyMacro.cmake /usr/share/cmake-3.16/Modules/CMakeGenericSystem.cmake /usr/share/cmake-3.16/Modules/CMakeInitializeConfigs.cmake /usr/share/cmake-3.16/Modules/CMakeLanguageInformation.cmake /usr/share/cmake-3.16/Modules/CMakeParseArguments.cmake /usr/share/cmake-3.16/Modules/CMakeSystemSpecificInformation.cmake /usr/share/cmake-3.16/Modules/CMakeSystemSpecificInitialize.cmake /usr/share/cmake-3.16/Modules/CheckFunctionExists.cmake /usr/share/cmake-3.16/Modules/CheckLibraryExists.cmake /usr/share/cmake-3.16/Modules/Compiler/CMakeCommonCompilerMacros.cmake /usr/share/cmake-3.16/Modules/Compiler/GNU-C.cmake /usr/share/cmake-3.16/Modules/Compiler/GNU-CXX.cmake /usr/share/cmake-3.16/Modules/Compiler/GNU.cmake /usr/share/cmake-3.16/Modules/FindFontconfig.cmake /usr/share/cmake-3.16/Modules/FindFreetype.cmake /usr/share/cmake-3.16/Modules/FindGettext.cmake /usr/share/cmake-3.16/Modules/FindOpenGL.cmake /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake /usr/share/cmake-3.16/Modules/FindPackageMessage.cmake /usr/share/cmake-3.16/Modules/FindPkgConfig.cmake /usr/share/cmake-3.16/Modules/FindX11.cmake /usr/share/cmake-3.16/Modules/Internal/CMakeCheckCompilerFlag.cmake /usr/share/cmake-3.16/Modules/MacroAddFileDependencies.cmake /usr/share/cmake-3.16/Modules/Platform/Linux-GNU-C.cmake /usr/share/cmake-3.16/Modules/Platform/Linux-GNU-CXX.cmake /usr/share/cmake-3.16/Modules/Platform/Linux-GNU.cmake /usr/share/cmake-3.16/Modules/Platform/Linux.cmake /usr/share/cmake-3.16/Modules/Platform/UnixPaths.cmake /usr/share/cmake-3.16/Modules/SelectLibraryConfigurations.cmake CMakeCache.txt CMakeFiles/3.16.3/CMakeCCompiler.cmake CMakeFiles/3.16.3/CMakeCXXCompiler.cmake CMakeFiles/3.16.3/CMakeSystem.cmake - pool = console - - -############################################# -# A missing CMake input file is not an error. - -build ../CMakeLists.txt ../windowsview/CMakeLists.txt ../windowsview/data.qrc ../windowswitchers/CMakeLists.txt /usr/lib/aarch64-linux-gnu/cmake/KF5Config/KF5ConfigCompilerTargets-debian.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5Config/KF5ConfigCompilerTargets.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5Config/KF5ConfigConfig.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5Config/KF5ConfigConfigVersion.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5Config/KF5ConfigMacros.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5Config/KF5ConfigQchTargets.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5Config/KF5ConfigTargets-debian.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5Config/KF5ConfigTargets.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5CoreAddons/KF5CoreAddonsConfig.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5CoreAddons/KF5CoreAddonsConfigVersion.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5CoreAddons/KF5CoreAddonsMacros.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5CoreAddons/KF5CoreAddonsQchTargets.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5CoreAddons/KF5CoreAddonsTargets-debian.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5CoreAddons/KF5CoreAddonsTargets.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5CoreAddons/KF5CoreAddonsToolingTargets-debian.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5CoreAddons/KF5CoreAddonsToolingTargets.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5GlobalAccel/KF5GlobalAccelConfig.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5GlobalAccel/KF5GlobalAccelConfigVersion.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5GlobalAccel/KF5GlobalAccelQchTargets.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5GlobalAccel/KF5GlobalAccelTargets-debian.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5GlobalAccel/KF5GlobalAccelTargets.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5I18n/KF5I18nConfig.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5I18n/KF5I18nConfigVersion.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5I18n/KF5I18nMacros.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5I18n/KF5I18nQchTargets.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5I18n/KF5I18nTargets-debian.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5I18n/KF5I18nTargets.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5WindowSystem/KF5WindowSystemConfig.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5WindowSystem/KF5WindowSystemConfigVersion.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5WindowSystem/KF5WindowSystemQchTargets.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5WindowSystem/KF5WindowSystemTargets-debian.cmake /usr/lib/aarch64-linux-gnu/cmake/KF5WindowSystem/KF5WindowSystemTargets.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5/Qt5Config.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5/Qt5ConfigVersion.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5/Qt5ModuleLocation.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Core/Qt5CoreConfig.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Core/Qt5CoreConfigExtras.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Core/Qt5CoreConfigExtrasMkspecDir.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Core/Qt5CoreConfigVersion.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Core/Qt5CoreMacros.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5DBus/Qt5DBusConfig.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5DBus/Qt5DBusConfigExtras.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5DBus/Qt5DBusConfigVersion.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5DBus/Qt5DBusMacros.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5GuiConfig.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5GuiConfigVersion.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QComposePlatformInputContextPlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QEglFSEmulatorIntegrationPlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QEglFSIntegrationPlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QEglFSKmsEglDeviceIntegrationPlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QEglFSKmsGbmIntegrationPlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QEglFSX11IntegrationPlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QEvdevKeyboardPlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QEvdevMousePlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QEvdevTabletPlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QEvdevTouchScreenPlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QGifPlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QICOPlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QIbusPlatformInputContextPlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QJpegPlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QLibInputPlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QLinuxFbIntegrationPlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QMinimalEglIntegrationPlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QMinimalIntegrationPlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QOffscreenIntegrationPlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QTuioTouchPlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QVncIntegrationPlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QXcbEglIntegrationPlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QXcbGlxIntegrationPlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QXcbIntegrationPlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5LinguistTools/Qt5LinguistToolsConfig.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5LinguistTools/Qt5LinguistToolsConfigVersion.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5LinguistTools/Qt5LinguistToolsMacros.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Network/Qt5NetworkConfig.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Network/Qt5NetworkConfigVersion.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Network/Qt5Network_QConnmanEnginePlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Network/Qt5Network_QGenericEnginePlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Network/Qt5Network_QNetworkManagerEnginePlugin.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Qml/Qt5QmlConfig.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Qml/Qt5QmlConfigExtras.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Qml/Qt5QmlConfigVersion.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Qml/Qt5Qml_QDebugMessageServiceFactory.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Qml/Qt5Qml_QLocalClientConnectionFactory.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Qml/Qt5Qml_QQmlDebugServerFactory.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Qml/Qt5Qml_QQmlDebuggerServiceFactory.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Qml/Qt5Qml_QQmlInspectorServiceFactory.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Qml/Qt5Qml_QQmlNativeDebugConnectorFactory.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Qml/Qt5Qml_QQmlNativeDebugServiceFactory.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Qml/Qt5Qml_QQmlPreviewServiceFactory.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Qml/Qt5Qml_QQmlProfilerServiceFactory.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Qml/Qt5Qml_QQuickProfilerAdapterFactory.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Qml/Qt5Qml_QTcpServerConnectionFactory.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Quick/Qt5QuickConfig.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Quick/Qt5QuickConfigVersion.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5QuickWidgets/Qt5QuickWidgetsConfig.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5QuickWidgets/Qt5QuickWidgetsConfigVersion.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Widgets/Qt5WidgetsConfigExtras.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Widgets/Qt5WidgetsConfigVersion.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Widgets/Qt5WidgetsMacros.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5X11Extras/Qt5X11ExtrasConfig.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5X11Extras/Qt5X11ExtrasConfigVersion.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Xml/Qt5XmlConfig.cmake /usr/lib/aarch64-linux-gnu/cmake/Qt5Xml/Qt5XmlConfigVersion.cmake /usr/share/ECM/cmake/ECMConfig.cmake /usr/share/ECM/cmake/ECMConfigVersion.cmake /usr/share/ECM/modules/ECMUseFindModules.cmake /usr/share/cmake-3.16/Modules/CMakeCInformation.cmake /usr/share/cmake-3.16/Modules/CMakeCXXInformation.cmake /usr/share/cmake-3.16/Modules/CMakeCheckCompilerFlagCommonPatterns.cmake /usr/share/cmake-3.16/Modules/CMakeCommonLanguageInclude.cmake /usr/share/cmake-3.16/Modules/CMakeFindDependencyMacro.cmake /usr/share/cmake-3.16/Modules/CMakeGenericSystem.cmake /usr/share/cmake-3.16/Modules/CMakeInitializeConfigs.cmake /usr/share/cmake-3.16/Modules/CMakeLanguageInformation.cmake /usr/share/cmake-3.16/Modules/CMakeParseArguments.cmake /usr/share/cmake-3.16/Modules/CMakeSystemSpecificInformation.cmake /usr/share/cmake-3.16/Modules/CMakeSystemSpecificInitialize.cmake /usr/share/cmake-3.16/Modules/CheckFunctionExists.cmake /usr/share/cmake-3.16/Modules/CheckLibraryExists.cmake /usr/share/cmake-3.16/Modules/Compiler/CMakeCommonCompilerMacros.cmake /usr/share/cmake-3.16/Modules/Compiler/GNU-C.cmake /usr/share/cmake-3.16/Modules/Compiler/GNU-CXX.cmake /usr/share/cmake-3.16/Modules/Compiler/GNU.cmake /usr/share/cmake-3.16/Modules/FindFontconfig.cmake /usr/share/cmake-3.16/Modules/FindFreetype.cmake /usr/share/cmake-3.16/Modules/FindGettext.cmake /usr/share/cmake-3.16/Modules/FindOpenGL.cmake /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake /usr/share/cmake-3.16/Modules/FindPackageMessage.cmake /usr/share/cmake-3.16/Modules/FindPkgConfig.cmake /usr/share/cmake-3.16/Modules/FindX11.cmake /usr/share/cmake-3.16/Modules/Internal/CMakeCheckCompilerFlag.cmake /usr/share/cmake-3.16/Modules/MacroAddFileDependencies.cmake /usr/share/cmake-3.16/Modules/Platform/Linux-GNU-C.cmake /usr/share/cmake-3.16/Modules/Platform/Linux-GNU-CXX.cmake /usr/share/cmake-3.16/Modules/Platform/Linux-GNU.cmake /usr/share/cmake-3.16/Modules/Platform/Linux.cmake /usr/share/cmake-3.16/Modules/Platform/UnixPaths.cmake /usr/share/cmake-3.16/Modules/SelectLibraryConfigurations.cmake CMakeCache.txt CMakeFiles/3.16.3/CMakeCCompiler.cmake CMakeFiles/3.16.3/CMakeCXXCompiler.cmake CMakeFiles/3.16.3/CMakeSystem.cmake: phony - - -############################################# -# Clean additional files. - -build CMakeFiles/clean.additional: CLEAN_ADDITIONAL - - -############################################# -# Clean all the built files. - -build clean: CLEAN CMakeFiles/clean.additional - - -############################################# -# Print all primary targets available. - -build help: HELP - diff --git a/build/cmake_install.cmake b/build/cmake_install.cmake deleted file mode 100644 index 8f13f77155c8a79d9cae99b51662bdf4a70dd7a0..0000000000000000000000000000000000000000 --- a/build/cmake_install.cmake +++ /dev/null @@ -1,56 +0,0 @@ -# Install script for directory: /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch - -# Set the install prefix -if(NOT DEFINED CMAKE_INSTALL_PREFIX) - set(CMAKE_INSTALL_PREFIX "/usr/local") -endif() -string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") - -# Set the install configuration name. -if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) - if(BUILD_TYPE) - string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" - CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") - else() - set(CMAKE_INSTALL_CONFIG_NAME "Debug") - endif() - message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") -endif() - -# Set the component getting installed. -if(NOT CMAKE_INSTALL_COMPONENT) - if(COMPONENT) - message(STATUS "Install component: \"${COMPONENT}\"") - set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") - else() - set(CMAKE_INSTALL_COMPONENT) - endif() -endif() - -# Install shared libraries without execute permission? -if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE) - set(CMAKE_INSTALL_SO_NO_EXE "1") -endif() - -# Is this installation the result of a crosscompile? -if(NOT DEFINED CMAKE_CROSSCOMPILING) - set(CMAKE_CROSSCOMPILING "FALSE") -endif() - -if(NOT CMAKE_INSTALL_LOCAL_ONLY) - # Include the install script for each subdirectory. - include("/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/windowsview/cmake_install.cmake") - include("/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/windowswitchers/cmake_install.cmake") - -endif() - -if(CMAKE_INSTALL_COMPONENT) - set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt") -else() - set(CMAKE_INSTALL_MANIFEST "install_manifest.txt") -endif() - -string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT - "${CMAKE_INSTALL_MANIFEST_FILES}") -file(WRITE "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/${CMAKE_INSTALL_MANIFEST}" - "${CMAKE_INSTALL_MANIFEST_CONTENT}") diff --git a/build/compile_commands.json b/build/compile_commands.json deleted file mode 100644 index 9dac709fa69b65c3dc5db182dd5b475e923d6782..0000000000000000000000000000000000000000 --- a/build/compile_commands.json +++ /dev/null @@ -1,49 +0,0 @@ -[ -{ - "directory": "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build", - "command": "/bin/c++ -DKCOREADDONS_LIB -DQT_CORE_LIB -DQT_DBUS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_QML_LIB -DQT_QUICKWIDGETS_LIB -DQT_QUICK_LIB -DQT_WIDGETS_LIB -DQT_X11EXTRAS_LIB -Dwindowsview_EXPORTS -Iwindowsview -I../windowsview -Iwindowsview/windowsview_autogen/include -I/usr/include/aarch64-linux-gnu/qt5/QGSettings -I/usr/include/kwin -isystem /usr/include/aarch64-linux-gnu/qt5 -isystem /usr/include/aarch64-linux-gnu/qt5/QtCore -isystem /usr/lib/aarch64-linux-gnu/qt5/mkspecs/linux-g++ -isystem /usr/include/aarch64-linux-gnu/qt5/QtGui -isystem /usr/include/aarch64-linux-gnu/qt5/QtWidgets -isystem /usr/include/aarch64-linux-gnu/qt5/QtQuick -isystem /usr/include/aarch64-linux-gnu/qt5/QtQml -isystem /usr/include/aarch64-linux-gnu/qt5/QtNetwork -isystem /usr/include/aarch64-linux-gnu/qt5/QtQuickWidgets -isystem /usr/include/KF5/KConfigCore -isystem /usr/include/KF5 -isystem /usr/include/KF5/KWindowSystem -isystem /usr/include/KF5/KCoreAddons -isystem /usr/include/KF5/KGlobalAccel -isystem /usr/include/aarch64-linux-gnu/qt5/QtDBus -isystem /usr/include/aarch64-linux-gnu/qt5/QtX11Extras -g -fPIC -fPIC -std=gnu++14 -o windowsview/CMakeFiles/windowsview.dir/windowsview_autogen/mocs_compilation.cpp.o -c /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/windowsview/windowsview_autogen/mocs_compilation.cpp", - "file": "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/windowsview/windowsview_autogen/mocs_compilation.cpp" -}, - -{ - "directory": "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build", - "command": "/bin/c++ -DKCOREADDONS_LIB -DQT_CORE_LIB -DQT_DBUS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_QML_LIB -DQT_QUICKWIDGETS_LIB -DQT_QUICK_LIB -DQT_WIDGETS_LIB -DQT_X11EXTRAS_LIB -Dwindowsview_EXPORTS -Iwindowsview -I../windowsview -Iwindowsview/windowsview_autogen/include -I/usr/include/aarch64-linux-gnu/qt5/QGSettings -I/usr/include/kwin -isystem /usr/include/aarch64-linux-gnu/qt5 -isystem /usr/include/aarch64-linux-gnu/qt5/QtCore -isystem /usr/lib/aarch64-linux-gnu/qt5/mkspecs/linux-g++ -isystem /usr/include/aarch64-linux-gnu/qt5/QtGui -isystem /usr/include/aarch64-linux-gnu/qt5/QtWidgets -isystem /usr/include/aarch64-linux-gnu/qt5/QtQuick -isystem /usr/include/aarch64-linux-gnu/qt5/QtQml -isystem /usr/include/aarch64-linux-gnu/qt5/QtNetwork -isystem /usr/include/aarch64-linux-gnu/qt5/QtQuickWidgets -isystem /usr/include/KF5/KConfigCore -isystem /usr/include/KF5 -isystem /usr/include/KF5/KWindowSystem -isystem /usr/include/KF5/KCoreAddons -isystem /usr/include/KF5/KGlobalAccel -isystem /usr/include/aarch64-linux-gnu/qt5/QtDBus -isystem /usr/include/aarch64-linux-gnu/qt5/QtX11Extras -g -fPIC -fPIC -std=gnu++14 -o windowsview/CMakeFiles/windowsview.dir/desktopbackground.cpp.o -c /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/windowsview/desktopbackground.cpp", - "file": "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/windowsview/desktopbackground.cpp" -}, - -{ - "directory": "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build", - "command": "/bin/c++ -DKCOREADDONS_LIB -DQT_CORE_LIB -DQT_DBUS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_QML_LIB -DQT_QUICKWIDGETS_LIB -DQT_QUICK_LIB -DQT_WIDGETS_LIB -DQT_X11EXTRAS_LIB -Dwindowsview_EXPORTS -Iwindowsview -I../windowsview -Iwindowsview/windowsview_autogen/include -I/usr/include/aarch64-linux-gnu/qt5/QGSettings -I/usr/include/kwin -isystem /usr/include/aarch64-linux-gnu/qt5 -isystem /usr/include/aarch64-linux-gnu/qt5/QtCore -isystem /usr/lib/aarch64-linux-gnu/qt5/mkspecs/linux-g++ -isystem /usr/include/aarch64-linux-gnu/qt5/QtGui -isystem /usr/include/aarch64-linux-gnu/qt5/QtWidgets -isystem /usr/include/aarch64-linux-gnu/qt5/QtQuick -isystem /usr/include/aarch64-linux-gnu/qt5/QtQml -isystem /usr/include/aarch64-linux-gnu/qt5/QtNetwork -isystem /usr/include/aarch64-linux-gnu/qt5/QtQuickWidgets -isystem /usr/include/KF5/KConfigCore -isystem /usr/include/KF5 -isystem /usr/include/KF5/KWindowSystem -isystem /usr/include/KF5/KCoreAddons -isystem /usr/include/KF5/KGlobalAccel -isystem /usr/include/aarch64-linux-gnu/qt5/QtDBus -isystem /usr/include/aarch64-linux-gnu/qt5/QtX11Extras -g -fPIC -fPIC -std=gnu++14 -o windowsview/CMakeFiles/windowsview.dir/icontheme.cpp.o -c /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/windowsview/icontheme.cpp", - "file": "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/windowsview/icontheme.cpp" -}, - -{ - "directory": "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build", - "command": "/bin/c++ -DKCOREADDONS_LIB -DQT_CORE_LIB -DQT_DBUS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_QML_LIB -DQT_QUICKWIDGETS_LIB -DQT_QUICK_LIB -DQT_WIDGETS_LIB -DQT_X11EXTRAS_LIB -Dwindowsview_EXPORTS -Iwindowsview -I../windowsview -Iwindowsview/windowsview_autogen/include -I/usr/include/aarch64-linux-gnu/qt5/QGSettings -I/usr/include/kwin -isystem /usr/include/aarch64-linux-gnu/qt5 -isystem /usr/include/aarch64-linux-gnu/qt5/QtCore -isystem /usr/lib/aarch64-linux-gnu/qt5/mkspecs/linux-g++ -isystem /usr/include/aarch64-linux-gnu/qt5/QtGui -isystem /usr/include/aarch64-linux-gnu/qt5/QtWidgets -isystem /usr/include/aarch64-linux-gnu/qt5/QtQuick -isystem /usr/include/aarch64-linux-gnu/qt5/QtQml -isystem /usr/include/aarch64-linux-gnu/qt5/QtNetwork -isystem /usr/include/aarch64-linux-gnu/qt5/QtQuickWidgets -isystem /usr/include/KF5/KConfigCore -isystem /usr/include/KF5 -isystem /usr/include/KF5/KWindowSystem -isystem /usr/include/KF5/KCoreAddons -isystem /usr/include/KF5/KGlobalAccel -isystem /usr/include/aarch64-linux-gnu/qt5/QtDBus -isystem /usr/include/aarch64-linux-gnu/qt5/QtX11Extras -g -fPIC -fPIC -std=gnu++14 -o windowsview/CMakeFiles/windowsview.dir/multitaskviewmodel.cpp.o -c /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/windowsview/multitaskviewmodel.cpp", - "file": "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/windowsview/multitaskviewmodel.cpp" -}, - -{ - "directory": "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build", - "command": "/bin/c++ -DKCOREADDONS_LIB -DQT_CORE_LIB -DQT_DBUS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_QML_LIB -DQT_QUICKWIDGETS_LIB -DQT_QUICK_LIB -DQT_WIDGETS_LIB -DQT_X11EXTRAS_LIB -Dwindowsview_EXPORTS -Iwindowsview -I../windowsview -Iwindowsview/windowsview_autogen/include -I/usr/include/aarch64-linux-gnu/qt5/QGSettings -I/usr/include/kwin -isystem /usr/include/aarch64-linux-gnu/qt5 -isystem /usr/include/aarch64-linux-gnu/qt5/QtCore -isystem /usr/lib/aarch64-linux-gnu/qt5/mkspecs/linux-g++ -isystem /usr/include/aarch64-linux-gnu/qt5/QtGui -isystem /usr/include/aarch64-linux-gnu/qt5/QtWidgets -isystem /usr/include/aarch64-linux-gnu/qt5/QtQuick -isystem /usr/include/aarch64-linux-gnu/qt5/QtQml -isystem /usr/include/aarch64-linux-gnu/qt5/QtNetwork -isystem /usr/include/aarch64-linux-gnu/qt5/QtQuickWidgets -isystem /usr/include/KF5/KConfigCore -isystem /usr/include/KF5 -isystem /usr/include/KF5/KWindowSystem -isystem /usr/include/KF5/KCoreAddons -isystem /usr/include/KF5/KGlobalAccel -isystem /usr/include/aarch64-linux-gnu/qt5/QtDBus -isystem /usr/include/aarch64-linux-gnu/qt5/QtX11Extras -g -fPIC -fPIC -std=gnu++14 -o windowsview/CMakeFiles/windowsview.dir/multitaskviewmanager.cpp.o -c /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/windowsview/multitaskviewmanager.cpp", - "file": "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/windowsview/multitaskviewmanager.cpp" -}, - -{ - "directory": "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build", - "command": "/bin/c++ -DKCOREADDONS_LIB -DQT_CORE_LIB -DQT_DBUS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_QML_LIB -DQT_QUICKWIDGETS_LIB -DQT_QUICK_LIB -DQT_WIDGETS_LIB -DQT_X11EXTRAS_LIB -Dwindowsview_EXPORTS -Iwindowsview -I../windowsview -Iwindowsview/windowsview_autogen/include -I/usr/include/aarch64-linux-gnu/qt5/QGSettings -I/usr/include/kwin -isystem /usr/include/aarch64-linux-gnu/qt5 -isystem /usr/include/aarch64-linux-gnu/qt5/QtCore -isystem /usr/lib/aarch64-linux-gnu/qt5/mkspecs/linux-g++ -isystem /usr/include/aarch64-linux-gnu/qt5/QtGui -isystem /usr/include/aarch64-linux-gnu/qt5/QtWidgets -isystem /usr/include/aarch64-linux-gnu/qt5/QtQuick -isystem /usr/include/aarch64-linux-gnu/qt5/QtQml -isystem /usr/include/aarch64-linux-gnu/qt5/QtNetwork -isystem /usr/include/aarch64-linux-gnu/qt5/QtQuickWidgets -isystem /usr/include/KF5/KConfigCore -isystem /usr/include/KF5 -isystem /usr/include/KF5/KWindowSystem -isystem /usr/include/KF5/KCoreAddons -isystem /usr/include/KF5/KGlobalAccel -isystem /usr/include/aarch64-linux-gnu/qt5/QtDBus -isystem /usr/include/aarch64-linux-gnu/qt5/QtX11Extras -g -fPIC -fPIC -std=gnu++14 -o windowsview/CMakeFiles/windowsview.dir/dbusservice.cpp.o -c /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/windowsview/dbusservice.cpp", - "file": "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/windowsview/dbusservice.cpp" -}, - -{ - "directory": "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build", - "command": "/bin/c++ -DKCOREADDONS_LIB -DQT_CORE_LIB -DQT_DBUS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_QML_LIB -DQT_QUICKWIDGETS_LIB -DQT_QUICK_LIB -DQT_WIDGETS_LIB -DQT_X11EXTRAS_LIB -Dwindowsview_EXPORTS -Iwindowsview -I../windowsview -Iwindowsview/windowsview_autogen/include -I/usr/include/aarch64-linux-gnu/qt5/QGSettings -I/usr/include/kwin -isystem /usr/include/aarch64-linux-gnu/qt5 -isystem /usr/include/aarch64-linux-gnu/qt5/QtCore -isystem /usr/lib/aarch64-linux-gnu/qt5/mkspecs/linux-g++ -isystem /usr/include/aarch64-linux-gnu/qt5/QtGui -isystem /usr/include/aarch64-linux-gnu/qt5/QtWidgets -isystem /usr/include/aarch64-linux-gnu/qt5/QtQuick -isystem /usr/include/aarch64-linux-gnu/qt5/QtQml -isystem /usr/include/aarch64-linux-gnu/qt5/QtNetwork -isystem /usr/include/aarch64-linux-gnu/qt5/QtQuickWidgets -isystem /usr/include/KF5/KConfigCore -isystem /usr/include/KF5 -isystem /usr/include/KF5/KWindowSystem -isystem /usr/include/KF5/KCoreAddons -isystem /usr/include/KF5/KGlobalAccel -isystem /usr/include/aarch64-linux-gnu/qt5/QtDBus -isystem /usr/include/aarch64-linux-gnu/qt5/QtX11Extras -g -fPIC -fPIC -std=gnu++14 -o windowsview/CMakeFiles/windowsview.dir/multitaskviewmanagerpluginfactory.cpp.o -c /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/windowsview/multitaskviewmanagerpluginfactory.cpp", - "file": "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/windowsview/multitaskviewmanagerpluginfactory.cpp" -}, - -{ - "directory": "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build", - "command": "/bin/c++ -DKCOREADDONS_LIB -DQT_CORE_LIB -DQT_DBUS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_QML_LIB -DQT_QUICKWIDGETS_LIB -DQT_QUICK_LIB -DQT_WIDGETS_LIB -DQT_X11EXTRAS_LIB -Dwindowsview_EXPORTS -Iwindowsview -I../windowsview -Iwindowsview/windowsview_autogen/include -I/usr/include/aarch64-linux-gnu/qt5/QGSettings -I/usr/include/kwin -isystem /usr/include/aarch64-linux-gnu/qt5 -isystem /usr/include/aarch64-linux-gnu/qt5/QtCore -isystem /usr/lib/aarch64-linux-gnu/qt5/mkspecs/linux-g++ -isystem /usr/include/aarch64-linux-gnu/qt5/QtGui -isystem /usr/include/aarch64-linux-gnu/qt5/QtWidgets -isystem /usr/include/aarch64-linux-gnu/qt5/QtQuick -isystem /usr/include/aarch64-linux-gnu/qt5/QtQml -isystem /usr/include/aarch64-linux-gnu/qt5/QtNetwork -isystem /usr/include/aarch64-linux-gnu/qt5/QtQuickWidgets -isystem /usr/include/KF5/KConfigCore -isystem /usr/include/KF5 -isystem /usr/include/KF5/KWindowSystem -isystem /usr/include/KF5/KCoreAddons -isystem /usr/include/KF5/KGlobalAccel -isystem /usr/include/aarch64-linux-gnu/qt5/QtDBus -isystem /usr/include/aarch64-linux-gnu/qt5/QtX11Extras -g -fPIC -fPIC -std=gnu++14 -o windowsview/CMakeFiles/windowsview.dir/qrc_data.cpp.o -c /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/windowsview/qrc_data.cpp", - "file": "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/windowsview/qrc_data.cpp" -} -] \ No newline at end of file diff --git a/build/rules.ninja b/build/rules.ninja deleted file mode 100644 index c311e0ba69eae7d04e47e4e3ab11bbe3a860d68d..0000000000000000000000000000000000000000 --- a/build/rules.ninja +++ /dev/null @@ -1,72 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Ninja" Generator, CMake Version 3.16 - -# This file contains all the rules used to get the outputs files -# built from the input files. -# It is included in the main 'build.ninja'. - -# ============================================================================= -# Project: ukui-window-switch -# Configuration: Debug -# ============================================================================= -# ============================================================================= - -############################################# -# Rule for running custom commands. - -rule CUSTOM_COMMAND - command = $COMMAND - description = $DESC - - -############################################# -# Rule for compiling CXX files. - -rule CXX_COMPILER__windowsview - depfile = $DEP_FILE - deps = gcc - command = /bin/c++ $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in - description = Building CXX object $out - - -############################################# -# Rule for linking CXX shared module. - -rule CXX_MODULE_LIBRARY_LINKER__windowsview - command = $PRE_LINK && /bin/c++ -fPIC $LANGUAGE_COMPILE_FLAGS $ARCH_FLAGS $LINK_FLAGS -shared $SONAME_FLAG$SONAME -o $TARGET_FILE $in $LINK_PATH $LINK_LIBRARIES && $POST_BUILD - description = Linking CXX shared module $TARGET_FILE - restat = $RESTAT - - -############################################# -# Rule for re-running cmake. - -rule RERUN_CMAKE - command = /usr/bin/cmake -S/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch -B/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build - description = Re-running CMake... - generator = 1 - - -############################################# -# Rule for cleaning additional files. - -rule CLEAN_ADDITIONAL - command = /usr/bin/cmake -P CMakeFiles/clean_additional.cmake - description = Cleaning additional files... - - -############################################# -# Rule for cleaning all built files. - -rule CLEAN - command = /usr/bin/ninja -t clean - description = Cleaning all built files... - - -############################################# -# Rule for printing all primary targets available. - -rule HELP - command = /usr/bin/ninja -t targets - description = All primary targets available: - diff --git a/build/windowsview/CMakeFiles/windowsview_autogen.dir/AutogenInfo.json b/build/windowsview/CMakeFiles/windowsview_autogen.dir/AutogenInfo.json deleted file mode 100644 index 6da1e0d6f9a8d33fdbcd1dd2e62f33324e472356..0000000000000000000000000000000000000000 --- a/build/windowsview/CMakeFiles/windowsview_autogen.dir/AutogenInfo.json +++ /dev/null @@ -1,159 +0,0 @@ -{ - "BUILD_DIR" : "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/windowsview/windowsview_autogen", - "CMAKE_BINARY_DIR" : "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build", - "CMAKE_CURRENT_BINARY_DIR" : "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/windowsview", - "CMAKE_CURRENT_SOURCE_DIR" : "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/windowsview", - "CMAKE_EXECUTABLE" : "/usr/bin/cmake", - "CMAKE_SOURCE_DIR" : "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch", - "HEADERS" : - [ - [ - "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/windowsview/dbusservice.h", - "MU", - "EWIEGA46WW/moc_dbusservice.cpp" - ], - [ - "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/windowsview/desktopbackground.h", - "MU", - "EWIEGA46WW/moc_desktopbackground.cpp" - ], - [ - "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/windowsview/icontheme.h", - "MU", - "EWIEGA46WW/moc_icontheme.cpp" - ], - [ - "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/windowsview/multitaskviewmanager.h", - "MU", - "EWIEGA46WW/moc_multitaskviewmanager.cpp" - ], - [ - "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/windowsview/multitaskviewmodel.h", - "MU", - "EWIEGA46WW/moc_multitaskviewmodel.cpp" - ] - ], - "HEADER_EXTENSIONS" : [ "h", "hh", "h++", "hm", "hpp", "hxx", "in", "txx" ], - "INCLUDE_DIR" : "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/windowsview/windowsview_autogen/include", - "MOC_COMPILATION_FILE" : "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/windowsview/windowsview_autogen/mocs_compilation.cpp", - "MOC_DEFINITIONS" : - [ - "KCOREADDONS_LIB", - "QT_CORE_LIB", - "QT_DBUS_LIB", - "QT_GUI_LIB", - "QT_NETWORK_LIB", - "QT_QML_LIB", - "QT_QUICKWIDGETS_LIB", - "QT_QUICK_LIB", - "QT_WIDGETS_LIB", - "QT_X11EXTRAS_LIB", - "windowsview_EXPORTS" - ], - "MOC_DEPEND_FILTERS" : - [ - [ - "Q_PLUGIN_METADATA", - "[\n][ \t]*Q_PLUGIN_METADATA[ \t]*\\([^\\)]*FILE[ \t]*\"([^\"]+)\"" - ], - [ - "K_PLUGIN_FACTORY_WITH_JSON", - "[\n^][ \t]*K_PLUGIN_FACTORY_WITH_JSON[ \t\n]*\\([^,]*,[ \t\n]*\"([^\"]+)\"" - ], - [ - "K_PLUGIN_CLASS_WITH_JSON", - "[\n^][ \t]*K_PLUGIN_CLASS_WITH_JSON[ \t\n]*\\([^,]*,[ \t\n]*\"([^\"]+)\"" - ] - ], - "MOC_INCLUDES" : - [ - "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/windowsview", - "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/windowsview", - "/usr/include/aarch64-linux-gnu/qt5/QGSettings", - "/usr/include/kwin", - "/usr/include/aarch64-linux-gnu/qt5", - "/usr/include/aarch64-linux-gnu/qt5/QtCore", - "/usr/lib/aarch64-linux-gnu/qt5/mkspecs/linux-g++", - "/usr/include/aarch64-linux-gnu/qt5/QtGui", - "/usr/include/aarch64-linux-gnu/qt5/QtWidgets", - "/usr/include/aarch64-linux-gnu/qt5/QtQuick", - "/usr/include/aarch64-linux-gnu/qt5/QtQml", - "/usr/include/aarch64-linux-gnu/qt5/QtNetwork", - "/usr/include/aarch64-linux-gnu/qt5/QtQuickWidgets", - "/usr/include/KF5/KConfigCore", - "/usr/include/KF5", - "/usr/include/KF5/KWindowSystem", - "/usr/include/KF5/KCoreAddons", - "/usr/include/KF5/KGlobalAccel", - "/usr/include/aarch64-linux-gnu/qt5/QtDBus", - "/usr/include/aarch64-linux-gnu/qt5/QtX11Extras", - "/usr/include", - "/usr/include/c++/9", - "/usr/include/aarch64-linux-gnu/c++/9", - "/usr/include/c++/9/backward", - "/usr/lib/gcc/aarch64-linux-gnu/9/include", - "/usr/local/include", - "/usr/include/aarch64-linux-gnu" - ], - "MOC_MACRO_NAMES" : - [ - "Q_OBJECT", - "Q_GADGET", - "Q_NAMESPACE", - "K_PLUGIN_FACTORY", - "K_PLUGIN_FACTORY_WITH_JSON", - "K_PLUGIN_CLASS_WITH_JSON" - ], - "MOC_OPTIONS" : [], - "MOC_PATH_PREFIX" : true, - "MOC_PREDEFS_CMD" : - [ - "/bin/c++", - "-dM", - "-E", - "-c", - "/usr/share/cmake-3.16/Modules/CMakeCXXCompilerABI.cpp" - ], - "MOC_PREDEFS_FILE" : "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/windowsview/windowsview_autogen/moc_predefs.h", - "MOC_RELAXED_MODE" : false, - "MOC_SKIP" : [], - "MULTI_CONFIG" : false, - "PARALLEL" : 1, - "PARSE_CACHE_FILE" : "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/windowsview/CMakeFiles/windowsview_autogen.dir/ParseCache.txt", - "QT_MOC_EXECUTABLE" : "/usr/lib/qt5/bin/moc", - "QT_UIC_EXECUTABLE" : "/usr/lib/qt5/bin/uic", - "QT_VERSION_MAJOR" : 5, - "SETTINGS_FILE" : "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/windowsview/CMakeFiles/windowsview_autogen.dir/AutogenUsed.txt", - "SOURCES" : - [ - [ - "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/windowsview/dbusservice.cpp", - "MU" - ], - [ - "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/windowsview/desktopbackground.cpp", - "MU" - ], - [ - "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/windowsview/icontheme.cpp", - "MU" - ], - [ - "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/windowsview/multitaskviewmanager.cpp", - "MU" - ], - [ - "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/windowsview/multitaskviewmanagerpluginfactory.cpp", - "MU" - ], - [ - "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/windowsview/multitaskviewmodel.cpp", - "MU" - ] - ], - "UIC_OPTIONS" : [], - "UIC_SEARCH_PATHS" : [], - "UIC_SKIP" : [], - "UIC_UI_FILES" : [], - "VERBOSITY" : 0 -} diff --git a/build/windowsview/cmake_install.cmake b/build/windowsview/cmake_install.cmake deleted file mode 100644 index 0eff4a6272371ad8f8c9e56240fd2c803a889e41..0000000000000000000000000000000000000000 --- a/build/windowsview/cmake_install.cmake +++ /dev/null @@ -1,75 +0,0 @@ -# Install script for directory: /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/windowsview - -# Set the install prefix -if(NOT DEFINED CMAKE_INSTALL_PREFIX) - set(CMAKE_INSTALL_PREFIX "/usr/local") -endif() -string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") - -# Set the install configuration name. -if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) - if(BUILD_TYPE) - string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" - CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") - else() - set(CMAKE_INSTALL_CONFIG_NAME "Debug") - endif() - message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") -endif() - -# Set the component getting installed. -if(NOT CMAKE_INSTALL_COMPONENT) - if(COMPONENT) - message(STATUS "Install component: \"${COMPONENT}\"") - set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") - else() - set(CMAKE_INSTALL_COMPONENT) - endif() -endif() - -# Install shared libraries without execute permission? -if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE) - set(CMAKE_INSTALL_SO_NO_EXE "1") -endif() - -# Is this installation the result of a crosscompile? -if(NOT DEFINED CMAKE_CROSSCOMPILING) - set(CMAKE_CROSSCOMPILING "FALSE") -endif() - -if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xUnspecifiedx" OR NOT CMAKE_INSTALL_COMPONENT) - if(EXISTS "$ENV{DESTDIR}/usr/lib/aarch64-linux-gnu/qt5/plugins/kwin/effects/plugins/libwindowsview.so" AND - NOT IS_SYMLINK "$ENV{DESTDIR}/usr/lib/aarch64-linux-gnu/qt5/plugins/kwin/effects/plugins/libwindowsview.so") - file(RPATH_CHECK - FILE "$ENV{DESTDIR}/usr/lib/aarch64-linux-gnu/qt5/plugins/kwin/effects/plugins/libwindowsview.so" - RPATH "") - endif() - list(APPEND CMAKE_ABSOLUTE_DESTINATION_FILES - "/usr/lib/aarch64-linux-gnu/qt5/plugins/kwin/effects/plugins/libwindowsview.so") - if(CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION) - message(WARNING "ABSOLUTE path INSTALL DESTINATION : ${CMAKE_ABSOLUTE_DESTINATION_FILES}") - endif() - if(CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION) - message(FATAL_ERROR "ABSOLUTE path INSTALL DESTINATION forbidden (by caller): ${CMAKE_ABSOLUTE_DESTINATION_FILES}") - endif() -file(INSTALL DESTINATION "/usr/lib/aarch64-linux-gnu/qt5/plugins/kwin/effects/plugins" TYPE MODULE FILES "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/build/windowsview/libwindowsview.so") - if(EXISTS "$ENV{DESTDIR}/usr/lib/aarch64-linux-gnu/qt5/plugins/kwin/effects/plugins/libwindowsview.so" AND - NOT IS_SYMLINK "$ENV{DESTDIR}/usr/lib/aarch64-linux-gnu/qt5/plugins/kwin/effects/plugins/libwindowsview.so") - if(CMAKE_INSTALL_DO_STRIP) - execute_process(COMMAND "/bin/strip" "$ENV{DESTDIR}/usr/lib/aarch64-linux-gnu/qt5/plugins/kwin/effects/plugins/libwindowsview.so") - endif() - endif() -endif() - -if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xUnspecifiedx" OR NOT CMAKE_INSTALL_COMPONENT) - list(APPEND CMAKE_ABSOLUTE_DESTINATION_FILES - "/usr/bin/ukui-window-switch") - if(CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION) - message(WARNING "ABSOLUTE path INSTALL DESTINATION : ${CMAKE_ABSOLUTE_DESTINATION_FILES}") - endif() - if(CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION) - message(FATAL_ERROR "ABSOLUTE path INSTALL DESTINATION forbidden (by caller): ${CMAKE_ABSOLUTE_DESTINATION_FILES}") - endif() -file(INSTALL DESTINATION "/usr/bin" TYPE FILE FILES "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/windowsview/ukui-window-switch") -endif() - diff --git a/build/windowsview/data.qrc.depends b/build/windowsview/data.qrc.depends deleted file mode 100644 index c93b1f0ee75ad5a4c62e570d8cdbe3a171776274..0000000000000000000000000000000000000000 --- a/build/windowsview/data.qrc.depends +++ /dev/null @@ -1,26 +0,0 @@ - - - qml/Controller.js - qml/TabletController.js - images/default-background.jpg - images/all-clean-click.svg - images/all-clean-default.svg - images/all-clean-hover.svg - images/ukui-taskview-close-click.svg - images/ukui-taskview-close-default.svg - images/ukui-taskview-close-hover.svg - qml/PreviewWindow.qml - qml/multitaskview.qml - qml/AppArea.qml - qml/DesktopArea.qml - qml/TabletMultitaskView.qml - qml/TabletViewRootWindow.qml - qml/TabletScrollViewArea.qml - qml/TabletPreviewWindow.qml - images/tablet_delete.svg - qml/TabletViewMain.qml - qml/TabletViewClearAllWindowButton.qml - qml/TabletViewCloseButton.qml - qml/CloseButton.qml - - diff --git a/build/windowswitchers/cmake_install.cmake b/build/windowswitchers/cmake_install.cmake deleted file mode 100644 index 1763bb119e9f1a8e3398465abf9320458b5abed5..0000000000000000000000000000000000000000 --- a/build/windowswitchers/cmake_install.cmake +++ /dev/null @@ -1,63 +0,0 @@ -# Install script for directory: /home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/windowswitchers - -# Set the install prefix -if(NOT DEFINED CMAKE_INSTALL_PREFIX) - set(CMAKE_INSTALL_PREFIX "/usr/local") -endif() -string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") - -# Set the install configuration name. -if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) - if(BUILD_TYPE) - string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" - CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") - else() - set(CMAKE_INSTALL_CONFIG_NAME "Debug") - endif() - message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") -endif() - -# Set the component getting installed. -if(NOT CMAKE_INSTALL_COMPONENT) - if(COMPONENT) - message(STATUS "Install component: \"${COMPONENT}\"") - set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") - else() - set(CMAKE_INSTALL_COMPONENT) - endif() -endif() - -# Install shared libraries without execute permission? -if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE) - set(CMAKE_INSTALL_SO_NO_EXE "1") -endif() - -# Is this installation the result of a crosscompile? -if(NOT DEFINED CMAKE_CROSSCOMPILING) - set(CMAKE_CROSSCOMPILING "FALSE") -endif() - -if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xUnspecifiedx" OR NOT CMAKE_INSTALL_COMPONENT) - list(APPEND CMAKE_ABSOLUTE_DESTINATION_FILES - "/usr/share/kwin/tabbox/thumbnail_grid") - if(CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION) - message(WARNING "ABSOLUTE path INSTALL DESTINATION : ${CMAKE_ABSOLUTE_DESTINATION_FILES}") - endif() - if(CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION) - message(FATAL_ERROR "ABSOLUTE path INSTALL DESTINATION forbidden (by caller): ${CMAKE_ABSOLUTE_DESTINATION_FILES}") - endif() -file(INSTALL DESTINATION "/usr/share/kwin/tabbox" TYPE DIRECTORY FILES "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/windowswitchers/thumbnail_grid") -endif() - -if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xUnspecifiedx" OR NOT CMAKE_INSTALL_COMPONENT) - list(APPEND CMAKE_ABSOLUTE_DESTINATION_FILES - "/usr/share/kservices5/kwin/kwin4_window_switcher_thumbnail_grid.desktop") - if(CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION) - message(WARNING "ABSOLUTE path INSTALL DESTINATION : ${CMAKE_ABSOLUTE_DESTINATION_FILES}") - endif() - if(CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION) - message(FATAL_ERROR "ABSOLUTE path INSTALL DESTINATION forbidden (by caller): ${CMAKE_ABSOLUTE_DESTINATION_FILES}") - endif() -file(INSTALL DESTINATION "/usr/share/kservices5/kwin" TYPE FILE RENAME "kwin4_window_switcher_thumbnail_grid.desktop" FILES "/home/zxy/debugdir/kwin/multitask/ukui-kwin-effects-new/uws2/ukui-window-switch/windowswitchers/thumbnail_grid/metadata.desktop") -endif() - diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000000000000000000000000000000000000..b527d32c07eb473e887e16a8fc466abc3c49bed1 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,355 @@ +ukui-window-switch (4.10.1.10-ok2.3) nile; urgency=medium + + * Issue:#IBFLY5 【X】【多任务视图】打开多任务视图界面静置进入自动锁屏,多任务视图界面不会自动退出 + * 其他:fix(wlcom windowsview): 点击有子窗口的窗口的关闭按钮时激活该窗口 + + -- zhangyuanyuan1 Mon, 21 Apr 2025 15:27:35 +0800 + +ukui-window-switch (4.10.1.10-ok2.2) nile; urgency=medium + + * Issue: + #I7X74I 【设计走查】alt+tab圆形元素未适配主题 + #I8X4B2 【USD】系统内存不足弹框按键alt+tab显示缩略图,win+tab未显示 + * 其他: + -更新copyright + + -- zhangyuanyuan1 Tue, 18 Mar 2025 14:31:28 +0800 + +ukui-window-switch (4.10.1.10-ok2.0) nile; urgency=medium + + * Issue:#IB24M1 【多任务视图】开启多个窗口,鼠标按住空白处无法上下滑动翻页 + * 其他: + -refactor:重构model-view实现及前后端通信 + -perf:优化CmakeLists.txt结构,调整翻译文件生成与安装机制 + -feat:增加自定义flow UkuiFlow,增加编译依赖qtdeclarative5-private-dev + -perf:优化应用预览窗居中动画和键盘走焦 + -perf:优化应用区域和工作区滑动交互 + + -- zhangyuanyuan1 Fri, 07 Mar 2025 14:07:48 +0800 + +ukui-window-switch (4.10.1.10-ok1.6) nile; urgency=medium + + * Issue:无 + * 其他:增加阿越翻译文件 + + -- Kevin Duan Fri, 03 Jan 2025 17:52:20 +0800 + +ukui-window-switch (4.10.1.10-ok1.5) nile; urgency=medium + + * Issue:无 + * 其他:fix: 修复“拉伸/居中”多任务视图背景与桌面背景显示不一致问题 + + -- zhangyuanyuan1 Fri, 03 Jan 2025 17:52:20 +0800 + +ukui-window-switch (4.10.1.10-ok1.4) nile; urgency=medium + + * Issue:无 + * 其他:Revert "fix: 修复开机自启动失败问题" + + -- zhangyuanyuan1 Thu, 19 Dec 2024 17:26:01 +0800 + +ukui-window-switch (4.10.1.10-ok1.3) nile; urgency=medium + + * Issue:无 + * 其他: + -feat:多任务视图应用区域添加滚动条 + -perf:优化模糊算法 + -fix:修复wlcom环境kill后自启动失败问题 + + -- zhangyuanyuan1 Thu, 12 Dec 2024 15:53:43 +0800 + +ukui-window-switch (4.10.1.10-ok1.2) nile; urgency=medium + + * Issue:无 + * 其他: + -fix(tabbox.qml)去掉引用的无用模块 + -fix(output.cpp)修正KWYC枚举值拼写,解决编译报错问题 + -feat(wlcom): 添加日志输出为log文件 + -fix(desktopbackground.cpp): 修复背景为'适应'模式多任务视图与桌面显示不一致问题 + + -- zhangyuanyuan1 Tue, 03 Dec 2024 09:51:02 +0800 + +ukui-window-switch (4.10.1.10-ok1.1) nile; urgency=medium + + * Issue: 无 + * 其他:修复shift+alt+tab快捷键切换后窗口不消失问题 + + -- zhangyuanyuan1 Thu, 21 Nov 2024 11:20:26 +0800 + +ukui-window-switch (4.10.1.10-ok1) nile; urgency=medium + + * rebuild + + -- zhangyuanyan1 Wed, 23 Oct 2024 14:14:58 +0800 + +ukui-window-switch (4.10.1.10-ok0) nile; urgency=medium + + * Issue:无 + * 其他:fix the dbus for kwin + + -- zhangyuanyuan1 Wed, 23 Oct 2024 14:03:12 +0800 + +ukui-window-switch (4.10.1.9-ok0) nile; urgency=medium + + * Issue: https://gitee.com/openkylin/ukui-window-switch/issues/IAID8L + + -- zhangyuanyuan1 Mon, 23 Sep 2024 14:35:06 +0800 + +ukui-window-switch (4.10.1.8-ok0) nile; urgency=medium + + * Issue: https://gitee.com/openkylin/kwin/issues/IAOG5O + + -- zhangyuanyuan1 Thu, 12 Sep 2024 14:39:28 +0800 + +ukui-window-switch (4.10.1.7-ok0) nile; urgency=medium + + * Issue:https://gitee.com/openkylin/ukui-touch-settings-plugin/issues/I9QJ3G + https://gitee.com/openkylin/ukui-touch-settings-plugin/issues/I9QJ6B + https://gitee.com/openkylin/ukui-touch-settings-plugin/issues/I9QJB0 + https://gitee.com/openkylin/ukui-touch-settings-plugin/issues/I9QJCU + https://gitee.com/openkylin/ukui-touch-settings-plugin/issues/I9QJXN + https://gitee.com/openkylin/ukui-touch-settings-plugin/issues/I9QJXN + https://gitee.com/openkylin/ukui-touch-settings-plugin/issues/I9QK9W + https://gitee.com/openkylin/ukui-touch-settings-plugin/issues/I9QKDF + * 其他: + -添加平板模式布局方向属性 + -补全wlcom显示桌面接口 + + -- zhangyuanyuan1 Fri, 30 Aug 2024 11:02:33 +0800 + +ukui-window-switch (4.10.1.6-ok0) nile; urgency=medium + + * Issue:https://gitee.com/openkylin/ukui-window-switch/issues/IAH6D7?from=project-issue + * 其他: + -更新翻译 + + -- zhangyuanyuan1 Mon, 05 Aug 2024 16:28:15 +0800 + +ukui-window-switch (4.10.1.5-ok0) nile; urgency=medium + + * Issue: 无 + * 其他: + -修复窗口选择界面默认焦点不在第二个窗口的问题 + -修复窗口选择界面关闭后预览图资源未释放问题 + + -- zhangyuanyuan1 Tue, 16 Jul 2024 17:07:02 +0800 + +ukui-window-switch (4.10.1.4-ok0) nile; urgency=medium + + * Issue: https://gitee.com/openkylin/ukui-window-switch/issues/IA7RVO?from=project-issue + * 其他: + -修复wlcom关闭工作区概率性崩溃问题 + + -- zhangyuanyuan1 Wed, 10 Jul 2024 17:50:29 +0800 + +ukui-window-switch (4.10.1.3-ok0) nile; urgency=medium + + * Issue: https://gitee.com/openkylin/ukui-window-switch/issues/I8YR0X?from=project-issue + https://gitee.com/openkylin/ukui-window-switch/issues/I9JDTK?from=project-issue + https://gitee.com/openkylin/ukui-window-switch/issues/I9KLQL?from=project-issue + https://gitee.com/openkylin/ukui-window-switch/issues/I9T078?from=project-issue + * 其他: + - 修复thumbnail资源释放问题 + + -- zhangyuanyuan1 Thu, 04 Jul 2024 13:39:38 +0800 + +ukui-window-switch (4.10.1.2-ok0) nile; urgency=medium + + * 调整多任务视图布局在维哈柯环境为从右到左 + + -- zhangyuanyuan1 Thu, 04 Jul 2024 11:01:47 +0800 + +ukui-window-switch (4.10.1.1-ok3) nile; urgency=medium + + * 修改版本号重编 + + -- zhangyuanyuan1 Wed, 19 Jun 2024 17:57:09 +0800 + +ukui-window-switch (4.10.1.1-ok2) nile; urgency=medium + + * mode is null when output is disabled + + -- zhangyuanyuan1 Wed, 19 Jun 2024 17:42:09 +0800 + +ukui-window-switch (4.10.1.1-ok1) nile; urgency=medium + + * 无窗口时按下alt-tab,窗口切换界面不会开启 + * 增加窗口切换界面失焦后自动关闭的功能 + * alt-tab界面添加毛玻璃 + + -- zhangyuanyuan1 Thu, 30 May 2024 19:47:00 +0800 + +ukui-window-switch (4.10.1.0-ok0) nile; urgency=medium + + * 修改版本号重编 + + -- zhangyuanyuan1 Tue, 28 May 2024 10:38:55 +0800 + +ukui-window-switch (4.10.0.0-ok0.1) nile; urgency=medium + + * 适配wlcom + + -- jiaodian Fri, 24 May 2024 16:53:53 +0800 + +ukui-window-switch (4.10.0.0-ok0.0) nile; urgency=medium + + * upstream version 4.10.0.0 + + -- zhangyuanyuan1 Wed, 22 May 2024 16:09:57 +0800 + +ukui-window-switch (4.0.0.0-ok0.12) nile; urgency=medium + + * No change rebuild + + -- CI Bot Tue, 21 May 2024 03:50:41 +0000 + +ukui-window-switch (4.0.0.0-ok0.11) nile; urgency=medium + + * 修改多任务视图,增加窗口垂直居中功能 + + -- jiaodian Wed, 06 Mar 2024 15:46:00 +0800 + +ukui-window-switch (4.0.0.0-ok0.10) nile; urgency=medium + + * 修改多任务视图圆角,适配主题大小 + * 修改多任务视图新建工作区按钮大小 + * 增加多任务视图背景深色蒙层 + + -- jiaodian Thu, 22 Feb 2024 14:02:43 +0800 + +ukui-window-switch (4.0.0.0-ok0.9) nile; urgency=medium + + * 修改多任务视图平板模式的缩略图大小算法,解决缩略图大于边框的问题 + + -- jiaodian Tue, 12 Dec 2023 17:20:20 +0800 + +ukui-window-switch (4.0.0.0-ok0.8) nile; urgency=medium + + * 修改多任务视图的开启和关闭事件的数据上传方式 + + -- jiaodian Tue, 21 Nov 2023 15:32:15 +0800 + +ukui-window-switch (4.0.0.0-ok0.7) nile; urgency=medium + + * 规范数据上传的格式 + + -- jiaodian Thu, 16 Nov 2023 15:36:06 +0800 + +ukui-window-switch (4.0.0.0-ok0.6) yangtze; urgency=medium + + * 增加走焦所在区域的数据埋点 + + -- jiaodian Thu, 16 Nov 2023 09:41:45 +0800 + +ukui-window-switch (4.0.0.0-ok0.5) yangtze; urgency=medium + + * 增加数据埋点功能 + + -- jiaodian Tue, 14 Nov 2023 16:28:14 +0800 + +ukui-window-switch (4.0.0.0-ok0.4) yangtze; urgency=medium + + * 增加维,哈,柯,蒙,藏,繁体语言支持 + + -- jiaodian Fri, 10 Nov 2023 09:33:31 +0800 + +ukui-window-switch (4.0.0.0-ok0.3) yangtze; urgency=medium + + * 优化走焦逻辑:多任务视图首次按键激活走焦框,应用区上下箭头键增加首尾循环导航 + + -- jiaodian Thu, 02 Nov 2023 16:58:27 +0800 + +ukui-window-switch (4.0.0.0-ok0.2) yangtze; urgency=medium + + * 修改打开多任务视图,开始菜单等窗口不关闭的问题 + + -- jiaodian Mon, 17 Jul 2023 17:41:40 +0800 + +ukui-window-switch (4.0.0.0-ok0.1build2) yangtze; urgency=medium + + * rebuild for build error + + -- pangyi Tue, 16 May 2023 11:04:05 +0800 + +ukui-window-switch (4.0.0.0-ok0.1build1) yangtze; urgency=medium + + * rebuild for build error + + -- pangyi Tue, 16 May 2023 10:11:08 +0800 + +ukui-window-switch (4.0.0.0-ok0.1) yangtze; urgency=medium + + * 简化多任务视图前端代码,去除过度封装代码 + + -- pangyi Tue, 16 May 2023 09:10:53 +0800 + +ukui-window-switch (4.0.0.0-ok0.0) yangtze; urgency=medium + + * upstream version 4.0.0.0 + + -- zouxiaoyi Wed, 12 Apr 2023 18:58:19 +0800 + +ukui-window-switch (3.22.1.4-ok1.7build1) yangtze; urgency=medium + + * 完善走焦映射判断逻辑 close: #I5XHDA, #I5XHGH + * rebuild with new version of kwin + + -- zouxiaoyi Wed, 04 Jan 2023 17:54:43 +0800 + +ukui-window-switch (3.22.1.4-ok1.7) yangtze; urgency=medium + + * 完善走焦映射判断逻辑 close: #I5XHDA, #I5XHGH + + -- zouxiaoyi Fri, 16 Dec 2022 17:01:44 +0800 + +ukui-window-switch (3.22.1.4-ok1.6) yangtze; urgency=medium + + * rebuild for kwin updates; + + -- zouxiaoyi Thu, 08 Dec 2022 20:46:38 +0800 + +ukui-window-switch (3.1.1.0-ok1.5build1) yangtze; urgency=medium + + * rebuild for kwin updates; + + -- zouxiaoyi Wed, 30 Nov 2022 11:30:48 +0800 + +ukui-window-switch (3.1.1.0-ok1.5) yangtze; urgency=medium + + * fix draw background picture failed + * fix thumbnails cover the upper and lower boundaries + * fix the animation effects + + -- zouxiaoyi Wed, 23 Nov 2022 14:09:00 +0800 + +ukui-window-switch (3.1.1.0-ok1.4) yangtze; urgency=medium + + * fix that signals does not work on PC mode; + * fix 3 states of close button on PC mode; + + -- zouxiaoyi Fri, 21 Oct 2022 14:09:00 +0800 + +ukui-window-switch (3.1.1.0-ok1.3) yangtze; urgency=medium + + * use blacklist to filter windows + + -- zouxiaoyi Fri, 21 Oct 2022 10:43:59 +0800 + +ukui-window-switch (3.1.1.0-ok1.2) yangtze; urgency=medium + + * add build dependence; + + -- zouxiaoyi Thu, 20 Oct 2022 16:59:57 +0800 + +ukui-window-switch (3.1.1.0-ok1.1) yangtze; urgency=medium + + * new upstream 3.1.1.0 + + -- zouxiaoyi Thu, 20 Oct 2022 16:17:43 +0800 + +ukui-window-switch (3.1.0.0k2.16-ok2~0719) yangtze; urgency=medium + + * build for openKylin + * Ignore some utility windows; + + -- Xie Wei Sun, 19 Jun 2022 14:52:01 +0800 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000000000000000000000000000000000000..dbbb8d2138bd5cdb36144b1ec0148c113dc1b4dc --- /dev/null +++ b/debian/control @@ -0,0 +1,51 @@ +Source: ukui-window-switch +Section: utils +Priority: optional +Maintainer: UKUI SIG +Uploaders:zhangyuanyuan +Build-Depends: cmake, + debhelper-compat (= 12), + extra-cmake-modules, + libdrm-dev, + libfontconfig1-dev, + libfreetype6-dev, + libglib2.0-dev, + libgsettings-qt-dev, + libkf5config-dev, + libkf5coreaddons-dev, + libkf5globalaccel-dev, + libkf5wayland-dev, + libkf5windowsystem-dev, + libkysdk-sysinfo-dev, + libkysdk-waylandhelper-dev(>= 3.0.1.0-0k0.5), + libmtdev-dev, + libqt5x11extras5-dev, + libxcb-composite0-dev, + libxcb-damage0-dev, + libxcb1-dev, + libxrender-dev, + libkysdk-datacollect-dev, + qtbase5-dev, + qtbase5-private-dev, + qtdeclarative5-dev, + qtdeclarative5-private-dev, + qttools5-dev, + qttools5-dev-tools, + kylin-wayland-compositor-client(>= 1.3.1.0-0k0.14), + libukui-quick-dev(>= 4.20.3.1-ok0.1k0.16), + libukui-search-dev, + libqt5xdg-dev +Standards-Version: 4.6.0 +Homepage: https://gitee.com/openkylin/ukui-window-switch.git +Vcs-Browser: https://gitee.com/openkylin/ukui-window-switch.git +Vcs-Git: https://gitee.com/openkylin/ukui-window-switch.git + +Package: ukui-window-switch +Architecture: any +Depends: ${misc:Depends}, ${shlibs:Depends}, + qml-module-org-ukui-quick-items, + qml-module-org-ukui-quick-platform +Description: UKUI Multitask View Package + This package provides a Multitask View function. + Users can use it to delete or activate other windows, + and it can also be used to control the workspace. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000000000000000000000000000000000000..be296a2473359a7a0f6a70838be0fae42a51aea1 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,56 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: ukui-window-switch +Source: https://gitee.com/openkylin/ukui-window-switch + +Files: * +Copyright: 2022, 2024, KylinSoft Co., Ltd. + 2022, zouxiaoyi zouxiaoyi@kylinos.cn + 2022, zhuyunpeng zhuyunpeng@kylinos.cn + 2022, liling liling@kylinos.cn + 2022, jiaodian jiaodian@kylinos.cn + 2022, pangyi pangyi@kylinos.cn + 2024, zy1 zhangyuanyuan1@kylinos.cn +License: LGPL-2+ + +Files: windowsview/appwindowfiltermodel.cpp + windowsview/appwindowfiltermodel.h + windowsview/appwindowlistmodel.cpp + windowsview/appwindowlistmodel.h + windowsview/desktoplistmodel.cpp + windowsview/desktoplistmodel.h +Copyright: 2024, KylinSoft Co., Ltd. +License: GPL-3+ + +Files: windowsview/qml/LineEdit.qml +Copyright: 2024, KylinSoft Co., Ltd. +License: GPL-3+ + +Files: windowsview/ukui-flow.cpp + windowsview/ukui-flow.h +Copyright: 2025, KylinSoft Co., Ltd. + 2016, The Qt Company Ltd. +License: GPL-2 or LGPL-3 + +Files: windowsview/ukui-window-switch-wlcom/log-utils.cpp + windowsview/ukui-window-switch-wlcom/log-utils.h +Copyright: 2024, KylinSoft Co., Ltd. +License: GPL-3+ + +Files: windowsview/ukui-window-switch-wlcom/qtsingleapplication/* +Copyright: 2013, Digia Plc and/or its subsidiary(-ies). +License: BSD-3-clause + +Files: windowswitchers/thumbnail_grid/contents/* +Copyright: 2020, Chris Holland +License: GPL-2+ + +License: LGPL-2+ + This software is Copyright (c) 2022 by KylinSoft Co., Ltd. + This is free software, licensed under: + The GNU Library General Public License, Version 2, June 1991 + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published by the + Free Software Foundation; version 2 of the License, or (at + your option) any later version. + On Debian systems, the complete text of version 2 of the GNU Library + General Public License can be found in '/usr/share/common-licenses/LGPL-2'. diff --git a/debian/postinst b/debian/postinst new file mode 100644 index 0000000000000000000000000000000000000000..c1cd3d39c7157ecd997fb3bbdc2ca4b9122bf758 --- /dev/null +++ b/debian/postinst @@ -0,0 +1,43 @@ +#!/bin/sh +# postinst script for ukui-window-switch +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-remove' +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see https://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + configure) + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +if [ -f /usr/bin/ukui-window-switch ]; then + chmod a+x /usr/bin/ukui-window-switch +fi + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000000000000000000000000000000000000..e1c367c12388dca85fb368ef66b356702f03a77a --- /dev/null +++ b/debian/rules @@ -0,0 +1,25 @@ +#!/usr/bin/make -f +# See debhelper(7) (uncomment to enable) +# output every command that modifies files on the build system. +#export DH_VERBOSE = 1 + + +# see FEATURE AREAS in dpkg-buildflags(1) +#export DEB_BUILD_MAINT_OPTIONS = hardening=+all + +# see ENVIRONMENT in dpkg-buildflags(1) +# package maintainers to append CFLAGS +#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic +# package maintainers to append LDFLAGS +#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed + + +%: + dh $@ + + +# dh_make generated override targets +# This is example for Cmake (See https://bugs.debian.org/641051 ) +#override_dh_auto_configure: +# dh_auto_configure -- # -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH) + diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000000000000000000000000000000000000..89ae9db8f88b823b6a7eabf55e203658739da122 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/debian/ukui-window-switch.manpages b/debian/ukui-window-switch.manpages new file mode 100644 index 0000000000000000000000000000000000000000..dead3fcb5a0ca940e407aa41d01c1337bf2acb7e --- /dev/null +++ b/debian/ukui-window-switch.manpages @@ -0,0 +1 @@ +man/ukui-window-switch.1 diff --git a/man/ukui-window-switch.1 b/man/ukui-window-switch.1 new file mode 100644 index 0000000000000000000000000000000000000000..d8d37eb58385c10be6c337520739cad6ab80660a --- /dev/null +++ b/man/ukui-window-switch.1 @@ -0,0 +1,19 @@ +.\" Man Page for ukui-window-switch +.TH ukui-window-switch 1 "26 July 2023" "UKUI Desktop Environment" +.SH "NAME" +ukui-window-switch - use it to switch windows +.SH "SYNOPSIS" +Open the multitaskView. +.SH "DESCRIPTION" +The user can press the win+tab key to open the multitaskView. +User can used it to delete or activate other windows, +and it can also be used to control the workspace. +.TP +\fB --show-workspace\fR +Open the multitaskView. +.SH "BUGS" +.SS Should you encounter any bugs, they may be reported at: +https://gitee.com/openkylin/ukui-window-switch/issues +.SH "AUTHORS" +.SS This Manual Page has been written for the UKUI Desktop Environment by: +Dian Jiao (2023) diff --git a/windowsview/CMakeLists.txt b/windowsview/CMakeLists.txt index ad127e398d26faaf23e5448b75100b45906746d3..61c342f54ee375d788382b3887cf2321ed303457 100644 --- a/windowsview/CMakeLists.txt +++ b/windowsview/CMakeLists.txt @@ -1,65 +1,19 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.16) -set(PLUGIN_NAME "windowsview") -set(PLASMA_RELATIVE_DATA_INSTALL_DIR "plasma") +find_package(QT NAMES Qt6 Qt5 COMPONENTS LinguistTools REQUIRED) +find_package(Qt${QT_VERSION_MAJOR} COMPONENTS LinguistTools REQUIRED) -set(CMAKE_INCLUDE_CURRENT_DIR ON) -set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTOUIC ON) -set(CMAKE_AUTORCC ON) +file(GLOB TS_FILES translations/*.ts) +set_source_files_properties(${TS_FILES} PROPERTIES OUTPUT_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/translations) +qt5_create_translation(QM_FILES ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/ukui-window-switch-wlcom ${CMAKE_CURRENT_SOURCE_DIR}/ukui-window-switch-kwineffect ${CMAKE_CURRENT_SOURCE_DIR}/qml ${TS_FILES} OPTIONS -no-obsolete -no-ui-lines) -set(CMAKE_CXX_STANDARD 14) -set(CMAKE_CXX_STANDARD_REQUIRED ON) +add_custom_target(generate_qm ALL DEPENDS ${QM_FILES}) -set(KF5_DEP_VERSION "5.54.0") +set(TRANSLATION_DIR "/usr/share/ukui-window-switch/translations/") +add_compile_definitions(TRANSLATION_DIR="${TRANSLATION_DIR}") -find_package(ECM 5.54.0 NO_MODULE) -find_package(X11 MODULE) -find_package(XCB MODULE COMPONENTS XCB COMPOSITE DAMAGE SHAPE XFIXES RENDER) -find_package(OpenGL) -find_package(EGL) -find_package(Qt5Quick REQUIRED) -find_package(Qt5QuickWidgets REQUIRED) -find_package(KF5Config REQUIRED) -find_package(KF5GlobalAccel REQUIRED) -find_package(KF5I18n REQUIRED) -find_package(PkgConfig REQUIRED) -find_package(Qt5LinguistTools REQUIRED) - -find_package(Qt5 REQUIRED NO_MODULE COMPONENTS X11Extras) - -set(SRCS desktopbackground.cpp - icontheme.cpp - multitaskviewmodel.cpp - multitaskviewmanager.cpp - dbusservice.cpp - multitaskviewmanagerpluginfactory.cpp - ) - -qt5_add_resources(SRCS data.qrc) -add_library( - ${PLUGIN_NAME} MODULE - ${SRCS} -) - -include_directories(/usr/include/kwin/) - -target_link_libraries( - ${PLUGIN_NAME} - PUBLIC - Qt5::Core - Qt5::Gui - Qt5::Widgets - Qt5::Quick - Qt5::QuickWidgets - PRIVATE - KF5::ConfigCore - KF5::WindowSystem - KF5::CoreAddons - KF5::GlobalAccel - Qt5::X11Extras - ${QGSettings_LIBRARIES} -) - -install(TARGETS ${PLUGIN_NAME} DESTINATION ${INSTALL_PATH}) -install(FILES ukui-window-switch DESTINATION /usr/bin/ ) +#add_subdirectory(ukui-window-switch-kwineffect) +add_subdirectory(ukui-window-switch-wlcom) +install(FILES ukui-window-switch DESTINATION /usr/bin/) +install(FILES ukui-window-switch.desktop DESTINATION /etc/xdg/autostart/) +install(FILES ${QM_FILES} DESTINATION ${TRANSLATION_DIR}) diff --git a/windowsview/appwindowfiltermodel.cpp b/windowsview/appwindowfiltermodel.cpp new file mode 100644 index 0000000000000000000000000000000000000000..af9b6c590fb8e84fd9ba20174a35b7c25eeafdc9 --- /dev/null +++ b/windowsview/appwindowfiltermodel.cpp @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2024, KylinSoft Co., Ltd. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * Authors: zy-yuan1 + * + */ +#include "appwindowfiltermodel.h" +#include + +AppWindowFilterModel::AppWindowFilterModel(QObject *parent) : QSortFilterProxyModel(parent) +{ + setFilterRole(AppWindowListModel::DesktopsId); +} + +void AppWindowFilterModel::setSourceModel(QAbstractItemModel *sourceModel) +{ + m_sourceModel = qobject_cast(sourceModel); + QSortFilterProxyModel::setSourceModel(sourceModel); + connect(sourceModel, &QAbstractItemModel::dataChanged, this, &AppWindowFilterModel::onDataChanged); +} + +int AppWindowFilterModel::desktopId() const +{ + return m_desktopId; +} + +void AppWindowFilterModel::setDesktopId(const int id) +{ + if (m_desktopId == id) { + return; + } + m_desktopId = id; + invalidate(); +} + +int AppWindowFilterModel::screenId() const +{ + return m_screenId; +} + +void AppWindowFilterModel::setScreenId(const int id) +{ + if (m_screenId == id) { + return; + } + m_screenId = id; + invalidate(); +} + +bool AppWindowFilterModel::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const +{ + QList desktopsId = m_sourceModel->index(source_row, 0, source_parent).data(AppWindowListModel::Role::DesktopsId).value >(); + int screenId = m_sourceModel->index(source_row, 0, source_parent).data(AppWindowListModel::Role::ScreenId).toUInt(); + return desktopsId.contains(m_desktopId) && screenId == m_screenId; +} + +void AppWindowFilterModel::onDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector &roles) +{ + Q_EMIT dataChanged(mapFromSource(topLeft), mapFromSource(bottomRight), roles); +} diff --git a/windowsview/appwindowfiltermodel.h b/windowsview/appwindowfiltermodel.h new file mode 100644 index 0000000000000000000000000000000000000000..44db22cd71a591565e4376ce276740ad78b91881 --- /dev/null +++ b/windowsview/appwindowfiltermodel.h @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024, KylinSoft Co., Ltd. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * Authors: zy-yuan1 + * + */ +#ifndef APPWINDOWFILTERMODEL_H +#define APPWINDOWFILTERMODEL_H + +#include +#include +#include "appwindowlistmodel.h" + +class AppWindowFilterModel : public QSortFilterProxyModel +{ + Q_OBJECT + Q_PROPERTY(int desktopId READ desktopId WRITE setDesktopId) + Q_PROPERTY(int screenId READ screenId WRITE setScreenId) + +public: + explicit AppWindowFilterModel(QObject *parent = nullptr); + ~AppWindowFilterModel() = default; + Q_INVOKABLE void setSourceModel(QAbstractItemModel *sourceModel) override; + + int desktopId() const; + void setDesktopId(const int id); + int screenId() const; + void setScreenId(const int id); + +protected: + bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override; + +private: + void onDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector &roles = QVector()); + + AppWindowListModel *m_sourceModel = nullptr; + int m_desktopId = 1; + int m_screenId = 0; +}; + +#endif // APPWINDOWFILTERMODEL_H diff --git a/windowsview/appwindowlistmodel.cpp b/windowsview/appwindowlistmodel.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6a07c69b86f884f6a70c10fcaadeb6f4f588c8bd --- /dev/null +++ b/windowsview/appwindowlistmodel.cpp @@ -0,0 +1,276 @@ +/* + * Copyright (C) 2024, KylinSoft Co., Ltd. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * Authors: zy-yuan1 + * + */ +#include "appwindowlistmodel.h" +#include "windowmanagerinterface.h" +#include +#include + + +AppWindowListModel::AppWindowListModel(QObject *parent) : QAbstractListModel(parent) +{ + connectSignals(); + loadWindows(); +} + +void AppWindowListModel::connectSignals() +{ + QObject::connect(WindowManagerInterface::getInstance(), &WindowManagerInterface::appWindowRemoved, + this, &AppWindowListModel::onAppWindowRemoved); + + QObject::connect(WindowManagerInterface::getInstance(), &WindowManagerInterface::appWindowDesktopChanged, + this, &AppWindowListModel::onAppWindowDesktopChanged); + + QObject::connect(WindowManagerInterface::getInstance(), &WindowManagerInterface::desktopMoved, + this, &AppWindowListModel::onDesktopMoved); + + QObject::connect(WindowManagerInterface::getInstance(), &WindowManagerInterface::desktopRemoved, + this, &AppWindowListModel::onDesktopRemoved); + QObject::connect(WindowManagerInterface::getInstance(), &WindowManagerInterface::appWindowAdd, + this, &AppWindowListModel::onAppWindowAdd); + QObject::connect(WindowManagerInterface::getInstance(), &WindowManagerInterface::appWindowActivated, + this, &AppWindowListModel::onAppWindowActived); + QObject::connect(WindowManagerInterface::getInstance(), &WindowManagerInterface::appWindowUpdated, + this, &AppWindowListModel::onAppWindowUpdated); +} + +int AppWindowListModel::rowCount(const QModelIndex &parent) const +{ + return m_windowList.count(); +} + +QVariant AppWindowListModel::data(const QModelIndex &index, int role) const +{ + int i = index.row(); + if (i < 0 || i >= m_windowList.count()) { + return QVariant(); + } + Window window = m_windowList.at(i); + switch (static_cast(role)) { + case Role::Id: + return window.id(); + case Role::Uuid: + return window.uuid(); + case Role::Caption: + return window.caption(); + case Role::X: + return window.x(); + case Role::Y: + return window.y(); + case Role::Width: + return window.width(); + case Role::Height: + return window.height(); + case Role::Minimized: + return window.minimized(); + case Role::DesktopsId: + return QVariant::fromValue >(window.desktopsId()); + case Role::ScreenId: + return window.screenId(); + case Role::Icon: + return window.icon(); + default: + return {}; + } +} + +bool AppWindowListModel::setData(const QModelIndex &index, const QVariant &value, int role) +{ + if (!index.isValid()) { + return false; + } + + if (role == Role::DesktopsId) { + m_windowList[index.row()].setDesktopsId(value.value >()); + Q_EMIT dataChanged(index, index, QVector{Role::DesktopsId}); + return true; + } else if (role == Role::ScreenId) { + m_windowList[index.row()].setScreenId(Desktop::DesktopType(value.toInt())); + Q_EMIT dataChanged(index, index, QVector{Role::ScreenId}); + return true; + } + + return false; +} + +QHash AppWindowListModel::roleNames() const +{ + QHash roles = QAbstractItemModel::roleNames(); + QMetaEnum e = metaObject()->enumerator(metaObject()->indexOfEnumerator("Role")); + + for (int i = 0; i < e.keyCount(); ++i) { + roles.insert(e.value(i), e.key(i)); + } + return roles; +} + +void AppWindowListModel::loadWindows() +{ + beginResetModel(); + m_windowList.clear(); + for (const Window &appwindow : getAllAppWindowList()) { + m_windowList.append(appwindow); + } + endResetModel(); +} + +void AppWindowListModel::addItem(Window window) +{ + beginInsertRows(QModelIndex(), 0, 0); + m_windowList.prepend(window); + endInsertRows(); +} + +void AppWindowListModel::onAppWindowRemoved(QString windowId) +{ + for (int index = 0; index < m_windowList.size(); ++index) { + auto item = m_windowList.at(index); + if (item.uuid() == windowId) { + beginRemoveRows(QModelIndex(), index, index); + m_windowList.removeAt(index); + endRemoveRows(); + break; + } + } +} + +void AppWindowListModel::onAppWindowDesktopChanged(QString windowId, int oldDesktopIndex, int newDesktopIndex) +{ + for (int i = 0; i < m_windowList.size(); ++i) { + auto &item = m_windowList.at(i); + if (item.uuid() == windowId) { + m_windowList[i].setDesktopsId(QList{ newDesktopIndex }); + Q_EMIT dataChanged(index(i, 0), index(i, 0), QVector{Role::DesktopsId}); + break; + } + } +} + +void AppWindowListModel::onDesktopMoved(int oldDesktopIndex, int newDesktopIndex) +{ +#ifdef KWINEFFECT + //x-kwin would emit signal 'appWindowDesktopChanged', model has changed in function 'onAppWindowDesktopChanged'. + return; +#endif + for (int i = 0; i < m_windowList.size(); ++i) { + auto &item = m_windowList.at(i); + QList desktops = item.desktopsId(); + if (desktops.contains(oldDesktopIndex) && desktops.contains(newDesktopIndex)) { + continue; + } + if (desktops.contains(oldDesktopIndex)) { + int ind = desktops.indexOf(oldDesktopIndex); + desktops.replace(ind, newDesktopIndex); + } else if (desktops.contains(newDesktopIndex)) { + int ind = desktops.indexOf(newDesktopIndex); + desktops.replace(ind, oldDesktopIndex); + } else { + continue; + } + + m_windowList[i].setDesktopsId(desktops); + Q_EMIT dataChanged(index(i, 0), index(i, 0), QVector{Role::DesktopsId}); + } +} + +void AppWindowListModel::onDesktopRemoved(int desktopIndex) +{ + //只需要处理desktopId > desktopIndex的情况, + //desktopId < desktopIndex时,不影响窗口所在工作区的索引值 + //desktopId = desktopIndex时,在onAppWindowDesktopChanged中处理 + bool changeFlag; + for (int i = 0; i < m_windowList.size(); ++i) { + changeFlag = false; + auto &item = m_windowList.at(i); + QList desktops = item.desktopsId(); + for (int i = 0; i < desktops.size(); ++i) { + if (desktops.at(i) > desktopIndex) { + changeFlag = true; + desktops[i] -=1; + } + #ifdef KWINEFFECT + //x-kwin not emit signal 'appWindowDesktopChanged' when removeDesktop, handle here. + if (desktops.at(i) == desktopIndex) { + changeFlag = true; + desktops[i] = desktopIndex - 1 > 0 ? desktopIndex - 1 : 1; + } + #endif + } + if (changeFlag) { + m_windowList[i].setDesktopsId(desktops); + Q_EMIT dataChanged(index(i, 0), index(i, 0), QVector{Role::DesktopsId}); + } + } +} + +void AppWindowListModel::onAppWindowAdd(const Window &window) +{ + qDebug() << "onAppWindowAdd window.caption" << window.caption(); + addItem(window); +} + +void AppWindowListModel::onAppWindowActived() +{ + loadWindows(); +} + +void AppWindowListModel::onAppWindowUpdated(const Window &window) +{ + for (int i = 0; i < m_windowList.size(); ++i) { + auto &item = m_windowList.at(i); + if (item.uuid() == window.uuid()) { + m_windowList.replace(i, window); + Q_EMIT dataChanged(index(i, 0), index(i, 0)); + break; + } + } +} + +// TODO: remove? +QVariant AppWindowListModel::getItemData(const QModelIndex &index) +{ + int i = index.row(); + if (i >= 0 && i < m_windowList.count()) { + return QVariant::fromValue(m_windowList.at(i)); + } else { + return QVariant(); + } +} + +QList AppWindowListModel::getAllAppWindowList() const +{ + QList allAppWindowList; + for(int desktopIndex = 1; desktopIndex <= WindowManagerInterface::getInstance()->getNumberOfDesktops(); desktopIndex++) { + for (int screenIndex = 0; screenIndex < WindowManagerInterface::getInstance()->logicalScreenCount(); screenIndex++) { + QList windowList; + windowList = WindowManagerInterface::getInstance()->createWindowList(desktopIndex, screenIndex); + for (int i = windowList.size() - 1; i >= 0; --i) { + for (const auto &wind : allAppWindowList) { + if (wind.uuid() == windowList[i].uuid()) { + windowList.removeAt(i); + break; + } + } + } + std::reverse(windowList.begin(), windowList.end()); + allAppWindowList += windowList; + } + } + return allAppWindowList; +} diff --git a/windowsview/appwindowlistmodel.h b/windowsview/appwindowlistmodel.h new file mode 100644 index 0000000000000000000000000000000000000000..43ee70795c6e22961de295bca5af56d0e93d383e --- /dev/null +++ b/windowsview/appwindowlistmodel.h @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2024, KylinSoft Co., Ltd. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * Authors: zy-yuan1 + * + */ +#ifndef APPWINDOWLISTMODEL_H +#define APPWINDOWLISTMODEL_H + +#include +#include +#include +#include "multitaskviewabstractmodelhandler.h" + +class Window; +class AppWindowListModel : public QAbstractListModel +{ + Q_OBJECT + +public: + enum Role { + Id = Qt::UserRole + 1, + Uuid, + Caption, + X, + Y, + Width, + Height, + Minimized, + DesktopsId, + ScreenId, + Icon + }; + Q_ENUM(Role) + + explicit AppWindowListModel(QObject *parent = nullptr); + ~AppWindowListModel() = default; + + int rowCount(const QModelIndex &parent = QModelIndex()) const override; + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; + bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override; + QHash roleNames() const override; + + + /* for TabletView + * qml里无法直接读取QMap,需要使用iterator,因此使用QVariant::fromValve(window) + * TODO: TabletView 加载动画优化 + */ + Q_INVOKABLE QVariant getItemData(const QModelIndex &index); + +private: + void connectSignals(); + void loadWindows(); + void addItem(Window window); + QList getAllAppWindowList() const; + + QList m_windowList; + +private Q_SLOTS: + void onAppWindowRemoved(QString windowId); + void onAppWindowDesktopChanged(QString windowId, int oldDesktopIndex, int newDesktopIndex); + void onDesktopMoved(int oldDesktopIndex, int newDesktopIndex); + void onDesktopRemoved(int desktopIndex); + void onAppWindowAdd(const Window &window); + void onAppWindowActived(); + void onAppWindowUpdated(const Window &window); +}; + +#endif // APPWINDOWLISTMODEL_H diff --git a/windowsview/data.qrc b/windowsview/data.qrc index c93b1f0ee75ad5a4c62e570d8cdbe3a171776274..2a2f482ab056c4f965497021b35f7f86081068be 100644 --- a/windowsview/data.qrc +++ b/windowsview/data.qrc @@ -1,26 +1,32 @@ qml/Controller.js - qml/TabletController.js - images/default-background.jpg images/all-clean-click.svg images/all-clean-default.svg images/all-clean-hover.svg images/ukui-taskview-close-click.svg images/ukui-taskview-close-default.svg images/ukui-taskview-close-hover.svg - qml/PreviewWindow.qml - qml/multitaskview.qml + qml/AppPreviewWindow.qml + qml/MasterDesktopArea.qml + qml/MultitaskView.qml qml/AppArea.qml qml/DesktopArea.qml - qml/TabletMultitaskView.qml - qml/TabletViewRootWindow.qml - qml/TabletScrollViewArea.qml qml/TabletPreviewWindow.qml images/tablet_delete.svg qml/TabletViewMain.qml - qml/TabletViewClearAllWindowButton.qml qml/TabletViewCloseButton.qml qml/CloseButton.qml + qml/ArrowButton.qml + images/icon-arrow-white.svg + images/icon-arrow-black.svg + qml/VirtualDesktopWindow.qml + qml/NewDesktopButton.qml + qml/ThumbnailWithKwin.qml + qml/Tabbox.qml + qml/ThumbnailWithWlcom.qml + qml/WorkSpaceThumbnailWithWlcom.qml + qml/WorkSpaceThumbnailWithKwin.qml + qml/LineEdit.qml diff --git a/windowsview/dbusservice.cpp b/windowsview/dbusservice.cpp deleted file mode 100644 index c7b6d19c14620e9db5adc8d6bf8ad0d5eeb8b519..0000000000000000000000000000000000000000 --- a/windowsview/dbusservice.cpp +++ /dev/null @@ -1,42 +0,0 @@ -#include "dbusservice.h" - -#include "multitaskviewmanager.h" - -namespace MultitaskView { - -DBusService::DBusService(MultitaskViewManager *viewManager, QObject *parent) - : QObject(parent), - viewManager_(viewManager), - connection_(QDBusConnection::sessionBus()) -{ - startService(); -} - -DBusService::~DBusService() -{ - stopService(); -} - -bool DBusService::startService() -{ - return connection_.registerService(serviceName_) - && connection_.registerObject(servicePath_, this, QDBusConnection::ExportAllSlots); -} - -bool DBusService::stopService() -{ - connection_.unregisterObject(servicePath_); - return connection_.unregisterService(serviceName_); -} - -void DBusService::show() -{ - viewManager_->open(); -} - -void DBusService::hide() -{ - viewManager_->close(); -} - -} // namespace MultitaskView diff --git a/windowsview/desktopbackground.cpp b/windowsview/desktopbackground.cpp index 61117a18f5b3a438b8a5e06d274715c9d43bf179..a8243a2fa74782bc81782f1221c849a844878ae5 100644 --- a/windowsview/desktopbackground.cpp +++ b/windowsview/desktopbackground.cpp @@ -1,3 +1,22 @@ +/* + * Copyright (C) 2022, KylinSoft Co., Ltd. + + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + #include "desktopbackground.h" #include @@ -5,23 +24,35 @@ #include #include #include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include //! 默认的最大虚化程度 #define MAX_BLUR_ALPHA 20 -//! 背景文件获取失败时,默认加载的背景 -#define DEFAULT_BACKGROUND ":/images/default-background.jpg" -const QString backgroundSchemaUrl = "org.mate.background"; -const QString fillStyleKeyName = "pictureOptions"; +static const QString backgroundSchemaUrl = "org.mate.background"; +static const QString fillStyleKeyName = "pictureOptions"; +static const QString fileNameKeyName = "pictureFilename"; QImage DesktopBackground::m_blurBackground; QImage DesktopBackground::m_nonBlurBackground; quint32 DesktopBackground::m_blurRadius = 0; +static int backgroundNum = 0; DesktopBackground::DesktopBackground(QQuickPaintedItem *parent) : QQuickPaintedItem(parent) , m_blurAlpha(0) { + backgroundNum++; QElapsedTimer timer; timer.start(); setFlag(ItemHasContents); @@ -31,10 +62,7 @@ DesktopBackground::DesktopBackground(QQuickPaintedItem *parent) DesktopBackground::~DesktopBackground() { - if (!m_blurBackground.isNull()) - m_blurBackground = QImage(); - if (!m_nonBlurBackground.isNull()) - m_nonBlurBackground = QImage(); + backgroundNum --; m_blurRadius = 0; } @@ -42,12 +70,32 @@ void DesktopBackground::init() { connect(this, &DesktopBackground::blurAlphaChanged, this, &DesktopBackground::onBlurAlphaChanged); - m_backgroundFile = getBackgroundFile(); - if(m_backgroundFile == ""){ - qWarning() << "未获取到背景图片!"; - m_backgroundFile = DEFAULT_BACKGROUND; + const QByteArray id("org.mate.background"); + if(QGSettings::isSchemaInstalled(id)){ + QGSettings * backgSetting = new QGSettings(id, QByteArray(), this); + connect(backgSetting, &QGSettings::changed,[=](QString key) { + if ("pictureFilename" == key || "primaryColor" == key) { + m_usePureColor = getBackgroundFile().isEmpty(); + if (!m_usePureColor) { + return; + } + m_pureColor = getBackgroundPrimaryColor(); + update(); + } + }); } + + m_backgroundFile = getBackgroundFile(); m_backgroundFillStyle = getBackgroundFillStyle(); + + if (m_backgroundFile == "") { + // no background file, use pure color + qWarning() << "[Multitask]: 未获取到背景图片!"; + m_usePureColor = true; + m_pureColor = getBackgroundPrimaryColor(); + return; + } + m_scalingFactor = getSystemScalingFactor(); if (m_nonBlurBackground.isNull()) { @@ -63,12 +111,12 @@ void DesktopBackground::init() void DesktopBackground::setBlurAlpha(qreal alpha) { - if(alpha < 0 || alpha > 1) + if(alpha < 0 || alpha > 1) { return; + } m_blurAlpha = alpha; quint32 blur_radius = qRound(m_blurAlpha * MAX_BLUR_ALPHA); - if (blur_radius != 0 && m_blurRadius != blur_radius) - { + if (blur_radius != 0 && m_blurRadius != blur_radius) { m_blurRadius = qRound(m_blurAlpha * MAX_BLUR_ALPHA); emit blurAlphaChanged(); } @@ -90,17 +138,14 @@ QRect DesktopBackground::scaledRect(const QImage &image) if (widthShorter) { scaledAspectRatio = qreal(boundingRect().height()) / qreal(boundingRect().width()); } - qreal shorterEdge = widthShorter ? width : height; qreal longerEdge = widthShorter ? height : width; - while (shorterEdge > 1) { qint32 temp = qFloor(shorterEdge * scaledAspectRatio); if (temp <= longerEdge) { longerEdge = temp; break; } - qint32 spacing = qRound(shorterEdge / 20); if (spacing <= 0) { spacing = 1; @@ -113,94 +158,265 @@ QRect DesktopBackground::scaledRect(const QImage &image) scaledSize.setWidth(widthShorter ? shorterEdge : longerEdge); scaledSize.setHeight(widthShorter ? longerEdge : shorterEdge); } - qint32 offsetX = 0; qint32 offsetY = 0; if (image.width() > scaledSize.width()) { offsetX = (image.width() - scaledSize.width()) / 2; } - if (image.height() > scaledSize.height()) { offsetY = (image.height() - scaledSize.height()) / 2; } - QPoint offsetPoint = image.rect().topLeft(); offsetPoint += QPoint(offsetX, offsetY); - return QRect(offsetPoint, scaledSize); } +QRect DesktopBackground::getDestRect(const QImage &image, const QRectF &desktopRect) +{ + qreal screenScale = qreal(desktopRect.width()) / desktopRect.height(); + qreal pixmapScale = qreal(image.width() / image.height()); + qreal width = image.width(); + qreal height = image.height(); + if (qFuzzyCompare(pixmapScale, screenScale)) { + return QRect(0, 0, desktopRect.width(), desktopRect.height()); + } + qreal scaleWidth = desktopRect.width() / width; + qreal scaleHeight = desktopRect.height() / height; + qreal realPixmapWidth = 0; + qreal realPixmapHeight = 0; + if (pixmapScale < screenScale) { + //图片比例小于屏幕比例时,按照图片和屏幕高度比进行缩放 + realPixmapWidth = width * scaleHeight; + realPixmapHeight = desktopRect.height(); + } else { + //图片比例大于屏幕比例时,按照图片与屏幕宽度比进行缩放 + realPixmapWidth = desktopRect.width(); + realPixmapHeight = height * scaleWidth; + } + + QSize sourceSize(desktopRect.width(), desktopRect.height()); + qint32 offsetX = 0; + qint32 offsetY = 0; + if (desktopRect.width() == realPixmapWidth) { + offsetY = (desktopRect.height() - realPixmapHeight) / 2; + sourceSize.setHeight(realPixmapHeight); + } else if (desktopRect.height() == realPixmapHeight) { + offsetX = (desktopRect.width() - realPixmapWidth) / 2; + sourceSize.setWidth(realPixmapWidth); + } + // 规避xcb下闪线的问题 + sourceSize = sourceSize - QSize(1, 1); + QPoint offsetPoint(0, 0); + offsetPoint += QPoint(offsetX, offsetY); + return QRect(offsetPoint, sourceSize); +} + +void DesktopBackground::setNonBlurBackground(const QImage &image) +{ + m_nonBlurBackground = image; +} + +void DesktopBackground::setBlurBackground(const QImage &originImage, qreal blurAlpha) +{ + m_blurBackground = BackgroundImageHandler::blurImage(blurAlpha * MAX_BLUR_ALPHA, originImage); +} + QString DesktopBackground::getBackgroundFile() { - QUrl url; + if (!QGSettings::isSchemaInstalled(backgroundSchemaUrl.toUtf8())) { + return QString(); + } + QString filePath; - QString schemaUrl = "org.mate.background"; - QString keyName = "pictureFilename"; + QGSettings gsettings(backgroundSchemaUrl.toUtf8()); + const QStringList keyList = gsettings.keys(); + if (keyList.contains(fileNameKeyName)) { + filePath = gsettings.get(fileNameKeyName).toString(); + } else { + qWarning() << "[Multitask]: inValid key name" << fileNameKeyName; + filePath = ""; + } + if (!QFile::exists(filePath)) { + // maybe desktop background picture was deleted, try AccountsService + filePath = getBackgroundFileFromAccount(); + } + return filePath; +} - if (QGSettings::isSchemaInstalled(schemaUrl.toUtf8())) { - QGSettings gsettings(schemaUrl.toUtf8()); +QString DesktopBackground::getBackgroundFileFromAccount() +{ + uid_t uid = getuid(); + QDBusInterface iface("org.freedesktop.Accounts", "/org/freedesktop/Accounts", + "org.freedesktop.Accounts", QDBusConnection::systemBus()); - const QStringList keyList = gsettings.keys(); - if (keyList.contains(keyName)) { - QString name = gsettings.get(keyName).toString(); - url = QUrl::fromLocalFile(name); - filePath = url.toString().replace(QRegExp("^file:/"), ""); - } else { - qWarning() << QString("未获取到Gesetting的键值(%1) value").arg(keyName); - return ""; + QDBusReply userPath = iface.call("FindUserById", (qint64)uid); + if(!userPath.isValid()) { + qWarning() << "[Multitask]: UserPath error" << userPath.error(); + } else { + QDBusInterface userIface("org.freedesktop.Accounts", userPath.value().path(), + "org.freedesktop.DBus.Properties", QDBusConnection::systemBus()); + QDBusReply backgroundReply = userIface.call("Get", "org.freedesktop.Accounts.User", "BackgroundFile"); + if(backgroundReply.isValid()) { + return backgroundReply.value().variant().toString(); } } - - return filePath; + return ""; } QString DesktopBackground::getBackgroundFillStyle() { + if (!QGSettings::isSchemaInstalled(backgroundSchemaUrl.toUtf8())) { + return QString(); + } + QString fillStyle; - if (QGSettings::isSchemaInstalled(backgroundSchemaUrl.toUtf8())) { - QGSettings backgroundGsetting(backgroundSchemaUrl.toUtf8()); - const QStringList keyList = backgroundGsetting.keys(); - if (keyList.contains(fillStyleKeyName)) { - fillStyle = backgroundGsetting.get(fillStyleKeyName).toString(); -// qDebug() << "MMMMMM fillStyle = " << fillStyle; - } else { - qWarning() << QString("未获取到Gesetting的键值(%1) value").arg(fillStyleKeyName); - // default to scaled - return "scaled"; - } + QGSettings gsettings(backgroundSchemaUrl.toUtf8()); + const QStringList keyList = gsettings.keys(); + if (keyList.contains(fillStyleKeyName)) { + fillStyle = gsettings.get(fillStyleKeyName).toString(); + } else { + qWarning() << "[Multitask]: inValid key name" << fillStyleKeyName; + fillStyle = "scaled"; } return fillStyle; } +QColor DesktopBackground::getBackgroundPrimaryColor() +{ + if (!QGSettings::isSchemaInstalled(backgroundSchemaUrl.toUtf8())) { + return QColor(); + } + + QGSettings gsettings(backgroundSchemaUrl.toUtf8()); + const QStringList keyList = gsettings.keys(); + if (keyList.contains("primaryColor")) { + auto color = gsettings.get("primaryColor").toString(); + return QColor(color); + } else { + qWarning() << "[Multitask]: inValid key name primaryColor"; + return QColor(Qt::color1) ; + } +} + void DesktopBackground::updateBlurBackground() { QElapsedTimer timer; timer.start(); - if (m_nonBlurBackground.isNull()) + if (m_nonBlurBackground.isNull()) { return; - - if (m_blurRadius > 0) { + } + if (m_blurRadius > 0 && m_blurBackground.isNull()) { // 重新模糊背景图片 - m_blurBackground = m_nonBlurBackground; - bluredImage(m_blurAlpha * MAX_BLUR_ALPHA, m_blurBackground); + m_blurBackground = BackgroundImageHandler::blurImage(m_blurAlpha * MAX_BLUR_ALPHA, m_nonBlurBackground); } qDebug() << "The DesktopBackground blur took" << timer.elapsed() << "milliseconds"; -// m_background.save("/home/pangyi/backgroundImage.png", "PNG"); -// m_blurBackground.save("/home/pangyi/backgroundImage1.png", "PNG"); + // m_blurBackground.save("/home/pangyi/backgroundImage.png", "PNG"); +} + +double DesktopBackground::getSystemScalingFactor() +{ + double scalingFactor = 1.5; + QString schemaUrl = "org.ukui.SettingsDaemon.plugins.xsettings"; + QString keyName = "scalingFactor"; + + if (QGSettings::isSchemaInstalled(schemaUrl.toUtf8())) { + QGSettings gsettings(schemaUrl.toUtf8()); + + const QStringList keyList = gsettings.keys(); + if (keyList.contains(keyName)) { + scalingFactor = gsettings.get(keyName).toDouble(); + // qDebug() << "MMMMMM scalingFactor = " << scalingFactor; + } else { + qWarning() << QString("未获取到Gesetting的键值(%1) value").arg(keyName); + // default + return scalingFactor; + } + } + return scalingFactor; +} + +void DesktopBackground::onBlurAlphaChanged() +{ + if(m_nonBlurBackground.isNull()) { + return; + } + updateBlurBackground(); + update(); } -int DesktopBackground::edge(int x, int i, int w) +void DesktopBackground::paint(QPainter *painter) +{ + if (m_usePureColor) { + painter->fillRect(boundingRect(), m_pureColor); + return; + } + QImage tmpImage; + if (qRound(m_blurAlpha * MAX_BLUR_ALPHA) > 0) { + tmpImage = m_blurBackground; + } else { + tmpImage = m_nonBlurBackground; + } + if (m_backgroundFillStyle == "centered") { + //居中 + // scale tmpImage to fitin Desktop Preview Window + tmpImage = tmpImage.scaled(tmpImage.width() * boundingRect().width() / qApp->screenAt(QPoint(boundingRect().center().x(), boundingRect().center().y()))->geometry().width(), + tmpImage.height() * boundingRect().height() / qApp->screenAt(QPoint(boundingRect().center().x(), boundingRect().center().y()))->geometry().height(), + Qt::KeepAspectRatioByExpanding); + painter->drawImage((boundingRect().width() - tmpImage.width()) / 2, + (boundingRect().height() - tmpImage.height()) / 2, + tmpImage); + } else if (m_backgroundFillStyle == "wallpaper") { + //平铺 + // scale tmpImage to fitin Desktop Preview Window + tmpImage = tmpImage.scaled(tmpImage.width() * boundingRect().width() / qApp->screenAt(QPoint(boundingRect().center().x(), boundingRect().center().y()))->geometry().width(), + tmpImage.height() * boundingRect().height() / qApp->screenAt(QPoint(boundingRect().center().x(), boundingRect().center().y()))->geometry().height(), + Qt::KeepAspectRatioByExpanding); + int drewWidth = 0; + int drewHeight = 0; + while (drewHeight < boundingRect().height()) { + // draw background on x-direction + while (drewWidth < boundingRect().width()) { + painter->drawImage(drewWidth, drewHeight, tmpImage); + drewWidth += tmpImage.width(); + } + // set drewWidth to 0 to start next line of drawing + drewWidth = 0; + // draw background on y-direction + drewHeight += tmpImage.height(); + } + } else if (m_backgroundFillStyle == "scaled") { + //填充 + painter->drawImage(boundingRect(), tmpImage, scaledRect(tmpImage)); + } else if (m_backgroundFillStyle == "stretched") { + //拉伸 + painter->drawImage(boundingRect(), tmpImage); + } else if (m_backgroundFillStyle == "zoom") { + //适应 + painter->drawImage(getDestRect(tmpImage, boundingRect()), tmpImage, tmpImage.rect()); + } else if (m_backgroundFillStyle == "spanned") { + //跨区 + painter->drawImage(boundingRect(), tmpImage, tmpImage.rect()); + } else { + // default to scaled + painter->drawImage(boundingRect(), tmpImage, scaledRect(tmpImage)); + } +} + + + +int BackgroundImageHandler::edge(int x, int i, int w) { // x 为中心位置, i 为偏移量, w 为图片的宽度/高度 int inx = x + i; - if(inx < 0 || inx >= w) + if(inx < 0 || inx >= w) { return x - i; - else + } else { return inx; + } } // 一维高斯函数 -float DesktopBackground::gaussFunc1D(int x, float sigma) +float BackgroundImageHandler::gaussFunc1D(int x, float sigma) { float A = 1.0f / (sigma * sqrt(2 * 3.1415f)); float index = -1.0 * (x * x) / (2 * sigma * sigma); @@ -208,31 +424,61 @@ float DesktopBackground::gaussFunc1D(int x, float sigma) } // 获取线性的权值空间 -void DesktopBackground::getKernal(int radius, float* weight) +void BackgroundImageHandler::getKernal(int radius, float* weight) { float sigma = radius / 3.0f; float sum = 0.0f; // 获取权值空间weight[] - for(int i = 0; i < 2 * radius + 1; i++) - { + for(int i = 0; i < 2 * radius + 1; i++) { weight[i] = gaussFunc1D(i - radius, sigma); sum += weight[i]; } // 归一化 - for(int i = 0; i < 2 * radius + 1; i++) - { + for(int i = 0; i < 2 * radius + 1; i++) { weight[i] /= sum; } } // 获取最终的模糊图像 -void DesktopBackground::bluredImage(int blur_radius, QImage &blurImage) +QImage BackgroundImageHandler::blurImage(int blur_radius, const QImage &image) { + QImage blurImage = image; + int imgOriginWidth = blurImage.width(); + int imgOriginHeight = blurImage.height(); + // 模糊算法优化点:对原图进行缩放 + int maxImgWidth = 1920; + if (blurImage.width() > maxImgWidth) { + int scaleRatio = qRound((qreal)blurImage.width()/maxImgWidth * 2); + blurImage = blurImage.scaled(blurImage.width()/scaleRatio, blurImage.height()/scaleRatio, Qt::KeepAspectRatio, Qt::FastTransformation); + } + + // 保证图片格式可用 + if (blurImage.format() == QImage::Format::Format_Mono || blurImage.format() == QImage::Format::Format_MonoLSB) { + blurImage.setColorCount(256); // set the color count to 256, which is 8-bit + blurImage = blurImage.convertToFormat(QImage::Format_RGB32); + } + // 原图为 originImg // 第一个方向处理的图像为tmpImg int originWidth = blurImage.width(); int originHeight = blurImage.height(); - blurImage = blurImage.scaled(400, 300, Qt::KeepAspectRatio); + int divisor = std::__gcd(originWidth, originHeight); + int blurWidth = originWidth / divisor; + int blurHeight = originHeight / divisor; + int value = 1; + if (blurWidth < 300) { + while (true) { + if ( ( value + 1 ) * blurWidth > 300 ) { + break; + } else { + ++value; + } + } + blurImage = blurImage.scaled(blurWidth * value, blurHeight * value, Qt::KeepAspectRatio); + } else { // 说明背景图没有找到足够大的最大公约数 + blurImage = blurImage.scaledToWidth(300); + } + // qDebug() << __func__ << originWidth << originHeight << blurImage.width() << blurImage.height() << value << divisor; QImage tmpImg = blurImage; // 经过第二次处理的最终结果bluredImage float weight[2 * blur_radius + 1]; @@ -242,14 +488,11 @@ void DesktopBackground::bluredImage(int blur_radius, QImage &blurImage) float rgb[3]; unsigned char *p, *p1, *ptmp; // 在横向进行一次相加 - for(int y = 0; y < height; y++) - { + for(int y = 0; y < height; y++) { p = blurImage.scanLine(y); - for(int x = 0; x < width; x++) - { + for(int x = 0; x < width; x++) { rgb[0] = rgb[1] = rgb[2] = 0.0f; - for(int i = -blur_radius; i <= blur_radius; i++) - { + for(int i = -blur_radius; i <= blur_radius; i++) { // 边界处理后的对应的权值矩阵实际值 int inx = edge(x, i, width); p1 = p + inx * 4; @@ -263,17 +506,21 @@ void DesktopBackground::bluredImage(int blur_radius, QImage &blurImage) ptmp[2] = rgb[2]; } } - // 在纵方向对第一次的结果重新进行一次 - for(int y = 0; y < height; y++) - { - for(int x = 0; x < width; x++) - { + // 在纵方向对第一次的结果重新进行一次,先进行逆时针旋转90度进行高斯模糊,减少 scanLine() 函数的计算量 + QTransform matrix; + matrix.rotate(-90.0); + tmpImg = tmpImg.transformed(matrix, Qt::FastTransformation); + blurImage = blurImage.transformed(matrix, Qt::FastTransformation); + int height_rotate = blurImage.height(); + int width_rotate = blurImage.width(); + for(int y = 0; y < height_rotate; y++) { + p = tmpImg.scanLine(y); + for(int x = 0; x < width_rotate; x++) { rgb[0] = rgb[1] = rgb[2] = 0.0f; - for(int i = -blur_radius; i <= blur_radius; i++) - { - int iny = edge(y, i, height); - p = tmpImg.scanLine(iny); - p1 = p + x * 4; + for(int i = -blur_radius; i <= blur_radius; i++) { + // 边界处理后的对应的权值矩阵实际值 + int inx = edge(x, i, width_rotate); + p1 = p + inx * 4; rgb[0] += p1[0] * weight[blur_radius + i]; rgb[1] += p1[1] * weight[blur_radius + i]; rgb[2] += p1[2] * weight[blur_radius + i]; @@ -284,79 +531,63 @@ void DesktopBackground::bluredImage(int blur_radius, QImage &blurImage) ptmp[2] = rgb[2]; } } - blurImage = blurImage.scaled(originWidth, originHeight, Qt::KeepAspectRatio); + matrix.rotate(180.0); + blurImage = blurImage.transformed(matrix, Qt::FastTransformation); + + // smooth scale是耗时大户啊(将近90ms),暂时没想到优化方法! + blurImage = blurImage.scaled(originWidth, originHeight, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); + // 将模糊图片缩放回原图尺寸 + blurImage = blurImage.scaled(imgOriginWidth, imgOriginHeight, Qt::IgnoreAspectRatio, Qt::FastTransformation); + return blurImage; } - -double DesktopBackground::getSystemScalingFactor() +void BackgroundImageHandler::loadBackgroundImageAsync(const QString filePath, double scalingFactor, const QString fillStyle, QObject *context, ImageTaskCallBack loadFinishedCallback) { - double scalingFactor = 1.5; - QString schemaUrl = "org.ukui.SettingsDaemon.plugins.xsettings"; - QString keyName = "scalingFactor"; - - if (QGSettings::isSchemaInstalled(schemaUrl.toUtf8())) { - QGSettings gsettings(schemaUrl.toUtf8()); + auto taskFunc = [filePath, scalingFactor, fillStyle]() { + return loadBackgroundImage(filePath, scalingFactor, fillStyle); + }; - const QStringList keyList = gsettings.keys(); - if (keyList.contains(keyName)) { - scalingFactor = gsettings.get(keyName).toDouble(); -// qDebug() << "MMMMMM scalingFactor = " << scalingFactor; - } else { - qWarning() << QString("未获取到Gesetting的键值(%1) value").arg(keyName); - // default - return scalingFactor; - } - } + new BackgroundImageHandler(taskFunc, context, loadFinishedCallback); +} - return scalingFactor; +void BackgroundImageHandler::blurImageAsync(const QImage &image, qreal radius, QObject *context, ImageTaskCallBack blurFinishedCallback) +{ + auto taskFunc = [radius, image]() { + return blurImage(radius, image); + }; + new BackgroundImageHandler(taskFunc, context, blurFinishedCallback); } -void DesktopBackground::onBlurAlphaChanged() +BackgroundImageHandler::BackgroundImageHandler(ImageTask taskFunc, QObject *context, ImageTaskCallBack callback) { - if(m_nonBlurBackground.isNull()) - return; + auto* thread = QThread::create([this, taskFunc](){ + auto image = taskFunc(); + Q_EMIT taskFinished(image); + }); + + moveToThread(thread); + + connect(thread, &QThread::finished, thread, &QObject::deleteLater); + connect(thread, &QThread::finished, this, &QObject::deleteLater); + connect(this, &BackgroundImageHandler::taskFinished, context, [callback, thread](const QImage image) { + callback(image); + if (thread->isRunning()) { + thread->quit(); + thread->wait(); + } + }); - updateBlurBackground(); - update(); + thread->start(); } -void DesktopBackground::paint(QPainter *painter) +QImage BackgroundImageHandler::loadBackgroundImage(const QString& filePath, double scalingFactor, const QString& fillStyle) { - QImage tmpImage; - if (qRound(m_blurAlpha * MAX_BLUR_ALPHA) > 0) { - tmpImage = m_blurBackground; - } else { - tmpImage = m_nonBlurBackground; - } - if (m_backgroundFillStyle == "centered") { - //居中 - painter->drawImage((boundingRect().width() - tmpImage.width()) / 2, - (boundingRect().height() - tmpImage.height()) / 2, - tmpImage); - } else if (m_backgroundFillStyle == "wallpaper") { - //平铺 - int drewWidth = 0; - int drewHeight = 0; - while (drewHeight < boundingRect().height()) { - // draw background on x-direction - while (drewWidth < boundingRect().width()) { - painter->drawImage(drewWidth, drewHeight, tmpImage); - drewWidth += tmpImage.width(); - } - // set drewWidth to 0 to start next line of drawing - drewWidth = 0; - // draw background on y-direction - drewHeight += tmpImage.height(); + QImage image(filePath); + if (scalingFactor != 1.0) { + if (fillStyle == "centered" || fillStyle == "wallpaper") { + // 居中 或 平铺 + image = image.scaled(image.width() * scalingFactor, image.height() * scalingFactor); } - } else if (m_backgroundFillStyle == "scaled") { - //填充 - painter->drawImage(boundingRect(), tmpImage, scaledRect(tmpImage)); - } else if (m_backgroundFillStyle == "stretched") { - //拉伸 - painter->drawImage(boundingRect(), tmpImage); - } - else { - // default to scaled - painter->drawImage(boundingRect(), tmpImage, scaledRect(tmpImage)); } + return image; } diff --git a/windowsview/desktopbackground.h b/windowsview/desktopbackground.h index eb14118240bf31a7978e6f9012fc2a86dae94809..2acf5d316efd348c97ff44e83607f30868340d4d 100644 --- a/windowsview/desktopbackground.h +++ b/windowsview/desktopbackground.h @@ -1,3 +1,22 @@ +/* + * Copyright (C) 2022, KylinSoft Co., Ltd. + + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + #ifndef DESKTOPBACKGROUND_H #define DESKTOPBACKGROUND_H @@ -5,49 +24,78 @@ #include #include +#include + + + +class QGSettings; +class QColor; + /*! * \brief 背景绘制的Item,导出由QML使用进行背景的绘制 * \details 方便前端进行背景绘制,并提供虚化、背景图片拉伸的能力 */ -class DesktopBackground : public QQuickPaintedItem + +using ImageTask = std::function; +using ImageTaskCallBack = std::function; + +class BackgroundImageHandler : public QObject { Q_OBJECT +public: + ~BackgroundImageHandler() = default; - Q_PROPERTY(qreal blurAlpha READ blurAlpha WRITE setBlurAlpha NOTIFY blurAlphaChanged) + static void loadBackgroundImageAsync(const QString filePath, double scalingFactor, const QString fillStyle, + QObject* context, ImageTaskCallBack loadFinishedCallback); + static void blurImageAsync(const QImage &image, qreal radius, + QObject* context, ImageTaskCallBack blurFinishedCallback); + static QImage blurImage(int blur_radius, const QImage &blurImage); + +private: + BackgroundImageHandler(ImageTask taskFunc, QObject* context, ImageTaskCallBack callback); + static QImage loadBackgroundImage(const QString &filePath, double scalingFactor, const QString &fillStyle); + static int edge(int x, int i, int w); + static float gaussFunc1D(int x, float sigma); + static void getKernal(int radius, float* weight); +Q_SIGNALS: + void taskFinished(const QImage &image); +}; + +class DesktopBackground : public QQuickPaintedItem +{ + Q_OBJECT + Q_PROPERTY(qreal blurAlpha READ blurAlpha WRITE setBlurAlpha NOTIFY blurAlphaChanged) public: explicit DesktopBackground(QQuickPaintedItem *parent = nullptr); ~DesktopBackground(); - void paint(QPainter *painter); - - qreal blurAlpha(){ - return m_blurAlpha; - } - + qreal blurAlpha() { return m_blurAlpha; } void setBlurAlpha(qreal alpha); - QRect scaledRect(const QImage &image); + QRect getDestRect(const QImage &image, const QRectF &desktopRect); + + static void setNonBlurBackground(const QImage &image); + static void setBlurBackground(const QImage &originImage, qreal blurAlpha); + static double getSystemScalingFactor(); + static QString getBackgroundFile(); + static QString getBackgroundFillStyle(); signals: void loadPicture(const QString &fileName); void blurAlphaChanged(); + void blurImage(int radius, const QImage &blurImage); private slots: void onBlurAlphaChanged(); private: void init(); - QString getBackgroundFile(); - QString getBackgroundFillStyle(); - double getSystemScalingFactor(); + static QString getBackgroundFileFromAccount(); + QColor getBackgroundPrimaryColor(); void updateBlurBackground(); - int edge(int x, int i, int w); - float gaussFunc1D(int x, float sigma); - void getKernal(int radius, float* weight); - void bluredImage(int blur_radius, QImage &blurImage); - +private: QString m_backgroundFile; QString m_backgroundFillStyle = "scaled"; double m_scalingFactor = 1.5; @@ -55,6 +103,8 @@ private: static QImage m_nonBlurBackground; qreal m_blurAlpha; static quint32 m_blurRadius; + bool m_usePureColor = false; + QColor m_pureColor = Qt::black; }; #endif // DESKTOPBACKGROUND_H diff --git a/windowsview/desktoplistmodel.cpp b/windowsview/desktoplistmodel.cpp new file mode 100644 index 0000000000000000000000000000000000000000..963ade4c943850364b652656562d0a0a0d5a0bf9 --- /dev/null +++ b/windowsview/desktoplistmodel.cpp @@ -0,0 +1,225 @@ +/* + * Copyright (C) 2024, KylinSoft Co., Ltd. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * Authors: zy-yuan1 + * + */ +#include "desktoplistmodel.h" + +#include +#include +#include +#include +#include +#include +#include +#include "windowmanagerinterface.h" + +DesktopListModel::DesktopListModel(QObject *parent) : QAbstractListModel(parent) +{ + connectSignals(); + init(); +} + +int DesktopListModel::rowCount(const QModelIndex &parent) const +{ + return m_desktopList.count(); +} + +QVariant DesktopListModel::data(const QModelIndex &index, int role) const +{ + int i = index.row(); + if (i < 0 || i >= m_desktopList.count()) { + return QVariant(); + } + + Desktop desktop = m_desktopList.at(i); + switch (static_cast(role)) { + case Role::Id: + return i + 1; + case Role::Uuid: + return desktop.uuid(); + case Role::CustomName: + return desktop.customName(); + case Role::ItemType: + return desktop.type() == Desktop::DesktopType::NewDesktop ? QString("newDesktop") + : QString("workSpace"); + default: + return {}; + } +} + +bool DesktopListModel::setData(const QModelIndex &index, const QVariant &value, int role) +{ + if (!index.isValid()) { + return false; + } + + if (role == Role::CustomName) { + m_desktopList[index.row()].setCustomName(value.toString()); + Q_EMIT dataChanged(index, index, QVector{Role::CustomName}); + WindowManagerInterface::getInstance()->setDesktopName(index.row() + 1, value.toString()); + WindowManagerInterface::getInstance()->saveDesktopNames(getDesktopNames()); + return true; + } else if (role == Role::ItemType) { + m_desktopList[index.row()].setDesktopType(Desktop::DesktopType(value.toInt())); + Q_EMIT dataChanged(index, index, QVector{Role::ItemType}); + } + + return false; +} + +QHash DesktopListModel::roleNames() const +{ + QHash roles = QAbstractItemModel::roleNames(); + QMetaEnum e = metaObject()->enumerator(metaObject()->indexOfEnumerator("Role")); + + for (int i = 0; i < e.keyCount(); ++i) { + roles.insert(e.value(i), e.key(i)); + } + return roles; +} + +bool DesktopListModel::insertRows(int row, int count, const QModelIndex &parent) +{ + if (row < 0 || row > m_desktopList.count() || m_desktopList.count() > MAX_DESKTOP_COUNT) { + return false; + } + + beginInsertRows(parent, row, row); + + Desktop desktop; + desktop.setDesktopType(Desktop::DesktopType::WorkSpace); + m_desktopList.insert(m_desktopList.count() - 1, desktop); + + endInsertRows(); + + return true; +} + +bool DesktopListModel::removeRows(int row, int count, const QModelIndex &parent) +{ + if (!rowIsValid(row)) { + return false; + } + + beginRemoveRows(parent, row, row); + m_desktopList.removeAt(row); + endRemoveRows(); + return true; +} + +bool DesktopListModel::moveRows(const QModelIndex &sourceParent, int sourceRow, int count, + const QModelIndex &destinationParent, int destinationChild) +{ + if (!rowIsValid(sourceRow) || !rowIsValid(destinationChild)) { + return false; + } + // only support count == 1 + // 需要注意 beginMoveRows 单个节点移动时,上移差是1,下移差是2 + if (sourceRow < destinationChild) { + // 右移/下移 + beginMoveRows(sourceParent,sourceRow, sourceRow, destinationParent, destinationChild + 1); + } else { + // 左移/上移 + beginMoveRows(sourceParent,sourceRow, sourceRow, destinationParent, destinationChild); + } + m_desktopList.move(sourceRow, destinationChild); + endMoveRows(); + return true; +} + +bool DesktopListModel::rowIsValid(int row) const +{ + return row >= 0 && row < m_desktopList.count(); +} + +void DesktopListModel::connectSignals() +{ + QObject::connect(WindowManagerInterface::getInstance(), &WindowManagerInterface::desktopAppended, + this, &DesktopListModel::onDesktopAppend); + QObject::connect(WindowManagerInterface::getInstance(), &WindowManagerInterface::desktopRemoved, + this, &DesktopListModel::onDesktopRemoved); + QObject::connect(WindowManagerInterface::getInstance(), &WindowManagerInterface::desktopMoved, + this, &DesktopListModel::onDesktopMoved); +} + +void DesktopListModel::init() +{ + beginResetModel(); + m_desktopList.clear(); + + const auto desktopCount = WindowManagerInterface::getInstance()->getNumberOfDesktops(); + QStringList desktopNameList = WindowManagerInterface::getInstance()->getDesktopNames(); + for (int desktopIndex = 1; desktopIndex <= desktopCount; desktopIndex++) { + Desktop desktop; + desktop.setDesktopType(Desktop::DesktopType::WorkSpace); + if (desktopIndex < desktopNameList.size()) { + desktop.setCustomName(desktopNameList.at(desktopIndex - 1)); + } + m_desktopList.append(desktop); + } + + // 在末尾添加空的Desktop,指代“newDesktop” + if (desktopCount < MAX_DESKTOP_COUNT) { + Desktop desktop; + desktop.setDesktopType(Desktop::DesktopType::NewDesktop); + m_desktopList.append(desktop); + } + + endResetModel(); +} + +QStringList DesktopListModel::getDesktopNames() +{ + QStringList nameList; + for (const auto &desktop : m_desktopList) { + nameList.append(desktop.customName()); + } + return nameList; +} + +void DesktopListModel::onDesktopAppend(int desktopIndex) +{ + //当工作区数量达到最大时,再点击“新建工作区”不需要model新增item,只需将model最后一项的属性ItemType由“newDesktop”改为“workSpace”,并修改其他必须修改的属性 + //其他情况下则新增item + if (desktopIndex == MAX_DESKTOP_COUNT) { + setData(index(desktopIndex - 1, 0), Desktop::DesktopType::WorkSpace, Role::ItemType); + setData(index(desktopIndex - 1, 0), "", Role::CustomName); + } else { + insertRows(desktopIndex - 1, 1, QModelIndex()); + emit desktopAppended(rowCount() + 1); + } + WindowManagerInterface::getInstance()->saveDesktopNames(getDesktopNames()); +} + +void DesktopListModel::onDesktopRemoved(int desktopIndex) +{ + //当工作区数量是最大时,且最后一项为“workSpace”,由于要播放删除动画,需要先添加“newDesktop”,再删除desktopIndex对应工作区 + if (rowCount() == MAX_DESKTOP_COUNT && index(MAX_DESKTOP_COUNT - 1, 0).data(Role::ItemType).toString() == QString("workSpace")) { + insertRows(MAX_DESKTOP_COUNT, 1, QModelIndex()); + setData(index(MAX_DESKTOP_COUNT, 0), Desktop::DesktopType::NewDesktop, Role::ItemType); + setData(index(MAX_DESKTOP_COUNT, 0), "", Role::CustomName); + } + removeRows(desktopIndex - 1, 1, QModelIndex()); + WindowManagerInterface::getInstance()->saveDesktopNames(getDesktopNames()); +} + +void DesktopListModel::onDesktopMoved(int srcDesktopIndex, int destDesktopIndex) +{ + moveRows(QModelIndex(), srcDesktopIndex - 1, 1, QModelIndex(), destDesktopIndex - 1); + WindowManagerInterface::getInstance()->saveDesktopNames(getDesktopNames()); +} diff --git a/windowsview/desktoplistmodel.h b/windowsview/desktoplistmodel.h new file mode 100644 index 0000000000000000000000000000000000000000..530406ade0307e7ae3fe79d1546ec028d32ecfd8 --- /dev/null +++ b/windowsview/desktoplistmodel.h @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2024, KylinSoft Co., Ltd. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * Authors: zy-yuan1 + * + */ +#ifndef DESKTOPLISTMODEL_H +#define DESKTOPLISTMODEL_H + +#include +#include +#include +#include +#include +#include +#include +#include "multitaskviewabstractmodelhandler.h" + +class Window; +class Desktop; + + +class DesktopListModel : public QAbstractListModel +{ + Q_OBJECT + +public: + enum Role { + Id = Qt::UserRole + 1, /* desktop index, 从 1 开始计数,易于和界面显示对应 */ + Uuid, /* desktop uuid */ + CustomName, /* 用户自定义名称 */ + ItemType /*DesktopType*/ + }; + Q_ENUM(Role) + + explicit DesktopListModel(QObject *parent = nullptr); + ~DesktopListModel() = default; + + int rowCount(const QModelIndex &parent = QModelIndex()) const override; + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; + bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override; + QHash roleNames() const override; + bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex()) override; + bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) override; + bool moveRows(const QModelIndex &sourceParent, int sourceRow, int count, + const QModelIndex &destinationParent, int destinationChild) override; + + bool rowIsValid(int row) const; + void connectSignals(); + void init(); + +private: + QStringList getDesktopNames(); + + QList m_desktopList; + /* 最大虚拟桌面数量为15: 15个工作区 或 14个工作区+新建工作区*/ + static constexpr int MAX_DESKTOP_COUNT = 15; + +signals: + /* 用户手动添加工作区时,需要额外执行动画使最后一个工作区(或新建工作区)显示完整;删除工作区则不需要 */ + void desktopAppended(int desktopIndex); + + +private slots: + void onDesktopAppend(int desktopIndex); + void onDesktopRemoved(int desktopIndex); + void onDesktopMoved(int srcDesktopIndex, int destDesktopIndex); +}; + +#endif // DESKTOPLISTMODEL_H diff --git a/windowsview/globalconfig.h b/windowsview/globalconfig.h deleted file mode 100644 index fcb0adb0f0f0f29d1adec4b55cde58c028adc0b0..0000000000000000000000000000000000000000 --- a/windowsview/globalconfig.h +++ /dev/null @@ -1,2 +0,0 @@ -#define HAVE_X11 1 -#define HAVE_XCB_COMPOSITE 1 diff --git a/windowsview/globalconfig.h.in b/windowsview/globalconfig.h.in new file mode 100644 index 0000000000000000000000000000000000000000..d4e81a43a1da8e4b09963cbe488d701d28d5df6c --- /dev/null +++ b/windowsview/globalconfig.h.in @@ -0,0 +1,4 @@ +#cmakedefine01 HAVE_X11 +#cmakedefine01 HAVE_XCB_COMPOSITE +#cmakedefine01 HAVE_GLX +#cmakedefine01 HAVE_EGL \ No newline at end of file diff --git a/windowsview/icontheme.cpp b/windowsview/icontheme.cpp index af9efb8595061993fe7eba9bd74fb89b3f6c5c03..8ea166f45da7a2fad6293dc9821c4d515c9e02e1 100644 --- a/windowsview/icontheme.cpp +++ b/windowsview/icontheme.cpp @@ -1,3 +1,22 @@ +/* + * Copyright (C) 2022, KylinSoft Co., Ltd. + + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + #include "icontheme.h" IconTheme::IconTheme(QQuickPaintedItem *parent) diff --git a/windowsview/icontheme.h b/windowsview/icontheme.h index 7777a81541d18f20838259995e6557546a75c470..5eceb7b989103344d155e5361cc818274b5ac881 100644 --- a/windowsview/icontheme.h +++ b/windowsview/icontheme.h @@ -1,3 +1,22 @@ +/* + * Copyright (C) 2022, KylinSoft Co., Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + #ifndef ICONTHEME_H #define ICONTHEME_H diff --git a/windowsview/images/default-background.jpg b/windowsview/images/default-background.jpg deleted file mode 100644 index fa2b0f9ca629452eff039a4ccc1bb72ec84b2d54..0000000000000000000000000000000000000000 Binary files a/windowsview/images/default-background.jpg and /dev/null differ diff --git a/windowsview/images/icon-arrow-black.svg b/windowsview/images/icon-arrow-black.svg new file mode 100644 index 0000000000000000000000000000000000000000..28d0f5bdf19d9ce7cc583533c5899590dcd47301 --- /dev/null +++ b/windowsview/images/icon-arrow-black.svg @@ -0,0 +1,7 @@ + + + icon-arrow-深 + + + + \ No newline at end of file diff --git a/windowsview/images/icon-arrow-white.svg b/windowsview/images/icon-arrow-white.svg new file mode 100644 index 0000000000000000000000000000000000000000..cc9612e19cf8ba0457e4440fc1e57e95ae8f0d10 --- /dev/null +++ b/windowsview/images/icon-arrow-white.svg @@ -0,0 +1,7 @@ + + + icon-arrow-浅 + + + + \ No newline at end of file diff --git a/windowsview/multitaskviewabstractmodelhandler.h b/windowsview/multitaskviewabstractmodelhandler.h new file mode 100644 index 0000000000000000000000000000000000000000..2e65b3545448cecd7ce97ba34659525dac27b6b6 --- /dev/null +++ b/windowsview/multitaskviewabstractmodelhandler.h @@ -0,0 +1,174 @@ +/* + * Copyright (C) 2022, KylinSoft Co., Ltd. + + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef MultitaskViewAbstractModelHandler_H +#define MultitaskViewAbstractModelHandler_H + +#include +#include + +class Window +{ + Q_GADGET + Q_PROPERTY(int id READ id) + Q_PROPERTY(QString caption READ caption) + Q_PROPERTY(int x READ x) + Q_PROPERTY(int y READ y) + Q_PROPERTY(int width READ width) + Q_PROPERTY(int height READ height) + Q_PROPERTY(bool minimized READ minimized) + Q_PROPERTY(QString uuid READ uuid) + Q_PROPERTY(QList desktopsId READ desktopsId) + Q_PROPERTY(int screenId READ screenId) + Q_PROPERTY(QVariant icon READ icon WRITE setIcon) + +public: + Window() = default; + Window(int id, QString uuid, const QString& caption, int x, int y, int width, int height, bool minimized) + : m_id(id), + m_uuid(uuid), + m_caption(caption), + m_x(x), + m_y(y), + m_width(width), + m_height(height), + m_isMinimized(minimized) {} + int id() const { return m_id; } + QString uuid() const { return m_uuid; } + const QString& caption() const { return m_caption; } + int x() const { return m_x; } + int y() const { return m_y; } + int width() const { return m_width; } + int height() const { return m_height; } + bool minimized() const { return m_isMinimized; } + QList desktopsId() const { return m_desktopsId; } + int screenId() const { return m_screenId; } + void setDesktopsId(const QList desktopsId) { + m_desktopsId = desktopsId; + } + void setScreenId(const int screenId) { + m_screenId = screenId; + } + + const QVariant& icon() { return m_icon; } + void setIcon(const QVariant& icon) { + m_icon = icon; + } + +private: + int m_id = 0; + QString m_uuid; + QString m_caption; + int m_x = 0; + int m_y = 0; + int m_width = 0; + int m_height = 0; + bool m_isMinimized = false; + QList m_desktopsId; + int m_screenId = 0; + QVariant m_icon; +}; +Q_DECLARE_METATYPE(Window) + + +class Desktop +{ + Q_GADGET + Q_PROPERTY(QString uuid READ uuid) + +public: + enum DesktopType { + WorkSpace = 0, + NewDesktop + }; + + Desktop() = default; + + QString uuid() const { return m_uuid; } + DesktopType type() const { return m_type; }; + + void setUuid(const QString uuid) { + m_uuid = uuid; + } + + void setDesktopType(DesktopType type) { + m_type = type; + } + + QString customName() const { return m_customName; } + + void setCustomName(const QString name) { + m_customName = name; + } + +private: + QString m_uuid; + QString m_customName; + DesktopType m_type = DesktopType::WorkSpace; +}; +Q_DECLARE_METATYPE(Desktop) + +class MultitaskViewAbstractModelHandler : public QObject +{ + Q_OBJECT + Q_DISABLE_COPY(MultitaskViewAbstractModelHandler) + +public: + explicit MultitaskViewAbstractModelHandler() = default; + ~MultitaskViewAbstractModelHandler() = default; + + virtual void removeAppWindow(QString windowId) = 0; + virtual void moveAppWindowToDesktop(QString windowId, int srcDesktopInex, int destDesktopInex) = 0; + virtual void activateAppWindow(QString windowId) = 0; + virtual QVariant getWindowIcon(QString windowId) = 0; + virtual void removeDesktop(int desktopIndex) = 0; + virtual void appendDesktop() = 0; + virtual void moveDesktop(int srcDesktopIndex, int destDesktopIndex) = 0; + virtual int getCurrentDesktop() = 0; + virtual bool isCurrentDesktopShowingDesktop() = 0; + virtual void setCurrentDesktop(int desktopIndex) = 0; + virtual QRect getFullScreenGeometry(int desktopIndex, int screenIndex) =0; + virtual bool hasModalChildWindow(QString windowId) = 0; + virtual bool isExtensionMode() = 0; + virtual int logicalScreenCount() = 0; + virtual QList createWindowList(int desktopIndex, int screenIndex) = 0; + virtual int getNumberOfDesktops() = 0; + virtual QString getDesktopUuid(int desktopIndex) = 0; + virtual QString getOutputUuid(int outputIndex) = 0; + virtual void setDesktopName(const int desktopIndex, const QString name) = 0; + +signals: + void appWindowCreated(); + void appWindowAdd(const Window &window); + void appWindowRemoved(QString windowId); + void appWindowActivated(); + void appWindowUpdated(const Window &window); + void appWindowDesktopChanged(QString windowId, int oldDesktopIndex,int newDesktopIndex); + void desktopRemoved(int desktopIndex); + void desktopAppended(int desktopIndex); + void desktopMoved(int oldDesktopIndex, int newDesktopIndex); + void currentDesktopChanged(int oldCurrentDesktopIndex, int newCurrentDesktopIndex); + void screenCountChanged(); + void screenSizeChanged(); + void desktopNumberChanged(); + +}; + + +#endif // MultitaskViewAbstractModelHandler_H diff --git a/windowsview/multitaskviewmanager.cpp b/windowsview/multitaskviewmanager.cpp deleted file mode 100644 index 982b4cb229b31b465d6419f5f0e302ae2e7dee22..0000000000000000000000000000000000000000 --- a/windowsview/multitaskviewmanager.cpp +++ /dev/null @@ -1,301 +0,0 @@ -#include "multitaskviewmanager.h" - -#include -#include - -#include -#include -#include -#include - -#include "desktopbackground.h" -#include "icontheme.h" - -namespace MultitaskView { - -MultitaskViewManager::MultitaskViewManager() -{ - setProjectType(); - - setQmlUrl(); - - registerQmlTypes(); - - registerShortcut(); - - initDBusService(); -} - -MultitaskViewManager::~MultitaskViewManager() -{ - dbusService_.reset(); - - close(); -} - -void MultitaskViewManager::grabbedKeyboardEvent(QKeyEvent *e) -{ - QApplication::sendEvent(view_->rootObject(), e); -} - -void MultitaskViewManager::open() -{ - if (isOpen) - { - return; - } - - //可旋转的机器,多任务视图打开的时候,禁用旋转 - if(projectType_ == MultitaskViewManager::TABLET && model_->isTabletMode()) - { - if(getRotationModeStatus()) - { - setRotationModeStatus(!isOpenRotationMode); - } - } - - initView(); - - KWin::effects->grabKeyboard(this); - - isOpen = true; -} - -bool MultitaskViewManager::getRotationModeStatus() -{ - QDBusMessage message = QDBusMessage::createMethodCall("com.kylin.statusmanager.interface", - "/", - "com.kylin.statusmanager.interface", - "get_auto_rotation"); - - QDBusMessage response = QDBusConnection::sessionBus().call(message); - - if (response.type() == QDBusMessage::ReplyMessage) - { - isOpenRotationMode = response.arguments().takeFirst().toBool(); - } - else - { - // invalid response, keep default. - } - return isOpenRotationMode; -} - -void MultitaskViewManager::setRotationModeStatus(bool rotationModeStatus) -{ - QDBusInterface iface("com.kylin.statusmanager.interface", - "/", - "com.kylin.statusmanager.interface"); - - if (!iface.isValid()) { - qDebug() << QDBusConnection::sessionBus().lastError().message(); - } - - QDBusReply reply = iface.call("set_auto_rotation",rotationModeStatus,"",""); - - if (reply.isValid()) { - qDebug() << "set Rotation mode success"; - return; - } - - qDebug() << "set Rotation mode failed" << reply.error(); -} - -void MultitaskViewManager::close() -{ - if (!isOpen) - { - return; - } - - //可旋转的机器,多任务视图打开前 是打开了旋转的 那么关闭多任务视图的同时 打开旋转 - if(projectType_ == MultitaskViewManager::TABLET && model_->isTabletMode()) - { - if(isOpenRotationMode) - { - setRotationModeStatus(isOpenRotationMode); - } - } - - KWin::effects->ungrabKeyboard(); - - destroyView(); - - isOpen = false; -} - -void MultitaskViewManager::showDesktop(bool show) -{ - KWin::effects->setShowingDesktop(show); -} - -void MultitaskViewManager::initModel() -{ - model_.reset(new MultitaskViewModel()); -} - -void MultitaskViewManager::setProjectType() -{ - // not sure if kdk is available! - return; - // if ( "V10SP1-edu" == getProjectCodeName() || - // "V10SPX-mavis-edu" == getProjectCodeName() || - // "3" == getOSReleaseValue("PRODUCT_FEATURES") || - // "2" == getOSReleaseValue("PRODUCT_FEATURES") ) - // { - // projectType_ = MultitaskViewManager::TABLET; - // } -} - -void MultitaskViewManager::setQmlUrl() -{ - if (projectType_ == MultitaskViewManager::TABLET) - { - qmlUrl_ = QUrl("qrc:/qml/TabletViewMain.qml"); - } - else if (projectType_ == MultitaskViewManager::PC) - { - qmlUrl_ = QUrl("qrc:/qml/multitaskview.qml"); - } -} - -void MultitaskViewManager::registerQmlTypes() -{ - qmlRegisterType("org.kde.kwin", 3, 0, "DesktopBackground"); - qmlRegisterType("IconTheme", 1, 0, "IconTheme"); -} - -void MultitaskViewManager::registerShortcut() -{ - auto* action = new QAction(this); - action->setObjectName("ShowMultitaskView"); - action->setText("Show Multitask View"); - - QKeySequence keySeq(Qt::META + Qt::Key_Tab); - KGlobalAccel::self()->setDefaultShortcut(action, QList() << keySeq); - KGlobalAccel::self()->setShortcut(action, QList() << keySeq); - - QObject::connect(action, &QAction::triggered, this, &MultitaskViewManager::open); -} - -void MultitaskViewManager::initDBusService() -{ - dbusService_.reset(new DBusService(this)); -} - -void MultitaskViewManager::initView() -{ - view_.reset(new QQuickView()); - - view_->setFlag(Qt::WindowType::BypassWindowManagerHint); - - KWindowSystem::setType(view_->winId(), NET::Dock); - - qDebug() << "[DEBUG]: multitask view uses " << view_->sceneGraphBackend(); - if (view_->rendererInterface()->graphicsApi() < 2) - { - useOpenGL_ = false; - } - - initModel(); - - view_->rootContext()->setContextProperty("multitaskViewManager", this); - view_->rootContext()->setContextProperty("multitaskViewModel", model_.get()); - - view_->setSource(qmlUrl_); - - // 必须在加载了QML之后才能设置view_对象的大小 - view_->setGeometry(KWin::effects->virtualScreenGeometry()); - - connectSignals(); - - view_->show(); - - view_->requestActivate(); -} - -void MultitaskViewManager::destroyView() -{ - if (view_ == nullptr) - { - return; - } - - if (view_->isVisible()) - { - view_->hide(); - } - - // 1. 由于可以在QML中通过JS调用到close函数, - // 因此,不能直接销毁view_对象;必须延迟 - // 销毁该对象。 - // 2. model_对象可以立刻销毁。但是,为了对称 - // 和简化逻辑,需要保证view_对象和model_对象的 - // 互相依赖的关系。因此,同时延迟销毁model_对象。 - // 3. MultitaskViewManager的析构函数需要确保 - // view_对象和model_对象完成销毁。为了简化逻辑, - // MultitaskViewManager的析构函数选择直接调用 - // destroyView函数,即采用了延迟销毁的做法。 - view_.release()->deleteLater(); - - model_.release()->deleteLater(); -} - -void MultitaskViewManager::connectSignals() -{ - const auto* model = model_.get(); - const auto* rootObject = view_->rootObject(); - connect(model, SIGNAL(appWindowCreated(int)), - rootObject, SIGNAL(qmlAppWindowCreated(int))); - connect(model, SIGNAL(appWindowActivated()), - rootObject, SIGNAL(qmlAppWindowActivated())); - connect(model, SIGNAL(appWindowRemoved(int)), - rootObject, SIGNAL(qmlAppWindowRemoved(int))); - if (projectType_ == MultitaskViewManager::PC) - { - connect(model, SIGNAL(appWindowDesktopChanged(int, int, int)), - rootObject, SIGNAL(qmlAppWindowDesktopChanged(int, int, int))); - connect(model, SIGNAL(desktopRemoved(int)), - rootObject, SIGNAL(qmlDesktopRemoved(int))); - connect(model, SIGNAL(desktopAppended(int)), - rootObject, SIGNAL(qmlDesktopAppended(int))); - connect(model, SIGNAL(desktopMoved(int, int)), - rootObject, SIGNAL(qmlDesktopMoved(int, int))); - connect(model, SIGNAL(currentDesktopChanged(int, int)), - rootObject, SIGNAL(qmlCurrentDesktopChanged(int, int))); - connect(model, SIGNAL(screenCountChanged(int, int)), - rootObject, SIGNAL(qmlScreenCountChanged(int, int))); - connect(model, SIGNAL(screenSizeChanged()), - rootObject, SIGNAL(qmlScreenSizeChanged())); - } - else if (projectType_ == MultitaskViewManager::TABLET) - { - connect(model, SIGNAL(tabletModeChanged(bool)), - rootObject, SIGNAL(qmlDeviceModeChanged(bool))); - connect(model, SIGNAL(rotationModeChanged(QString)), - rootObject, SIGNAL(qmlOrientationChanged(QString))); - } -} - -// QString MultitaskViewManager::getProjectCodeName() -// { -// QString projectCodeName = KDKGetPrjCodeName().c_str(); - -// return projectCodeName; -// } - -// QString MultitaskViewManager::getOSReleaseValue(const QString key) -// { -// int value_length = 256; - -// char os_release_value[value_length]; - -// if (kdk_get_osrelease(key.toStdString().c_str(), os_release_value, value_length) > 0) -// { -// return os_release_value; -// } - -// return ""; -// } - -} // namespace MultitaskView diff --git a/windowsview/multitaskviewmanager.h b/windowsview/multitaskviewmanager.h deleted file mode 100644 index 8fa8ee2514c1334dbe3d3aa0a0e07700e561e795..0000000000000000000000000000000000000000 --- a/windowsview/multitaskviewmanager.h +++ /dev/null @@ -1,95 +0,0 @@ -#ifndef MULTITASKVIEWMANAGER_H -#define MULTITASKVIEWMANAGER_H - -#include - -#include - -#include - -#include "dbusservice.h" -#include "multitaskviewmodel.h" - -namespace MultitaskView { - -class MultitaskViewManager : public KWin::Effect -{ - Q_OBJECT - -public: - - MultitaskViewManager(); - - ~MultitaskViewManager() override; - - enum ProjectType { - PC, - TABLET, - }; - - void grabbedKeyboardEvent(QKeyEvent* e) override; - - Q_INVOKABLE void open(); - - Q_INVOKABLE void close(); - Q_INVOKABLE void showDesktop(bool show); - - Q_INVOKABLE bool useOpenGL() { return useOpenGL_; } - -private: - - void initModel(); - - void setProjectType(); - - void setQmlUrl(); - - void registerQmlTypes(); - - void registerShortcut(); - - void initDBusService(); - - void initView(); - - void destroyView(); - - void connectSignals(); - - // QString getProjectCodeName(); - - // QString getOSReleaseValue(const QString key); - - //! - //! \brief getRotationModeStatus 获取当前旋转模式是否打开 - //! - bool getRotationModeStatus(); - - ///! - //! \brief setRotationModeStatus - //! - void setRotationModeStatus(bool openRotationMode); - -private: - - std::unique_ptr model_ = nullptr; - - std::unique_ptr view_ = nullptr; - - std::unique_ptr dbusService_ = nullptr; - - bool isOpen = false; - - bool useOpenGL_ = true; - - ProjectType projectType_ = MultitaskViewManager::PC; - - QUrl qmlUrl_ = QUrl("qrc:/qml/multitaskView.qml"); - - //记录旋转模式是否打开 - bool isOpenRotationMode = false; -}; - -} // namespace MultitaskView - -#endif // MULTITASKVIEWMANAGER_H diff --git a/windowsview/multitaskviewmodel.cpp b/windowsview/multitaskviewmodel.cpp deleted file mode 100644 index 7a391c7250f49e4db1c400eb460bc7524750927b..0000000000000000000000000000000000000000 --- a/windowsview/multitaskviewmodel.cpp +++ /dev/null @@ -1,665 +0,0 @@ -#include "multitaskviewmodel.h" - -#include - -#include -#include -#include - -const QString UKUI_STYLE_SCHEMA = "org.ukui.style"; -const QString UKUI_STYLE_SCHEMA_STYLENAME = "styleName"; -const QString UKUI_STYLE_SCHEMA_FONTSIZE = "systemFontSize"; - -namespace MultitaskView { - -MultitaskViewModel::MultitaskViewModel(QObject *parent) : QObject(parent) -{ - lastDesktopIndex = getCurrentDesktop(); - - updateScreenCount(); - - updateModelData(); - - connectSignals(); - - if (QGSettings::isSchemaInstalled(UKUI_STYLE_SCHEMA.toUtf8())) - { - settings_ = new QGSettings(UKUI_STYLE_SCHEMA.toUtf8()); - } -} - -MultitaskViewModel::~MultitaskViewModel() = default; - -QList MultitaskViewModel::getAppWindowList(int desktopIndex, int screenIndex) const -{ - if (!validateDesktopIndex(desktopIndex) - ||!validateScreenIndex(screenIndex)) - { - return QList(); - } - - auto desktopIter = std::find_if(desktopList_.cbegin(), - desktopList_.cend(), - [desktopIndex](const QVariant& desktop) - { - return desktop.value().index() == desktopIndex; - }); - if (desktopIter == desktopList_.cend()) - { - return QList(); - } - - const auto& desktop = desktopIter->value(); - const auto& screenList = desktop.screenList(); - auto screenIter = std::find_if(screenList.cbegin(), - screenList.cend(), - [screenIndex](const QVariant& screen) - { - return screen.value().index() == screenIndex; - }); - if (screenIter == screenList.cend()) - { - return QList(); - } - - const auto& screen = screenIter->value(); - auto appWindowList = screen.windowList(); - std::reverse(appWindowList.begin(), appWindowList.end()); - - return appWindowList; -} - -void MultitaskViewModel::removeAppWindow(QUuid windowId) -{ - auto* window = KWin::effects->findWindow(windowId); - if (window == nullptr) - { - return; - } - - window->closeWindow(); -} - -void MultitaskViewModel::removeAllAppWindowOnDesktop(int desktopIndex) -{ - if (!validateDesktopIndex(desktopIndex)) - { - return; - } - - for (int screenIndex = 0; screenIndex < logicalScreenCount(); ++screenIndex) - { - QList windowList = getAppWindowList(desktopIndex, screenIndex); - - for (QVariant &windowVariant : windowList) - { - Window window = windowVariant.value(); - - removeAppWindow(window.uuid()); - } - } -} - -void MultitaskViewModel::moveAppWindowToDesktop(QUuid windowId, - int srcDesktopInex, - int destDesktopInex) const -{ - auto* window = KWin::effects->findWindow(windowId); - if (window == nullptr - || window->isOnAllDesktops() - || !validateDesktopIndex(srcDesktopInex) - || !validateDesktopIndex(destDesktopInex)) - { - return; - } - - auto desktopIndexList = window->desktops(); - if (!desktopIndexList.contains(srcDesktopInex)) - { - return; - } - - desktopIndexList.remove(desktopIndexList.indexOf(srcDesktopInex)); - - if (desktopIndexList.contains(destDesktopInex)) - { - return; - } - - desktopIndexList.append(destDesktopInex); - - KWin::effects->windowToDesktops(window, desktopIndexList); -} - -void MultitaskViewModel::activateAppWindow(QUuid windowId) -{ - auto* window = KWin::effects->findWindow(windowId); - if (window == nullptr) - { - return; - } - - KWin::effects->activateWindow(window); -} - -QIcon MultitaskViewModel::getWindowIcon(QUuid windowId) -{ - // auto id = static_cast(windowId); - auto* window = KWin::effects->findWindow(windowId); - if(window == nullptr) - { - return QIcon(""); - } - - return window->icon(); -} - -QList MultitaskViewModel::getDesktopList() const -{ - return desktopList_; -} - -void MultitaskViewModel::removeDesktop(int desktopIndex) -{ - auto desktopCount = KWin::effects->numberOfDesktops(); - if (desktopCount <= 1) - { - return; - } - - if (!validateDesktopIndex(desktopIndex)) - { - return; - } - - const auto oldDesktopIndex = desktopIndex; - if (desktopIndex == 1) - { - moveDesktopWindows(1, 2); - - desktopIndex = 2; - } - - for (; desktopIndex <= desktopCount; desktopIndex++) - { - moveDesktopWindows(desktopIndex, desktopIndex - 1); - } - - KWin::effects->setNumberOfDesktops(desktopCount - 1); - - updateModelData(); - - emit desktopRemoved(oldDesktopIndex); -} - -void MultitaskViewModel::appendDesktop() -{ - auto desktopCount = KWin::effects->numberOfDesktops(); - if (desktopCount >= MAX_DESKTOP_COUNT) - { - return; - } - - KWin::effects->setNumberOfDesktops(desktopCount + 1); - - updateModelData(); - - emit desktopAppended(desktopCount + 1); -} - -void MultitaskViewModel::moveDesktop(int srcDesktopIndex, int destDesktopIndex) -{ - if (!validateDesktopIndex(srcDesktopIndex) - || !validateDesktopIndex(destDesktopIndex)) - { - return; - } - - if (srcDesktopIndex == destDesktopIndex) - { - return; - } - - const auto desktopCount = KWin::effects->numberOfDesktops(); - KWin::effects->setNumberOfDesktops(desktopCount + 1); - - auto tempDesktopIndex = desktopCount + 1; - moveDesktopWindows(destDesktopIndex, tempDesktopIndex); - // 将临时虚拟桌面的数据暂时更新到模型数据中, - // 方便后面调用moveDesktopWindows函数将 - // 临时虚拟桌面中的窗口移动到来源虚拟桌面 - updateModelData(); - - moveDesktopsOneStep(createDesktopIndexList(srcDesktopIndex, destDesktopIndex)); - - moveDesktopWindows(tempDesktopIndex, srcDesktopIndex); - - KWin::effects->setNumberOfDesktops(desktopCount); - - updateModelData(); - - emit desktopMoved(srcDesktopIndex, destDesktopIndex); -} - -int MultitaskViewModel::getCurrentDesktop() -{ - return KWin::effects->currentDesktop(); -} - -void MultitaskViewModel::setCurrentDesktop(int desktopIndex) -{ - if (!validateDesktopIndex(desktopIndex)) - { - return; - } - - KWin::effects->setCurrentDesktop(desktopIndex); -} - -QRect MultitaskViewModel::getFullScreenGeometry(int desktopIndex, int screenIndex) const -{ - KWin::EffectScreen* screen = KWin::effects->findScreen(screenIndex); - return KWin::effects->clientArea(KWin::clientAreaOption::FullScreenArea, - screen, desktopIndex); -} - -bool MultitaskViewModel::hasModalChildWindow(QUuid windowId) -{ - auto* window = KWin::effects->findWindow(windowId); - if (window == nullptr) - { - return false; - } - - return window->findModal() != nullptr; -} - -QString MultitaskViewModel::getUKUIStyleName() const -{ - // default to ukui-default - QString styleName = "ukui-default"; - - if (settings_ && settings_->keys().contains(UKUI_STYLE_SCHEMA_STYLENAME)) - { - styleName = settings_->get(UKUI_STYLE_SCHEMA_STYLENAME).toString(); - } - else - { - qWarning() << QString("未查询到Gesetting的键值(%1)").arg(UKUI_STYLE_SCHEMA_STYLENAME); - } - - return styleName; -} - -int MultitaskViewModel::getUKUIFontSize() const -{ - // default to 11 - int fontSize = 11; - - if (settings_ && settings_->keys().contains(UKUI_STYLE_SCHEMA_FONTSIZE)) - { - fontSize = settings_->get(UKUI_STYLE_SCHEMA_FONTSIZE).toInt(); - } - else - { - qWarning() << QString("未查询到Gesetting的键值(%1)").arg(UKUI_STYLE_SCHEMA_FONTSIZE); - } - - return fontSize; -} - -void MultitaskViewModel::onWindowAdded(KWin::EffectWindow *window) -{ - if(!shouldAcceptWindow(window)) - { - if(!window->isModal()) { - return; - } - } - - updateModelData(); - - emit appWindowCreated(getWindowId(window)); -} - -void MultitaskViewModel::onWindowDeleted(KWin::EffectWindow *window) -{ - updateModelData(); - - emit appWindowRemoved(getWindowId(window)); -} - -void MultitaskViewModel::onWindowActivated(KWin::EffectWindow* window) -{ - // KWin在发送windowActivated信号时 - // window对象是有可能为空的。对于多任务 - // 视图来说,只关心真正有窗口被激活的清空。 - // 因此,如果window对象为空,则不转发 - // 该信号 - if (window == nullptr) - { - return; - } - // 切换虚拟桌面时发出的窗口激活信号不需要发送到qml。 - if (window->isDesktop() || getCurrentDesktop() != lastDesktopIndex) - { - lastDesktopIndex = getCurrentDesktop(); - return; - } - - emit appWindowActivated(); -} - -void MultitaskViewModel::onDesktopPresenceChanged(KWin::EffectWindow *window, - int oldDesktopIndex, int newDesktopIndex) -{ - if (!shouldAcceptWindow(window)) - { - return; - } - - updateModelData(); - - emit appWindowDesktopChanged(getWindowId(window), oldDesktopIndex, newDesktopIndex); -} - -void MultitaskViewModel::onNumberScreensChanged() -{ - updateModelData(); - - const auto oldScreenCount = screenCount_; - - updateScreenCount(); - - emit screenCountChanged(oldScreenCount, screenCount_); -} - -void MultitaskViewModel::updateScreenCount() -{ - screenCount_ = KWin::effects->screens().size(); -} - -// static -bool MultitaskViewModel::isExtensionMode() -{ - QDesktopWidget desktop; - for (int index = 0; index < desktop.numScreens(); index++) - { - if(KWin::effects->virtualScreenGeometry() - == desktop.screenGeometry(index)) - { - return false; - } - } - - return true; -} - -int MultitaskViewModel::logicalScreenCount() const -{ - const auto screenCount = KWin::effects->screens().size(); - if (screenCount == 1 - || !isExtensionMode()) - { - return 1; - } - - return screenCount; -} - -bool MultitaskViewModel::isTabletMode() const -{ - // default to PC mode. - bool tabletMode = false; - - QDBusMessage message = QDBusMessage::createMethodCall("com.kylin.statusmanager.interface", - "/", - "com.kylin.statusmanager.interface", - "get_current_tabletmode"); - - QDBusMessage response = QDBusConnection::sessionBus().call(message); - - if (response.type() == QDBusMessage::ReplyMessage) - { - tabletMode = response.arguments().takeFirst().toBool(); - } - else - { - // invalid response, keep default. - } - - return tabletMode; -} - -QString MultitaskViewModel::rotationMode() const -{ - // default to "normal". - QString rotation = "normal"; - - QDBusMessage message = QDBusMessage::createMethodCall("com.kylin.statusmanager.interface", - "/", - "com.kylin.statusmanager.interface", - "get_current_rotation"); - - QDBusMessage response = QDBusConnection::sessionBus().call(message); - - if (response.type() == QDBusMessage::ReplyMessage) - { - rotation = response.arguments().takeFirst().toString(); - } - else - { - // invalid response, keep default. - } - - return rotation; -} - -QList MultitaskViewModel::createWindowList(int desktopIndex, int screenIndex) -{ - if (!validateDesktopIndex(desktopIndex) - || !validateScreenIndex(screenIndex)) - { - return QList(); - } - KWin::EffectScreen* screen = KWin::effects->findScreen(screenIndex); - - QList windowList; - - const auto& effectWindowList = KWin::effects->stackingOrder(); - for (auto iter = effectWindowList.cbegin(); - iter != effectWindowList.cend(); iter++) - { - auto* effectWindow = *iter; - if (!shouldAcceptWindow(effectWindow)) - { - continue; - } - - if (!effectWindow->desktops().contains(desktopIndex) - || effectWindow->screen() != screen) - { - continue; - } - - Window window(getWindowId(effectWindow), - effectWindow->caption(), - effectWindow->pos().x(), - effectWindow->pos().y(), - effectWindow->decorationInnerRect().width(), - effectWindow->decorationInnerRect().height(), - effectWindow->isMinimized(), - getUuid(effectWindow)); - - windowList.append(QVariant::fromValue(window)); - } - - return windowList; -} - -void MultitaskViewModel::updateModelData() -{ - QList desktopList; - - const auto desktopCount = KWin::effects->numberOfDesktops(); - for (int desktopIndex = 1; desktopIndex <= desktopCount; desktopIndex++) - { - QList screenList; - for (int screenIndex = 0; screenIndex < logicalScreenCount(); screenIndex++) - { - auto screen = QVariant::fromValue(Screen(screenIndex, createWindowList(desktopIndex, screenIndex))); - screenList.append(std::move(screen)); - } - - auto desktop = QVariant::fromValue(Desktop(desktopIndex, screenList)); - desktopList.append(std::move(desktop)); - } - - desktopList_ = std::move(desktopList); -} - -void MultitaskViewModel::moveDesktopWindows(int srcDesktopIndex, int destDesktopIndex) -{ - if (!validateDesktopIndex(srcDesktopIndex) - || !validateDesktopIndex(destDesktopIndex)) - { - return; - } - - auto srcDesktopIter = std::find_if(desktopList_.cbegin(), - desktopList_.cend(), - [srcDesktopIndex](const QVariant& desktop) - { - return desktop.value().index() == srcDesktopIndex; - }); - if (srcDesktopIter == desktopList_.cend()) - { - return; - } - - const auto& desktop = srcDesktopIter->value(); - const auto& screenList = desktop.screenList(); - for (auto screenIter = screenList.cbegin(); - screenIter != screenList.cend(); screenIter++) - { - const auto& screen = screenIter->value(); - const auto& windowList = screen.windowList(); - for (auto windowIter = windowList.begin(); - windowIter != windowList.end(); windowIter++) - { - const auto& window = windowIter->value(); - moveAppWindowToDesktop(window.uuid(), srcDesktopIndex, destDesktopIndex); - } - } -} - -void MultitaskViewModel::moveDesktopsOneStep(const QVector& desktopIndexList) -{ - if (desktopIndexList.size() < 2) - { - return; - } - - for (auto iter = desktopIndexList.cbegin(); - iter != desktopIndexList.cend() -1; iter++) - { - const auto destDesktopIndex = *iter; - const auto srcDesktopIndex = *(iter + 1); - moveDesktopWindows(srcDesktopIndex, destDesktopIndex); - } -} - -// static -WId MultitaskViewModel::getWindowId(KWin::EffectWindow *window) -{ - return window->parent()->property("windowId").toULongLong(); -} - -QUuid MultitaskViewModel::getUuid(KWin::EffectWindow *window) -{ -// qDebug() << "Uuid: " << window->parent()->property("internalId").toUuid(); - return window->parent()->property("internalId").toUuid(); -} - - -// static -QVector MultitaskViewModel::createDesktopIndexList(int srcDesktopIndex, int destDesktopIndex) -{ - QVector desktopIndexList; - - if (!validateDesktopIndex(srcDesktopIndex) - || !validateDesktopIndex(destDesktopIndex)) - { - return desktopIndexList; - } - - if (srcDesktopIndex > destDesktopIndex) - { - for (auto index = destDesktopIndex; index <= srcDesktopIndex; index++) - { - desktopIndexList.append(index); - } - } - else - { - for (auto index = destDesktopIndex; index >= srcDesktopIndex; index--) - { - desktopIndexList.append(index); - } - } - - return desktopIndexList; -} - -// static -bool MultitaskViewModel::validateDesktopIndex(int desktopIndex) -{ - return desktopIndex >= 1 && desktopIndex <= MAX_DESKTOP_COUNT; -} - -bool MultitaskViewModel::validateScreenIndex(int screenIndex) const -{ - return screenIndex >= 0 && screenIndex < logicalScreenCount(); -} - -// static -bool MultitaskViewModel::shouldAcceptWindow(KWin::EffectWindow* window) -{ - return !window->isDeleted() - && window->isNormalWindow() - && !window->isSkipSwitcher() - && window->isOnCurrentActivity() - && window->acceptsFocus(); -} - -void MultitaskViewModel::connectSignals() -{ - QObject::connect(KWin::effects, &KWin::EffectsHandler::windowAdded, - this, &MultitaskViewModel::onWindowAdded); - QObject::connect(KWin::effects, &KWin::EffectsHandler::windowDeleted, - this, &MultitaskViewModel::onWindowDeleted); - QObject::connect(KWin::effects, &KWin::EffectsHandler::windowActivated, - this, &MultitaskViewModel::onWindowActivated); - QObject::connect(KWin::effects, &KWin::EffectsHandler::desktopPresenceChanged, - this, &MultitaskViewModel::onDesktopPresenceChanged); - QObject::connect(KWin::effects, SIGNAL(desktopChanged(int, int)), - this, SIGNAL(currentDesktopChanged(int, int))); - // QObject::connect(KWin::effects, &KWin::EffectsHandler::numberScreensChanged, - // this, &MultitaskViewModel::onNumberScreensChanged); - QObject::connect(KWin::effects, &KWin::EffectsHandler::virtualScreenSizeChanged, - this, &MultitaskViewModel::screenSizeChanged); - QDBusConnection::sessionBus().connect("com.kylin.statusmanager.interface", - "/", - "com.kylin.statusmanager.interface", - "mode_change_signal", - this, - SLOT(tabletModeChanged(bool))); - QDBusConnection::sessionBus().connect("com.kylin.statusmanager.interface", - "/", - "com.kylin.statusmanager.interface", - "rotations_change_signal", - this, - SLOT(rotationModeChanged(QString))); -} - -} // namespace MultitaskView diff --git a/windowsview/multitaskviewmodel.h b/windowsview/multitaskviewmodel.h deleted file mode 100644 index 3add61c89d2b025c3d04efd943475b7e8eda685a..0000000000000000000000000000000000000000 --- a/windowsview/multitaskviewmodel.h +++ /dev/null @@ -1,321 +0,0 @@ -#ifndef MULTITASKVIEWMODEL_H -#define MULTITASKVIEWMODEL_H - -#include -#include -#include -#include -#include -#include -#include - -#include - -class QGSettings; - -namespace MultitaskView { - -class Window -{ - Q_GADGET - - Q_PROPERTY(int id READ id) - - Q_PROPERTY(QString caption READ caption) - - Q_PROPERTY(int x READ x) - - Q_PROPERTY(int y READ y) - - Q_PROPERTY(int width READ width) - - Q_PROPERTY(int height READ height) - - Q_PROPERTY(bool minimized READ minimized) - - Q_PROPERTY(QUuid uuid READ uuid) - -public: - - Window() = default; - - Window(int id, const QString& caption, int x, int y, int width, int height, bool minimized, QUuid uuid) - : id_(id), - caption_(caption), - x_(x), - y_(y), - width_(width), - height_(height), - minimized_(minimized), - uuid_(uuid) - { - } - - int id() const - { - return id_; - } - - QUuid uuid() const - { - return uuid_; - } - - const QString& caption() const - { - return caption_; - } - - int x() const - { - return x_; - } - - int y() const - { - return y_; - } - - int width() const - { - return width_; - } - - int height() const - { - return height_; - } - - bool minimized() const - { - return minimized_; - } - -private: - - int id_ = 0; - - QUuid uuid_; - - QString caption_; - - int x_ = 0; - - int y_ = 0; - - int width_ = 0; - - int height_ = 0; - - bool minimized_ = false; -}; - - -class Screen -{ - Q_GADGET - - Q_PROPERTY(int index READ index) - - Q_PROPERTY(QList windowList READ windowList) - -public: - - Screen() = default; - - Screen(int index, const QList& windowList) - : index_(index), - windowList_(windowList) - {} - - int index() const - { - return index_; - } - - const QList& windowList() const - { - return windowList_; - } - -private: - - int index_ = 0; - - QList windowList_; -}; - -class Desktop -{ - Q_GADGET - - Q_PROPERTY(int index READ index) - - Q_PROPERTY(QList screenList READ screenList) - -public: - - Desktop() = default; - - Desktop(int index, const QList& screenList) - : index_(index), - screenList_(screenList) - {} - - int index() const - { - return index_; - } - - const QList& screenList() const - { - return screenList_; - } - -private: - - int index_ = 1; - - QList screenList_; -}; - -class MultitaskViewModel : public QObject -{ - Q_OBJECT - - Q_PROPERTY(int logicalScreenCount READ logicalScreenCount NOTIFY screenCountChanged) - - Q_PROPERTY(bool isTabletMode READ isTabletMode) - - Q_PROPERTY(QString rotationMode READ rotationMode NOTIFY rotationModeChanged) - -public: - - explicit MultitaskViewModel(QObject *parent = nullptr); - - ~MultitaskViewModel(); - - Q_INVOKABLE QList getAppWindowList(int desktopIndex, int screenIndex) const; - - Q_INVOKABLE void removeAppWindow(QUuid windowId); - - Q_INVOKABLE void removeAllAppWindowOnDesktop(int desktopIndex); - - Q_INVOKABLE void moveAppWindowToDesktop(QUuid windowId, int srcDesktopInex, int destDesktopInex) const; - - Q_INVOKABLE void activateAppWindow(QUuid windowId); - - Q_INVOKABLE QIcon getWindowIcon(QUuid windowId); - - Q_INVOKABLE QList getDesktopList() const; - - Q_INVOKABLE void removeDesktop(int desktopIndex); - - Q_INVOKABLE void appendDesktop(); - - Q_INVOKABLE void moveDesktop(int srcDesktopIndex, int destDesktopIndex); - - Q_INVOKABLE int getCurrentDesktop(); - - Q_INVOKABLE void setCurrentDesktop(int desktopIndex); - - Q_INVOKABLE QRect getFullScreenGeometry(int desktopIndex, int screenIndex) const; - - Q_INVOKABLE bool hasModalChildWindow(QUuid windowId); - - bool isTabletMode() const; - - Q_INVOKABLE QString getUKUIStyleName() const; - - Q_INVOKABLE int getUKUIFontSize() const; - -signals: - - void appWindowCreated(int windowId); - - void appWindowRemoved(int windowId); - - void appWindowActivated(); - - void appWindowDesktopChanged(int windowId, int oldDesktopIndex, int newDesktopIndex); - - void desktopRemoved(int desktopIndex); - - void desktopAppended(int desktopIndex); - - void desktopMoved(int oldDesktopIndex, int newDesktopIndex); - - void currentDesktopChanged(int oldCurrentDesktopIndex, int newCurrentDesktopIndex); - - void screenCountChanged(int oldScreentCount, int newScreenCount); - - void screenSizeChanged(); - - void tabletModeChanged(bool); - - void rotationModeChanged(QString); - -private slots: - - void onWindowAdded(KWin::EffectWindow* window); - - void onWindowDeleted(KWin::EffectWindow* window); - - void onWindowActivated(KWin::EffectWindow* window); - - void onDesktopPresenceChanged(KWin::EffectWindow* window, int oldDesktopIndex, int newDesktopIndex); - - void onNumberScreensChanged(); - -private: - - void updateScreenCount(); - - static bool isExtensionMode(); - - int logicalScreenCount() const; - - QString rotationMode() const; - - QList createWindowList(int desktopIndex, int screenIndex); - - void updateModelData(); - - void moveDesktopWindows(int srcDesktopIndex, int destDesktopIndex); - - void moveDesktopsOneStep(const QVector& desktopIndexList); - - static QVector createDesktopIndexList(int srcDesktopIndex, int destDesktopIndex); - - static bool validateDesktopIndex(int desktopIndex); - - bool validateScreenIndex(int screenIndex) const; - - static WId getWindowId(KWin::EffectWindow* window); - - static QUuid getUuid(KWin::EffectWindow *window); - - static bool shouldAcceptWindow(KWin::EffectWindow* window); - - void connectSignals(); - -private: - - // 虚拟桌面列表 - QList desktopList_; - - // 屏幕数量 - int screenCount_ = 0; - - // 最大虚拟桌面数量为16 - static constexpr int MAX_DESKTOP_COUNT = 16; - - // 初始化为0,这样首次打开时就没有桌面index与lastDesktopIndex相同 - int lastDesktopIndex = 0; - - QGSettings* settings_ = nullptr; -}; - -} // namespace MultiTaskView - -#endif // MULTITASKVIEWMODEL_H diff --git a/windowsview/qml/AppArea.qml b/windowsview/qml/AppArea.qml index 1c7bd5a62bdc2465c09b4d898672dfaa698b868b..b0d378bea15d59bf4d5912c42b97d939687cf776 100644 --- a/windowsview/qml/AppArea.qml +++ b/windowsview/qml/AppArea.qml @@ -1,30 +1,65 @@ +/* + * Copyright (C) 2022, KylinSoft Co., Ltd. + + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + import QtQuick 2.12 -import QtQuick.Controls 2.5 import QtQuick.Layouts 1.3 -import QtQuick.Window 2.12 -import org.kde.kwin 3.0 as KWinComponents -import QtGraphicalEffects 1.0 import "Controller.js" as Controller -import IconTheme 1.0 -Rectangle { - id : appArea - width : 100 - height : 100 - color : "transparent" - property ListModel appModel : null - property var rootRect : null - property var appAreaController : null - - ScrollView{ +import org.ukui.positioner 1.0 +import org.ukui.quick.items 1.0 as UkuiItem + +FocusScope { + id : root + property var appAreaController : new Controller.AppController(multitaskViewModel, root, multitaskViewManager, ["none"]) + property int currentTabIndex: 0 + + Flickable { id : scrollArea - width : parent.width - height : parent.height - property var flowRows : 0 - contentWidth : parent.width - contentHeight : flowRows * ((rootRect.height / 22 * 5) + 12 + 40) > parent.height ? flowRows * ((rootRect.height / 22 * 5) + 12 + 40) : parent.height - ScrollBar.horizontal.policy : ScrollBar.AlwaysOff - ScrollBar.vertical.policy : ScrollBar.AlwaysOff + anchors.fill : parent + // 预览图布局区域 y 轴起始高度 + property int scrollViewYStartPoint : 32 * scaleFactor + // 预览图布局区域距离左侧和右侧的间距 + property int scrollViewLeftSpace : isVerticalLayout ? 32 : 0 + anchors.leftMargin: scrollViewLeftSpace //注意:间距为0则无法显示滚动条 + anchors.rightMargin: scrollViewLeftSpace + anchors.topMargin: 0 + anchors.bottomMargin: 0 + property ListModel windowPosInfoModel: ListModel{} + property var rowSpacing : isVerticalLayout ? Math.floor(16 * scaleFactor) : Math.floor(10 * scaleFactor) + property var columnSpacing : isVerticalLayout ? Math.floor(16 * scaleFactor) : Math.floor(10 * scaleFactor) + height: parent.height + width: parent.width + contentWidth : parent.width - scrollViewLeftSpace * 2 + contentHeight : Math.max(flow.height, height) clip : true + + UkuiItem.DtThemeScrollBar.vertical: UkuiItem.DtThemeScrollBar { + id: vScrollBar + Accessible.role: Accessible.ScrollBar + Accessible.name: "apparea-vertical-scrollbar" + Accessible.description: "a scroll bar, which allows the user to scroll the visible area" + parent: scrollArea.parent + anchors.top: scrollArea.top + anchors.left: scrollArea.right + anchors.bottom: scrollArea.bottom + visual : flow.height > scrollArea.height + } + MouseArea{ anchors.fill : parent onClicked : { @@ -32,185 +67,285 @@ Rectangle { } } - Flow{ - id : flowLayout - spacing : 0 - width : screenRect.width + + NumberAnimation { + id : scrollMoveAnimation + target : vScrollBar + property : "position" + from : vScrollBar.position + duration : 300 + easing.type : Easing.InOutQuart + } + + UkuiFlow { + id : flow + property bool needFlowYAnimation : false + + spacing : scrollArea.rowSpacing + topPadding: scrollArea.scrollViewYStartPoint + width : parent.width flow : Flow.LeftToRight + layoutDirection: isLayoutLeftToRight ? Qt.LeftToRight : Qt.RightToLeft + lineHorizontalCenterAlignment: true move :Transition { //子项增加时或者减少时的过度,也就是子项的visible变化的过度 NumberAnimation { properties : "x,y"; easing.type : Easing.InOutQuad; - duration : 500 + duration : isVerticalLayout ? 500 : 300 } } - Repeater{ - property int cnt : 0 - id : rep - model : appModel - function adjustSize(){ - // 计算当前布局的方式 - var sqrtCnt = Math.ceil(Math.sqrt(rep.cnt)); - var cols = sqrtCnt; - if (cols > 3) { - cols = 3; + onHeightChanged: { + y = Math.max((scrollArea.height - flow.height) / 2, 0) + } + + // flow 垂直居中动画 + Behavior on y { + enabled: flow.needFlowYAnimation + NumberAnimation { + duration : isVerticalLayout ? 500 : 300 + easing.type : Easing.InOutQuart + } + } + + onPositioningComplete: { + updateWindowPosInfo() + } + + function updateWindowPosInfo() { + var rowWindowNum = 0 //窗口区域每行的窗口数 + var leftX = 0 + var rightX = 0 + var rowY = flow.topPadding + var itemCount = 0 + var winModel = [] + scrollArea.windowPosInfoModel.clear() + + for (let i = 0; i < flow.children.length; ++i) { + if (flow.children[i].width === 0) { + continue } - var lineWidth = rootRect.width; - // 调整矩形框的大小 - for(var i = 0; i < rep.cnt; i += cols) + // 根据预览窗 Y 坐标判断是否到下一行 + if (flow.children[i].y !== rowY) { + if (winModel.length > 0) { + scrollArea.windowPosInfoModel.append({model : winModel, rowWindowCount : rowWindowNum}) + winModel = [] + rowWindowNum = 0 + } + rowY += flow.children[i].height + flow.spacing + } + + // 更新预览窗在 Flow 布局中的 X 坐标并存入局部 model + itemCount++ + leftX = flow.children[i].x + rightX = leftX + flow.children[i].width + winModel.push({index: itemCount - 1, leftX: leftX, rightX: rightX}) + rowWindowNum++ + } + if (winModel.length > 0) { + scrollArea.windowPosInfoModel.append({model : winModel, rowWindowCount : rowWindowNum}) + } + } + + Repeater { + id : previewWindowRepeater + model : appAreaModel + activeFocusOnTab: count !== 0 ? true : false + focus : false + + delegate: Rectangle { + id : thumbnailitem + width: appWindow.width + height: appWindow.height + focus: true + color : "transparent" + property var thumbWidth : getThumbnailSize()[0] + property var thumbHeight : getThumbnailSize()[1] + property string uuid: model.Uuid + + states: [ + State { + name : "tabActive" + when: previewWindowRepeater.activeFocus && index === currentTabIndex && (multitaskViewManager.shouldShowTabBorder) + PropertyChanges { + target: appWindow.borderRectangle + borderColor : tabFocusBorderColor + } + } + ] + + function getThumbnailSize() { - var blockWidth = Math.floor(lineWidth / Math.min(cols, rep.cnt - i)); - for(var j = 0;j < Math.min(cols, rep.cnt - i); ++j) - { - if(itemAt(i + j)){ - itemAt(i + j).width = blockWidth + var thumbHeight = thumbRectangleHeight + var max_width = parent.width / 3 + var clientWidth = model.Width + var clientHeight = model.Height + var thumbWidth = Math.floor(thumbHeight * clientWidth / clientHeight) + if (thumbWidth > max_width) { + thumbWidth = max_width + thumbHeight = Math.floor(thumbWidth * clientHeight / clientWidth) + } + return [thumbWidth, thumbHeight] + } + + AppPreviewWindow { + id : appWindow + // Warning: 因为 appWindow 的 parent 会改变,所以不要使用 parent 获取宽高 + minWidth: Math.floor(root.width / 10) + + thumbHeight : thumbnailitem.thumbHeight + thumbWidth : thumbnailitem.thumbWidth + windowType : "app" + x_wid : model.Id + wid : model.Uuid + icon : model.Icon + caption : model.Caption + parent: thumbnailitem + + Drag.onActiveChanged : { + if (!Drag.active) { + var fromPos = mapToItem(thumbnailitem, 0, 0) + posX = fromPos.x + posY = fromPos.y + appAreaController.onSourceDropped(appWindow, rootWindow.highlightDesktop, rootWindow.highlightDesktop) + } else { + //拖拽动画开始前,修改 appWindow 父对象 + appWindow.parent = allroot + zoomOutAnimation() } } } - scrollArea.flowRows = Math.ceil(rep.cnt/cols) + }//Rectangle + + onActiveFocusChanged: { + if (previewWindowRepeater.activeFocus) { + currentTabIndex = 0 + if (vScrollBar.position > 0) { + scrollMoveAnimation.to = 0 + scrollMoveAnimation.start() + } + multitaskViewManager.activeAreaChangeDataCollect("Windows Preview Area") + } } onItemAdded : { - cnt++; - adjustSize(); + if (flow.needFlowYAnimation !== false) { + flow.needFlowYAnimation = false + } } onItemRemoved : { - cnt--; - adjustSize(); + if (flow.needFlowYAnimation !== true) { + flow.needFlowYAnimation = true + } } - Rectangle{ - id : thumbnailitem - height : (rootRect.height / 22 * 5) + 12 + 40 - color : "transparent" - radius : 14 - function thumbwidth(){ - var max_height = rootRect.height / 22 * 5 - 12 - var max_width = rootRect.width / 3 - 12 - var oriW = model.width; - var oriH = model.height; - var dh, dw; - var isfind = 0; - // 情况2 - dh = max_height - dw = oriW * dh / oriH; - if(dw <= max_width){ - isfind = 1; - } - // 情况1 - if(!isfind){ - dw = max_width - dh = oriH * max_width / oriW - } - return dw + Keys.onPressed: { + if (rootWindow.isWlcom) { + multitaskViewManager.keyNavigationDataCollect(event.key) } + if (event.key === Qt.Key_Left) { + if (currentTabIndex > 0) { + currentTabIndex = currentTabIndex - 1 + } else if (currentTabIndex === 0) { + currentTabIndex = previewWindowRepeater.count - 1 + } + event.accepted = true - function thumbheight(){ - var max_height = rootRect.height / 22 * 5 - 12 - var max_width = rootRect.width / 3 - 12 - var oriW = model.width; - var oriH = model.height; - var dh, dw; - - var isfind = 0; - // 情况2 - dh = max_height - dw = oriW * dh / oriH - if(dw <= max_width){ - isfind = 1; + } else if (event.key === Qt.Key_Right ) { + if (currentTabIndex < previewWindowRepeater.count - 1) { + currentTabIndex = currentTabIndex + 1 + } else if (currentTabIndex === previewWindowRepeater.count - 1) { + currentTabIndex = 0 } - // 情况1 - if(!isfind){ - dw = max_width - dh = oriH * max_width / oriW + event.accepted = true + + } else if (event.key === Qt.Key_Up || event.key === Qt.Key_Down) { + var isKeyUp = event.key === Qt.Key_Up + currentTabIndex = appAreaController.keyUpDownSelectWindow(isKeyUp, scrollArea.windowPosInfoModel, currentTabIndex) + event.accepted = true + + } else if (event.key === Qt.Key_Tab) { + if (event.modifiers & Qt.MetaModifier) { + appAreaController.closeMultitaskView() + return } - return dh + currentTabIndex = 0 + focus = false // resolve warning: QQuickItem: Cannot set activeFocusOnTab to false once item is the active focus item. + event.accepted = false + + } else if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter || event.key === Qt.Key_Space) { + appAreaController.onWindowClicked(previewWindowRepeater.itemAt(currentTabIndex).uuid); + event.accepted = true + + } else if (event.key === Qt.Key_End) { + currentTabIndex = previewWindowRepeater.count - 1 + event.accepted = true + + } else if (event.key === Qt.Key_Home) { + currentTabIndex = 0 + event.accepted = true + + } else if (event.key === Qt.Key_PageUp || event.key === Qt.Key_PageDown) { + var isKeyPageUp = event.key === Qt.Key_PageUp + currentTabIndex = appAreaController.keyPageUpDownSelectWindow(isKeyPageUp, scrollArea.windowPosInfoModel, currentTabIndex) + event.accepted = true + + } else if (event.key === Qt.Key_Escape) { + appAreaController.closeMultitaskView() } - Rectangle { - id : appWindowAnchor - anchors.centerIn : parent - width : thumbnailitem.thumbwidth() + 12 > rootRect.width / 10 ? thumbnailitem.thumbwidth() + 12 : rootRect.width / 10 - height : parent.height - color : "transparent" - - PreviewWindow { - id : appWindow - width : thumbnailitem.thumbwidth() + 12 > rootRect.width / 10 ? thumbnailitem.thumbwidth() + 12 : rootRect.width / 10 - height : (rootRect.height/22*5) + 12 + 40 - previewAreaWidth : thumbnailitem.thumbwidth() + 12 > rootRect.width / 10 ? thumbnailitem.thumbwidth() + 12 : rootRect.width / 10 - previewAreaHeight : rootRect.height / 22 * 5 - windowType : "app" - controller : new Controller.AppController(multitaskViewModel, appWindow, multitaskViewManager, ["none"]); - - onNowDragActiveChanged : { - if(!appWindow.winowDragActive) { - appWindow.zoomOut() - var fromPos = appWindowBack.mapToItem(appWindowAnchor,0,0) - - appWindow.posX = fromPos.x - appWindow.posY = fromPos.y - appAreaController.onSourceDropped(appWindow,allroot.highlightDesktop,allroot.highlightDesktop) - } else { - appWindow.zoomIn() - } - } + if (event.key === Qt.Key_Tab || event.key === Qt.Key_Left || + event.key === Qt.Key_Right || event.key === Qt.Key_Up || + event.key === Qt.Key_Down || event.key === Qt.Key_Home || + event.key === Qt.Key_End || event.key === Qt.Key_PageUp || + event.key === Qt.Key_PageDown) { + multitaskViewManager.setShouldShowTabBorder(true) + } - states : [ - State { - name : "default" - PropertyChanges { target : appWindow; borderWidth : 0 } - PropertyChanges { target : appWindow; closeButtonVisble : false } - }, - - State { - name : "hover" - PropertyChanges { target : appWindow; borderWidth : 4 } - PropertyChanges { target : appWindow; closeButtonVisble : true } - } - ] - - Rectangle { - id : appWindowBack - anchors.horizontalCenter : appWindow.horizontalCenter - y : 40+5 - height : appWindow.previewAreaHeight-12 - width : appWindow.previewAreaWidth-12 - color : Qt.rgba(255,255,255, 0.5) - clip : true - visible: true - layer.enabled : multitaskViewManager.useOpenGL() ? true : false - layer.effect : OpacityMask{ - maskSource : Rectangle{ - height : appWindow.previewAreaHeight-12 - width : appWindow.previewAreaWidth-12 - radius : 8 - } - } - - KWinComponents.WindowThumbnailItem{ - id : tmp - anchors.centerIn : parent - z: appWindow.onTop ? 100 : 20 - height : thumbnailitem.thumbheight() - width : thumbnailitem.thumbwidth() - wId: model.uuid - clip : true - } - } + if (event.accepted) { + scrollToTabItem() + } + } - Component.onCompleted : { - appWindow.setCaption(model.caption) - appWindow.setId(model.uuid) - } - } + function scrollToTabItem() { + var currentNextY = itemAt(currentTabIndex).mapToItem(scrollArea, 0, 0).y + var previewWindowHeight = itemAt(currentTabIndex).height + if (currentNextY < 0) { + scrollMoveAnimation.to = vScrollBar.position - (-currentNextY) / scrollArea.contentHeight + scrollMoveAnimation.start() + } else if (currentNextY + previewWindowHeight > scrollArea.height) { + scrollMoveAnimation.to = vScrollBar.position + (currentNextY + previewWindowHeight - scrollArea.height) / scrollArea.contentHeight + scrollMoveAnimation.start() } - }//Rectangle + } }//Repeater + + Component.onCompleted: { + if (appAreaModel.rowCount() !== 0) { + previewWindowRepeater.forceActiveFocus() + } + // 无应用窗口时不获取tab焦点 + } + + Connections { + target: rootWindow.isWlcom ? multitaskViewManager : null + function onTaskViewShowed() { + if (appAreaModel.rowCount() !== 0) { + previewWindowRepeater.forceActiveFocus() + } + } + } + + Connections { + target: previewWindowRepeater + enabled: !multitaskViewManager.winTabVisible + function onCountChanged() { + flow.forceLayout(); + } + } }//Flow }//ScrollView } diff --git a/windowsview/qml/AppPreviewWindow.qml b/windowsview/qml/AppPreviewWindow.qml new file mode 100644 index 0000000000000000000000000000000000000000..05b34a8c13ef5d2668b17283576decf5edd33626 --- /dev/null +++ b/windowsview/qml/AppPreviewWindow.qml @@ -0,0 +1,320 @@ +/* + * Copyright (C) 2022, KylinSoft Co., Ltd. + + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +/* + 每个预览窗口的UI设计 +*/ +import QtQuick 2.12 +import QtQuick.Layouts 1.3 +import QtGraphicalEffects 1.0 +import "Controller.js" as Controller +//ukui-quick +import org.ukui.quick.items 1.0 as UkuiItem +import org.ukui.quick.platform 1.0 as UkuiPlatform + +Rectangle { + id : root + color : "transparent" + + /** windowType is the type of PreviewWindow, + * the options are : none, app, desktop, creation. + * Default to none. + */ + property string windowType : "none" + + /** stateList is the list of state, + * the options are : default, hover, drag, receive. + * Default to default. + */ + property var stateList : ["default", "hover", "drag", "receive"]; + state : "default" + property string wid : "" + property int x_wid : -1 + property var thumbHeight + property var thumbWidth + property real posX : 0 + property real posY : 0 + property double titleOpacity : 1 + property var controller : new Controller.AppController(multitaskViewModel, root, multitaskViewManager, ["none"]); + property var icon + Drag.active : previewMouseArea.drag.active + Drag.source : root + Drag.hotSpot.x : root.width / 2 + Drag.hotSpot.y : root.height / 2 + property alias borderRectangle : previewArea + property alias caption : caption.text + + // 定义缩放比例系数变量 + property double scaleValue : 0.0 + property double windowDragX : 0.0 + property double windowDragY : 0.0 + property double windowOriginalX : 0.0 + property double windowOriginalY : 0.0 + + // 定义应用预览窗各间距、宽高 + property int spacingWidth: 2 * scaleFactor // focus边框与预览图间距 + property int appThumbnailMargin: appBorderWidth + spacingWidth + property int minWidth: thumbWidth + 2 * appThumbnailMargin + width: Math.max(thumbWidth + 2 * appThumbnailMargin, minWidth) + height: captionRow.height + previewArea.height + mainColumnLayout.spacing + 2 * appThumbnailMargin + + + states : [ + State { + name : "default" + PropertyChanges { + target : previewArea + borderColor : root.parent.state == "tabActive" ? tabFocusBorderColor : defaultBorderColor + } + PropertyChanges { target : previewWindowCloseButton; visible : rootWindow.isTouchState ? true : false } + }, + State { + name : "hover" + PropertyChanges { + target : previewArea + borderColor : root.parent.state == "tabActive" ? tabFocusBorderColor : hoverBorderColor + } + PropertyChanges { target : previewWindowCloseButton; visible : true } + } + ] + + MouseArea { + id : previewMouseArea + anchors.fill : parent + hoverEnabled : true + preventStealing : true + drag.axis : Drag.XAndYAxis + drag.target : root + + Accessible.role: Accessible.Button + Accessible.name: "active-window-" + root.caption + Accessible.description: "preview-window, click to active the app window" + + onEntered : { + root.state = "hover" + } + onExited : { + root.state = "default" + } + onPressed : { + windowDragX = mouseX + windowDragY = mouseY + + //拖拽开始时相对于 mainView 的初始位置 + var originalPos = mapToItem(allroot, 0, 0) + windowOriginalX = originalPos.x + windowOriginalY = originalPos.y + } + onClicked : { + controller.onWindowClicked(wid); + } + onReleased : { + root.Drag.drop(); + } + + ColumnLayout { + id: mainColumnLayout + anchors.fill: parent + anchors.centerIn : parent + spacing : 10 * scaleFactor // 标题栏与预览图外边框间距 + + RowLayout { + id : captionRow + spacing : Math.floor(8 * scaleFactor) + Layout.fillHeight : true + Layout.preferredHeight : iconAndCloseButtonHeight + Layout.leftMargin : appBorderWidth + spacingWidth + Layout.rightMargin: appBorderWidth + opacity : titleOpacity + layoutDirection: isLayoutLeftToRight ? Qt.LeftToRight : Qt.RightToLeft + + UkuiItem.Icon { + id: iconItem + width: iconAndCloseButtonHeight + height: width + source: icon + } + + UkuiItem.DtThemeText { + id : caption + verticalAlignment: Qt.AlignVCenter + horizontalAlignment: isLayoutLeftToRight ? Qt.AlignLeft : Qt.AlignRight + elide : isLayoutLeftToRight ? Text.ElideRight : Text.ElideLeft + Layout.fillWidth : true + text : "" + textColor : UkuiPlatform.GlobalTheme.kFontWhite + } + + CloseButton { + id : previewWindowCloseButton + width : iconAndCloseButtonHeight + height : width + radius : width / 2 + windowType : "app" + + Accessible.name: "close-window-" + caption.text + Accessible.description: "close-button, click to close the app window" + + onExited: { + if (!previewMouseArea.containsMouse) { + root.state = "default" + } + } + onClicked: { + controller.removePreviewWindow(root.wid) + } + } + }//RowLayout + + UkuiItem.DtThemeBackground { + id : previewArea + Layout.fillWidth: true + Layout.fillHeight: false + Layout.preferredHeight : thumbRectangleHeight + 2 * appThumbnailMargin + color : "transparent" + borderColor : tabFocusBorderColor + border.width : appBorderWidth + radius : UkuiPlatform.GlobalTheme.kRadiusWindow * scaleFactor + + Rectangle { + id : appWindowBack + anchors.centerIn: parent + height : thumbHeight + width : thumbWidth + radius : UkuiPlatform.GlobalTheme.kRadiusMenu * scaleFactor + color : Qt.rgba(1, 1, 1, 0.5) + clip : true + layer.enabled : appWindowBack.radius !== 0 + layer.effect : OpacityMask { + maskSource : Rectangle { + height : thumbHeight + width : thumbWidth + radius : appWindowBack.radius + } + } + Loader { + id : appWindowLoader + property string thumbnailId : wid + height : thumbHeight + width : thumbWidth + anchors.centerIn: parent + source: isWlcom ? "ThumbnailWithWlcom.qml" : "ThumbnailWithKwin.qml" + } + } + } + }//culumnLayout + } + + function returnOriginal(x, y) { + zoomInAnimation() + } + + function zoomOutAnimation() { + transformId.origin.x = windowDragX + transformId.origin.y = windowDragY + scaleValue = 0.38 + titleOpacity = 0 + scaleDownAnimation.restart() + } + + function zoomInAnimation() { + transformId.origin.x = windowDragX + transformId.origin.y = windowDragY + scaleValue = 1 + titleOpacity = 1 + scaleUpAnimation.restart() + } + + + transform : Scale{ + id : transformId + } + + ParallelAnimation{ + id : scaleDownAnimation + NumberAnimation { + target : transformId + property : "xScale" + to : scaleValue + duration : 300 + easing.type : Easing.InOutQuart + } + NumberAnimation{ + target : transformId + property : "yScale" + to : scaleValue + duration : 300 + easing.type : Easing.InOutQuart + } + NumberAnimation{ + target : captionRow + property : "opacity" + to : titleOpacity + duration : 300 + easing.type : Easing.InOutQuart + } + } + + ParallelAnimation{ + id : scaleUpAnimation + NumberAnimation { + target : transformId + property : "xScale" + to : scaleValue + duration : 300 + easing.type : Easing.InOutQuart + } + NumberAnimation{ + target : transformId + property : "yScale" + to : scaleValue + duration : 300 + easing.type : Easing.InOutQuart + } + NumberAnimation{ + target : captionRow + property : "opacity" + to : titleOpacity + duration : 300 + easing.type : Easing.InOutQuart + } + + NumberAnimation { + target: root + property: "x" + duration: 300 + to: windowOriginalX + easing.type: Easing.InOutQuad + } + NumberAnimation { + target: root + property: "y" + duration: 300 + to: windowOriginalY + easing.type: Easing.InOutQuad + } + + onFinished: { + //拖拽还原动画结束后,将 appWindow 的父对象改回 thumbnailitem,并重新设置坐标 + appWindow.parent = thumbnailitem + appWindow.x = 0 + appWindow.y = 0 + } + } +} diff --git a/windowsview/qml/ArrowButton.qml b/windowsview/qml/ArrowButton.qml new file mode 100644 index 0000000000000000000000000000000000000000..d4abadadafedee31fadb45ad4043528ef7f45b94 --- /dev/null +++ b/windowsview/qml/ArrowButton.qml @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2022, KylinSoft Co., Ltd. + + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import QtQuick 2.12 +//ukui-quick +import org.ukui.quick.items 1.0 as UkuiItem +import org.ukui.quick.platform 1.0 as UkuiPlatform + +UkuiItem.DtThemeBackground { + id : arrowButton + width : Math.floor(48 * scaleFactor) + height : width + radius : UkuiPlatform.GlobalTheme.kRadiusNormal + backgroundColor: buttonMouseArea.containsPress ? UkuiPlatform.GlobalTheme.kContainClick + : buttonMouseArea.containsMouse ? UkuiPlatform.GlobalTheme.kContainHover : UkuiPlatform.GlobalTheme.kContainGeneralNormal + property var direction : "right" + + Accessible.role: Accessible.Button + Accessible.name: "arrow button" + direction + Accessible.description: "a push button, click to move the parent view "+ direction + + UkuiItem.Icon { + id: arrowIcon + anchors.centerIn: parent + width: parent.width / 2 + height: width + source: direction == "right" ? "ukui-end-symbolic" : "ukui-start-symbolic" + mode: UkuiItem.Icon.AutoHighlight + } + + MouseArea { + id: buttonMouseArea + anchors.fill: parent + hoverEnabled: true + + onClicked : { + if (direction == "left") { + if (desktopListView.contentX + desktopListView.contentXoffset - desktopMoveDistance > 0) { + contentMoveAnimation.to = desktopListView.contentX - desktopMoveDistance + contentMoveAnimation.start() + } else { + contentMoveAnimation.to = 0 - desktopListView.contentXoffset + contentMoveAnimation.start() + } + } + + if (direction == "right") { + if (desktopListView.contentX + desktopListView.contentXoffset + desktopMoveDistance < desktopListView.contentWidth-desktopListView.width) { + contentMoveAnimation.to = desktopListView.contentX + desktopMoveDistance + contentMoveAnimation.start() + } else { + contentMoveAnimation.to = desktopListView.contentWidth - desktopListView.width - desktopListView.contentXoffset + contentMoveAnimation.start() + } + } + + } + } +} diff --git a/windowsview/qml/CloseButton.qml b/windowsview/qml/CloseButton.qml index 18d902e4e573c4fd439a490cc6632ab64675f6d6..9c8e2594cc77b4d7006074c8a8c91b0fa1ebbe23 100644 --- a/windowsview/qml/CloseButton.qml +++ b/windowsview/qml/CloseButton.qml @@ -1,85 +1,104 @@ +/* + * Copyright (C) 2022, KylinSoft Co., Ltd. + + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + import QtQuick 2.12 -import QtQuick.Controls 2.5 -import QtQuick.Layouts 1.3 -import "Controller.js" as Controller -import IconTheme 1.0 -import QtGraphicalEffects 1.0 -// import org.kylin.qqc2style.private 1.0 as StylePrivate +import org.ukui.quick.items 1.0 +import org.ukui.quick.platform 1.0 -Rectangle { - id : closeButton +DtThemeBackground { + id : root + visible : false + state : "default" + border.width: 1 + border.color: "transparent" - property var closeButtonController : new Controller.CloseButtonController(multitaskViewModel, closeButton, multitaskViewManager, ["app"]) + property string windowType : "none" property var buttonStateList : ["default", "hover", "click"]; - state : "default" - property var closeButtonColor : closeButtonDefaultColor - property int wid : -1 property alias closeButtonContainMouse: closeButtonMouseArea.containsMouse - visible : closeButtonVisble - width : 24 - height : 24 - radius : 14 - color : closeButtonColor - - IconTheme { - anchors.centerIn : parent - width : 12 - height : 12 - iconName : "window-close-symbolic" - } - - function setStatus(status) { - if(buttonStateList.indexOf(status) < 0) - { - return; - } - if (status === state) { - return - } else { - state = status; + signal entered() + signal exited() + signal pressed() + signal clicked() + + Accessible.role: Accessible.Button + Accessible.name: "close button" + Accessible.description: "a push button, click to close the preview window or desktop" + Accessible.onPressAction: { root.clicked() } + + states : [ + State { + name : "default" + PropertyChanges { + target : root + backgroundColor: GlobalTheme.kContainGeneralAlphaNormal + } + }, + State { + name : "hover" + PropertyChanges { + target : root + backgroundColor: windowType == "desktop" ? GlobalTheme.kComponentAlphaHover : GlobalTheme.kComponentHover + } + }, + State { + name : "click" + PropertyChanges { + target : root + backgroundColor: windowType == "desktop" ? GlobalTheme.kComponentAlphaClick : GlobalTheme.kComponentClick + } } + ] + + Icon { + id: closeIcon + anchors.centerIn: parent + width: parent.width / 2 + height: parent.height / 2 + source: "window-close-symbolic" + mode: parent.closeButtonContainMouse ? Icon.AutoHighlight + : windowType == "desktop" ? Icon.AutoHighlight : Icon.Highlight } - function setDefaultStatus() { - - setStatus("default") - } - - function setHoverStatus() { - - setStatus("hover") - } - - function setClickStatus() { - - setStatus("click") - } - - function setId(wId) { - wid = wId; - } - - MouseArea{ + MouseArea { id : closeButtonMouseArea anchors.fill : parent hoverEnabled : true + preventStealing: true onEntered: { - closeButtonController.setHoverStatus() + root.state = "hover" + root.entered() } - onExited: { - closeButtonController.setDefaultStatus() - if(!previewMouseArea.containsMouse) - { - previewWindow.setDefaultStatus() - } + root.exited() + root.state = "default" + } + onPressed: { + root.state = "press" + root.pressed() + } + onReleased: { + root.state = containsMouse ? "hover" : "default" } - onClicked: { - closeButtonController.setClickStatus() - controller.removePreviewWindow(wid); + root.clicked() } } } diff --git a/windowsview/qml/Controller.js b/windowsview/qml/Controller.js index 723ddca2c709b9a4282f90ff90a01b4494d49acc..eb6db99c9cf35ad51cb52809b5182932ac62f86b 100644 --- a/windowsview/qml/Controller.js +++ b/windowsview/qml/Controller.js @@ -1,3 +1,22 @@ +/* + * Copyright (C) 2022, KylinSoft Co., Ltd. + + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + // 控制器基类 class Controller { constructor(model, view, manager, acceptedTypeSet) { @@ -72,9 +91,7 @@ class Controller { onSourceDropped(source, srcDesktopIndex, destDesktopIndex) { if (this.validateSource(source)) { this.acceptSource(source, srcDesktopIndex, destDesktopIndex); - } - else - { + } else { this.rejectSource(source); } } @@ -93,34 +110,133 @@ class AppController extends Controller { // 删除预览窗口 removePreviewWindow(windowId) { - if (this.model.hasModalChildWindow(windowId)) - { + if (this.model.hasModalChildWindow(windowId)) { this.onWindowClicked(windowId); - } - else - { + } else { this.model.removeAppWindow(windowId); } } - // 设置拖拽态 - setDragStatus() { - this.view.setDragStatus(); + // 自己被释放 + onDropSource(source, srcDesktopIndex, destDesktopIndex) { + this.model.moveAppWindowToDesktop(source.wid, srcDesktopIndex, destDesktopIndex); } - // 自己进入目标 - onEnterTarget(srcDesktopIndex, destDesktopIndex) { - this.view.onEnterDropArea(); - } + // Up与Down键的走焦目标 + keyUpDownSelectWindow(keyStatus,windowPosInfoModel,currentTabIndex) + { + var currentRow = 0 + var currentRowWindowNum = 0 + var windowNum = 0 + + //计算当前获取键盘焦点的窗口位于第几行 + for(var i = 0; i < windowPosInfoModel.count; i++) { + windowNum += windowPosInfoModel.get(i).rowWindowCount + if (currentTabIndex < windowNum) { + currentRow = i + currentRowWindowNum = windowPosInfoModel.get(i).rowWindowCount + break + } + } - // 自己离开目标 - onExitTarget() { - this.view.onExitDropArea(); + //计算当前获取键盘焦点窗口的leftX rightX + var currentRowModel = windowPosInfoModel.get(currentRow).model + var currentIndexLeftX = 0 + var currentIndexRightX = 0 + for (var i = 0; i < currentRowWindowNum; i++) { + if (currentTabIndex === currentRowModel.get(i).index) { + currentIndexLeftX = currentRowModel.get(i).leftX + currentIndexRightX = currentRowModel.get(i).rightX + break + } + } + + //判断应该跳转到上/下一行的哪个窗口 + var lastRowModel + if (currentRow === 0 && keyStatus) { + lastRowModel = windowPosInfoModel.get(windowPosInfoModel.count - 1).model + } else if (currentRow === windowPosInfoModel.count - 1 && !keyStatus) { + lastRowModel = windowPosInfoModel.get(0).model + } else { + lastRowModel = keyStatus ? windowPosInfoModel.get(currentRow - 1).model + : windowPosInfoModel.get(currentRow + 1).model + } + + var lastIndex = 0 + var resultIndex = 0 + var result = 0 + for (var i = 0; i < lastRowModel.count; i++) { + var temp = 0 + if (lastRowModel.get(i).rightX < currentIndexLeftX) { + lastIndex = i + continue; + } + if (lastRowModel.get(i).leftX > currentIndexRightX) { + break; + } + if (lastRowModel.get(i).leftX <= currentIndexLeftX) { + if (lastRowModel.get(i).rightX <= currentIndexRightX) { + temp = lastRowModel.get(i).rightX - currentIndexLeftX + } else { + temp = currentIndexRightX - currentIndexLeftX + } + } else { + if (lastRowModel.get(i).rightX <= currentIndexRightX) { + temp = lastRowModel.get(i).rightX - lastRowModel.get(i).leftX + } else { + temp = currentIndexRightX - lastRowModel.get(i).leftX + } + } + + if (temp > result) { + result = temp; + lastIndex = i + } + } + resultIndex = lastRowModel.get(lastIndex).index + return resultIndex } - // 自己被释放 - onDropSource(source, srcDesktopIndex, destDesktopIndex) { - this.model.moveAppWindowToDesktop(source.wid, srcDesktopIndex, destDesktopIndex); + // PageUp与PageDown键的走焦目标 + keyPageUpDownSelectWindow(keyStatus,windowPosInfoModel,currentTabIndex) + { + var currentRow = 0 + var lastRowWindowNum = 0 + var currentRowWindowNum = 0 + var windowNum = 0 + + for(var i = 0; i < windowPosInfoModel.count; i++) + { + windowNum += windowPosInfoModel.get(i).rowWindowCount + if (currentTabIndex < windowNum) + { + if (i === 0 && keyStatus) + { + return currentTabIndex + } + else if (i === windowPosInfoModel.count - 1 && !keyStatus) + { + return currentTabIndex + } + currentRow = i + currentRowWindowNum = windowPosInfoModel.get(i).rowWindowCount + lastRowWindowNum = keyStatus ? windowPosInfoModel.get(i - 1).rowWindowCount + : windowPosInfoModel.get(i + 1).rowWindowCount + break + } + } + + //判断应该跳转到上一行的哪个窗口 + if (keyStatus) { + var lastRowModel = windowPosInfoModel.get(currentRow - 1).model + var resultIndex = lastRowModel.get(0).index + return resultIndex + } else{ + var lastRowModel = windowPosInfoModel.get(currentRow + 1).model + var resultIndex = lastRowModel.get(lastRowWindowNum - 1).index + return resultIndex + } + } } @@ -145,14 +261,8 @@ class DesktopController extends Controller { this.model.setCurrentDesktop(this.view.wid); } - // 设置拖拽态 - setDragStatus() { - this.view.setDragStatus(); - } - - // 设置拖拽接收态 - setReceiveStatus() { - this.view.setReceiveStatus(); + setCurrentDesktop(wid) { + this.model.setCurrentDesktop(wid); } // 自己进入目标 @@ -163,7 +273,6 @@ class DesktopController extends Controller { // 来源进入自己 onSourceEntered(source, srcDesktopIndex, destDesktopIndex) { - this.setReceiveStatus(); source.controller.onEnterTarget(srcDesktopIndex, destDesktopIndex); } @@ -195,17 +304,11 @@ class CreationController extends Controller { this.model.appendDesktop(); } - // 设置拖拽接收态 - setReceiveStatus() { - this.view.setReceiveStatus(); - } - // 来源进入自己 onSourceEntered(source) { if (!validateSource(source)) { return; } - this.setReceiveStatus(); source.controller.onEnterTarget(srcDesktopIndex, destDesktopIndex); } @@ -214,7 +317,6 @@ class CreationController extends Controller { if (!validateSource(source)) { return; } - this.setDefaultStatus(); source.controller.onExitTarget(); } diff --git a/windowsview/qml/DesktopArea.qml b/windowsview/qml/DesktopArea.qml index b0f207ed48a2d9bb8de1d27e79ace73b6a2c9d68..eb894bb1733ae79400ad61396f873acd34e16527 100644 --- a/windowsview/qml/DesktopArea.qml +++ b/windowsview/qml/DesktopArea.qml @@ -1,300 +1,318 @@ +/* + * Copyright (C) 2022, KylinSoft Co., Ltd. + + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + import QtQuick 2.12 -import QtQuick.Controls 2.5 import QtQuick.Layouts 1.3 import QtQuick.Window 2.12 -import org.kde.kwin 3.0 as KWinComponents import QtGraphicalEffects 1.0 -import "Controller.js" as Controller -import IconTheme 1.0 - -Rectangle { - id : desktopRect - x : 0 - y : 0 - width : 100 - height : 100 - color : desktopAreaColor - - property ListModel desktopModel : null - property var rootRect : null - property var desktopAreaController : null +import DesktopListModel 1.0 +//ukui-quick +import org.ukui.quick.items 1.0 as UkuiItem +import org.ukui.quick.platform 1.0 as UkuiPlatform +FocusScope { + id : root //虚拟桌面的各个参数 - property double desktopScale : 16/135 //虚拟桌面缩放比 - property int desktopThumbnailWidth : rootRect.width * desktopScale //虚拟桌面缩略图高度 - property int desktopThumbnailHeight : rootRect.height * desktopScale //虚拟桌面缩略图宽度 - property int desktopCaptionHeight : 24 //虚拟桌面标题栏高度 - property int desktopBorderWidth : 4 //虚拟桌面边框宽度 - property int desktopRectWidth : desktopThumbnailWidth + 2 * desktopBorderWidth - - - ListView { - id : desktopListView - y : desktopRect.height / 2 - desktopThumbnailHeight / 2 - 10 - width : parent.width - height : desktopRect.height - property bool initMultitask : true - orientation : ListView.Horizontal - model : listModel - spacing : 24 - footerPositioning : ListView.InlineFooter - - NumberAnimation { - id : desktopListViewLeftMarginAni - target : desktopListView - property : "leftMargin" - duration : 400 - easing.type : Easing.InOutQuad - } - - add : Transition { - NumberAnimation { - properties : "scale,opacity" - from : 0 - to : 1 - duration : 400 - easing.type : Easing.InOutQuad + property bool desktopHoverStatus : false + //虚拟桌面标题栏高度 + property int desktopCaptionHeight : Math.floor(32 * scaleFactor) + property int spacing : Math.floor(24 * scaleFactor) + property int desktopRectWidth : desktopThumbnailWidth + 2 * workspaceBorderWidth + property int desktopRectHeight : desktopRect.height + property int desktopMoveDistance : desktopRectWidth / 2 + + UkuiItem.DtThemeBackground { + id : desktopRect + anchors.fill : parent + useStyleTransparency : true + backgroundColor : UkuiPlatform.GlobalTheme.kContainGeneralNormal + + MouseArea { + id : desktopMouseArea + anchors.fill : parent + hoverEnabled : true + onEntered: { + desktopHoverStatus = true } - } - - remove : Transition{ - ParallelAnimation{ - NumberAnimation { - properties : "scale,opacity" - from : 1 - to : 0 - duration : 400 - easing.type : Easing.InOutQuad - } + onExited: { + desktopHoverStatus = false } - } - - removeDisplaced : Transition { - NumberAnimation { properties : "x,y"; duration : 1000 } - } - - move : Transition { - NumberAnimation { - property : "x" - duration : 200 - easing.type : Easing.InOutQuad + onClicked: { + focus = true } - } - moveDisplaced : Transition { - NumberAnimation { - property : "x" - duration : 200 - easing.type : Easing.InOutQuad - } - } - delegate : Rectangle { - id : desktopListViewDelegate - width : desktopThumbnailWidth + 2 * desktopBorderWidth - height : desktopThumbnailHeight + desktopCaptionHeight + 2 * desktopBorderWidth - color : "transparent" - PreviewWindow{ - id : desktopDragRect - width : desktopListViewDelegate.width - height : desktopListViewDelegate.height - dragAxis : Drag.XAxis - previewAreaWidth : desktopThumbnailWidth + 2 * desktopBorderWidth - previewAreaHeight : desktopThumbnailHeight + 2 * desktopBorderWidth - iconVisble : false - opacity : 1 - wid: value //工作区id会根据工作区的删除交换等操作改变,因此不使用函数赋值 - windowType : "desktop" - controller : new Controller.DesktopController(multitaskViewModel, desktopDragRect, multitaskViewManager, ["app","desktop"]); - captionText : "工作区 " + value //工作区名称会根据工作区的删除交换等操作改变,因此不使用函数赋值 - captionColor: desktopCaptionColor - property var nowDragActive : false - - onWinowDragActiveChanged : { - if(winowDragActive) - { - desktopMaskColor.visible = false - opacity = 0.75 - } - else - { - opacity = 1 - } - if (winowDragActive !== nowDragActive) { - nowDragActive = winowDragActive - } + onWheel: { + if (!hScrollBar.visible) { + return; + } + // 鼠标滚轮操作滚动条 + if (wheel.angleDelta.y > 0) { + hScrollBar.decrease(); + } else if (wheel.angleDelta.y < 0) { + hScrollBar.increase(); } + } - onNowDragActiveChanged : { - if(!desktopDragRect.winowDragActive) { - desktopDragRect.posX = 0 - desktopDragRect.posY = 0 - desktopAreaController.onSourceDropped(desktopDragRect,allroot.highlightDesktop,allroot.highlightDesktop) + Keys.onPressed: { + if (event.key === Qt.Key_Tab) { + if (appAreaModel.rowCount() !== 0) { + return } + // 强制转移焦点 + desktopListView.forceActiveFocus() + desktopListView.currentIndex = desktopListView.count - 1 + multitaskViewManager.setShouldShowTabBorder(true) + event.accepted = true } + } - states : [ - State { - name : "default" - PropertyChanges { target : desktopDragRect; borderWidth : allroot.highlightDesktop == value? 4 : 0 } - PropertyChanges { target : desktopDragRect; closeButtonVisble : false } - }, + ListView { + id : desktopListView + anchors.fill : parent + property bool initMultitask : true + orientation : ListView.Horizontal + layoutDirection: isLayoutLeftToRight ? Qt.LeftToRight : Qt.RightToLeft + property int contentXoffset : isLayoutLeftToRight ? 0 : contentWidth + model : desktopListModel + spacing : root.spacing + activeFocusOnTab: false + clip : true + keyNavigationEnabled: true + interactive: true + + UkuiItem.DtThemeScrollBar.horizontal: UkuiItem.DtThemeScrollBar { + id: hScrollBar + Accessible.role: Accessible.ScrollBar + Accessible.name: "desktoparea-horizontal-scrollbar" + Accessible.description: "a scroll bar, which allows the user to scroll the visible area" + policy: UkuiItem.DtThemeScrollBar.AsNeeded + visual: parent.contentWidth > parent.width + } - State { - name : "hover" - PropertyChanges { target : desktopDragRect; borderWidth : 4 } - PropertyChanges { target : desktopDragRect; closeButtonVisble : true } + onActiveFocusChanged: { + if (desktopListView.activeFocus) { + currentIndex = 0 } - ] - Rectangle { - id: workspace - anchors.horizontalCenter : desktopDragRect.horizontalCenter - x : desktopBorderWidth - y : desktopCaptionHeight+desktopBorderWidth+1 - width : desktopThumbnailWidth - height : desktopThumbnailHeight - color : Qt.rgba(255,255,255, 0.5) - clip :true - visible: true - layer.enabled : multitaskViewManager.useOpenGL() ? true : false - layer.effect : OpacityMask{ - maskSource : Rectangle{ - width : desktopThumbnailWidth - height : desktopThumbnailHeight - radius : 8 - } - } + // interactive == false,透传鼠标事件,使desktopMouseArea clicked事件得以触发,退出工作区名称编辑状态 + // interactive == true,截获鼠标事件,ListView交互生效 + interactive = !activeFocus + } - KWinComponents.DesktopBackground { - id : desktopThumbnailBackground - anchors.centerIn : parent - width : desktopThumbnailWidth - height : desktopThumbnailHeight - blurAlpha : 0 + Keys.onPressed: { + if (rootWindow.isWlcom) { + multitaskViewManager.keyNavigationDataCollect(event.key) } - DropArea { - id : previewDropArea - anchors.fill : parent - - onEntered : { - desktopMaskColor.visible = true - desktopDragRect.controller.onSourceEntered(drag.source,drag.source.wid,desktopDragRect.wid); + if (event.key === Qt.Key_PageUp || event.key === Qt.Key_Home) { + if (currentIndex === 0) { + return } - - onExited : { - desktopMaskColor.visible = false + currentIndex = 0 + if (isLayoutLeftToRight && desktopListView.contentX > 0) { + contentMoveAnimation.to = 0 + contentMoveAnimation.start() + } else if (!isLayoutLeftToRight && desktopListView.contentX + desktopListView.width < 0) { + contentMoveAnimation.to = - desktopListView.width + contentMoveAnimation.start() } - - onDropped : { - desktopMaskColor.visible = false - desktopDragRect.controller.onSourceDropped(drop.source,allroot.highlightDesktop,desktopDragRect.wid); - root.updateListModel() + } else if (event.key === Qt.Key_PageDown || event.key === Qt.Key_End) { + if (currentIndex === desktopListModel.rowCount() - 2) { + return } - } - - Repeater { - id : desktopWindowRepeater - model : listModel.get(index).model - - KWinComponents.WindowThumbnailItem { - id : desktopWindowThumbnail - width : model.width * desktopScale - height : model.height * desktopScale - visible : !(model.minimized) - x : (model.x - screenRect.x) * desktopScale - y : (model.y - screenRect.y) * desktopScale - wId : model.uuid - clip : true + currentIndex = desktopListModel.rowCount() - 2 + if (isLayoutLeftToRight && desktopListView.contentX < desktopListView.contentWidth - desktopListView.width) { + contentMoveAnimation.to = desktopListView.contentWidth - desktopListView.width + contentMoveAnimation.start() + } else if (!isLayoutLeftToRight && desktopListView.contentX + desktopListView.contentWidth > 0) { + contentMoveAnimation.to = - desktopListView.contentWidth + contentMoveAnimation.start() } + } else if (event.key === Qt.Key_Left && currentIndex === 0) { + // 当焦点在第一个工作区,不响应左键;在其他工作区则正常响应左键 + return } - Rectangle { - id : desktopMaskColor - visible : false - anchors.fill: parent - color : desktopMaskReceiveColor + if (event.key === Qt.Key_Tab || event.key === Qt.Key_Left || + event.key === Qt.Key_Right || event.key === Qt.Key_Home || + event.key === Qt.Key_End || event.key === Qt.Key_PageUp || + event.key === Qt.Key_PageDown) { + multitaskViewManager.setShouldShowTabBorder(true); + event.accepted = false; } } - } - } - onCountChanged : { - if (initMultitask) { - if (count === listModel.count) { - initMultitask = false; + //这里实现了虚拟桌面listview的居中 + NumberAnimation { + id : desktopListViewLeftMarginAni + target : desktopListView + property : isLayoutLeftToRight ? "leftMargin" : "rightMargin" + duration : 300 + easing.type : Easing.InOutQuad } - return; - } - var newWidth = desktopRectWidth * (count + 1) + desktopListView.spacing * (count) - desktopListViewLeftMarginAni.to = (parent.width - newWidth) / 2 < 0 ? 0 : (parent.width - newWidth) / 2 - desktopListViewLeftMarginAni.start() - } - - footer : Item { - id : newDesktopButton - width : desktopThumbnailWidth + 2 * desktopBorderWidth + 24 - height : desktopThumbnailHeight + desktopCaptionHeight + 2 * desktopBorderWidth - visible : desktopListView.count < 16 ? true : false + populate: Transition { + NumberAnimation { + properties : "scale,opacity" + from : 0 + to : 1 + duration : 300 + easing.type : Easing.InOutQuad + } + } - PreviewWindow { - id : spacingRect - anchors.fill : parent - anchors.leftMargin : 24 - previewAreaHeight : desktopThumbnailHeight+ 2 * desktopBorderWidth - previewAreaWidth :desktopThumbnailWidth+ 2 * desktopBorderWidth - captionColor: desktopCaptionColor - iconVisble : false - windowType : "creation" - controller : new Controller.CreationController(multitaskViewModel, spacingRect, multitaskViewManager, ["app"]); + add : Transition { + NumberAnimation { + properties : "scale,opacity" + from : 0 + to : 1 + duration : 400 + easing.type : Easing.InOutQuad + } + } + remove : Transition { + NumberAnimation { + properties : "scale,opacity" + from : 1 + to : 0 + duration : 400 + easing.type : Easing.InOutQuad + } + } + removeDisplaced : Transition { + NumberAnimation { + properties : "x,y" + duration : 400 + } + } - DropArea { - id : newDesktopDropArea - anchors.fill : parent + move : Transition { + NumberAnimation { + property : "x" + duration : 200 + easing.type : Easing.InOutQuad + } + } + moveDisplaced : Transition { + NumberAnimation { + property : "x" + duration : 200 + easing.type : Easing.InOutQuad + } + } - onEntered : { - createDesktopButton.color = createDesktopButtonReceiveColor + onCountChanged : { + if (initMultitask || count <= 0) { + if (count === desktopListModel.rowCount()) { + initMultitask = false; + } + return; } - onExited : { - createDesktopButton.color = createDesktopButtonDefaultColor + var newWidth = desktopRectWidth * count + desktopListView.spacing * (count - 1) + desktopListViewLeftMarginAni.to = (rootWindow.width - newWidth) / 2 < 0 ? 0 : (rootWindow.width - newWidth) / 2 + desktopListViewLeftMarginAni.start() + } + + Connections { + target: rootWindow.isWlcom ? multitaskViewManager : null + function onDesktopDataUpdated() { + desktopListView.model = {} + desktopListView.model = desktopListModel } + } - onDropped : { - spacingRect.controller.onSourceDropped(drop.source,allroot.highlightDesktop,listModel.count+1); - root.updateListModel() + function getWorkspaceItemOrNewWorkspaceItem(type) { + if(type === "newDesktop") { + return "NewDesktopButton.qml" } + return "VirtualDesktopWindow.qml" } - Rectangle { - id : createDesktopButton - width : desktopThumbnailWidth - height : desktopThumbnailHeight - x : desktopBorderWidth - y : desktopCaptionHeight+desktopBorderWidth - radius : 8 - color : createDesktopButtonDefaultColor + NumberAnimation { + id : moveToScrollEndAnimation + target : desktopListView + property : "contentX" + from : desktopListView.contentX + to : isLayoutLeftToRight ? desktopListView.contentWidth + desktopRectWidth + root.spacing - desktopListView.width : + - desktopListView.contentWidth - desktopRectWidth - root.spacing + duration : 300 + easing.type : Easing.InOutQuart + } - Rectangle { - anchors.centerIn : parent - color : desktopCaptionColor - width : newDesktopButton.height / 4 - height : newDesktopButton.height / 100 + function moveToScrollEnd() { + if (desktopListView.contentWidth + desktopRectWidth + root.spacing > desktopListView.width + && desktopListView.count < 16) { + moveToScrollEndAnimation.restart() } + } - Rectangle { - anchors.centerIn : parent - color : desktopCaptionColor - width : newDesktopButton.height / 100 - height : newDesktopButton.height / 4 + Connections { + target: desktopListModel + function onDesktopAppended(desktopIndex) { + desktopListView.moveToScrollEnd(desktopIndex) } } - Component.onCompleted : { - spacingRect.setCaption("新建工作区") - spacingRect.setId(0) + delegate: Loader { + source : desktopListView.getWorkspaceItemOrNewWorkspaceItem(model.ItemType) + onLoaded: { + if ("customName" in item) { + item.customName = model.CustomName + } + } + Connections { + target: item + function onCustomNameChanged() { + if (model.CustomName !== item.customName) { + desktopListModel.setData(desktopListModel.index(index, 0), + item.customName, + DesktopListModel.CustomName) + } + } + } } + } // desktopListView + + NumberAnimation { + id : contentMoveAnimation + target : desktopListView + property : "contentX" + from : desktopListView.contentX + duration : 300 + easing.type : Easing.InOutQuart } - } // footer : newdesktopButton - } // desktopListView + + ArrowButton { + id : leftButton + visible : desktopHoverStatus && desktopListView.contentX + desktopListView.contentXoffset > 0 + x : Math.floor(48 * scaleFactor) + y : (parent.height-leftButton.height)/2 + direction: "left" + } + + ArrowButton { + id : rightButton + visible : desktopHoverStatus && desktopListView.contentX + desktopListView.contentXoffset < desktopListView.contentWidth-desktopListView.width + x : parent.width - Math.floor(48 * scaleFactor) - rightButton.width + y : (parent.height-rightButton.height)/2 + direction: "right" + } + } + } } diff --git a/windowsview/qml/LineEdit.qml b/windowsview/qml/LineEdit.qml new file mode 100644 index 0000000000000000000000000000000000000000..c01a143e065ad2d8e02f45e4adcd2dfa1565e6f6 --- /dev/null +++ b/windowsview/qml/LineEdit.qml @@ -0,0 +1,129 @@ +/* +* Copyright (C) 2024, KylinSoft Co., Ltd. +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +* +* Authors: zy-yuan1 +* +*/ + +import QtQuick 2.15 +//ukui-quick +import org.ukui.quick.items 1.0 as UkuiItem +import org.ukui.quick.platform 1.0 as UkuiPlatform + +UkuiItem.DtThemeBackground { + id: rootItem + property bool editable: false + property bool enableLayoutMirroring: false + property string defaultText: "" + property string itemDisplayText: defaultText + property int contentTextWidth: textDisplay.contentWidth + property bool isDefaultText : false + + signal textEditingFinished() + + implicitWidth: 100 + implicitHeight: 32 + color: "transparent" + borderColor: editable ? UkuiPlatform.GlobalTheme.kBrandNormal : UkuiPlatform.GlobalTheme.kGrayAlpha0 + border.width : 2 + radius: 4 + + Accessible.role: Accessible.Button + Accessible.name: "edit-text-" + itemDisplayText + Accessible.description: "push-button, click to modify the text" + + MouseArea { + id: rootMouseArea + anchors.fill: parent + hoverEnabled: true + preventStealing: true + cursorShape: editable ? Qt.IBeamCursor : Qt.ArrowCursor + onClicked: { + if (!editable) { + // 点击进入编辑状态 + editable = true; + } + } + } + + onEditableChanged: { + if (editable) { + // 单击进入textInput可输入状态,需要将焦点强制转移给textInput + textInput.forceActiveFocus(); + textInput.selectAll(); + } + + // 更新Text显示文本 + updateItemDisplayText(); + textInput.text = itemDisplayText + } + + TextInput { + id: textInput + anchors.fill: parent + anchors.centerIn : parent + anchors.leftMargin : 4 + anchors.rightMargin : 4 + horizontalAlignment: TextInput.AlignLeft + verticalAlignment: TextInput.AlignVCenter + LayoutMirroring.enabled: enableLayoutMirroring + + clip: true + maximumLength : 32 + focus: true + selectByMouse: true + color: UkuiPlatform.GlobalTheme.kFontPrimary.pureColor + selectionColor: UkuiPlatform.GlobalTheme.kBrandNormal.pureColor + visible: editable + + text: itemDisplayText + + onEditingFinished: { + editable = false; + textEditingFinished() + } + + Keys.priority: Keys.AfterItem + Keys.onPressed: { + event.accepted = true + } + } + + UkuiItem.DtThemeText { + id: textDisplay + anchors.fill: parent + anchors.centerIn: parent + horizontalAlignment: Text.AlignLeft + LayoutMirroring.enabled: enableLayoutMirroring + verticalAlignment: Text.AlignVCenter + + text: itemDisplayText + elide: enableLayoutMirroring ? Text.ElideLeft : Text.ElideRight + visible: !editable + + UkuiItem.Tooltip { + anchors.fill: parent + mainText: textDisplay.text + posFollowCursor: true + active: !editable && textDisplay.truncated + } + } + + function updateItemDisplayText() { + itemDisplayText = textInput.length > 0 ? textInput.displayText : rootItem.defaultText + isDefaultText = textInput.length > 0 ? false : true + } +} diff --git a/windowsview/qml/MasterDesktopArea.qml b/windowsview/qml/MasterDesktopArea.qml new file mode 100644 index 0000000000000000000000000000000000000000..bb36242356cc58eabcb969bbd9782ab110bbe971 --- /dev/null +++ b/windowsview/qml/MasterDesktopArea.qml @@ -0,0 +1,211 @@ +/* + * Copyright (C) 2022, KylinSoft Co., Ltd. + + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +/* + 虚拟桌面的UI和功能的处理,也是加载创建预览窗口 + 虚拟桌面区域的窗口和窗口区域的窗口都来自一个"类” +*/ +import QtQuick 2.12 +import QtQuick.Controls 2.5 +import QtQuick.Layouts 1.3 +import QtQuick.Window 2.12 +import QtGraphicalEffects 1.0 + +//ukui-quick +import org.ukui.quick.items 1.0 as UkuiItem +import org.ukui.quick.platform 1.0 as UkuiPlatform + +FocusScope { + id : root + //虚拟桌面的各个参数 + property bool desktopHoverStatus : false + //虚拟桌面标题栏高度 + property int desktopCaptionHeight : Math.floor(32 * scaleFactor) + property int spacing : Math.floor(24 * scaleFactor) + property int desktopRectWidth : desktopRect.height + property int desktopRectHeight : desktopThumbnailHeight + 2 * workspaceBorderWidth + spacingWidth + desktopCaptionHeight + property int listviewTopMargin : Math.floor(24 * scaleFactor) + + UkuiItem.DtThemeBackground { + id : desktopRect + anchors.fill : parent + useStyleTransparency : true + backgroundColor : UkuiPlatform.GlobalTheme.kContainGeneralNormal + + MouseArea { + id : desktopMouseArea + anchors.fill : parent + hoverEnabled : true + onEntered: { + desktopHoverStatus = true + } + onExited: { + desktopHoverStatus = false + } + + ListView { + id : desktopListView + anchors.fill : parent + anchors.topMargin : root.listviewTopMargin + property bool initMultitask : true + orientation : ListView.Vertical + model : desktopListModel + spacing : root.spacing + activeFocusOnTab: false + clip : true + onActiveFocusChanged: { + if (desktopListView.activeFocus) { + currentIndex = 0 + } + } + + Keys.onPressed: { + if (event.key === Qt.Key_PageUp || event.key === Qt.Key_Home) { + if (currentIndex === 0) { + return + } + currentIndex = 0 + if (desktopListView.contentY > 0){ + contentMoveAnimation.to = 0 + contentMoveAnimation.start() + } + } else if (event.key === Qt.Key_PageDown || event.key === Qt.Key_End) { + if (currentIndex === desktopListModel.rowCount() - 2) { + return + } + currentIndex = desktopListModel.rowCount() - 2 + if (desktopListView.contentY < desktopListView.contentHeight - desktopListView.height) { + contentMoveAnimation.to = desktopListView.contentHeight - desktopListView.height + contentMoveAnimation.start() + } + } + } + + ScrollBar.vertical: ScrollBar { + id : deskVbar + hoverEnabled : true + active : hovered || pressed + + //定义样式 + contentItem : Rectangle { + implicitWidth : Math.floor(8 * scaleFactor) + radius : Math.floor(4 * scaleFactor) + visible : desktopHoverStatus && desktopListView.contentHeight > desktopListView.height + color : deskVbar.hovered || deskVbar.pressed ? UkuiPlatform.GlobalTheme.kComponentAlphaHover : UkuiPlatform.GlobalTheme.kComponentAlphaNormal + } + } + + populate: Transition { + NumberAnimation { + properties : "scale,opacity" + from : 0 + to : 1 + duration : 400 + easing.type : Easing.InOutQuad + } + } + + add : Transition { + NumberAnimation { + properties : "scale,opacity" + from : 0 + to : 1 + duration : 300 + easing.type : Easing.InOutQuad + } + } + remove : Transition { + NumberAnimation { + properties : "scale,opacity" + from : 1 + to : 0 + duration : 300 + easing.type : Easing.InOutQuad + } + } + removeDisplaced : Transition { + NumberAnimation { + properties : "x,y" + duration : 300 + } + } + + move : Transition { + NumberAnimation { + property : "y" + duration : 200 + easing.type : Easing.InOutQuad + } + } + moveDisplaced : Transition { + NumberAnimation { + property : "y" + duration : 200 + easing.type : Easing.InOutQuad + } + } + + function getWorkspaceItemOrNewWorkspaceItem(type) { + if(type === "newDesktop") { + return "NewDesktopButton.qml" + } + return "VirtualDesktopWindow.qml" + } + + NumberAnimation { + id : moveToScrollEndAnimation + target : desktopListView + property : "contentY" + from : desktopListView.contentY + to : desktopListView.contentHeight + desktopRectHeight + root.spacing - desktopListView.height + duration : 300 + easing.type : Easing.InOutQuart + } + + function moveToScrollEnd() { + if (desktopListView.contentHeight + desktopRectHeight + root.spacing > desktopListView.height + && desktopListView.count < 16) { + moveToScrollEndAnimation.restart() + } + } + + Connections { + target: desktopListModel + function onDesktopAppended(desktopIndex) { + desktopListView.moveToScrollEnd(desktopIndex) + } + } + + delegate: Loader { + source : desktopListView.getWorkspaceItemOrNewWorkspaceItem(model.ItemType) + } + } // desktopListView + } + + NumberAnimation { + id : contentMoveAnimation + target : desktopListView + property : "contentY" + from : desktopListView.contentY + to : desktopListView.contentY + duration : 300 + easing.type : Easing.InOutQuart + } + } +} diff --git a/windowsview/qml/MultitaskView.qml b/windowsview/qml/MultitaskView.qml new file mode 100644 index 0000000000000000000000000000000000000000..acefa7e38b0ce69b5d2b5cfd49a959effa27c087 --- /dev/null +++ b/windowsview/qml/MultitaskView.qml @@ -0,0 +1,171 @@ +/* + * Copyright (C) 2022, KylinSoft Co., Ltd. + + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import QtQuick 2.12 +import QtQuick.Layouts 1.3 +import QtQuick.Window 2.12 +import org.kylin.background 3.0 as KWin +import QtGraphicalEffects 1.0 +//ukui-quick +import org.ukui.quick.platform 1.0 as UkuiPlatform + +import AppWindowFilterModel 1.0 + +Repeater { + id : allroot + model : screencnt + focus: true + Keys.enabled: true + property int screencnt : multitaskViewModel.logicalScreenCount + + Rectangle { + id : rootWindow + visible: allroot.visible + x : rootWindow.screenRect.x + y : rootWindow.screenRect.y + width : rootWindow.screenRect.width + height : rootWindow.screenRect.height + property var isWlcom : multitaskViewManager.isWlcom() + property var isVerticalLayout : multitaskViewManager.isMultitaskViewVerticalLayout() + property int highlightDesktop : multitaskViewModel.highlightDesktop + property var screenRect : multitaskViewModel.screenRectList[index] //getFullScreenGeometry(highlightDesktop, index) + property var scaleFactor : devicePixelRatio + property bool isTouchState : multitaskViewModel.isTouchState + // focus border color + property var hoverBorderColor : UkuiPlatform.GlobalTheme.kWhite + property var tabFocusBorderColor : UkuiPlatform.GlobalTheme.kBrandNormal + property var defaultBorderColor : UkuiPlatform.GlobalTheme.kGrayAlpha0 + // focus border width + property int iconAndCloseButtonHeight : 32 * scaleFactor + property int appBorderWidth : 4 * scaleFactor + property int workspaceBorderWidth : 3 * scaleFactor + property int spacingWidth : 2 * scaleFactor + property int thumbRectangleHeight : isVerticalLayout ? Math.floor(screenRect.height * 5 / 22) : Math.floor(screenRect.height * 5 / 23) + // 工作区窗口缩放比 + property double desktopScale : isVerticalLayout ? 16 / 135 : 57 / 480 + // 工作区窗口的高度和宽度 + property int desktopThumbnailWidth : screenRect.width * desktopScale + property int desktopThumbnailHeight : screenRect.height * desktopScale + //水平布局方向 + property bool isLayoutLeftToRight: multitaskViewManager.isLayoutLeftToRight() + + KWin.DesktopBackground { + id : wholeDesktopBackground + width : rootWindow.width + height : rootWindow.height + blurAlpha : 0.7 + } + + Connections { + target: rootWindow.isWlcom ? multitaskViewManager : null + function onBackgroundChanged() { + wholeDesktopBackground.update() + } + } + + FocusScope { + id: mainView + anchors.fill: parent + focus: true + width: parent.width + height: parent.height + property var screenIndex : index + + Keys.onPressed: { + if (event.key === Qt.Key_Escape) { + multitaskViewManager.close() + } + } + + AppWindowFilterModel { + id: appAreaModel + desktopId: rootWindow.highlightDesktop + screenId: mainView.screenIndex + sourceModel: appWindowListModel + } + + Loader { + id: viewLoader + sourceComponent: isVerticalLayout ? verticalLayoutView : horizontalLayoutView + anchors.fill: parent + } + + Component { + id: verticalLayoutView + Rectangle { + color: "transparent" + AppArea { + id : appArea1 + anchors.left : parent.left + anchors.right : parent.right + anchors.top : parent.top + height : Math.floor(mainView.height * 111 / 135) + width: parent.width + + Component.onCompleted : { + console.log("AppArea end! ! !") + } + } + DesktopArea { + id : desktopArea1 + anchors.left : parent.left + anchors.right : parent.right + anchors.top : appArea1.bottom + anchors.bottom : parent.bottom + } + + Component.onCompleted : { + console.log("verticalLayoutView end! ! !") + } + } + } + + Component { + id: horizontalLayoutView + Rectangle { + color: "transparent" + AppArea { + id : appArea2 + anchors.left : parent.left + anchors.bottom : parent.bottom + anchors.top : parent.top + height: parent.height + width : Math.floor(mainView.width * 410 / 480) + + Component.onCompleted : { + console.log("MasterAppArea end! ! !") + } + } + + MasterDesktopArea { + id : desktopArea2 + anchors.left : appArea2.right + anchors.right : parent.right + anchors.top : parent.top + anchors.bottom : parent.bottom + } + + Component.onCompleted : { + console.log("horizontalLayoutView end! ! !") + } + } + } + } + } +} diff --git a/windowsview/qml/NewDesktopButton.qml b/windowsview/qml/NewDesktopButton.qml new file mode 100644 index 0000000000000000000000000000000000000000..a82db473afa97f6efe808b5c0148bc9765c3c0f3 --- /dev/null +++ b/windowsview/qml/NewDesktopButton.qml @@ -0,0 +1,167 @@ +/* + * Copyright (C) 2022, KylinSoft Co., Ltd. + + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import QtQuick 2.12 +import QtQuick.Layouts 1.3 +import QtQuick.Window 2.12 +import QtGraphicalEffects 1.0 +import "Controller.js" as Controller +//ukui-quick +import org.ukui.quick.items 1.0 as UkuiItem +import org.ukui.quick.platform 1.0 as UkuiPlatform + +Item { + id : root + width : isVerticalLayout ? desktopRectWidth : desktopRect.width + height : isVerticalLayout ? desktopRect.height - 8 : desktopRectHeight + activeFocusOnTab: true + focus : true + property string windowType : "creation" + property var newWorkspaceController : new Controller.CreationController(multitaskViewModel, root, multitaskViewManager, ["app","desktop"]); + // 用户自定义工作区名称 + property string customName: "" + + onActiveFocusChanged: { + if (root.activeFocus) { + desktopListView.currentIndex = desktopListView.count - 1 + if (isVerticalLayout && desktopListView.contentX + desktopListView.contentXoffset < desktopListView.contentWidth - desktopListView.width) { + contentMoveAnimation.to = isLayoutLeftToRight ? desktopListView.contentWidth - desktopListView.width : -desktopListView.contentWidth + contentMoveAnimation.start() + } + if (!isVerticalLayout && desktopListView.contentY < desktopListView.contentHeight - desktopListView.height) { + contentMoveAnimation.to = desktopListView.contentHeight + listviewTopMargin - desktopListView.height + contentMoveAnimation.start() + } + multitaskViewManager.activeAreaChangeDataCollect("New Workspace Button Area") + } + } + + Keys.onPressed: { + if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter || event.key === Qt.Key_Space) + { + newWorkspaceController.onWindowClicked() + event.accepted = true + } else if (event.key === Qt.Key_Escape) { + newWorkspaceController.closeMultitaskView() + } else if (event.modifiers & Qt.MetaModifier) { + if (event.key === Qt.Key_Tab) { + newWorkspaceController.closeMultitaskView() + } + } else if (event.key === Qt.Key_Tab) { + if (appAreaModel.rowCount() === 0) { + desktopListView.currentIndex = 0 + multitaskViewManager.setShouldShowTabBorder(true) + } + } + } + + states: State { + name: "active" + when: root.activeFocus && (multitaskViewManager.shouldShowTabBorder) + PropertyChanges { target: createDesktopButtonBorder; borderColor : tabFocusBorderColor} + } + + Item { + anchors.fill: parent + anchors.centerIn : parent + + MouseArea { + id : previewMouseArea + anchors.fill : parent + preventStealing : true + + Accessible.role: Accessible.Button + Accessible.name: "new-desktop" + Accessible.description: "push-button, click to create a new desktop" + + onClicked : { + newWorkspaceController.onWindowClicked() + } + } + + ColumnLayout { + id : mainVerticalLayout + anchors.fill: parent + anchors.centerIn : parent + spacing : spacingWidth + + UkuiItem.DtThemeText { + id : caption + verticalAlignment: Qt.AlignVCenter + horizontalAlignment: isLayoutLeftToRight ? Qt.AlignLeft : Qt.AlignRight + elide : isLayoutLeftToRight ? Text.ElideRight : Text.ElideLeft + Layout.fillWidth : true + Layout.fillHeight : true + Layout.preferredHeight: desktopCaptionHeight + Layout.maximumHeight: root.height - mainVerticalLayout.spacing - createDesktopButtonBorder.height + Layout.leftMargin : workspaceBorderWidth + text : qsTr("New Desktop") + + UkuiItem.Tooltip { + anchors.fill: parent + mainText: caption.text + posFollowCursor: true + active: caption.truncated + } + + MouseArea { + id: captionArea + anchors.fill: parent + hoverEnabled: true + } + } + + UkuiItem.DtThemeBackground { + id : createDesktopButtonBorder + Layout.fillWidth: true + Layout.fillHeight: false + Layout.preferredHeight: desktopThumbnailHeight + 2 * border.width + color : "transparent" + border.width : workspaceBorderWidth + borderColor : defaultBorderColor + radius : UkuiPlatform.GlobalTheme.kRadiusWindow * scaleFactor + + UkuiItem.DtThemeBackground { + id : createDesktopButton + width : desktopThumbnailWidth + height : desktopThumbnailHeight + anchors.centerIn : parent + radius : UkuiPlatform.GlobalTheme.kRadiusMenu * scaleFactor + backgroundColor : newDesktopDropArea.containsDrag ? UkuiPlatform.GlobalTheme.kGrayAlpha9 : UkuiPlatform.GlobalTheme.kModalMask + + UkuiItem.Icon { + anchors.centerIn: parent + width: Math.floor(32 * scaleFactor) + height: width + source: "list-add-symbolic" + mode: UkuiItem.Icon.AutoHighlight + } + + DropArea { + id : newDesktopDropArea + anchors.fill : parent + onDropped : { + newWorkspaceController.onSourceDropped(drop.source, rootWindow.highlightDesktop, desktopListView.count); + } + } + } + } + }//culumnLayout + } +} diff --git a/windowsview/qml/PreviewWindow.qml b/windowsview/qml/PreviewWindow.qml deleted file mode 100644 index b7cc297b673f4c53a77b32f32df4d57dfe72e5b8..0000000000000000000000000000000000000000 --- a/windowsview/qml/PreviewWindow.qml +++ /dev/null @@ -1,264 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.5 -import QtQuick.Layouts 1.3 -import "Controller.js" as Controller -import IconTheme 1.0 - -Rectangle { - id : previewWindow - width : 100 - height : 150 - color : "transparent" - - /** windowType is the type of PreviewWindow, - * the options are : none, app, desktop, creation. - * Default to none. - */ - property string windowType : "none" - - /** stateList is the list of state, - * the options are : default, hover, drag, receive. - * Default to default. - */ - property var stateList : ["default", "hover", "drag", "receive"]; - state : "default" - property string wid : ""; - property int previewAreaWidth : 100 - property int previewAreaHeight : 150 - property real posX : 0 - property real posY : 0 - property double closeButtonSize : 24 - property bool closeButtonVisble : false - property double titleOpacity : 1 - property var iconVisble : true - property var controller : null - property real borderWidth : 0 - property var dragAxis : Drag.XAndYAxis - property var captionText : "" - property var captionColor : Qt.rgba(255,255,255,1) - property bool winowDragActive : previewMouseArea.drag.active - property bool nowDragActive : false - property bool onTop: false - property ListModel premodel : null - Drag.active : previewMouseArea.drag.active - Drag.source : previewWindow - Drag.hotSpot.x : previewWindow.previewAreaWidth - Drag.hotSpot.y : previewWindow.previewAreaHeight - - onWinowDragActiveChanged : { - if(winowDragActive !== nowDragActive){ - nowDragActive = winowDragActive - } - } - - NumberAnimation on x{ - id : movePreX - duration : 500 - running : false - } - - NumberAnimation on y{ - id : movePreY - duration : 500 - running : false - } - - function setStatus(status) { - if(stateList.indexOf(status) < 0) - { - return; - } - if (status === state) { - return - } else { - state = status; - } - } - - function setCaption(titleText) { - caption.text = titleText; - } - - function setId(wId) { - wid = wId; - /*此处加载关闭按钮的id的原因如下 - * 1.此类被虚拟桌面和预览窗口,同时复用; - * 2.父子组件的onCompleted{},子类先触发,然后才是父类 - * 3.如果在Component.onCompleted{}中,给closebutton赋id时,只有model.id不为空,其他均为空,原因为2导致 - * 4.虚拟桌面没有model的概念,会在3处赋值的时候,报warning - * 故以上原因,在此处赋id - */ - closeButton.setId(wId) - } - - function setDefaultStatus() { - setStatus("default") - } - - function setHoverStatus() { - setStatus("hover") - } - - function setDragStatus() { - setStatus("drag") - } - - function setReceiveStatus() { - setStatus("receive") - } - - function returnOriginal(x,y) - { - movePreX.to =0 - movePreY.to =0 - movePreX.from =x - movePreY.from =y - movePreX.stop() - movePreY.stop() - movePreX.start() - movePreY.start() - } - - // 应用程序预览窗口的缩放动画暂时 - // 由视图模块在响应拖拽事件时主动 - // 触发。因此,该函数暂时实现为空 - function onEnterDropArea() { - - } - - // 应用程序预览窗口的缩放动画暂时 - // 由视图模块在响应拖拽事件时主动 - // 触发。因此,该函数暂时实现为空 - function onExitDropArea() { - - } - - function zoomIn() { - scaleAnimation.running = false - scaleAnimation.stop(); - scaleAnimation.from = 1; - scaleAnimation.to = 0.25; - scaleAnimation.start(); - } - - function zoomOut() { - scaleAnimation.running = false - scaleAnimation.stop(); - scaleAnimation.from = 0.5; - scaleAnimation.to = 1; - scaleAnimation.start(); - } - - NumberAnimation on scale{ - id : scaleAnimation - duration : 500 - from : 0 - to : 0 - running : false - } - - MouseArea{ - id : previewMouseArea - anchors.fill : parent - hoverEnabled : true - preventStealing : true - drag.target : previewWindow - drag.axis : dragAxis - - onEntered : { - controller.setHoverStatus(); - } - - onExited : { - if(!closeButton.closeButtonContainMouse) - { - controller.setDefaultStatus(); - } - } - - onClicked : { - controller.onWindowClicked(wid); - } - - onReleased : { - previewWindow.Drag.drop(); - } - } - - - ColumnLayout { - spacing : 2 - anchors.centerIn : parent - Layout.fillHeight : true - width : parent.width - - RowLayout { - id : captionRow - spacing : 8 - Layout.fillHeight : true - opacity : titleOpacity - anchors.rightMargin: 6 - - Rectangle { - id : iconItem - height : 24 - width : 24 - color : "transparent" - visible : iconVisble - IconTheme{ - anchors.fill : parent - icon : multitaskViewModel.getWindowIcon(wid) - } - } - - Label { - id : caption - verticalAlignment: Qt.AlignVCenter - elide : Text.ElideRight - Layout.fillWidth : true - height : 24 - text : captionText - font.pixelSize: multitaskViewModel.getUKUIFontSize() - color: captionColor - } - - CloseButton { - id : closeButton - wid: previewWindow.wid - - states : [ - State { - name : "default" - PropertyChanges { target : closeButton; closeButtonColor : closeButtonDefaultColor } - }, - State { - name : "hover" - PropertyChanges { target : closeButton; closeButtonColor : closeButtonHoverColor } - }, - State { - name : "click" - PropertyChanges { target : closeButton; closeButtonColor : closeButtonClickColor } - } - ] - } - }//RowLayout - - Rectangle { - id : previewArea - width : previewAreaWidth - height : previewAreaHeight - color : "transparent" - border.color : "#FFFFFF" - border.width : borderWidth - radius : multitaskViewManager.useOpenGL() ? 12 : 0 - } - - states : State { - when : previewMouseArea.drag.active && windowType != "creation" - ParentChange { target : previewWindow; parent : root } - PropertyChanges { target : previewWindow; onTop : true } - PropertyChanges { target : previewWindow; borderWidth : 4 } - PropertyChanges { target : previewWindow; titleOpacity : 0 } - } - }//culumnLayout -} diff --git a/windowsview/qml/Tabbox.qml b/windowsview/qml/Tabbox.qml new file mode 100755 index 0000000000000000000000000000000000000000..d75e69ae85509175521309e070a758bdb3c1a434 --- /dev/null +++ b/windowsview/qml/Tabbox.qml @@ -0,0 +1,368 @@ +/* + * Copyright (C) 2024, KylinSoft Co., Ltd. + + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import QtQuick 2.0 +import QtQuick.Layouts 1.3 +import QtGraphicalEffects 1.0 +import "Controller.js" as Controller +import org.kylin.thumbnail 1.0 as WlcomThumbnail +import AppWindowFilterModel 1.0 +//ukui-quick +import org.ukui.quick.items 1.0 as UkuiItem +import org.ukui.quick.platform 1.0 as UkuiPlatform +//flow +import org.ukui.positioner 1.0 + +FocusScope { + id: root + property int currentIndex: -1 + property real yOffset: tabbox.shadowHeight + width: tabbox.width + height: tabbox.height + 2 * tabbox.shadowHeight + focus: true + +UkuiItem.DtThemeBackground { + id : tabbox + anchors.centerIn: parent + property var controller : new Controller.AppController(multitaskViewModel, tabbox, multitaskViewManager, ["none"]); + property rect screenGeometry : multitaskViewManager.currentScreenRect + property bool isOpenGL : true + property int maxHeight : screenGeometry.height * 0.85 + property var scaleFactor : devicePixelRatio + property int viewMargin : 20 * scaleFactor + property bool isLayoutLeftToRight: Qt.application.layoutDirection === Qt.LeftToRight + property real shadowHeight : shadow.size + Math.abs(shadow.yOffset) + + focus : true + useStyleTransparency : true + backgroundColor : UkuiPlatform.GlobalTheme.kComponentNormal + width : screenGeometry.width + height : tabboxFlickable.height + Keys.enabled : true + border.width : UkuiPlatform.GlobalTheme.normalLine * scaleFactor + borderColor : UkuiPlatform.GlobalTheme.kLineWindowActive + shadowData: UkuiPlatform.GlobalTheme.kShadowMenu + + // TODO: replace 2 DtThemeBackgrounds by UkuiPlatform multi-shadow item, if supported. + Loader { + id: childShadowLoader + anchors.fill: parent + sourceComponent: childShadowComponent + active: tabbox.shadowData.isMultiShadow + onLoaded: { + tabbox.shadowHeight = Math.max( tabbox.shadow.size, item.shadowHeight) + } + } + Component { + id: childShadowComponent + UkuiItem.DtThemeBackground { + property real shadowHeight : shadow.size + Math.abs(shadow.yOffset) + anchors.fill: parent + useStyleTransparency: false + alpha: 0 + shadowData: tabbox.shadowData.childShadow + } + } + + onActiveFocusChanged : { + if(!tabbox.activeFocus) { + multitaskViewManager.close() + } else { + if (multitaskViewManager.isBackTab) { + currentIndex = appWindowListModel.rowCount() > 1 ? appWindowListModel.rowCount() - 1 : 0; + } else { + currentIndex = appWindowListModel.rowCount() > 1 ? 1 : 0; + } + + /** + 1. wlcom环境特定情况(快速操作按下alt+tab并松开)下,会出现本界面不隐藏问题,原因如下: + 由于wlcom合成器与窗口选择器是两个独立的进程,使得窗口选择器被快捷键拉起时,向合成器发出的GrabKeyboard请求未被及时响应 + 导致在特定情况下窗口选择器无法收到Key_Alt的Released信号,进而无法通过响应alt released事件来关闭此界面 + 2. 当前实现,此界面显示时可以认为Key_Alt必定处于按下状态,因此针对特定情况处理如下: + 在此界面显示并获取键盘焦点后,立即查询Key_Alt是否处于按下状态 + 如果按未处于按下状态,则激活选定窗口并退出;否则,不做特殊处理 + **/ + // fix https://gitee.com/openkylin/ukui-window-switch/issues/IAID8L?from=project-issue + if (!multitaskViewManager.isAltKeyPressed()) { + activateSelectedWindow(); + return; + } + } + } + + Flickable { + id: tabboxFlickable + anchors.leftMargin: tabbox.viewMargin //注意:间距为0则无法显示滚动条 + anchors.rightMargin: tabbox.viewMargin + width: contentWidth + height: Math.min(contentHeight, tabbox.maxHeight) + contentWidth: parent.width - 2 * tabbox.viewMargin + contentHeight: tabboxFlow.height + LayoutMirroring.enabled: !tabbox.isLayoutLeftToRight + LayoutMirroring.childrenInherit: true + clip: true + + UkuiItem.DtThemeScrollBar.vertical: UkuiItem.DtThemeScrollBar { + id: tabboxScrollBar + Accessible.role: Accessible.ScrollBar + Accessible.name: "tabbox-vertical-scrollbar" + Accessible.description: "a scroll bar, which allows the user to scroll the visible area" + parent: tabboxFlickable.parent + anchors.top: tabboxFlickable.top + anchors.left: tabboxFlickable.right + anchors.bottom: tabboxFlickable.bottom + policy: UkuiItem.DtThemeScrollBar.AsNeeded + visual: tabboxFlow.height > height + } + + NumberAnimation { + id : scrollMoveAnimation + target : tabboxScrollBar + property : "position" + from : tabboxScrollBar.position + duration : 300 + easing.type : Easing.InOutQuart + } + + UkuiFlow { + id: tabboxFlow + spacing: 8 * tabbox.scaleFactor + padding: tabbox.viewMargin + width: parent.width + flow: Flow.LeftToRight + layoutDirection: Qt.LeftToRight + lineHorizontalCenterAlignment: true + + Connections { + target: previewItemRepeater + function onCountChanged() { + tabboxFlow.forceLayout(); + } + } + + Repeater { + id : previewItemRepeater + model: appWindowListModel + + delegate: UkuiItem.DtThemeBackground { + id: previewItem + property string uuid: model.Uuid + property int spaceWidth: 4 * tabbox.scaleFactor + property int outerBorderWidth: UkuiPlatform.GlobalTheme.focusLine * tabbox.scaleFactor + property int innerBorderWidth: UkuiPlatform.GlobalTheme.focusLine * tabbox.scaleFactor + property int maxThumbnailWidth: (tabbox.screenGeometry.width - 2 * tabboxFlow.padding) / 4 + property int thumbnailHeight: tabbox.screenGeometry.height / 22 * 5 + property int minWidth: Math.floor(tabbox.width / 10) + width: Math.max(thumbnailBorderItem.width + 2 * (spaceWidth + outerBorderWidth), minWidth) + height: captionRow.height + thumbnailHeight + 5 * spaceWidth + 2 * (innerBorderWidth + outerBorderWidth) + color: "transparent" + borderColor: UkuiPlatform.GlobalTheme.kFontStrong + border.width: index === currentIndex ? outerBorderWidth : 0 + radius: tabbox.isOpenGL ? UkuiPlatform.GlobalTheme.kRadiusWindow : 0 + + MouseArea { + anchors.fill: parent + hoverEnabled: true + Accessible.role: Accessible.Button + Accessible.name: "active-window-" + model.caption + Accessible.description: "preview-window, click to active the app window" + + onEntered : { + thumbnailBorderItem.border.width = previewItem.innerBorderWidth; + } + + onExited : { + thumbnailBorderItem.border.width = 0; + } + + onClicked : { + currentIndex = index; + tabbox.controller.onWindowClicked(model.Uuid); + } + } + + function getThumbnailSize() + { + var thumbHeight = thumbnailHeight + var max_width = maxThumbnailWidth + var clientWidth = model.Width + var clientHeight = model.Height + var thumbWidth = Math.floor(thumbHeight * clientWidth / clientHeight) + if (thumbWidth > max_width) { + thumbWidth = max_width + thumbHeight = Math.floor(thumbWidth * clientHeight / clientWidth) + } + return [thumbWidth, thumbHeight] + } + + ColumnLayout { + anchors.fill: parent + anchors.margins: previewItem.spaceWidth + spacing: 4 * tabbox.scaleFactor + + RowLayout { + id: captionRow + spacing: 8 * tabbox.scaleFactor + Layout.preferredHeight: Math.max(iconItem.height, captionText.height) + Layout.maximumWidth: thumbnailBorderItem.width + Layout.alignment: Qt.AlignCenter + Layout.leftMargin: 2 * previewItem.spaceWidth + + UkuiItem.Icon { + id: iconItem + width: 24 * tabbox.scaleFactor + height: width + source: model.Icon + } + + UkuiItem.DtThemeText { + id: captionText + verticalAlignment: Qt.AlignVCenter + Layout.fillWidth: true + Layout.preferredHeight: contentHeight + text: model.Caption + horizontalAlignment: Qt.AlignLeft + elide: tabbox.isLayoutLeftToRight ? Text.ElideRight : Text.ElideLeft + } + } // RowLayout + + UkuiItem.DtThemeBackground { + id: thumbnailBorderItem + Layout.alignment: Qt.AlignCenter + Layout.preferredWidth: getThumbnailSize()[0] + 2 * (previewItem.innerBorderWidth + previewItem.spaceWidth) + Layout.preferredHeight: previewItem.thumbnailHeight + 2 * (previewItem.innerBorderWidth + previewItem.spaceWidth) + color: "transparent" + borderColor: UkuiPlatform.GlobalTheme.kFontStrong + border.width: 0 + radius: tabbox.isOpenGL ? UkuiPlatform.GlobalTheme.kRadiusMax : 0 + // 预览图阴影 + shadowData: UkuiPlatform.GlobalTheme.KShadowMin + Rectangle { + id: thumbnailBackItem + width: getThumbnailSize()[0] + height: getThumbnailSize()[1] + anchors.centerIn: parent + color: "transparent" + clip: true + layer.enabled: tabbox.isOpenGL ? true : false + layer.effect: OpacityMask { + maskSource: Rectangle { + width: thumbnailBackItem.width + height: thumbnailBackItem.height + radius: thumbnailBorderItem.radius + } + } + WlcomThumbnail.ThumbnailItem { + id: thumbnailItem + anchors.fill: parent + windowId: model.Uuid + } + } + } + } // ColumnLayout + } // Repeater.delegate + } // Repeater + } // Flow + } // Flickable + + Keys.onDeletePressed : { + multitaskViewManager.close() + } + + Keys.onEscapePressed : { + multitaskViewManager.close() + } + + Keys.onBacktabPressed : { + if (!multitaskViewManager.isAltKeyPressed()) { + return; + } + if (isLayoutLeftToRight) { + currentIndex = tabboxFlow.moveCurrentIndexLeft(currentIndex); + } else { + currentIndex = tabboxFlow.moveCurrentIndexRight(currentIndex); + } + } + + Keys.onTabPressed : { + if (isLayoutLeftToRight) { + currentIndex = tabboxFlow.moveCurrentIndexRight(currentIndex); + } else { + currentIndex = tabboxFlow.moveCurrentIndexLeft(currentIndex); + } + } + + Keys.onPressed : { + if (event.key === Qt.Key_Left) { + currentIndex = tabboxFlow.moveCurrentIndexLeft(currentIndex); + } else if (event.key === Qt.Key_Right) { + currentIndex = tabboxFlow.moveCurrentIndexRight(currentIndex); + } else if (event.key === Qt.Key_Up) { + currentIndex = tabboxFlow.moveCurrentIndexUp(currentIndex); + } else if (event.key === Qt.Key_Down) { + currentIndex = tabboxFlow.moveCurrentIndexDown(currentIndex); + } else { + return; + } + } + + Keys.onReleased : { + if (event.key === Qt.Key_Alt) { + activateSelectedWindow(); + } else if (event.key === Qt.Key_Shift && !multitaskViewManager.isAltKeyPressed()) { + activateSelectedWindow(); + } + } + + function activateSelectedWindow() { + if (!previewItemRepeater.itemAt(currentIndex)) { + return; + } + controller.onWindowClicked(previewItemRepeater.itemAt(currentIndex).uuid); + } +} + onCurrentIndexChanged: { + if (!multitaskViewManager.altTabVisible) { + return; + } + + scrollToTabItem() + } + + function scrollToTabItem() { + var currentNextY = previewItemRepeater.itemAt(currentIndex).mapToItem(tabboxFlickable, 0, 0).y + var previewWindowHeight = previewItemRepeater.itemAt(currentIndex).height + if (currentNextY < 0) { + scrollMoveAnimation.to = tabboxScrollBar.position - (-currentNextY + tabbox.viewMargin) / tabboxFlickable.contentHeight + scrollMoveAnimation.start() + } else if (currentNextY + previewWindowHeight > tabboxFlickable.height) { + scrollMoveAnimation.to = tabboxScrollBar.position + (currentNextY + previewWindowHeight - tabboxFlickable.height + tabbox.viewMargin) / tabboxFlickable.contentHeight + scrollMoveAnimation.start() + } + } + + Connections { + target: multitaskViewManager + function onAltTabVisibleChanged() { + if (!multitaskViewManager.altTabVisible) { + root.currentIndex = -1 + } + } + } +} diff --git a/windowsview/qml/TabletController.js b/windowsview/qml/TabletController.js deleted file mode 100644 index fcc80c727901cff1ca82ebac1a486c98c551f232..0000000000000000000000000000000000000000 --- a/windowsview/qml/TabletController.js +++ /dev/null @@ -1,166 +0,0 @@ -// Controller 是基类,用于各种根窗口或者非应用程序预览窗口的窗口, 实现了设计文档中预览窗口类中的大部分函数的转发接口; -// TabletAppController 是应用程序预览窗口控制器类,实现了点击窗口时激活的接口和删除应用程序预览窗口的接口。 -// ClearAllController 是全部清除按钮控制器类,实现了清除所有窗口的接口和设置按钮按下状态的接口。 -// 控制器基类 -class Controller { - constructor(model, view, manager, acceptedTypeSet) { - this.model = model; - this.view = view; - this.manager = manager; - this.acceptedTypeSet = acceptedTypeSet; - } - - initViewAnimation() { - // default screen is 0 - if (this.model.getAppWindowList(this.model.getCurrentDesktop(), 0).length === 0) - { - // no app window - // calling no window animation - this.view.startNoWindowTipsAnimation(); - // view will call disappear animation itself. - // view will call close function then. - } - else - { - // call AllClear Button animation - this.view.startSequentialLoadWindowTimer(); - } - } - - //点击空白处关闭多任务视图 - viewSpacingClickedController() - { - if (this.model.isTabletMode) { - this.manager.showDesktop(true); - } - this.view.viewSpacingClickedController() - } - - // 关闭多任务视图 - closeMultitaskView() { - this.manager.close(); - } - - // 窗口点击事件处理 - onWindowClicked(windowId) { - } - - startClearAllBtnDisappearAni() - { - this.view.startClearAllBtnDisappearAni(); - } - - // 删除预览窗口 - removePreviewWindow(windowId) {} - - // 设置默认态 - setDefaultStatus() { - this.view.setDefaultStatus(); - } - - // 设置 Hover 态 - setHoverStatus() { - this.view.setHoverStatus(); - } - - //设置长按状态 - setPressStatus() - { - this.view.setHoverStatus(); - } - - // 设置拖拽态 - setDragStatus() { - this.view.setDragStatus(); - } - - // 设置拖拽接收态 - setReceiveStatus() { - this.view.setReceiveStatus(); - } - - startSpaceClickedPreWindowAnimation() - { - this.view.startSpaceClickedPreWindowAnimation(); - } -} - -class TabletAppController extends Controller { - constructor(model, view, manager, acceptedTypeSet) { - super(model, view, manager, acceptedTypeSet); - } - - // 窗口点击事件处理 - onWindowClicked(windowId) { - // activate windowId - this.model.activateAppWindow(windowId); - if (this.model.isTabletMode) - { - this.view.startActiveWindowAnimation(); - // view will call close function - } - } - - // 向上滑动确认关闭 - slideUpCloseWindow() { - this.view.startCloseWindowAnimation(); - } - - // 向上滑动取消关闭 - startResumeWindowAnimation() { - this.view.startResumeWindowAnimation(); - } - - // 删除预览窗口 - removePreviewWindow(windowId) { - if (this.model.hasModalChildWindow(windowId)) - { - this.onWindowClicked(windowId); - // If window has modal child window, - // controller calls close force. - this.closeMultitaskView(); - } - else - { - // delete app - this.model.removeAppWindow(windowId); - } - } - - startClearAllWindowAnimation(/*unused*/) { - this.view.startClearAllWindowAnimation(); - } - - removeAppWindowOnDesktop() - { - this.model.removeAllAppWindowOnDesktop(this.model.getCurrentDesktop()); - this.closeMultitaskView(); - } -} - -class CloseButtonController extends Controller { - constructor(model, view, manager, acceptedTypeSet) { - super(model, view, manager, acceptedTypeSet); - } -} - -class ClearAllController extends Controller { - constructor(model, view, manager, acceptedTypeSet) { - super(model, view, manager, acceptedTypeSet); - } - - // 窗口点击事件处理 - onWindowClicked(/*unused*/) { - this.view.startClearAllWindowAnimation(); - } - removeAllAppWindowOnDesktop() - { - this.model.removeAllAppWindowOnDesktop(this.model.getCurrentDesktop()); - this.closeMultitaskView(); - } - - // 窗口按下事件处理 - setPressStatus() { - this.view.setPressStatus(); - } -} diff --git a/windowsview/qml/TabletMultitaskView.qml b/windowsview/qml/TabletMultitaskView.qml deleted file mode 100644 index 6ac92613a9342ff3308de1a73269d38f8ade58f7..0000000000000000000000000000000000000000 --- a/windowsview/qml/TabletMultitaskView.qml +++ /dev/null @@ -1,64 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.5 -import QtQuick.Layouts 1.3 -import QtQuick.Window 2.12 -import org.ukui.kwin 2.0 as KWin -import org.kde.plasma 2.0 as PlasmaCore -import QtGraphicalEffects 1.0 -import "TabletController.js" as TabletController -import IconTheme 1.0 - -TabletViewRootWindow { - id : rootView - - //为了解决控制器模块的view,实现父类调用子类 - signal qmlViewSpaceClicked() - signal qmlViewClosed() - signal qmlClearAllAppWindow() - //由于执行小窗口关闭动效时,会关闭多任务视图多次,导致崩溃,故增加此属性 - property bool alreadyCloseView: false - - Connections{ - target : rootView - - onQmlViewClosed:{ - if (!alreadyCloseView) - { - alreadyCloseView = true - controller.closeMultitaskView() - } - if (tabletViewRootModel.count>0) - { - tabletViewRootModel.clear() - } - } - } - Connections{ - target : tabletViewMainWindow - onQmlAppWindowRemovedForward:{ - for(var i = 0; i < tabletViewRootModel.count; i++){ - var info = tabletViewRootModel.get(i); - if(info.id === id) { - tabletViewRootModel.remove(i); - return; - } - } - } - } - - TabletScrollViewArea { - id : appArea - x : 0 - y : Math.floor(scrollViewYStartPoint) - width : Math.floor(tabletViewMain.width) - height : Math.floor(scrollViewHeight) - appModel : tabletViewRootModel - rootRect : screenRect - } - - TabletViewClearAllWindowButton { - id : clearAllWindow - property var controller : new TabletController.Controller(multitaskViewModel, clearAllWindow, multitaskViewManager, ["none"]) - } - -}//Rectangle rootView diff --git a/windowsview/qml/TabletPreviewWindow.qml b/windowsview/qml/TabletPreviewWindow.qml index 48305cf341ac6a4345c95b43e2c1f4db94ab742f..dbbdb62ef2bdfefb5d967dc300f4516eee88ac26 100644 --- a/windowsview/qml/TabletPreviewWindow.qml +++ b/windowsview/qml/TabletPreviewWindow.qml @@ -1,451 +1,394 @@ +/* + * Copyright (C) 2022, KylinSoft Co., Ltd. + + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + import QtQuick 2.12 -import QtQuick.Controls 2.5 import QtQuick.Layouts 1.3 -import "TabletController.js" as TabletController -import IconTheme 1.0 -import org.kde.plasma 2.0 as PlasmaCore import QtGraphicalEffects 1.0 +//ukui-quick +import org.ukui.quick.items 1.0 as UkuiItem +import org.ukui.quick.platform 1.0 as UkuiPlatform -Rectangle { - id : tabletPreviewWindow - width : 498 - height : 320 - color : "transparent" - - property ListModel premodel : null +Item { + id : root property bool closeButtonVisble : false - property real borderWidth : 0 - property var stateList : ["default", "hover"]; + property var screenIndex : null state : "default" - property int wid : -1 + property string wid : "" + property int x_wid //当前预览窗口在桌面上的未缩放前的实际宽度 property int preViewNoScaledWidth : -1 //当前预览窗口在桌面上的未缩放前的实际高度 property int preViewNoScaledHeight : -1 //当前预览窗口在桌面上的未缩放前的X坐标 property int preViewNoScaledXCoordinate : -1 - //当前预览窗口在桌面上的未缩放前的Y坐标 + //当前预览窗口在桌面上的未缩放前的Y坐标 property int preViewNoScaledYCoordinate : -1 - property var captionText : "" - property var appController : new TabletController.TabletAppController(multitaskViewModel, appWindow, multitaskViewManager, ["app"]) - property var thumbAnchorRootMapGloableX : mapToGlobal(thumbAnchorRoot.x,thumbAnchorRoot.y).x - property var thumbAnchorRootMapGloableY : mapToGlobal(thumbAnchorRoot.x,thumbAnchorRoot.y).y - property int thumbnailRadius: multitaskViewManager.useOpenGL() ? 14 : 0 + property string captionText : "" + property real thumbAnchorRootMapGloableX : 0 + property real thumbAnchorRootMapGloableY : 0 + property int thumbnailRadius : UkuiPlatform.GlobalTheme.kRadiusWindow * tabletScaleFactor + property var icon + //drag event + property bool dragActive: previewWindowMouseArea.drag.active + property real dargBeginTime : Date.now() + + states : [ + State { + name : "default" + PropertyChanges { target : thumbnailWindow; border.width : 0 } + PropertyChanges { target : previewWindowCloseButton; visible : false } + }, + State { + name : "hover" + PropertyChanges { target : thumbnailWindow; border.width : borderWidth } + PropertyChanges { target : previewWindowCloseButton; visible : true } + } + ] + + //控制白色边框是否显示 + MouseArea { + id : previewWindowMouseArea + anchors.fill : parent + hoverEnabled : true + drag.target: root + drag.axis: Drag.YAxis + drag.maximumY: root.height / 10 + + Accessible.role: Accessible.Button + Accessible.name: "active-window-" + root.caption + Accessible.description: "preview-window, click to active the app window" + + onEntered : { + if (!thumbnailWindow.thumbClicked) { + root.state = "hover" + } + } + onExited: { + root.state = "default" + } + onClicked: { + appWindowClicked() + } + + ColumnLayout { + id : columnLayout + spacing : iconToThumbSpacing + anchors.centerIn : parent + Layout.fillHeight : true + width : root.width + + RowLayout { + id : captionRow + spacing : Math.floor(12 * tabletScaleFactor) + Layout.fillHeight : true + layoutDirection: isLayoutLeftToRight ? Qt.LeftToRight : Qt.RightToLeft + + UkuiItem.Icon { + id: iconItem + width: iconAndCloseButtonHeight + height: width + source: icon + } + + UkuiItem.DtThemeText { + id : caption + Layout.fillWidth : true + text : captionText + fontSizeMode : Text.HorizontalFit + horizontalAlignment: isLayoutLeftToRight ? Qt.AlignLeft : Qt.AlignRight + elide : isLayoutLeftToRight ? Text.ElideRight : Text.ElideLeft + textColor : UkuiPlatform.GlobalTheme.kFontWhite + } + + TabletViewCloseButton { + id : previewWindowCloseButton + Accessible.name: "close-window-" + captionText + Accessible.description: "close-button, click to close the app window" + + onExited: { + if (!previewWindowMouseArea.containsMouse) { + root.state = "default" + } + } + onClicked: { + removePreviewWindow(wid) + } + } + }//RowLayout captionRow + + UkuiItem.DtThemeBackground { + id : thumbnailWindow + height : root.height - iconToThumbSpacing - iconAndCloseButtonHeight + width : root.width + color : "transparent" + radius : root.thumbnailRadius + borderColor : UkuiPlatform.GlobalTheme.kWhite + border.width : borderWidth + property bool thumbClicked: false // 记录是否是点击缩略图 + + states: [ + State { + name : "mousestate" + when : thumbnailWindow.thumbClicked + ParentChange { + target : thumbnailBackground + parent : tabletViewMain + } + } + ] + + UkuiItem.DtThemeBackground { + id : thumbnailBackground + /* + * 此处必须使用 x, y, width, height 进行位置设置,且禁止使用 anchors.centerIn 和 anchors.fill 等 + * 因为 thumbnailBackground 在动画过程中会改变 parent,所以如果使用锚点会导致 thumbnailBackground + * 突然参考新的 parent 改变大小。设置 width 和 height 时,禁止使用 parent.width 和 parent.height + * 也是如此。 + */ + x : borderWidth + y : borderWidth + width : thumbnailWindow.width - 2 * borderWidth + height : thumbnailWindow.height - 2 * borderWidth + // anchors.centerIn : parent + useStyleTransparency: true + backgroundColor : UkuiPlatform.GlobalTheme.kContainGeneralNormal + radius : root.thumbnailRadius !== 0 ? root.thumbnailRadius - borderWidth : 0 + Loader { + id: thumbnail + width : Math.floor(thumbWidth()) + height : Math.floor(thumbHeight()) + anchors.centerIn : parent + property string thumbnailId : wid + source: isWlcom ? "ThumbnailWithWlcom.qml" : "ThumbnailWithKwin.qml" + clip : true + layer.enabled : root.thumbnailRadius !== 0 + layer.effect : OpacityMask { + maskSource : Rectangle { + width : thumbnail.width + height : thumbnail.height + radius : root.thumbnailRadius + } + } + + function thumbWidth(){ + var factor = model.height / thumbnailBackground.height; + var width = model.width / factor; + return Math.min(thumbnailBackground.width, width); + } + + function thumbHeight(){ + var factor = thumbnailBackground.width * model.height + var height = factor / model.width; + return Math.round(Math.min(thumbnailBackground.height, height)) + } + } + + } + } + } + } + + onDragActiveChanged: { + if (dragActive) { + enlargeWindowAnimation.start() + appWindowReturnBackAnimation.stop() + dargBeginTime = Date.now() + } else { + var subTime = Date.now() - dargBeginTime + var subDistance = -root.y + var velocity = Math.abs(subDistance) / subTime; + // console.log("移动距离: " + subDistance , "窗口的三分之二距离: ", root.height * 2 / 3) + // console.log("速度为: " + velocity) + // 平均速度或者位移距离 + if ((velocity > 0.5 && subDistance > 0 ) || subDistance >= root.height * 2 / 3) { + slideUpToCloseWindowAnimation.start() + } else { + appWindowReturnBackAnimation.start() + } + } + } + + Connections { + target : tabletViewMain + function onClearAllWindowButtonClickSignal() { + clearAllWindowAnimation.start() + } + function onBlankAreaClickSignal() { + spaceClickedPreWindowAnimation.start() + } + } /***************************************动画***************************/ - //全部清除窗口的动效 - ParallelAnimation - { - id:clearAllWindowAnimation + // 全部清除窗口的动效 + ParallelAnimation { + id : clearAllWindowAnimation NumberAnimation { - target: tabletPreviewWindow + target: root properties: "y" - to: Math.floor(tabletPreviewWindow.y - tabletPreviewWindow.height * 2) + to: Math.floor(root.y - root.height * 2) duration: 300 easing.type: Easing.InOutQuart } NumberAnimation { - target: tabletPreviewWindow + target: root properties: "opacity" to: 0 duration: 300 easing.type: Easing.InOutQuart } - onFinished: { - removeAppWindow(wid) - if (premodel.count <= 0) - { - appController.removeAppWindowOnDesktop() - } + onFinished : { + removePreviewWindow(wid) } } - //点击空白处关闭多任务视图动效(小窗口逐渐在原地消失) + // 点击空白处关闭多任务视图动效(小窗口逐渐在原地消失) NumberAnimation { id : spaceClickedPreWindowAnimation - target : tabletPreviewWindow + target : root property : "opacity" duration : 300 easing.type : Easing.InOutQuart from : 1 to : 0 onFinished: { - qmlViewClosed() + closeMultitaskView() } } - //! 上滑关闭窗口动效 - NumberAnimation { + // 上滑关闭窗口动效 + SmoothedAnimation { id : slideUpToCloseWindowAnimation - target : tabletPreviewWindowMove + target : root property : "y" //因为需要上滑完全离开屏幕 尤其第二行预览窗口,故需要-(预览窗口距离屏幕顶端的距离+预览窗口本身高度) - to : Math.floor(0 - appWindowBack.y- tabletPreviewWindowMove.height) - duration : 200 - easing.type : Easing.InOutQuart + to : Math.floor(0 - root.parent.y - root.height) + velocity : 1100 + reversingMode: SmoothedAnimation.Eased onFinished: { removePreviewWindow(wid) } } - //取消上滑后,恢复到原始位置的动画 + // 上滑窗口 放大窗口 NumberAnimation { - id : appWindowReturnBackAnimation - target : tabletPreviewWindow - property : "y" - to : Math.floor(tabletPreviewWindowMove.y) + id : enlargeWindowAnimation + target: root + property : "scale" duration : 200 - easing.type : Easing.InOutQuart + to : 1.05 } - //点击应用程序预览窗口激活应用程序时的动画特效 - ParallelAnimation{ - id : activateWindowAnimation - NumberAnimation{ - target : thumbAnchorRoot + // 取消上滑后,恢复到原始位置的动画 + ParallelAnimation { + id : appWindowReturnBackAnimation + SpringAnimation { + target : root + property : "y" + to : 0 + easing.type : Easing.InOutQuart + damping : 0.15 // 弹簧阻尼值。默认值为0,取值0~1.0。控制 + spring : 2 // 弹性。有效值范围是0~5.0,默认值为0(禁用了spring的动作)。 + } + + NumberAnimation { + id : restoreWindowSizeAnimation + target: root + property : "scale" + duration : 200 + to : 1 + } + } + + // 点击应用程序预览窗口激活应用程序时的动画特效,只针对平板模式 + ParallelAnimation { + id : activateWindowAnimationForTabletMode + NumberAnimation { + target : thumbnailBackground property : "x" - from : Math.floor(thumbAnchorRootMapGloableX) + from : thumbAnchorRootMapGloableX to : preViewNoScaledXCoordinate - duration : 250 + duration : 1000 easing.type : Easing.InOutQuart } - NumberAnimation{ - target : thumbAnchorRoot + NumberAnimation { + target : thumbnailBackground property : "y" - from : Math.floor(thumbAnchorRootMapGloableY) + from : thumbAnchorRootMapGloableY to : preViewNoScaledYCoordinate - duration : 250 + duration : 1000 easing.type : Easing.InOutQuart } - NumberAnimation{ - target : thumbAnchorRoot + NumberAnimation { + target : thumbnailBackground property : "width" to : preViewNoScaledWidth - duration : 250 + duration : 1000 easing.type : Easing.InOutQuart } - NumberAnimation{ - target : thumbAnchorRoot + NumberAnimation { + target : thumbnailBackground property : "height" to : preViewNoScaledHeight - duration : 250 + duration : 1000 easing.type : Easing.InOutQuart } onFinished: { - qmlViewClosed() + closeMultitaskView() } } - /***************************************函数*************************/ - function removePreviewWindow(wid) - { - appController.removePreviewWindow(wid) - if ( premodel.count<= 1) - { - qmlViewClosed() - } - removeAppWindow(wid) - } - - function removeAppWindow(wid){ - for(var i = 0; i < premodel.count; i++){ - var info = premodel.get(i); - if(info.id === wid) { - premodel.remove(i); - return; - } - } + function closeMultitaskView() { + multitaskViewManager.close() } - function appWindowClicked(){ - if (!multitaskViewModel.isTabletMode) - { - appController.onWindowClicked(wid); - qmlViewClosed() - } - else - { - thumbAnchorRootMapGloableY = Math.floor(mapToGlobal(thumbMove.x,thumbMove.y).y) - thumbAnchorRootMapGloableX = Math.floor(mapToGlobal(thumbMove.x,thumbMove.y).x) - thumbAnchorRoot.thumbClicked = true - captionRow.visible = false - thumbBorder.border.width = 0 - preWindowCloseButton.visible = false - appController.onWindowClicked(wid); - } - } - - function setStatus(status) { - if(stateList.indexOf(status) < 0) - { - return; - } - if (status === state) { - return - } - state = status; - } - - function setDefaultStatus() { - setStatus("default") - } - - function setHoverStatus() { - setStatus("hover") - } - - function startClearAllWindowAnimation() - { - clearAllWindowAnimation.start() - } - - function startSpaceClickedPreWindowAnimation() - { - spaceClickedPreWindowAnimation.start() - } - - function startCloseWindowAnimation() - { - slideUpToCloseWindowAnimation.start() - } - - function startResumeWindowAnimation() - { - appWindowReturnBackAnimation.start() - } - - function startActiveWindowAnimation() + function removePreviewWindow(wid) { - activateWindowAnimation.start() - } - - function setCaption(titleText) { - caption.text = titleText; - } - - function setId(wId) { - wid = wId; - } - - function setPreViewNoScaledWidth(Width) { - preViewNoScaledWidth = Width; - } - - function setPreViewNoScaledHeight(Height) { - preViewNoScaledHeight = Height; - } - - function setPreViewNoScaledXCoordinate(X) { - preViewNoScaledXCoordinate = X; - } - - function setPreViewNoScaledYCoordinate(Y) { - preViewNoScaledYCoordinate = Y; - } - - //控制白色边框是否显示 - MouseArea{ - id : preWindowMouseArea - anchors.fill : parent - preventStealing : true - hoverEnabled : true - - onEntered : { - appController.setHoverStatus(); - } - - onExited: { - if(!preWindowCloseButton.closeButtonContainMouse) - { - appController.setDefaultStatus(); + console.log("removePreviewWindow", wid) + if (multitaskViewModel.hasModalChildWindow(wid)) { + multitaskViewModel.activateAppWindow(wid) + if (multitaskViewModel.isTabletMode()) { + activateWindowAnimationForTabletMode.start() } - } - - onClicked: { - appWindowClicked() + // If window has modal child window, calls close force. + multitaskViewManager.close(); + } else { + // delete app + multitaskViewModel.removeAppWindow(wid); } } - Rectangle{ - id : tabletPreviewWindowMove - width : Math.floor(parent.width) - height : Math.floor(parent.height) - color : "transparent" - radius : tabletPreviewWindow.thumbnailRadius - ColumnLayout { - id : columnLayout - spacing : iconToThumbSpacing - anchors.centerIn : parent - Layout.fillHeight : true - width : Math.floor(tabletPreviewWindow.width) - - RowLayout { - id : captionRow - spacing : 12 * tabletScaleFactor - Layout.fillHeight : true - - Rectangle { - id : iconItem - height : Math.floor(iconAndCloseButtonHeight) - width : Math.floor(iconAndCloseButtonHeight) - color : "transparent" - IconTheme{ - anchors.fill : parent - icon : multitaskViewModel.getWindowIcon(wid) - } - } - - Label { - id : caption - Layout.fillWidth : true - text : captionText - fontSizeMode : Text.HorizontalFit - elide : Text.ElideRight - color : "#FFFFFF" - } - - TabletViewCloseButton { - id : preWindowCloseButton - - states : [ - State { - name : "default" - PropertyChanges { target : preWindowCloseButton; imageSource : "qrc:/images/ukui-taskview-close-default.svg" } - }, - State { - name : "hover" - PropertyChanges { target : preWindowCloseButton; imageSource : "qrc:/images/ukui-taskview-close-hover.svg" } - }, - State { - name : "press" - PropertyChanges { target : preWindowCloseButton; imageSource : "qrc:/images/ukui-taskview-close-click.svg" } - } - ] - - Component.onCompleted: { - preWindowCloseButton.setId(model.id) - } - } - }//RowLayout captionRow - - Rectangle{ - id : thumbBorder - height : Math.floor(preWinHeight) - width : Math.floor(preWinWidth + 8) - color : "transparent" - radius : tabletPreviewWindow.thumbnailRadius - border.color : "#FFFFFF" - border.width : Math.floor(borderWidth) - - Rectangle{ - id : thumbAnchorRoot - height : Math.floor(preWinHeight) - width : Math.floor(preWinWidth) - color : Qt.rgba(255,255,255, 0.5) - x : 4 - y : 0 - radius : tabletPreviewWindow.thumbnailRadius - property bool thumbClicked: false//记录是否是点击缩略图 - - Rectangle{ - id : thumbMove - width : Math.floor(parent.width) - height : Math.floor(parent.height) - color : "transparent" - anchors.centerIn : parent - radius : tabletPreviewWindow.thumbnailRadius - - states: [ - State { - name : "mousestate" - when : thumbAnchorRoot.thumbClicked - ParentChange { - target : thumbAnchorRoot - parent : rootView - } - } - ] - - MouseArea{ - anchors.fill : parent - //这里没有鼠标透传的原因:如果鼠标透传的话,会影响Scrollview的拖拽功能 - onClicked: { - appWindowClicked() - } - } - - Rectangle { - id:thumb - visible:true - - function thumbWidth(){ - var factor = model.height / thumbMove.height; - var width = model.width / factor; - return Math.min(thumbMove.width, width); - } - - function thumbHeight(){ - var factor = thumbMove.width * model.height - var height = factor / model.width; - return Math.floor(Math.min(thumbMove.height, height)) - } - - width : Math.floor(thumb.thumbWidth()) - height : Math.floor(thumb.thumbHeight()) - anchors.centerIn : parent - radius : tabletPreviewWindow.thumbnailRadius - color : "transparent" - clip : true - layer.enabled : multitaskViewManager.useOpenGL() ? true : false - layer.effect : OpacityMask{ - maskSource : Rectangle{ - width : Math.floor(thumb.width) - height : Math.floor(thumb.height) - radius : tabletPreviewWindow.thumbnailRadius - } - } - PlasmaCore.WindowThumbnail{ - anchors.centerIn : parent - height : Math.floor(thumb.height) - width : Math.floor(thumb.width) - winId : wid - clip : true - } - } - } - } - } + function appWindowClicked() + { + if (multitaskViewModel.isTabletMode) { + thumbAnchorRootMapGloableX = mapToGlobal(thumbnailBackground.x, thumbnailBackground.y).x + thumbAnchorRootMapGloableY = mapToGlobal(thumbnailBackground.x, thumbnailBackground.y).y + thumbnailWindow.thumbClicked = true + captionRow.visible = false + thumbnailWindow.border.width = 0 + previewWindowCloseButton.visible = false + multitaskViewModel.activateAppWindow(wid) + activateWindowAnimationForTabletMode.start() + } else { + multitaskViewModel.activateAppWindow(wid); + closeMultitaskView() } } - DragHandler{ - property int dragTime : 0 - property var beginTime : Date.now() - id : windowDrag - target : tabletPreviewWindow - xAxis.enabled : false - yAxis.maximum : 0 - - onActiveChanged: { - if (active){ - beginTime = Date.now() - } - if (!active){ - var subTime = Date.now() - beginTime - var subDistance = Math.abs(tabletPreviewWindowMove.y - tabletPreviewWindow.y) - var v = Math.abs(subDistance) / subTime; - console.log("移动距离 ,窗口的三分之二" + subDistance , tabletPreviewWindow.height * 1 / 2) - console.log("速度为: " + v) - // 平均速度或者位移距离 - if (v > 0.5 || subDistance >= tabletPreviewWindow.height * 1 / 2){ - appController.slideUpCloseWindow() - }else{ - appController.startResumeWindowAnimation() - } - } - } - }//windowDrag } - - diff --git a/windowsview/qml/TabletScrollViewArea.qml b/windowsview/qml/TabletScrollViewArea.qml deleted file mode 100644 index 0a6ce557f0fc80f8dbdf6f51d1db246d06b05f6a..0000000000000000000000000000000000000000 --- a/windowsview/qml/TabletScrollViewArea.qml +++ /dev/null @@ -1,167 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.5 -import QtQuick.Layouts 1.3 -import QtQuick.Window 2.12 -import org.kde.plasma 2.0 as PlasmaCore -import QtGraphicalEffects 1.0 -import "TabletController.js" as TabletController -import IconTheme 1.0 - - -Rectangle{ - id : tabletScrollViewArea - width : 1920 - height : 1080 - color : "transparent" - property ListModel appModel : null - property var rootRect : null - //调用全部清除按钮动效的时候需要用到 - property var appAreaController : null - - ScrollView{ - id : scrollView - - //更新滚动区域的大小,之所以这么做,是为了解决滚动区域增加鼠标事件后,滚动失效的问题 - function getContentWidth() - { - var maxColumn = Math.ceil(appModel.count / 2) - var scrollViewContentWidth = appArea.width - if (appModel.count <= 4) - { - scrollViewContentWidth = appArea.width - return Math.floor(scrollViewContentWidth) - } - scrollViewContentWidth = maxColumn * preWinWidth + maxColumn * gridLayout.columnSpacing + 2 * gridLayout.leftPadding - return Math.floor(scrollViewContentWidth) - } - - x : 0 - y : 0 - contentWidth : Math.floor(scrollView.getContentWidth()) - contentHeight : Math.floor(appArea.height) - width : Math.floor(rootRect.width) - ScrollBar.horizontal.policy : ScrollBar.AlwaysOff - ScrollBar.vertical.policy : ScrollBar.AlwaysOff - - MouseArea{ - anchors.fill : parent - propagateComposedEvents: true - - onClicked: { - mouse.accepted = false - } - } - - Grid{ - id : gridLayout - anchors.fill : parent - anchors.centerIn : parent - columnSpacing : Math.floor(preWinVecSpace) - rowSpacing : Math.floor(preWinHorSpace) - leftPadding : Math.floor(scrollViewLeftSpace) - rightPadding : Math.floor(scrollViewLeftSpace) - rows : 2 - flow : Grid.TopToBottom - - //显示多任务视图时,每个Item在显示的时候执行的动效 - add : Transition { - id : displayPreviewWinAnimation - - ParallelAnimation{ - NumberAnimation { - property : "opacity" - duration : 300 - easing.type : Easing.InOutQuart - from : 0 - to : 1 - } - NumberAnimation { - property : "x" - duration :300 - easing.type : Easing.InOutQuart - from : Math.floor(rootRect.width / 2 - 510/*窗口的宽度*/ / 2) - } - NumberAnimation { - property : "y" - duration : 300 - easing.type : Easing.InOutQuart - from : Math.floor(rootRect.height) - } - NumberAnimation { - property : "scale" - from : 0 - to : 1.0 - duration : 150 - } - } - - } - - //关闭小窗口时,W补齐方式的动画 - move : Transition { - NumberAnimation{ - properties : "x,y"; - easing.type : Easing.InOutQuart; - duration : 300 - } - } - - - Repeater{ - id : previewWindowRepeater - model : appModel - - Rectangle{ - id : appWindowBack - height : Math.floor(preWinHeight + iconToThumbSpacing + iconAndCloseButtonHeight) - width : Math.floor(preWinWidth) - color : "transparent" - radius : 14 - - TabletPreviewWindow { - id : appWindow - height : Math.floor(preWinHeight + iconToThumbSpacing + iconAndCloseButtonHeight) - width : Math.floor(preWinWidth) - color : "transparent" - radius : 14 - premodel : appModel - - states : [ - State { - name : "default" - PropertyChanges { target : appWindow; borderWidth : 0 } - PropertyChanges { target : appWindow; closeButtonVisble : false } - }, - - State { - name : "hover" - PropertyChanges { target : appWindow; borderWidth : 4 } - PropertyChanges { target : appWindow; closeButtonVisble : true } - } - ] - - Connections{ - target : rootView - onQmlViewSpaceClicked:{ - appWindow.appController.startSpaceClickedPreWindowAnimation() - } - - onQmlClearAllAppWindow:{ - appWindow.appController.startClearAllWindowAnimation() - } - } - - Component.onCompleted: { - appWindow.setCaption(model.caption) - appWindow.setId(model.id) - appWindow.setPreViewNoScaledHeight(model.height) - appWindow.setPreViewNoScaledWidth(model.width) - appWindow.setPreViewNoScaledXCoordinate(model.x) - appWindow.setPreViewNoScaledYCoordinate(model.y) - } - } - } - } - } - } -} diff --git a/windowsview/qml/TabletViewClearAllWindowButton.qml b/windowsview/qml/TabletViewClearAllWindowButton.qml deleted file mode 100644 index 94a290bbae8392b871bf3e31aa01f789406f47d6..0000000000000000000000000000000000000000 --- a/windowsview/qml/TabletViewClearAllWindowButton.qml +++ /dev/null @@ -1,100 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.5 -import QtQuick.Layouts 1.3 -import "TabletController.js" as TabletController -import IconTheme 1.0 -import QtQuick.Window 2.12 -import org.ukui.kwin 2.0 as KWin -import QtGraphicalEffects 1.0 - -Rectangle{ - id : tabletViewClearAllWindowButton - height : Math.floor(48 * tabletScaleFactor) - width : Math.floor(126 * tabletScaleFactor) - color : Qt.rgba(255,255,255, 0.4) - radius : 10 - anchors.verticalCenter : parent.verticalCenter - anchors.verticalCenterOffset : Math.floor(screenRect.height / 2 - 48 * tabletScaleFactor -38 * tabletScaleFactor) - anchors.horizontalCenter : parent.horizontalCenter - anchors.horizontalCenterOffset : 0 - visible : tabletViewRootModel.count>0 - opacity : 0 - - - Rectangle{ - id : deleteIcon - width : Math.floor(24 * tabletScaleFactor) - height : Math.floor(24 * tabletScaleFactor) - color : "transparent" - x : Math.floor(27 * tabletScaleFactor) - y : Math.floor(12 * tabletScaleFactor) - Image { - id : deleteImage - anchors.fill : parent - source : "qrc:/images/tablet_delete.svg" - } - } - - Label{ - id : deletText - x : Math.floor(60 * tabletScaleFactor) - y : Math.floor(10 * tabletScaleFactor) - Layout.fillWidth : true - text : "清除" - elide : Text.ElideRight - font.pixelSize : 18 * tabletScaleFactor - color : "#000000" - } - - MouseArea{ - anchors.fill : parent - hoverEnabled : true - onEntered: { - tabletViewClearAllWindowButton.color = Qt.rgba(255,255,255, 0.6) - } - onPressed: { - tabletViewClearAllWindowButton.color = Qt.rgba(255,255,255, 0.8) - } - onExited: { - tabletViewClearAllWindowButton.color = Qt.rgba(255,255,255, 0.4) - } - - onClicked: { - console.log("全部清除被点击!") - controller.startClearAllBtnDisappearAni() - qmlClearAllAppWindow() - } - } - - function startClearAllBtnAppearAni() - { - clearAllWindowButtonAppearAni.start() - } - - function startClearAllBtnDisappearAni() - { - clearAllWindowButtonDisappearAni.start() - } - - //全部清除按钮出现的动画 - NumberAnimation { - id : clearAllWindowButtonAppearAni - target : tabletViewClearAllWindowButton - properties : "opacity" - from : 0 - to : 1 - duration : tabletViewRootModel.count >= 6 ? 5 * 100 + 300 : (tabletViewRootModel.count - 1) * 100 + 300 - easing.type : Easing.InOutQuart - } - - //全部清除按钮消失的动画 - NumberAnimation { - id : clearAllWindowButtonDisappearAni - target : tabletViewClearAllWindowButton - properties : "opacity" - from : 1 - to : 0 - duration : 300 - easing.type : Easing.InOutQuart - } -} diff --git a/windowsview/qml/TabletViewCloseButton.qml b/windowsview/qml/TabletViewCloseButton.qml index eaf94b113c8293bb7c57db13b069fe0893b13c38..c418b22f1e17a259f645857d3da8196dc2b330fd 100644 --- a/windowsview/qml/TabletViewCloseButton.qml +++ b/windowsview/qml/TabletViewCloseButton.qml @@ -1,60 +1,69 @@ +/* + * Copyright (C) 2022, KylinSoft Co., Ltd. + + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + import QtQuick 2.12 -import QtQuick.Controls 2.5 -import QtQuick.Layouts 1.3 -import "TabletController.js" as TabletController -import IconTheme 1.0 -import org.kde.plasma 2.0 as PlasmaCore import QtGraphicalEffects 1.0 +//ukui-quick +import org.ukui.quick.items 1.0 as UkuiItem +import org.ukui.quick.platform 1.0 as UkuiPlatform -Rectangle { - id : closeButton - visible : closeButtonVisble - width : Math.floor(iconAndCloseButtonHeight) - height : Math.floor(iconAndCloseButtonHeight) - radius : 14 - color : "transparent" - - property var closeButtonController : new TabletController.CloseButtonController(multitaskViewModel, closeButton, multitaskViewManager, ["app"]) - property var buttonStateList : ["default", "hover", "press"]; +UkuiItem.DtThemeBackground { + id : root + visible : false + width : iconAndCloseButtonHeight + height : width + radius : width / 2 state : "default" - property var imageSource : "qrc:/images/ukui-taskview-close-default.svg" - property int wid : -1 property alias closeButtonContainMouse: closeButtonMouseArea.containsMouse - Image { - id: closeWindow - anchors.fill : parent - source : imageSource - sourceSize.width: Math.floor(parent.width) - sourceSize.height: Math.floor(parent.height) - } - - function setStatus(status) { - if(buttonStateList.indexOf(status) < 0) - { - return; - } - if (status === state) { - return - } else { - state = status; - } - } - - function setDefaultStatus() { - setStatus("default") - } + signal entered() + signal exited() + signal pressed() + signal clicked() - function setHoverStatus() { - setStatus("hover") - } + Accessible.role: Accessible.Button + Accessible.name: "close" + Accessible.description: "a push button, click to close the preview window" + Accessible.onPressAction: { root.clicked() } - function setPressStatus() { - setStatus("press") - } + states : [ + State { + name : "default" + PropertyChanges { target: root; backgroundColor: UkuiPlatform.GlobalTheme.kContainGeneralAlphaNormal } + }, + State { + name : "hover" + PropertyChanges { target: root; backgroundColor: UkuiPlatform.GlobalTheme.kComponentHover } + }, + State { + name : "press" + PropertyChanges { target: root; backgroundColor: UkuiPlatform.GlobalTheme.kComponentClick } + } + ] - function setId(wId) { - wid = wId; + UkuiItem.Icon { + id: closeIcon + anchors.centerIn: parent + width: parent.width / 2 + height: parent.height / 2 + source: "window-close-symbolic" + mode: parent.closeButtonContainMouse ? UkuiItem.Icon.AutoHighlight : UkuiItem.Icon.Highlight } MouseArea{ @@ -62,23 +71,22 @@ Rectangle { anchors.fill : parent hoverEnabled : true onEntered: { - closeButtonController.setHoverStatus() + root.state = "hover" + root.entered() } onExited: { - closeButtonController.setDefaultStatus() - if(!preWindowMouseArea.containsMouse) - { - tabletPreviewWindow.setDefaultStatus() - } + root.state = "default" + root.exited() } onPressed: { - closeButtonController.setPressStatus() + root.state = "press" + root.pressed() } onClicked: { - tabletPreviewWindow.removePreviewWindow(wid) + root.clicked() } } } diff --git a/windowsview/qml/TabletViewMain.qml b/windowsview/qml/TabletViewMain.qml index 9d392a9dfc3622bb6976fe1b46ddca0ac99cad4b..ce48da695ab699ea7010d9dfc912c5289bfce53b 100644 --- a/windowsview/qml/TabletViewMain.qml +++ b/windowsview/qml/TabletViewMain.qml @@ -1,126 +1,476 @@ +/* + * Copyright (C) 2022, KylinSoft Co., Ltd. + + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + import QtQuick 2.12 import QtQuick.Controls 2.5 import QtQuick.Layouts 1.3 -import "TabletController.js" as TabletController -import IconTheme 1.0 import QtQuick.Window 2.12 -import org.ukui.kwin 2.0 as KWin import QtGraphicalEffects 1.0 +import org.kylin.background 3.0 as KWin +import AppWindowFilterModel 1.0 +//ukui-quick +import org.ukui.quick.items 1.0 as UkuiItem +import org.ukui.quick.platform 1.0 as UkuiPlatform -Rectangle{ - id : tabletViewMainWindow - - property var controller : new TabletController.Controller(multitaskViewModel, tabletViewMainWindow, multitaskViewManager, ["none"]) - Keys.onPressed: { - if (event.key === Qt.Key_Escape) { - controller.closeMultitaskView(); - return; - } - if (event.modifiers & Qt.MetaModifier) { - if (event.key === Qt.Key_Tab) { - controller.closeMultitaskView(); - return; - } - } - } +Repeater{ + id : allrootRepeater + model : screencnt + property int screencnt : multitaskViewModel.logicalScreenCount + //水平布局方向 + property bool isLayoutLeftToRight: multitaskViewManager.isLayoutLeftToRight() - signal qmlAppWindowActivated() - signal qmlAppWindowCreated(int id) - signal qmlAppWindowRemoved(int id) - signal qmlDeviceModeChanged(bool modeFlag) - signal qmlOrientationChanged(string orientation) + Item { + id : tabletViewMain + property var isWlcom : multitaskViewManager.isWlcom() + property var screenRect : multitaskViewModel.getFullScreenGeometry(multitaskViewModel.highlightDesktop, index) + // 整体缩放比 + property var tabletScaleFactor : screenRect.width > screenRect.height ? screenRect.height / 1080 : screenRect.width / 1080 + // 预览窗口宽高比 + property real previewWinAspectRatio: screenRect.width / screenRect.height + // 图标和缩略图的间距 + property int iconToThumbSpacing : 12 * tabletScaleFactor + // 图标高度 + property int iconAndCloseButtonHeight : 32 * tabletScaleFactor + // 缩略图高度 + property var preWinHeight + // 缩略图宽度 + property var preWinWidth + property int borderWidth : 4 * tabletScaleFactor + // 预览窗口列间距 + property var preWinVecSpace + // 预览窗口行间距 + property var preWinHorSpace + // 滚动区域距离左侧和右侧的间距 + property var scrollViewLeftSpace + // 滚动区域高度 + property var scrollViewHeight + // 滚动区域 y 轴起始高度 + property var scrollViewYStartPoint : getCurrentPreWindowHeight() + property ListModel tabletViewRootModel : ListModel{} + property var language : multitaskViewModel.getCurrentLanguage() + property int screenId: index - //后台发送qmlAppWindowRemoved,通过qmlAppWindowRemovedForward通知视图模块删除model内的数据 - signal qmlAppWindowRemovedForward(int id) + x : Math.floor(screenRect.x) + y : Math.floor(screenRect.y) + width : Math.floor(screenRect.width) + height : Math.floor(screenRect.height) - Connections{ - target : tabletViewMainWindow + // 这里放置后台提供的桌面背景的 Item + KWin.DesktopBackground { + anchors.fill : parent + blurAlpha : 0.7 + } - onQmlAppWindowActivated: { - controller.closeMultitaskView(); + function getCurrentPreWindowHeight() + { + console.log("当前开始计算每一个预览窗口的尺寸") + if ( screenRect.width > screenRect.height ) + { + scrollViewYStartPoint = Math.floor(99 * tabletScaleFactor) + preWinHeight = Math.floor(324 * tabletScaleFactor) + preWinWidth = Math.floor(preWinHeight * previewWinAspectRatio) + preWinVecSpace = Math.floor(112 * tabletScaleFactor) + preWinHorSpace = Math.floor(56 * tabletScaleFactor) + scrollViewLeftSpace = Math.floor(112 * tabletScaleFactor) + scrollViewHeight = Math.floor(820 * tabletScaleFactor) + } else { + scrollViewYStartPoint = Math.floor(196 * tabletScaleFactor) + preWinHeight = Math.floor(498 * tabletScaleFactor) + preWinWidth = Math.floor(preWinHeight * previewWinAspectRatio) + preWinVecSpace = Math.floor(96 * tabletScaleFactor) + preWinHorSpace = Math.floor(68 * tabletScaleFactor) + scrollViewLeftSpace = Math.floor(96 * tabletScaleFactor) + scrollViewHeight = Math.floor(1196 * tabletScaleFactor) + } } + focus : true + property int loadedWindowNum : 0 + /* + 此处的focus不可以删除,因为后台在grabbedKeyboardEvent()函数中增加了setfocus() + 不增加focus:true前端无法接受键盘事件 + 这是正向解决方法,其他方法非正向解决,不推荐!!! + */ - // onQmlAppWindowCreated: { - // controller.closeMultitaskView(); - // } + signal blankAreaClickSignal() + signal clearAllWindowButtonClickSignal() + //由于执行小窗口关闭动效时,会关闭多任务视图多次,导致崩溃,故增加此属性 + property bool alreadyCloseView: false - onQmlDeviceModeChanged : { - controller.closeMultitaskView(); + function sequentialLoadWindow() { + var appWindowCount = appListModel.rowCount() + var info + if (loadedWindowNum < appWindowCount && loadedWindowNum < 6 ) { + info = appWindowListModel.getItemData(appListModel.mapToSource(appListModel.index(loadedWindowNum, 0))) + tabletViewRootModel.append({"x": info.x, "y": info.y, + "width": info.width, "height": info.height, + "id": info.id, "minimized": info.minimized, + "caption": info.caption, "uuid": String(info.uuid)}); + loadedWindowNum = loadedWindowNum + 1 + // console.log("加载窗口中,目前已加载窗口数量为" + loadedWindowNum) + + } else { + sequentialLoadWindowTimer.stop() + // console.log("计时器停止,窗口数量为: " + tabletViewRootModel.count) + } + if (loadedWindowNum >= 6) { + sequentialLoadWindowTimer.stop() + console.log("计时器停止,接下来一次性加载所有窗口") + while (loadedWindowNum < appWindowCount) { + info = appWindowListModel.getItemData(appListModel.mapToSource(appListModel.index(loadedWindowNum, 0))) + tabletViewRootModel.append({"x": info.x, "y": info.y, + "width": info.width, "height": info.height, + "id": info.id, "minimized": info.minimized, + "caption": info.caption, "uuid": String(info.uuid), + "icon": info.icon}); + loadedWindowNum = loadedWindowNum + 1 + } + } + if (loadedWindowNum >= appWindowCount) { + sequentialLoadWindowTimer.stop() + // console.log("所有窗口加载完毕,显示全部清除按钮") + clearAllWindowButtonAppearAni.start() + } } - onQmlAppWindowRemoved: { - qmlAppWindowRemovedForward(id) + function closeMultitaskView() { + if (!alreadyCloseView) { + alreadyCloseView = true + console.log("closeMultitaskView() !") + multitaskViewManager.close() + } } - } - property var screenIndex : 0 - property var screenRect : multitaskViewModel.getFullScreenGeometry(1,0) - property string orientation: multitaskViewModel.rotationMode - //整体缩放比 - property var tabletScaleFactor : screenRect.width > screenRect.height ? screenRect.height / 1080 : screenRect.width / 1080 - //预览窗口宽高比 - property var preWinAspectRatio: screenRect.width / screenRect.height - //图标和缩略图的间距 - property var iconToThumbSpacing : Math.floor(18 * tabletScaleFactor) - //图标高度 - property var iconAndCloseButtonHeight : Math.floor(44 * tabletScaleFactor) - //缩略图高度 - property var preWinHeight : Math.floor(320 * tabletScaleFactor) - //缩略图宽度 - property var preWinWidth : Math.floor(preWinHeight * preWinAspectRatio) - //预览窗口列间距 - property var preWinVecSpace : Math.floor(112 * tabletScaleFactor) - //预览窗口行间距 - property var preWinHorSpace : Math.floor(56 * tabletScaleFactor) - //滚动区域距离左侧和右侧的间距 - property var scrollViewLeftSpace : Math.floor(112 * tabletScaleFactor) - //滚动区域高度 - property var scrollViewHeight : Math.floor(820 * tabletScaleFactor) - //全部清除按钮x - property var clearWindwoX : Math.floor(747 * tabletScaleFactor) - //全部清除按钮y - property var clearWindwoY : Math.floor(994 * tabletScaleFactor) - //滚动区域y轴起始高度 - property var scrollViewYStartPoint : Math.floor(getCurrentPreWindowHeight()) - - width : Math.floor(screenRect.width) - height : Math.floor(screenRect.height) - x : Math.floor(screenRect.x) - y : Math.floor(screenRect.y) - color : "transparent" - - /**********************************************函数*********************************************/ - function getCurrentPreWindowHeight() - { - if ( orientation == "normal" || orientation == "upside-down" ) - { - scrollViewYStartPoint = Math.floor(99 * tabletScaleFactor) - preWinHeight = Math.floor(320 * tabletScaleFactor) - tabletParentWindow.preWinWidth = Math.floor(preWinHeight * preWinAspectRatio) - preWinVecSpace = Math.floor(112 * tabletScaleFactor) - preWinHorSpace = Math.floor(56 * tabletScaleFactor) - scrollViewLeftSpace = Math.floor(112 * tabletScaleFactor) - scrollViewHeight = Math.floor(820 * tabletScaleFactor) - clearWindwoX = Math.floor(747 * tabletScaleFactor) - clearWindwoY = Math.floor(994 * tabletScaleFactor) + // 控制启动动效中,小窗口之间的间隔 + Timer { + id : sequentialLoadWindowTimer + interval : 150 + repeat : true + running : false + triggeredOnStart : false + onTriggered: { + // console.log("计时器启动 间隔150") + tabletViewMain.sequentialLoadWindow() + } } - else if ( orientation == "left" || orientation == "right" ) - { - scrollViewYStartPoint = Math.floor(196 * tabletScaleFactor) - preWinHeight = Math.floor(498 * tabletScaleFactor) - preWinWidth = Math.floor(preWinHeight * preWinAspectRatio) - preWinVecSpace = Math.floor(96 * tabletScaleFactor) - preWinHorSpace = Math.floor(68 * tabletScaleFactor) - scrollViewLeftSpace = Math.floor(96 * tabletScaleFactor) - scrollViewHeight = Math.floor(1196 * tabletScaleFactor) - clearWindwoX = Math.floor(477 * tabletScaleFactor) - clearWindwoY = Math.floor(1534 * tabletScaleFactor) + + UkuiItem.DtThemeBackground { + id : scrollBackgroundArea + anchors.fill: parent + useStyleTransparency: true + backgroundColor: UkuiPlatform.GlobalTheme.kModalMask + // 无应用时的窗口显示 + UkuiItem.DtThemeText { + id : noWindowText + anchors.centerIn : parent + font.bold : true + font.pixelSize : Math.floor(25 * tabletScaleFactor) + textColor : UkuiPlatform.GlobalTheme.kFontWhite + text : qsTr("No recent tasks") // 无应用开启 + visible : tabletViewRootModel.count === 0 + opacity : 0 + + SequentialAnimation{ + id : noWindowTipsAnimation + // 无窗口文字出现动画 + NumberAnimation { + id : noWindowTipsAppearAni + target : noWindowText + property : "opacity" + duration : 1000 + easing.type : Easing.InOutQuart + from : 0 + to : 1 + } + // 无窗口文字消失动画 + NumberAnimation { + id : noWindowTipsDisappearAni + target : noWindowText + property : "opacity" + duration : 1000 + easing.type : Easing.InOutQuart + from : 1 + to : 0 + } + onFinished: { + console.log("无窗口文字消失动画") + tabletViewMain.closeMultitaskView() + } + } + } } - } - TabletMultitaskView { - id : tabletViewMain - anchors.fill : parent - color : "transparent" + // 预览窗口显示区域 + ScrollView { + id : previewWindowShownRegion + anchors.fill : parent + + //更新滚动区域的大小,之所以这么做,是为了解决滚动区域增加鼠标事件后,滚动失效的问题 + function getContentWidth() + { + var maxColumn = Math.ceil(tabletViewRootModel.count / 2) + var scrollViewContentWidth = parent.width + if (tabletViewRootModel.count <= 4) + { + scrollViewContentWidth = parent.width + return Math.floor(scrollViewContentWidth) + } + scrollViewContentWidth = maxColumn * preWinWidth + maxColumn * gridLayout.columnSpacing + 2 * gridLayout.leftPadding + return Math.floor(scrollViewContentWidth) + } + contentWidth : Math.floor(previewWindowShownRegion.getContentWidth()) + contentHeight : Math.floor(this.height) + ScrollBar.horizontal.policy : ScrollBar.AlwaysOff + ScrollBar.vertical.policy : ScrollBar.AlwaysOff + + MouseArea { + anchors.fill : parent + onClicked : { + if (multitaskViewModel.isTabletMode) { + multitaskViewManager.setShowingDesktop(true) + } + tabletViewMain.blankAreaClickSignal() + } + } + + Grid { + id : gridLayout + anchors.fill : parent + anchors.centerIn : parent + topPadding : Math.floor(scrollViewYStartPoint) + columnSpacing : Math.floor(preWinVecSpace) + rowSpacing : Math.floor(preWinHorSpace) + leftPadding : Math.floor(scrollViewLeftSpace) + rightPadding : Math.floor(scrollViewLeftSpace) + rows : 2 + flow : Grid.TopToBottom + transformOrigin : "TopLeft" + + //显示多任务视图时,每个Item在显示的时候执行的动效 + add : Transition { + id : displayPreviewWinAnimation + ParallelAnimation { + NumberAnimation { + property : "opacity" + duration : 900 + easing.type : Easing.InOutQuart + from : 0 + to : 1 + } + NumberAnimation { + property : "x" + duration : 900 + easing.type : Easing.InOutQuart + from : Math.floor(parent.width / 2 - 510/*窗口的宽度*/ / 2) + } + NumberAnimation { + property : "y" + duration : 900 + easing.type : Easing.InOutQuart + from : Math.floor(parent.height) + } + NumberAnimation { + property : "scale" + from : 0 + to : 1.0 + duration : 450 + } + } + } + + //关闭小窗口时,W补齐方式的动画 + move : Transition { + NumberAnimation{ + properties : "x,y"; + easing.type : Easing.InOutQuart; + duration : 300 + } + } + + Repeater { + id : previewWindowRepeater + model : tabletViewRootModel + + Item { + id : appWindowBack + height : Math.floor(preWinHeight + iconToThumbSpacing + iconAndCloseButtonHeight) + width : Math.floor(preWinWidth) + borderWidth * 2 + + TabletPreviewWindow { + id : appWindow + height : parent.height + width : parent.width + x_wid : model.id + wid : model.uuid + screenIndex : tabletViewMain.index + captionText : model.caption + preViewNoScaledWidth : model.width + preViewNoScaledHeight : model.height + preViewNoScaledXCoordinate : model.x + preViewNoScaledYCoordinate : model.y + icon: model.icon + } + } + } + } + } + + // 清除所有窗口的按钮 + UkuiItem.DtThemeBackground { + id : clearAllWindowButton + property int bottomMargin : 38 * tabletScaleFactor + height : Math.floor(48 * tabletScaleFactor) + width : language === "Chinese" ? Math.floor(112 * tabletScaleFactor) : Math.floor(184 * tabletScaleFactor) + backgroundColor: clearAllMousearea.containsPress ? UkuiPlatform.GlobalTheme.kComponentClick + : clearAllMousearea.containsMouse ? UkuiPlatform.GlobalTheme.kComponentHover : UkuiPlatform.GlobalTheme.kComponentNormal + radius : Math.floor(24 * tabletScaleFactor) + anchors.verticalCenter : parent.verticalCenter + anchors.verticalCenterOffset : Math.floor(tabletViewMain.height / 2) - bottomMargin - this.height + anchors.horizontalCenter : parent.horizontalCenter + visible : tabletViewRootModel.count > 0 + opacity : 0 + + Accessible.role: Accessible.Button + Accessible.name: "clear" + Accessible.description: "a push button, click to clear all preview windows" + + Row { + anchors.centerIn: parent + spacing: Math.floor(8 * tabletScaleFactor) + UkuiItem.Icon { + id : deleteIcon + anchors.verticalCenter : parent.verticalCenter + width : Math.floor(16 * tabletScaleFactor) + height : Math.floor(16 * tabletScaleFactor) + source: "window-close-symbolic" + mode: UkuiItem.Icon.AutoHighlight + } + + UkuiItem.DtThemeText { + id : deletText + anchors.verticalCenter : parent.verticalCenter + text : qsTr("Clear") // 清除 + elide : isLayoutLeftToRight ? Text.ElideRight : Text.ElideLeft + font.pixelSize : Math.floor(18 * tabletScaleFactor) + textColor : UkuiPlatform.GlobalTheme.kFontPrimary + } + } + + MouseArea { + id: clearAllMousearea + anchors.fill: parent + hoverEnabled: true + + onClicked: { + console.log("全部清除被点击!") + clearAllWindowButtonDisappearAni.start() + tabletViewMain.clearAllWindowButtonClickSignal() + } + } + + //全部清除按钮出现的动画 + NumberAnimation { + id : clearAllWindowButtonAppearAni + target : clearAllWindowButton + properties : "opacity" + from : 0 + to : 1 + duration : tabletViewRootModel.count >= 6 ? 5 * 100 + 300 : (tabletViewRootModel.count - 1) * 100 + 300 + easing.type : Easing.InOutQuart + } + + //全部清除按钮消失的动画 + NumberAnimation { + id : clearAllWindowButtonDisappearAni + target : clearAllWindowButton + properties : "opacity" + from : 1 + to : 0 + duration : 300 + easing.type : Easing.InOutQuart + } + + Connections { + target : tabletViewMain + function onBlankAreaClickSignal() { + clearAllWindowButtonDisappearAni.start() + } + } + } + + Component.onCompleted: { + if (multitaskViewModel.currentDesktopHasWindow()) { + console.log("顺序加载窗口的启动计时器") + sequentialLoadWindowTimer.start() + } else { + console.log("启动无窗口动画") + noWindowTipsAnimation.start() + } + } + + Keys.onPressed: { + if (event.key === Qt.Key_Escape) { + closeMultitaskView(); + return; + } + if (event.modifiers & Qt.MetaModifier) { + if (event.key === Qt.Key_Tab) { + closeMultitaskView(); + return; + } + } + } + + Timer { + id : closeViewTimer + interval : 0 + repeat : false + running : false + triggeredOnStart : false + onTriggered: { + closeMultitaskView() + } + } + + AppWindowFilterModel { + id: appListModel + desktopId: multitaskViewModel.highlightDesktop + screenId: tabletViewMain.screenId + sourceModel: appWindowListModel + } + + Connections { + target: multitaskViewModel + function onAppWindowRemoved(windowId) { + multitaskViewModel.removeAppWindow(windowId) + + // remove window from tabletViewRootModel + for(var i = 0; i < tabletViewRootModel.count; i++){ + var info = tabletViewRootModel.get(i); + if(info.uuid === windowId) { + tabletViewRootModel.remove(i); + break; + } + } + if (!multitaskViewModel.currentDesktopHasWindow()) { + closeViewTimer.start() + } + } + } } } diff --git a/windowsview/qml/TabletViewRootWindow.qml b/windowsview/qml/TabletViewRootWindow.qml deleted file mode 100644 index 0bf29359626a00d5b636ef2bb17222e104b0109a..0000000000000000000000000000000000000000 --- a/windowsview/qml/TabletViewRootWindow.qml +++ /dev/null @@ -1,155 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.5 -import QtQuick.Layouts 1.3 -import "TabletController.js" as TabletController -import IconTheme 1.0 -import QtQuick.Window 2.12 -import org.ukui.kwin 2.0 as KWin -import QtGraphicalEffects 1.0 - -Rectangle{ - id : tabletRootWindow - anchors.fill : parent - property var controller : new TabletController.Controller(multitaskViewModel, tabletRootWindow, multitaskViewManager, ["none"]) - property var appWindowCount : 0 - property var loadedWindowNum : 0 - property ListModel tabletViewRootModel : ListModel{} - - /**********************************************函数*********************************************/ - function viewSpacingClickedController() - { - clearAllWindow.startClearAllBtnDisappearAni() - qmlViewSpaceClicked() - } - - function startNoWindowTipsAnimation() - { - noWindowTipsAnimation.start() - } - function startSequentialLoadWindowTimer() - { - sequentialLoadWindowTimer.start() - } - - function fetchWindowNum(){ - var appWindowList = multitaskViewModel.getAppWindowList(1,tabletViewMainWindow.screenIndex) - for (var i in appWindowList) - { - tabletRootWindow.appWindowCount = tabletRootWindow.appWindowCount+1 - } - controller.initViewAnimation() - } - - function sequentialLoadWindow() { - var appWindowList = multitaskViewModel.getAppWindowList(1,tabletViewMainWindow.screenIndex) - if (loadedWindowNum < appWindowCount && loadedWindowNum < 6 ) - { - var info = appWindowList[loadedWindowNum] - tabletViewRootModel.append({"x": info.x, "y": info.y, - "width": info.width, "height": info.height, - "id": info.id,"minimized":info.minimized, "caption": info.caption}); - loadedWindowNum = loadedWindowNum+1 - console.log("加载窗口中,目前已加载窗口数量为" + loadedWindowNum) - - } - else - { - sequentialLoadWindowTimer.stop() - console.log("计时器停止,窗口数量为: " + tabletViewRootModel.count) - } - if (loadedWindowNum >= 6) - { - sequentialLoadWindowTimer.stop() - while(loadedWindowNum < appWindowCount) - { - var info = appWindowList[loadedWindowNum] - tabletViewRootModel.append({"x": info.x, "y": info.y, - "width": info.width, "height": info.height, - "id": info.id,"minimized":info.minimized, "caption": info.caption}); - loadedWindowNum = loadedWindowNum + 1 - } - console.log("sequentialLoadWindow的剩余窗口加载完毕!!!") - - } - if (loadedWindowNum >= appWindowCount || appWindowCount <= 0) - { - console.log("全部清除按钮显示或者无窗口显示") - sequentialLoadWindowTimer.stop() - clearAllWindow.startClearAllBtnAppearAni() - } - } - - /**********************************************动画*********************************************/ - SequentialAnimation{ - id : noWindowTipsAnimation - //无窗口文字出现动画 - NumberAnimation { - id : noWindowTipsAppearAni - target : noWindowText - property : "opacity" - duration : 1000 - easing.type : Easing.InOutQuart - from : 0 - to : 1 - } - - //无窗口文字消失动画 - NumberAnimation { - id : noWindowTipsDisappearAni - target : noWindowText - property : "opacity" - duration : 1000 - easing.type : Easing.InOutQuart - from : 1 - to : 0 - } - onFinished: { - controller.closeMultitaskView() - } - } - - - //控制启动动效中,小窗口之间的间隔 - Timer { - id : sequentialLoadWindowTimer; - interval : 100; - repeat : true - running : false - triggeredOnStart : false - onTriggered: { - tabletRootWindow.sequentialLoadWindow() - } - } - - //这里放置后台提供的桌面背景的Item - KWin.DesktopBackground { - width : Math.floor(tabletRootWindow.width) - height : Math.floor(tabletRootWindow.height) - blurAlpha : 0.7 - z : -1 - } - - //无应用时的窗口显示 - Text { - id : noWindowText - anchors.centerIn : parent - font.bold : true - font.pixelSize : 25 - color : "white" - text : qsTr("无应用开启") - visible : tabletViewRootModel.count == 0 - opacity : 0 - } - - //根窗口的鼠标事件 - MouseArea{ - anchors.fill : parent - onClicked: { - controller.viewSpacingClickedController() - } - } - - Component.onCompleted: { - tabletRootWindow.fetchWindowNum(); - } -} diff --git a/windowsview/qml/ThumbnailWithKwin.qml b/windowsview/qml/ThumbnailWithKwin.qml new file mode 100644 index 0000000000000000000000000000000000000000..bebf44a699a84ac72ae43d447ad1505461c1a2d6 --- /dev/null +++ b/windowsview/qml/ThumbnailWithKwin.qml @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2024, KylinSoft Co., Ltd. + + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import org.kde.kwin 3.0 as KWinComponents + +KWinComponents.WindowThumbnailItem { + id : appWindowThumbnail + anchors.fill : parent + wId : thumbnailId +} diff --git a/windowsview/qml/ThumbnailWithWlcom.qml b/windowsview/qml/ThumbnailWithWlcom.qml new file mode 100644 index 0000000000000000000000000000000000000000..59b0382aac9cf8b28de5252b817a46da6f0bbe4d --- /dev/null +++ b/windowsview/qml/ThumbnailWithWlcom.qml @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2024, KylinSoft Co., Ltd. + + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import org.kylin.thumbnail 1.0 as WlcomThumbnail + +WlcomThumbnail.ThumbnailItem { + anchors.fill: parent + windowId: thumbnailId +} + diff --git a/windowsview/qml/VirtualDesktopWindow.qml b/windowsview/qml/VirtualDesktopWindow.qml new file mode 100644 index 0000000000000000000000000000000000000000..068b30bc293c3acb57dde764fa621fa482f4ec3e --- /dev/null +++ b/windowsview/qml/VirtualDesktopWindow.qml @@ -0,0 +1,415 @@ +/* + * Copyright (C) 2022, KylinSoft Co., Ltd. + + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +/* + 此文件是虚拟桌面的预览窗口的内容设置 +*/ + +import QtQuick 2.12 +import QtQuick.Layouts 1.3 +import QtQuick.Window 2.12 +import org.kylin.background 3.0 as KWin +//import org.kde.kwin 3.0 as KWinComponents +import QtGraphicalEffects 1.0 +import "Controller.js" as Controller +//ukui-quick +import org.ukui.quick.items 1.0 as UkuiItem +import org.ukui.quick.platform 1.0 as UkuiPlatform + +Item { + id : root + width : isVerticalLayout ? desktopRectWidth : desktopRect.width + height : isVerticalLayout ? desktopRect.height - 8 : desktopRectHeight + activeFocusOnTab: index === 0 ? true : false + focus : true + property string windowType : "desktop" + property var wid : index + 1 + // Using the Drag attached property, any Item can be made a source of drag and drop events within a scene + Drag.active : previewMouseArea.drag.active + Drag.hotSpot.x : width / 2 + Drag.hotSpot.y : height / 2 + property bool windowDragActive : previewMouseArea.drag.active + property bool nowDragActive: false + property var controller : new Controller.DesktopController(multitaskViewModel, this, multitaskViewManager, ["app","desktop"]) + property real posX : 0 + property real posY : 0 + // 用户自定义工作区名称 + property string customName: "" + + states: [ + State { + name : "tabAndDragActive" + when: root.activeFocus && root.windowDragActive && (multitaskViewManager.shouldShowTabBorder) + PropertyChanges { target: previewArea; borderColor: tabFocusBorderColor } + ParentChange { target: root; parent: desktopRect } + }, + State { + name : "tabActive" + when: root.activeFocus && (multitaskViewManager.shouldShowTabBorder) + PropertyChanges { target: previewArea; borderColor: tabFocusBorderColor } + }, + State { + name : "dragActive" + when : nowDragActive + ParentChange { target: root; parent: desktopRect } + } + ] + + Keys.onPressed: { + if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter || event.key === Qt.Key_Space) { + controller.setCurrentDesktop(root.wid) + controller.onWindowClicked(root.wid) + event.accepted = true + } else if (event.key === Qt.Key_Escape) { + controller.closeMultitaskView() + } else if (event.modifiers & Qt.MetaModifier) { + if (event.key === Qt.Key_Tab) { + controller.closeMultitaskView() + } + } else if (event.key === Qt.Key_Tab) { + if (index === 0 ) { + desktopListView.currentIndex = desktopListView.count - 1 + multitaskViewManager.setShouldShowTabBorder(true) + } + } + } + + onActiveFocusChanged: { + if (index === 0 && root.activeFocus) { + desktopListView.currentIndex = 0 + var offsetPosition = isVerticalLayout ? desktopListView.contentX : desktopListView.contentY + if (offsetPosition > 0) { + contentMoveAnimation.to = 0 + contentMoveAnimation.start() + } + multitaskViewManager.activeAreaChangeDataCollect("Workspace Preview Area") + } + } + + // 工作区位置移动触发下方信号 + onWindowDragActiveChanged : { + // 需要保证让 dragRectangle 先恢复原来的 parent 再移动到合适的位置 + // 因为直接使用 windowDragActive 变量并无法实现上述控制顺序,所以 + // 需要额外的变量 nowDragActive 来实现 ParentChange,然后再移动到 + // 合适的位置 + if (nowDragActive != windowDragActive) { + nowDragActive = windowDragActive + } + if (windowDragActive) { + opacity = 0.75 + } else { + // 工作区取消拖动后需要返回原来的位置,如果拖拽产 + // 生了工作区的位置交换也没有关系,也不会影响动效 + opacity = 1 + this.posX = 0 + this.posY = 0 + controller.rejectSource(root) + } + } + + Item { + id : desktopDragRect + anchors.fill: parent + anchors.centerIn : parent + state : "default" + property int desktopIndex: root.wid + + states : [ + State { + name : "default" + PropertyChanges { + target : previewArea + borderColor : desktopDragRect.getWorkspaceDefaultBorderColor() + } + PropertyChanges { target : closeButton; visible : rootWindow.isTouchState ? true : false } + PropertyChanges { target : editButton; visible : false } + }, + State { + name : "hover" + PropertyChanges { + target : previewArea + borderColor : desktopDragRect.getWorkspaceHoverBorderColor() + } + PropertyChanges { target : closeButton; visible : true && !captionEdit.editable } + PropertyChanges { target : editButton; visible : true && !captionEdit.editable} + } + ] + + MouseArea { + id : previewMouseArea + anchors.fill : parent + hoverEnabled : true + preventStealing : true + drag.axis : isVerticalLayout ? Drag.XAxis : Drag.YAxis + drag.target : root + + Accessible.role: Accessible.Button + Accessible.name: "desktop-" + root.wid + Accessible.description: "preview-desktop, click to enter the desktop" + + onEntered : { + controller.setHoverStatus(); + } + onExited : { + controller.setDefaultStatus() + } + onClicked : { + controller.onWindowClicked(root.wid) + } + + ColumnLayout { + id : mainVerticalLayout + anchors.fill: parent + anchors.centerIn : parent + spacing : spacingWidth + + RowLayout { + id : captionRow + spacing : 0 + Layout.fillHeight : true + Layout.rightMargin: workspaceBorderWidth + layoutDirection: isLayoutLeftToRight ? Qt.LeftToRight : Qt.RightToLeft + Layout.preferredHeight: desktopCaptionHeight + Layout.maximumHeight: root.height - mainVerticalLayout.spacing - previewArea.height + + LineEdit { + id: captionEdit + editable: false + enableLayoutMirroring: !isLayoutLeftToRight + Layout.fillWidth : true + Layout.maximumWidth: (editable || !editButton.visible) ? desktopRectWidth : contentTextWidth + Math.floor(8 * scaleFactor) + Layout.leftMargin : workspaceBorderWidth + Layout.preferredHeight: Math.min(desktopCaptionHeight, captionRow.height) + + onTextEditingFinished: { + if (itemDisplayText != defaultText) { + customName = itemDisplayText + } else { + //清空输入则恢复默认名称 + customName = captionEdit.isDefaultText ? "" : defaultText + } + //在输入状态按回车键保存时,要求仅保存名称,不退出任务视图界面 + //工作区名称编辑结束,需要将焦点还给root,否则会影响工作区键盘导航 + root.forceActiveFocus() + } + } + Binding { + id: defaultTextBinding + target: captionEdit + property: "defaultText" + value: qsTr("Desktop") + " " + root.wid + } + Binding { + target: captionEdit + property: "itemDisplayText" + value: customName.length === 0 ? captionEdit.defaultText : customName + } + + Rectangle { + id : editButton + implicitWidth : Math.floor(16 * scaleFactor) + implicitHeight: width + color : "transparent" + Accessible.role: Accessible.Button + Accessible.name: "edit-desktop-name-" + root.wid + Accessible.description: "push-button, click to rename the desktop" + + MouseArea { + anchors.fill: parent + onClicked: { + captionEdit.editable = true + } + } + UkuiItem.Icon { + id: editIcon + anchors.centerIn: parent + width: parent.width + height: width + source: "document-edit-symbolic" + mode: UkuiItem.Icon.AutoHighlight + } + } + + Item { + // 填充剩余空间 + Layout.fillWidth : true + Layout.minimumWidth: Math.floor(8 * scaleFactor) + visible: editButton.visible + } + + CloseButton { + id : closeButton + implicitWidth : Math.min(iconAndCloseButtonHeight, captionRow.height) + implicitHeight : width + radius : width / 2 + windowType : "desktop" + + Accessible.name: "close-desktop-" + root.wid + Accessible.description: "close-button, click to remove the desktop" + + onClicked : { + if (desktopListModel.rowCount() > 2) { + //剩余[1个工作区+"新建工作区"]时不会删除"工作区1",属性绑定不能解除 + defaultTextBinding.when = false + } + controller.removePreviewWindow(root.wid) + } + onExited: { + if (!previewMouseArea.containsMouse) { + root.setDefaultStatus() + } + } + } + }//RowLayout + + UkuiItem.DtThemeBackground { + id : previewArea + Layout.fillWidth: true + Layout.fillHeight: false + Layout.preferredHeight: desktopThumbnailHeight + 2 * border.width + color : "transparent" + borderColor : defaultBorderColor + border.width : workspaceBorderWidth + radius : UkuiPlatform.GlobalTheme.kRadiusWindow * scaleFactor + + Rectangle { + id: workspace + anchors.centerIn: parent + width : desktopThumbnailWidth + height : desktopThumbnailHeight + color : "black" + radius : UkuiPlatform.GlobalTheme.kRadiusMenu * scaleFactor + clip : true + visible : true + layer.enabled : workspace.radius !== 0 + layer.effect : OpacityMask { + maskSource : Rectangle { + width : desktopThumbnailWidth + height : desktopThumbnailHeight + radius : workspace.radius + } + } + KWin.DesktopBackground { + id : desktopThumbnailBackground + anchors.centerIn : parent + width : desktopThumbnailWidth + height : desktopThumbnailHeight + blurAlpha : 0 + } + + Loader { + id : workSpaceThumbnailLoader + width : desktopThumbnailWidth + height : desktopThumbnailHeight + source: isWlcom ? "WorkSpaceThumbnailWithWlcom.qml" : "WorkSpaceThumbnailWithKwin.qml" + } + + UkuiItem.DtThemeBackground { + id : desktopMaskColor + visible : false + anchors.fill: parent + backgroundColor : UkuiPlatform.GlobalTheme.kModalMask + } + } + } + }//culumnLayout + } + + // 应用程序预览窗口拖动到虚拟桌面,虚拟桌面区域收到下方信号 + DropArea { + id : previewDropArea + anchors.fill : parent + visible: !root.windowDragActive + onEntered : { + if (drag.source.windowType == "app") { + desktopMaskColor.visible = true + } + if (drag.source.wid !== root.wid) { + controller.onSourceEntered(drag.source, drag.source.wid, root.wid); + } + } + onExited : { + desktopMaskColor.visible = false + } + onDropped : { + desktopMaskColor.visible = false + controller.onSourceDropped(drop.source, rootWindow.highlightDesktop, root.wid); + } + } + + function getWorkspaceDefaultBorderColor() + { + if (root.activeFocus && (multitaskViewManager.shouldShowTabBorder)) { + return tabFocusBorderColor + } else if (highlightDesktop === root.wid) { + return hoverBorderColor + } else { + return defaultBorderColor + } + } + + function getWorkspaceHoverBorderColor() + { + if (root.activeFocus && (multitaskViewManager.shouldShowTabBorder)) { + return tabFocusBorderColor + } else { + return hoverBorderColor + } + } + } + + NumberAnimation on x{ + id : movePreX + duration : 0 + running : false + } + + NumberAnimation on y{ + id : movePreY + duration : 0 + running : false + } + + function returnOriginal(x,y) + { + movePreX.to = 0 + movePreY.to = 0 + movePreX.from = x + movePreY.from = y + movePreX.stop() + movePreY.stop() + movePreX.start() + movePreY.start() + } + + function setDefaultStatus() { + desktopDragRect.state = "default" + } + + function setHoverStatus() { + desktopDragRect.state = "hover" + } + + Component.onCompleted: { + if (root.activeFocusOnTab && appAreaModel.rowCount() === 0) { + // 无应用窗口时获取tab焦点 + root.forceActiveFocus() + } + } +} diff --git a/windowsview/qml/WorkSpaceThumbnailWithKwin.qml b/windowsview/qml/WorkSpaceThumbnailWithKwin.qml new file mode 100644 index 0000000000000000000000000000000000000000..1617d03adbbe7fcbb993db34a81dfbb93475f5fe --- /dev/null +++ b/windowsview/qml/WorkSpaceThumbnailWithKwin.qml @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2024, KylinSoft Co., Ltd. + + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import QtQuick 2.12 +import QtQuick.Window 2.12 +import org.kde.kwin 3.0 as KWinComponents +import AppWindowFilterModel 1.0 + +Item { + id: root + anchors.fill: parent + + Repeater { + id : desktopWindowRepeater + + model : AppWindowFilterModel { + id: kwinWorkspaceThumbnailModel + desktopId: desktopDragRect.desktopIndex + screenId: mainView.screenIndex + sourceModel: multitaskViewModel.isCurrentDesktopShowingDesktop() ? {} : appWindowListModel + } + + KWinComponents.WindowThumbnailItem { + width : Math.floor(model.Width * desktopScale) + height : Math.floor(model.Height * desktopScale) + visible : !(model.Minimized) + x : Math.floor((model.X - screenRect.x) * desktopScale) + y : Math.floor((model.Y - screenRect.y) * desktopScale) + wId: model.Uuid + } + } +} diff --git a/windowsview/qml/WorkSpaceThumbnailWithWlcom.qml b/windowsview/qml/WorkSpaceThumbnailWithWlcom.qml new file mode 100644 index 0000000000000000000000000000000000000000..a315c63bf1c194fe96a5445b4648626defd3297d --- /dev/null +++ b/windowsview/qml/WorkSpaceThumbnailWithWlcom.qml @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2024, KylinSoft Co., Ltd. + + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import QtQuick 2.12 +import QtQuick.Window 2.12 +import org.kylin.thumbnail 1.0 as WlcomThumbnail + +WlcomThumbnail.ThumbnailItem { + anchors.fill: parent + thumbnailType: 2 + outputId: multitaskViewModel.getOutputUuid(mainView.screenIndex) + windowId: multitaskViewModel.getDesktopUuid(wid) +} + + + + diff --git a/windowsview/qml/multitaskview.qml b/windowsview/qml/multitaskview.qml deleted file mode 100644 index bdd1818c8fd7f8787ba6b8f0806d44dd1c831018..0000000000000000000000000000000000000000 --- a/windowsview/qml/multitaskview.qml +++ /dev/null @@ -1,287 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.5 -import QtQuick.Layouts 1.3 -import QtQuick.Window 2.12 -import org.kde.kwin 3.0 as KWinComponents -import QtGraphicalEffects 1.0 -import "Controller.js" as Controller -import IconTheme 1.0 - -Repeater { - id : allroot - property int screencnt : multitaskViewModel.logicalScreenCount - model : screencnt - signal qmlAppWindowCreated(int visiblestatus) - signal qmlAppWindowRemoved(int Id) - signal qmlAppWindowActivated() - signal qmlAppWindowDesktopChanged(int windowId, int oldDesktopIndex, int newDesktopIndex) - signal qmlDesktopRemoved(int Id) - signal qmlDesktopAppended(int Id) - signal qmlDesktopMoved(int oldDesktop,int newDesktop) - signal qmlCurrentDesktopChanged(int old,int newId) - signal qmlScreenCountChanged(int oldCount,int newCount) - signal qmlScreenSizeChanged() - property int highlightDesktop : multitaskViewModel.getCurrentDesktop() - property var allcontroller : new Controller.Controller(multitaskViewModel, allroot, multitaskViewManager, ["none"]) - property var currentTheme : multitaskViewModel.getUKUIStyleName() - property var closeButtonHoverColor : setItemColor() - property var closeButtonDefaultColor : "" - property var closeButtonClickColor : "" - property var createDesktopButtonReceiveColor : "" - property var createDesktopButtonDefaultColor : "" - property var desktopMaskReceiveColor : "" - property var desktopCaptionColor : "" - property var desktopAreaColor : "" - focus : true - - function setItemColor() { - closeButtonDefaultColor = Qt.rgba(255,255,255, 0.15) - if (allroot.currentTheme === "ukui-default" || allroot.currentTheme === "ukui-white" - || allroot.currentTheme === "ukui" || allroot.currentTheme === "ukui-light") - { - closeButtonHoverColor = Qt.rgba(255,255,255, 1) - closeButtonClickColor = Qt.rgba(217,217,217, 1) - createDesktopButtonReceiveColor = Qt.rgba(0, 0, 0, 0.25) - createDesktopButtonDefaultColor = Qt.rgba(0, 0, 0, 0.15) - desktopMaskReceiveColor = Qt.rgba(0, 0, 0, 0.25) - desktopCaptionColor = Qt.rgba(0,0,0,1) - desktopAreaColor = Qt.rgba(245/255, 245/255, 245/255,0.75) - } - else - { - closeButtonHoverColor = "#37373B" - closeButtonClickColor = Qt.rgba(75,75,79, 1) - createDesktopButtonReceiveColor = Qt.rgba(0, 0, 0, 0.1) - createDesktopButtonDefaultColor = Qt.rgba(255, 255, 255, 0.15) - desktopMaskReceiveColor = Qt.rgba(255, 255, 255, 0.25) - desktopCaptionColor = Qt.rgba(255, 255, 255, 1) - desktopAreaColor = Qt.rgba(35/255, 36/255, 38/255, 0.75) - } - } - - onQmlAppWindowCreated : { - // allroot.allcontroller.closeMultitaskView(); - } - - onQmlAppWindowActivated: { - allroot.allcontroller.closeMultitaskView(); - } - - onQmlScreenCountChanged : { - allroot.allcontroller.closeMultitaskView(); - } - - onQmlScreenSizeChanged : { - allroot.allcontroller.closeMultitaskView(); - } - - Keys.onPressed : { - if (event.key === Qt.Key_Escape) { - allroot.allcontroller.closeMultitaskView(); - return; - } - if (event.modifiers & Qt.MetaModifier) - { - if (event.key === Qt.Key_Tab) - { - allroot.allcontroller.closeMultitaskView(); - return; - } - } - } - - Rectangle { - // 窗口缩略图区域 - id :root - property var windowIndex : index - property var screenRect : multitaskViewModel.getFullScreenGeometry(multitaskViewModel.getCurrentDesktop(),root.windowIndex) - width : screenRect.width - height : screenRect.height - x : screenRect.x - y : screenRect.y - - color : "transparent" - objectName : "root" - property var controller : new Controller.Controller(multitaskViewModel, root, multitaskViewManager, ["none"]) - - Connections{ - target : allroot - onQmlAppWindowRemoved : { - for(var i = 0;i. + * * + * * Authors: iaom + * + */ + +#include +#include "screens-manager.h" + +Screen::Screen(QScreen *screen, QObject *parent): QObject(parent), m_screen(screen) +{ + +} + +QRect Screen::geometry() const +{ + return m_screen->geometry(); +} + +QScreen *Screen::internal() +{ + return m_screen; +} + +bool Screen::enable() +{ + return m_enable; +} + +void Screen::setEnable(bool enable) +{ + if(m_enable != enable) { + m_enable = enable; + Q_EMIT enableChanged(m_enable); + } +} + +ScreensManager::ScreensManager(QObject *parent) : QObject(parent) +{ + for(auto screen : qApp->screens()) { + onScreenAdded(screen); + } + connect(qApp, &QGuiApplication::screenAdded, this, &ScreensManager::onScreenAdded); + connect(qApp, &QGuiApplication::screenRemoved, this, &ScreensManager::onScreenRemoved); + connect(qApp, &QGuiApplication::primaryScreenChanged, this, &ScreensManager::onPrimaryScreenChanged); +} + +ScreensManager::~ScreensManager() +{ + qDeleteAll(m_screens); +} + +QList ScreensManager::screens() +{ + QList tmp; + for(auto screen : m_screens) { + if(screen->enable()) { + tmp.append(screen); + } + } + return tmp; +} + +Screen *ScreensManager::primaryScreen() +{ + return m_primaryScreen; +} + +void ScreensManager::onScreenAdded(QScreen *screen) +{ + auto s = new Screen(screen, this); + if(screen == qApp->primaryScreen()) { + m_primaryScreen = s; + Q_EMIT primaryScreenChanged(s); + } + m_screens.append(s); + connect(s->internal(), &QScreen::geometryChanged, this, [&, s](){ + checkScreensGeometryStatus(s); + }); + connect(s, &Screen::enableChanged, this, [&, s](bool enable){ + onEnableChanged(s, enable); + }); + checkScreensGeometryStatus(s); +} + +void ScreensManager::onScreenRemoved(QScreen *screen) +{ + int i = 0; + for(; i <= m_screens.size(); ++i) { + if(m_screens.at(i)->internal() == screen) { + break; + } + } + if(i < m_screens.size()) { + auto s = m_screens.takeAt(i); + Q_EMIT screenRemoved(s); + s->deleteLater(); + } +} + +void ScreensManager::onPrimaryScreenChanged(QScreen *screen) +{ + if(m_primaryScreen->internal() != screen) { + for(auto s : m_screens) { + if(s->internal() == screen) { + if(!s->enable()) { + s->setEnable(true); + } + m_primaryScreen = s; + Q_EMIT primaryScreenChanged(s); + return; + } + } + } +} + +void ScreensManager::onEnableChanged(Screen *screen, bool enable) +{ + if(enable) { + Q_EMIT screenAdded(screen); + } else { + Q_EMIT screenRemoved(screen); + } +} + +void ScreensManager::checkScreensGeometryStatus(Screen* screen) +{ + if(screen == nullptr || m_primaryScreen == nullptr) { + return; + } + + for(auto s : m_screens) { + if(s == nullptr) { + continue; + } + if(s->internal()->geometry() == screen->geometry() && s != screen) { + if(s == m_primaryScreen) { + screen->setEnable(false); + Q_EMIT s->geometryChanged(s->internal()->geometry()); + return; + } else { + s->setEnable(false); + Q_EMIT screen->geometryChanged(screen->internal()->geometry()); + return; + } + } else { + if(!s->enable()) { + s->setEnable(true); + } + Q_EMIT s->geometryChanged(s->internal()->geometry()); + } + } +} diff --git a/windowsview/screens-manager.h b/windowsview/screens-manager.h new file mode 100644 index 0000000000000000000000000000000000000000..61a45427ccfc6b8baab39de38726fc67986f565d --- /dev/null +++ b/windowsview/screens-manager.h @@ -0,0 +1,73 @@ +/* + * * Copyright (C) 2024, KylinSoft Co., Ltd. + * * + * * This program is free software: you can redistribute it and/or modify + * * it under the terms of the GNU General Public License as published by + * * the Free Software Foundation, either version 3 of the License, or + * * (at your option) any later version. + * * + * * This program is distributed in the hope that it will be useful, + * * but WITHOUT ANY WARRANTY; without even the implied warranty of + * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * * GNU General Public License for more details. + * * + * * You should have received a copy of the GNU General Public License + * * along with this program. If not, see . + * * + * * Authors: iaom + * + */ + +#ifndef SCREENS_MANAGER_H +#define SCREENS_MANAGER_H +#include +#include + +class ScreensManager; +class Screen : public QObject +{ + Q_OBJECT +public: + explicit Screen(QScreen *screen, QObject *parent = nullptr); + Q_DISABLE_COPY(Screen); + +public: + QRect geometry() const; + QScreen * internal(); + bool enable(); + void setEnable(bool enable); +Q_SIGNALS: + void geometryChanged(const QRect &geometry); + void enableChanged(bool enable); + +private: + QScreen *m_screen = nullptr; + bool m_enable = false; +}; +class ScreensManager : public QObject +{ + Q_OBJECT +public: + explicit ScreensManager(QObject *parent = nullptr); + ~ScreensManager(); + QList screens(); + Screen * primaryScreen(); + +Q_SIGNALS: + void screenAdded(Screen *); + void screenRemoved(Screen *); + void primaryScreenChanged(Screen *); + +private Q_SLOTS: + void onScreenAdded(QScreen *screen); + void onScreenRemoved(QScreen *screen); + void onPrimaryScreenChanged(QScreen *screen); + void onEnableChanged(Screen *screen, bool enable); + void checkScreensGeometryStatus(Screen *screen); +private: + Screen *m_primaryScreen = nullptr; + QList m_screens; + +}; + +#endif //SCREENS_MANAGER_H diff --git a/windowsview/translations/ukui-window-switch_bo_CN.ts b/windowsview/translations/ukui-window-switch_bo_CN.ts new file mode 100644 index 0000000000000000000000000000000000000000..6ce331fc27fcca0b976032c041f438e1be8710f9 --- /dev/null +++ b/windowsview/translations/ukui-window-switch_bo_CN.ts @@ -0,0 +1,33 @@ + + + + + NewDesktopButton + + + New Desktop + ལས་ཁུལ་གསར་འཛུགས། + + + + TabletViewMain + + + No recent tasks + བེད་སྤྱོད་སྒོ་འབྱེད་མེད། + + + + Clear + གསལ་པོར་བཤད་ན། + + + + VirtualDesktopWindow + + + Desktop + ཅོག་ཙེའི་སྟེང་གི + + + diff --git a/windowsview/translations/ukui-window-switch_de.ts b/windowsview/translations/ukui-window-switch_de.ts new file mode 100644 index 0000000000000000000000000000000000000000..c0a5de431526a5c19268ae868dc33925dbc0b558 --- /dev/null +++ b/windowsview/translations/ukui-window-switch_de.ts @@ -0,0 +1,33 @@ + + + + + NewDesktopButton + + + New Desktop + Neuer Desktop + + + + TabletViewMain + + + No recent tasks + Keine aktuellen Aufgaben + + + + Clear + Klar + + + + VirtualDesktopWindow + + + Desktop + Desktop + + + diff --git a/windowsview/translations/ukui-window-switch_es.ts b/windowsview/translations/ukui-window-switch_es.ts new file mode 100644 index 0000000000000000000000000000000000000000..d6b0244542640e3b75e61de3a08a527a82cfbfbc --- /dev/null +++ b/windowsview/translations/ukui-window-switch_es.ts @@ -0,0 +1,33 @@ + + + + + NewDesktopButton + + + New Desktop + Nuevo escritorio + + + + TabletViewMain + + + No recent tasks + No hay tareas recientes + + + + Clear + Claro + + + + VirtualDesktopWindow + + + Desktop + Escritorio + + + diff --git a/windowsview/translations/ukui-window-switch_fr.ts b/windowsview/translations/ukui-window-switch_fr.ts new file mode 100644 index 0000000000000000000000000000000000000000..bdb68d96c7e115cb0fd7723d75cfdde86a22f702 --- /dev/null +++ b/windowsview/translations/ukui-window-switch_fr.ts @@ -0,0 +1,33 @@ + + + + + NewDesktopButton + + + New Desktop + Nouveau bureau + + + + TabletViewMain + + + No recent tasks + Pas de tâches récentes + + + + Clear + Clair + + + + VirtualDesktopWindow + + + Desktop + Bureau + + + diff --git a/windowsview/translations/ukui-window-switch_kk.ts b/windowsview/translations/ukui-window-switch_kk.ts new file mode 100644 index 0000000000000000000000000000000000000000..b3fd344bacbdbc001ecb231b508d8409179ce9c3 --- /dev/null +++ b/windowsview/translations/ukui-window-switch_kk.ts @@ -0,0 +1,33 @@ + + + + + NewDesktopButton + + + New Desktop + ۇستەل جوعارعى + + + + TabletViewMain + + + No recent tasks + جاقىنعى مىندەتتەر جوق + + + + Clear + تازالاۋ + + + + VirtualDesktopWindow + + + Desktop + ۇستەل بەتى + + + diff --git a/windowsview/translations/ukui-window-switch_ky.ts b/windowsview/translations/ukui-window-switch_ky.ts new file mode 100644 index 0000000000000000000000000000000000000000..cbd03e0fe14821818b7993afc10822c4ad6e48cd --- /dev/null +++ b/windowsview/translations/ukui-window-switch_ky.ts @@ -0,0 +1,33 @@ + + + + + NewDesktopButton + + + New Desktop + شىرە ۉستۉ + + + + TabletViewMain + + + No recent tasks + جاقىندا مٸلدەتتەر جوق + + + + Clear + تازالوو + + + + VirtualDesktopWindow + + + Desktop + ئۈستەلئۈستى + + + diff --git a/windowsview/translations/ukui-window-switch_mn.ts b/windowsview/translations/ukui-window-switch_mn.ts new file mode 100644 index 0000000000000000000000000000000000000000..b7682dd1a7cf21f5163b3a9c0e0144c060720350 --- /dev/null +++ b/windowsview/translations/ukui-window-switch_mn.ts @@ -0,0 +1,33 @@ + + + + + NewDesktopButton + + + New Desktop + ᠱᠢᠨ᠎ᠡ᠎ᠪᠡᠷ ᠪᠠᠢᠭᠤᠯᠤᠭ᠍ᠰᠠᠨ ᠠᠵᠢᠯᠯᠠᠬᠤ ᠤᠷᠤᠨ + + + + TabletViewMain + + + No recent tasks + ᠨᠡᠬᠡᠬᠡᠬᠦ᠌ ᠬᠡᠷᠡᠭᠯᠡᠭᠡ ᠪᠠᠢᠬᠤ ᠦᠬᠡᠢ + + + + Clear + ᠤᠰᠠᠳᠬᠠᠬᠤ + + + + VirtualDesktopWindow + + + Desktop + ᠠᠵᠢᠯᠯᠠᠬᠤ ᠤᠷᠤᠨ + + + diff --git a/windowsview/translations/ukui-window-switch_ug.ts b/windowsview/translations/ukui-window-switch_ug.ts new file mode 100644 index 0000000000000000000000000000000000000000..c25db44f88723b3f968c4c0cdddc8e8f55fab2dd --- /dev/null +++ b/windowsview/translations/ukui-window-switch_ug.ts @@ -0,0 +1,33 @@ + + + + + NewDesktopButton + + + New Desktop + ئۈستەل ئۈستىلىرى + + + + TabletViewMain + + + No recent tasks + يېقىنقى ۋەزىپىلەر يوق + + + + Clear + تازلاش + + + + VirtualDesktopWindow + + + Desktop + ئۈستەل يۈزى + + + diff --git a/windowsview/translations/ukui-window-switch_zh_CN.ts b/windowsview/translations/ukui-window-switch_zh_CN.ts new file mode 100644 index 0000000000000000000000000000000000000000..4349d6bc261f906232894626ca39586d3413827d --- /dev/null +++ b/windowsview/translations/ukui-window-switch_zh_CN.ts @@ -0,0 +1,33 @@ + + + + + NewDesktopButton + + + New Desktop + 新建工作区 + + + + TabletViewMain + + + No recent tasks + 无应用开启 + + + + Clear + 清除 + + + + VirtualDesktopWindow + + + Desktop + 工作区 + + + diff --git a/windowsview/translations/ukui-window-switch_zh_Hant.ts b/windowsview/translations/ukui-window-switch_zh_Hant.ts new file mode 100644 index 0000000000000000000000000000000000000000..953b8246dcc66058c98815b42df95c946d5abd52 --- /dev/null +++ b/windowsview/translations/ukui-window-switch_zh_Hant.ts @@ -0,0 +1,33 @@ + + + + + NewDesktopButton + + + New Desktop + 新建工作區 + + + + TabletViewMain + + + No recent tasks + 無應用開啟 + + + + Clear + 清除 + + + + VirtualDesktopWindow + + + Desktop + 工作區 + + + diff --git a/windowsview/ukui-flow.cpp b/windowsview/ukui-flow.cpp new file mode 100644 index 0000000000000000000000000000000000000000..fb678874c0245f9e6d174e55e628297d45ffc159 --- /dev/null +++ b/windowsview/ukui-flow.cpp @@ -0,0 +1,1064 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +* Copyright (C) 2025, KylinSoft Co., Ltd. +* +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtQml module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** iaom +****************************************************************************/ + +#include "ukui-flow.h" + +#include +#include +static const QQuickItemPrivate::ChangeTypes watchedChanges + = QQuickItemPrivate::Geometry + | QQuickItemPrivate::SiblingOrder + | QQuickItemPrivate::Visibility + | QQuickItemPrivate::Destroyed; + +void UkuiBasePositionerPrivate::watchChanges(QQuickItem *other) +{ + QQuickItemPrivate *otherPrivate = QQuickItemPrivate::get(other); + otherPrivate->addItemChangeListener(this, watchedChanges); +} + +void UkuiBasePositionerPrivate::unwatchChanges(QQuickItem* other) +{ + QQuickItemPrivate *otherPrivate = QQuickItemPrivate::get(other); + otherPrivate->removeItemChangeListener(this, watchedChanges); +} + + +UkuiBasePositioner::PositionedItem::PositionedItem(QQuickItem *i) + : item(i) + , transitionableItem(nullptr) + , index(-1) + , isNew(false) + , isVisible(true) + , topPadding(0) + , leftPadding(0) + , rightPadding(0) + , bottomPadding(0) +{ +} + +UkuiBasePositioner::PositionedItem::~PositionedItem() +{ + delete transitionableItem; +} + +qreal UkuiBasePositioner::PositionedItem::itemX() const +{ + return transitionableItem ? transitionableItem->itemX() : item->x(); +} + +qreal UkuiBasePositioner::PositionedItem::itemY() const +{ + return transitionableItem ? transitionableItem->itemY() : item->y(); +} + +void UkuiBasePositioner::PositionedItem::moveTo(const QPointF &pos) +{ + if (transitionableItem) { + transitionableItem->moveTo(pos); + } + else + item->setPosition(pos); +} + +void UkuiBasePositioner::PositionedItem::transitionNextReposition(QQuickItemViewTransitioner *transitioner, QQuickItemViewTransitioner::TransitionType type, bool asTarget) +{ + if (!transitioner) + return; + if (!transitionableItem) + transitionableItem = new QQuickItemViewTransitionableItem(item); + transitioner->transitionNextReposition(transitionableItem, type, asTarget); +} + +bool UkuiBasePositioner::PositionedItem::prepareTransition(QQuickItemViewTransitioner *transitioner, const QRectF &viewBounds) +{ + return transitionableItem ? transitionableItem->prepareTransition(transitioner, index, viewBounds) : false; +} + +void UkuiBasePositioner::PositionedItem::startTransition(QQuickItemViewTransitioner *transitioner) +{ + if (transitionableItem) + transitionableItem->startTransition(transitioner, index); +} + +void UkuiBasePositioner::PositionedItem::updatePadding(qreal lp, qreal tp, qreal rp, qreal bp) +{ + leftPadding = lp; + topPadding = tp; + rightPadding = rp; + bottomPadding = bp; +} + +UkuiBasePositioner::UkuiBasePositioner(PositionerType at, QQuickItem *parent) + : QQuickImplicitSizeItem(*(new UkuiBasePositionerPrivate), parent) +{ + Q_D(UkuiBasePositioner); + d->init(at); +} + +UkuiBasePositioner::UkuiBasePositioner(UkuiBasePositionerPrivate &dd, PositionerType at, QQuickItem *parent) + : QQuickImplicitSizeItem(dd, parent) +{ + Q_D(UkuiBasePositioner); + d->init(at); +} + +UkuiBasePositioner::~UkuiBasePositioner() +{ + Q_D(UkuiBasePositioner); + delete d->transitioner; + for (int i = 0; i < positionedItems.count(); ++i) + d->unwatchChanges(positionedItems.at(i).item); + for (int i = 0; i < unpositionedItems.count(); ++i) + d->unwatchChanges(unpositionedItems.at(i).item); + clearPositionedItems(&positionedItems); + clearPositionedItems(&unpositionedItems); +} + +void UkuiBasePositioner::updatePolish() +{ + Q_D(UkuiBasePositioner); + if (d->positioningDirty) + prePositioning(); +} + +qreal UkuiBasePositioner::spacing() const +{ + Q_D(const UkuiBasePositioner); + return d->spacing; +} + +void UkuiBasePositioner::setSpacing(qreal s) +{ + Q_D(UkuiBasePositioner); + if (s == d->spacing) + return; + d->spacing = s; + d->setPositioningDirty(); + emit spacingChanged(); +} + +QQuickTransition *UkuiBasePositioner::populate() const +{ + Q_D(const UkuiBasePositioner); + return d->transitioner ? d->transitioner->populateTransition : nullptr; +} + +void UkuiBasePositioner::setPopulate(QQuickTransition *transition) +{ + Q_D(UkuiBasePositioner); + if (!d->transitioner) + d->transitioner = new QQuickItemViewTransitioner; + if (d->transitioner->populateTransition != transition) { + d->transitioner->populateTransition = transition; + emit populateChanged(); + } +} + +QQuickTransition *UkuiBasePositioner::move() const +{ + Q_D(const UkuiBasePositioner); + return d->transitioner ? d->transitioner->displacedTransition : nullptr; +} + +void UkuiBasePositioner::setMove(QQuickTransition *mt) +{ + Q_D(UkuiBasePositioner); + if (!d->transitioner) + d->transitioner = new QQuickItemViewTransitioner; + if (mt == d->transitioner->displacedTransition) + return; + + d->transitioner->displacedTransition = mt; + emit moveChanged(); +} + +QQuickTransition *UkuiBasePositioner::add() const +{ + Q_D(const UkuiBasePositioner); + return d->transitioner ? d->transitioner->addTransition : nullptr; +} + +void UkuiBasePositioner::setAdd(QQuickTransition *add) +{ + Q_D(UkuiBasePositioner); + if (!d->transitioner) + d->transitioner = new QQuickItemViewTransitioner; + if (add == d->transitioner->addTransition) + return; + + d->transitioner->addTransition = add; + emit addChanged(); +} + +void UkuiBasePositioner::componentComplete() +{ + Q_D(UkuiBasePositioner); + QQuickItem::componentComplete(); + if (d->transitioner) + d->transitioner->setPopulateTransitionEnabled(true); + positionedItems.reserve(childItems().count()); + prePositioning(); + if (d->transitioner) + d->transitioner->setPopulateTransitionEnabled(false); +} + +void UkuiBasePositioner::itemChange(ItemChange change, const ItemChangeData &value) +{ + Q_D(UkuiBasePositioner); + if (change == ItemChildAddedChange) { + d->setPositioningDirty(); + } else if (change == ItemChildRemovedChange) { + QQuickItem *child = value.item; + UkuiBasePositioner::PositionedItem posItem(child); + int idx = positionedItems.find(posItem); + if (idx >= 0) { + d->unwatchChanges(child); + removePositionedItem(&positionedItems, idx); + } else if ((idx = unpositionedItems.find(posItem)) >= 0) { + d->unwatchChanges(child); + removePositionedItem(&unpositionedItems, idx); + } + d->setPositioningDirty(); + } + + QQuickItem::itemChange(change, value); +} + +void UkuiBasePositioner::forceLayout() +{ + updatePolish(); +} + +void UkuiBasePositioner::prePositioning() +{ + Q_D(UkuiBasePositioner); + if (!isComponentComplete()) + return; + + if (d->doingPositioning) + return; + + d->positioningDirty = false; + d->doingPositioning = true; + //Need to order children by creation order modified by stacking order + QList children = childItems(); + + QPODVector oldItems; + positionedItems.copyAndClear(oldItems); + for (int ii = 0; ii < unpositionedItems.count(); ii++) + oldItems.append(unpositionedItems[ii]); + unpositionedItems.clear(); + int addedIndex = -1; + + for (int ii = 0; ii < children.count(); ++ii) { + QQuickItem *child = children.at(ii); + if (QQuickItemPrivate::get(child)->isTransparentForPositioner()) + continue; + QQuickItemPrivate *childPrivate = QQuickItemPrivate::get(child); + PositionedItem posItem(child); + int wIdx = oldItems.find(posItem); + if (wIdx < 0) { + d->watchChanges(child); + posItem.isNew = true; + if (!childPrivate->explicitVisible || !child->width() || !child->height()) { + posItem.isVisible = false; + posItem.index = -1; + unpositionedItems.append(posItem); + } else { + posItem.index = positionedItems.count(); + positionedItems.append(posItem); + + if (d->transitioner) { + if (addedIndex < 0) + addedIndex = posItem.index; + PositionedItem *theItem = &positionedItems[positionedItems.count()-1]; + if (d->transitioner->canTransition(QQuickItemViewTransitioner::PopulateTransition, true)) + theItem->transitionNextReposition(d->transitioner, QQuickItemViewTransitioner::PopulateTransition, true); + else if (!d->transitioner->populateTransitionEnabled()) + theItem->transitionNextReposition(d->transitioner, QQuickItemViewTransitioner::AddTransition, true); + } + } + } else { + PositionedItem *item = &oldItems[wIdx]; + // Items are only omitted from positioning if they are explicitly hidden + // i.e. their positioning is not affected if an ancestor is hidden. + if (!childPrivate->explicitVisible || !child->width() || !child->height()) { + item->isVisible = false; + item->index = -1; + unpositionedItems.append(*item); + } else if (!item->isVisible) { + // item changed from non-visible to visible, treat it as a "new" item + item->isVisible = true; + item->isNew = true; + item->index = positionedItems.count(); + positionedItems.append(*item); + + if (d->transitioner) { + if (addedIndex < 0) + addedIndex = item->index; + positionedItems[positionedItems.count()-1].transitionNextReposition(d->transitioner, QQuickItemViewTransitioner::AddTransition, true); + } + } else { + item->isNew = false; + item->index = positionedItems.count(); + positionedItems.append(*item); + } + } + } + + if (d->transitioner) { + for (int i=0; i= 0) { + positionedItems[i].transitionNextReposition(d->transitioner, QQuickItemViewTransitioner::AddTransition, false); + } else { + // just queue the item for a move-type displace - if the item hasn't + // moved anywhere, it won't be transitioned anyway + positionedItems[i].transitionNextReposition(d->transitioner, QQuickItemViewTransitioner::MoveTransition, false); + } + } + } + } + + QSizeF contentSize(0,0); + reportConflictingAnchors(); + if (!d->anchorConflict) { + doPositioning(&contentSize); + updateAttachedProperties(); + } + + if (d->transitioner) { + QRectF viewBounds(QPointF(), contentSize); + for (int i=0; itransitioner, viewBounds); + for (int i=0; itransitioner); + d->transitioner->resetTargetLists(); + } + + d->doingPositioning = false; + + //Set implicit size to the size of its children + setImplicitSize(contentSize.width(), contentSize.height()); + + emit positioningComplete(); +} + +void UkuiBasePositioner::positionItem(qreal x, qreal y, PositionedItem *target) +{ + if ( target->itemX() != x || target->itemY() != y ) + target->moveTo(QPointF(x, y)); +} + +void UkuiBasePositioner::positionItemX(qreal x, PositionedItem *target) +{ + Q_D(UkuiBasePositioner); + if (target->itemX() != x + && (d->type == Horizontal || d->type == Both)) { + target->moveTo(QPointF(x, target->itemY())); + } +} + +void UkuiBasePositioner::positionItemY(qreal y, PositionedItem *target) +{ + Q_D(UkuiBasePositioner); + if (target->itemY() != y + && (d->type == Vertical || d->type == Both)) { + target->moveTo(QPointF(target->itemX(), y)); + } +} + +/* + Since PositionedItem values are stored by value, their internal transitionableItem pointers + must be cleaned up when a PositionedItem is removed from a QPODVector, otherwise the pointer + is never deleted since QPODVector doesn't invoke the destructor. + */ +void UkuiBasePositioner::removePositionedItem(QPODVector *items, int index) +{ + Q_ASSERT(index >= 0 && index < items->count()); + delete items->at(index).transitionableItem; + items->remove(index); +} +void UkuiBasePositioner::clearPositionedItems(QPODVector *items) +{ + for (int i=0; icount(); i++) + delete items->at(i).transitionableItem; + items->clear(); +} + +UkuiPositionerAttached *UkuiBasePositioner::qmlAttachedProperties(QObject *obj) +{ + return new UkuiPositionerAttached(obj); +} + +void UkuiBasePositioner::updateAttachedProperties(UkuiPositionerAttached *specificProperty, QQuickItem *specificPropertyOwner) const +{ + // If this function is deemed too expensive or shows up in profiles, it could + // be changed to run only when there are attached properties present. This + // could be a flag in the positioner that is set by the attached property + // constructor. + UkuiPositionerAttached *prevLastProperty = nullptr; + UkuiPositionerAttached *lastProperty = nullptr; + + for (int ii = 0; ii < positionedItems.count(); ++ii) { + const PositionedItem &child = positionedItems.at(ii); + if (!child.item) + continue; + + UkuiPositionerAttached *property = nullptr; + + if (specificProperty) { + if (specificPropertyOwner == child.item) { + property = specificProperty; + } + } else { + property = static_cast(qmlAttachedPropertiesObject(child.item, false)); + } + + if (property) { + property->setIndex(ii); + property->setIsFirstItem(ii == 0); + + if (property->isLastItem()) { + if (prevLastProperty) + prevLastProperty->setIsLastItem(false); // there can be only one last property + prevLastProperty = property; + } + } + + lastProperty = property; + } + + if (prevLastProperty && prevLastProperty != lastProperty) + prevLastProperty->setIsLastItem(false); + if (lastProperty) + lastProperty->setIsLastItem(true); + + // clear attached properties for unpositioned items + for (int ii = 0; ii < unpositionedItems.count(); ++ii) { + const PositionedItem &child = unpositionedItems.at(ii); + if (!child.item) + continue; + + UkuiPositionerAttached *property = nullptr; + + if (specificProperty) { + if (specificPropertyOwner == child.item) { + property = specificProperty; + } + } else { + property = static_cast(qmlAttachedPropertiesObject(child.item, false)); + } + + if (property) { + property->setIndex(-1); + property->setIsFirstItem(false); + property->setIsLastItem(false); + } + } +} + +qreal UkuiBasePositioner::padding() const +{ + Q_D(const UkuiBasePositioner); + return d->padding(); +} + +void UkuiBasePositioner::setPadding(qreal padding) +{ + Q_D(UkuiBasePositioner); + if (qFuzzyCompare(d->padding(), padding)) + return; + + d->extra.value().padding = padding; + d->setPositioningDirty(); + emit paddingChanged(); + if (!d->extra.isAllocated() || !d->extra->explicitTopPadding) + emit topPaddingChanged(); + if (!d->extra.isAllocated() || !d->extra->explicitLeftPadding) + emit leftPaddingChanged(); + if (!d->extra.isAllocated() || !d->extra->explicitRightPadding) + emit rightPaddingChanged(); + if (!d->extra.isAllocated() || !d->extra->explicitBottomPadding) + emit bottomPaddingChanged(); +} + +void UkuiBasePositioner::resetPadding() +{ + setPadding(0); +} + +qreal UkuiBasePositioner::topPadding() const +{ + Q_D(const UkuiBasePositioner); + if (d->extra.isAllocated() && d->extra->explicitTopPadding) + return d->extra->topPadding; + return d->padding(); +} + +void UkuiBasePositioner::setTopPadding(qreal padding) +{ + Q_D(UkuiBasePositioner); + d->setTopPadding(padding); +} + +void UkuiBasePositioner::resetTopPadding() +{ + Q_D(UkuiBasePositioner); + d->setTopPadding(0, true); +} + +qreal UkuiBasePositioner::leftPadding() const +{ + Q_D(const UkuiBasePositioner); + if (d->extra.isAllocated() && d->extra->explicitLeftPadding) + return d->extra->leftPadding; + return d->padding(); +} + +void UkuiBasePositioner::setLeftPadding(qreal padding) +{ + Q_D(UkuiBasePositioner); + d->setLeftPadding(padding); +} + +void UkuiBasePositioner::resetLeftPadding() +{ + Q_D(UkuiBasePositioner); + d->setLeftPadding(0, true); +} + +qreal UkuiBasePositioner::rightPadding() const +{ + Q_D(const UkuiBasePositioner); + if (d->extra.isAllocated() && d->extra->explicitRightPadding) + return d->extra->rightPadding; + return d->padding(); +} + +void UkuiBasePositioner::setRightPadding(qreal padding) +{ + Q_D(UkuiBasePositioner); + d->setRightPadding(padding); +} + +void UkuiBasePositioner::resetRightPadding() +{ + Q_D(UkuiBasePositioner); + d->setRightPadding(0, true); +} + +qreal UkuiBasePositioner::bottomPadding() const +{ + Q_D(const UkuiBasePositioner); + if (d->extra.isAllocated() && d->extra->explicitBottomPadding) + return d->extra->bottomPadding; + return d->padding(); +} + +void UkuiBasePositioner::setBottomPadding(qreal padding) +{ + Q_D(UkuiBasePositioner); + d->setBottomPadding(padding); +} + +void UkuiBasePositioner::resetBottomPadding() +{ + Q_D(UkuiBasePositioner); + d->setBottomPadding(0, true); +} + +UkuiBasePositionerPrivate::ExtraData::ExtraData() + : padding(0) + , topPadding(0) + , leftPadding(0) + , rightPadding(0) + , bottomPadding(0) + , explicitTopPadding(false) + , explicitLeftPadding(false) + , explicitRightPadding(false) + , explicitBottomPadding(false) +{ +} + +void UkuiBasePositionerPrivate::setTopPadding(qreal value, bool reset) +{ + Q_Q(UkuiBasePositioner); + qreal oldPadding = q->topPadding(); + if (!reset || extra.isAllocated()) { + extra.value().topPadding = value; + extra.value().explicitTopPadding = !reset; + } + if ((!reset && !qFuzzyCompare(oldPadding, value)) || (reset && !qFuzzyCompare(oldPadding, padding()))) { + setPositioningDirty(); + emit q->topPaddingChanged(); + } +} + +void UkuiBasePositionerPrivate::setLeftPadding(qreal value, bool reset) +{ + Q_Q(UkuiBasePositioner); + qreal oldPadding = q->leftPadding(); + if (!reset || extra.isAllocated()) { + extra.value().leftPadding = value; + extra.value().explicitLeftPadding = !reset; + } + if ((!reset && !qFuzzyCompare(oldPadding, value)) || (reset && !qFuzzyCompare(oldPadding, padding()))) { + setPositioningDirty(); + emit q->leftPaddingChanged(); + } +} + +void UkuiBasePositionerPrivate::setRightPadding(qreal value, bool reset) +{ + Q_Q(UkuiBasePositioner); + qreal oldPadding = q->rightPadding(); + if (!reset || extra.isAllocated()) { + extra.value().rightPadding = value; + extra.value().explicitRightPadding = !reset; + } + if ((!reset && !qFuzzyCompare(oldPadding, value)) || (reset && !qFuzzyCompare(oldPadding, padding()))) { + setPositioningDirty(); + emit q->rightPaddingChanged(); + } +} + +void UkuiBasePositionerPrivate::setBottomPadding(qreal value, bool reset) +{ + Q_Q(UkuiBasePositioner); + qreal oldPadding = q->bottomPadding(); + if (!reset || extra.isAllocated()) { + extra.value().bottomPadding = value; + extra.value().explicitBottomPadding = !reset; + } + if ((!reset && !qFuzzyCompare(oldPadding, value)) || (reset && !qFuzzyCompare(oldPadding, padding()))) { + setPositioningDirty(); + emit q->bottomPaddingChanged(); + } +} + +UkuiPositionerAttached::UkuiPositionerAttached(QObject *parent) : QObject(parent), m_index(-1), m_isFirstItem(false), m_isLastItem(false) +{ + QQuickItem *attachedItem = qobject_cast(parent); + if (attachedItem) { + UkuiBasePositioner *positioner = qobject_cast(attachedItem->parent()); + if (positioner) { + positioner->updateAttachedProperties(this, attachedItem); + } + } +} + +void UkuiPositionerAttached::setIndex(int index) +{ + if (m_index == index) + return; + m_index = index; + emit indexChanged(); +} + +void UkuiPositionerAttached::setIsFirstItem(bool isFirstItem) +{ + if (m_isFirstItem == isFirstItem) + return; + m_isFirstItem = isFirstItem; + emit isFirstItemChanged(); +} + +void UkuiPositionerAttached::setIsLastItem(bool isLastItem) +{ + if (m_isLastItem == isLastItem) + return; + m_isLastItem = isLastItem; + emit isLastItemChanged(); +} + +class UkuiFlowPrivate : public UkuiBasePositionerPrivate +{ + Q_DECLARE_PUBLIC(UkuiFlow) + +public: + UkuiFlowPrivate() + : UkuiBasePositionerPrivate(), flow(UkuiFlow::LeftToRight), lineHorizontalCenterAlignment(false) + {} + + void effectiveLayoutDirectionChange() override + { + Q_Q(UkuiFlow); + // Don't postpone, as it might be the only trigger for visible changes. + q->prePositioning(); + emit q->effectiveLayoutDirectionChanged(); + } + + UkuiFlow::Flow flow; + bool lineHorizontalCenterAlignment; + QHash posCache; +}; + +UkuiFlow::UkuiFlow(QQuickItem *parent) +: UkuiBasePositioner(*(new UkuiFlowPrivate), Both, parent) +{ + Q_D(UkuiFlow); + // Flow layout requires relayout if its own size changes too. + d->addItemChangeListener(d, QQuickItemPrivate::Geometry); +} + +UkuiFlow::Flow UkuiFlow::flow() const +{ + Q_D(const UkuiFlow); + return d->flow; +} + +void UkuiFlow::setFlow(Flow flow) +{ + Q_D(UkuiFlow); + if (d->flow != flow) { + d->flow = flow; + prePositioning(); + emit flowChanged(); + } +} + +Qt::LayoutDirection UkuiFlow::layoutDirection() const +{ + Q_D(const UkuiFlow); + return d->layoutDirection; +} + +void UkuiFlow::setLayoutDirection(Qt::LayoutDirection layoutDirection) +{ + Q_D(UkuiFlow); + if (d->layoutDirection != layoutDirection) { + d->layoutDirection = layoutDirection; + emit layoutDirectionChanged(); + d->effectiveLayoutDirectionChange(); + } +} + +Qt::LayoutDirection UkuiFlow::effectiveLayoutDirection() const +{ + return UkuiBasePositionerPrivate::getEffectiveLayoutDirection(this); +} + +bool UkuiFlow::lineHorizontalCenterAlignment() const +{ + Q_D(const UkuiFlow); + return d->lineHorizontalCenterAlignment; +} + +void UkuiFlow::setLineHorizontalCenterAlignment(bool lineHorizontalCenterAlignment) +{ + Q_D(UkuiFlow); + if (d->lineHorizontalCenterAlignment != lineHorizontalCenterAlignment) { + d->lineHorizontalCenterAlignment = lineHorizontalCenterAlignment; + d->setPositioningDirty(); + emit lineHorizontalCenterAlignmentChanged(); + } +} + +int UkuiFlow::moveCurrentIndexLeft(int currentIndex) +{ + if (effectiveLayoutDirection() == Qt::LayoutDirection::LeftToRight) { + if (currentIndex > 0) { + return currentIndex - 1; + } else { + return positionedItems.count() - 1; + } + } else { + if (currentIndex < positionedItems.count() - 1) { + return currentIndex + 1; + } else { + return 0; + } + } +} + +int UkuiFlow::moveCurrentIndexRight(int currentIndex) +{ + if (effectiveLayoutDirection() == Qt::LayoutDirection::LeftToRight) { + if (currentIndex < positionedItems.count() - 1) { + return currentIndex + 1; + } else { + return 0; + } + } else { + if (currentIndex > 0) { + return currentIndex - 1; + } else { + return positionedItems.count() - 1; + } + } +} + +int UkuiFlow::moveCurrentIndexUp(int currentIndex) +{ + // 只有一行时移动到末尾 + if (positionedItems[0].itemY() == positionedItems[positionedItems.count() - 1].itemY()) { + return positionedItems.count() - 1; + } + + PositionedItem ¤tChild = positionedItems[currentIndex]; + qreal currentRowY = currentChild.itemY(); + int upRowStartIndex = 0; + int upRowEndIndex = positionedItems.count() - 1; + + // 计算当前获取键盘焦点的窗口需要移动至哪一行 + if (currentChild.itemY() == positionedItems[0].itemY()) { + // 当前键盘焦点窗口位于第一行 + currentRowY = positionedItems[positionedItems.count() - 1].itemY(); + upRowEndIndex = positionedItems.count() - 1; + } else { + for (int i = positionedItems.count() - 1; i >= 0; i--) { + if (positionedItems[i].itemY() < currentChild.itemY()) { + currentRowY = positionedItems[i].itemY(); + upRowEndIndex = i; + break; + } + } + } + + for (int i = upRowEndIndex; i >= 0; i--) { + if (positionedItems[i].itemY() < currentRowY) { + upRowStartIndex = i + 1; + break; + } + } + + // 查找应该跳转到上一行的哪个窗口 + return findUpDownItemIndex(currentIndex, upRowStartIndex, upRowEndIndex); +} + +int UkuiFlow::moveCurrentIndexDown(int currentIndex) +{ + // 只有一行时移动到首个 + if (positionedItems[0].itemY() == positionedItems[positionedItems.count() - 1].itemY()) { + return 0; + } + + PositionedItem ¤tChild = positionedItems[currentIndex]; + qreal currentRowY = currentChild.itemY(); + int downRowStartIndex = 0; + int downRowEndIndex = positionedItems.count() - 1; + + // 计算当前获取键盘焦点的窗口需要移动至哪一行 + if (currentChild.itemY() == positionedItems[positionedItems.count() - 1].itemY()) { + // 当前键盘焦点窗口位于最后一行 + currentRowY = positionedItems[0].itemY(); + downRowStartIndex = 0; + } else { + for (int i = 0; i < positionedItems.count(); i++) { + if (positionedItems[i].itemY() > currentChild.itemY()) { + currentRowY = positionedItems[i].itemY(); + downRowStartIndex = i; + break; + } + } + } + + for (int i = downRowStartIndex; i < positionedItems.count(); i++) { + if (positionedItems[i].itemY() > currentRowY) { + downRowEndIndex = i - 1; + break; + } + } + + // 查找应该跳转到下一行的哪个窗口 + return findUpDownItemIndex(currentIndex, downRowStartIndex, downRowEndIndex); +} + +int UkuiFlow::findUpDownItemIndex(int currentIndex, int startIndex, int endIndex) +{ + PositionedItem ¤tChild = positionedItems[currentIndex]; + // 获取当前键盘焦点窗口的leftX rightX + qreal currentIndexLeftX = currentChild.itemX(); + qreal currentIndexRightX = currentChild.itemX() + currentChild.item->width(); + + // 判断应该跳转到上/下一行的哪个窗口 + int resultIndex = startIndex; + qreal result = 0; + for (int i = startIndex; i <= endIndex; i++) { + qreal temp = 0; + if ((positionedItems[i].itemX() + positionedItems[i].item->width()) < currentIndexLeftX) { + resultIndex = i; + continue; + } + if (positionedItems[i].itemX()> currentIndexRightX) { + break; + } + if (positionedItems[i].itemX() <= currentIndexLeftX) { + if ((positionedItems[i].itemX() + positionedItems[i].item->width()) <= currentIndexRightX) { + temp = (positionedItems[i].itemX() + positionedItems[i].item->width()) - currentIndexLeftX; + } else { + temp = currentIndexRightX - currentIndexLeftX; + } + } else { + if ((positionedItems[i].itemX() + positionedItems[i].item->width()) <= currentIndexRightX) { + temp = (positionedItems[i].itemX() + positionedItems[i].item->width()) - positionedItems[i].itemX(); + } else { + temp = currentIndexRightX - positionedItems[i].itemX(); + } + } + + if (temp > result) { + result = temp; + resultIndex = i; + } + } + return resultIndex; +} + +void UkuiFlow::doPositioning(QSizeF *contentSize) +{ + //Precondition: All items in the positioned list have a valid item pointer and should be positioned + Q_D(UkuiFlow); + + qreal hoffset1 = leftPadding(); + qreal hoffset2 = rightPadding(); + if (!d->isLeftToRight()) + qSwap(hoffset1, hoffset2); + qreal hoffset = hoffset1; + const qreal voffset1 = topPadding(); + qreal voffset = voffset1; + qreal linemax = 0; + contentSize->setWidth(qMax(contentSize->width(), hoffset1 + hoffset2)); + contentSize->setHeight(qMax(contentSize->height(), voffset + bottomPadding())); + + int lineFirstIndex = 0; + for (int i = 0; i < positionedItems.count(); ++i) { + PositionedItem &child = positionedItems[i]; + + if (d->flow == LeftToRight) { + if (widthValid() && hoffset != hoffset1 && hoffset + child.item->width() + hoffset2 > width()) { + //居中处理 + if (d->lineHorizontalCenterAlignment) { + PositionedItem &lineLastItem = positionedItems[i - 1]; + qreal moveOffSet = (width() - (d->posCache.value(lineLastItem.index).x() + lineLastItem.item->width() - d->posCache.value(lineFirstIndex).x())) / 2; + for (int j = lineFirstIndex; j < i; ++j) { + PositionedItem &lineChild = positionedItems[j]; + qreal posX = d->posCache.value(j).x() + moveOffSet; + if (!d->isLeftToRight()) { + posX = width() - lineChild.item->width() - posX; + } + positionItem(posX, d->posCache.value(j).y(), &lineChild); + lineChild.updatePadding(leftPadding(), topPadding(), rightPadding(), bottomPadding()); + } + lineFirstIndex = i; + } + hoffset = hoffset1; + voffset += linemax + spacing(); + linemax = 0; + } + } else { + if (heightValid() && voffset != voffset1 && voffset + child.item->height() + bottomPadding() > height()) { + voffset = voffset1; + hoffset += linemax + spacing(); + linemax = 0; + } + } + + if (d->isLeftToRight()) { + if(d->lineHorizontalCenterAlignment) { + d->posCache.insert(child.index, {hoffset, voffset}); + } else { + positionItem(hoffset, voffset, &child); + } + } else { + if(d->lineHorizontalCenterAlignment) { + d->posCache.insert(child.index, {hoffset, voffset}); + } else { + positionItemY(voffset, &child); + child.topPadding = topPadding(); + child.bottomPadding = bottomPadding(); + } + } + + contentSize->setWidth(qMax(contentSize->width(), hoffset + child.item->width() + hoffset2)); + contentSize->setHeight(qMax(contentSize->height(), voffset + child.item->height() + bottomPadding())); + + if (d->flow == LeftToRight) { + hoffset += child.item->width(); + hoffset += spacing(); + linemax = qMax(linemax, child.item->height()); + } else { + voffset += child.item->height(); + voffset += spacing(); + linemax = qMax(linemax, child.item->width()); + } + } + //最后一行 + if (widthValid() && d->lineHorizontalCenterAlignment && lineFirstIndex < positionedItems.count()) { + PositionedItem &lastItem = positionedItems[positionedItems.count() - 1]; + if (d->flow == LeftToRight) { + qreal moveOffSet = (width() - (d->posCache.value(lastItem.index).x() + lastItem.item->width() - d->posCache.value(lineFirstIndex).x())) / 2; + for (int j = lineFirstIndex; j < positionedItems.count(); ++j) { + PositionedItem &lineChild = positionedItems[j]; + qreal posX = d->posCache.value(j).x() + moveOffSet; + if (!d->isLeftToRight()) { + posX = width() - lineChild.item->width() - posX; + } + positionItem(posX, d->posCache.value(j).y(), &lineChild); + lineChild.updatePadding(leftPadding(), topPadding(), rightPadding(), bottomPadding()); + } + } + } + if(d->lineHorizontalCenterAlignment && d->flow == LeftToRight) { + contentSize->setWidth(width()); + } + d->posCache.clear(); +} + +void UkuiFlow::reportConflictingAnchors() +{ + Q_D(UkuiFlow); + for (int ii = 0; ii < positionedItems.count(); ++ii) { + const PositionedItem &child = positionedItems.at(ii); + if (child.item) { + QQuickAnchors *anchors = QQuickItemPrivate::get(static_cast(child.item))->_anchors; + if (anchors && (anchors->usedAnchors() || anchors->fill() || anchors->centerIn())) { + d->anchorConflict = true; + break; + } + } + } + if (d->anchorConflict) + qmlWarning(this) << "Cannot specify anchors for items inside Flow." << " Flow will not function."; +} diff --git a/windowsview/ukui-flow.h b/windowsview/ukui-flow.h new file mode 100644 index 0000000000000000000000000000000000000000..2c464f192d539a8484b1be033b604005d3259911 --- /dev/null +++ b/windowsview/ukui-flow.h @@ -0,0 +1,377 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +* Copyright (C) 2025, KylinSoft Co., Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtQuick module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** iaom +****************************************************************************/ + +#ifndef UKUI_FLOW_H +#define UKUI_FLOW_H + +#include +#include +#include +#include +#include + +#include +#include + +class UkuiBasePositionerPrivate; + +class UkuiPositionerAttached : public QObject +{ + Q_OBJECT + +public: + UkuiPositionerAttached(QObject *parent); + + Q_PROPERTY(int index READ index NOTIFY indexChanged) + Q_PROPERTY(bool isFirstItem READ isFirstItem NOTIFY isFirstItemChanged) + Q_PROPERTY(bool isLastItem READ isLastItem NOTIFY isLastItemChanged) + + int index() const { return m_index; } + void setIndex(int index); + + bool isFirstItem() const { return m_isFirstItem; } + void setIsFirstItem(bool isFirstItem); + + bool isLastItem() const { return m_isLastItem; } + void setIsLastItem(bool isLastItem); + + Q_SIGNALS: + void indexChanged(); + void isFirstItemChanged(); + void isLastItemChanged(); + +private: + int m_index; + bool m_isFirstItem; + bool m_isLastItem; +}; + +class UkuiBasePositioner : public QQuickImplicitSizeItem +{ + Q_OBJECT + + Q_PROPERTY(qreal spacing READ spacing WRITE setSpacing NOTIFY spacingChanged) + Q_PROPERTY(QQuickTransition *populate READ populate WRITE setPopulate NOTIFY populateChanged) + Q_PROPERTY(QQuickTransition *move READ move WRITE setMove NOTIFY moveChanged) + Q_PROPERTY(QQuickTransition *add READ add WRITE setAdd NOTIFY addChanged) + + Q_PROPERTY(qreal padding READ padding WRITE setPadding RESET resetPadding NOTIFY paddingChanged) + Q_PROPERTY(qreal topPadding READ topPadding WRITE setTopPadding RESET resetTopPadding NOTIFY topPaddingChanged) + Q_PROPERTY(qreal leftPadding READ leftPadding WRITE setLeftPadding RESET resetLeftPadding NOTIFY leftPaddingChanged) + Q_PROPERTY(qreal rightPadding READ rightPadding WRITE setRightPadding RESET resetRightPadding NOTIFY rightPaddingChanged) + Q_PROPERTY(qreal bottomPadding READ bottomPadding WRITE setBottomPadding RESET resetBottomPadding NOTIFY bottomPaddingChanged) + +public: + enum PositionerType { None = 0x0, Horizontal = 0x1, Vertical = 0x2, Both = 0x3 }; + + UkuiBasePositioner(PositionerType, QQuickItem *parent); + ~UkuiBasePositioner(); + + qreal spacing() const; + void setSpacing(qreal); + + QQuickTransition *populate() const; + void setPopulate(QQuickTransition *); + + QQuickTransition *move() const; + void setMove(QQuickTransition *); + + QQuickTransition *add() const; + void setAdd(QQuickTransition *); + + static UkuiPositionerAttached *qmlAttachedProperties(QObject *obj); + + void updateAttachedProperties(UkuiPositionerAttached *specificProperty = nullptr, QQuickItem *specificPropertyOwner = nullptr) const; + + qreal padding() const; + void setPadding(qreal padding); + void resetPadding(); + + qreal topPadding() const; + void setTopPadding(qreal padding); + void resetTopPadding(); + + qreal leftPadding() const; + void setLeftPadding(qreal padding); + void resetLeftPadding(); + + qreal rightPadding() const; + void setRightPadding(qreal padding); + void resetRightPadding(); + + qreal bottomPadding() const; + void setBottomPadding(qreal padding); + void resetBottomPadding(); + + Q_INVOKABLE void forceLayout(); + +protected: + UkuiBasePositioner(UkuiBasePositionerPrivate &dd, PositionerType at, QQuickItem *parent); + void componentComplete() override; + void itemChange(ItemChange, const ItemChangeData &) override; + + void updatePolish() override; + +Q_SIGNALS: + void spacingChanged(); + void populateChanged(); + void moveChanged(); + void addChanged(); + void paddingChanged(); + void topPaddingChanged(); + void leftPaddingChanged(); + void rightPaddingChanged(); + void bottomPaddingChanged(); + void positioningComplete(); + +protected Q_SLOTS: + void prePositioning(); + +protected: + virtual void doPositioning(QSizeF *contentSize)=0; + virtual void reportConflictingAnchors()=0; + + class PositionedItem + { + public : + PositionedItem(QQuickItem *i); + ~PositionedItem(); + bool operator==(const PositionedItem &other) const { return other.item == item; } + + qreal itemX() const; + qreal itemY() const; + + void moveTo(const QPointF &pos); + + void transitionNextReposition(QQuickItemViewTransitioner *transitioner, QQuickItemViewTransitioner::TransitionType type, bool asTarget); + bool prepareTransition(QQuickItemViewTransitioner *transitioner, const QRectF &viewBounds); + void startTransition(QQuickItemViewTransitioner *transitioner); + + void updatePadding(qreal lp, qreal tp, qreal rp, qreal bp); + + QQuickItem *item; + QQuickItemViewTransitionableItem *transitionableItem; + int index; + bool isNew; + bool isVisible; + + qreal topPadding; + qreal leftPadding; + qreal rightPadding; + qreal bottomPadding; + }; + + QPODVector positionedItems; + QPODVector unpositionedItems;//Still 'in' the positioner, just not positioned + + void positionItem(qreal x, qreal y, PositionedItem *target); + void positionItemX(qreal, PositionedItem *target); + void positionItemY(qreal, PositionedItem *target); + + void removePositionedItem(QPODVector *items, int index); + void clearPositionedItems(QPODVector *items); + +private: + Q_DISABLE_COPY(UkuiBasePositioner) + Q_DECLARE_PRIVATE(UkuiBasePositioner) +}; + +class UkuiBasePositionerPrivate : public QQuickImplicitSizeItemPrivate, public QQuickItemChangeListener +{ + Q_DECLARE_PUBLIC(UkuiBasePositioner) + +public: + struct ExtraData { + ExtraData(); + + qreal padding; + qreal topPadding; + qreal leftPadding; + qreal rightPadding; + qreal bottomPadding; + bool explicitTopPadding : 1; + bool explicitLeftPadding : 1; + bool explicitRightPadding : 1; + bool explicitBottomPadding : 1; + }; + QLazilyAllocated extra; + + UkuiBasePositionerPrivate() + : spacing(0), type(UkuiBasePositioner::None) + , transitioner(0), positioningDirty(false) + , doingPositioning(false), anchorConflict(false), layoutDirection(Qt::LeftToRight) + + { + } + + void init(UkuiBasePositioner::PositionerType at) + { + type = at; + } + + qreal spacing; + + UkuiBasePositioner::PositionerType type; + QQuickItemViewTransitioner *transitioner; + + void watchChanges(QQuickItem *other); + void unwatchChanges(QQuickItem* other); + void setPositioningDirty() { + Q_Q(UkuiBasePositioner); + if (!positioningDirty) { + positioningDirty = true; + q->polish(); + } + } + + bool positioningDirty : 1; + bool doingPositioning : 1; + bool anchorConflict : 1; + + Qt::LayoutDirection layoutDirection; + + void mirrorChange() override { + effectiveLayoutDirectionChange(); + } + bool isLeftToRight() const { + if (type == UkuiBasePositioner::Vertical) + return true; + else + return effectiveLayoutMirror ? layoutDirection == Qt::RightToLeft : layoutDirection == Qt::LeftToRight; + } + + void itemSiblingOrderChanged(QQuickItem* other) override + { + Q_UNUSED(other); + setPositioningDirty(); + } + + void itemGeometryChanged(QQuickItem *, QQuickGeometryChange change, const QRectF &) override + { + if (change.sizeChange()) + setPositioningDirty(); + } + + void itemVisibilityChanged(QQuickItem *) override + { + setPositioningDirty(); + } + + void itemDestroyed(QQuickItem *item) override + { + Q_Q(UkuiBasePositioner); + int index = q->positionedItems.find(UkuiBasePositioner::PositionedItem(item)); + if (index >= 0) + q->removePositionedItem(&q->positionedItems, index); + } + + static Qt::LayoutDirection getLayoutDirection(const UkuiBasePositioner *positioner) + { + return positioner->d_func()->layoutDirection; + } + + static Qt::LayoutDirection getEffectiveLayoutDirection(const UkuiBasePositioner *positioner) + { + if (positioner->d_func()->effectiveLayoutMirror) + return positioner->d_func()->layoutDirection == Qt::RightToLeft ? Qt::LeftToRight : Qt::RightToLeft; + else + return positioner->d_func()->layoutDirection; + } + + virtual void effectiveLayoutDirectionChange() + { + } + + inline qreal padding() const { return extra.isAllocated() ? extra->padding : 0.0; } + void setTopPadding(qreal value, bool reset = false); + void setLeftPadding(qreal value, bool reset = false); + void setRightPadding(qreal value, bool reset = false); + void setBottomPadding(qreal value, bool reset = false); +}; + +class UkuiFlowPrivate; +class UkuiFlow : public UkuiBasePositioner +{ + Q_OBJECT + Q_PROPERTY(Flow flow READ flow WRITE setFlow NOTIFY flowChanged) + Q_PROPERTY(Qt::LayoutDirection layoutDirection READ layoutDirection WRITE setLayoutDirection NOTIFY layoutDirectionChanged) + Q_PROPERTY(Qt::LayoutDirection effectiveLayoutDirection READ effectiveLayoutDirection NOTIFY effectiveLayoutDirectionChanged) + Q_PROPERTY(bool lineHorizontalCenterAlignment READ lineHorizontalCenterAlignment WRITE setLineHorizontalCenterAlignment NOTIFY lineHorizontalCenterAlignmentChanged) +public: + UkuiFlow(QQuickItem *parent=nullptr); + + enum Flow { LeftToRight, TopToBottom }; + Q_ENUM(Flow) + Flow flow() const; + void setFlow(Flow); + + Qt::LayoutDirection layoutDirection() const; + void setLayoutDirection (Qt::LayoutDirection); + Qt::LayoutDirection effectiveLayoutDirection() const; + + bool lineHorizontalCenterAlignment() const; + void setLineHorizontalCenterAlignment(bool); + +public Q_SLOTS: + int moveCurrentIndexLeft(int currentIndex); + int moveCurrentIndexRight(int currentIndex); + int moveCurrentIndexUp(int currentIndex); + int moveCurrentIndexDown(int currentIndex); + int findUpDownItemIndex(int currentIndex, int startIndex, int endIndex); + +Q_SIGNALS: + void flowChanged(); + void layoutDirectionChanged(); + void effectiveLayoutDirectionChanged(); + void lineHorizontalCenterAlignmentChanged(); + +protected: + UkuiFlow(UkuiFlowPrivate &dd, QQuickItem *parent); + void doPositioning(QSizeF *contentSize) override; + void reportConflictingAnchors() override; +private: + Q_DISABLE_COPY(UkuiFlow) + Q_DECLARE_PRIVATE(UkuiFlow) +}; +QML_DECLARE_TYPEINFO(UkuiPositionerAttached, QML_HAS_ATTACHED_PROPERTIES) + + +#endif //UKUI_FLOW_H diff --git a/windowsview/ukui-window-switch b/windowsview/ukui-window-switch index 78cf9802ecb17bd28158680cf4811048eec42ee4..c6026a6824aa97a94e6de2967eefe6099e625de1 100755 --- a/windowsview/ukui-window-switch +++ b/windowsview/ukui-window-switch @@ -1,5 +1,16 @@ #!/bin/bash +process_name="kylin-wlcom" +process_count=$(ps aux | grep -v grep | grep -c "$process_name") + if [ "$1" == "--show-workspace" ]; then - dbus-send --session --type=method_call --dest=org.kde.KWin /MultitaskView org.kde.KWin.MultitaskView.show + if [ $process_count -gt 0 ]; then + /usr/bin/ukui-window-switch-wlcom --show-workspace +# else +# dbus-send --session --type=method_call --dest=org.kde.KWin /MultitaskView org.kde.KWin.MultitaskView.show + fi +else + if [ $process_count -gt 0 ]; then + /usr/bin/ukui-window-switch-wlcom + fi fi diff --git a/windowsview/ukui-window-switch-kwineffect/CMakeLists.txt b/windowsview/ukui-window-switch-kwineffect/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..148b6fe8bdb9487b033aeb5a85bf7785a1b46302 --- /dev/null +++ b/windowsview/ukui-window-switch-kwineffect/CMakeLists.txt @@ -0,0 +1,83 @@ +cmake_minimum_required(VERSION 3.16) + +# 调试多任务视图需要取消注释下面 +# add_definitions("-Wall -g") +set(PLUGIN_NAME "windowsview") + +set(CMAKE_INCLUDE_CURRENT_DIR ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) + +set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +set(KF5_DEP_VERSION "5.54.0") + +find_package(ECM 5.54.0 NO_MODULE) +set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake) + +find_package(OpenGL) +find_package(EGL MODULE) +find_package(KF5Config REQUIRED) +find_package(KF5GlobalAccel REQUIRED) +find_package(KF5I18n REQUIRED) +find_package(PkgConfig REQUIRED) +find_package(Qt5LinguistTools REQUIRED) +find_package(Qt5 REQUIRED NO_MODULE COMPONENTS X11Extras Concurrent Quick Qml DBus) + +pkg_check_modules(KDK REQUIRED kysdk-sysinfo) +pkg_check_modules(DATACOLLECT REQUIRED kysdk-datacollect) + +include_directories(${KDK_INCLUDE_DIRS}) +include_directories(${DATACOLLECT_INCLUDE_DIRS}) + +add_definitions(-DKWINEFFECT=1) + +set(SRCS ../desktopbackground.cpp + ../icontheme.cpp + ../windowmanagerinterface.cpp + multitaskviewmanager.cpp + dbusservice.cpp + multitaskviewmanagerpluginfactory.cpp + ../multitaskviewabstractmodelhandler.h + multitaskviewmodelbycompositehandler.cpp + ../desktoplistmodel.h + ../desktoplistmodel.cpp + ../appwindowlistmodel.h + ../appwindowlistmodel.cpp + ../appwindowfiltermodel.h + ../appwindowfiltermodel.cpp + ../ukui-flow.cpp + ../ukui-flow.h + ../screens-manager.cpp + ../screens-manager.h + ) + +qt5_add_resources(SRCS ../data.qrc) +add_library( + ${PLUGIN_NAME} MODULE + ${SRCS} +) + +target_link_libraries( + ${PLUGIN_NAME} + PRIVATE + Qt5::Core + Qt5::Gui + Qt5::Quick + Qt5::QuickPrivate + KF5::ConfigCore + KF5::WindowSystem + KF5::CoreAddons + KF5::GlobalAccel + Qt5::X11Extras + Qt5::Concurrent + Qt5::DBus + Qt5::Qml + Qt::QmlPrivate + ${QGSettings_LIBRARIES} + ${KDK_LINK_LIBRARIES} + ${DATACOLLECT_LINK_LIBRARIES} +) +set(INSTALL_PATH ${QT_INSTALL_PLUGINS}/kwin/effects/plugins/) +install(TARGETS ${PLUGIN_NAME} DESTINATION ${INSTALL_PATH}) diff --git a/windowsview/ukui-window-switch-kwineffect/dbusservice.cpp b/windowsview/ukui-window-switch-kwineffect/dbusservice.cpp new file mode 100644 index 0000000000000000000000000000000000000000..313b1c0fcd19b13974e9b5a52c73bdd0696850cc --- /dev/null +++ b/windowsview/ukui-window-switch-kwineffect/dbusservice.cpp @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2022, KylinSoft Co., Ltd. + + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "dbusservice.h" + +#include "multitaskviewmanager.h" + +DBusService::DBusService(MultitaskViewManager *viewManager, QObject *parent) + : QObject(parent), + m_viewManager(viewManager), + m_connection(QDBusConnection::sessionBus()) +{ + startService(); +} + +DBusService::~DBusService() +{ + stopService(); +} + +bool DBusService::startService() +{ + return m_connection.registerService(m_serviceName) + && m_connection.registerObject(m_servicePath, this, QDBusConnection::ExportAllSlots); +} + +bool DBusService::stopService() +{ + m_connection.unregisterObject(m_servicePath); + return true; +} + +void DBusService::show() +{ + m_viewManager->open(); +} + +void DBusService::hide() +{ + m_viewManager->close(); +} diff --git a/windowsview/dbusservice.h b/windowsview/ukui-window-switch-kwineffect/dbusservice.h similarity index 41% rename from windowsview/dbusservice.h rename to windowsview/ukui-window-switch-kwineffect/dbusservice.h index a308d9831223d61e173f53101218d439a97e192e..8b54732b528ff12f7a45cfbff1b51a7e6307ce08 100644 --- a/windowsview/dbusservice.h +++ b/windowsview/ukui-window-switch-kwineffect/dbusservice.h @@ -1,3 +1,22 @@ +/* + * Copyright (C) 2022, KylinSoft Co., Ltd. + + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + #ifndef DBUSSERVICE_H #define DBUSSERVICE_H @@ -5,8 +24,6 @@ #include #include -namespace MultitaskView { - // 前置声明。解决dbusservice.h和multitaskviewmanager.h // 相互引用引发QtCreator提示DBusService类型找不到的问题 class MultitaskViewManager; @@ -20,32 +37,22 @@ class DBusService : public QObject public: DBusService(MultitaskViewManager* viewManager, QObject *parent = nullptr); - ~DBusService(); public slots: - void show(); - void hide(); private: - bool startService(); - bool stopService(); private: - - MultitaskViewManager* viewManager_ = nullptr; - - QString serviceName_ = "org.kde.KWin"; - - QString servicePath_ = "/MultitaskView"; - - QDBusConnection connection_; + MultitaskViewManager* m_viewManager = nullptr; + QString m_serviceName = "org.kde.KWin"; + QString m_servicePath = "/MultitaskView"; + QDBusConnection m_connection; }; -} // namespace MultitaskView #endif // DBUSSERVICE_H diff --git a/windowsview/ukui-window-switch-kwineffect/multitaskviewmanager.cpp b/windowsview/ukui-window-switch-kwineffect/multitaskviewmanager.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5ccf7daeb8356abcab34c76957ac10d32865b12e --- /dev/null +++ b/windowsview/ukui-window-switch-kwineffect/multitaskviewmanager.cpp @@ -0,0 +1,412 @@ +/* + * Copyright (C) 2024, KylinSoft Co., Ltd. + + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "multitaskviewmanager.h" + +// kf5 +#include +#include +// kysdk +#include +#include +// Qt +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../desktopbackground.h" +#include "../icontheme.h" +#include "../windowmanagerinterface.h" +#include "../appwindowfiltermodel.h" +#include "../ukui-flow.h" + +bool MultitaskViewManager::m_isOpenGLBackend = true; + +MultitaskViewManager::MultitaskViewManager() +{ + initializeProjectType(); + registerQmlTypes(); + registerShortcut(); + initDBusService(); + initGuiLayouDirection(); + installTranslator(); + + const QByteArray id("org.mate.background"); + if(QGSettings::isSchemaInstalled(id)){ + QGSettings * backgSetting = new QGSettings(id, QByteArray(), this); + connect(backgSetting, &QGSettings::changed,[=](QString key) { + if ("pictureFilename" == key) { + updateDesktopBackground(); + } + }); + } + updateDesktopBackground(); +} + +MultitaskViewManager::~MultitaskViewManager() +{ + m_dbusService.reset(); + close(); + if (m_translator) { + m_translator->deleteLater(); + m_translator = nullptr; + } +} + +bool MultitaskViewManager::isCursorNavigationKey(QKeyEvent *e) const +{ + if (e->key() == Qt::Key_Tab || e->key() == Qt::Key_Left || + e->key() == Qt::Key_Right || e->key() == Qt::Key_Up || + e->key() == Qt::Key_Down || e->key() == Qt::Key_Home || + e->key() == Qt::Key_End || e->key() == Qt::Key_PageUp || + e->key() == Qt::Key_PageDown) { + return true; + } + return false; +} + +void MultitaskViewManager::grabbedKeyboardEvent(QKeyEvent *e) +{ + if (m_view.get()) { + if (e->type() == QEvent::KeyPress && isCursorNavigationKey(e)) { + if (!m_isShowTabBorder) { + m_isShowTabBorder = true; + } + //当该事件会作为走焦事件处理时,进行数据埋点 + QByteArray keyName = QKeySequence(e->key()).toString().toLatin1(); + QtConcurrent::run([keyName]() { + const char* text = keyName.data(); + KCustomProperty property[1]; + property[0].key = (char*)"keyName"; + property[0].value = (char*)text; + KTrackData *node = kdk_dia_data_init(KEVENTSOURCE_DESKTOP, KEVENT_CLICK); + kdk_dia_append_custom_property(node, property, 1); + kdk_dia_upload_default(node, (char*)"keyboard_navigation_event", (char*)"ukui-window-switch"); + kdk_dia_data_free(node); + }); + } + m_view->contentItem()->setFocus(true); + QCoreApplication::sendEvent(m_view.get(), e); + } +} + +void MultitaskViewManager::activeAreaChangeDataCollect(const QString &areaName) +{ + QByteArray name = areaName.toLatin1(); + QtConcurrent::run([name]() { + const char* text = name.data(); + KCustomProperty property[1]; + property[0].key = (char*)"activeAreaName"; + property[0].value = (char*)text; + KTrackData *node = kdk_dia_data_init(KEVENTSOURCE_DESKTOP, KEVENT_CUSTOM); + kdk_dia_append_custom_property(node, property, 1); + kdk_dia_upload_default(node, (char*)"keyboard_navigation_active_area_changed_event", (char*)"ukui-window-switch"); + kdk_dia_data_free(node); + }); +} + +void MultitaskViewManager::open() +{ + qDebug() << "开启多任务视图" << __FUNCTION__ << __LINE__ << isOpen << m_isKeyboardGrab; + // Alt + Tab 快捷键快速连续触发时,xcb_grab_keyboard_reply 函数返回的 grab 状态为 GrabInvalidTime,然后 + // 导致 grabKeyboard 失败。大致原因为:xcb_grab_keyboard_unchecked() 指定的时间早于 last-keyboard-grab + // 的时间或晚于当前 X server 的时间。具体原因待确认。 + // 因此在 grabKeyboard 失败后需要再次进行 grabKeyboard 操作。 + if (isOpen && !m_isKeyboardGrab) { + m_isKeyboardGrab = KWin::effects->grabKeyboard(this); + KWin::effects->setActiveFullScreenEffect(this); + return; + } + // 可旋转的机器,多任务视图打开的时候,禁用旋转 + if (m_isLoadTabletModeQML && getRotationModeStatus()) { + setRotationModeStatus(!m_isAutoRotateBeforeShowMultiTask); + } + initModel(); + m_isShowTabBorder = false; + initView(); + if (!m_isKeyboardGrab) { + m_isKeyboardGrab = KWin::effects->grabKeyboard(this); + KWin::effects->setActiveFullScreenEffect(this); + } + isOpen = true; + QtConcurrent::run([]() { + KTrackData *node = kdk_dia_data_init(KEVENTSOURCE_DESKTOP, KEVENT_CUSTOM); + kdk_dia_upload_default(node, (char*)"ukui_window_switch_start_event", (char*)"ukui-window-switch"); + kdk_dia_data_free(node); + }); +} + +void MultitaskViewManager::close() +{ + if (!isOpen) { + return; + } + //可旋转的机器,多任务视图打开前 是打开了旋转的 那么关闭多任务视图的同时 打开旋转 + if (m_isLoadTabletModeQML && m_isAutoRotateBeforeShowMultiTask) { + setRotationModeStatus(m_isAutoRotateBeforeShowMultiTask); + } + if (m_isKeyboardGrab) { + KWin::effects->ungrabKeyboard(); + m_isKeyboardGrab = false; + } + KWin::effects->setActiveFullScreenEffect(nullptr); + destroyView(); + isOpen = false; + QtConcurrent::run([]() { + KTrackData *node = kdk_dia_data_init(KEVENTSOURCE_DESKTOP, KEVENT_CUSTOM); + kdk_dia_upload_default(node, (char*)"ukui_window_switch_exit_event", (char*)"ukui-window-switch"); + kdk_dia_data_free(node); + }); +} + +bool MultitaskViewManager::getRotationModeStatus() +{ + QDBusMessage message = QDBusMessage::createMethodCall("com.kylin.statusmanager.interface", + "/", + "com.kylin.statusmanager.interface", + "get_auto_rotation"); + + QDBusMessage response = QDBusConnection::sessionBus().call(message); + + if (response.type() == QDBusMessage::ReplyMessage) { + m_isAutoRotateBeforeShowMultiTask = response.arguments().takeFirst().toBool(); + } else { + qDebug() << "get Rotation mode failed" << response.type(); + } + return m_isAutoRotateBeforeShowMultiTask; +} + +void MultitaskViewManager::setRotationModeStatus(bool rotationModeStatus) +{ + QDBusInterface iface("com.kylin.statusmanager.interface", + "/", + "com.kylin.statusmanager.interface"); + + if (!iface.isValid()) { + qDebug() << QDBusConnection::sessionBus().lastError().message(); + } + QDBusReply reply = iface.call("set_auto_rotation",rotationModeStatus,"",""); + if (reply.isValid()) { + qDebug() << "set Rotation mode success"; + return; + } + qDebug() << "set Rotation mode failed" << reply.error(); +} + +void MultitaskViewManager::initGuiLayouDirection() +{ + QString systemLang = QLocale::system().name(); + if (systemLang == "ug_CN" || systemLang == "ky_KG" || systemLang == "kk_KZ") { + m_isLayoutLeftToRight = false; + } else { + m_isLayoutLeftToRight = true; + } +} + +void MultitaskViewManager::updateDesktopBackground() +{ + QString filePath = DesktopBackground::getBackgroundFile(); + if (filePath.isEmpty()) { + return; + } + + auto loadImageFinishedCallback = [this](const QImage &image) { + DesktopBackground::setNonBlurBackground(image); + DesktopBackground::setBlurBackground(image, 0.7); + }; + + BackgroundImageHandler::loadBackgroundImageAsync(filePath, DesktopBackground::getSystemScalingFactor(), + DesktopBackground::getBackgroundFillStyle(), + this, loadImageFinishedCallback); +} + +void MultitaskViewManager::setShowingDesktop(bool showing) +{ + KWin::effects->setShowingDesktop(showing); +} + +void MultitaskViewManager::setShouldShowTabBorder(bool isShow) +{ + if (m_isShowTabBorder == isShow) { + return; + } + m_isShowTabBorder = isShow; + emit shouldShowTabBorderChanged(); +} + +void MultitaskViewManager::initModel() +{ + qDebug() << "创建model数据" << __FUNCTION__; + m_desktopListModel.reset(new DesktopListModel()); + m_appWindowListModel.reset(new AppWindowListModel()); +} + +void MultitaskViewManager::initializeProjectType() +{ + if ( getProjectCodeName() == QStringLiteral("V10SP1-edu") + || getProjectSubName() == QStringLiteral("mavis") + || getProductFeatures() == 2 ) { + m_projectType = MultitaskViewManager::TABLET; + } else if (getProjectCodeName() == QStringLiteral("V10SP1") && getProductFeatures() == '\u0000') { + // '\u0000' 空格的ASCII码 + m_projectType = MultitaskViewManager::MASTER; + m_isViewVerticalLayout = false; + } else { + m_projectType = MultitaskViewManager::TWOINONE; + m_isViewVerticalLayout = true; + } +} + +void MultitaskViewManager::setQmlUrl() +{ + if (m_projectType == MultitaskViewManager::TABLET + || (m_projectType == MultitaskViewManager::TWOINONE && WindowManagerInterface::getInstance()->isTabletMode())) { + m_qmlUrl = QUrl("qrc:/qml/TabletViewMain.qml"); + m_isLoadTabletModeQML = true; + } else if (m_projectType == MultitaskViewManager::MASTER + || (m_projectType == MultitaskViewManager::TWOINONE && !WindowManagerInterface::getInstance()->isTabletMode())) { + m_qmlUrl = QUrl("qrc:/qml/MultitaskView.qml"); + m_isLoadTabletModeQML = false; + } +} + +void MultitaskViewManager::registerQmlTypes() +{ + qmlRegisterType("org.kylin.background", 3, 0, "DesktopBackground"); + qmlRegisterType("IconTheme", 1, 0, "IconTheme"); + qmlRegisterType("AppWindowFilterModel", 1, 0, "AppWindowFilterModel"); + qmlRegisterType("DesktopListModel", 1, 0, "DesktopListModel"); + qRegisterMetaType >("QList"); + qmlRegisterUncreatableType("org.ukui.positioner", 1, 0, "UkuiPositioner", "UkuiPositioner is an attached property"); + qmlRegisterUncreatableType("org.ukui.positioner", 1, 0, "UkuiBasePositioner", "UkuiBasePositioner is an abstract type that is only available as an attached property."); + qmlRegisterType("org.ukui.positioner", 1, 0, "UkuiFlow"); +} + +void MultitaskViewManager::registerShortcut() +{ + auto* action = new QAction(this); + action->setObjectName("ShowMultitaskView"); + action->setText("Show Multitask View"); + + QKeySequence keySeq(Qt::META + Qt::Key_Tab); + KGlobalAccel::self()->setDefaultShortcut(action, QList() << keySeq); + KGlobalAccel::self()->setShortcut(action, QList() << keySeq); + connect(action, &QAction::triggered, this, &MultitaskViewManager::open); +} + +void MultitaskViewManager::initDBusService() +{ + m_dbusService.reset(new DBusService(this)); +} + +void MultitaskViewManager::installTranslator() +{ + m_translator = new QTranslator(qApp); + m_translator->load(QLocale::system(), QLatin1String("ukui-window-switch"), + QLatin1String("_"), TRANSLATION_DIR); + QApplication::installTranslator(m_translator); +} + +void MultitaskViewManager::initView() +{ + qDebug() << " 初始化多任务视图 " << __FUNCTION__; + m_view.reset(new QQuickView()); + m_view->setFlags(Qt::BypassWindowManagerHint | Qt::FramelessWindowHint); + // TODO: wayland 环境下不设置的话,会显示多任务视图的关闭动画 + KWindowSystem::setType(m_view->winId(), NET::Dock); + qDebug() << "[DEBUG]: multitask view uses " << m_view->sceneGraphBackend(); + if (m_view->rendererInterface()->graphicsApi() < 2 || !KWin::effects->isOpenGLCompositing()) { + m_isOpenGLBackend = false; + WindowManagerInterface::getInstance()->setIsOpenGLBackend(m_isOpenGLBackend); + } + // 通过 QQmlContext::setContextProperty() 注册 C++ 的对象实例到 QML 中 + m_view->rootContext()->setContextProperty("multitaskViewManager", this); + m_view->rootContext()->setContextProperty("multitaskViewModel", WindowManagerInterface::getInstance()); + m_view->rootContext()->setContextProperty("desktopListModel", m_desktopListModel.get()); + m_view->rootContext()->setContextProperty("appWindowListModel", m_appWindowListModel.get()); + m_view->rootContext()->setContextProperty("devicePixelRatio", qApp->primaryScreen()->logicalDotsPerInch() / 96.0); + m_view->show(); + setQmlUrl(); + qDebug() << "加载的qml为 " << m_qmlUrl; + m_view->setSource(m_qmlUrl); + // 默认情况视图会随着QML中的根项调整大小,可以通过 setResizeMode(QQuickView::ResizeMode) 修改默认行为 + // 但是多任务视图的 rootObject 是 Repeater,且没有设置大小,所以必须通过 setGeometry 设置视图大小。 + // TODO: Repeater 继承了 Item 的 anchor 属性,Repeater 是否可以设置大小? + // 必须在加载了QML之后才能设置 m_view 对象的大小,否则视图大小仍为 0x0 + qDebug() << " 设置的多任务视图的位置在" << KWin::effects->virtualScreenGeometry(); + m_view->setGeometry(KWin::effects->virtualScreenGeometry()); + //wayland环境下通过将active设空使其他窗口失去active状态, + //否则打开多任务视图时,开始菜单等监听deactive信号的窗口不会关闭 + KWin::effects->activateWindow(nullptr); + connectSignals(); + m_view->requestActivate(); +} + +void MultitaskViewManager::destroyView() +{ + if (m_view == nullptr) { + return; + } + if (m_view->isVisible()) { + m_view->hide(); + } + + // 1. 由于可以在QML中通过JS调用到close函数, + // 因此,不能直接销毁 m_view 对象;必须延迟 + // 销毁该对象。 + // 2. m_model 对象可以立刻销毁。但是,为了对称 + // 和简化逻辑,需要保证 m_view 对象和 m_model 对象的 + // 互相依赖的关系。因此,同时延迟销毁 m_model 对象。 + // 3. MultitaskViewManager的析构函数需要确保 + // m_view 对象和 m_model 对象完成销毁。为了简化逻辑, + // MultitaskViewManager的析构函数选择直接调用 + // destroyView函数,即采用了延迟销毁的做法。 + m_view.release()->deleteLater(); + m_desktopListModel.release()->deleteLater(); + m_appWindowListModel.release()->deleteLater(); +} + +void MultitaskViewManager::connectSignals() +{ + qDebug() << "创建信号" << __FUNCTION__; + connect(WindowManagerInterface::getInstance(), &WindowManagerInterface::appWindowCreated, this, &MultitaskViewManager::close); + connect(WindowManagerInterface::getInstance(), &WindowManagerInterface::screenCountChanged, this, &MultitaskViewManager::close); + connect(WindowManagerInterface::getInstance(), &WindowManagerInterface::screenSizeChanged, this, &MultitaskViewManager::close); + connect(WindowManagerInterface::getInstance(), &WindowManagerInterface::tabletModeChanged, this, &MultitaskViewManager::close); +} + +QString MultitaskViewManager::getProjectCodeName() +{ + return QString(kdk_system_get_projectName()); +} + +QString MultitaskViewManager::getProjectSubName() +{ + return QString(kdk_system_get_projectSubName()); +} + +QString MultitaskViewManager::getProductFeatures() +{ + return QString(kdk_system_get_productFeatures()); +} diff --git a/windowsview/ukui-window-switch-kwineffect/multitaskviewmanager.h b/windowsview/ukui-window-switch-kwineffect/multitaskviewmanager.h new file mode 100644 index 0000000000000000000000000000000000000000..215f5e1525ad55aab8ec18f614da897071fe8403 --- /dev/null +++ b/windowsview/ukui-window-switch-kwineffect/multitaskviewmanager.h @@ -0,0 +1,113 @@ +/* + * Copyright (C) 2024, KylinSoft Co., Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef MULTITASKVIEWMANAGER_H +#define MULTITASKVIEWMANAGER_H + +#include +#include + +#include + +#include "dbusservice.h" +#include "../desktoplistmodel.h" +#include "../appwindowlistmodel.h" + +class QTranslator; + +class MultitaskViewManager : public KWin::Effect +{ + Q_OBJECT + Q_PROPERTY(bool shouldShowTabBorder READ shouldShowTabBorder WRITE setShouldShowTabBorder NOTIFY shouldShowTabBorderChanged) + +public: + MultitaskViewManager(); + ~MultitaskViewManager() override; + enum ProjectType { + TABLET, + MASTER, + TWOINONE, + }; + Q_INVOKABLE void open(); + Q_INVOKABLE void close(); + Q_INVOKABLE void setShowingDesktop(bool showing); + Q_INVOKABLE bool isMultitaskViewVerticalLayout() const { return m_isViewVerticalLayout; } + Q_INVOKABLE bool shouldShowTabBorder() const { return m_isShowTabBorder; } + Q_INVOKABLE void setShouldShowTabBorder(bool isShow); + Q_INVOKABLE void activeAreaChangeDataCollect(const QString &areaName); + Q_INVOKABLE bool isWlcom() const {return false;}; + Q_INVOKABLE bool isLayoutLeftToRight() { return m_isLayoutLeftToRight; }; + + void grabbedKeyboardEvent(QKeyEvent* e) override; + static bool m_isOpenGLBackend; + +private: + void initModel(); + void initializeProjectType(); + void setQmlUrl(); + void registerQmlTypes(); + void registerShortcut(); + void initDBusService(); + void installTranslator(); + void initView(); + void destroyView(); + void connectSignals(); + bool isCursorNavigationKey(QKeyEvent *e) const; + QString getProjectCodeName(); + QString getProjectSubName(); + QString getProductFeatures(); + //! + //! \brief getRotationModeStatus 获取当前旋转模式是否打开 + //! + bool getRotationModeStatus(); + ///! + //! \brief setRotationModeStatus + //! + void setRotationModeStatus(bool openRotationMode); + + void initGuiLayouDirection(); + +private: + std::unique_ptr m_view = nullptr; + std::unique_ptr m_dbusService = nullptr; + std::unique_ptr m_desktopListModel = nullptr; + std::unique_ptr m_appWindowListModel = nullptr; + bool isOpen = false; + bool m_isKeyboardGrab = false; + ProjectType m_projectType = MultitaskViewManager::MASTER; + QUrl m_qmlUrl = QUrl("qrc:/qml/multitaskview.qml"); + // 记录旋转模式是否打开 + bool m_isAutoRotateBeforeShowMultiTask = false; + // 记录是否加载平板模式的qml + bool m_isLoadTabletModeQML = false; + // 记录多任务视图整体布局方向是否为垂直方向 + bool m_isViewVerticalLayout = false; + // 记录走焦边框是否显示 + bool m_isShowTabBorder = false; + QTranslator *m_translator = nullptr; + bool m_isLayoutLeftToRight = true; + +signals: + void shouldShowTabBorderChanged(); + +private Q_SLOTS: + void updateDesktopBackground(); +}; + +#endif // MULTITASKVIEWMANAGER_H diff --git a/windowsview/multitaskviewmanagerpluginfactory.cpp b/windowsview/ukui-window-switch-kwineffect/multitaskviewmanagerpluginfactory.cpp similarity index 39% rename from windowsview/multitaskviewmanagerpluginfactory.cpp rename to windowsview/ukui-window-switch-kwineffect/multitaskviewmanagerpluginfactory.cpp index f2b5cffb08cfdffdfe9484a5691dbec5c56358a3..6924be84bfd7367b6ab19084b8588aa64561287e 100644 --- a/windowsview/multitaskviewmanagerpluginfactory.cpp +++ b/windowsview/ukui-window-switch-kwineffect/multitaskviewmanagerpluginfactory.cpp @@ -1,3 +1,22 @@ +/* + * Copyright (C) 2024, KylinSoft Co., Ltd. + + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + #include #include "multitaskviewmanager.h" @@ -18,7 +37,7 @@ public: KWin::Effect* createEffect() const override { - return new MultitaskView::MultitaskViewManager(); + return new MultitaskViewManager(); } }; diff --git a/windowsview/ukui-window-switch-kwineffect/multitaskviewmodelbycompositehandler.cpp b/windowsview/ukui-window-switch-kwineffect/multitaskviewmodelbycompositehandler.cpp new file mode 100644 index 0000000000000000000000000000000000000000..854f1e9cdcc5fa1ad6bb5078153494bcd70d2802 --- /dev/null +++ b/windowsview/ukui-window-switch-kwineffect/multitaskviewmodelbycompositehandler.cpp @@ -0,0 +1,310 @@ +/* + * Copyright (C) 2024, KylinSoft Co., Ltd. + + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "multitaskviewmodelbycompositehandler.h" +#include + +#include +#include +#include +#include +#include +#include + +MultitaskViewModelByCompositeHandler::MultitaskViewModelByCompositeHandler(QObject *parent) : MultitaskViewAbstractModelHandler{} +{ + connectSignals(); +} + +void MultitaskViewModelByCompositeHandler::removeAppWindow(QString windowId) +{ + auto* window = KWin::effects->findWindow(windowId); + if (window == nullptr) { + return; + } + + window->closeWindow(); +} + +void MultitaskViewModelByCompositeHandler::moveAppWindowToDesktop(QString windowId, + int srcDesktopInex, + int destDesktopInex) +{ + + auto* window = KWin::effects->findWindow(windowId); + if (window == nullptr || window->isOnAllDesktops()) { + return; + } + + auto desktopIndexList = window->desktops(); + if (!desktopIndexList.contains(srcDesktopInex)) { + return; + } + + desktopIndexList.remove(desktopIndexList.indexOf(srcDesktopInex)); + + if (desktopIndexList.contains(destDesktopInex)) { + return; + } + + desktopIndexList.append(destDesktopInex); + + KWin::effects->windowToDesktops(window, desktopIndexList); +} + +void MultitaskViewModelByCompositeHandler::activateAppWindow(QString windowId) +{ + auto* window = KWin::effects->findWindow(windowId); + if (window == nullptr) { + return; + } + KWin::effects->activateWindow(window); +} + +QIcon MultitaskViewModelByCompositeHandler::getWindowIcon(QString windowId) +{ + auto* window = KWin::effects->findWindow(windowId); + if (window == nullptr) { + return QIcon(""); + } + return window->icon(); +} + +int MultitaskViewModelByCompositeHandler::getNumberOfDesktops() +{ + auto desktopCount = KWin::effects->numberOfDesktops(); + return desktopCount; +} + + +void MultitaskViewModelByCompositeHandler::removeDesktop(int desktopIndex) +{ + KWin::desktopManager->removeDesktop(desktopIndex); + emit desktopRemoved(desktopIndex); +} + +void MultitaskViewModelByCompositeHandler::moveDesktop(int srcDesktopIndex, int destDesktopIndex) +{ + KWin::desktopManager->moveDesktop(srcDesktopIndex, destDesktopIndex); + emit desktopMoved(srcDesktopIndex, destDesktopIndex); + setCurrentDesktop(destDesktopIndex); +} + +void MultitaskViewModelByCompositeHandler::appendDesktop() +{ + auto desktopCount = KWin::effects->numberOfDesktops(); + KWin::effects->setNumberOfDesktops(desktopCount + 1); + emit desktopAppended(desktopCount + 1); +} + +int MultitaskViewModelByCompositeHandler::getCurrentDesktop() +{ + return KWin::effects->currentDesktop(); +} + +bool MultitaskViewModelByCompositeHandler::isCurrentDesktopShowingDesktop() +{ + return KWin::desktopManager->showingDesktop(); +} + +void MultitaskViewModelByCompositeHandler::setCurrentDesktop(int desktopIndex) +{ + //在990环境下将wayland窗口拖入新工作区后,立刻调用接口切换至对应工作区会导致kwin崩溃 + //setCurrentDesktop与windowToDesktops不在一个事件循环内执行则无此问题 + QTimer::singleShot(0, this, [desktopIndex]() { + KWin::effects->setCurrentDesktop(desktopIndex); + }); +} + +QRect MultitaskViewModelByCompositeHandler::getFullScreenGeometry(int desktopIndex, int screenIndex) +{ + KWin::EffectScreen* screen =KWin::effects->findScreen(screenIndex); + return KWin::effects->clientArea(KWin::clientAreaOption::FullScreenArea, + screen, desktopIndex); +} + +bool MultitaskViewModelByCompositeHandler::hasModalChildWindow(QString windowId) +{ + auto* window = KWin::effects->findWindow(windowId); + if (window == nullptr) { + return false; + } + + return window->findModal() != nullptr; +} + +bool MultitaskViewModelByCompositeHandler::isExtensionMode() +{ + for (int i = 0; i < QGuiApplication::screens().size(); i++) { + if (KWin::effects->virtualScreenGeometry() == QGuiApplication::screens().at(i)->geometry()) { + return false; + }; + } + + return true; +} + +int MultitaskViewModelByCompositeHandler::logicalScreenCount() +{ + const auto screenCount = KWin::effects->screens().size(); + if (screenCount == 1 || !isExtensionMode()) { + return 1; + } + + return screenCount; +} + +WId MultitaskViewModelByCompositeHandler::getWindowId(KWin::EffectWindow *window) +{ + return window->parent()->property("windowId").toULongLong(); +} + +QUuid MultitaskViewModelByCompositeHandler::getUuid(KWin::EffectWindow *window) +{ + return window->parent()->property("internalId").toUuid(); +} + +QList MultitaskViewModelByCompositeHandler::createWindowList(int desktopIndex, int screenIndex) +{ + KWin::EffectScreen* screen = KWin::effects->findScreen(screenIndex); + QList windowList; + const auto& effectWindowList = KWin::effects->stackingOrder(); + for (auto iter = effectWindowList.cbegin(); iter != effectWindowList.cend(); iter++) { + auto* effectWindow = *iter; + if (!shouldAcceptWindow(effectWindow)) { + continue; + } + if ((!effectWindow->desktops().contains(desktopIndex) && effectWindow->desktops().size()) + || effectWindow->screen() != screen) { + continue; + } + Window window(getWindowId(effectWindow), + getUuid(effectWindow).toString(), + effectWindow->caption(), + effectWindow->pos().x(), + effectWindow->pos().y(), + effectWindow->frameGeometry().width(), + effectWindow->frameGeometry().height(), + effectWindow->isMinimized()); + QList list; + QVector vec = effectWindow->desktops(); + if (vec.isEmpty()) { + // If the vec is empty it means the window is on all desktops + for (int i = 1; i <= getNumberOfDesktops(); ++i) + list.append(i); + } else { + std::transform(vec.begin(), vec.end(),std::back_inserter(list), [](uint id) { return static_cast(id); }); + } + window.setDesktopsId(list); + window.setScreenId(screenIndex); + window.setIcon(QVariant::fromValue(effectWindow->icon())); + windowList.append(window); + } + return windowList; +} + +bool MultitaskViewModelByCompositeHandler::shouldAcceptWindow(KWin::EffectWindow* window) +{ + return !window->isDeleted() + && window->isNormalWindow() + && !window->isSkipSwitcher() + && window->isOnCurrentActivity() + && window->acceptsFocus() + && window->isManaged(); +} + +QString MultitaskViewModelByCompositeHandler::getDesktopUuid(int desktopIndex) +{ + return ""; +} + +QString MultitaskViewModelByCompositeHandler::getOutputUuid(int outputIndex) +{ + return ""; +} + +void MultitaskViewModelByCompositeHandler::setDesktopName(const int desktopIndex, const QString name) +{ + Q_UNUSED(desktopIndex); + Q_UNUSED(name); +} + +void MultitaskViewModelByCompositeHandler::onWindowAdded(KWin::EffectWindow *window) +{ + if (!shouldAcceptWindow(window) && !window->isModal()) { + return; + } + + emit appWindowCreated(); +} + +void MultitaskViewModelByCompositeHandler::onWindowDeleted(KWin::EffectWindow *window) +{ + emit appWindowRemoved(getUuid(window).toString()); +} + +void MultitaskViewModelByCompositeHandler::onWindowActivated(KWin::EffectWindow* window) +{ + // KWin在发送windowActivated信号时 + // window对象是有可能为空的。对于多任务 + // 视图来说,只关心真正有窗口被激活的清空。 + // 因此,如果window对象为空,则不转发 + // 该信号 + if (window == nullptr) { + return; + } + if (window->isDesktop()) { + return; + } + + emit appWindowActivated(); +} + +void MultitaskViewModelByCompositeHandler::onDesktopPresenceChanged(KWin::EffectWindow *window, + int oldDesktopIndex, int newDesktopIndex) +{ + if (!shouldAcceptWindow(window)) { + return; + } + + emit appWindowDesktopChanged(getUuid(window).toString(), oldDesktopIndex, newDesktopIndex); +} + +void MultitaskViewModelByCompositeHandler::onNumberScreensChanged() +{ + emit screenCountChanged(); +} + +void MultitaskViewModelByCompositeHandler::connectSignals() +{ + QObject::connect(KWin::effects, &KWin::EffectsHandler::windowAdded, + this, &MultitaskViewModelByCompositeHandler::onWindowAdded); + QObject::connect(KWin::effects, &KWin::EffectsHandler::windowDeleted, + this, &MultitaskViewModelByCompositeHandler::onWindowDeleted); + QObject::connect(KWin::effects, &KWin::EffectsHandler::windowActivated, + this, &MultitaskViewModelByCompositeHandler::onWindowActivated); + QObject::connect(KWin::effects, &KWin::EffectsHandler::desktopPresenceChanged, + this, &MultitaskViewModelByCompositeHandler::onDesktopPresenceChanged); + QObject::connect(KWin::effects, SIGNAL(desktopChanged(int, int, KWin::EffectWindow*)), + this, SIGNAL(currentDesktopChanged(int, int))); + QObject::connect(KWin::effects, SIGNAL(numberDesktopsChanged(uint)), + this, SIGNAL(desktopNumberChanged())); + QObject::connect(KWin::effects, &KWin::EffectsHandler::virtualScreenSizeChanged, + this, &MultitaskViewModelByCompositeHandler::screenSizeChanged); +} diff --git a/windowsview/ukui-window-switch-kwineffect/multitaskviewmodelbycompositehandler.h b/windowsview/ukui-window-switch-kwineffect/multitaskviewmodelbycompositehandler.h new file mode 100644 index 0000000000000000000000000000000000000000..1694720d4111bf304ecd2e0ba9fc680e3591a9ee --- /dev/null +++ b/windowsview/ukui-window-switch-kwineffect/multitaskviewmodelbycompositehandler.h @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2024, KylinSoft Co., Ltd. + + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef MULTITASKVIEWMODELBYCOMPOSITEHANDLER_H +#define MULTITASKVIEWMODELBYCOMPOSITEHANDLER_H +#include "../multitaskviewabstractmodelhandler.h" +#include "../windowmanagerinterface.h" +#include +#include +#include +#include +#include +#include +#include +#include + +class MultitaskViewModelByCompositeHandler : public MultitaskViewAbstractModelHandler +{ + Q_OBJECT + +public: + explicit MultitaskViewModelByCompositeHandler(QObject *parent = nullptr); + ~MultitaskViewModelByCompositeHandler() = default; + + void removeAppWindow(QString windowId) override; + void moveAppWindowToDesktop(QString windowId, int srcDesktopInex, int destDesktopInex) override; + void activateAppWindow(QString windowId) override; + QIcon getWindowIcon(QString windowId) override; + void removeDesktop(int desktopIndex) override; + void moveDesktop(int srcDesktopIndex, int destDesktopIndex) override; + int getNumberOfDesktops() override; + void appendDesktop() override; + int getCurrentDesktop() override; + bool isCurrentDesktopShowingDesktop() override; + void setCurrentDesktop(int desktopIndex) override; + QRect getFullScreenGeometry(int desktopIndex, int screenIndex) override; + bool hasModalChildWindow(QString windowId) override; + bool isExtensionMode() override; + int logicalScreenCount() override; + QList createWindowList(int desktopIndex, int screenIndex) override; + QString getDesktopUuid(int desktopIndex) override; + QString getOutputUuid(int outputIndex) override; + void setDesktopName(const int desktopIndex, const QString name) override; +private: + static WId getWindowId(KWin::EffectWindow* window); + static QUuid getUuid(KWin::EffectWindow *window); + bool shouldAcceptWindow(KWin::EffectWindow* window); + void connectSignals(); + +private slots: + void onWindowAdded(KWin::EffectWindow* window); + void onWindowDeleted(KWin::EffectWindow* window); + void onWindowActivated(KWin::EffectWindow* window); + void onDesktopPresenceChanged(KWin::EffectWindow* window, int oldDesktopIndex, int newDesktopIndex); + void onNumberScreensChanged(); + +}; + + +#endif // MULTITASKVIEWMODELBYCOMPOSITEHANDLER_h diff --git a/windowsview/windowsview.json b/windowsview/ukui-window-switch-kwineffect/windowsview.json similarity index 100% rename from windowsview/windowsview.json rename to windowsview/ukui-window-switch-kwineffect/windowsview.json diff --git a/windowsview/ukui-window-switch-wlcom/CMakeLists.txt b/windowsview/ukui-window-switch-wlcom/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..743ed5aa675febdd6ad4cc91c805682cb3fd7447 --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/CMakeLists.txt @@ -0,0 +1,109 @@ +cmake_minimum_required(VERSION 3.16) + +# 调试多任务视图需要取消注释下面 +add_definitions("-Wall -g") + +project(ukui-window-switch-wlcom) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) + +set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +set(KF5_DEP_VERSION "5.54.0") + +find_package(ECM 5.54.0 NO_MODULE) +set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake) + +find_package(OpenGL) +find_package(EGL MODULE) +find_package(KF5Config REQUIRED) +find_package(KF5GlobalAccel REQUIRED) +find_package(KF5WindowSystem) +find_package(PkgConfig REQUIRED) +find_package(Qt5 REQUIRED NO_MODULE COMPONENTS Concurrent Quick Qml LinguistTools DBus REQUIRED) +find_package(ukui-search REQUIRED) +find_package(Qt5Xdg REQUIRED) +find_package(ukui-quick COMPONENTS platform) + +pkg_check_modules(KDK REQUIRED kysdk-sysinfo) +pkg_check_modules(DATACOLLECT REQUIRED kysdk-datacollect) +pkg_check_modules(GL REQUIRED gl) + +include_directories(${KDK_INCLUDE_DIRS}) +include_directories(${DATACOLLECT_INCLUDE_DIRS}) +include_directories(${OPENGL_INCLUDE_DIR}) +include_directories(${GL}) + + +set(WLCSRCS main.cpp + log-utils.h log-utils.cpp + ../desktopbackground.cpp + ../icontheme.cpp + multitaskviewmanagerbywlcom.cpp + dbusservice.cpp + ../windowmanagerinterface.cpp + ../multitaskviewabstractmodelhandler.h + multitaskviewmodelbywlcomhandler.cpp + context.cpp + toplevel.cpp + workspace.cpp + output.cpp + thumbnail.cpp + ThumbnailItem.cpp + discard-egl-pixmap-runnable.h + ../desktoplistmodel.h + ../desktoplistmodel.cpp + ../appwindowlistmodel.h + ../appwindowlistmodel.cpp + ../appwindowfiltermodel.h + ../appwindowfiltermodel.cpp + ../ukui-flow.cpp + ../ukui-flow.h + ../screens-manager.cpp + ../screens-manager.h +) + +add_subdirectory(qtsingleapplication) +include_directories(qtsingleapplication/src) + +qt5_add_resources(WLCSRCS ../data.qrc) + +add_executable(ukui-window-switch-wlcom + ${WLCSRCS} +) +target_include_directories(ukui-window-switch-wlcom PRIVATE ${Qt5Quick_PRIVATE_INCLUDE_DIRS}) +target_link_directories(ukui-window-switch-wlcom PRIVATE KF5::WindowSystem) + +target_compile_definitions(${PROJECT_NAME} PRIVATE $<$:DISABLE_LOG_FILE>) +target_compile_definitions(${PROJECT_NAME} PRIVATE $<$:QT_QML_DEBUG>) + +target_link_libraries( + ukui-window-switch-wlcom + PRIVATE + Qt5::Core + Qt5::GuiPrivate + Qt5::Quick + Qt5::QuickPrivate + KF5::WindowSystem + KF5::GlobalAccel + Qt5::Concurrent + Qt5::DBus + Qt5::Qml + Qt::QmlPrivate + qtsingleapplication + kywc + ${QGSettings_LIBRARIES} + ${KDK_LINK_LIBRARIES} + ${DATACOLLECT_LINK_LIBRARIES} + ${OPENGL_gl_LIBRARY} + ${EGL_LIBRARY} + ${GL_LIBRARIES} + ukui-search + Qt5Xdg + ukui-quick::platform +) + +install(TARGETS ukui-window-switch-wlcom DESTINATION /usr/bin) diff --git a/windowsview/ukui-window-switch-wlcom/ThumbnailItem.cpp b/windowsview/ukui-window-switch-wlcom/ThumbnailItem.cpp new file mode 100644 index 0000000000000000000000000000000000000000..50d06ea645b6d4f0221711fd3f52143d67cdce38 --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/ThumbnailItem.cpp @@ -0,0 +1,368 @@ +/* + * Copyright (C) 2024, KylinSoft Co., Ltd. + + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include +#include + +#include +#include + +#include "ThumbnailItem.h" + +#include +#include +#include + +#include +#include +#include + +#include "discard-egl-pixmap-runnable.h" + +class ThumbnailItem::Private +{ + public: + Private(ThumbnailItem *item); + ~Private(); + + void createEglImage(Thumbnail *thumbnail); + void imageFromMemfd(Thumbnail *thumbnail); + + EGLImage m_image = EGL_NO_IMAGE_KHR; + QImage image; + uint32_t format; + QString m_id; + QString m_outputid; + void *mem_ptr = nullptr; + Thumbnail::BufferFlags thumFlags = Thumbnail::BufferFlag::Dmabuf; + QScopedPointer m_texture; + + uint8_t *map = nullptr; + size_t dataSize = 0; + private: + ThumbnailItem *t; +}; + +ThumbnailItem::Private::Private(ThumbnailItem *item) : t(item) {} + +ThumbnailItem::Private::~Private() {} + +QSGNode *ThumbnailItem::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) +{ + QSGTexture *texture = NULL; + + if (pri->thumFlags & Thumbnail::BufferFlag::Dmabuf) { + if (pri->m_image == EGL_NO_IMAGE_KHR) { + QImage q_image(200, 200, QImage::Format_ARGB32_Premultiplied); + q_image.fill(Qt::transparent); + texture = window()->createTextureFromImage(q_image, QQuickWindow::TextureIsOpaque); + } else { + QOpenGLContext *context = window()->openglContext(); + if (!context || !context->isValid()) { + qWarning() << "OpenGL context is not valid."; + return NULL; + } + + if (!pri->m_texture) { + pri->m_texture.reset(new QOpenGLTexture(QOpenGLTexture::Target2D)); + bool created = pri->m_texture->create(); + Q_ASSERT(created); + } + + static auto s_glEGLImageTargetTexture2DOES = + (PFNGLEGLIMAGETARGETTEXTURE2DOESPROC)eglGetProcAddress( + "glEGLImageTargetTexture2DOES"); + if (!s_glEGLImageTargetTexture2DOES) { + qWarning() << "glEGLImageTargetTexture2DOES is not available" << window(); + return NULL; + } + pri->m_texture->bind(); + s_glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, (GLeglImageOES)pri->m_image); + + pri->m_texture->setWrapMode(QOpenGLTexture::ClampToEdge); + pri->m_texture->setMinMagFilters(QOpenGLTexture::Linear, QOpenGLTexture::Linear); + pri->m_texture->release(); + pri->m_texture->setSize(boundingRect().toRect().size().width(), boundingRect().toRect().size().height()); + + int textureId = pri->m_texture->textureId(); + + QQuickWindow::CreateTextureOption textureOption = + pri->format == DRM_FORMAT_ARGB8888 ? QQuickWindow::TextureHasAlphaChannel + : QQuickWindow::TextureIsOpaque; + texture = window()->createTextureFromNativeObject(QQuickWindow::NativeObjectTexture, + &textureId, 0 /*a vulkan thing?*/, + m_thumbnail->size(), textureOption); + } + } else { + if (pri->image.isNull()) { + qWarning() << "image.isNull() " << strerror(errno); + QImage errorImage(200, 200, QImage::Format_ARGB32_Premultiplied); + errorImage.fill(Qt::red); + pri->image = errorImage; + } + + if (pri->image.hasAlphaChannel()) { + texture = window()->createTextureFromImage(pri->image, QQuickWindow::TextureHasAlphaChannel); + } else { + texture = window()->createTextureFromImage(pri->image, QQuickWindow::TextureIsOpaque); + } + } + + QSGImageNode *textureNode = static_cast(oldNode); + if (!textureNode) { + textureNode = window()->createImageNode(); + textureNode->setOwnsTexture(true); + textureNode->setFiltering(QSGTexture::Linear); + } + textureNode->setTexture(texture); + + const auto br = boundingRect().toRect(); + textureNode->setRect(br); + + if (!m_connectedWindow) { + m_connectedWindow = true; + connect(window(), &QQuickWindow::afterRendering, this, &ThumbnailItem::onAfterRendering, + Qt::DirectConnection); + } + m_renderPending = true; + + return textureNode; +} + +ThumbnailItem::ThumbnailItem(QQuickItem *parent) : QQuickItem(parent), pri(new Private(this)) +{ + setFlag(ItemHasContents, true); // 必须设置,表明这个Item有内容需要绘制 + + QPlatformNativeInterface *native = QGuiApplication::platformNativeInterface(); + if (!native) { + return; + } + + m_display = reinterpret_cast( + native->nativeResourceForIntegration(QByteArrayLiteral("wl_display"))); + if (!m_display) { + qWarning("Failed to get Wayland display."); + return; + } +} + +void ThumbnailItem::onAfterRendering() +{ + if (m_renderPending) { + m_renderPending = false; + QMetaObject::invokeMethod(this, "onRenderCompleted", Qt::QueuedConnection); + } +} + +void ThumbnailItem::onRenderCompleted() +{ + m_thumbnail->release(true); +} + +ThumbnailItem::~ThumbnailItem() +{ + if(m_active && !m_thumbnailIsDeleted) { + if (pri->map) { + munmap(pri->map, pri->dataSize); + pri->map = nullptr; + } + m_thumbnail->destory(); + } + + if (pri) { + delete pri; + pri = nullptr; + } +} + +#define ADD_ATTRIB(name, value) \ + do { \ + attribs[num_attribs++] = (name); \ + attribs[num_attribs++] = (value); \ + attribs[num_attribs] = EGL_NONE; \ + } while (0) + +void ThumbnailItem::Private::createEglImage(Thumbnail *thumbnail) +{ + EGLDisplay display = EGL_NO_DISPLAY; + display = static_cast( + QGuiApplication::platformNativeInterface()->nativeResourceForIntegration("egldisplay")); + + if (display == EGL_NO_DISPLAY) { + qWarning() << "egl get display failed "; + return; + } + + if (m_image) { + if (thumFlags & Thumbnail::BufferFlag::Reused) + return; + static auto eglDestroyImageKHR = + (PFNEGLDESTROYIMAGEKHRPROC)eglGetProcAddress("eglDestroyImageKHR"); + eglDestroyImageKHR(display, m_image); + } + + EGLint attribs[20] = { EGL_NONE }; + int num_attribs = 0; + + ADD_ATTRIB(EGL_WIDTH, thumbnail->size().width()); + ADD_ATTRIB(EGL_HEIGHT, thumbnail->size().height()); + ADD_ATTRIB(EGL_LINUX_DRM_FOURCC_EXT, thumbnail->format()); + ADD_ATTRIB(EGL_DMA_BUF_PLANE0_FD_EXT, thumbnail->fd()); + ADD_ATTRIB(EGL_DMA_BUF_PLANE0_OFFSET_EXT, thumbnail->offset()); + ADD_ATTRIB(EGL_DMA_BUF_PLANE0_PITCH_EXT, thumbnail->stride()); + if (thumbnail->modifier() != DRM_FORMAT_MOD_INVALID) { + ADD_ATTRIB(EGL_DMA_BUF_PLANE0_MODIFIER_LO_EXT, thumbnail->modifier() & 0xFFFFFFFF); + ADD_ATTRIB(EGL_DMA_BUF_PLANE0_MODIFIER_HI_EXT, thumbnail->modifier() >> 32); + } + ADD_ATTRIB(EGL_IMAGE_PRESERVED_KHR, EGL_TRUE); + + format = thumbnail->format(); + + static auto eglCreateImageKHR = + (PFNEGLCREATEIMAGEKHRPROC)eglGetProcAddress("eglCreateImageKHR"); + Q_ASSERT(eglCreateImageKHR); + m_image = eglCreateImageKHR(display, EGL_NO_CONTEXT, EGL_LINUX_DMA_BUF_EXT, NULL, attribs); + if (m_image == EGL_NO_IMAGE_KHR) { + qWarning() << "invalid eglCreateImageKHR" << glGetError(); + } +} + +void ThumbnailItem::Private::imageFromMemfd(Thumbnail *thumbnail) +{ + if (thumFlags & Thumbnail::BufferFlag::Reused) + return; + + dataSize = thumbnail->size().height() * thumbnail->stride() + thumbnail->offset(); + map = static_cast(mmap(nullptr, dataSize, PROT_READ, MAP_PRIVATE, thumbnail->fd(), 0)); + + if (map == MAP_FAILED) { + qWarning() << "Failed to mmap the memory: " << strerror(errno); + return; + } +} + +void ThumbnailItem::BufferImportDmabuf() +{ + if(!m_thumbnail) { + return; + } + Thumbnail *thum = qobject_cast(sender()); + if (thum->flags() & Thumbnail::BufferFlag::Dmabuf) { + pri->createEglImage(thum); + } else { + pri->imageFromMemfd(thum); + if (pri->map) { + const QImage::Format qtFormat = thum->stride() / thum->size().width() == 3 + ? QImage::Format_RGB888 + : QImage::Format_ARGB32; + + QImage img(pri->map, thum->size().width(), thum->size().height(), thum->stride(), + qtFormat); + pri->image = img.copy(); + } + } + + pri->format = m_thumbnail->format(); + pri->thumFlags = m_thumbnail->flags(); + if(window() && window()->isVisible()) { + update(); + } +} + +void ThumbnailItem::setOutputId(QString outputId) +{ + pri->m_outputid = outputId; + emit outputIdChanged(); +} + +void ThumbnailItem::setWindowId(QString windowId) +{ + if (pri->m_id != windowId) { + pri->m_id = windowId; + active(!windowId.isEmpty()); + emit windowIdChanged(); + } +} + +void ThumbnailItem::setThumbnailType(int type) +{ + m_thumbnailType = type; + emit thumbnailTypeChanged(); +} + +void ThumbnailItem::releaseResources() +{ + if(window()) { + window()->scheduleRenderJob(new DiscardEglPixmapRunnable(pri->m_image, pri->m_texture.take()), QQuickWindow::NoStage); + pri->m_image = EGL_NO_IMAGE_KHR; + } +} + +QString ThumbnailItem::outputId() const +{ + return pri->m_outputid; +} + +QString ThumbnailItem::windowId() const +{ + return pri->m_id; +} + +void ThumbnailItem::active(bool active) +{ + if(active && !pri->m_id.isEmpty()) { + if((m_currentUuid == pri->m_id && m_active) || !isVisible()) { + return; + } + if(!context) { + context = new Context(m_display, Context::Capability::Thumbnail, this); + context->start(); + } + if(!m_thumbnail) { + m_thumbnail = new Thumbnail(this); + connect(m_thumbnail, &Thumbnail::bufferUpdate, this, &ThumbnailItem::BufferImportDmabuf); + connect(m_thumbnail, &Thumbnail::deleted, this, &ThumbnailItem::thumbnailIsDeleted); + + } + context->thumbnail_init(m_thumbnail, (Thumbnail::Type)m_thumbnailType, pri->m_id, pri->m_outputid); + m_active = true; + m_currentUuid = pri->m_id; + m_thumbnailIsDeleted = false; + } else { + if(m_active && !m_thumbnailIsDeleted) { + if (pri->map) { + munmap(pri->map, pri->dataSize); + pri->map = nullptr; + } + m_thumbnail->destory(); + } + } +} + +void ThumbnailItem::thumbnailIsDeleted() +{ + releaseResources(); + m_thumbnailIsDeleted = true; + m_thumbnail = nullptr; + m_active = false; + m_currentUuid = ""; + + pri->format = 0; + pri->thumFlags = {}; +} diff --git a/windowsview/ukui-window-switch-wlcom/ThumbnailItem.h b/windowsview/ukui-window-switch-wlcom/ThumbnailItem.h new file mode 100644 index 0000000000000000000000000000000000000000..1788f12c38611abcbf5b5e3a48173e4bf517f9a3 --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/ThumbnailItem.h @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2024, KylinSoft Co., Ltd. + + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef THUMBNAILITEM_H +#define THUMBNAILITEM_H + +#include +#include + +#include "context.h" + +class ThumbnailItem : public QQuickItem +{ + Q_OBJECT + Q_PROPERTY(QString windowId READ windowId WRITE setWindowId NOTIFY windowIdChanged) + Q_PROPERTY(QString outputId READ outputId WRITE setOutputId NOTIFY outputIdChanged) + Q_PROPERTY(int thumbnailType READ thumbnailType WRITE setThumbnailType NOTIFY thumbnailTypeChanged) + + public: + explicit ThumbnailItem(QQuickItem *parent = nullptr); + ~ThumbnailItem(); + + QString windowId() const; + void setWindowId(QString windowId); + + QString outputId() const; + void setOutputId(QString outputId); + + int thumbnailType() { return m_thumbnailType; } + void setThumbnailType(int type); + bool isActive() { return m_active; } + + void releaseResources() override; + + signals: + void windowIdChanged(); + void outputIdChanged(); + void thumbnailTypeChanged(); + + protected: + QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) override; + + private Q_SLOTS: + void BufferImportDmabuf(); + void thumbnailIsDeleted(); + void onAfterRendering(); + void onRenderCompleted(); + + private: + void active(bool active); + + class Private; + Private *pri; + Context *context = nullptr; + Thumbnail *m_thumbnail = nullptr; + int m_thumbnailType = 1; + bool m_active = false; + bool m_thumbnailIsDeleted = false; + QString m_currentUuid; + wl_display *m_display = nullptr; + bool m_renderPending = false; + bool m_connectedWindow = false; +}; + +#endif // ThumbnailItem_H diff --git a/windowsview/ukui-window-switch-wlcom/context.cpp b/windowsview/ukui-window-switch-wlcom/context.cpp new file mode 100644 index 0000000000000000000000000000000000000000..72a3694d0a26b6a36f2008755a5e5123628ffc5f --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/context.cpp @@ -0,0 +1,194 @@ +/* + * Copyright (C) 2024, KylinSoft Co., Ltd. + + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "context.h" +#include +#include +#include + +class Context::Private +{ + public: + Private(Context *context); + ~Private(); + kywc_context *setup(uint32_t capability); + + kywc_context *k_context = nullptr; + QSocketNotifier *notifier = nullptr; + struct wl_display *display = NULL; + uint32_t capabilities = 0; + + private: + Context *ctx; + static void createHandle(kywc_context *context, void *data); + static void destroyHandle(kywc_context *context, void *data); + static void newOutput(kywc_context *context, kywc_output *output, void *data); + static void newToplevel(kywc_context *context, kywc_toplevel *toplevel, void *data); + static void newWorkspace(kywc_context *context, kywc_workspace *workspace, void *data); + static struct kywc_context_interface context_impl; +}; + +Context::Private::Private(Context *context) : ctx(context) {} + +Context::Private::~Private() {} + +void Context::Private::createHandle(kywc_context *context, void *data) +{ + Context::Private *p = (Context::Private *)data; + emit p->ctx->created(); +} + +void Context::Private::destroyHandle(kywc_context *context, void *data) +{ + Context::Private *p = (Context::Private *)data; + emit p->ctx->destroyed(); +} + +void Context::Private::newOutput(kywc_context *context, kywc_output *output, void *data) +{ + Context::Private *p = (Context::Private *)data; + Output *o = new Output(p->ctx); + o->setup(output); + emit p->ctx->outputAdded(o); +} + +void Context::Private::newToplevel(kywc_context *context, kywc_toplevel *toplevel, void *data) +{ + Context::Private *p = (Context::Private *)data; + Toplevel *t = new Toplevel(p->ctx); + t->setup(toplevel); + emit p->ctx->toplevelAdded(t); +} + +void Context::Private::newWorkspace(kywc_context *context, kywc_workspace *workspace, void *data) +{ + Context::Private *p = (Context::Private *)data; + Workspace *w = new Workspace(p->ctx); + w->setup(workspace); + emit p->ctx->workespaceAdded(w); +} + +struct kywc_context_interface Context::Private::context_impl = { + createHandle, destroyHandle, newOutput, newToplevel, newWorkspace, +}; + + +kywc_context *Context::Private::setup(uint32_t capabilities) +{ + if (!display) + k_context = kywc_context_create(NULL, capabilities, &context_impl, this); + else + k_context = kywc_context_create_by_display(display, capabilities, &context_impl, this); + return k_context; +} + +Context::Context( struct wl_display *display, Capabilities caps, QObject *parent) + : QObject{parent} + , pri(new Private(this)) +{ + pri->display = display; + + uint32_t capabilities = 0; + if (caps & Context::Capability::Output) + capabilities |= KYWC_CONTEXT_CAPABILITY_OUTPUT; + if (caps & Context::Capability::Toplevel) + capabilities |= KYWC_CONTEXT_CAPABILITY_TOPLEVEL; + if (caps & Context::Capability::Workspace) + capabilities |= KYWC_CONTEXT_CAPABILITY_WORKSPACE; + if (caps & Context::Capability::Thumbnail) + capabilities |= KYWC_CONTEXT_CAPABILITY_THUMBNAIL; + pri->capabilities = capabilities; +} + +Context::~Context() { + kywc_context_destroy(pri->k_context); + if(pri) { + delete pri; + pri = nullptr; + } +} + +void Context::start() +{ + kywc_context *ctx = NULL; + + if (!pri->display) { + ctx = pri->setup(pri->capabilities); + if (!ctx) { + return; + } + pri->notifier = new QSocketNotifier(kywc_context_get_fd(ctx), QSocketNotifier::Read, this); + connect(pri->notifier, &QSocketNotifier::activated, this, &Context::onContextReady); + + kywc_context_process(ctx); + } else { + ctx = pri->setup(pri->capabilities); + if (!ctx) { + return; + } + } +} + +void Context::onContextReady() +{ + if (kywc_context_process(pri->k_context) < 0) { + disconnect(pri->notifier, &QSocketNotifier::activated, this, &Context::onContextReady); + emit aboutToTeardown(); + exit(-1); + } +} + +void Context::dispatch() +{ + kywc_context_dispatch(pri->k_context); +} + +void Context::addWorkspace(uint32_t position) +{ + kywc_workspace_create(pri->k_context, NULL, position); +} + +Workspace *Context::findWorkspace(QString uuid) +{ + QByteArray qByteArray = uuid.toUtf8(); + char *str = qByteArray.data(); + kywc_workspace *workspace = kywc_context_find_workspace(pri->k_context, str); + return (Workspace *)kywc_workspace_get_user_data(workspace); +} + +Output *Context::findOutput(QString uuid) +{ + QByteArray qByteArray = uuid.toUtf8(); + char *str = qByteArray.data(); + kywc_output *output = kywc_context_find_output(pri->k_context, str); + return (Output *)kywc_output_get_user_data(output); +} + +Toplevel *Context::findToplevel(QString uuid) +{ + QByteArray qByteArray = uuid.toUtf8(); + char *str = qByteArray.data(); + kywc_toplevel *toplevel = kywc_context_find_toplevel(pri->k_context, str); + return (Toplevel *)kywc_toplevel_get_user_data(toplevel); +} + +void Context::thumbnail_init(Thumbnail *thumbnail, Thumbnail::Type type, QString uuid, QString output_uuid) +{ + thumbnail->setup(pri->k_context, type, uuid, output_uuid); +} diff --git a/windowsview/ukui-window-switch-wlcom/context.h b/windowsview/ukui-window-switch-wlcom/context.h new file mode 100644 index 0000000000000000000000000000000000000000..ba980e5ab143c436b89daf61ea4d36a7310af438 --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/context.h @@ -0,0 +1,298 @@ +/* + * Copyright (C) 2024, KylinSoft Co., Ltd. + + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef CONTEXT_H +#define CONTEXT_H + +#include +#include +#include +#include + +typedef struct _kywc_context kywc_context; +typedef struct _kywc_output kywc_output; +typedef struct _kywc_toplevel kywc_toplevel; +typedef struct _kywc_workspace kywc_workspace; +typedef struct _kywc_thumbnail kywc_thumbnail; + +class Workspace : public QObject +{ + Q_OBJECT + public: + enum class Mask { + Name = 1 << 0, + Position = 1 << 1, + Activated = 1 << 2, + }; + Q_DECLARE_FLAGS(Masks, Mask); + + explicit Workspace(QObject *parent = nullptr); + ~Workspace(); + + void setup(kywc_workspace *workspace); + QString name() const; + QString uuid() const; + int position() const; + bool isActivated() const; + + void setActivate(); + void move(int position); + void remove(); + void setName(const QString name); + + Q_SIGNALS: + void stateUpdated(Workspace::Masks mask); + void deleted(); + + private: + class Private; + Private *pri; +}; + +Q_DECLARE_OPERATORS_FOR_FLAGS(Workspace::Masks) + +class Output : public QObject +{ + Q_OBJECT + public: + struct Mode { + QSize size; + int32_t refresh; // mHz + bool preferred; + }; + + enum class Capability { + Power = 1 << 0, + Brightness = 1 << 1, + ColorTemp = 1 << 2, + }; + Q_DECLARE_FLAGS(Capabilities, Capability); + + enum class Mask { + Enabled = 1 << 0, + Mode = 1 << 1, + Position = 1 << 2, + Transform = 1 << 3, + Scale = 1 << 4, + Power = 1 << 5, + Primary = 1 << 6, + Brightness = 1 << 7, + ColorTemp = 1 << 8, + }; + Q_DECLARE_FLAGS(Masks, Mask); + + explicit Output(QObject *parent = nullptr); + ~Output(); + + void setup(kywc_output *output); + QString name() const; + QString uuid() const; + QString make() const; + QString model() const; + QString serial() const; + QString description() const; + QSize physicalSize() const; + Output::Capabilities capabilities() const; + QList modes() const; + Output::Mode curMode() const; + QPoint point() const; + QSize size() const; + int transform() const; + float scale() const; + bool isEnabled() const; + bool isPower() const; + bool isPrimary() const; + uint32_t brightness() const; + uint32_t colorTemp() const; + + Q_SIGNALS: + void stateUpdated(Output::Masks mask); + void deleted(); + + private: + class Private; + Private *pri; +}; + +Q_DECLARE_OPERATORS_FOR_FLAGS(Output::Capabilities) +Q_DECLARE_OPERATORS_FOR_FLAGS(Output::Masks) + +class Toplevel : public QObject +{ + Q_OBJECT + public: + enum class Capability { + Taskbar = 1 << 0, + Switcher = 1 << 1, + }; + Q_DECLARE_FLAGS(Capabilities, Capability); + + enum class Mask { + AppId = 1 << 0, + Title = 1 << 1, + Activated = 1 << 2, + Minimized = 1 << 3, + Maximized = 1 << 4, + Fullscreen = 1 << 5, + PrimaryOutput = 1 << 6, + Workspace = 1 << 7, + Parent = 1 << 8, + Icon = 1 << 9, + Position = 1 << 10, + Size = 1 << 11, + }; + Q_DECLARE_FLAGS(Masks, Mask) + + explicit Toplevel(QObject *parent = nullptr); + ~Toplevel(); + + void setup(kywc_toplevel *toplevel); + QString uuid() const; + QString title() const; + QString icon() const; + QString appId() const; + QPointer parent() const; + QString primaryOutput() const; + QStringList workspaces() const; + QPoint point() const; + QSize size() const; + Toplevel::Capabilities capabilities() const; + bool isActivated() const; + bool isMinimized() const; + bool isMaximized() const; + bool isFullscreen() const; + uint32_t pid() const; + + void setMaximized(QString output); + void setMinimized(); + void unsetMaximized(); + void unsetMinimized(); + void setFullscreen(QString output); + void unsetFullscreen(); + void setActivate(); + void close(); + void enterWorkspace(QString workspace); + void leaveWorkspace(QString workspace); + void moveToWorkspace(QString workspace); + void moveToOutput(QString output); + + bool hasChildren(); + + void setDesktopFile(const QString &desktopFile); + QString iconName() const; + QString name() const; + + Q_SIGNALS: + void stateUpdated(Toplevel::Masks mask); + void deleted(); + + private: + class Private; + Private *pri; +}; + +Q_DECLARE_OPERATORS_FOR_FLAGS(Toplevel::Capabilities) +Q_DECLARE_OPERATORS_FOR_FLAGS(Toplevel::Masks) + +class Thumbnail : public QObject +{ + Q_OBJECT + public: + enum Type{ + Output, + Toplevel, + Workspace, + }; + + enum BufferFlag { + Dmabuf = 1 << 0, + Reused = 1 << 1, + }; + Q_DECLARE_FLAGS(BufferFlags, BufferFlag); + + explicit Thumbnail(QObject *parent = nullptr); + ~Thumbnail(); + + void setup(kywc_context *ctx, Thumbnail::Type type, QString uuid, QString output_uuid); + void release(bool wants_buffer); + void destory(); + + int32_t fd() const; + uint32_t format() const; + QSize size() const; + uint32_t offset() const; + uint32_t stride() const; + uint64_t modifier() const; + Thumbnail::BufferFlags flags() const; + + Q_SIGNALS: + void bufferUpdate(); + void deleted(); + + private: + class Private; + Private *pri; +}; + +Q_DECLARE_OPERATORS_FOR_FLAGS(Thumbnail::BufferFlags) + +class Context : public QObject +{ + Q_OBJECT + public: + enum class Capability { + Output = 1 << 0, + Toplevel = 1 << 1, + Workspace = 1 << 2, + Thumbnail = 1 << 3, + }; + Q_DECLARE_FLAGS(Capabilities, Capability) + + explicit Context(struct wl_display *display, Capabilities caps, QObject *parent = nullptr); + ~Context(); + + void start(); + void thumbnail_init(Thumbnail *thumbnail, Thumbnail::Type type, QString uuid, QString output_uuid); + + void addWorkspace(uint32_t position); + Workspace *findWorkspace(QString uuid); + Output *findOutput(QString uuid); + Toplevel *findToplevel(QString uuid); + + void dispatch(); + Q_SIGNALS: + void aboutToTeardown(); + + void created(); + void destroyed(); + void workespaceAdded(Workspace *workspace); + void outputAdded(Output *output); + void toplevelAdded(Toplevel *toplevel); + + private Q_SLOTS: + void onContextReady(); + + private: + class Private; + Private *pri; +}; + +Q_DECLARE_OPERATORS_FOR_FLAGS(Context::Capabilities) + +#endif // CONTEXT_H diff --git a/windowsview/ukui-window-switch-wlcom/dbusservice.cpp b/windowsview/ukui-window-switch-wlcom/dbusservice.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6288a1048c76ed359f17bd1a040e1b12406f92db --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/dbusservice.cpp @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2022, KylinSoft Co., Ltd. + + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "dbusservice.h" + +#include "multitaskviewmanagerbywlcom.h" + +DBusService::DBusService(MultitaskViewManagerByWlcom *viewManager, QObject *parent) + : QObject(parent), + m_viewManager(viewManager), + m_connection(QDBusConnection::sessionBus()) +{ + startService(); +} + +DBusService::~DBusService() +{ + stopService(); +} + +bool DBusService::startService() +{ + return m_connection.registerService(m_serviceName) & m_connection.registerObject(m_servicePath, this, QDBusConnection::ExportAllSlots); +} + +bool DBusService::stopService() +{ + m_connection.unregisterObject(m_servicePath); + return m_connection.unregisterService(m_serviceName); +} + +void DBusService::show() +{ + m_viewManager->open(); +} + +void DBusService::hide() +{ + m_viewManager->close(); +} diff --git a/windowsview/ukui-window-switch-wlcom/dbusservice.h b/windowsview/ukui-window-switch-wlcom/dbusservice.h new file mode 100644 index 0000000000000000000000000000000000000000..f3ed9c3ba6b066e334582f50dd7efcb8ea338d62 --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/dbusservice.h @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2022, KylinSoft Co., Ltd. + + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef DBUSSERVICE_H +#define DBUSSERVICE_H + +#include +#include +#include + +// 前置声明。解决dbusservice.h和multitaskviewmanager.h +// 相互引用引发QtCreator提示DBusService类型找不到的问题 +class MultitaskViewManagerByWlcom; + +class DBusService : public QObject +{ + Q_OBJECT + + Q_CLASSINFO("D-Bus Interface", "org.kylin.switch.MultitaskView") + +public: + DBusService(MultitaskViewManagerByWlcom* viewManager, + QObject *parent = nullptr); + ~DBusService(); + +public slots: + void show(); + void hide(); + +private: + bool startService(); + bool stopService(); + +private: + MultitaskViewManagerByWlcom* m_viewManager = nullptr; + QString m_serviceName = "org.kylin.switch"; + QString m_servicePath = "/MultitaskView"; + QDBusConnection m_connection; +}; + + +#endif // DBUSSERVICE_H diff --git a/windowsview/ukui-window-switch-wlcom/discard-egl-pixmap-runnable.h b/windowsview/ukui-window-switch-wlcom/discard-egl-pixmap-runnable.h new file mode 100644 index 0000000000000000000000000000000000000000..9d7d46699178065346b51e36b329a0c9b4024f7c --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/discard-egl-pixmap-runnable.h @@ -0,0 +1,51 @@ +/* + * * Copyright (C) 2024, KylinSoft Co., Ltd. + * * + * * This program is free software: you can redistribute it and/or modify + * * it under the terms of the GNU General Public License as published by + * * the Free Software Foundation, either version 3 of the License, or + * * (at your option) any later version. + * * + * * This program is distributed in the hope that it will be useful, + * * but WITHOUT ANY WARRANTY; without even the implied warranty of + * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * * GNU General Public License for more details. + * * + * * You should have received a copy of the GNU General Public License + * * along with this program. If not, see . + * * + * * Authors: iaom + * + */ + +#ifndef UKUI_QUICK_DISCARD_EGL_PIXMAP_RUNNABLE_H +#define UKUI_QUICK_DISCARD_EGL_PIXMAP_RUNNABLE_H +#include +#include +#include +#include + +class DiscardEglPixmapRunnable : public QRunnable +{ +public: + DiscardEglPixmapRunnable(EGLImageKHR image, QOpenGLTexture *texture) + : m_image(image) + , m_texture(texture) + { + } + + void run() override + { + if (m_image != EGL_NO_IMAGE_KHR) { + static auto eglDestroyImageKHR = (PFNEGLDESTROYIMAGEKHRPROC)eglGetProcAddress("eglDestroyImageKHR"); + eglDestroyImageKHR(eglGetCurrentDisplay(), m_image); + } + + delete m_texture; + } + +private: + const EGLImageKHR m_image; + QOpenGLTexture *m_texture; +}; +#endif //UKUI_QUICK_DISCARD_EGL_PIXMAP_RUNNABLE_H diff --git a/windowsview/ukui-window-switch-wlcom/log-utils.cpp b/windowsview/ukui-window-switch-wlcom/log-utils.cpp new file mode 100644 index 0000000000000000000000000000000000000000..874a8a9464cd3245d29f733a0b93564e56aba4cc --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/log-utils.cpp @@ -0,0 +1,138 @@ +/* + * Copyright (C) 2024, KylinSoft Co., Ltd. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * Authors: iaom + * + */ + +#include "log-utils.h" +#include +#include +#include +#include +#include + +#define LOG_FILE_COUNT 2 +#define MAX_LOG_FILE_SIZE 4194304 +#define MAX_LOG_CHECK_INTERVAL 43200000 + +quint64 LogUtils::m_startUpTime = 0; +int LogUtils::m_logFileId = -1; +QString LogUtils::m_logFileName; +QString LogUtils::m_currentLogFile; +static QString logFilePath = QStandardPaths::writableLocation(QStandardPaths::HomeLocation) + "/.log/ukui-window-switch/"; + +void LogUtils::messageOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg) +{ + checkLogFile(); + + QByteArray localMsg = msg.toLocal8Bit(); + QByteArray currentTime = QTime::currentTime().toString().toLocal8Bit(); + const char *file = context.file ? context.file : ""; + const char *function = context.function ? context.function : ""; + + FILE *log_file = fopen(m_currentLogFile.toLocal8Bit().constData(), "a+"); + + switch (type) { + case QtDebugMsg: + if (!log_file) { + break; + } + fprintf(log_file, "Debug: %s: %s (%s:%u, %s)\n", currentTime.constData(), localMsg.constData(), file, context.line, function); + break; + case QtInfoMsg: + fprintf(log_file? log_file: stdout, "Info: %s: %s (%s:%u, %s)\n", currentTime.constData(), localMsg.constData(), file, context.line, function); + break; + case QtWarningMsg: + fprintf(log_file? log_file: stderr, "Warning: %s: %s (%s:%u, %s)\n", currentTime.constData(), localMsg.constData(), file, context.line, function); + break; + case QtCriticalMsg: + fprintf(log_file? log_file: stderr, "Critical: %s: %s (%s:%u, %s)\n", currentTime.constData(), localMsg.constData(), file, context.line, function); + break; + case QtFatalMsg: + fprintf(log_file? log_file: stderr, "Fatal: %s: %s (%s:%u, %s)\n", currentTime.constData(), localMsg.constData(), file, context.line, function); + break; + } + + if (log_file) { + fclose(log_file); + } +} + +void LogUtils::initLogFile(const QString &fileName) +{ + QDir dir; + if (!dir.exists(logFilePath)) { + if (!dir.mkpath(logFilePath)) { + qWarning() << "Unable to create" << logFilePath; + return; + } + } + m_logFileName = logFilePath + fileName + "-%1.log"; + + for (int i = 0; i < LOG_FILE_COUNT; ++i) { + m_currentLogFile = m_logFileName.arg(i); + if (QFile::exists(m_currentLogFile)) { + if (checkFileSize(m_currentLogFile)) { + m_logFileId = i; + break; + } + } else { + QFile file(m_currentLogFile); + file.open(QIODevice::WriteOnly); + file.close(); + } + } + + + if (m_logFileId < 0) { + m_logFileId = 0; + m_currentLogFile = m_logFileName.arg(m_logFileId); + clearFile(m_currentLogFile); + } + + qInfo() << "Current log file:" << m_currentLogFile; +} + +void LogUtils::checkLogFile() +{ + quint64 logTime = QDateTime::currentDateTime().toMSecsSinceEpoch(); + quint64 spacing = std::max(logTime, m_startUpTime) - std::min(logTime, m_startUpTime); + + if (spacing <= MAX_LOG_CHECK_INTERVAL || checkFileSize(m_currentLogFile)) { + return; + } + + m_logFileId = ((m_logFileId + 1) % LOG_FILE_COUNT); + m_currentLogFile = m_logFileName.arg(m_logFileId); + if (!checkFileSize(m_currentLogFile)) { + clearFile(m_currentLogFile); + } +} + +bool LogUtils::checkFileSize(const QString &fileName) +{ + return QFile(fileName).size() < MAX_LOG_FILE_SIZE; +} + +void LogUtils::clearFile(const QString &fileName) +{ + QFile file(fileName); + file.open(QIODevice::WriteOnly); + file.write(""); + file.flush(); + file.close(); +} diff --git a/windowsview/ukui-window-switch-wlcom/log-utils.h b/windowsview/ukui-window-switch-wlcom/log-utils.h new file mode 100644 index 0000000000000000000000000000000000000000..dccf1d0363fee3bcb814a73ebea2bc3029386257 --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/log-utils.h @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2024, KylinSoft Co., Ltd. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * Authors: iaom + * + */ + +#ifndef LOGUTILS_H +#define LOGUTILS_H +#include + +class LogUtils +{ +public: + static void initLogFile(const QString &fileName); + static void messageOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg); + +private: + static void checkLogFile(); + static bool checkFileSize(const QString &fileName); + static void clearFile(const QString &fileName); + static quint64 m_startUpTime; + static int m_logFileId; + static QString m_logFileName; + static QString m_currentLogFile; +}; + +#endif // LOGUTILS_H diff --git a/windowsview/ukui-window-switch-wlcom/main.cpp b/windowsview/ukui-window-switch-wlcom/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5ed9a40f15879f5bcacf9d2f0552249e8919b11d --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/main.cpp @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2024, KylinSoft Co., Ltd. + + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include +#include +#include +#include +#include +#include "qtsingleapplication.h" +#include "context.h" +#include "multitaskviewmanagerbywlcom.h" +#include "log-utils.h" + +int main(int argc, char *argv[]) +{ +#ifndef DISABLE_LOG_FILE + LogUtils::initLogFile("ukui-window-switch-wlcom"); + qInstallMessageHandler(LogUtils::messageOutput); +#endif + +#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) + QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); +#endif +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough); +#endif + + QtSingleApplication a(argc, argv); + QCommandLineParser parser; + QCommandLineOption showWorkSpaceOption("show-workspace","show multitaskView"); + parser.addOption(showWorkSpaceOption); + parser.process(a); + if (a.isRunning()) + { + if (parser.isSet(showWorkSpaceOption)) { + a.sendMessage(QApplication::arguments().length() > 1 ? QApplication::arguments().at(1) : a.applicationFilePath()); + } + return EXIT_SUCCESS; + } + + MultitaskViewManagerByWlcom m; + if (parser.isSet(showWorkSpaceOption)) { + m.open(); + } + QObject::connect(&a, &QtSingleApplication::messageReceived, [&m](){ + m.open(); + }); + return QtSingleApplication::exec(); +} diff --git a/windowsview/ukui-window-switch-wlcom/manager.cpp b/windowsview/ukui-window-switch-wlcom/manager.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3ca5d0f2ed0283ac97d74c6652287cd38efcafd7 --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/manager.cpp @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2024, KylinSoft Co., Ltd. + + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "manager.h" +#include + +manager::manager() +{ + m_view.reset(new QQuickView()); + m_view->show(); + m_view->setSource(QUrl("")); + m_view->setGeometry(QRect(0,0,1000,1000)); +} diff --git a/windowsview/ukui-window-switch-wlcom/manager.h b/windowsview/ukui-window-switch-wlcom/manager.h new file mode 100644 index 0000000000000000000000000000000000000000..f70b53fe1e5da18598d76779a96b6374be0c6541 --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/manager.h @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2024, KylinSoft Co., Ltd. + + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef MANAGER_H +#define MANAGER_H +#include +#include +#include +#include +#include "context.h" + +class manager : public QObject +{ + Q_OBJECT +public: + manager(); + kywc_context *ctx = nullptr; + std::unique_ptr m_view = nullptr; +}; + +#endif // MANAGER_H diff --git a/windowsview/ukui-window-switch-wlcom/multitaskviewmanagerbywlcom.cpp b/windowsview/ukui-window-switch-wlcom/multitaskviewmanagerbywlcom.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0e755556e65cae2078d2202f37b25d4593d762bc --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/multitaskviewmanagerbywlcom.cpp @@ -0,0 +1,648 @@ +/* + * Copyright (C) 2024, KylinSoft Co., Ltd. + + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "multitaskviewmanagerbywlcom.h" + +// kf5 +#include + +// kysdk +#include +#include + +// Qt +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +//ukui-quick +#include + +#include "../windowmanagerinterface.h" +#include "../desktopbackground.h" +#include "../icontheme.h" +#include "ThumbnailItem.h" +#include "../appwindowfiltermodel.h" +#include "../ukui-flow.h" + +bool MultitaskViewManagerByWlcom::m_isOpenGLBackend = true; +bool MultitaskViewManagerByWlcom::isOpen = false; +bool MultitaskViewManagerByWlcom::m_isEffect = false; + +#define CONTROL_CENTER_SETTING "org.ukui.control-center.personalise" +#define CONTROL_CENTER_EFFECT_KEY "effect" + +MultitaskViewManagerByWlcom::MultitaskViewManagerByWlcom() +{ + initializeProjectType(); + registerQmlTypes(); + registerShortcut(); + initDBusService(); + installTranslator(); + initGuiLayouDirection(); + initEffect(); + WindowManagerInterface::getInstance(); + + const QByteArray id("org.mate.background"); + if(QGSettings::isSchemaInstalled(id)){ + QGSettings * backgSetting = new QGSettings(id, QByteArray(), this); + connect(backgSetting, &QGSettings::changed,[=](QString key) { + if ("pictureFilename" == key) { + updateDesktopBackground(); + } + }); + } + updateDesktopBackground(); + initModel(); + initView(); + connectSignals(); +} + +MultitaskViewManagerByWlcom::~MultitaskViewManagerByWlcom() +{ + close(); + destroyView(); + if (m_translator) { + m_translator->deleteLater(); + m_translator = nullptr; + } +} + +bool MultitaskViewManagerByWlcom::isCursorNavigationKey(const int &key) const +{ + if (key == Qt::Key_Tab || key == Qt::Key_Left || + key == Qt::Key_Right || key == Qt::Key_Up || + key == Qt::Key_Down || key == Qt::Key_Home || + key == Qt::Key_End || key == Qt::Key_PageUp || + key == Qt::Key_PageDown) { + return true; + } + return false; +} + +void MultitaskViewManagerByWlcom::activeAreaChangeDataCollect(const QString &areaName) +{ + QByteArray name = areaName.toLatin1(); + QtConcurrent::run([name]() { + const char* text = name.data(); + KCustomProperty property[1]; + property[0].key = (char*)"activeAreaName"; + property[0].value = (char*)text; + KTrackData *node = kdk_dia_data_init(KEVENTSOURCE_DESKTOP, KEVENT_CUSTOM); + kdk_dia_append_custom_property(node, property, 1); + kdk_dia_upload_default(node, (char*)"keyboard_navigation_active_area_changed_event", (char*)"ukui-window-switch"); + kdk_dia_data_free(node); + }); +} + +bool MultitaskViewManagerByWlcom::isAltKeyPressed() +{ + return QGuiApplication::queryKeyboardModifiers() & Qt::KeyboardModifier::AltModifier; +} + +void MultitaskViewManagerByWlcom::keyNavigationDataCollect(const int &keyValue) +{ + if (!isCursorNavigationKey(keyValue)) { + return; + } + + QByteArray name = QKeySequence(keyValue).toString().toLatin1(); + QtConcurrent::run([name]() { + const char* text = name.data(); + KCustomProperty property[1]; + property[0].key = (char*)"keyName"; + property[0].value = (char*)text; + KTrackData *node = kdk_dia_data_init(KEVENTSOURCE_DESKTOP, KEVENT_CLICK); + kdk_dia_append_custom_property(node, property, 1); + kdk_dia_upload_default(node, (char*)"keyboard_navigation_event", (char*)"ukui-window-switch"); + kdk_dia_data_free(node); + }); +} + +void MultitaskViewManagerByWlcom:: open() +{ + if (isOpen) { + close(); + return; + } + qDebug() << "开启多任务视图" << __FUNCTION__ << __LINE__ << isOpen; + + // 可旋转的机器,多任务视图打开的时候,禁用旋转 + if(m_isLoadTabletModeQML && getRotationModeStatus()) { + setRotationModeStatus(!m_isAutoRotateBeforeShowMultiTask); + } + m_isShowTabBorder = false; + + showTaskView(); + isOpen = true; + + QtConcurrent::run([]() { + KTrackData *node = kdk_dia_data_init(KEVENTSOURCE_DESKTOP, KEVENT_CUSTOM); + kdk_dia_upload_default(node, (char*)"ukui_window_switch_start_event", (char*)"ukui-window-switch"); + kdk_dia_data_free(node); + }); +} + +void MultitaskViewManagerByWlcom::openTab() +{ + if (isOpen) { + int currentIndex = m_tabView->rootObject()->property("currentIndex").toInt(); + int allcount = m_appWindowListModel->rowCount(); + if (currentIndex + 1 == allcount) { + currentIndex = 0; + } else { + currentIndex++; + } + m_tabView->rootObject()->setProperty("currentIndex", currentIndex); + return; + } + + qDebug() << "正向遍历窗口" << __FUNCTION__ << __LINE__ << isOpen; + m_isBackTab = false; + + // 可旋转的机器,多任务视图打开的时候,禁用旋转 + if(m_isLoadTabletModeQML && getRotationModeStatus()) { + setRotationModeStatus(!m_isAutoRotateBeforeShowMultiTask); + } + if (m_appWindowListModel->rowCount() == 0) { + return; + } + + showTabView(); + + isOpen = true; +} + +void MultitaskViewManagerByWlcom::openBackTab() +{ + if (isOpen) { + int currentIndex = m_tabView->rootObject()->property("currentIndex").toInt(); + if (currentIndex == 0) { + currentIndex = m_appWindowListModel->rowCount() - 1; + } else { + currentIndex--; + } + m_tabView->rootObject()->setProperty("currentIndex", currentIndex); + return; + } + + qDebug() << "反向遍历窗口" << __FUNCTION__ << __LINE__ << isOpen; + m_isBackTab = true; + + // 可旋转的机器,多任务视图打开的时候,禁用旋转 + if(m_isLoadTabletModeQML && getRotationModeStatus()) { + setRotationModeStatus(!m_isAutoRotateBeforeShowMultiTask); + } + if (m_appWindowListModel->rowCount() == 0) { + return; + } + + showTabView(); + + isOpen = true; +} + +void MultitaskViewManagerByWlcom::close() +{ + if (!isOpen) { + return; + } + //可旋转的机器,多任务视图打开前 是打开了旋转的 那么关闭多任务视图的同时 打开旋转 + if (m_isLoadTabletModeQML && m_isAutoRotateBeforeShowMultiTask) { + setRotationModeStatus(m_isAutoRotateBeforeShowMultiTask); + } + + hideTabView(); + hideTaskView(); + isOpen = false; + QtConcurrent::run([]() { + KTrackData *node = kdk_dia_data_init(KEVENTSOURCE_DESKTOP, KEVENT_CUSTOM); + kdk_dia_upload_default(node, (char*)"ukui_window_switch_exit_event", (char*)"ukui-window-switch"); + kdk_dia_data_free(node); + }); +} + +bool MultitaskViewManagerByWlcom::getRotationModeStatus() +{ + QDBusMessage message = QDBusMessage::createMethodCall("com.kylin.statusmanager.interface", + "/", + "com.kylin.statusmanager.interface", + "get_auto_rotation"); + + QDBusMessage response = QDBusConnection::sessionBus().call(message); + + if (response.type() == QDBusMessage::ReplyMessage) { + m_isAutoRotateBeforeShowMultiTask = response.arguments().takeFirst().toBool(); + } else { + qDebug() << "get Rotation mode failed" << response.type(); + } + return m_isAutoRotateBeforeShowMultiTask; +} + +void MultitaskViewManagerByWlcom::setRotationModeStatus(bool rotationModeStatus) +{ + QDBusInterface iface("com.kylin.statusmanager.interface", + "/", + "com.kylin.statusmanager.interface"); + + if (!iface.isValid()) { + qDebug() << QDBusConnection::sessionBus().lastError().message(); + } + QDBusReply reply = iface.call("set_auto_rotation",rotationModeStatus,"",""); + if (reply.isValid()) { + qDebug() << "set Rotation mode success"; + return; + } + qDebug() << "set Rotation mode failed" << reply.error(); +} + +void MultitaskViewManagerByWlcom::initGuiLayouDirection() +{ + QString systemLang = QLocale::system().name(); + if (systemLang == "ug_CN" || systemLang == "ky_KG" || systemLang == "kk_KZ") { + m_isLayoutLeftToRight = false; + } else { + m_isLayoutLeftToRight = true; + } +} + +QRect MultitaskViewManagerByWlcom::currentScreenRect() +{ + return UkuiQuick::WindowProxy::currentScreen()->geometry(); +} + +bool MultitaskViewManagerByWlcom::isBackTab() +{ + return m_isBackTab; +} + +bool MultitaskViewManagerByWlcom::altTabVisible() +{ + return m_tabView->isVisible(); +} + +bool MultitaskViewManagerByWlcom::winTabVisible() +{ + return m_taskView->isVisible(); +} + +void MultitaskViewManagerByWlcom::updateDesktopBackground() +{ + QString filePath = DesktopBackground::getBackgroundFile(); + if (filePath.isEmpty()) { + return; + } + + auto loadImageFinishedCallback = [this](const QImage &image) { + DesktopBackground::setNonBlurBackground(image); + DesktopBackground::setBlurBackground(image, 0.7); + emit this->backgroundChanged(); + }; + + BackgroundImageHandler::loadBackgroundImageAsync(filePath, DesktopBackground::getSystemScalingFactor(), + DesktopBackground::getBackgroundFillStyle(), + this, loadImageFinishedCallback); +} + +void MultitaskViewManagerByWlcom::setShowingDesktop(bool showing) +{ + Q_UNUSED(showing) + UkuiQuick::WindowManager::setShowingDesktop(true); +} + +void MultitaskViewManagerByWlcom::initModel() +{ + qDebug() << "创建model数据" << __FUNCTION__; + m_desktopListModel.reset(new DesktopListModel()); + m_appWindowListModel.reset(new AppWindowListModel()); +} + +void MultitaskViewManagerByWlcom::initializeProjectType() +{ + if ( getProjectCodeName() == QStringLiteral("V10SP1-edu") + || getProjectSubName() == QStringLiteral("mavis") + || getProductFeatures() == 2 ) { + m_projectType = MultitaskViewManagerByWlcom::TABLET; + } else if (getProjectCodeName() == QStringLiteral("V10SP1") && getProductFeatures() == '\u0000') { + // '\u0000' 空格的ASCII码 + m_projectType = MultitaskViewManagerByWlcom::MASTER; + m_isViewVerticalLayout = false; + } else { + m_projectType = MultitaskViewManagerByWlcom::TWOINONE; + m_isViewVerticalLayout = true; + } +} + +void MultitaskViewManagerByWlcom::setQmlUrl() +{ + if (m_projectType == MultitaskViewManagerByWlcom::TABLET + || (m_projectType == MultitaskViewManagerByWlcom::TWOINONE && WindowManagerInterface::getInstance()->isTabletMode())) { + m_qmlUrl = QUrl("qrc:/qml/TabletViewMain.qml"); + m_isLoadTabletModeQML = true; + } else if (m_projectType == MultitaskViewManagerByWlcom::MASTER + || (m_projectType == MultitaskViewManagerByWlcom::TWOINONE && !WindowManagerInterface::getInstance()->isTabletMode())) { + m_qmlUrl = QUrl("qrc:/qml/MultitaskView.qml"); + m_isLoadTabletModeQML = false; + } +} + +void MultitaskViewManagerByWlcom::registerQmlTypes() +{ + qmlRegisterType("org.kylin.thumbnail", 1, 0, "ThumbnailItem"); + qmlRegisterType("org.kylin.background", 3, 0, "DesktopBackground"); + qmlRegisterType("IconTheme", 1, 0, "IconTheme"); + qmlRegisterType("AppWindowFilterModel", 1, 0, "AppWindowFilterModel"); + qmlRegisterType("DesktopListModel", 1, 0, "DesktopListModel"); + qRegisterMetaType >("QList"); + qmlRegisterUncreatableType("org.ukui.positioner", 1, 0, "UkuiPositioner", "UkuiPositioner is an attached property"); + qmlRegisterUncreatableType("org.ukui.positioner", 1, 0, "UkuiBasePositioner", "UkuiBasePositioner is an abstract type that is only available as an attached property."); + qmlRegisterType("org.ukui.positioner", 1, 0, "UkuiFlow"); +} + +void MultitaskViewManagerByWlcom::registerShortcut() +{ + auto* action = new QAction(this); + action->setObjectName("ShowMultitaskView"); + action->setText("Show Multitask View"); + + QKeySequence keySeq(Qt::META + Qt::Key_Tab); + KGlobalAccel::self()->setDefaultShortcut(action, QList() << keySeq); + KGlobalAccel::self()->setShortcut(action, QList() << keySeq); + connect(action, &QAction::triggered, this, &MultitaskViewManagerByWlcom::open); + + auto* tabaction = new QAction(this); + tabaction->setObjectName("ShowTabbox"); + tabaction->setText("Show Tabbox"); + + QKeySequence tabKeySeq(Qt::ALT + Qt::Key_Tab); + KGlobalAccel::self()->setDefaultShortcut(tabaction, QList() << tabKeySeq); + KGlobalAccel::self()->setShortcut(tabaction, QList() << tabKeySeq); + connect(tabaction, &QAction::triggered, this, &MultitaskViewManagerByWlcom::openTab); + + auto* backtabaction = new QAction(this); + backtabaction->setObjectName("ShowBackTabbox"); + backtabaction->setText("Show Back Tabbox"); + + QKeySequence backtabKeySeq(Qt::ALT + Qt::SHIFT + Qt::Key_Backtab); + KGlobalAccel::self()->setDefaultShortcut(backtabaction, QList() << backtabKeySeq); + KGlobalAccel::self()->setShortcut(backtabaction, QList() << backtabKeySeq); + connect(backtabaction, &QAction::triggered, this, &MultitaskViewManagerByWlcom::openBackTab); +} + +void MultitaskViewManagerByWlcom::initDBusService() +{ + m_dbusService.reset(new DBusService(this)); +} + +void MultitaskViewManagerByWlcom::installTranslator() +{ + m_translator = new QTranslator(qApp); + m_translator->load(QLocale::system(), QLatin1String("ukui-window-switch"), + QLatin1String("_"), TRANSLATION_DIR); + QApplication::installTranslator(m_translator); +} + +void MultitaskViewManagerByWlcom::initView() +{ + qDebug() << " 初始化多任务视图 " << __FUNCTION__; + + //init alt-tab view + m_tabView.reset(new QQuickView()); + m_tabView->setFlags(Qt::FramelessWindowHint); + m_tabView->setColor(Qt::transparent); + m_tabWindowProxy = new UkuiQuick::WindowProxy(m_tabView.get()); + m_tabWindowProxy->setWindowType(UkuiQuick::WindowType::Type::Switcher); + m_tabWindowProxy->setWindowStates(UkuiQuick::WindowState::Focusable | UkuiQuick::WindowState::Activatable, true); + + qDebug() << "[DEBUG]: multitask view uses " << m_tabView->sceneGraphBackend(); + if (m_tabView->rendererInterface()->graphicsApi() < 2) { + m_isOpenGLBackend = false; + WindowManagerInterface::getInstance()->setIsOpenGLBackend(m_isOpenGLBackend); + } + + // 通过 QQmlContext::setContextProperty() 注册 C++ 的对象实例到 QML 中 + m_tabView->rootContext()->setContextProperty("multitaskViewManager", this); + m_tabView->rootContext()->setContextProperty("multitaskViewModel", WindowManagerInterface::getInstance()); + m_tabView->rootContext()->setContextProperty("appWindowListModel", m_appWindowListModel.get()); + m_tabView->rootContext()->setContextProperty("devicePixelRatio", qApp->primaryScreen()->logicalDotsPerInch() / 96.0); + + m_tabView->setSource(m_tabQmlUrl); + m_tabView->setResizeMode(QQuickView::ResizeMode::SizeViewToRootObject); + connect(m_tabView.get(), &QQuickView::heightChanged, this, &MultitaskViewManagerByWlcom::updateAltTabView); + updateAltTabView(); //避免首次打开卡顿 + + + //init win-tab view + m_taskView.reset(new QQuickView()); + m_taskView->setFlags(Qt::FramelessWindowHint); + m_taskView->setColor(Qt::transparent); + m_taskWindowProxy = new UkuiQuick::WindowProxy(m_taskView.get()); + m_taskWindowProxy->setWindowType(UkuiQuick::WindowType::Type::Switcher); + m_taskWindowProxy->setWindowStates(UkuiQuick::WindowState::Focusable | UkuiQuick::WindowState::Activatable, true); + + m_taskView->rootContext()->setContextProperty("multitaskViewManager", this); + m_taskView->rootContext()->setContextProperty("multitaskViewModel", WindowManagerInterface::getInstance()); + m_taskView->rootContext()->setContextProperty("appWindowListModel", m_appWindowListModel.get()); + m_taskView->rootContext()->setContextProperty("devicePixelRatio", qApp->primaryScreen()->logicalDotsPerInch() / 96.0); + m_taskView->rootContext()->setContextProperty("desktopListModel", m_desktopListModel.get()); + + setQmlUrl(); + m_taskView->setSource(m_qmlUrl); + m_taskView->setResizeMode(QQuickView::ResizeMode::SizeRootObjectToView); + connect(m_taskView.get(), &QQuickView::activeFocusItemChanged, m_taskView.get(), [this] { + if (!m_taskView || m_taskView->activeFocusItem()) { + return; + } + close(); + }, Qt::ConnectionType::UniqueConnection); +} + +void MultitaskViewManagerByWlcom::initEffect() +{ + const QByteArray id(CONTROL_CENTER_SETTING); + if (QGSettings::isSchemaInstalled(id)) { + auto settings = new QGSettings(id, QByteArray(), this); + + QStringList keys = settings->keys(); + if (keys.contains(CONTROL_CENTER_EFFECT_KEY)) { + m_isEffect = settings->get(CONTROL_CENTER_EFFECT_KEY).toBool(); + } + + QObject::connect(settings, &QGSettings::changed, this, [=](const QString &key) { + if (key == CONTROL_CENTER_EFFECT_KEY) { + m_isEffect = settings->get(key).toBool(); + } + }); + } +} + +void MultitaskViewManagerByWlcom::destroyView() +{ + if (m_tabView != nullptr && m_tabView->isVisible()) { + m_tabView->hide(); + emit altTabVisibleChanged(); + } + if (m_taskView != nullptr && m_taskView->isVisible()) { + m_taskView->hide(); + emit winTabVisibleChanged(); + } + + // 1. 由于可以在QML中通过JS调用到close函数, + // 因此,不能直接销毁 m_view 对象;必须延迟 + // 销毁该对象 + // 2. m_model 对象可以立刻销毁。但是,为了对称 + // 和简化逻辑,需要保证 m_view 对象和 m_model 对象的 + // 互相依赖的关系。因此,同时延迟销毁 m_model 对象。 + // 3. MultitaskViewManagerByWlcom的析构函数需要确保 + // m_view 对象和 m_model 对象完成销毁。为了简化逻辑, + // MultitaskViewManagerByWlcom的析构函数选择直接调用 + // destroyView函数,即采用了延迟销毁的做法。 + m_tabView.release()->deleteLater(); + m_taskView.release()->deleteLater(); + m_desktopListModel.release()->deleteLater(); + m_appWindowListModel.release()->deleteLater(); +} + +void MultitaskViewManagerByWlcom::showTabView() +{ + if (m_tabView == nullptr || m_tabWindowProxy == nullptr) { + qWarning() << "ukui-window-switch alt-tab view is null, open failed!"; + return; + } + + //显示alt-tab界面 + updateAltTabView(); + m_tabView->show(); + emit altTabVisibleChanged(); +} + +void MultitaskViewManagerByWlcom::hideTabView() +{ + if (m_tabView == nullptr) { + return; + } + if (m_tabView->isVisible()) { + m_tabView->hide(); + emit altTabVisibleChanged(); + } +} + +void MultitaskViewManagerByWlcom::showTaskView() +{ + if (m_taskView == nullptr || m_taskWindowProxy == nullptr) { + qWarning() << "ukui-window-switch view is null, open failed!"; + return; + } + + if (m_isLoadTabletModeQML) { + qDebug() << "加载的qml为 " << m_qmlUrl; + m_taskView->setSource(m_qmlUrl); + } + // 默认情况视图会随着QML中的根项调整大小,可以通过 setResizeMode(QQuickView::ResizeMode) 修改默认行为 + // 但是多任务视图的 rootObject 是 Repeater,且没有设置大小,所以必须通过 setGeometry 设置视图大小。 + // TODO: Repeater 继承了 Item 的 anchor 属性,Repeater 是否可以设置大小? + // 必须在加载了QML之后才能设置 m_view 对象的大小,否则视图大小仍为 0x0 + if (m_taskView->resizeMode() != QQuickView::ResizeMode::SizeRootObjectToView) { + m_taskView->setResizeMode(QQuickView::ResizeMode::SizeRootObjectToView); + } + QRect bounding; + for (int i= 0; i < QGuiApplication::screens().size(); i++) { + bounding = bounding.united(QGuiApplication::screens().at(i)->geometry()); + } + m_taskWindowProxy->setGeometry(bounding); + m_taskView->show(); + emit winTabVisibleChanged(); + emit desktopDataUpdated(); + emit taskViewShowed(); +} + +void MultitaskViewManagerByWlcom::hideTaskView() +{ + if (m_taskView == nullptr) { + return; + } + if (m_taskView->isVisible()) { + m_taskView->hide(); + emit winTabVisibleChanged(); + } +} + +void MultitaskViewManagerByWlcom::updateAltTabView() +{ + if (m_tabView == nullptr) { + return; + } + QRect bounding = UkuiQuick::WindowProxy::currentScreen()->geometry(); + if (bounding.width() != m_tabView->width()) { + // 修复主副屏尺寸不同,alt-tab界面宽度不更新问题 + emit currentScreenRectChanged(); + } + QPainterPath path; + qreal yOffset = m_tabView->rootObject()->property("yOffset").toInt(); + path.addRect(0, yOffset, m_tabView->width(), m_tabView->height() - (yOffset * 2)); + m_tabWindowProxy->setBlurRegion(true, QRegion(path.toFillPolygon().toPolygon())); //毛玻璃 + m_tabWindowProxy->setPosition(QPoint(bounding.x(),bounding.y() + bounding.height() * 0.5 - m_tabView->height() * 0.5)); +} + +void MultitaskViewManagerByWlcom::onTabletModeChanged() +{ + close(); + setQmlUrl(); +} + +void MultitaskViewManagerByWlcom::setShouldShowTabBorder(bool isShow) +{ + if (m_isShowTabBorder == isShow) { + return; + } + m_isShowTabBorder = isShow; + emit shouldShowTabBorderChanged(); +} + +void MultitaskViewManagerByWlcom::connectSignals() +{ + qDebug() << "创建信号" << __FUNCTION__; + //connect(WindowManagerInterface::getInstance(), &WindowManagerInterface::appWindowCreated, this, &MultitaskViewManagerByWlcom::close); + connect(WindowManagerInterface::getInstance(), &WindowManagerInterface::screenCountChanged, this, &MultitaskViewManagerByWlcom::close); + connect(WindowManagerInterface::getInstance(), &WindowManagerInterface::screenSizeChanged, this, &MultitaskViewManagerByWlcom::close); + connect(WindowManagerInterface::getInstance(), &WindowManagerInterface::tabletModeChanged, this, &MultitaskViewManagerByWlcom::onTabletModeChanged); + connect(qApp->primaryScreen(), &QScreen::geometryChanged, this, &MultitaskViewManagerByWlcom::currentScreenRectChanged); +} + +QString MultitaskViewManagerByWlcom::getProjectCodeName() +{ + return QString(kdk_system_get_projectName()); +} + +QString MultitaskViewManagerByWlcom::getProjectSubName() +{ + return QString(kdk_system_get_projectSubName()); +} + +QString MultitaskViewManagerByWlcom::getProductFeatures() +{ + return QString(kdk_system_get_productFeatures()); +} diff --git a/windowsview/ukui-window-switch-wlcom/multitaskviewmanagerbywlcom.h b/windowsview/ukui-window-switch-wlcom/multitaskviewmanagerbywlcom.h new file mode 100644 index 0000000000000000000000000000000000000000..06d3ff057f3b1f27a6b285356c92c19463d534af --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/multitaskviewmanagerbywlcom.h @@ -0,0 +1,148 @@ +/* + * Copyright (C) 2024, KylinSoft Co., Ltd. + + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef MULTITASKVIEWMANAGERBYWLCOM_H +#define MULTITASKVIEWMANAGERBYWLCOM_H + +#include +#include + +//ukui-quick +#include + +#include "dbusservice.h" +#include "../desktoplistmodel.h" +#include "../appwindowlistmodel.h" + +class QTranslator; +class MultitaskViewManagerByWlcom : public QObject +{ + Q_OBJECT + Q_PROPERTY(QRect currentScreenRect READ currentScreenRect NOTIFY currentScreenRectChanged) + Q_PROPERTY(bool shouldShowTabBorder READ shouldShowTabBorder WRITE setShouldShowTabBorder NOTIFY shouldShowTabBorderChanged) + Q_PROPERTY(bool isBackTab READ isBackTab) + Q_PROPERTY(bool altTabVisible READ altTabVisible NOTIFY altTabVisibleChanged) + Q_PROPERTY(bool winTabVisible READ winTabVisible NOTIFY winTabVisibleChanged) + +public: + MultitaskViewManagerByWlcom(); + ~MultitaskViewManagerByWlcom(); + enum ProjectType { + TABLET, + MASTER, + TWOINONE, + }; + Q_INVOKABLE void open(); + Q_INVOKABLE void close(); + Q_INVOKABLE void openTab(); + Q_INVOKABLE void openBackTab(); + Q_INVOKABLE void setShowingDesktop(bool showing); + Q_INVOKABLE bool isMultitaskViewVerticalLayout() const { return m_isViewVerticalLayout; } + Q_INVOKABLE bool shouldShowTabBorder() const { return m_isShowTabBorder; } + Q_INVOKABLE void setShouldShowTabBorder(bool isShow); + Q_INVOKABLE void activeAreaChangeDataCollect(const QString &areaName); + Q_INVOKABLE bool isWlcom() const {return true;}; + Q_INVOKABLE bool isLayoutLeftToRight() { return m_isLayoutLeftToRight; }; + Q_INVOKABLE bool isAltKeyPressed(); + Q_INVOKABLE void keyNavigationDataCollect(const int &keyValue); + + QRect currentScreenRect(); + bool isBackTab(); + bool altTabVisible(); + bool winTabVisible(); + + static bool m_isOpenGLBackend; + static bool isOpen; + static bool m_isEffect; + +private: + void initModel(); + void initializeProjectType(); + void setQmlUrl(); + void registerQmlTypes(); + void registerShortcut(); + void initDBusService(); + void installTranslator(); + void initView(); + void initEffect(); + void destroyView(); + void connectSignals(); + bool isCursorNavigationKey(const int &key) const; + QString getProjectCodeName(); + QString getProjectSubName(); + QString getProductFeatures(); + //! + //! \brief getRotationModeStatus 获取当前旋转模式是否打开 + //! + bool getRotationModeStatus(); + ///! + //! \brief setRotationModeStatus + //! + void setRotationModeStatus(bool openRotationMode); + + void initGuiLayouDirection(); + + // 窗口选择界面 + void showTabView(); + void hideTabView(); + + // 多任务视图界面 + void showTaskView(); + void hideTaskView(); + +private: + std::unique_ptr m_tabView = nullptr; + std::unique_ptr m_taskView = nullptr; + std::unique_ptr m_dbusService = nullptr; + std::unique_ptr m_desktopListModel = nullptr; + std::unique_ptr m_appWindowListModel = nullptr; + ProjectType m_projectType = MultitaskViewManagerByWlcom::MASTER; + QUrl m_qmlUrl = QUrl("qrc:/qml/MultitaskView.qml"); + QUrl m_tabQmlUrl = QUrl("qrc:/qml/Tabbox.qml"); + // 记录旋转模式是否打开 + bool m_isAutoRotateBeforeShowMultiTask = false; + // 记录是否加载平板模式的qml + bool m_isLoadTabletModeQML = false; + // 记录多任务视图整体布局方向是否为垂直方向 + bool m_isViewVerticalLayout = false; + // 记录走焦边框是否显示 + bool m_isShowTabBorder = false; + QTranslator *m_translator = nullptr; + bool m_isLayoutLeftToRight = true; + UkuiQuick::WindowProxy *m_tabWindowProxy = nullptr; + UkuiQuick::WindowProxy *m_taskWindowProxy = nullptr; + bool m_isBackTab = false; + +signals: + void showedViewChanged(); + void currentScreenRectChanged(); + void shouldShowTabBorderChanged(); + void desktopDataUpdated(); + void taskViewShowed(); + void altTabVisibleChanged(); + void winTabVisibleChanged(); + void backgroundChanged(); + +private Q_SLOTS: + void updateDesktopBackground(); + void updateAltTabView(); + void onTabletModeChanged(); +}; + +#endif // MULTITASKVIEWMANAGERBYWLCOM_H diff --git a/windowsview/ukui-window-switch-wlcom/multitaskviewmodelbywlcomhandler.cpp b/windowsview/ukui-window-switch-wlcom/multitaskviewmodelbywlcomhandler.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8fd99568f391348fb279f8b9e377ae3e5d5a6069 --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/multitaskviewmodelbywlcomhandler.cpp @@ -0,0 +1,579 @@ +/* + * Copyright (C) 2024, KylinSoft Co., Ltd. + + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "multitaskviewmodelbywlcomhandler.h" +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "multitaskviewmanagerbywlcom.h" + +using namespace std; + +static UkuiSearch::ApplicationInfo *applicationInfo = nullptr; +static std::once_flag flag; +UkuiSearch::ApplicationInfo *MultitaskViewModelByWlcomHandler::getApplicationInfo() +{ + std::call_once(flag, [ & ] { + applicationInfo = new UkuiSearch::ApplicationInfo(); + }); + return applicationInfo; +} + +QString MultitaskViewModelByWlcomHandler::desktopFileFromPid(uint pid) +{ + QString desktopFile; + getApplicationInfo()->tranPidToDesktopFp(pid, desktopFile); + return desktopFile; +} + +MultitaskViewModelByWlcomHandler::MultitaskViewModelByWlcomHandler(QObject *parent) : MultitaskViewAbstractModelHandler{} +{ + createContext(); + m_context->start(); + connectSignals(); + getApplicationInfo(); +} + +MultitaskViewModelByWlcomHandler::~MultitaskViewModelByWlcomHandler() +{ + delete m_context; +} + +void MultitaskViewModelByWlcomHandler::createContext() +{ + struct wl_display *display = NULL; + + QPlatformNativeInterface *native = QGuiApplication::platformNativeInterface(); + if (!native) { + return; + } + + display = reinterpret_cast( + native->nativeResourceForIntegration(QByteArrayLiteral("wl_display"))); + if (!display) { + qWarning("Failed to get Wayland display."); + return; + } + + m_context = new Context(nullptr, Context::Capability::Output | Context::Capability::Toplevel | + Context::Capability::Workspace); + connect(m_context, &Context::workespaceAdded, this, &MultitaskViewModelByWlcomHandler::onWorkSpaceAdded); + connect(m_context, &Context::toplevelAdded, this, &MultitaskViewModelByWlcomHandler::onWindowAdded); + connect(m_context, &Context::outputAdded, this, &MultitaskViewModelByWlcomHandler::onOutputAdded); +} + +Toplevel *MultitaskViewModelByWlcomHandler::getToplevel(QString windowId) +{ + Toplevel *toplevel = NULL; + + const auto wnds = m_allWindowList; + for (auto const wnd: wnds) { + if ((QString)wnd->uuid() == windowId) { + toplevel = wnd; + } + } + return toplevel; +} + +Window MultitaskViewModelByWlcomHandler::windowFromToplevel(Toplevel *toplevel) +{ + if (toplevel == nullptr) { + return Window(); + } + Window window(toplevel->uuid().toInt(), + toplevel->uuid(), + toplevel->title().isEmpty() ? toplevel->name() : toplevel->title(), + toplevel->point().x(), + toplevel->point().y(), + toplevel->size().width(), + toplevel->size().height(), + toplevel->isMinimized()); + + QList list; + int desktopId = 1; + for (int i = 0; i < m_workspaceList.size(); ++i) { + if (toplevel->workspaces().contains((QString)m_workspaceList[i]->uuid())) { + desktopId = i + 1; + list.append(desktopId); + } + } + + int screenId = 0; + for (int i= 0; i < m_outputList.size(); i++) { + // screenId 指的是QGuiApplication::screens()中的索引值 + // m_outputList 中的屏幕顺序可能和QGuiApplication::screens()中的屏幕顺序不一致,因此需要通过getOutputUuid(i)匹配uuid来查找索引值 + if (getOutputUuid(i) == toplevel->primaryOutput()) { + screenId = i; + } + } + + window.setDesktopsId(list); + window.setScreenId(screenId); + window.setIcon(QVariant::fromValue(toplevel->iconName())); + return window; +} + +void MultitaskViewModelByWlcomHandler::removeAppWindow(QString windowId) +{ + Toplevel *toplevel = getToplevel(windowId); + if (toplevel == nullptr){ + return; + } + toplevel->close(); +} + +void MultitaskViewModelByWlcomHandler::moveAppWindowToDesktop(QString windowId, + int srcDesktopInex, + int destDesktopInex) +{ + + if (destDesktopInex -1 >= m_workspaceList.size()){ + return; + } + Toplevel *toplevel = getToplevel(windowId); + toplevel->moveToWorkspace(m_workspaceList[destDesktopInex-1]->uuid()); + +} + +void MultitaskViewModelByWlcomHandler::activateAppWindow(QString windowId) +{ + getToplevel(windowId)->setActivate(); +} + +QVariant MultitaskViewModelByWlcomHandler::getWindowIcon(QString windowId) +{ + Toplevel *toplevel = getToplevel(windowId); + if (!toplevel){ + return ""; + } + + QIcon themeIcon; + themeIcon = QIcon::fromTheme(toplevel->icon(), themeIcon); + if (!themeIcon.isNull()) { + return themeIcon; + } + + return toplevel->iconName(); +} + +int MultitaskViewModelByWlcomHandler::getNumberOfDesktops() +{ + return m_workspaceList.size(); +} + +void MultitaskViewModelByWlcomHandler::removeDesktop(int desktopIndex) +{ + m_workspaceList[desktopIndex-1]->remove(); +} + +void MultitaskViewModelByWlcomHandler::moveDesktop(int srcDesktopIndex, int destDesktopIndex) +{ + m_workspaceList[srcDesktopIndex-1]->move(destDesktopIndex - 1); + m_workspaceList.move(srcDesktopIndex - 1, destDesktopIndex - 1); + emit desktopMoved(srcDesktopIndex, destDesktopIndex); +} + +void MultitaskViewModelByWlcomHandler::appendDesktop() +{ + int desktopCount = m_workspaceList.size(); + m_context->addWorkspace(desktopCount); + QEventLoop loop; + connect(this, &MultitaskViewModelByWlcomHandler::workspaceHasCreated, &loop, &QEventLoop::quit); + loop.exec(); +} + +int MultitaskViewModelByWlcomHandler::getCurrentDesktop() +{ + for (int i = 0; i < m_workspaceList.size(); i++) { + if (m_workspaceList[i]->isActivated()) { + return i+1; + } + } + return 1; +} + +bool MultitaskViewModelByWlcomHandler::isCurrentDesktopShowingDesktop() +{ + //wlcom 内部已实现,不需要获取该状态 + return false; +} + +void MultitaskViewModelByWlcomHandler::setCurrentDesktop(int desktopIndex) +{ + m_workspaceList[desktopIndex-1]->setActivate(); +} + +QRect MultitaskViewModelByWlcomHandler::getFullScreenGeometry(int desktopIndex, int screenIndex) +{ + return QGuiApplication::screens().at(screenIndex)->geometry(); +} + +bool MultitaskViewModelByWlcomHandler::hasModalChildWindow(QString windowId) +{ + Toplevel *toplevel = getToplevel(windowId); + if (toplevel){ + return toplevel->hasChildren(); + } + return false; +} + +bool MultitaskViewModelByWlcomHandler::isExtensionMode() +{ + QRect bounding; + for (int i = 0; i < QGuiApplication::screens().size(); i++) { + bounding = bounding.united(QGuiApplication::screens().at(i)->geometry()); + } + for (int i = 0; i < QGuiApplication::screens().size(); i++) { + if (bounding == QGuiApplication::screens().at(i)->geometry()) { + return false; + }; + } + + return true; +} + +int MultitaskViewModelByWlcomHandler::logicalScreenCount() +{ + const auto screenCount = QGuiApplication::screens().size(); + if (screenCount == 1 || !isExtensionMode()) { + return 1; + } + return screenCount; +} + + +QList MultitaskViewModelByWlcomHandler::createWindowList(int desktopIndex, int screenIndex) +{ + if (screenIndex > QGuiApplication::screens().size()) { + return {}; + } + QString outputUuid; + for (auto &output : m_outputList) { + if (QGuiApplication::screens().at(screenIndex)->name() == output->name()) { + outputUuid = output->uuid(); + } + } + if (outputUuid.isEmpty()) { + qWarning() << "[Multitask]: OutputUuid is empty in createWindowList, the screenIndex is" << screenIndex; + return {}; + } + + QList windowList; + + const auto wnds = m_allWindowList; + + for (auto const wnd: wnds) { + if (!shouldAcceptWindow(wnd)) { + continue; + } + bool isOnDesktop = false; + for (int i = 0; i < wnd->workspaces().size(); i++) { + if (wnd->workspaces()[i] == (QString)m_workspaceList[desktopIndex - 1]->uuid()){ + isOnDesktop = true; + break; + } + } + if (!isOnDesktop){ + continue; + } + + + if (outputUuid != wnd->primaryOutput()) { + continue; + } + + QString id =wnd->uuid(); + QString title = wnd->title(); + if (title.isEmpty()) { + title = wnd->name(); + } + Window window(id.toInt(), + wnd->uuid(), + title, + wnd->point().x(), + wnd->point().y(), + wnd->size().width(), + wnd->size().height(), + wnd->isMinimized()); + + QList list; + int desktopId = 1; + for (int i = 0; i < m_workspaceList.size(); ++i) { + if (wnd->workspaces().contains((QString)m_workspaceList[i]->uuid())) { + desktopId = i + 1; + list.append(desktopId); + } + } + + window.setDesktopsId(list); + window.setScreenId(screenIndex); + window.setIcon(QVariant::fromValue(wnd->iconName())); + windowList.append(window); + } + return windowList; +} + +bool MultitaskViewModelByWlcomHandler::shouldAcceptWindow(Toplevel *toplevel) +{ + return !(toplevel->capabilities() & Toplevel::Capability::Switcher); +} + +QString MultitaskViewModelByWlcomHandler::getDesktopUuid(int desktopIndex) +{ + return m_workspaceList[desktopIndex - 1]->uuid(); +} + +QString MultitaskViewModelByWlcomHandler::getOutputUuid(int outputIndex) +{ + if (m_outputList.size() == 1) { + return m_outputList[0]->uuid(); + } + + QString outputName = ""; + if (QGuiApplication::screens().size() > outputIndex) { + outputName = QGuiApplication::screens().at(outputIndex)->name(); + } + + for (int i= 0; i < m_outputList.size(); i++) { + if (m_outputList[i]->name() == outputName) { + return m_outputList[i]->uuid(); + } + } + + qWarning() << "[Multitask]: getOutputUuid falied, invalid outputIndex" << outputIndex; + return QString(); +} + +void MultitaskViewModelByWlcomHandler::setDesktopName(const int desktopIndex, const QString name) +{ + if (m_workspaceList.size() < desktopIndex) { + return; + } + m_workspaceList[desktopIndex - 1]->setName(name); +} + + +void MultitaskViewModelByWlcomHandler::onWindowAdded(Toplevel *toplevel) +{ + if (!shouldAcceptWindow(toplevel)) { + //如果非独立子窗口的父窗口显示在任务视图, + //激活非独立子窗口时,需要调整父窗口显示顺序,因此需要监听窗口状态变化 + if (toplevel->parent() != nullptr && shouldAcceptWindow(toplevel->parent())) { + connect(toplevel, &Toplevel::stateUpdated, this, &MultitaskViewModelByWlcomHandler::onWindowUpdate); + } + return; + } + + m_allWindowList.push_back(toplevel); + connect(toplevel, &Toplevel::stateUpdated, this, &MultitaskViewModelByWlcomHandler::onWindowUpdate); + connect(toplevel, &Toplevel::deleted, this, &MultitaskViewModelByWlcomHandler::onWindowDeleted); + if (toplevel->icon() == "fallback" || toplevel->title().isEmpty()) { + // wlcom未找到应用图标,则通过ukui-search接口查找desktop文件,进而获取应用图标 + QString desktopFile; + getApplicationInfo()->desktopFilePathFromName(toplevel->appId(), desktopFile); + if (desktopFile.isEmpty()) { + desktopFile = desktopFileFromPid(toplevel->pid()); + } + toplevel->setDesktopFile(desktopFile); + } + + emit appWindowAdd(windowFromToplevel(toplevel)); +} + +void MultitaskViewModelByWlcomHandler::onOutputAdded(Output *output) +{ + m_outputList.push_back(output); + connect(output, &Output::deleted, this, &MultitaskViewModelByWlcomHandler::onOutputDeleted); +} + +void MultitaskViewModelByWlcomHandler::onOutputDeleted() +{ + Output *output = qobject_cast(sender()); + for (int i = 0; i < m_outputList.size(); ++i) { + if (output->uuid() == (QString)m_outputList[i]->uuid()) { + m_outputList.removeAt(i); + break; + } + } +} + +void MultitaskViewModelByWlcomHandler::onWindowDeleted() +{ + Toplevel *toplevel = qobject_cast(sender()); + for (int i = 0; i < m_allWindowList.size(); i++){ + if (m_allWindowList[i]->uuid() == toplevel->uuid()){ + m_allWindowList.removeAt(i); + break; + } + } + QString id = toplevel->uuid(); + + qDebug()<<"toplevel"<parent() != nullptr && shouldAcceptWindow(toplevel->parent())) { + int index = m_allWindowList.indexOf(toplevel->parent()); + if (index != -1) { + m_allWindowList.move(index, m_allWindowList.size() - 1); + emit appWindowActivated(); + } + } + + return; + } + // KWin在发送windowActivated信号时 + // window对象是有可能为空的。对于多任务 + // 视图来说,只关心真正有窗口被激活的清空。 + // 因此,如果window对象为空,则不转发 + // 该信号 + if (toplevel->appId() == nullptr) { + return; + } + + int index = m_allWindowList.indexOf(toplevel); + if (index != -1) { + m_allWindowList.move(index, m_allWindowList.size() - 1); + emit appWindowActivated(); + } +} + +void MultitaskViewModelByWlcomHandler::onWindowUpdate(Toplevel::Masks mask) +{ + Toplevel *toplevel = qobject_cast(sender()); + + if (mask & (Toplevel::Mask::Activated) && toplevel->isActivated()) { + onWindowActivated(toplevel); + } + + if (mask & (Toplevel::Mask::Size | Toplevel::Mask::Title | Toplevel::Mask::Icon | Toplevel::Mask::PrimaryOutput)) { + emit appWindowUpdated(windowFromToplevel(toplevel)); + } + + if (mask & Toplevel::Mask::Workspace) { + QStringList workspaces = toplevel->workspaces(); + if (workspaces.size() > 1) { + emit appWindowUpdated(windowFromToplevel(toplevel)); + } else if (!workspaces.isEmpty()) { + for (int i = 0; i < m_workspaceList.size(); i++) { + if (m_workspaceList[i]->uuid() == workspaces.at(0)) { + onDesktopPresenceChanged(toplevel,0,i+1); + break; + } + } + } + } + +} + +void MultitaskViewModelByWlcomHandler::onDesktopPresenceChanged(Toplevel *toplevel, int oldDesktopIndex ,int newDesktopIndex) +{ + if (!shouldAcceptWindow(toplevel)) { + return; + } + for (int i = 0; i < m_allWindowList.size(); i++){ + if (m_allWindowList[i]->uuid() == toplevel->uuid()){ + m_allWindowList[i] = toplevel; + break; + } + } + emit appWindowDesktopChanged(toplevel->uuid(), oldDesktopIndex, newDesktopIndex); +} + +void MultitaskViewModelByWlcomHandler::onWorkSpaceAdded(Workspace *workspace) +{ + m_workspaceList.push_back(workspace); + connect(workspace, &Workspace::stateUpdated, this, &MultitaskViewModelByWlcomHandler::onCurrentDesktopChanged); + connect(workspace, &Workspace::deleted, this, &MultitaskViewModelByWlcomHandler::onWorkSpaceDeleted); + emit workspaceHasCreated(); + emit desktopAppended(m_workspaceList.size()); +} + +void MultitaskViewModelByWlcomHandler::onWorkSpaceDeleted() +{ + Workspace *workspace = qobject_cast(sender()); + for (int i = 0; i < m_workspaceList.size(); i++) { + if (workspace->uuid() == (QString)m_workspaceList[i]->uuid()){ + m_workspaceList.removeAt(i); + emit desktopRemoved(i+1); + break; + } + } +} + +void MultitaskViewModelByWlcomHandler::onCurrentDesktopChanged(Workspace::Masks mask) +{ + Workspace *workspace = qobject_cast(sender()); + + if (mask & Workspace::Mask::Position) { + if (workspace->isActivated()){ + for (int i = 0; i < m_workspaceList.size(); i++) { + if (workspace->uuid() == m_workspaceList[i]->uuid()){ + m_workspaceList[i] = workspace; + emit currentDesktopChanged(0,i+1); + break; + } + } + } + } + + if (mask & Workspace::Mask::Activated) { + if (workspace->isActivated()){ + for (int i = 0; i < m_workspaceList.size(); i++) { + if (workspace->uuid() == m_workspaceList[i]->uuid()){ + m_workspaceList[i] = workspace; + emit currentDesktopChanged(0,i+1); + break; + } + } + } + } + +} + + +void MultitaskViewModelByWlcomHandler::connectSignals() +{ + // QObject::connect(KWindowSystem::self(), &KWindowSystem::windowAdded, + // this, &MultitaskViewModelByWlcomHandler::onWindowAdded); + // QObject::connect(KWindowSystem::self(), &KWindowSystem::windowRemoved, + // this, &MultitaskViewModelByWlcomHandler::onWindowDeleted); + // QObject::connect(KWindowSystem::self(), &KWindowSystem::activeWindowChanged, + // this, &MultitaskViewModelByWlcomHandler::onWindowActivated); + // QObject::connect(KWindowSystem::self(), static_cast(&KWindowSystem::windowChanged), + // this, &MultitaskViewModelByWlcomHandler::onDesktopPresenceChanged); + // QObject::connect(KWindowSystem::self(), &KWindowSystem::currentDesktopChanged, + // this, &MultitaskViewModelByWlcomHandler::onCurrentDesktopChanged); + // QObject::connect(KWindowSystem::self(), SIGNAL(numberOfDesktopsChanged(int)), + // this, SIGNAL(desktopNumberChanged())); +} diff --git a/windowsview/ukui-window-switch-wlcom/multitaskviewmodelbywlcomhandler.h b/windowsview/ukui-window-switch-wlcom/multitaskviewmodelbywlcomhandler.h new file mode 100644 index 0000000000000000000000000000000000000000..b4607d622279d17c371b0f963aac10993c0b66ab --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/multitaskviewmodelbywlcomhandler.h @@ -0,0 +1,93 @@ +/* + * Copyright (C) 2024, KylinSoft Co., Ltd. + + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef MULTITASKVIEWMODELBYWLCOMHANDLER_H +#define MULTITASKVIEWMODELBYWLCOMHANDLER_H +#include "../multitaskviewabstractmodelhandler.h" +#include +#include +#include +#include +#include +#include +#include "context.h" +//ukui-search +#include + +class MultitaskViewModelByWlcomHandler : public MultitaskViewAbstractModelHandler +{ + Q_OBJECT + +public: + explicit MultitaskViewModelByWlcomHandler(QObject *parent = nullptr); + ~MultitaskViewModelByWlcomHandler(); + + void removeAppWindow(QString windowId) override; + void moveAppWindowToDesktop(QString windowId, int srcDesktopInex, int destDesktopInex) override; + void activateAppWindow(QString windowId) override; + QVariant getWindowIcon(QString windowId) override; + void removeDesktop(int desktopIndex) override; + void moveDesktop(int srcDesktopIndex, int destDesktopIndex) override; + int getNumberOfDesktops() override; + void appendDesktop() override; + int getCurrentDesktop() override; + bool isCurrentDesktopShowingDesktop() override; + void setCurrentDesktop(int desktopIndex) override; + QRect getFullScreenGeometry(int desktopIndex, int screenIndex) override; + bool hasModalChildWindow(QString windowId) override; + bool isExtensionMode() override; + int logicalScreenCount() override; + QList createWindowList(int desktopIndex, int screenIndex) override; + QString getDesktopUuid(int desktopIndex) override; + QString getOutputUuid(int outputIndex) override; + void setDesktopName(const int desktopIndex, const QString name) override; + + static UkuiSearch::ApplicationInfo *getApplicationInfo(); + static QString desktopFileFromPid(uint pid); + +private: + bool shouldAcceptWindow(Toplevel *toplevel); + void createContext(); + void connectSignals(); + Toplevel *getToplevel(QString windowId); + Window windowFromToplevel(Toplevel *toplevel); + Context *m_context = nullptr; + QList m_allWindowList; + QList m_workspaceList; + QList m_outputList; + +signals: + void workspaceHasCreated(); + +private slots: + void onWindowAdded(Toplevel *toplevel); + void onOutputAdded(Output *output); + void onWindowDeleted(); + void onWindowActivated(Toplevel *toplevel); + void onWindowUpdate(Toplevel::Masks mask); + void onWorkSpaceAdded(Workspace *workspace); + void onWorkSpaceDeleted(); + // void onWorkSpaceActivated(int windowId); + void onCurrentDesktopChanged(Workspace::Masks mask); + void onDesktopPresenceChanged(Toplevel *toplevel, int oldDesktopIndex ,int newDesktopIndex); + void onOutputDeleted(); + +}; + +#endif // MULTITASKVIEWMODELBYWLCOMHANDLER_H diff --git a/windowsview/ukui-window-switch-wlcom/output.cpp b/windowsview/ukui-window-switch-wlcom/output.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0f1b9d8b97554b07be2e69a3bc22c10a3b85694c --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/output.cpp @@ -0,0 +1,283 @@ +/* + * Copyright (C) 2024, KylinSoft Co., Ltd. + + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "context.h" +#include + +class Output::Private +{ + public: + Private(Output *output); + ~Private(); + void setup(kywc_output *output); + + QString uuid; + QString name; + QString make; + QString model; + QString serial; + QString description; + QSize physical; + QList mode_list; + Mode cur_mode; + QPoint point; + QSize size; + Output::Capabilities capabilities; + int32_t transform; + float scale; + bool enabled, power, primary; + uint32_t brightness, color_temp; + + kywc_output *k_output; + + private: + Output *o; + static void stateHandle(kywc_output *output, uint32_t mask); + static void destroyHandle(kywc_output *output); + static struct kywc_output_interface output_impl; +}; + +Output::Private::Private(Output *output) : o(output) {} + +Output::Private::~Private() {} + +void Output::Private::stateHandle(kywc_output *output, uint32_t mask) +{ + Output *o_output = (Output *)kywc_output_get_user_data(output); + Output::Masks masks; + if (mask & KYWC_OUTPUT_STATE_ENABLED) { + o_output->pri->enabled = output->enabled; + masks |= Output::Mask::Enabled; + } + + if (mask & KYWC_OUTPUT_STATE_MODE) { + struct kywc_output_mode *mode = output->mode; + o_output->pri->cur_mode.size = QSize(mode->width, mode->height); + o_output->pri->cur_mode.refresh = mode->refresh; + o_output->pri->cur_mode.preferred = mode->preferred; + masks |= Output::Mask::Mode; + } + + if (mask & KYWC_OUTPUT_STATE_POSITION) { + o_output->pri->point = QPoint(output->x, output->y); + masks |= Output::Mask::Position; + } + + if (mask & KYWC_OUTPUT_STATE_TRANSFORM) { + o_output->pri->transform = output->transform; + masks |= Output::Mask::Transform; + } + + if (mask & KYWC_OUTPUT_STATE_SCALE) { + o_output->pri->scale = output->scale; + masks |= Output::Mask::Scale; + } + + if (mask & KYWC_OUTPUT_STATE_POWER) { + o_output->pri->power = output->power; + masks |= Output::Mask::Power; + } + + if (mask & KYWC_OUTPUT_STATE_PRIMARY) { + o_output->pri->primary = output->primary; + masks |= Output::Mask::Primary; + } + + if (mask & KYWC_OUTPUT_STATE_BRIGHTNESS) { + o_output->pri->brightness = output->brightness; + masks |= Output::Mask::Brightness; + } + + if (mask & KYWC_OUTPUT_STATE_COLOR_TEMP) { + o_output->pri->color_temp = output->color_temp; + masks |= Output::Mask::ColorTemp; + } + + emit o_output->stateUpdated(masks); +} + +void Output::Private::destroyHandle(kywc_output *output) +{ + Output *o_output = (Output *)kywc_output_get_user_data(output); + emit o_output->deleted(); +} + +struct kywc_output_interface Output::Private::output_impl { + stateHandle, destroyHandle, +}; + +void Output::Private::setup(kywc_output *output) +{ + k_output = output; + uuid = QString(output->uuid); + name = QString(output->name); + make = QString(output->make); + model = QString(output->model); + serial = QString(output->serial); + description = QString(output->description); + physical = QSize(output->physical_width, output->physical_height); + point = QPoint(output->x, output->y); + transform = output->transform; + scale = output->scale; + enabled = output->enabled; + power = output->power; + primary = output->primary; + brightness = output->brightness; + color_temp = output->color_temp; + + if (output->capabilities & KYWC_OUTPUT_CAPABILITY_POWER) + capabilities |= Output::Capability::Power; + if (output->capabilities & KYWC_OUTPUT_CAPABILITY_BRIGHTNESS) + capabilities |= Output::Capability::Brightness; + if (output->capabilities & KYWC_OUTPUT_CAPABILITY_COLOR_TEMP) + capabilities |= Output::Capability::ColorTemp; + + struct kywc_output_mode *output_mode, *tmp; + wl_list_for_each_safe(output_mode, tmp, &output->modes, link) { + Mode mod; + mod.size = QSize(output_mode->width, output_mode->height); + mod.refresh = output_mode->refresh; + mod.preferred = output_mode->preferred; + mode_list.append(mod); + } + + struct kywc_output_mode *mode = output->mode; + /* mode is null if output is disabled */ + if (mode) { + cur_mode.size = QSize(mode->width, mode->height); + cur_mode.refresh = mode->refresh; + cur_mode.preferred = mode->preferred; + } else { + cur_mode.size = QSize(0, 0); + cur_mode.refresh = 0; + cur_mode.preferred = false; + } + + kywc_output_set_user_data(output, this->o); + kywc_output_set_interface(output, &output_impl); +} + +Output::Output(QObject *parent) : pri(new Private(this)) {} + +Output::~Output() { + if(pri) { + delete pri; + pri = nullptr; + } +} + +void Output::setup(kywc_output *output) +{ + pri->setup(output); +} + +QString Output::name() const +{ + return pri->name; +} + +QString Output::uuid() const +{ + return pri->uuid; +} + +QString Output::make() const +{ + return pri->make; +} + +QString Output::model() const +{ + return pri->model; +} + +QString Output::serial() const +{ + return pri->serial; +} + +QString Output::description() const +{ + return pri->description; +} + +QSize Output::physicalSize() const +{ + return pri->physical; +} + +Output::Capabilities Output::capabilities() const +{ + return pri->capabilities; +} + +QList Output::modes() const +{ + return pri->mode_list; +} + +Output::Mode Output::curMode() const +{ + return pri->cur_mode; +} + +QPoint Output::point() const +{ + return pri->point; +} + +int Output::transform() const +{ + return pri->transform; +} + +float Output::scale() const +{ + return pri->scale; +} + +bool Output::isEnabled() const +{ + return pri->enabled; +} + +bool Output::isPower() const +{ + return pri->power; +} + +bool Output::isPrimary() const +{ + return pri->primary; +} + +uint32_t Output::brightness() const +{ + return pri->brightness; +} + +uint32_t Output::colorTemp() const +{ + return pri->color_temp; +} + +QSize Output::size() const +{ + return pri->size; +} diff --git a/windowsview/ukui-window-switch-wlcom/qtsingleapplication/CMakeLists.txt b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..784cb478e59a8278edf5b8785592203476410c27 --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.16) +project(qtsingleapplication) + +find_package(Qt5 COMPONENTS + Core Gui Widgets Network + REQUIRED) + +include_directories(src) +set(SRCS src/qtsingleapplication.h src/qtsingleapplication.cpp src/qtlocalpeer.h src/qtlocalpeer.cpp) + +add_library(${PROJECT_NAME} STATIC ${SRCS}) +target_include_directories(${PROJECT_NAME} PRIVATE src) +target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Network) diff --git a/windowsview/ukui-window-switch-wlcom/qtsingleapplication/INSTALL.TXT b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/INSTALL.TXT new file mode 100644 index 0000000000000000000000000000000000000000..bbb74a9d1f41bc4eb352e6d500642b2137e95b30 --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/INSTALL.TXT @@ -0,0 +1,254 @@ +INSTALLATION INSTRUCTIONS + +These instructions refer to the package you are installing as +some-package.tar.gz or some-package.zip. The .zip file is intended for use +on Windows. + +The directory you choose for the installation will be referred to as +your-install-dir. + +Note to Qt Visual Studio Integration users: In the instructions below, +instead of building from command line with nmake, you can use the menu +command 'Qt->Open Solution from .pro file' on the .pro files in the +example and plugin directories, and then build from within Visual +Studio. + +Unpacking and installation +-------------------------- + +1. Unpacking the archive (if you have not done so already). + + On Unix and Mac OS X (in a terminal window): + + cd your-install-dir + gunzip some-package.tar.gz + tar xvf some-package.tar + + This creates the subdirectory some-package containing the files. + + On Windows: + + Unpack the .zip archive by right-clicking it in explorer and + choosing "Extract All...". If your version of Windows does not + have zip support, you can use the infozip tools available + from www.info-zip.org. + + If you are using the infozip tools (in a command prompt window): + cd your-install-dir + unzip some-package.zip + +2. Configuring the package. + + The configure script is called "configure" on unix/mac and + "configure.bat" on Windows. It should be run from a command line + after cd'ing to the package directory. + + You can choose whether you want to use the component by including + its source code directly into your project, or build the component + as a dynamic shared library (DLL) that is loaded into the + application at run-time. The latter may be preferable for + technical or licensing (LGPL) reasons. If you want to build a DLL, + run the configure script with the argument "-library". Also see + the note about usage below. + + (Components that are Qt plugins, e.g. styles and image formats, + are by default built as a plugin DLL.) + + The configure script will prompt you in some cases for further + information. Answer these questions and carefully read the license text + before accepting the license conditions. The package cannot be used if + you do not accept the license conditions. + +3. Building the component and examples (when required). + + If a DLL is to be built, or if you would like to build the + examples, next give the commands + + qmake + make [or nmake if your are using Microsoft Visual C++] + + The example program(s) can be found in the directory called + "examples" or "example". + + Components that are Qt plugins, e.g. styles and image formats, are + ready to be used as soon as they are built, so the rest of this + installation instruction can be skipped. + +4. Building the Qt Designer plugin (optional). + + Some of the widget components are provided with plugins for Qt + Designer. To build and install the plugin, cd into the + some-package/plugin directory and give the commands + + qmake + make [or nmake if your are using Microsoft Visual C++] + + Restart Qt Designer to make it load the new widget plugin. + + Note: If you are using the built-in Qt Designer from the Qt Visual + Studio Integration, you will need to manually copy the plugin DLL + file, i.e. copy + %QTDIR%\plugins\designer\some-component.dll + to the Qt Visual Studio Integration plugin path, typically: + C:\Program Files\Trolltech\Qt VS Integration\plugins + + Note: If you for some reason are using a Qt Designer that is built + in debug mode, you will need to build the plugin in debug mode + also. Edit the file plugin.pro in the plugin directory, changing + 'release' to 'debug' in the CONFIG line, before running qmake. + + + +Solutions components are intended to be used directly from the package +directory during development, so there is no 'make install' procedure. + + +Using a component in your project +--------------------------------- + +To use this component in your project, add the following line to the +project's .pro file (or do the equivalent in your IDE): + + include(your-install-dir/some-package/src/some-package.pri) + +This adds the package's sources and headers to the SOURCES and HEADERS +project variables respectively (or, if the component has been +configured as a DLL, it adds that library to the LIBS variable), and +updates INCLUDEPATH to contain the package's src +directory. Additionally, the .pri file may include some dependencies +needed by the package. + +To include a header file from the package in your sources, you can now +simply use: + + #include + +or alternatively, in pre-Qt 4 style: + + #include + +Refer to the documentation to see the classes and headers this +components provides. + + + +Install documentation (optional) +-------------------------------- + +The HTML documentation for the package's classes is located in the +your-install-dir/some-package/doc/html/index.html. You can open this +file and read the documentation with any web browser. + +To install the documentation into Qt Assistant (for Qt version 4.4 and +later): + +1. In Assistant, open the Edit->Preferences dialog and choose the + Documentation tab. Click the Add... button and select the file + your-install-dir/some-package/doc/html/some-package.qch + +For Qt versions prior to 4.4, do instead the following: + +1. The directory your-install-dir/some-package/doc/html contains a + file called some-package.dcf. Execute the following commands in a + shell, command prompt or terminal window: + + cd your-install-dir/some-package/doc/html/ + assistant -addContentFile some-package.dcf + +The next time you start Qt Assistant, you can access the package's +documentation. + + +Removing the documentation from assistant +----------------------------------------- + +If you have installed the documentation into Qt Assistant, and want to uninstall it, do as follows, for Qt version 4.4 and later: + +1. In Assistant, open the Edit->Preferences dialog and choose the + Documentation tab. In the list of Registered Documentation, select + the item com.nokia.qtsolutions.some-package_version, and click + the Remove button. + +For Qt versions prior to 4.4, do instead the following: + +1. The directory your-install-dir/some-package/doc/html contains a + file called some-package.dcf. Execute the following commands in a + shell, command prompt or terminal window: + + cd your-install-dir/some-package/doc/html/ + assistant -removeContentFile some-package.dcf + + + +Using the component as a DLL +---------------------------- + +1. Normal components + + The shared library (DLL) is built and placed in the + some-package/lib directory. It is intended to be used directly + from there during development. When appropriate, both debug and + release versions are built, since the run-time linker will in some + cases refuse to load a debug-built DLL into a release-built + application or vice versa. + + The following steps are taken by default to help the dynamic + linker to locate the DLL at run-time (during development): + + Unix: The some-package.pri file will add linker instructions to + add the some-package/lib directory to the rpath of the + executable. (When distributing, or if your system does not support + rpath, you can copy the shared library to another place that is + searched by the dynamic linker, e.g. the "lib" directory of your + Qt installation.) + + Mac: The full path to the library is hardcoded into the library + itself, from where it is copied into the executable at link time, + and ready by the dynamic linker at run-time. (When distributing, + you will want to edit these hardcoded paths in the same way as for + the Qt DLLs. Refer to the document "Deploying an Application on + Mac OS X" in the Qt Reference Documentation.) + + Windows: the .dll file(s) are copied into the "bin" directory of + your Qt installation. The Qt installation will already have set up + that directory to be searched by the dynamic linker. + + +2. Plugins + + For Qt Solutions plugins (e.g. image formats), both debug and + release versions of the plugin are built by default when + appropriate, since in some cases the release Qt library will not + load a debug plugin, and vice versa. The plugins are automatically + copied into the plugins directory of your Qt installation when + built, so no further setup is required. + + Plugins may also be built statically, i.e. as a library that will be + linked into your application executable, and so will not need to + be redistributed as a separate plugin DLL to end users. Static + building is required if Qt itself is built statically. To do it, + just add "static" to the CONFIG variable in the plugin/plugin.pro + file before building. Refer to the "Static Plugins" section in the + chapter "How to Create Qt Plugins" for explanation of how to use a + static plugin in your application. The source code of the example + program(s) will also typically contain the relevant instructions + as comments. + + + +Uninstalling +------------ + + The following command will remove any fils that have been + automatically placed outside the package directory itself during + installation and building + + make distclean [or nmake if your are using Microsoft Visual C++] + + If Qt Assistant documentation or Qt Designer plugins have been + installed, they can be uninstalled manually, ref. above. + + +Enjoy! :) + +- The Qt Solutions Team. diff --git a/windowsview/ukui-window-switch-wlcom/qtsingleapplication/README.TXT b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/README.TXT new file mode 100644 index 0000000000000000000000000000000000000000..06abb09559608cb4391bd89591d4d12012ef1c6a --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/README.TXT @@ -0,0 +1,33 @@ +Qt Solutions Component: Single Application + +The QtSingleApplication component provides support for +applications that can be only started once per user. + + + +Version history: + +2.0: - Version 1.3 ported to Qt 4. + +2.1: - Fix compilation problem on Mac. + +2.2: - Really fix the Mac compilation problem. + - Mac: fix crash due to wrong object releasing. + - Mac: Fix memory leak. + +2.3: - Windows: Force creation of internal widget to make it work + with Qt 4.2. + +2.4: - Fix the system for automatic window raising on message + reception. NOTE: minor API change. + +2.5: - Mac: Fix isRunning() to work and report correctly. + +2.6: - - initialize() is now obsolete, no longer necessary to call + it + - - Fixed race condition where multiple instances migth be started + - - QtSingleCoreApplication variant provided for non-GUI (console) + usage + - Complete reimplementation. Visible changes: + - LGPL release. + diff --git a/windowsview/ukui-window-switch-wlcom/qtsingleapplication/buildlib/buildlib.pro b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/buildlib/buildlib.pro new file mode 100644 index 0000000000000000000000000000000000000000..37dddcdaa0c919a3d50e5308a0c4433e319d97e1 --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/buildlib/buildlib.pro @@ -0,0 +1,13 @@ +TEMPLATE=lib +CONFIG += qt dll qtsingleapplication-buildlib +mac:CONFIG += absolute_library_soname +win32|mac:!wince*:!win32-msvc:!macx-xcode:CONFIG += debug_and_release build_all +include(../src/qtsingleapplication.pri) +TARGET = $$QTSINGLEAPPLICATION_LIBNAME +DESTDIR = $$QTSINGLEAPPLICATION_LIBDIR +win32 { + DLLDESTDIR = $$[QT_INSTALL_BINS] + QMAKE_DISTCLEAN += $$[QT_INSTALL_BINS]\\$${QTSINGLEAPPLICATION_LIBNAME}.dll +} +target.path = $$DESTDIR +INSTALLS += target diff --git a/windowsview/ukui-window-switch-wlcom/qtsingleapplication/common.pri b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/common.pri new file mode 100644 index 0000000000000000000000000000000000000000..924c57c8839282f92f15c73cff6213a751814bba --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/common.pri @@ -0,0 +1,14 @@ +exists(config.pri):infile(config.pri, SOLUTIONS_LIBRARY, yes): CONFIG += qtsingleapplication-uselib + +TEMPLATE += fakelib +greaterThan(QT_MAJOR_VERSION, 5)|\ + if(equals(QT_MAJOR_VERSION, 5):greaterThan(QT_MINOR_VERSION, 4))|\ + if(equals(QT_MAJOR_VERSION, 5):equals(QT_MINOR_VERSION, 4):greaterThan(QT_PATCH_VERSION, 1)) { + QTSINGLEAPPLICATION_LIBNAME = $$qt5LibraryTarget(QtSolutions_SingleApplication-head) +} else { + QTSINGLEAPPLICATION_LIBNAME = $$qtLibraryTarget(QtSolutions_SingleApplication-head) +} +TEMPLATE -= fakelib + +QTSINGLEAPPLICATION_LIBDIR = $$PWD/lib +unix:qtsingleapplication-uselib:!qtsingleapplication-buildlib:QMAKE_RPATHDIR += $$QTSINGLEAPPLICATION_LIBDIR diff --git a/windowsview/ukui-window-switch-wlcom/qtsingleapplication/configure b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/configure new file mode 100755 index 0000000000000000000000000000000000000000..3c4edfff2b1f282066e8f767c140775e475efe2e --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/configure @@ -0,0 +1,25 @@ +#!/bin/sh + +if [ "x$1" != "x" -a "x$1" != "x-library" ]; then + echo "Usage: $0 [-library]" + echo + echo "-library: Build the component as a dynamic library (DLL). Default is to" + echo " include the component source code directly in the application." + echo + exit 0 +fi + +rm -f config.pri +if [ "x$1" = "x-library" ]; then + echo "Configuring to build this component as a dynamic library." + echo "SOLUTIONS_LIBRARY = yes" > config.pri +fi + +echo +echo "This component is now configured." +echo +echo "To build the component library (if requested) and example(s)," +echo "run qmake and your make command." +echo +echo "To remove or reconfigure, run make distclean." +echo diff --git a/windowsview/ukui-window-switch-wlcom/qtsingleapplication/configure.bat b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/configure.bat new file mode 100644 index 0000000000000000000000000000000000000000..2927549442a7046141a27f5800bbf2877e5bde1f --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/configure.bat @@ -0,0 +1,43 @@ +:: Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +:: SPDX-License-Identifier: BSD-3-Clause + +@echo off + +rem +rem "Main" +rem + +if not "%1"=="" ( + if not "%1"=="-library" ( + call :PrintUsage + goto EOF + ) +) + +if exist config.pri. del config.pri +if "%1"=="-library" ( + echo Configuring to build this component as a dynamic library. + echo SOLUTIONS_LIBRARY = yes > config.pri +) + +echo . +echo This component is now configured. +echo . +echo To build the component library (if requested) and example(s), +echo run qmake and your make or nmake command. +echo . +echo To remove or reconfigure, run make (nmake) distclean. +echo . +goto EOF + +:PrintUsage +echo Usage: configure.bat [-library] +echo . +echo -library: Build the component as a dynamic library (DLL). Default is to +echo include the component source directly in the application. +echo A DLL may be preferable for technical or licensing (LGPL) reasons. +echo . +goto EOF + + +:EOF diff --git a/windowsview/ukui-window-switch-wlcom/qtsingleapplication/doc/html/classic.css b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/doc/html/classic.css new file mode 100644 index 0000000000000000000000000000000000000000..b8cae8e1edbe98c493cb6464e8cc7e7c2a77e81f --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/doc/html/classic.css @@ -0,0 +1,284 @@ +BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV { + font-family: Arial, Geneva, Helvetica, sans-serif; +} +H1 { + text-align: center; + font-size: 160%; +} +H2 { + font-size: 120%; +} +H3 { + font-size: 100%; +} + +h3.fn,span.fn +{ + background-color: #eee; + border-width: 1px; + border-style: solid; + border-color: #ddd; + font-weight: bold; + padding: 6px 0px 6px 10px; + margin: 42px 0px 0px 0px; +} + +hr { + border: 0; + color: #a0a0a0; + background-color: #ccc; + height: 1px; + width: 100%; + text-align: left; + margin: 34px 0px 34px 0px; +} + +table.valuelist { + border-width: 1px 1px 1px 1px; + border-style: solid; + border-color: #dddddd; + border-collapse: collapse; + background-color: #f0f0f0; +} + +table.indextable { + border-width: 1px 1px 1px 1px; + border-style: solid; + border-collapse: collapse; + background-color: #f0f0f0; + border-color:#555; + font-size: 100%; +} + +table td.largeindex { + border-width: 1px 1px 1px 1px; + border-collapse: collapse; + background-color: #f0f0f0; + border-color:#555; + font-size: 120%; +} + +table.valuelist th { + border-width: 1px 1px 1px 2px; + padding: 4px; + border-style: solid; + border-color: #666; + color:white; + background-color:#666; +} + +th.titleheader { + border-width: 1px 0px 1px 0px; + padding: 2px; + border-style: solid; + border-color: #666; + color:white; + background-color:#555; + background-image:url('images/gradient.png')}; + background-repeat: repeat-x; + font-size: 100%; +} + + +th.largeheader { + border-width: 1px 0px 1px 0px; + padding: 4px; + border-style: solid; + border-color: #444; + color:white; + background-color:#555555; + font-size: 120%; +} + +p { + + margin-left: 4px; + margin-top: 8px; + margin-bottom: 8px; +} + +a:link +{ + color: #0046ad; + text-decoration: none +} + +a:visited +{ + color: #672967; + text-decoration: none +} + +a.obsolete +{ + color: #661100; + text-decoration: none +} + +a.compat +{ + color: #661100; + text-decoration: none +} + +a.obsolete:visited +{ + color: #995500; + text-decoration: none +} + +a.compat:visited +{ + color: #995500; + text-decoration: none +} + +body +{ + background: #ffffff; + color: black +} + +table.generic, table.annotated +{ + border-width: 1px; + border-color:#bbb; + border-style:solid; + border-collapse:collapse; +} + +table td.memItemLeft { + width: 180px; + padding: 2px 0px 0px 8px; + margin: 4px; + border-width: 1px; + border-color: #E0E0E0; + border-style: none; + font-size: 100%; + white-space: nowrap +} + +table td.memItemRight { + padding: 2px 8px 0px 8px; + margin: 4px; + border-width: 1px; + border-color: #E0E0E0; + border-style: none; + font-size: 100%; +} + +table tr.odd { + background: #f0f0f0; + color: black; +} + +table tr.even { + background: #e4e4e4; + color: black; +} + +table.annotated th { + padding: 3px; + text-align: left +} + +table.annotated td { + padding: 3px; +} + +table tr pre +{ + padding-top: 0px; + padding-bottom: 0px; + padding-left: 0px; + padding-right: 0px; + border: none; + background: none +} + +tr.qt-style +{ + background: #96E066; + color: black +} + +body pre +{ + padding: 0.2em; + border: #e7e7e7 1px solid; + background: #f1f1f1; + color: black +} + +table tr.qt-code pre +{ + padding: 0.2em; + border: #e7e7e7 1px solid; + background: #f1f1f1; + color: black +} + +span.preprocessor, span.preprocessor a +{ + color: darkblue; +} + +span.comment +{ + color: darkred; + font-style: italic +} + +span.string,span.char +{ + color: darkgreen; +} + +.title +{ + text-align: center +} + +.subtitle +{ + font-size: 0.8em +} + +.small-subtitle +{ + font-size: 0.65em +} + +.qmlitem { + padding: 0; +} + +.qmlname { + white-space: nowrap; +} + +.qmltype { + text-align: center; + font-size: 160%; +} + +.qmlproto { + background-color: #eee; + border-width: 1px; + border-style: solid; + border-color: #ddd; + font-weight: bold; + padding: 6px 10px 6px 10px; + margin: 42px 0px 0px 0px; +} + +.qmlreadonly { + float: right; + color: red +} + +.qmldoc { +} + +*.qmlitem p { +} diff --git a/windowsview/ukui-window-switch-wlcom/qtsingleapplication/doc/html/images/qt-logo.png b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/doc/html/images/qt-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..794162f5af58e7b38beebf472842fc9703ede19b Binary files /dev/null and b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/doc/html/images/qt-logo.png differ diff --git a/windowsview/ukui-window-switch-wlcom/qtsingleapplication/doc/html/index.html b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/doc/html/index.html new file mode 100644 index 0000000000000000000000000000000000000000..af9dab10a91dd719fd2f748d5e4b57dd82765bbc --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/doc/html/index.html @@ -0,0 +1,48 @@ + + + + + + Single Application + + + + + + + +
  Home

Single Application
+

+ +

Description

+

The QtSingleApplication component provides support for applications that can be only started once per user.

+

For some applications it is useful or even critical that they are started only once by any user. Future attempts to start the application should activate any already running instance, and possibly perform requested actions, e.g. loading a file, in that instance.

+

The QtSingleApplication class provides an interface to detect a running instance, and to send command strings to that instance. For console (non-GUI) applications, the QtSingleCoreApplication variant is provided, which avoids dependency on QtGui.

+ +

Classes

+ + +

Examples

+ + +

Tested platforms

+
    +
  • Qt 4.4, 4.5 / Windows XP / MSVC.NET 2005
  • +
  • Qt 4.4, 4.5 / Linux / gcc
  • +
  • Qt 4.4, 4.5 / MacOS X 10.5 / gcc
  • +
+


+ + + + +
Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies)Trademarks
Qt Solutions
+ diff --git a/windowsview/ukui-window-switch-wlcom/qtsingleapplication/doc/html/qtsingleapplication-example-loader.html b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/doc/html/qtsingleapplication-example-loader.html new file mode 100644 index 0000000000000000000000000000000000000000..6a3663298cb134bb68f84dfcb2fe02a9a2c397e9 --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/doc/html/qtsingleapplication-example-loader.html @@ -0,0 +1,175 @@ + + + + + + Loading Documents + + + + + + + +
  Home

Loading Documents
+

+

The application in this example loads or prints the documents passed as commandline parameters to further instances of this application.

+
 /****************************************************************************
+ **
+ ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of the Qt Solutions component.
+ **
+ ** You may use this file under the terms of the BSD license as follows:
+ **
+ ** "Redistribution and use in source and binary forms, with or without
+ ** modification, are permitted provided that the following conditions are
+ ** met:
+ **   * Redistributions of source code must retain the above copyright
+ **     notice, this list of conditions and the following disclaimer.
+ **   * Redistributions in binary form must reproduce the above copyright
+ **     notice, this list of conditions and the following disclaimer in
+ **     the documentation and/or other materials provided with the
+ **     distribution.
+ **   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+ **     the names of its contributors may be used to endorse or promote
+ **     products derived from this software without specific prior written
+ **     permission.
+ **
+ ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+ **
+ ****************************************************************************/
+
+ #include <qtsingleapplication.h>
+ #include <QtCore/QFile>
+ #include <QtGui/QMainWindow>
+ #include <QtGui/QPrinter>
+ #include <QtGui/QPainter>
+ #include <QtGui/QTextEdit>
+ #include <QtGui/QMdiArea>
+ #include <QtCore/QTextStream>
+
+ class MainWindow : public QMainWindow
+ {
+     Q_OBJECT
+ public:
+     MainWindow();
+
+ public slots:
+     void handleMessage(const QString& message);
+
+ signals:
+     void needToShow();
+
+ private:
+     QMdiArea *workspace;
+ };
+

The user interface in this application is a QMainWindow subclass with a QMdiArea as the central widget. It implements a slot handleMessage() that will be connected to the messageReceived() signal of the QtSingleApplication class.

+
 MainWindow::MainWindow()
+ {
+     workspace = new QMdiArea(this);
+
+     setCentralWidget(workspace);
+ }
+

The MainWindow constructor creates a minimal user interface.

+
 void MainWindow::handleMessage(const QString& message)
+ {
+     enum Action {
+         Nothing,
+         Open,
+         Print
+     } action;
+
+     action = Nothing;
+     QString filename = message;
+     if (message.toLower().startsWith("/print ")) {
+         filename = filename.mid(7);
+         action = Print;
+     } else if (!message.isEmpty()) {
+         action = Open;
+     }
+     if (action == Nothing) {
+         emit needToShow();
+         return;
+     }
+
+     QFile file(filename);
+     QString contents;
+     if (file.open(QIODevice::ReadOnly))
+         contents = file.readAll();
+     else
+         contents = "[[Error: Could not load file " + filename + "]]";
+
+     QTextEdit *view = new QTextEdit;
+     view->setPlainText(contents);
+
+     switch(action) {
+

The handleMessage() slot interprets the message passed in as a filename that can be prepended with /print to indicate that the file should just be printed rather than loaded.

+
     case Print:
+         {
+             QPrinter printer;
+             view->print(&printer);
+             delete view;
+         }
+         break;
+
+     case Open:
+         {
+             workspace->addSubWindow(view);
+             view->setWindowTitle(message);
+             view->show();
+             emit needToShow();
+         }
+         break;
+     default:
+         break;
+     };
+ }
+

Loading the file will also activate the window.

+
 #include "main.moc"
+
+ int main(int argc, char **argv)
+ {
+     QtSingleApplication instance("File loader QtSingleApplication example", argc, argv);
+     QString message;
+     for (int a = 1; a < argc; ++a) {
+         message += argv[a];
+         if (a < argc-1)
+             message += " ";
+     }
+
+     if (instance.sendMessage(message))
+         return 0;
+

The main entry point function creates a QtSingleApplication object, and creates a message to send to a running instance of the application. If the message was sent successfully the process exits immediately.

+
     MainWindow mw;
+     mw.handleMessage(message);
+     mw.show();
+
+     QObject::connect(&instance, SIGNAL(messageReceived(const QString&)),
+                      &mw, SLOT(handleMessage(const QString&)));
+
+     instance.setActivationWindow(&mw, false);
+     QObject::connect(&mw, SIGNAL(needToShow()), &instance, SLOT(activateWindow()));
+
+     return instance.exec();
+ }
+

If the message could not be sent the application starts up. Note that false is passed to the call to setActivationWindow() to prevent automatic activation for every message received, e.g. when the application should just print a file. Instead, the message handling function determines whether activation is requested, and signals that by emitting the needToShow() signal. This is then simply connected directly to QtSingleApplication's activateWindow() slot.

+


+ + + + +
Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies)Trademarks
Qt Solutions
+ diff --git a/windowsview/ukui-window-switch-wlcom/qtsingleapplication/doc/html/qtsingleapplication-example-trivial.html b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/doc/html/qtsingleapplication-example-trivial.html new file mode 100644 index 0000000000000000000000000000000000000000..5e60cfa4f5e1aa420028a14c0ff5ecda90f48e88 --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/doc/html/qtsingleapplication-example-trivial.html @@ -0,0 +1,101 @@ + + + + + + A Trivial Example + + + + + + + +
  Home

A Trivial Example
+

+

The application in this example has a log-view that displays messages sent by further instances of the same application.

+

The example demonstrates the use of the QtSingleApplication class to detect and communicate with a running instance of the application using the sendMessage() API. The messageReceived() signal is used to display received messages in a QTextEdit log.

+
 /****************************************************************************
+ **
+ ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of the Qt Solutions component.
+ **
+ ** You may use this file under the terms of the BSD license as follows:
+ **
+ ** "Redistribution and use in source and binary forms, with or without
+ ** modification, are permitted provided that the following conditions are
+ ** met:
+ **   * Redistributions of source code must retain the above copyright
+ **     notice, this list of conditions and the following disclaimer.
+ **   * Redistributions in binary form must reproduce the above copyright
+ **     notice, this list of conditions and the following disclaimer in
+ **     the documentation and/or other materials provided with the
+ **     distribution.
+ **   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+ **     the names of its contributors may be used to endorse or promote
+ **     products derived from this software without specific prior written
+ **     permission.
+ **
+ ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+ **
+ ****************************************************************************/
+
+ #include <qtsingleapplication.h>
+ #include <QtGui/QTextEdit>
+
+ class TextEdit : public QTextEdit
+ {
+     Q_OBJECT
+ public:
+     TextEdit(QWidget *parent = 0)
+         : QTextEdit(parent)
+     {}
+ public slots:
+     void append(const QString &str)
+     {
+         QTextEdit::append(str);
+     }
+ };
+
+ #include "main.moc"
+
+ int main(int argc, char **argv)
+ {
+     QtSingleApplication instance(argc, argv);
+

The example has only the main entry point function. A QtSingleApplication object is created immediately.

+
     if (instance.sendMessage("Wake up!"))
+         return 0;
+

If another instance of this application is already running, sendMessage() will succeed, and this instance just exits immediately.

+
     TextEdit logview;
+     logview.setReadOnly(true);
+     logview.show();
+

Otherwise the instance continues as normal and creates the user interface.

+
     instance.setActivationWindow(&logview);
+
+     QObject::connect(&instance, SIGNAL(messageReceived(const QString&)),
+                      &logview, SLOT(append(const QString&)));
+
+     return instance.exec();
+

The logview object is also set as the application's activation window. Every time a message is received, the window will be raised and activated automatically.

+

The messageReceived() signal is also connected to the QTextEdit's append() slot. Every message received from further instances of this application will be displayed in the log.

+

Finally the event loop is entered.

+


+ + + + +
Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies)Trademarks
Qt Solutions
+ diff --git a/windowsview/ukui-window-switch-wlcom/qtsingleapplication/doc/html/qtsingleapplication-members.html b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/doc/html/qtsingleapplication-members.html new file mode 100644 index 0000000000000000000000000000000000000000..c995ce3f88e39cd76b90b27538f5f5c545deb2b3 --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/doc/html/qtsingleapplication-members.html @@ -0,0 +1,235 @@ + + + + + + List of All Members for QtSingleApplication + + + + + + + +
  Home

List of All Members for QtSingleApplication

+

This is the complete list of members for QtSingleApplication, including inherited members.

+

+ +
+

+


+ + + + +
Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies)Trademarks
Qt Solutions
+ diff --git a/windowsview/ukui-window-switch-wlcom/qtsingleapplication/doc/html/qtsingleapplication-obsolete.html b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/doc/html/qtsingleapplication-obsolete.html new file mode 100644 index 0000000000000000000000000000000000000000..0d07dfae33bb248bd6519ef31c7e2a00267b4a8c --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/doc/html/qtsingleapplication-obsolete.html @@ -0,0 +1,31 @@ + + + + + + Obsolete Members for QtSingleApplication + + + + + + + +
  Home

Obsolete Members for QtSingleApplication

+

The following class members are obsolete. They are provided to keep old source code working. We strongly advise against using them in new code.

+

+

Public Functions

+ + +
void initialize ( bool dummy = true )   (obsolete)
+
+

Member Function Documentation

+

void QtSingleApplication::initialize ( bool dummy = true )

+


+ + + + +
Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies)Trademarks
Qt Solutions
+ diff --git a/windowsview/ukui-window-switch-wlcom/qtsingleapplication/doc/html/qtsingleapplication.dcf b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/doc/html/qtsingleapplication.dcf new file mode 100644 index 0000000000000000000000000000000000000000..d81f87fbb7b456fea32eaed2b6280217bf516c18 --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/doc/html/qtsingleapplication.dcf @@ -0,0 +1,40 @@ + + +
+
+ QtSingleApplication + activateWindow + activationWindow + id + isRunning + messageReceived + sendMessage + setActivationWindow +
+
+
+
+ QtSingleCoreApplication + id + isRunning + messageReceived + sendMessage +
+
+
+
+
+ A non-GUI example +
+
+ A Trivial Example +
+
+ Loading Documents +
+
+ Single Application +
+
+
+ diff --git a/windowsview/ukui-window-switch-wlcom/qtsingleapplication/doc/html/qtsingleapplication.html b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/doc/html/qtsingleapplication.html new file mode 100644 index 0000000000000000000000000000000000000000..2754a3b9ea8fd7e752bc20fb859b837968c422df --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/doc/html/qtsingleapplication.html @@ -0,0 +1,162 @@ + + + + + + QtSingleApplication Class Reference + + + + + + + +
  Home

QtSingleApplication Class Reference

+

The QtSingleApplication class provides an API to detect and communicate with running instances of an application. More...

+
 #include <QtSingleApplication>

Inherits QApplication.

+ +
+ +

Public Functions

+ + + + + + + + + + + +
QtSingleApplication ( int & argc, char ** argv, bool GUIenabled = true )
QtSingleApplication ( const QString & appId, int & argc, char ** argv )
QtSingleApplication ( int & argc, char ** argv, Type type )
QtSingleApplication ( Display * dpy, Qt::HANDLE visual = 0, Qt::HANDLE cmap = 0 )
QtSingleApplication ( Display * dpy, int & argc, char ** argv, Qt::HANDLE visual = 0, Qt::HANDLE cmap = 0 )
QtSingleApplication ( Display * dpy, const QString & appId, int argc, char ** argv, Qt::HANDLE visual = 0, Qt::HANDLE cmap = 0 )
QWidget * activationWindow () const
QString id () const
bool isRunning ()
void setActivationWindow ( QWidget * aw, bool activateOnMessage = true )
+ +
+ +

Public Slots

+ + + +
void activateWindow ()
bool sendMessage ( const QString & message, int timeout = 5000 )
+ +
+ +

Signals

+ + +
void messageReceived ( const QString & message )
+ +

Additional Inherited Members

+ + +
+

Detailed Description

+

The QtSingleApplication class provides an API to detect and communicate with running instances of an application.

+

This class allows you to create applications where only one instance should be running at a time. I.e., if the user tries to launch another instance, the already running instance will be activated instead. Another usecase is a client-server system, where the first started instance will assume the role of server, and the later instances will act as clients of that server.

+

By default, the full path of the executable file is used to determine whether two processes are instances of the same application. You can also provide an explicit identifier string that will be compared instead.

+

The application should create the QtSingleApplication object early in the startup phase, and call isRunning() to find out if another instance of this application is already running. If isRunning() returns false, it means that no other instance is running, and this instance has assumed the role as the running instance. In this case, the application should continue with the initialization of the application user interface before entering the event loop with exec(), as normal.

+

The messageReceived() signal will be emitted when the running application receives messages from another instance of the same application. When a message is received it might be helpful to the user to raise the application so that it becomes visible. To facilitate this, QtSingleApplication provides the setActivationWindow() function and the activateWindow() slot.

+

If isRunning() returns true, another instance is already running. It may be alerted to the fact that another instance has started by using the sendMessage() function. Also data such as startup parameters (e.g. the name of the file the user wanted this new instance to open) can be passed to the running instance with this function. Then, the application should terminate (or enter client mode).

+

If isRunning() returns true, but sendMessage() fails, that is an indication that the running instance is frozen.

+

Here's an example that shows how to convert an existing application to use QtSingleApplication. It is very simple and does not make use of all QtSingleApplication's functionality (see the examples for that).

+
 // Original
+ int main(int argc, char **argv)
+ {
+     QApplication app(argc, argv);
+
+     MyMainWidget mmw;
+     mmw.show();
+     return app.exec();
+ }
+
+ // Single instance
+ int main(int argc, char **argv)
+ {
+     QtSingleApplication app(argc, argv);
+
+     if (app.isRunning())
+         return !app.sendMessage(someDataString);
+
+     MyMainWidget mmw;
+     app.setActivationWindow(&mmw);
+     mmw.show();
+     return app.exec();
+ }
+

Once this QtSingleApplication instance is destroyed (normally when the process exits or crashes), when the user next attempts to run the application this instance will not, of course, be encountered. The next instance to call isRunning() or sendMessage() will assume the role as the new running instance.

+

For console (non-GUI) applications, QtSingleCoreApplication may be used instead of this class, to avoid the dependency on the QtGui library.

+

See also QtSingleCoreApplication.

+
+

Member Function Documentation

+

QtSingleApplication::QtSingleApplication ( int & argc, char ** argv, bool GUIenabled = true )

+

Creates a QtSingleApplication object. The application identifier will be QCoreApplication::applicationFilePath(). argc, argv, and GUIenabled are passed on to the QAppliation constructor.

+

If you are creating a console application (i.e. setting GUIenabled to false), you may consider using QtSingleCoreApplication instead.

+

QtSingleApplication::QtSingleApplication ( const QString & appId, int & argc, char ** argv )

+

Creates a QtSingleApplication object with the application identifier appId. argc and argv are passed on to the QAppliation constructor.

+

QtSingleApplication::QtSingleApplication ( int & argc, char ** argv, Type type )

+

Creates a QtSingleApplication object. The application identifier will be QCoreApplication::applicationFilePath(). argc, argv, and type are passed on to the QAppliation constructor.

+

QtSingleApplication::QtSingleApplication ( Display * dpy, Qt::HANDLE visual = 0, Qt::HANDLE cmap = 0 )

+

Special constructor for X11, ref. the documentation of QApplication's corresponding constructor. The application identifier will be QCoreApplication::applicationFilePath(). dpy, visual, and cmap are passed on to the QApplication constructor.

+

QtSingleApplication::QtSingleApplication ( Display * dpy, int & argc, char ** argv, Qt::HANDLE visual = 0, Qt::HANDLE cmap = 0 )

+

Special constructor for X11, ref. the documentation of QApplication's corresponding constructor. The application identifier will be QCoreApplication::applicationFilePath(). dpy, argc, argv, visual, and cmap are passed on to the QApplication constructor.

+

QtSingleApplication::QtSingleApplication ( Display * dpy, const QString & appId, int argc, char ** argv, Qt::HANDLE visual = 0, Qt::HANDLE cmap = 0 )

+

Special constructor for X11, ref. the documentation of QApplication's corresponding constructor. The application identifier will be appId. dpy, argc, argv, visual, and cmap are passed on to the QApplication constructor.

+

void QtSingleApplication::activateWindow ()   [slot]

+

De-minimizes, raises, and activates this application's activation window. This function does nothing if no activation window has been set.

+

This is a convenience function to show the user that this application instance has been activated when he has tried to start another instance.

+

This function should typically be called in response to the messageReceived() signal. By default, that will happen automatically, if an activation window has been set.

+

See also setActivationWindow(), messageReceived(), and initialize().

+

QWidget * QtSingleApplication::activationWindow () const

+

Returns the applications activation window if one has been set by calling setActivationWindow(), otherwise returns 0.

+

See also setActivationWindow().

+

QString QtSingleApplication::id () const

+

Returns the application identifier. Two processes with the same identifier will be regarded as instances of the same application.

+

bool QtSingleApplication::isRunning ()

+

Returns true if another instance of this application is running; otherwise false.

+

This function does not find instances of this application that are being run by a different user (on Windows: that are running in another session).

+

See also sendMessage().

+

void QtSingleApplication::messageReceived ( const QString & message )   [signal]

+

This signal is emitted when the current instance receives a message from another instance of this application.

+

See also sendMessage(), setActivationWindow(), and activateWindow().

+

bool QtSingleApplication::sendMessage ( const QString & message, int timeout = 5000 )   [slot]

+

Tries to send the text message to the currently running instance. The QtSingleApplication object in the running instance will emit the messageReceived() signal when it receives the message.

+

This function returns true if the message has been sent to, and processed by, the current instance. If there is no instance currently running, or if the running instance fails to process the message within timeout milliseconds, this function return false.

+

See also isRunning() and messageReceived().

+

void QtSingleApplication::setActivationWindow ( QWidget * aw, bool activateOnMessage = true )

+

Sets the activation window of this application to aw. The activation window is the widget that will be activated by activateWindow(). This is typically the application's main window.

+

If activateOnMessage is true (the default), the window will be activated automatically every time a message is received, just prior to the messageReceived() signal being emitted.

+

See also activationWindow(), activateWindow(), and messageReceived().

+


+ + + + +
Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies)Trademarks
Qt Solutions
+ diff --git a/windowsview/ukui-window-switch-wlcom/qtsingleapplication/doc/html/qtsingleapplication.index b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/doc/html/qtsingleapplication.index new file mode 100644 index 0000000000000000000000000000000000000000..56052c2a2d36a08abe4d8cdd46c359ebce901e57 --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/doc/html/qtsingleapplication.index @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/windowsview/ukui-window-switch-wlcom/qtsingleapplication/doc/html/qtsingleapplication.qhp b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/doc/html/qtsingleapplication.qhp new file mode 100644 index 0000000000000000000000000000000000000000..ff42d9df482746b1ae43bbaeb1f5d6bb0c219f6c --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/doc/html/qtsingleapplication.qhp @@ -0,0 +1,53 @@ + + + com.nokia.qtsolutions.qtsingleapplication_head + qdoc + + qt + solutions + qtsingleapplication + + + qt + solutions + qtsingleapplication + +
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + qtsingleapplication.html + index.html + qtsingleapplication-example-trivial.html + qtsinglecoreapplication.html + qtsingleapplication-example-loader.html + qtsinglecoreapplication-example-console.html + classic.css + images/qt-logo.png + + + diff --git a/windowsview/ukui-window-switch-wlcom/qtsingleapplication/doc/html/qtsinglecoreapplication-example-console.html b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/doc/html/qtsinglecoreapplication-example-console.html new file mode 100644 index 0000000000000000000000000000000000000000..18a9ae89bfb609d8cbae8221b8eb41fb778b4ab9 --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/doc/html/qtsinglecoreapplication-example-console.html @@ -0,0 +1,118 @@ + + + + + + A non-GUI example + + + + + + + +
  Home

A non-GUI example
+

+

This example shows how to use the single-application functionality in a console application. It does not require the QtGui library at all.

+

The only differences from the GUI application usage demonstrated in the other examples are:

+

1) The .pro file should include qtsinglecoreapplication.pri instead of qtsingleapplication.pri

+

2) The class name is QtSingleCoreApplication instead of QtSingleApplication.

+

3) No calls are made regarding window activation, for obvious reasons.

+

console.pro:

+
 TEMPLATE   = app
+ CONFIG    += console
+ SOURCES   += main.cpp
+ include(../../src/qtsinglecoreapplication.pri)
+ QT -= gui
+

main.cpp:

+
 /****************************************************************************
+ **
+ ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of the Qt Solutions component.
+ **
+ ** You may use this file under the terms of the BSD license as follows:
+ **
+ ** "Redistribution and use in source and binary forms, with or without
+ ** modification, are permitted provided that the following conditions are
+ ** met:
+ **   * Redistributions of source code must retain the above copyright
+ **     notice, this list of conditions and the following disclaimer.
+ **   * Redistributions in binary form must reproduce the above copyright
+ **     notice, this list of conditions and the following disclaimer in
+ **     the documentation and/or other materials provided with the
+ **     distribution.
+ **   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+ **     the names of its contributors may be used to endorse or promote
+ **     products derived from this software without specific prior written
+ **     permission.
+ **
+ ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+ **
+ ****************************************************************************/
+
+ #include "qtsinglecoreapplication.h"
+ #include <QtCore/QDebug>
+
+ void report(const QString& msg)
+ {
+     qDebug("[%i] %s", (int)QCoreApplication::applicationPid(), qPrintable(msg));
+ }
+
+ class MainClass : public QObject
+ {
+     Q_OBJECT
+ public:
+     MainClass()
+         : QObject()
+         {}
+
+ public slots:
+     void handleMessage(const QString& message)
+         {
+             report( "Message received: \"" + message + "\"");
+         }
+ };
+
+ int main(int argc, char **argv)
+ {
+     report("Starting up");
+
+     QtSingleCoreApplication app(argc, argv);
+
+     if (app.isRunning()) {
+         QString msg(QString("Hi master, I am %1.").arg(QCoreApplication::applicationPid()));
+         bool sentok = app.sendMessage(msg, 2000);
+         QString rep("Another instance is running, so I will exit.");
+         rep += sentok ? " Message sent ok." : " Message sending failed; the other instance may be frozen.";
+         report(rep);
+         return 0;
+     } else {
+         report("No other instance is running; so I will.");
+         MainClass mainObj;
+         QObject::connect(&app, SIGNAL(messageReceived(const QString&)),
+                          &mainObj, SLOT(handleMessage(const QString&)));
+         return app.exec();
+     }
+ }
+
+ #include "main.moc"
+


+ + + + +
Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies)Trademarks
Qt Solutions
+ diff --git a/windowsview/ukui-window-switch-wlcom/qtsingleapplication/doc/html/qtsinglecoreapplication-members.html b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/doc/html/qtsinglecoreapplication-members.html new file mode 100644 index 0000000000000000000000000000000000000000..69fb858167221811e18ed20016aa9c68dbc66fbb --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/doc/html/qtsinglecoreapplication-members.html @@ -0,0 +1,126 @@ + + + + + + List of All Members for QtSingleCoreApplication + + + + + + + +
  Home

List of All Members for QtSingleCoreApplication

+

This is the complete list of members for QtSingleCoreApplication, including inherited members.

+

+ +
+

+


+ + + + +
Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies)Trademarks
Qt Solutions
+ diff --git a/windowsview/ukui-window-switch-wlcom/qtsingleapplication/doc/html/qtsinglecoreapplication.html b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/doc/html/qtsinglecoreapplication.html new file mode 100644 index 0000000000000000000000000000000000000000..a20cf2f4f3097aaed747a8f74a02273aaf4606eb --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/doc/html/qtsinglecoreapplication.html @@ -0,0 +1,98 @@ + + + + + + QtSingleCoreApplication Class Reference + + + + + + + +
  Home

QtSingleCoreApplication Class Reference

+

A variant of the QtSingleApplication class for non-GUI applications. More...

+
 #include <QtSingleCoreApplication>

Inherits QCoreApplication.

+ +
+ +

Public Functions

+ + + + + +
QtSingleCoreApplication ( int & argc, char ** argv )
QtSingleCoreApplication ( const QString & appId, int & argc, char ** argv )
QString id () const
bool isRunning ()
+ +
+ +

Public Slots

+ + +
bool sendMessage ( const QString & message, int timeout = 5000 )
+ +
+ +

Signals

+ + +
void messageReceived ( const QString & message )
+ +

Additional Inherited Members

+ + +
+

Detailed Description

+

A variant of the QtSingleApplication class for non-GUI applications.

+

This class is a variant of QtSingleApplication suited for use in console (non-GUI) applications. It is an extension of QCoreApplication (instead of QApplication). It does not require the QtGui library.

+

The API and usage is identical to QtSingleApplication, except that functions relating to the "activation window" are not present, for obvious reasons. Please refer to the QtSingleApplication documentation for explanation of the usage.

+

A QtSingleCoreApplication instance can communicate to a QtSingleApplication instance if they share the same application id. Hence, this class can be used to create a light-weight command-line tool that sends commands to a GUI application.

+

See also QtSingleApplication.

+
+

Member Function Documentation

+

QtSingleCoreApplication::QtSingleCoreApplication ( int & argc, char ** argv )

+

Creates a QtSingleCoreApplication object. The application identifier will be QCoreApplication::applicationFilePath(). argc and argv are passed on to the QCoreAppliation constructor.

+

QtSingleCoreApplication::QtSingleCoreApplication ( const QString & appId, int & argc, char ** argv )

+

Creates a QtSingleCoreApplication object with the application identifier appId. argc and argv are passed on to the QCoreAppliation constructor.

+

QString QtSingleCoreApplication::id () const

+

Returns the application identifier. Two processes with the same identifier will be regarded as instances of the same application.

+

bool QtSingleCoreApplication::isRunning ()

+

Returns true if another instance of this application is running; otherwise false.

+

This function does not find instances of this application that are being run by a different user (on Windows: that are running in another session).

+

See also sendMessage().

+

void QtSingleCoreApplication::messageReceived ( const QString & message )   [signal]

+

This signal is emitted when the current instance receives a message from another instance of this application.

+

See also sendMessage().

+

bool QtSingleCoreApplication::sendMessage ( const QString & message, int timeout = 5000 )   [slot]

+

Tries to send the text message to the currently running instance. The QtSingleCoreApplication object in the running instance will emit the messageReceived() signal when it receives the message.

+

This function returns true if the message has been sent to, and processed by, the current instance. If there is no instance currently running, or if the running instance fails to process the message within timeout milliseconds, this function return false.

+

See also isRunning() and messageReceived().

+


+ + + + +
Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies)Trademarks
Qt Solutions
+ diff --git a/windowsview/ukui-window-switch-wlcom/qtsingleapplication/doc/images/qt-logo.png b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/doc/images/qt-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..794162f5af58e7b38beebf472842fc9703ede19b Binary files /dev/null and b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/doc/images/qt-logo.png differ diff --git a/windowsview/ukui-window-switch-wlcom/qtsingleapplication/doc/index.qdoc b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/doc/index.qdoc new file mode 100644 index 0000000000000000000000000000000000000000..796dffe9c64324870b418b13705b8b33e50a4a29 --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/doc/index.qdoc @@ -0,0 +1,50 @@ +// Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +// SPDX-License-Identifier: BSD-3-Clause + +/*! + \page index.html + \title Single Application + + \section1 Description + + The QtSingleApplication component provides support + for applications that can be only started once per user. + + + + For some applications it is useful or even critical that they are started + only once by any user. Future attempts to start the application should + activate any already running instance, and possibly perform requested + actions, e.g. loading a file, in that instance. + + The QtSingleApplication class provides an interface to detect a running + instance, and to send command strings to that instance. + For console (non-GUI) applications, the QtSingleCoreApplication variant is provided, which avoids dependency on QtGui. + + + + + \section1 Classes + \list + \i QtSingleApplication \i QtSingleCoreApplication\endlist + + \section1 Examples + \list + \i \link qtsingleapplication-example-trivial.html A Trivial Example \endlink \i \link qtsingleapplication-example-loader.html Loading Documents \endlink \i \link qtsinglecoreapplication-example-console.html A Non-GUI Example \endlink \endlist + + + + + + + \section1 Tested platforms + \list + \i Qt 4.4, 4.5 / Windows XP / MSVC.NET 2005 + \i Qt 4.4, 4.5 / Linux / gcc + \i Qt 4.4, 4.5 / MacOS X 10.5 / gcc + \endlist + + + + +*/ diff --git a/windowsview/ukui-window-switch-wlcom/qtsingleapplication/examples/console/console.pro b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/examples/console/console.pro new file mode 100644 index 0000000000000000000000000000000000000000..e0390e2335a17c481bfeb6c1342b12597ae5dc33 --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/examples/console/console.pro @@ -0,0 +1,5 @@ +TEMPLATE = app +CONFIG += console +SOURCES += main.cpp +include(../../src/qtsinglecoreapplication.pri) +QT -= gui diff --git a/windowsview/ukui-window-switch-wlcom/qtsingleapplication/examples/console/console.qdoc b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/examples/console/console.qdoc new file mode 100644 index 0000000000000000000000000000000000000000..2706e269b9867b1ef93aec4620cf53d811375682 --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/examples/console/console.qdoc @@ -0,0 +1,28 @@ +// Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +// SPDX-License-Identifier: BSD-3-Clause + +/*! \page qtsinglecoreapplication-example-console.html + \title A non-GUI example + + This example shows how to use the single-application functionality + in a console application. It does not require the \c QtGui library + at all. + + The only differences from the GUI application usage demonstrated + in the other examples are: + + 1) The \c.pro file should include \c qtsinglecoreapplication.pri + instead of \c qtsingleapplication.pri + + 2) The class name is \c QtSingleCoreApplication instead of \c + QtSingleApplication. + + 3) No calls are made regarding window activation, for obvious reasons. + + console.pro: + \quotefile console/console.pro + + main.cpp: + \quotefile console/main.cpp + +*/ diff --git a/windowsview/ukui-window-switch-wlcom/qtsingleapplication/examples/console/main.cpp b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/examples/console/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..13fd00e2f663f0c9b20559722a1e972e1c709535 --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/examples/console/main.cpp @@ -0,0 +1,52 @@ +// Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +// SPDX-License-Identifier: BSD-3-Clause + + +#include "qtsinglecoreapplication.h" +#include + + +void report(const QString& msg) +{ + qDebug("[%i] %s", (int)QCoreApplication::applicationPid(), qPrintable(msg)); +} + +class MainClass : public QObject +{ + Q_OBJECT +public: + MainClass() + : QObject() + {} + +public slots: + void handleMessage(const QString& message) + { + report( "Message received: \"" + message + "\""); + } +}; + +int main(int argc, char **argv) +{ + report("Starting up"); + + QtSingleCoreApplication app(argc, argv); + + if (app.isRunning()) { + QString msg(QString("Hi master, I am %1.").arg(QCoreApplication::applicationPid())); + bool sentok = app.sendMessage(msg, 2000); + QString rep("Another instance is running, so I will exit."); + rep += sentok ? " Message sent ok." : " Message sending failed; the other instance may be frozen."; + report(rep); + return 0; + } else { + report("No other instance is running; so I will."); + MainClass mainObj; + QObject::connect(&app, SIGNAL(messageReceived(const QString&)), + &mainObj, SLOT(handleMessage(const QString&))); + return app.exec(); + } +} + + +#include "main.moc" diff --git a/windowsview/ukui-window-switch-wlcom/qtsingleapplication/examples/examples.pro b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/examples/examples.pro new file mode 100644 index 0000000000000000000000000000000000000000..36b8fd3831578d44ee4c634808c64ffd94114b63 --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/examples/examples.pro @@ -0,0 +1,4 @@ +TEMPLATE = subdirs +SUBDIRS = trivial \ + loader \ + console diff --git a/windowsview/ukui-window-switch-wlcom/qtsingleapplication/examples/loader/file1.qsl b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/examples/loader/file1.qsl new file mode 100644 index 0000000000000000000000000000000000000000..50fcd26d6ce3000f9d5f12904e80eccdc5685dd1 --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/examples/loader/file1.qsl @@ -0,0 +1 @@ +File 1 diff --git a/windowsview/ukui-window-switch-wlcom/qtsingleapplication/examples/loader/file2.qsl b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/examples/loader/file2.qsl new file mode 100644 index 0000000000000000000000000000000000000000..4475433e279a71203927cbe80125208a3b5db560 --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/examples/loader/file2.qsl @@ -0,0 +1 @@ +File 2 diff --git a/windowsview/ukui-window-switch-wlcom/qtsingleapplication/examples/loader/loader.pro b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/examples/loader/loader.pro new file mode 100644 index 0000000000000000000000000000000000000000..3e52586b32ae3d68cabf73c19239b8c05bc21fbd --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/examples/loader/loader.pro @@ -0,0 +1,6 @@ +greaterThan(QT_MAJOR_VERSION, 4): QT += printsupport +TEMPLATE = app + +include(../../src/qtsingleapplication.pri) + +SOURCES += main.cpp diff --git a/windowsview/ukui-window-switch-wlcom/qtsingleapplication/examples/loader/loader.qdoc b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/examples/loader/loader.qdoc new file mode 100644 index 0000000000000000000000000000000000000000..1f550267780831a43ed783e1eb2cbd77a5514447 --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/examples/loader/loader.qdoc @@ -0,0 +1,44 @@ +// Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +// SPDX-License-Identifier: BSD-3-Clause + +/*! \page qtsingleapplication-example-loader.html + \title Loading Documents + + The application in this example loads or prints the documents + passed as commandline parameters to further instances of this + application. + + \quotefromfile loader/main.cpp + \printuntil }; + The user interface in this application is a QMainWindow subclass + with a QMdiArea as the central widget. It implements a slot + \c handleMessage() that will be connected to the messageReceived() + signal of the QtSingleApplication class. + + \printuntil } + The MainWindow constructor creates a minimal user interface. + + \printto case Print: + The handleMessage() slot interprets the message passed in as a + filename that can be prepended with \e /print to indicate that + the file should just be printed rather than loaded. + + \printto #include + Loading the file will also activate the window. + + \printto mw + The \c main entry point function creates a QtSingleApplication + object, and creates a message to send to a running instance + of the application. If the message was sent successfully the + process exits immediately. + + \printuntil } + If the message could not be sent the application starts up. Note + that \c false is passed to the call to setActivationWindow() to + prevent automatic activation for every message received, e.g. when + the application should just print a file. Instead, the message + handling function determines whether activation is requested, and + signals that by emitting the needToShow() signal. This is then + simply connected directly to QtSingleApplication's + activateWindow() slot. +*/ diff --git a/windowsview/ukui-window-switch-wlcom/qtsingleapplication/examples/loader/main.cpp b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/examples/loader/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5078490766b6b4ec57b5e658ed4459bfcbacd8e3 --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/examples/loader/main.cpp @@ -0,0 +1,115 @@ +// Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +// SPDX-License-Identifier: BSD-3-Clause + +#include +#include +#include +#include +#include +#include +#include +#include + +class MainWindow : public QMainWindow +{ + Q_OBJECT +public: + MainWindow(); + +public slots: + void handleMessage(const QString& message); + +signals: + void needToShow(); + +private: + QMdiArea *workspace; +}; + +MainWindow::MainWindow() +{ + workspace = new QMdiArea(this); + + setCentralWidget(workspace); +} + +void MainWindow::handleMessage(const QString& message) +{ + enum Action { + Nothing, + Open, + Print + } action; + + action = Nothing; + QString filename = message; + if (message.toLower().startsWith("/print ")) { + filename = filename.mid(7); + action = Print; + } else if (!message.isEmpty()) { + action = Open; + } + if (action == Nothing) { + emit needToShow(); + return; + } + + QFile file(filename); + QString contents; + if (file.open(QIODevice::ReadOnly)) + contents = file.readAll(); + else + contents = "[[Error: Could not load file " + filename + "]]"; + + QTextEdit *view = new QTextEdit; + view->setPlainText(contents); + + switch(action) { + case Print: + { + QPrinter printer; + view->print(&printer); + delete view; + } + break; + + case Open: + { + workspace->addSubWindow(view); + view->setWindowTitle(message); + view->show(); + emit needToShow(); + } + break; + default: + break; + }; +} + +#include "main.moc" + +int main(int argc, char **argv) +{ + QtSingleApplication instance("File loader QtSingleApplication example", argc, argv); + QString message; + for (int a = 1; a < argc; ++a) { + message += argv[a]; + if (a < argc-1) + message += " "; + } + + if (instance.sendMessage(message)) + return 0; + + MainWindow mw; + mw.handleMessage(message); + mw.show(); + + QObject::connect(&instance, SIGNAL(messageReceived(const QString&)), + &mw, SLOT(handleMessage(const QString&))); + + instance.setActivationWindow(&mw, false); + QObject::connect(&mw, SIGNAL(needToShow()), &instance, SLOT(activateWindow())); + + return instance.exec(); +} diff --git a/windowsview/ukui-window-switch-wlcom/qtsingleapplication/examples/trivial/main.cpp b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/examples/trivial/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d243cc57d870a91af1dd6b77f5d217819ba15279 --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/examples/trivial/main.cpp @@ -0,0 +1,41 @@ +// Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +// SPDX-License-Identifier: BSD-3-Clause + +#include +#include + +class TextEdit : public QTextEdit +{ + Q_OBJECT +public: + TextEdit(QWidget *parent = 0) + : QTextEdit(parent) + {} +public slots: + void append(const QString &str) + { + QTextEdit::append(str); + } +}; + +#include "main.moc" + + + +int main(int argc, char **argv) +{ + QtSingleApplication instance(argc, argv); + if (instance.sendMessage("Wake up!")) + return 0; + + TextEdit logview; + logview.setReadOnly(true); + logview.show(); + + instance.setActivationWindow(&logview); + + QObject::connect(&instance, SIGNAL(messageReceived(const QString&)), + &logview, SLOT(append(const QString&))); + + return instance.exec(); +} diff --git a/windowsview/ukui-window-switch-wlcom/qtsingleapplication/examples/trivial/trivial.pro b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/examples/trivial/trivial.pro new file mode 100644 index 0000000000000000000000000000000000000000..673497a408c6232757b2204fcb954fb9e78c51ca --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/examples/trivial/trivial.pro @@ -0,0 +1,5 @@ +TEMPLATE = app + +include(../../src/qtsingleapplication.pri) + +SOURCES += main.cpp diff --git a/windowsview/ukui-window-switch-wlcom/qtsingleapplication/examples/trivial/trivial.qdoc b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/examples/trivial/trivial.qdoc new file mode 100644 index 0000000000000000000000000000000000000000..4a8640ebd04fcf5470825149e30efc5195dad494 --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/examples/trivial/trivial.qdoc @@ -0,0 +1,39 @@ +// Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +// SPDX-License-Identifier: BSD-3-Clause + +/*! \page qtsingleapplication-example-trivial.html + \title A Trivial Example + + The application in this example has a log-view that displays + messages sent by further instances of the same application. + + The example demonstrates the use of the QtSingleApplication + class to detect and communicate with a running instance of + the application using the sendMessage() API. The messageReceived() + signal is used to display received messages in a QTextEdit log. + + \quotefromfile trivial/main.cpp + \printuntil instance + The example has only the \c main entry point function. + A QtSingleApplication object is created immediately. + + \printuntil return + If another instance of this application is already running, + sendMessage() will succeed, and this instance just exits + immediately. + + \printuntil show() + Otherwise the instance continues as normal and creates the + user interface. + + \printuntil return instance.exec(); + The \c logview object is also set as the application's activation + window. Every time a message is received, the window will be raised + and activated automatically. + + The messageReceived() signal is also connected to the QTextEdit's + append() slot. Every message received from further instances of + this application will be displayed in the log. + + Finally the event loop is entered. +*/ diff --git a/windowsview/ukui-window-switch-wlcom/qtsingleapplication/qtsingleapplication.pro b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/qtsingleapplication.pro new file mode 100644 index 0000000000000000000000000000000000000000..07257c5d441a3c19a9b3738c24a2f21f8a134283 --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/qtsingleapplication.pro @@ -0,0 +1,5 @@ +TEMPLATE=subdirs +CONFIG += ordered +include(common.pri) +qtsingleapplication-uselib:SUBDIRS=buildlib +SUBDIRS+=examples diff --git a/windowsview/ukui-window-switch-wlcom/qtsingleapplication/src/QtLockedFile b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/src/QtLockedFile new file mode 100644 index 0000000000000000000000000000000000000000..16b48ba9dd6ef2fd157e4f9e4d587a9e743ef3db --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/src/QtLockedFile @@ -0,0 +1 @@ +#include "qtlockedfile.h" diff --git a/windowsview/ukui-window-switch-wlcom/qtsingleapplication/src/QtSingleApplication b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/src/QtSingleApplication new file mode 100644 index 0000000000000000000000000000000000000000..d111bf72d8261f29361b4051f56c7099d4fae924 --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/src/QtSingleApplication @@ -0,0 +1 @@ +#include "qtsingleapplication.h" diff --git a/windowsview/ukui-window-switch-wlcom/qtsingleapplication/src/qtlocalpeer.cpp b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/src/qtlocalpeer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7e99171f1016067199a27267b1253e016536de8b --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/src/qtlocalpeer.cpp @@ -0,0 +1,177 @@ +// Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +// SPDX-License-Identifier: BSD-3-Clause + + +#include "qtlocalpeer.h" +#include +#include +#include +#include + +#if defined(Q_OS_WIN) +#include +#include +typedef BOOL(WINAPI*PProcessIdToSessionId)(DWORD,DWORD*); +static PProcessIdToSessionId pProcessIdToSessionId = 0; +#endif +#if defined(Q_OS_UNIX) +#include +#include +#include +#endif + +namespace QtLP_Private { +#include "qtlockedfile.cpp" +#if defined(Q_OS_WIN) +#include "qtlockedfile_win.cpp" +#else +#include "qtlockedfile_unix.cpp" +#endif +} + +const char* QtLocalPeer::ack = "ack"; + +QtLocalPeer::QtLocalPeer(QObject* parent, const QString &appId) + : QObject(parent), id(appId) +{ + QString prefix = id; + if (id.isEmpty()) { + id = QCoreApplication::applicationFilePath(); +#if defined(Q_OS_WIN) + id = id.toLower(); +#endif + prefix = id.section(QLatin1Char('/'), -1); + } + prefix.remove(QRegularExpression("[^a-zA-Z]")); + prefix.truncate(6); + + QByteArray idc = id.toUtf8(); + quint16 idNum = qChecksum(idc.constData(), idc.size()); + socketName = QLatin1String("qtsingleapp-") + prefix + + QLatin1Char('-') + QString::number(idNum, 16); + +#if defined(Q_OS_WIN) + if (!pProcessIdToSessionId) { + QLibrary lib("kernel32"); + pProcessIdToSessionId = (PProcessIdToSessionId)lib.resolve("ProcessIdToSessionId"); + } + if (pProcessIdToSessionId) { + DWORD sessionId = 0; + pProcessIdToSessionId(GetCurrentProcessId(), &sessionId); + socketName += QLatin1Char('-') + QString::number(sessionId, 16); + } +#else + socketName += QLatin1Char('-') + QString::number(::getuid(), 16); +#endif + + server = new QLocalServer(this); + QString lockName = QDir(QDir::tempPath()).absolutePath() + + QLatin1Char('/') + socketName + + QLatin1String("-lockfile"); + lockFile.setFileName(lockName); + lockFile.open(QIODevice::ReadWrite); +} + + + +bool QtLocalPeer::isClient() +{ + if (lockFile.isLocked()) + return false; + + if (!lockFile.lock(QtLP_Private::QtLockedFile::WriteLock, false)) + return true; + + bool res = server->listen(socketName); +#if defined(Q_OS_UNIX) && (QT_VERSION >= QT_VERSION_CHECK(4,5,0)) + // ### Workaround + if (!res && server->serverError() == QAbstractSocket::AddressInUseError) { + QFile::remove(QDir::cleanPath(QDir::tempPath())+QLatin1Char('/')+socketName); + res = server->listen(socketName); + } +#endif + if (!res) + qWarning("QtSingleCoreApplication: listen on local socket failed, %s", qPrintable(server->errorString())); + QObject::connect(server, SIGNAL(newConnection()), SLOT(receiveConnection())); + return false; +} + + +bool QtLocalPeer::sendMessage(const QString &message, int timeout) +{ + if (!isClient()) + return false; + + QLocalSocket socket; + bool connOk = false; + for(int i = 0; i < 2; i++) { + // Try twice, in case the other instance is just starting up + socket.connectToServer(socketName); + connOk = socket.waitForConnected(timeout/2); + if (connOk || i) + break; + int ms = 250; +#if defined(Q_OS_WIN) + Sleep(DWORD(ms)); +#else + struct timespec ts = { ms / 1000, (ms % 1000) * 1000 * 1000 }; + nanosleep(&ts, NULL); +#endif + } + if (!connOk) + return false; + + QByteArray uMsg(message.toUtf8()); + QDataStream ds(&socket); + ds.writeBytes(uMsg.constData(), uMsg.size()); + bool res = socket.waitForBytesWritten(timeout); + if (res) { + res &= socket.waitForReadyRead(timeout); // wait for ack + if (res) + res &= (socket.read(qstrlen(ack)) == ack); + } + return res; +} + + +void QtLocalPeer::receiveConnection() +{ + QLocalSocket* socket = server->nextPendingConnection(); + if (!socket) + return; + + while (true) { + if (socket->state() == QLocalSocket::UnconnectedState) { + qWarning("QtLocalPeer: Peer disconnected"); + delete socket; + return; + } + if (socket->bytesAvailable() >= qint64(sizeof(quint32))) + break; + socket->waitForReadyRead(); + } + + QDataStream ds(socket); + QByteArray uMsg; + quint32 remaining; + ds >> remaining; + uMsg.resize(remaining); + int got = 0; + char* uMsgBuf = uMsg.data(); + do { + got = ds.readRawData(uMsgBuf, remaining); + remaining -= got; + uMsgBuf += got; + } while (remaining && got >= 0 && socket->waitForReadyRead(2000)); + if (got < 0) { + qWarning("QtLocalPeer: Message reception failed %s", socket->errorString().toLatin1().constData()); + delete socket; + return; + } + QString message(QString::fromUtf8(uMsg)); + socket->write(ack, qstrlen(ack)); + socket->waitForBytesWritten(1000); + socket->waitForDisconnected(1000); // make sure client reads ack + delete socket; + emit messageReceived(message); //### (might take a long time to return) +} diff --git a/windowsview/ukui-window-switch-wlcom/qtsingleapplication/src/qtlocalpeer.h b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/src/qtlocalpeer.h new file mode 100644 index 0000000000000000000000000000000000000000..5e6db56c851c19d717b8fd7b6b5f53e5c274e08f --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/src/qtlocalpeer.h @@ -0,0 +1,40 @@ +// Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef QTLOCALPEER_H +#define QTLOCALPEER_H + +#include +#include +#include + +#include "qtlockedfile.h" + +class QtLocalPeer : public QObject +{ + Q_OBJECT + +public: + QtLocalPeer(QObject *parent = 0, const QString &appId = QString()); + bool isClient(); + bool sendMessage(const QString &message, int timeout); + QString applicationId() const + { return id; } + +Q_SIGNALS: + void messageReceived(const QString &message); + +protected Q_SLOTS: + void receiveConnection(); + +protected: + QString id; + QString socketName; + QLocalServer* server; + QtLP_Private::QtLockedFile lockFile; + +private: + static const char* ack; +}; + +#endif // QTLOCALPEER_H diff --git a/windowsview/ukui-window-switch-wlcom/qtsingleapplication/src/qtlockedfile.cpp b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/src/qtlockedfile.cpp new file mode 100644 index 0000000000000000000000000000000000000000..78f20bc26a4926928507eb528ff33e5b2892bdcf --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/src/qtlockedfile.cpp @@ -0,0 +1,156 @@ +// Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +// SPDX-License-Identifier: BSD-3-Clause + +#include "qtlockedfile.h" + +/*! + \class QtLockedFile + + \brief The QtLockedFile class extends QFile with advisory locking + functions. + + A file may be locked in read or write mode. Multiple instances of + \e QtLockedFile, created in multiple processes running on the same + machine, may have a file locked in read mode. Exactly one instance + may have it locked in write mode. A read and a write lock cannot + exist simultaneously on the same file. + + The file locks are advisory. This means that nothing prevents + another process from manipulating a locked file using QFile or + file system functions offered by the OS. Serialization is only + guaranteed if all processes that access the file use + QLockedFile. Also, while holding a lock on a file, a process + must not open the same file again (through any API), or locks + can be unexpectedly lost. + + The lock provided by an instance of \e QtLockedFile is released + whenever the program terminates. This is true even when the + program crashes and no destructors are called. +*/ + +/*! \enum QtLockedFile::LockMode + + This enum describes the available lock modes. + + \value ReadLock A read lock. + \value WriteLock A write lock. + \value NoLock Neither a read lock nor a write lock. +*/ + +/*! + Constructs an unlocked \e QtLockedFile object. This constructor + behaves in the same way as \e QFile::QFile(). + + \sa QFile::QFile() +*/ +QtLockedFile::QtLockedFile() + : QFile() +{ +#ifdef Q_OS_WIN + wmutex = 0; + rmutex = 0; +#endif + m_lock_mode = NoLock; +} + +/*! + Constructs an unlocked QtLockedFile object with file \a name. This + constructor behaves in the same way as \e QFile::QFile(const + QString&). + + \sa QFile::QFile() +*/ +QtLockedFile::QtLockedFile(const QString &name) + : QFile(name) +{ +#ifdef Q_OS_WIN + wmutex = 0; + rmutex = 0; +#endif + m_lock_mode = NoLock; +} + +/*! + Opens the file in OpenMode \a mode. + + This is identical to QFile::open(), with the one exception that the + Truncate mode flag is disallowed. Truncation would conflict with the + advisory file locking, since the file would be modified before the + write lock is obtained. If truncation is required, use resize(0) + after obtaining the write lock. + + Returns true if successful; otherwise false. + + \sa QFile::open(), QFile::resize() +*/ +bool QtLockedFile::open(OpenMode mode) +{ + if (mode & QIODevice::Truncate) { + qWarning("QtLockedFile::open(): Truncate mode not allowed."); + return false; + } + return QFile::open(mode); +} + +/*! + Returns \e true if this object has a in read or write lock; + otherwise returns \e false. + + \sa lockMode() +*/ +bool QtLockedFile::isLocked() const +{ + return m_lock_mode != NoLock; +} + +/*! + Returns the type of lock currently held by this object, or \e + QtLockedFile::NoLock. + + \sa isLocked() +*/ +QtLockedFile::LockMode QtLockedFile::lockMode() const +{ + return m_lock_mode; +} + +/*! + \fn bool QtLockedFile::lock(LockMode mode, bool block = true) + + Obtains a lock of type \a mode. The file must be opened before it + can be locked. + + If \a block is true, this function will block until the lock is + aquired. If \a block is false, this function returns \e false + immediately if the lock cannot be aquired. + + If this object already has a lock of type \a mode, this function + returns \e true immediately. If this object has a lock of a + different type than \a mode, the lock is first released and then a + new lock is obtained. + + This function returns \e true if, after it executes, the file is + locked by this object, and \e false otherwise. + + \sa unlock(), isLocked(), lockMode() +*/ + +/*! + \fn bool QtLockedFile::unlock() + + Releases a lock. + + If the object has no lock, this function returns immediately. + + This function returns \e true if, after it executes, the file is + not locked by this object, and \e false otherwise. + + \sa lock(), isLocked(), lockMode() +*/ + +/*! + \fn QtLockedFile::~QtLockedFile() + + Destroys the \e QtLockedFile object. If any locks were held, they + are released. +*/ diff --git a/windowsview/ukui-window-switch-wlcom/qtsingleapplication/src/qtlockedfile.h b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/src/qtlockedfile.h new file mode 100644 index 0000000000000000000000000000000000000000..c729bf2058dd00022da96dd275e3eeb8def3f21b --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/src/qtlockedfile.h @@ -0,0 +1,60 @@ +// Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef QTLOCKEDFILE_H +#define QTLOCKEDFILE_H + +#include +#ifdef Q_OS_WIN +#include +#endif + +#if defined(Q_OS_WIN) +# if !defined(QT_QTLOCKEDFILE_EXPORT) && !defined(QT_QTLOCKEDFILE_IMPORT) +# define QT_QTLOCKEDFILE_EXPORT +# elif defined(QT_QTLOCKEDFILE_IMPORT) +# if defined(QT_QTLOCKEDFILE_EXPORT) +# undef QT_QTLOCKEDFILE_EXPORT +# endif +# define QT_QTLOCKEDFILE_EXPORT __declspec(dllimport) +# elif defined(QT_QTLOCKEDFILE_EXPORT) +# undef QT_QTLOCKEDFILE_EXPORT +# define QT_QTLOCKEDFILE_EXPORT __declspec(dllexport) +# endif +#else +# define QT_QTLOCKEDFILE_EXPORT +#endif + +namespace QtLP_Private { + +class QT_QTLOCKEDFILE_EXPORT QtLockedFile : public QFile +{ +public: + enum LockMode { NoLock = 0, ReadLock, WriteLock }; + + QtLockedFile(); + QtLockedFile(const QString &name); + ~QtLockedFile(); + + bool open(OpenMode mode); + + bool lock(LockMode mode, bool block = true); + bool unlock(); + bool isLocked() const; + LockMode lockMode() const; + +private: +#ifdef Q_OS_WIN + Qt::HANDLE wmutex; + Qt::HANDLE rmutex; + QVector rmutexes; + QString mutexname; + + Qt::HANDLE getMutexHandle(int idx, bool doCreate); + bool waitMutex(Qt::HANDLE mutex, bool doBlock); + +#endif + LockMode m_lock_mode; +}; +} +#endif diff --git a/windowsview/ukui-window-switch-wlcom/qtsingleapplication/src/qtlockedfile_unix.cpp b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/src/qtlockedfile_unix.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8385d8b8b2cec4e31a723aa8cad37c0fc6441337 --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/src/qtlockedfile_unix.cpp @@ -0,0 +1,78 @@ +// Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +// SPDX-License-Identifier: BSD-3-Clause + +#include +#include +#include +#include + +#include "qtlockedfile.h" + +bool QtLockedFile::lock(LockMode mode, bool block) +{ + if (!isOpen()) { + qWarning("QtLockedFile::lock(): file is not opened"); + return false; + } + + if (mode == NoLock) + return unlock(); + + if (mode == m_lock_mode) + return true; + + if (m_lock_mode != NoLock) + unlock(); + + struct flock fl; + fl.l_whence = SEEK_SET; + fl.l_start = 0; + fl.l_len = 0; + fl.l_type = (mode == ReadLock) ? F_RDLCK : F_WRLCK; + int cmd = block ? F_SETLKW : F_SETLK; + int ret = fcntl(handle(), cmd, &fl); + + if (ret == -1) { + if (errno != EINTR && errno != EAGAIN) + qWarning("QtLockedFile::lock(): fcntl: %s", strerror(errno)); + return false; + } + + + m_lock_mode = mode; + return true; +} + + +bool QtLockedFile::unlock() +{ + if (!isOpen()) { + qWarning("QtLockedFile::unlock(): file is not opened"); + return false; + } + + if (!isLocked()) + return true; + + struct flock fl; + fl.l_whence = SEEK_SET; + fl.l_start = 0; + fl.l_len = 0; + fl.l_type = F_UNLCK; + int ret = fcntl(handle(), F_SETLKW, &fl); + + if (ret == -1) { + qWarning("QtLockedFile::lock(): fcntl: %s", strerror(errno)); + return false; + } + + m_lock_mode = NoLock; + return true; +} + +QtLockedFile::~QtLockedFile() +{ + if (isOpen()) + unlock(); +} + diff --git a/windowsview/ukui-window-switch-wlcom/qtsingleapplication/src/qtlockedfile_win.cpp b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/src/qtlockedfile_win.cpp new file mode 100644 index 0000000000000000000000000000000000000000..28cf07259b628c289de13ae658a55af63fa35c14 --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/src/qtlockedfile_win.cpp @@ -0,0 +1,174 @@ +// Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +// SPDX-License-Identifier: BSD-3-Clause + +#include "qtlockedfile.h" +#include +#include + +#define MUTEX_PREFIX "QtLockedFile mutex " +// Maximum number of concurrent read locks. Must not be greater than MAXIMUM_WAIT_OBJECTS +#define MAX_READERS MAXIMUM_WAIT_OBJECTS + +#if QT_VERSION >= 0x050000 +#define QT_WA(unicode, ansi) unicode +#endif + +Qt::HANDLE QtLockedFile::getMutexHandle(int idx, bool doCreate) +{ + if (mutexname.isEmpty()) { + QFileInfo fi(*this); + mutexname = QString::fromLatin1(MUTEX_PREFIX) + + fi.absoluteFilePath().toLower(); + } + QString mname(mutexname); + if (idx >= 0) + mname += QString::number(idx); + + Qt::HANDLE mutex; + if (doCreate) { + QT_WA( { mutex = CreateMutexW(NULL, FALSE, (TCHAR*)mname.utf16()); }, + { mutex = CreateMutexA(NULL, FALSE, mname.toLocal8Bit().constData()); } ); + if (!mutex) { + qErrnoWarning("QtLockedFile::lock(): CreateMutex failed"); + return 0; + } + } + else { + QT_WA( { mutex = OpenMutexW(SYNCHRONIZE | MUTEX_MODIFY_STATE, FALSE, (TCHAR*)mname.utf16()); }, + { mutex = OpenMutexA(SYNCHRONIZE | MUTEX_MODIFY_STATE, FALSE, mname.toLocal8Bit().constData()); } ); + if (!mutex) { + if (GetLastError() != ERROR_FILE_NOT_FOUND) + qErrnoWarning("QtLockedFile::lock(): OpenMutex failed"); + return 0; + } + } + return mutex; +} + +bool QtLockedFile::waitMutex(Qt::HANDLE mutex, bool doBlock) +{ + Q_ASSERT(mutex); + DWORD res = WaitForSingleObject(mutex, doBlock ? INFINITE : 0); + switch (res) { + case WAIT_OBJECT_0: + case WAIT_ABANDONED: + return true; + break; + case WAIT_TIMEOUT: + break; + default: + qErrnoWarning("QtLockedFile::lock(): WaitForSingleObject failed"); + } + return false; +} + + + +bool QtLockedFile::lock(LockMode mode, bool block) +{ + if (!isOpen()) { + qWarning("QtLockedFile::lock(): file is not opened"); + return false; + } + + if (mode == NoLock) + return unlock(); + + if (mode == m_lock_mode) + return true; + + if (m_lock_mode != NoLock) + unlock(); + + if (!wmutex && !(wmutex = getMutexHandle(-1, true))) + return false; + + if (!waitMutex(wmutex, block)) + return false; + + if (mode == ReadLock) { + int idx = 0; + for (; idx < MAX_READERS; idx++) { + rmutex = getMutexHandle(idx, false); + if (!rmutex || waitMutex(rmutex, false)) + break; + CloseHandle(rmutex); + } + bool ok = true; + if (idx >= MAX_READERS) { + qWarning("QtLockedFile::lock(): too many readers"); + rmutex = 0; + ok = false; + } + else if (!rmutex) { + rmutex = getMutexHandle(idx, true); + if (!rmutex || !waitMutex(rmutex, false)) + ok = false; + } + if (!ok && rmutex) { + CloseHandle(rmutex); + rmutex = 0; + } + ReleaseMutex(wmutex); + if (!ok) + return false; + } + else { + Q_ASSERT(rmutexes.isEmpty()); + for (int i = 0; i < MAX_READERS; i++) { + Qt::HANDLE mutex = getMutexHandle(i, false); + if (mutex) + rmutexes.append(mutex); + } + if (rmutexes.size()) { + DWORD res = WaitForMultipleObjects(rmutexes.size(), rmutexes.constData(), + TRUE, block ? INFINITE : 0); + if (res != WAIT_OBJECT_0 && res != WAIT_ABANDONED) { + if (res != WAIT_TIMEOUT) + qErrnoWarning("QtLockedFile::lock(): WaitForMultipleObjects failed"); + m_lock_mode = WriteLock; // trick unlock() to clean up - semiyucky + unlock(); + return false; + } + } + } + + m_lock_mode = mode; + return true; +} + +bool QtLockedFile::unlock() +{ + if (!isOpen()) { + qWarning("QtLockedFile::unlock(): file is not opened"); + return false; + } + + if (!isLocked()) + return true; + + if (m_lock_mode == ReadLock) { + ReleaseMutex(rmutex); + CloseHandle(rmutex); + rmutex = 0; + } + else { + foreach(Qt::HANDLE mutex, rmutexes) { + ReleaseMutex(mutex); + CloseHandle(mutex); + } + rmutexes.clear(); + ReleaseMutex(wmutex); + } + + m_lock_mode = QtLockedFile::NoLock; + return true; +} + +QtLockedFile::~QtLockedFile() +{ + if (isOpen()) + unlock(); + if (wmutex) + CloseHandle(wmutex); +} diff --git a/windowsview/ukui-window-switch-wlcom/qtsingleapplication/src/qtsingleapplication.cpp b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/src/qtsingleapplication.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a6f4516809ffce4777b7c7f281f6f3a046c2cb90 --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/src/qtsingleapplication.cpp @@ -0,0 +1,310 @@ +// Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +// SPDX-License-Identifier: BSD-3-Clause + + +#include "qtsingleapplication.h" +#include "qtlocalpeer.h" +#include + + +/*! + \class QtSingleApplication qtsingleapplication.h + \brief The QtSingleApplication class provides an API to detect and + communicate with running instances of an application. + + This class allows you to create applications where only one + instance should be running at a time. I.e., if the user tries to + launch another instance, the already running instance will be + activated instead. Another usecase is a client-server system, + where the first started instance will assume the role of server, + and the later instances will act as clients of that server. + + By default, the full path of the executable file is used to + determine whether two processes are instances of the same + application. You can also provide an explicit identifier string + that will be compared instead. + + The application should create the QtSingleApplication object early + in the startup phase, and call isRunning() to find out if another + instance of this application is already running. If isRunning() + returns false, it means that no other instance is running, and + this instance has assumed the role as the running instance. In + this case, the application should continue with the initialization + of the application user interface before entering the event loop + with exec(), as normal. + + The messageReceived() signal will be emitted when the running + application receives messages from another instance of the same + application. When a message is received it might be helpful to the + user to raise the application so that it becomes visible. To + facilitate this, QtSingleApplication provides the + setActivationWindow() function and the activateWindow() slot. + + If isRunning() returns true, another instance is already + running. It may be alerted to the fact that another instance has + started by using the sendMessage() function. Also data such as + startup parameters (e.g. the name of the file the user wanted this + new instance to open) can be passed to the running instance with + this function. Then, the application should terminate (or enter + client mode). + + If isRunning() returns true, but sendMessage() fails, that is an + indication that the running instance is frozen. + + Here's an example that shows how to convert an existing + application to use QtSingleApplication. It is very simple and does + not make use of all QtSingleApplication's functionality (see the + examples for that). + + \code + // Original + int main(int argc, char **argv) + { + QApplication app(argc, argv); + + MyMainWidget mmw; + mmw.show(); + return app.exec(); + } + + // Single instance + int main(int argc, char **argv) + { + QtSingleApplication app(argc, argv); + + if (app.isRunning()) + return !app.sendMessage(someDataString); + + MyMainWidget mmw; + app.setActivationWindow(&mmw); + mmw.show(); + return app.exec(); + } + \endcode + + Once this QtSingleApplication instance is destroyed (normally when + the process exits or crashes), when the user next attempts to run the + application this instance will not, of course, be encountered. The + next instance to call isRunning() or sendMessage() will assume the + role as the new running instance. + + For console (non-GUI) applications, QtSingleCoreApplication may be + used instead of this class, to avoid the dependency on the QtGui + library. + + \sa QtSingleCoreApplication +*/ + + +void QtSingleApplication::sysInit(const QString &appId) +{ + actWin = 0; + peer = new QtLocalPeer(this, appId); + connect(peer, SIGNAL(messageReceived(const QString&)), SIGNAL(messageReceived(const QString&))); +} + + +/*! + Creates a QtSingleApplication object. The application identifier + will be QCoreApplication::applicationFilePath(). \a argc, \a + argv, and \a GUIenabled are passed on to the QAppliation constructor. + + If you are creating a console application (i.e. setting \a + GUIenabled to false), you may consider using + QtSingleCoreApplication instead. +*/ + +QtSingleApplication::QtSingleApplication(int &argc, char **argv, bool GUIenabled) + : QApplication(argc, argv, GUIenabled) +{ + sysInit(); +} + + +/*! + Creates a QtSingleApplication object with the application + identifier \a appId. \a argc and \a argv are passed on to the + QAppliation constructor. +*/ + +QtSingleApplication::QtSingleApplication(const QString &appId, int &argc, char **argv) + : QApplication(argc, argv) +{ + sysInit(appId); +} + +#if QT_VERSION < 0x050000 + +/*! + Creates a QtSingleApplication object. The application identifier + will be QCoreApplication::applicationFilePath(). \a argc, \a + argv, and \a type are passed on to the QAppliation constructor. +*/ +QtSingleApplication::QtSingleApplication(int &argc, char **argv, Type type) + : QApplication(argc, argv, type) +{ + sysInit(); +} + + +# if defined(Q_WS_X11) +/*! + Special constructor for X11, ref. the documentation of + QApplication's corresponding constructor. The application identifier + will be QCoreApplication::applicationFilePath(). \a dpy, \a visual, + and \a cmap are passed on to the QApplication constructor. +*/ +QtSingleApplication::QtSingleApplication(Display* dpy, Qt::HANDLE visual, Qt::HANDLE cmap) + : QApplication(dpy, visual, cmap) +{ + sysInit(); +} + +/*! + Special constructor for X11, ref. the documentation of + QApplication's corresponding constructor. The application identifier + will be QCoreApplication::applicationFilePath(). \a dpy, \a argc, \a + argv, \a visual, and \a cmap are passed on to the QApplication + constructor. +*/ +QtSingleApplication::QtSingleApplication(Display *dpy, int &argc, char **argv, Qt::HANDLE visual, Qt::HANDLE cmap) + : QApplication(dpy, argc, argv, visual, cmap) +{ + sysInit(); +} + +/*! + Special constructor for X11, ref. the documentation of + QApplication's corresponding constructor. The application identifier + will be \a appId. \a dpy, \a argc, \a + argv, \a visual, and \a cmap are passed on to the QApplication + constructor. +*/ +QtSingleApplication::QtSingleApplication(Display* dpy, const QString &appId, int argc, char **argv, Qt::HANDLE visual, Qt::HANDLE cmap) + : QApplication(dpy, argc, argv, visual, cmap) +{ + sysInit(appId); +} +# endif // Q_WS_X11 +#endif // QT_VERSION < 0x050000 + + +/*! + Returns true if another instance of this application is running; + otherwise false. + + This function does not find instances of this application that are + being run by a different user (on Windows: that are running in + another session). + + \sa sendMessage() +*/ + +bool QtSingleApplication::isRunning() +{ + return peer->isClient(); +} + + +/*! + Tries to send the text \a message to the currently running + instance. The QtSingleApplication object in the running instance + will emit the messageReceived() signal when it receives the + message. + + This function returns true if the message has been sent to, and + processed by, the current instance. If there is no instance + currently running, or if the running instance fails to process the + message within \a timeout milliseconds, this function return false. + + \sa isRunning(), messageReceived() +*/ +bool QtSingleApplication::sendMessage(const QString &message, int timeout) +{ + return peer->sendMessage(message, timeout); +} + + +/*! + Returns the application identifier. Two processes with the same + identifier will be regarded as instances of the same application. +*/ +QString QtSingleApplication::id() const +{ + return peer->applicationId(); +} + + +/*! + Sets the activation window of this application to \a aw. The + activation window is the widget that will be activated by + activateWindow(). This is typically the application's main window. + + If \a activateOnMessage is true (the default), the window will be + activated automatically every time a message is received, just prior + to the messageReceived() signal being emitted. + + \sa activateWindow(), messageReceived() +*/ + +void QtSingleApplication::setActivationWindow(QWidget* aw, bool activateOnMessage) +{ + actWin = aw; + if (activateOnMessage) + connect(peer, SIGNAL(messageReceived(const QString&)), this, SLOT(activateWindow())); + else + disconnect(peer, SIGNAL(messageReceived(const QString&)), this, SLOT(activateWindow())); +} + + +/*! + Returns the applications activation window if one has been set by + calling setActivationWindow(), otherwise returns 0. + + \sa setActivationWindow() +*/ +QWidget* QtSingleApplication::activationWindow() const +{ + return actWin; +} + + +/*! + De-minimizes, raises, and activates this application's activation window. + This function does nothing if no activation window has been set. + + This is a convenience function to show the user that this + application instance has been activated when he has tried to start + another instance. + + This function should typically be called in response to the + messageReceived() signal. By default, that will happen + automatically, if an activation window has been set. + + \sa setActivationWindow(), messageReceived(), initialize() +*/ +void QtSingleApplication::activateWindow() +{ + if (actWin) { + actWin->setWindowState(actWin->windowState() & ~Qt::WindowMinimized); + actWin->raise(); + actWin->activateWindow(); + } +} + + +/*! + \fn void QtSingleApplication::messageReceived(const QString& message) + + This signal is emitted when the current instance receives a \a + message from another instance of this application. + + \sa sendMessage(), setActivationWindow(), activateWindow() +*/ + + +/*! + \fn void QtSingleApplication::initialize(bool dummy = true) + + \obsolete +*/ diff --git a/windowsview/ukui-window-switch-wlcom/qtsingleapplication/src/qtsingleapplication.h b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/src/qtsingleapplication.h new file mode 100644 index 0000000000000000000000000000000000000000..f8f6e88e221eddb8ebcf386b3de253b63a44e074 --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/src/qtsingleapplication.h @@ -0,0 +1,68 @@ +// Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef QTSINGLEAPPLICATION_H +#define QTSINGLEAPPLICATION_H + +#include + +class QtLocalPeer; + +#if defined(Q_OS_WIN) +# if !defined(QT_QTSINGLEAPPLICATION_EXPORT) && !defined(QT_QTSINGLEAPPLICATION_IMPORT) +# define QT_QTSINGLEAPPLICATION_EXPORT +# elif defined(QT_QTSINGLEAPPLICATION_IMPORT) +# if defined(QT_QTSINGLEAPPLICATION_EXPORT) +# undef QT_QTSINGLEAPPLICATION_EXPORT +# endif +# define QT_QTSINGLEAPPLICATION_EXPORT __declspec(dllimport) +# elif defined(QT_QTSINGLEAPPLICATION_EXPORT) +# undef QT_QTSINGLEAPPLICATION_EXPORT +# define QT_QTSINGLEAPPLICATION_EXPORT __declspec(dllexport) +# endif +#else +# define QT_QTSINGLEAPPLICATION_EXPORT +#endif + +class QT_QTSINGLEAPPLICATION_EXPORT QtSingleApplication : public QApplication +{ + Q_OBJECT + +public: + QtSingleApplication(int &argc, char **argv, bool GUIenabled = true); + QtSingleApplication(const QString &id, int &argc, char **argv); +#if QT_VERSION < 0x050000 + QtSingleApplication(int &argc, char **argv, Type type); +# if defined(Q_WS_X11) + QtSingleApplication(Display* dpy, Qt::HANDLE visual = 0, Qt::HANDLE colormap = 0); + QtSingleApplication(Display *dpy, int &argc, char **argv, Qt::HANDLE visual = 0, Qt::HANDLE cmap= 0); + QtSingleApplication(Display* dpy, const QString &appId, int argc, char **argv, Qt::HANDLE visual = 0, Qt::HANDLE colormap = 0); +# endif // Q_WS_X11 +#endif // QT_VERSION < 0x050000 + + bool isRunning(); + QString id() const; + + void setActivationWindow(QWidget* aw, bool activateOnMessage = true); + QWidget* activationWindow() const; + + // Obsolete: + void initialize(bool dummy = true) + { isRunning(); Q_UNUSED(dummy) } + +public Q_SLOTS: + bool sendMessage(const QString &message, int timeout = 5000); + void activateWindow(); + + +Q_SIGNALS: + void messageReceived(const QString &message); + + +private: + void sysInit(const QString &appId = QString()); + QtLocalPeer *peer; + QWidget *actWin; +}; + +#endif // QTSINGLEAPPLICATION_H diff --git a/windowsview/ukui-window-switch-wlcom/qtsingleapplication/src/qtsingleapplication.pri b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/src/qtsingleapplication.pri new file mode 100644 index 0000000000000000000000000000000000000000..6f2bced94dc6d3f7d115a739e7fdf235fbd8221c --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/src/qtsingleapplication.pri @@ -0,0 +1,17 @@ +include(../common.pri) +INCLUDEPATH += $$PWD +DEPENDPATH += $$PWD +QT *= network +greaterThan(QT_MAJOR_VERSION, 4): QT *= widgets + +qtsingleapplication-uselib:!qtsingleapplication-buildlib { + LIBS += -L$$QTSINGLEAPPLICATION_LIBDIR -l$$QTSINGLEAPPLICATION_LIBNAME +} else { + SOURCES += $$PWD/qtsingleapplication.cpp $$PWD/qtlocalpeer.cpp + HEADERS += $$PWD/qtsingleapplication.h $$PWD/qtlocalpeer.h +} + +win32 { + contains(TEMPLATE, lib):contains(CONFIG, shared):DEFINES += QT_QTSINGLEAPPLICATION_EXPORT + else:qtsingleapplication-uselib:DEFINES += QT_QTSINGLEAPPLICATION_IMPORT +} diff --git a/windowsview/ukui-window-switch-wlcom/qtsingleapplication/src/qtsinglecoreapplication.cpp b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/src/qtsinglecoreapplication.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a3e2b3aef994129defb2cadae3b8f84a74f45303 --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/src/qtsinglecoreapplication.cpp @@ -0,0 +1,112 @@ +// Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +// SPDX-License-Identifier: BSD-3-Clause + + +#include "qtsinglecoreapplication.h" +#include "qtlocalpeer.h" + +/*! + \class QtSingleCoreApplication qtsinglecoreapplication.h + \brief A variant of the QtSingleApplication class for non-GUI applications. + + This class is a variant of QtSingleApplication suited for use in + console (non-GUI) applications. It is an extension of + QCoreApplication (instead of QApplication). It does not require + the QtGui library. + + The API and usage is identical to QtSingleApplication, except that + functions relating to the "activation window" are not present, for + obvious reasons. Please refer to the QtSingleApplication + documentation for explanation of the usage. + + A QtSingleCoreApplication instance can communicate to a + QtSingleApplication instance if they share the same application + id. Hence, this class can be used to create a light-weight + command-line tool that sends commands to a GUI application. + + \sa QtSingleApplication +*/ + +/*! + Creates a QtSingleCoreApplication object. The application identifier + will be QCoreApplication::applicationFilePath(). \a argc and \a + argv are passed on to the QCoreAppliation constructor. +*/ + +QtSingleCoreApplication::QtSingleCoreApplication(int &argc, char **argv) + : QCoreApplication(argc, argv) +{ + peer = new QtLocalPeer(this); + connect(peer, SIGNAL(messageReceived(const QString&)), SIGNAL(messageReceived(const QString&))); +} + + +/*! + Creates a QtSingleCoreApplication object with the application + identifier \a appId. \a argc and \a argv are passed on to the + QCoreAppliation constructor. +*/ +QtSingleCoreApplication::QtSingleCoreApplication(const QString &appId, int &argc, char **argv) + : QCoreApplication(argc, argv) +{ + peer = new QtLocalPeer(this, appId); + connect(peer, SIGNAL(messageReceived(const QString&)), SIGNAL(messageReceived(const QString&))); +} + + +/*! + Returns true if another instance of this application is running; + otherwise false. + + This function does not find instances of this application that are + being run by a different user (on Windows: that are running in + another session). + + \sa sendMessage() +*/ + +bool QtSingleCoreApplication::isRunning() +{ + return peer->isClient(); +} + + +/*! + Tries to send the text \a message to the currently running + instance. The QtSingleCoreApplication object in the running instance + will emit the messageReceived() signal when it receives the + message. + + This function returns true if the message has been sent to, and + processed by, the current instance. If there is no instance + currently running, or if the running instance fails to process the + message within \a timeout milliseconds, this function return false. + + \sa isRunning(), messageReceived() +*/ + +bool QtSingleCoreApplication::sendMessage(const QString &message, int timeout) +{ + return peer->sendMessage(message, timeout); +} + + +/*! + Returns the application identifier. Two processes with the same + identifier will be regarded as instances of the same application. +*/ + +QString QtSingleCoreApplication::id() const +{ + return peer->applicationId(); +} + + +/*! + \fn void QtSingleCoreApplication::messageReceived(const QString& message) + + This signal is emitted when the current instance receives a \a + message from another instance of this application. + + \sa sendMessage() +*/ diff --git a/windowsview/ukui-window-switch-wlcom/qtsingleapplication/src/qtsinglecoreapplication.h b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/src/qtsinglecoreapplication.h new file mode 100644 index 0000000000000000000000000000000000000000..12725899f20861a100dc3359b924b50ec122c1c7 --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/src/qtsinglecoreapplication.h @@ -0,0 +1,34 @@ +// Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef QTSINGLECOREAPPLICATION_H +#define QTSINGLECOREAPPLICATION_H + +#include + +class QtLocalPeer; + +class QtSingleCoreApplication : public QCoreApplication +{ + Q_OBJECT + +public: + QtSingleCoreApplication(int &argc, char **argv); + QtSingleCoreApplication(const QString &id, int &argc, char **argv); + + bool isRunning(); + QString id() const; + +public Q_SLOTS: + bool sendMessage(const QString &message, int timeout = 5000); + + +Q_SIGNALS: + void messageReceived(const QString &message); + + +private: + QtLocalPeer* peer; +}; + +#endif // QTSINGLECOREAPPLICATION_H diff --git a/windowsview/ukui-window-switch-wlcom/qtsingleapplication/src/qtsinglecoreapplication.pri b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/src/qtsinglecoreapplication.pri new file mode 100644 index 0000000000000000000000000000000000000000..d2d6cc3e148ec45c831641f1afd35cebb33cf92d --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/qtsingleapplication/src/qtsinglecoreapplication.pri @@ -0,0 +1,10 @@ +INCLUDEPATH += $$PWD +DEPENDPATH += $$PWD +HEADERS += $$PWD/qtsinglecoreapplication.h $$PWD/qtlocalpeer.h +SOURCES += $$PWD/qtsinglecoreapplication.cpp $$PWD/qtlocalpeer.cpp + +QT *= network + +win32:contains(TEMPLATE, lib):contains(CONFIG, shared) { + DEFINES += QT_QTSINGLECOREAPPLICATION_EXPORT=__declspec(dllexport) +} diff --git a/windowsview/ukui-window-switch-wlcom/thumbnail.cpp b/windowsview/ukui-window-switch-wlcom/thumbnail.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1867b90f32cdd9bce9ab4379ba8f65f7c4ada3e1 --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/thumbnail.cpp @@ -0,0 +1,202 @@ +/* + * Copyright (C) 2024, KylinSoft Co., Ltd. + + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "context.h" +#include + +class Thumbnail::Private +{ + public: + Private(Thumbnail *thumbnail); + ~Private(); + void setup(kywc_context *ctx, Thumbnail::Type type, QString uuid, QString output_uuid); + + int32_t fd; + uint32_t format; + QSize size; + uint32_t offset; + uint32_t stride; + uint64_t modifier; + Thumbnail::BufferFlags flags; + + Type type; + QString source_uuid; + QString output_uuid; + + kywc_thumbnail *k_thumbnail = nullptr; + + private: + Thumbnail *t; + static bool bufferHandle(kywc_thumbnail *thumbnail, const struct kywc_thumbnail_buffer *buffer, + void *data); + static void bufferUpdateHandle(kywc_thumbnail *thumbnail, + const struct kywc_thumbnail_buffer *buffer, void *data); + static void destroyHandle(kywc_thumbnail *thumbnail, void *data); + static struct kywc_thumbnail_interface thumbnail_impl; +}; + +Thumbnail::Private::Private(Thumbnail *thumbnail) : t(thumbnail) {} + +Thumbnail::Private::~Private() {} + +void Thumbnail::Private::bufferUpdateHandle(kywc_thumbnail *thumbnail, + const struct kywc_thumbnail_buffer *buffer, void *data) +{ + Thumbnail *thum = (Thumbnail *)data; + + switch (thumbnail->type) { + case KYWC_THUMBNAIL_TYPE_OUTPUT: + thum->pri->type = Thumbnail::Type::Output; + break; + case KYWC_THUMBNAIL_TYPE_TOPLEVEL: + thum->pri->type = Thumbnail::Type::Toplevel; + break; + case KYWC_THUMBNAIL_TYPE_WORKSPACE: + thum->pri->type = Thumbnail::Type::Workspace; + break; + } + + thum->pri->source_uuid = QString(thumbnail->source_uuid); + thum->pri->output_uuid = QString(thumbnail->output_uuid); + + if (buffer->flags & KYWC_THUMBNAIL_BUFFER_IS_DMABUF) { + thum->pri->flags |= Thumbnail::BufferFlag::Dmabuf; + } + + if (buffer->flags & KYWC_THUMBNAIL_BUFFER_IS_REUSED) { + thum->pri->flags |= Thumbnail::BufferFlag::Reused; + } + + thum->pri->size = QSize(buffer->width, buffer->height); + thum->pri->offset = buffer->offset; + thum->pri->stride = buffer->stride; + thum->pri->fd = buffer->fd; + + thum->pri->format = buffer->format; + thum->pri->modifier = buffer->modifier; + + emit thum->bufferUpdate(); +} + +bool Thumbnail::Private::bufferHandle(kywc_thumbnail *thumbnail, + const struct kywc_thumbnail_buffer *buffer, void *data) +{ + bufferUpdateHandle(thumbnail, buffer, data); + return true; +} + +void Thumbnail::Private::destroyHandle(kywc_thumbnail *thumbnail, void *data) +{ + Thumbnail *thum = (Thumbnail *)data; + emit thum->deleted(); +} + +struct kywc_thumbnail_interface Thumbnail::Private::thumbnail_impl { + bufferHandle, destroyHandle,bufferUpdateHandle, +}; + +void Thumbnail::Private::setup(kywc_context *ctx, Thumbnail::Type type, QString uuid, + QString output_uuid) +{ + enum kywc_thumbnail_type flag = KYWC_THUMBNAIL_TYPE_TOPLEVEL; + switch (type) { + case Thumbnail::Type::Output: + flag = KYWC_THUMBNAIL_TYPE_OUTPUT; + break; + case Thumbnail::Type::Toplevel: + flag = KYWC_THUMBNAIL_TYPE_TOPLEVEL; + break; + case Thumbnail::Type::Workspace: + flag = KYWC_THUMBNAIL_TYPE_WORKSPACE; + break; + } + QByteArray qByteArray_uuid = uuid.toUtf8(); + char *str = qByteArray_uuid.data(); + + QByteArray qByteArray = output_uuid.toUtf8(); + char *output = qByteArray.data(); + if(k_thumbnail) { + kywc_thumbnail_destroy(k_thumbnail); + } + k_thumbnail = kywc_thumbnail_create(ctx, flag, str, output, &thumbnail_impl, this->t); +} + +Thumbnail::Thumbnail(QObject *parent) : pri(new Private(this)) {} + +Thumbnail::~Thumbnail() { + if(pri) { + delete pri; + pri = nullptr; + } +} + +void Thumbnail::setup(kywc_context *ctx, Thumbnail::Type type, QString uuid, QString output_uuid) +{ + pri->setup(ctx, type, uuid, output_uuid); +} + +int32_t Thumbnail::fd() const +{ + return pri->fd; +} + +uint32_t Thumbnail::format() const +{ + return pri->format; +} + +QSize Thumbnail::size() const +{ + return pri->size; +} + +uint32_t Thumbnail::offset() const +{ + return pri->offset; +} + +uint32_t Thumbnail::stride() const +{ + return pri->stride; +} + +uint64_t Thumbnail::modifier() const +{ + return pri->modifier; +} + +Thumbnail::BufferFlags Thumbnail::flags() const +{ + return pri->flags; +} + +void Thumbnail::release(bool wants_buffer) +{ + if (pri->k_thumbnail) { + kywc_thumbnail_release(pri->k_thumbnail, wants_buffer); + } +} + +void Thumbnail::destory() +{ + if(pri->k_thumbnail) { + kywc_thumbnail_destroy(pri->k_thumbnail); + pri->k_thumbnail = nullptr; + } +} diff --git a/windowsview/ukui-window-switch-wlcom/toplevel.cpp b/windowsview/ukui-window-switch-wlcom/toplevel.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e585c7300cc74f8441a73635bee9a09f411136c7 --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/toplevel.cpp @@ -0,0 +1,374 @@ +/* + * Copyright (C) 2024, KylinSoft Co., Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "context.h" +#include +#include + +class Toplevel::Private +{ + public: + Private(Toplevel *toplevel); + ~Private(); + void setup(kywc_toplevel *toplevel); + QString uuid; + QString title; + QString app_id; + QString icon; + QPointer parent; + QString primary_output; + QStringList workspaces; + QPoint point; + QSize size; + Toplevel::Capabilities capabilities; + bool activated, minimized, maximized, fullscreen; + uint32_t pid; + + kywc_toplevel *k_toplevel; + + XdgDesktopFile xdf; + + private: + Toplevel *t; + static void stateHandle(kywc_toplevel *toplevel, uint32_t mask); + static void destroyHandle(kywc_toplevel *toplevel); + static struct kywc_toplevel_interface toplevel_impl; +}; + +Toplevel::Private::Private(Toplevel *toplevel) : t(toplevel) {} + +Toplevel::Private::~Private() {} + +void Toplevel::Private::stateHandle(kywc_toplevel *toplevel, uint32_t mask) +{ + Toplevel *t_toplevel = (Toplevel *)kywc_toplevel_get_user_data(toplevel); + + Toplevel::Masks t_mask; + if (mask & KYWC_TOPLEVEL_STATE_APP_ID) { + t_mask |= Toplevel::Mask::AppId; + t_toplevel->pri->app_id = QString(toplevel->app_id); + } + + if (mask & KYWC_TOPLEVEL_STATE_TITLE) { + t_mask |= Toplevel::Mask::Title; + t_toplevel->pri->title = QString(toplevel->title); + } + + if (mask & KYWC_TOPLEVEL_STATE_ACTIVATED) { + t_mask |= Toplevel::Mask::Activated; + t_toplevel->pri->activated = toplevel->activated; + } + + if (mask & KYWC_TOPLEVEL_STATE_MINIMIZED) { + t_mask |= Toplevel::Mask::Minimized; + t_toplevel->pri->minimized = toplevel->minimized; + } + + if (mask & KYWC_TOPLEVEL_STATE_MAXIMIZED) { + t_mask |= Toplevel::Mask::Maximized; + t_toplevel->pri->maximized = toplevel->maximized; + } + + if (mask & KYWC_TOPLEVEL_STATE_FULLSCREEN) { + t_mask |= Toplevel::Mask::Fullscreen; + t_toplevel->pri->fullscreen = toplevel->fullscreen; + } + + if (mask & KYWC_TOPLEVEL_STATE_PRIMARY_OUTPUT) { + t_mask |= Toplevel::Mask::PrimaryOutput; + t_toplevel->pri->primary_output = QString(toplevel->primary_output); + } + + if (mask & KYWC_TOPLEVEL_STATE_WORKSPACE) { + t_mask |= Toplevel::Mask::Workspace; + t_toplevel->pri->workspaces.clear(); + for (int i = 0; i < MAX_WORKSPACES; i++) { + if (toplevel->workspaces[i] == NULL || toplevel->workspaces[i][0] == '\0') + continue; + t_toplevel->pri->workspaces << QString(toplevel->workspaces[i]); + } + } + + if (mask & KYWC_TOPLEVEL_STATE_PARENT) { + t_mask |= Toplevel::Mask::Parent; + if (toplevel->parent) { + Toplevel *parent_toplevel = (Toplevel *)kywc_toplevel_get_user_data(toplevel->parent); + if (parent_toplevel == nullptr) { + parent_toplevel = new Toplevel; + parent_toplevel->setup(toplevel->parent); + } + t_toplevel->pri->parent = parent_toplevel; + } else + t_toplevel->pri->parent = nullptr; + } + + if (mask & KYWC_TOPLEVEL_STATE_ICON) { + t_mask |= Toplevel::Mask::Icon; + if (!QString(toplevel->icon).isEmpty() && QString(toplevel->icon) != "fallback") { + t_toplevel->pri->icon = QString(toplevel->icon); + } + } + + if (mask & KYWC_TOPLEVEL_STATE_POSITION) { + t_mask |= Toplevel::Mask::Position; + t_toplevel->pri->point = QPoint(toplevel->x, toplevel->y); + } + + if (mask & KYWC_TOPLEVEL_STATE_SIZE) { + t_mask |= Toplevel::Mask::Size; + t_toplevel->pri->size = QSize(toplevel->width, toplevel->height); + } + emit t_toplevel->stateUpdated(t_mask); +} + +void Toplevel::Private::destroyHandle(kywc_toplevel *toplevel) +{ + Toplevel *t_toplevel = (Toplevel *)kywc_toplevel_get_user_data(toplevel); + + emit t_toplevel->deleted(); +} + +struct kywc_toplevel_interface Toplevel::Private::toplevel_impl { + stateHandle, destroyHandle, +}; + +void Toplevel::Private::setup(kywc_toplevel *toplevel) +{ + k_toplevel = toplevel; + uuid = QString(toplevel->uuid); + title = QString(toplevel->title); + icon = QString(toplevel->icon); + app_id = QString(toplevel->app_id); + pid = uint32_t(toplevel->pid); + if (toplevel->parent) { + Toplevel *parent_toplevel = (Toplevel *)kywc_toplevel_get_user_data(toplevel->parent); + if (parent_toplevel == nullptr) { + parent_toplevel = new Toplevel; + parent_toplevel->setup(toplevel->parent); + } + parent = parent_toplevel; + } else + parent = nullptr; + primary_output = toplevel->primary_output; + for (int i = 0; i < MAX_WORKSPACES; i++) { + if (toplevel->workspaces[i] == NULL || toplevel->workspaces[i][0] == '\0') + continue; + workspaces << QString(toplevel->workspaces[i]); + } + + if (toplevel->capabilities & KYWC_TOPLEVEL_CAPABILITY_SKIP_TASKBAR) + capabilities |= Toplevel::Capability::Taskbar; + if (toplevel->capabilities & KYWC_TOPLEVEL_CAPABILITY_SKIP_SWITCHER) + capabilities |= Toplevel::Capability::Switcher; + + activated = toplevel->activated; + minimized = toplevel->minimized; + maximized = toplevel->maximized; + fullscreen = toplevel->fullscreen; + point = QPoint(toplevel->x, toplevel->y); + size = QSize(toplevel->width, toplevel->height); + + kywc_toplevel_set_interface(toplevel, &toplevel_impl); + kywc_toplevel_set_user_data(toplevel, t); +} + +Toplevel::Toplevel(QObject *parent) : pri(new Private(this)) {} + +Toplevel::~Toplevel() { + if(pri) { + delete pri; + pri = nullptr; + } +} + +void Toplevel::setup(kywc_toplevel *toplevel) +{ + pri->setup(toplevel); +} + +QString Toplevel::uuid() const +{ + return pri->uuid; +} + +QString Toplevel::title() const +{ + return pri->title; +} + +QString Toplevel::icon() const +{ + return pri->icon; +} + +QString Toplevel::appId() const +{ + return pri->app_id; +} + +QPointer Toplevel::parent() const +{ + return pri->parent; +} + +QString Toplevel::primaryOutput() const +{ + return pri->primary_output; +} + +QStringList Toplevel::workspaces() const +{ + return pri->workspaces; +} + +QPoint Toplevel::point() const +{ + return pri->point; +} + +QSize Toplevel::size() const +{ + return pri->size; +} + +Toplevel::Capabilities Toplevel::capabilities() const +{ + return pri->capabilities; +} + +bool Toplevel::isActivated() const +{ + return pri->activated; +} + +bool Toplevel::isMinimized() const +{ + return pri->minimized; +} + +bool Toplevel::isMaximized() const +{ + return pri->maximized; +} + +bool Toplevel::isFullscreen() const +{ + return pri->fullscreen; +} + +uint32_t Toplevel::pid() const +{ + return pri->pid; +} + +void Toplevel::setMaximized(QString output) +{ + QByteArray qByteArray = output.toUtf8(); + char *str = qByteArray.data(); + kywc_toplevel_set_maximized(pri->k_toplevel, str); +} + +void Toplevel::unsetMaximized() +{ + kywc_toplevel_unset_maximized(pri->k_toplevel); +} + +void Toplevel::setMinimized() +{ + kywc_toplevel_set_minimized(pri->k_toplevel); +} + +void Toplevel::unsetMinimized() +{ + kywc_toplevel_unset_minimized(pri->k_toplevel); +} + +void Toplevel::setFullscreen(QString output) +{ + QByteArray qByteArray = output.toUtf8(); + char *str = qByteArray.data(); + kywc_toplevel_set_fullscreen(pri->k_toplevel, str); +} + +void Toplevel::unsetFullscreen() +{ + kywc_toplevel_unset_fullscreen(pri->k_toplevel); +} + +void Toplevel::setActivate() +{ + kywc_toplevel_activate(pri->k_toplevel); +} + +void Toplevel::close() +{ + kywc_toplevel_close(pri->k_toplevel); +} + +void Toplevel::enterWorkspace(QString workspace) +{ + QByteArray qByteArray = workspace.toUtf8(); + char *str = qByteArray.data(); + kywc_toplevel_enter_workspace(pri->k_toplevel, str); +} + +void Toplevel::leaveWorkspace(QString workspace) +{ + QByteArray qByteArray = workspace.toUtf8(); + char *str = qByteArray.data(); + kywc_toplevel_leave_workspace(pri->k_toplevel, str); +} + +void Toplevel::moveToWorkspace(QString workspace) +{ + QByteArray qByteArray = workspace.toUtf8(); + char *str = qByteArray.data(); + kywc_toplevel_move_to_workspace(pri->k_toplevel, str); +} + +void Toplevel::moveToOutput(QString output) +{ + QByteArray qByteArray = output.toUtf8(); + char *str = qByteArray.data(); + kywc_toplevel_move_to_output(pri->k_toplevel, str); +} + +bool Toplevel::hasChildren() +{ + return kywc_toplevel_has_children(pri->k_toplevel); +} + +void Toplevel::setDesktopFile(const QString & desktopFile) +{ + pri->xdf.load(desktopFile); +} + +QString Toplevel::iconName() const +{ + if (icon().isEmpty() || icon() == "fallback") { + return pri->xdf.iconName(); + } else { + return icon(); + } +} + +QString Toplevel::name() const +{ + return pri->xdf.localizedValue("Name").toString(); +} diff --git a/windowsview/ukui-window-switch-wlcom/ui.cpp b/windowsview/ukui-window-switch-wlcom/ui.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0b2652231c92712cb5934e1ab42ad44db812a987 --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/ui.cpp @@ -0,0 +1,940 @@ +/* + * Copyright (C) 2024, KylinSoft Co., Ltd. + + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "widget.h" + +MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) +{ + struct wl_display *display = NULL; + + QPlatformNativeInterface *native = QGuiApplication::platformNativeInterface(); + if (!native) { + return; + } + + display = reinterpret_cast( + native->nativeResourceForIntegration(QByteArrayLiteral("wl_display"))); + if (!display) { + qWarning("Failed to get Wayland display."); + return; + } + + context = new Context(display, Context::Capability::Output | Context::Capability::Toplevel | + Context::Capability::Workspace); + init_form(); + context->start(); +} + +MainWindow::~MainWindow() +{ + delete context; +} + +void MainWindow::init_workspace_widget(QWidget *widget) +{ + QGridLayout *layout = new QGridLayout(widget); + + tableWidget_0 = new QTableWidget(); + + QStringList col_list_lable; // 列标题 + + col_list_lable << QString("uuid"); + col_list_lable << QString("name"); + col_list_lable << QString("position"); + col_list_lable << QString("activated"); + int col_list_lable_cnt = col_list_lable.count(); + tableWidget_0->setColumnCount(col_list_lable_cnt); + tableWidget_0->setHorizontalHeaderLabels(col_list_lable); + + tableWidget_0->setSelectionBehavior(QAbstractItemView::SelectRows); // 是否可选中 + tableWidget_0->setStyleSheet("selection-background-color:pink"); + tableWidget_0->setShowGrid(true); + + tableWidget_0->horizontalHeader()->setSectionResizeMode(0, QHeaderView::ResizeToContents); + + QPushButton *add_btn = new QPushButton("add new"); + QPushButton *activited_btn = new QPushButton("set activited"); + QPushButton *move_up_btn = new QPushButton("move up"); + QPushButton *move_down_btn = new QPushButton("move down"); + QPushButton *delete_btn = new QPushButton("delete"); + + add_btn->setFixedSize(100, 30); + activited_btn->setFixedSize(100, 30); + move_up_btn->setFixedSize(100, 30); + move_down_btn->setFixedSize(100, 30); + delete_btn->setFixedSize(100, 30); + + layout->addWidget(tableWidget_0, 0, 0, 5, 1); + layout->addWidget(add_btn, 0, 1); + layout->addWidget(activited_btn, 1, 1); + layout->addWidget(move_up_btn, 2, 1); + layout->addWidget(move_down_btn, 3, 1); + layout->addWidget(delete_btn, 4, 1); + + layout->setColumnStretch(0, 8); + layout->setColumnStretch(1, 2); + + widget->setLayout(layout); + + tableWidget_0->setMouseTracking(true); + connect(tableWidget_0, SIGNAL(entered(QModelIndex)), this, SLOT(ShowTooltip(QModelIndex))); + connect(add_btn, SIGNAL(clicked()), this, SLOT(add_btn_clicked())); + connect(move_up_btn, SIGNAL(clicked()), this, SLOT(move_up_btn_clicked())); + connect(move_down_btn, SIGNAL(clicked()), this, SLOT(move_down_btn_clicked())); + connect(delete_btn, SIGNAL(clicked()), this, SLOT(delete_btn_clicked())); + connect(activited_btn, SIGNAL(clicked()), this, SLOT(activited_btn_clicked())); + workspace_count = 0; + + connect(context, &Context::workespaceAdded, this, &MainWindow::add_workspace_item); +} + +void MainWindow::init_output_widget(QWidget *widget) +{ + QGridLayout *layout = new QGridLayout(widget); + + tableWidget_1 = new QTableWidget(widget); + + QStringList col_list_lable; // 列标题 + + QLabel *label = new QLabel("Primary output :", widget); + label->setFont(QFont("Helvetica")); + + pri_label = new QLabel(widget); + pri_label->setStyleSheet("QLabel{background-color:rgb(192, 192, 192);}"); + pri_label->setAutoFillBackground(true); + pri_label->setAlignment(Qt::AlignCenter); + pri_label->setGeometry(102, 4, 100, 25); + + tableWidget_1->setGeometry(0, 30, 100, 100); + + col_list_lable << QString("uuid"); + col_list_lable << QString("name"); + col_list_lable << QString("make"); + col_list_lable << QString("model"); + col_list_lable << QString("serial"); + col_list_lable << QString("description"); + col_list_lable << QString("phisical size"); + col_list_lable << QString("capabilities"); + col_list_lable << QString("modes"); + col_list_lable << QString("current modes"); + col_list_lable << QString("position"); + col_list_lable << QString("transform"); + col_list_lable << QString("scale"); + col_list_lable << QString("enabled"); + col_list_lable << QString("power"); + col_list_lable << QString("brightness"); + col_list_lable << QString("color_temp"); + int col_list_lable_cnt = col_list_lable.count(); + tableWidget_1->setColumnCount(col_list_lable_cnt); + tableWidget_1->setHorizontalHeaderLabels(col_list_lable); + + tableWidget_1->resize(940, 240); + tableWidget_1->horizontalScrollBar()->setEnabled(true); + tableWidget_1->setEditTriggers(QAbstractItemView::NoEditTriggers); // 是否可编辑 + tableWidget_1->setSelectionBehavior(QAbstractItemView::SelectRows); // 是否可选中 + tableWidget_1->setStyleSheet("selection-background-color:pink"); + tableWidget_1->setShowGrid(true); + + tableWidget_1->horizontalHeader()->setSectionResizeMode(0, QHeaderView::ResizeToContents); + + layout->addWidget(label, 0, 0); + layout->addWidget(pri_label, 0, 1); + layout->addWidget(tableWidget_1, 1, 0, 10, 10); + widget->setLayout(layout); + outputs_count = 0; + + tableWidget_1->setMouseTracking(true); + connect(tableWidget_1, SIGNAL(entered(QModelIndex)), this, SLOT(ShowTooltip(QModelIndex))); + + connect(context, &Context::outputAdded, this, &MainWindow::add_output_item); +} + +void MainWindow::init_toplevel_widget(QWidget *widget) +{ + QVBoxLayout *layout = new QVBoxLayout(); + widget->setLayout(layout); + + tableWidget_2 = new QTableWidget; + + layout->addWidget(tableWidget_2); + tableWidget_2->setContextMenuPolicy(Qt::CustomContextMenu); + connect(tableWidget_2, SIGNAL(customContextMenuRequested(QPoint)), this, + SLOT(show_menu(QPoint))); + + QStringList col_list_lable; // 列标题 + + col_list_lable << QString("uuid"); + col_list_lable << QString("title"); + col_list_lable << QString("app_id"); + col_list_lable << QString("icon"); + col_list_lable << QString("position"); + col_list_lable << QString("size"); + + col_list_lable << QString("capabilities"); + col_list_lable << QString("parent"); + col_list_lable << QString("primary output"); + col_list_lable << QString("activited"); + col_list_lable << QString("minimizad"); + col_list_lable << QString("maximized"); + col_list_lable << QString("fullscreen"); + col_list_lable << QString("workespaces"); + + int col_list_lable_cnt = col_list_lable.count(); + tableWidget_2->setColumnCount(col_list_lable_cnt); + tableWidget_2->setHorizontalHeaderLabels(col_list_lable); + + tableWidget_2->horizontalScrollBar()->setEnabled(true); + tableWidget_2->setEditTriggers(QAbstractItemView::NoEditTriggers); // 是否可编辑 + tableWidget_2->setSelectionBehavior(QAbstractItemView::SelectRows); // 是否可选中 + tableWidget_2->setStyleSheet("selection-background-color:pink"); + tableWidget_2->setShowGrid(true); + + tableWidget_2->horizontalHeader()->setSectionResizeMode(0, QHeaderView::ResizeToContents); + tableWidget_2->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); + + tableWidget_2->setMinimumSize(QSize(700, 500)); + toplevel_count = 0; + + tableWidget_2->setMouseTracking(true); + connect(tableWidget_2, SIGNAL(entered(QModelIndex)), this, SLOT(ShowTooltip(QModelIndex))); + connect(context, &Context::toplevelAdded, this, &MainWindow::add_toplevel_item); +} + +void MainWindow::ShowTooltip(QModelIndex index) +{ + QToolTip::showText(QCursor::pos(), index.data().toString()); + return; +} + +void MainWindow::init_form() +{ + QTabWidget *tabWidget = new QTabWidget(this); + this->setCentralWidget(tabWidget); + + QWidget *pageWidget_0 = new QWidget; + QWidget *pageWidget_1 = new QWidget; + QWidget *pageWidget_2 = new QWidget; + + tabWidget->addTab(pageWidget_0, "workspace"); + tabWidget->addTab(pageWidget_1, "output"); + tabWidget->addTab(pageWidget_2, "toplevel"); + + tabWidget->resize(940, 300); + + init_workspace_widget(pageWidget_0); + init_output_widget(pageWidget_1); + init_toplevel_widget(pageWidget_2); +} + +static int get_cur_rows(QTableWidget *tableWidget, QString uuid) +{ + for (int i = 0; i < tableWidget->rowCount(); i++) { + if (tableWidget->item(i, 0)->text() == uuid) + return i; + } + return -1; +} + +void MainWindow::update_output_item(Output::Masks mask) +{ + Output *output = qobject_cast(sender()); + int cur_row = get_cur_rows(tableWidget_1, output->uuid()); + if (cur_row < 0) + return; + + if (mask & Output::Mask::Enabled) { + if (output->isEnabled()) + tableWidget_1->item(cur_row, 13)->setText("yes"); + else + tableWidget_1->item(cur_row, 13)->setText("no"); + } + + if (mask & Output::Mask::Mode) { + Output::Mode cur_mode = output->curMode(); + QString cur_m = QString("%1 x %2 px, %3 Hz") + .arg(cur_mode.size.width()) + .arg(cur_mode.size.height()) + .arg(cur_mode.refresh); + if (cur_mode.preferred) + cur_m += " preferred"; + tableWidget_1->item(cur_row, 9)->setText(cur_m); + } + + if (mask & Output::Mask::Position) { + QString position = QString("%1 , %2").arg(output->point().x()).arg(output->point().y()); + tableWidget_1->item(cur_row, 10)->setText(position); + } + + if (mask & Output::Mask::Transform) { + QString transform = QString("%1").arg(output->transform()) + "°"; + tableWidget_1->item(cur_row, 11)->setText(transform); + } + + if (mask & Output::Mask::Scale) + tableWidget_1->item(cur_row, 12)->setText(QString::number(output->scale(), 'f', 2)); + + if (mask & Output::Mask::Power) { + if (output->isPower()) + tableWidget_1->item(cur_row, 14)->setText("on"); + else + tableWidget_1->item(cur_row, 14)->setText("off"); + } + + if (mask & Output::Mask::Primary) { + if (output->isPrimary()) + pri_label->setText(output->name()); + } + + if (mask & Output::Mask::Brightness) + tableWidget_1->item(cur_row, 15)->setText(QString("%1").arg(output->brightness())); + + if (mask & Output::Mask::ColorTemp) + tableWidget_1->item(cur_row, 16)->setText(QString("%1").arg(output->colorTemp())); +} + +void MainWindow::delete_output_item() +{ + Output *output = qobject_cast(sender()); + int cur_row = get_cur_rows(tableWidget_1, output->uuid()); + if (cur_row < 0) + return; + + tableWidget_1->removeRow(cur_row); // 删除 + delete output; + outputs_count--; +} + +void MainWindow::add_output_item(Output *output) +{ + int rows = tableWidget_1->rowCount(); + int columns = tableWidget_1->columnCount(); + if (outputs_count > (rows - 1)) + tableWidget_1->insertRow(outputs_count); // 插入 + + for (int i = 0; i < columns; i++) { + tableWidget_1->setItem(outputs_count, i, new QTableWidgetItem); + tableWidget_1->setRowHeight(outputs_count, 30); + tableWidget_1->item(outputs_count, i)->setTextAlignment(Qt::AlignCenter); // 居中显示 + tableWidget_1->item(outputs_count, i)->setFont(QFont("Helvetica")); // 设置字体为黑体 + } + + tableWidget_1->item(outputs_count, 0)->setText(output->uuid()); + tableWidget_1->item(outputs_count, 1)->setText(output->name()); + tableWidget_1->item(outputs_count, 2)->setText(output->make()); + tableWidget_1->item(outputs_count, 3)->setText(output->model()); + tableWidget_1->item(outputs_count, 4)->setText(output->serial()); + tableWidget_1->item(outputs_count, 5)->setText(output->description()); + + QString phisical_size = QString("%1 x %2 mm") + .arg(output->physicalSize().width()) + .arg(output->physicalSize().height()); + tableWidget_1->item(outputs_count, 6)->setText(phisical_size); + + QString caps; + if (output->capabilities() & Output::Capability::Power) + caps += "power "; + if (output->capabilities() & Output::Capability::Brightness) + caps += "brightness "; + if (output->capabilities() & Output::Capability::ColorTemp) + caps += "color_temp"; + tableWidget_1->item(outputs_count, 7)->setText(caps); + + QComboBox *comBox_mode = new QComboBox(); + QList modes = output->modes(); + for (int i = 0; i < modes.size(); i++) { + QString mode = QString("%1 x %2 px, %3 Hz") + .arg(modes[i].size.width()) + .arg(modes[i].size.height()) + .arg(modes[i].refresh); + if (modes[i].preferred) + mode += " preferred"; + comBox_mode->addItem(mode); + } + + tableWidget_1->setCellWidget(outputs_count, 8, comBox_mode); + if (output->isEnabled()) + tableWidget_1->item(outputs_count, 13)->setText("yes"); + else + tableWidget_1->item(outputs_count, 13)->setText("no"); + + Output::Mode cur_mode = output->curMode(); + QString cur_m = QString("%1 x %2 px, %3 Hz") + .arg(cur_mode.size.width()) + .arg(cur_mode.size.height()) + .arg(cur_mode.refresh); + if (cur_mode.preferred) + cur_m += " preferred"; + + tableWidget_1->item(outputs_count, 9)->setText(cur_m); + QString position = QString("%1 , %2").arg(output->point().x()).arg(output->point().y()); + tableWidget_1->item(outputs_count, 10)->setText(position); + QString transform = QString("%1").arg(output->transform()) + "°"; + tableWidget_1->item(outputs_count, 11)->setText(transform); + tableWidget_1->item(outputs_count, 12)->setText(QString::number(output->scale(), 'f', 2)); + if (output->isPower()) + tableWidget_1->item(outputs_count, 14)->setText("on"); + else + tableWidget_1->item(outputs_count, 14)->setText("off"); + + if (output->isPrimary()) + pri_label->setText(output->name()); + + tableWidget_1->item(outputs_count, 15)->setText(QString("%1").arg(output->brightness())); + tableWidget_1->item(outputs_count, 16)->setText(QString("%1").arg(output->colorTemp())); + + connect(output, &Output::stateUpdated, this, &MainWindow::update_output_item); + connect(output, &Output::deleted, this, &MainWindow::delete_output_item); + tableWidget_1->show(); + + outputs_count++; +} + +void MainWindow::delete_toplevel_item() +{ + Toplevel *toplevel = qobject_cast(sender()); + + int cur_row = get_cur_rows(tableWidget_2, toplevel->uuid()); + if (cur_row < 0) + return; + tableWidget_2->removeRow(cur_row); // 删除 + delete toplevel; + toplevel_count--; +} + +void MainWindow::update_toplevel_item(Toplevel::Masks mask) +{ + Toplevel *toplevel = qobject_cast(sender()); + + int cur_row = get_cur_rows(tableWidget_2, toplevel->uuid()); + if (cur_row < 0) + return; + + if (mask & Toplevel::Mask::AppId) + tableWidget_2->item(cur_row, 2)->setText(toplevel->appId()); + + if (mask & Toplevel::Mask::Title) + tableWidget_2->item(cur_row, 1)->setText(toplevel->title()); + + if (mask & Toplevel::Mask::Activated) { + if (toplevel->isActivated()) + tableWidget_2->item(cur_row, 9)->setText("true"); + else + tableWidget_2->item(cur_row, 9)->setText("false"); + } + + if (mask & Toplevel::Mask::Minimized) { + if (toplevel->isMinimized()) + tableWidget_2->item(cur_row, 10)->setText("true"); + else + tableWidget_2->item(cur_row, 10)->setText("false"); + } + + if (mask & Toplevel::Mask::Maximized) { + if (toplevel->isMaximized()) + tableWidget_2->item(cur_row, 11)->setText("true"); + else + tableWidget_2->item(cur_row, 11)->setText("false"); + } + + if (mask & Toplevel::Mask::Fullscreen) { + if (toplevel->isFullscreen()) + tableWidget_2->item(cur_row, 12)->setText("true"); + else + tableWidget_2->item(cur_row, 12)->setText("false"); + } + + if (mask & Toplevel::Mask::PrimaryOutput) + tableWidget_2->item(cur_row, 8)->setText(toplevel->primaryOutput()); + + if (mask & Toplevel::Mask::Workspace) { + QStringList workspaces = toplevel->workspaces(); + QComboBox *comBox_mode = new QComboBox(); + if (!workspaces.isEmpty()) { + for (int i = 0; i < workspaces.size(); i++) { + comBox_mode->addItem(workspaces.at(i)); + } + } + tableWidget_2->setCellWidget(cur_row, 13, comBox_mode); + } + + if (mask & Toplevel::Mask::Parent) { + Toplevel *parent = toplevel->parent(); + if (parent) + tableWidget_2->item(cur_row, 7)->setText(parent->uuid()); + else + tableWidget_2->item(cur_row, 7)->setText("NULL"); + } + + if (mask & Toplevel::Mask::Position) { + QString point = QString("%1 , %2").arg(toplevel->point().x()).arg(toplevel->point().y()); + tableWidget_2->item(cur_row, 4)->setText(point); + } + + if (mask & Toplevel::Mask::Size) { + QString size = + QString("%1 , %2").arg(toplevel->size().width()).arg(toplevel->size().height()); + tableWidget_2->item(cur_row, 5)->setText(size); + } + + if (mask & Toplevel::Mask::Icon) + tableWidget_2->item(cur_row, 3)->setText(toplevel->icon()); +} + +void MainWindow::add_toplevel_item(Toplevel *toplevel) +{ + int rows = tableWidget_2->rowCount(); + int columns = tableWidget_2->columnCount(); + if (toplevel_count > (rows - 1)) + tableWidget_2->insertRow(toplevel_count); // 插入 + + for (int i = 0; i < columns; i++) { + tableWidget_2->setItem(toplevel_count, i, new QTableWidgetItem); + tableWidget_2->setRowHeight(toplevel_count, 30); + tableWidget_2->item(toplevel_count, i)->setTextAlignment(Qt::AlignCenter); // 居中显示 + tableWidget_2->item(toplevel_count, i)->setFont(QFont("Helvetica")); // 设置字体为黑体 + } + + tableWidget_2->item(toplevel_count, 0)->setText(toplevel->uuid()); + + QString point = QString("%1 , %2").arg(toplevel->point().x()).arg(toplevel->point().y()); + tableWidget_2->item(toplevel_count, 4)->setText(point); + + QString size = QString("%1 , %2").arg(toplevel->size().width()).arg(toplevel->size().height()); + tableWidget_2->item(toplevel_count, 5)->setText(size); + + QString caps; + if (toplevel->capabilities() & Toplevel::Capability::Taskbar) + caps += "taskbar "; + if (toplevel->capabilities() & Toplevel::Capability::Switcher) + caps += "switcher"; + tableWidget_2->item(toplevel_count, 6)->setText(caps); + + tableWidget_2->item(toplevel_count, 2)->setText(toplevel->appId()); + tableWidget_2->item(toplevel_count, 1)->setText(toplevel->title()); + + if (toplevel->isActivated()) + tableWidget_2->item(toplevel_count, 9)->setText("true"); + else + tableWidget_2->item(toplevel_count, 9)->setText("false"); + + if (toplevel->isMinimized()) + tableWidget_2->item(toplevel_count, 10)->setText("true"); + else + tableWidget_2->item(toplevel_count, 10)->setText("false"); + + if (toplevel->isMaximized()) + tableWidget_2->item(toplevel_count, 11)->setText("true"); + else + tableWidget_2->item(toplevel_count, 11)->setText("false"); + + if (toplevel->isFullscreen()) + tableWidget_2->item(toplevel_count, 12)->setText("true"); + else + tableWidget_2->item(toplevel_count, 12)->setText("false"); + + tableWidget_2->item(toplevel_count, 8)->setText(toplevel->primaryOutput()); + + QStringList workspaces = toplevel->workspaces(); + QComboBox *comBox_mode = new QComboBox(); + if (!workspaces.isEmpty()) { + for (int i = 0; i < workspaces.size(); i++) + comBox_mode->addItem(workspaces.at(i)); + } + tableWidget_2->setCellWidget(toplevel_count, 13, comBox_mode); + + Toplevel *parent = toplevel->parent(); + if (parent) + tableWidget_2->item(toplevel_count, 7)->setText(parent->uuid()); + else + tableWidget_2->item(toplevel_count, 7)->setText("NULL"); + + tableWidget_2->item(toplevel_count, 3)->setText(toplevel->icon()); + + tableWidget_2->show(); + connect(toplevel, &Toplevel::stateUpdated, this, &MainWindow::update_toplevel_item); + connect(toplevel, &Toplevel::deleted, this, &MainWindow::delete_toplevel_item); + toplevel_count++; +} + +void MainWindow::add_workspace_item(Workspace *workspace) +{ + int rows = tableWidget_0->rowCount(); + int columns = tableWidget_0->columnCount(); + if (workspace_count > (rows - 1)) + tableWidget_0->insertRow(workspace_count); // 插入 + + for (int i = 0; i < columns; i++) { + tableWidget_0->setItem(workspace_count, i, new QTableWidgetItem); + tableWidget_0->setRowHeight(workspace_count, 30); + tableWidget_0->item(workspace_count, i)->setTextAlignment(Qt::AlignCenter); // 居中显示 + tableWidget_0->item(workspace_count, i)->setFont(QFont("Helvetica")); // 设置字体为黑体 + } + + tableWidget_0->item(workspace_count, 0)->setText(workspace->uuid()); + tableWidget_0->item(workspace_count, 1)->setText(workspace->name()); + tableWidget_0->item(workspace_count, 2)->setText(QString("%1").arg(workspace->position())); + + if (workspace->isActivated()) + tableWidget_0->item(workspace_count, 3)->setText("true"); + else + tableWidget_0->item(workspace_count, 3)->setText("false"); + + connect(workspace, &Workspace::stateUpdated, this, &MainWindow::update_workspace_item); + connect(workspace, &Workspace::deleted, this, &MainWindow::delete_workspace_item); + workspace_count++; +} + +void MainWindow::delete_workspace_item() +{ + Workspace *workspace = qobject_cast(sender()); + int cur_row = get_cur_rows(tableWidget_0, workspace->uuid()); + if (cur_row < 0) + return; + + tableWidget_0->removeRow(cur_row); // 删除 + delete workspace; + workspace_count--; +} + +void MainWindow::update_workspace_item(Workspace::Masks mask) +{ + Workspace *workspace = qobject_cast(sender()); + int cur_row = get_cur_rows(tableWidget_0, workspace->uuid()); + if (cur_row < 0) + return; + + if (mask & Workspace::Mask::Name) + tableWidget_0->item(cur_row, 1)->setText(workspace->name()); + + if (mask & Workspace::Mask::Position) + tableWidget_0->item(cur_row, 2)->setText(QString("%1").arg(workspace->position())); + + if (mask & Workspace::Mask::Activated) { + if (workspace->isActivated()) + tableWidget_0->item(cur_row, 3)->setText("true"); + else + tableWidget_0->item(cur_row, 3)->setText("false"); + } +} + +void MainWindow::move_up_btn_clicked() +{ + int cur_row = tableWidget_0->currentRow(); + int columns = tableWidget_0->columnCount(); + if (cur_row != 0) { + tableWidget_0->insertRow(cur_row - 1); + for (int i = 0; i < columns; ++i) { + tableWidget_0->setItem( + cur_row - 1, i, new QTableWidgetItem(tableWidget_0->item(cur_row + 1, i)->text())); + tableWidget_0->item(cur_row - 1, i)->setTextAlignment(Qt::AlignCenter); // 居中显示 + } + + tableWidget_0->removeRow(cur_row + 1); + tableWidget_0->selectRow(cur_row - 1); + + QString uuid = tableWidget_0->item(tableWidget_0->currentRow(), 0)->text(); + Workspace *workspace = context->findWorkspace(uuid); + workspace->move(workspace->position() - 1); + } +} + +void MainWindow::move_down_btn_clicked() +{ + int cur_row = tableWidget_0->currentRow(); + int columns = tableWidget_0->columnCount(); + if (cur_row < (tableWidget_0->rowCount() - 1)) { + tableWidget_0->insertRow(cur_row + 2); // rowi为选中行的索引 + for (int i = 0; i < columns; ++i) { + tableWidget_0->setItem(cur_row + 2, i, + new QTableWidgetItem(tableWidget_0->item(cur_row, i)->text())); + tableWidget_0->item(cur_row + 2, i)->setTextAlignment(Qt::AlignCenter); + } + + tableWidget_0->removeRow(cur_row); + tableWidget_0->selectRow(cur_row + 1); + + QString uuid = tableWidget_0->item(tableWidget_0->currentRow(), 0)->text(); + Workspace *workspace = context->findWorkspace(uuid); + workspace->move(workspace->position() + 1); + } +} + +void MainWindow::delete_btn_clicked() +{ + int cur_row = tableWidget_0->currentRow(); + if (cur_row < 0) + return; + + QString uuid = tableWidget_0->item(cur_row, 0)->text(); + Workspace *workspace = context->findWorkspace(uuid); + workspace->remove(); +} + +void MainWindow::activited_btn_clicked() +{ + int cur_row = tableWidget_0->currentRow(); + if (cur_row < 0) + return; + QString uuid = tableWidget_0->item(cur_row, 0)->text(); + Workspace *workspace = context->findWorkspace(uuid); + workspace->setActivate(); +} + +void MainWindow::add_btn_clicked() +{ + context->addWorkspace(workspace_count); +} + +void MainWindow::show_menu(const QPoint pos) +{ + // 设置菜单选项 + QMenu *menu = new QMenu(tableWidget_2); + QAction *action1 = new QAction("set_maximized", tableWidget_2); + QAction *action2 = new QAction("unset_maximized", tableWidget_2); + QAction *action3 = new QAction("set_minimized", tableWidget_2); + QAction *action4 = new QAction("unset_minimized", tableWidget_2); + QAction *action5 = new QAction("set_fullscreen", tableWidget_2); + QAction *action6 = new QAction("unset_fullscreen", tableWidget_2); + QAction *action7 = new QAction("set_activate", tableWidget_2); + QAction *action8 = new QAction("close", tableWidget_2); + QAction *action9 = new QAction("enter_workspace", tableWidget_2); + QAction *action10 = new QAction("leave_workspace", tableWidget_2); + QAction *action11 = new QAction("toplevel_move_to_workspace", tableWidget_2); + QAction *action12 = new QAction("send_to_output", tableWidget_2); + + menu->addAction(action1); + menu->addAction(action2); + menu->addAction(action3); + menu->addAction(action4); + menu->addAction(action5); + menu->addAction(action6); + menu->addAction(action7); + menu->addAction(action8); + menu->addAction(action9); + menu->addAction(action10); + menu->addAction(action11); + menu->addAction(action12); + + menu->move(cursor().pos()); + menu->show(); + + connect(action1, SIGNAL(triggered()), this, SLOT(toplevel_set_maximized())); + connect(action2, SIGNAL(triggered()), this, SLOT(toplevel_unset_maximized())); + connect(action3, SIGNAL(triggered()), this, SLOT(toplevel_set_minimized())); + connect(action4, SIGNAL(triggered()), this, SLOT(toplevel_unset_minimized())); + connect(action5, SIGNAL(triggered()), this, SLOT(toplevel_set_fullscreen())); + connect(action6, SIGNAL(triggered()), this, SLOT(toplevel_unset_fullscreen())); + connect(action7, SIGNAL(triggered()), this, SLOT(toplevel_set_activate())); + connect(action8, SIGNAL(triggered()), this, SLOT(toplevel_close())); + + // 获得鼠标点击的x,y坐标点 + int x = pos.x(); + int y = pos.y(); + QModelIndex index = tableWidget_2->indexAt(QPoint(x, y)); + int row = index.row(); // 获得QTableWidget列表点击的行数 + + QMenu *moreWorspace = new QMenu(); + for (int i = 0; i < tableWidget_0->rowCount(); i++) { + QAction *action = new QAction(tableWidget_0->item(i, 1)->text()); + moreWorspace->addAction(action); + connect(action, SIGNAL(triggered()), this, SLOT(toplevel_enter_workspace())); + } + + QMenu *leaveWorspaces = new QMenu(); + for (int i = 0; i < tableWidget_0->rowCount(); i++) { + QWidget *widget = tableWidget_2->cellWidget(row, 13); + QComboBox *combox = (QComboBox *)widget; + for (int j = 0; j < combox->count(); j++) { + if (combox->itemText(j) == tableWidget_0->item(i, 0)->text()) { + QAction *action = new QAction(tableWidget_0->item(i, 1)->text()); + leaveWorspaces->addAction(action); + connect(action, SIGNAL(triggered()), this, SLOT(toplevel_leave_workspace())); + } + } + } + + QMenu *moveWorspace = new QMenu(); + for (int i = 0; i < tableWidget_0->rowCount(); i++) { + QAction *action = new QAction(tableWidget_0->item(i, 1)->text()); + moveWorspace->addAction(action); + connect(action, SIGNAL(triggered()), this, SLOT(toplevel_move_to_workspace())); + } + + QWidget *widget = tableWidget_2->cellWidget(row, 13); + QComboBox *combox = (QComboBox *)widget; + if (combox->count() != 0) { + action9->setMenu(moreWorspace); + action10->setMenu(leaveWorspaces); + action11->setMenu(moveWorspace); + } + + QMenu *moreOutput = new QMenu(); + for (int i = 0; i < tableWidget_1->rowCount(); i++) { + QAction *action = new QAction(tableWidget_1->item(i, 1)->text()); + moreOutput->addAction(action); + connect(action, SIGNAL(triggered()), this, SLOT(toplevel_send_to_output())); + } + action12->setMenu(moreOutput); +} + +void MainWindow::toplevel_set_maximized() +{ + int row = tableWidget_2->currentRow(); + QString output = tableWidget_2->item(row, 6)->text(); + QString uuid = tableWidget_2->item(row, 0)->text(); + Toplevel *toplevel = context->findToplevel(uuid); + toplevel->setMaximized(output); +} + +void MainWindow::toplevel_unset_maximized() +{ + int row = tableWidget_2->currentRow(); + QString output = tableWidget_2->item(row, 6)->text(); + QString uuid = tableWidget_2->item(row, 0)->text(); + Toplevel *toplevel = context->findToplevel(uuid); + toplevel->unsetMaximized(); +} + +void MainWindow::toplevel_set_minimized() +{ + int row = tableWidget_2->currentRow(); + QString uuid = tableWidget_2->item(row, 0)->text(); + Toplevel *toplevel = context->findToplevel(uuid); + toplevel->setMinimized(); +} + +void MainWindow::toplevel_unset_minimized() +{ + int row = tableWidget_2->currentRow(); + QString uuid = tableWidget_2->item(row, 0)->text(); + Toplevel *toplevel = context->findToplevel(uuid); + toplevel->unsetMinimized(); +} + +void MainWindow::toplevel_set_fullscreen() +{ + int row = tableWidget_2->currentRow(); + QString output = tableWidget_2->item(row, 6)->text(); + QString uuid = tableWidget_2->item(row, 0)->text(); + Toplevel *toplevel = context->findToplevel(uuid); + toplevel->setFullscreen(output); +} + +void MainWindow::toplevel_unset_fullscreen() +{ + int row = tableWidget_2->currentRow(); + QString uuid = tableWidget_2->item(row, 0)->text(); + Toplevel *toplevel = context->findToplevel(uuid); + toplevel->unsetFullscreen(); +} + +void MainWindow::toplevel_set_activate() +{ + int row = tableWidget_2->currentRow(); + QString uuid = tableWidget_2->item(row, 0)->text(); + Toplevel *toplevel = context->findToplevel(uuid); + toplevel->setActivate(); +} + +void MainWindow::toplevel_close() +{ + int row = tableWidget_2->currentRow(); + QString uuid = tableWidget_2->item(row, 0)->text(); + Toplevel *toplevel = context->findToplevel(uuid); + toplevel->close(); +} + +void MainWindow::toplevel_enter_workspace() +{ + QAction *action = qobject_cast(sender()); + + int row = tableWidget_2->currentRow(); + QString uuid = tableWidget_2->item(row, 0)->text(); + Toplevel *toplevel = context->findToplevel(uuid); + + for (int i = 0; i < tableWidget_0->rowCount(); i++) { + if (tableWidget_0->item(i, 1)->text() == action->text()) { + QString workspace = tableWidget_0->item(i, 0)->text(); + toplevel->enterWorkspace(workspace); + } + } +} + +void MainWindow::toplevel_leave_workspace() +{ + QAction *action = qobject_cast(sender()); + + int row = tableWidget_2->currentRow(); + QString uuid = tableWidget_2->item(row, 0)->text(); + Toplevel *toplevel = context->findToplevel(uuid); + + for (int i = 0; i < tableWidget_0->rowCount(); i++) { + if (tableWidget_0->item(i, 1)->text() == action->text()) { + QString workspace = tableWidget_0->item(i, 0)->text(); + toplevel->leaveWorkspace(workspace); + } + } +} + +void MainWindow::toplevel_move_to_workspace() +{ + QAction *action = qobject_cast(sender()); + + int row = tableWidget_2->currentRow(); + QString uuid = tableWidget_2->item(row, 0)->text(); + Toplevel *toplevel = context->findToplevel(uuid); + + for (int i = 0; i < tableWidget_0->rowCount(); i++) { + if (tableWidget_0->item(i, 1)->text() == action->text()) { + QString workspace = tableWidget_0->item(i, 0)->text(); + toplevel->moveToWorkspace(workspace); + } + } +} + +void MainWindow::toplevel_send_to_output() +{ + QAction *action = qobject_cast(sender()); + + int row = tableWidget_2->currentRow(); + QString uuid = tableWidget_2->item(row, 0)->text(); + Toplevel *toplevel = context->findToplevel(uuid); + + for (int i = 0; i < tableWidget_1->rowCount(); i++) { + if (tableWidget_1->item(i, 1)->text() == action->text()) { + QString output = tableWidget_1->item(i, 0)->text(); + toplevel->moveToOutput(output); + } + } +} diff --git a/windowsview/ukui-window-switch-wlcom/workspace.cpp b/windowsview/ukui-window-switch-wlcom/workspace.cpp new file mode 100644 index 0000000000000000000000000000000000000000..36d3fd6b6fee635cf9b21ffebbc71735873ea953 --- /dev/null +++ b/windowsview/ukui-window-switch-wlcom/workspace.cpp @@ -0,0 +1,140 @@ +/* + * Copyright (C) 2024, KylinSoft Co., Ltd. + + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "context.h" +#include + +class Workspace::Private +{ + public: + Private(Workspace *workspace); + ~Private(); + void setup(kywc_workspace *workspace); + + QString uuid; + QString name; + uint32_t position; + bool activated; + + kywc_workspace *k_workspace; + + private: + Workspace *w_space; + static void stateHandle(kywc_workspace *workspace, uint32_t mask); + static void destroyHandle(kywc_workspace *workspace); + static struct kywc_workspace_interface workspace_impl; +}; + +Workspace::Private::Private(Workspace *workspace) : w_space(workspace) {} + +Workspace::Private::~Private() {} + +void Workspace::Private::stateHandle(kywc_workspace *workspace, uint32_t mask) +{ + Workspace *w = (Workspace *)kywc_workspace_get_user_data(workspace); + Workspace::Masks masks; + if (mask & KYWC_WORKSPACE_STATE_NAME) + masks |= Workspace::Mask::Name; + if (mask & KYWC_WORKSPACE_STATE_POSITION) + masks |= Workspace::Mask::Position; + if (mask & KYWC_WORKSPACE_STATE_ACTIVATED) + masks |= Workspace::Mask::Activated; + + w->pri->name = QString(workspace->name); + w->pri->position = workspace->position; + w->pri->activated = workspace->activated; + + emit w->stateUpdated(masks); +} + +void Workspace::Private::destroyHandle(kywc_workspace *workspace) +{ + Workspace *w = (Workspace *)kywc_workspace_get_user_data(workspace); + emit w->deleted(); +} + +struct kywc_workspace_interface Workspace::Private::workspace_impl = { + stateHandle, + destroyHandle, +}; + +void Workspace::Private::setup(kywc_workspace *workspace) +{ + uuid = workspace->uuid; + name = workspace->name; + position = workspace->position; + activated = workspace->activated; + k_workspace = workspace; + kywc_workspace_set_user_data(workspace, w_space); + kywc_workspace_set_interface(workspace, &workspace_impl); +} + +Workspace::Workspace(QObject *parent) : pri(new Private(this)) {} + +Workspace::~Workspace() { + if(pri) { + delete pri; + pri = nullptr; + } +} + +void Workspace::setup(kywc_workspace *workspace) +{ + pri->setup(workspace); +} + +QString Workspace::name() const +{ + return pri->name; +} + +QString Workspace::uuid() const +{ + return pri->uuid; +} + +int Workspace::position() const +{ + return pri->position; +} + +bool Workspace::isActivated() const +{ + return pri->activated; +} + +void Workspace::setActivate() +{ + kywc_workspace_activate(pri->k_workspace); +} + +void Workspace::move(int position) +{ + kywc_workspace_set_position(pri->k_workspace, position); +} + +void Workspace::remove() +{ + kywc_workspace_remove(pri->k_workspace); +} + +void Workspace::setName(const QString name) +{ + kywc_workspace_set_name(pri->k_workspace, name.toLocal8Bit().data()); +} diff --git a/windowsview/ukui-window-switch.desktop b/windowsview/ukui-window-switch.desktop new file mode 100755 index 0000000000000000000000000000000000000000..2dd9677330de44f0b8de2cc5121cb52fb3324c13 --- /dev/null +++ b/windowsview/ukui-window-switch.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Name=ukui-window-switch +Name[zh_CN]=多任务视图 +Exec=/usr/bin/ukui-window-switch +#Icon=ukui-window-switch +Terminal=false +Type=Application +NoDisplay=true +OnlyShowIn=UKUI +X-UKUI-Autostart-Delay=3 +X-UKUI-Autostart-Phase=Application +X-UKUI-Autostart-Notify=true +X-UKUI-AutoRestart=true diff --git a/windowsview/windowmanagerinterface.cpp b/windowsview/windowmanagerinterface.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9c4051eeef5e39d938ff30522120cb59df704b38 --- /dev/null +++ b/windowsview/windowmanagerinterface.cpp @@ -0,0 +1,543 @@ +/* + * Copyright (C) 2022, KylinSoft Co., Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "windowmanagerinterface.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#if 0 +#ifdef KWINEFFECT +#include "ukui-window-switch-kwineffect/multitaskviewmodelbycompositehandler.h" +#endif +#endif +#include "ukui-window-switch-wlcom/multitaskviewmodelbywlcomhandler.h" + +static constexpr int MAX_DESKTOP_COUNT = 15; +static const QString UKUI_STYLE_SCHEMA = "org.ukui.style"; +static const QString UKUI_STYLE_SCHEMA_STYLENAME = "styleName"; +static const QString UKUI_STYLE_SCHEMA_FONTSIZE = "systemFontSize"; +static const QString UKUI_STYLE_SCHEMA_FONT = "systemFont"; +static const QString UKUI_STYLE_SCHEMA_WIDGETNAME = "widgetThemeName"; +const QString IGNORE_WINDOW_CONFIG = "/usr/share/ukui/ukui-panel/panel-commission.ini"; +static const QString DESKTOP_NAME = "desktop-name"; +const QString DESKTOP_CONFIG_DIR = QDir::homePath() + QStringLiteral("/.config/org.ukui/ukui-window-switch/"); +const QString DESKTOP_CONFIG = DESKTOP_CONFIG_DIR + QStringLiteral("multitaskview.conf"); +const QString UKUI_FRAMEWORK_SERVICE = "org.ukui.Framework"; +const QString UKUI_FRAMEWORK_MOUSE_PATH = "/org/ukui/Framework/Devices/Mouse"; +const QString UKUI_FRAMEWORK_MOUSE_INTERFACE = "org.ukui.Framework.Devices.Mouse"; +const QString UKUI_FRAMEWORK_TOUCHPAD_PATH = "/org/ukui/Framework/Devices/Touchpad"; +const QString UKUI_FRAMEWORK_TOUCHPAD_INTERFACE = "org.ukui.Framework.Devices.Touchpad"; + +WindowManagerInterface *WindowManagerInterface::getInstance() +{ + static WindowManagerInterface s_interface; + return &s_interface; +} + +WindowManagerInterface::WindowManagerInterface(QObject *parent) : QObject(parent) +{ +#if 0 + //kwineffect相关接口无法在非effect插件的环境下编译通过,需要通过预编译来进行判断 +#ifdef KWINEFFECT + m_modelhandler = new MultitaskViewModelByCompositeHandler(this); +#else + m_modelhandler = new MultitaskViewModelByWlcomHandler(this); +#endif +#endif + m_modelhandler = new MultitaskViewModelByWlcomHandler(this); + + m_screenManager = new ScreensManager(this); + + initTouchState(); + connectSignals(); + if (QGSettings::isSchemaInstalled(UKUI_STYLE_SCHEMA.toUtf8())) { + m_settings = new QGSettings(UKUI_STYLE_SCHEMA.toUtf8()); + } + + updateScreenRectList(); + QList screenList = m_screenManager->screens(); + for (const auto &screen : screenList) { + connect(screen, &Screen::geometryChanged, this, &WindowManagerInterface::onScreenSizeChanged); + } +} + +WindowManagerInterface::~WindowManagerInterface() +{ + if (m_modelhandler != nullptr) { + delete m_modelhandler; + m_modelhandler = nullptr; + } +} + +bool WindowManagerInterface::currentDesktopHasWindow() const +{ + for (int screenIndex = 0; screenIndex < logicalScreenCount(); screenIndex++) { + if (m_modelhandler->createWindowList(getCurrentDesktop(), screenIndex).size() > 0) { + return true; + } + } + return false; +} + +void WindowManagerInterface::setDesktopName(const int desktopIndex, const QString name) +{ + if (!validateDesktopIndex(desktopIndex)) { + return; + } + m_modelhandler->setDesktopName(desktopIndex, name); +} + +QString WindowManagerInterface::getDesktopUuid(int desktopIndex) +{ + if (!validateDesktopIndex(desktopIndex)) { + return QString(); + } + return m_modelhandler->getDesktopUuid(desktopIndex); +} + +QString WindowManagerInterface::getOutputUuid(int outputIndex) +{ + return m_modelhandler->getOutputUuid(outputIndex); +} + + +void WindowManagerInterface::removeAppWindow(QString windowId) +{ + m_modelhandler->removeAppWindow(windowId); +} + +void WindowManagerInterface::removeAllAppWindowOnDesktop(int desktopIndex, int screenIndex) +{ + QList windowList; + windowList = m_modelhandler->createWindowList(desktopIndex, screenIndex); + for (Window &window : windowList) { + m_modelhandler->removeAppWindow(window.uuid()); + } +} + +int WindowManagerInterface::getNumberOfDesktops() const +{ + return m_modelhandler->getNumberOfDesktops(); +} + +void WindowManagerInterface::moveAppWindowToDesktop(QString windowId, int srcDesktopInex, int destDesktopInex) const +{ + m_modelhandler->moveAppWindowToDesktop(windowId, srcDesktopInex, destDesktopInex); +} + +void WindowManagerInterface::activateAppWindow(QString windowId) +{ + m_modelhandler->activateAppWindow(windowId); +} + +QVariant WindowManagerInterface::getWindowIcon(QString windowId) +{ + return m_modelhandler->getWindowIcon(windowId); +} + +void WindowManagerInterface::removeDesktop(int desktopIndex) +{ + if (m_modelhandler->getNumberOfDesktops() <= 1) { + return; + } + if (!validateDesktopIndex(desktopIndex)) { + return; + } + m_modelhandler->removeDesktop(desktopIndex); +} + +void WindowManagerInterface::appendDesktop() +{ + if (m_modelhandler->getNumberOfDesktops() >= MAX_DESKTOP_COUNT) { + return; + } + m_modelhandler->appendDesktop(); +} + +void WindowManagerInterface::moveDesktop(int srcDesktopIndex, int destDesktopIndex) +{ + if (srcDesktopIndex == destDesktopIndex) { + return; + } + m_modelhandler->moveDesktop(srcDesktopIndex, destDesktopIndex); +} + +QList WindowManagerInterface::createWindowList(int desktopIndex, int screenIndex) +{ + return m_modelhandler->createWindowList(desktopIndex, screenIndex); +} + +int WindowManagerInterface::getCurrentDesktop() const +{ + return m_modelhandler->getCurrentDesktop(); +} + +bool WindowManagerInterface::isCurrentDesktopShowingDesktop() const +{ + return m_modelhandler->isCurrentDesktopShowingDesktop(); +} + +void WindowManagerInterface::setCurrentDesktop(int desktopIndex) +{ + if (!validateDesktopIndex(desktopIndex)) { + return; + } + m_modelhandler->setCurrentDesktop(desktopIndex); +} + +QRect WindowManagerInterface::getFullScreenGeometry(int desktopIndex, int screenIndex) const +{ + return m_modelhandler->getFullScreenGeometry(desktopIndex, screenIndex); +} + +bool WindowManagerInterface::hasModalChildWindow(QString windowId) +{ + return m_modelhandler->hasModalChildWindow(windowId); +} + + +QString WindowManagerInterface::getUKUIStyleName() const +{ + // default to ukui-default + QString styleName = "ukui-default"; + if (m_settings && m_settings->keys().contains(UKUI_STYLE_SCHEMA_STYLENAME)) { + styleName = m_settings->get(UKUI_STYLE_SCHEMA_STYLENAME).toString(); + } else { + qWarning() << QString("未查询到Gesetting的键值(%1)").arg(UKUI_STYLE_SCHEMA_STYLENAME); + } + return styleName; +} + +double WindowManagerInterface::getUKUIFontSize() const +{ + // default to 11 + double fontSize = 11; + if (m_settings && m_settings->keys().contains(UKUI_STYLE_SCHEMA_FONTSIZE)) { + fontSize = m_settings->get(UKUI_STYLE_SCHEMA_FONTSIZE).toDouble(); + } else { + qWarning() << QString("未查询到Gesetting的键值(%1)").arg(UKUI_STYLE_SCHEMA_FONTSIZE); + } + return fontSize; +} + +QString WindowManagerInterface::getUKUIFont() const +{ + // default to 11 + QString font = "Noto Sans CJK SC"; + if (m_settings && m_settings->keys().contains(UKUI_STYLE_SCHEMA_FONT)) { + font = m_settings->get(UKUI_STYLE_SCHEMA_FONT).toString(); + } else { + qWarning() << QString("未查询到Gesetting的键值(%1)").arg(UKUI_STYLE_SCHEMA_FONT); + } + return font; +} + +void WindowManagerInterface::setIsOpenGLBackend(bool isOpenGLBackend) +{ + m_isOpenGLBackend = isOpenGLBackend; +} + +int WindowManagerInterface::getRadius(QString type) const +{ + return m_isOpenGLBackend ? getUKUIRadius(type) : 0; +} + +int WindowManagerInterface::getUKUIRadius(QString type) const +{ + // default to 8 + QString widgetName = "default"; + if (m_settings && m_settings->keys().contains(UKUI_STYLE_SCHEMA_WIDGETNAME)) { + widgetName = m_settings->get(UKUI_STYLE_SCHEMA_WIDGETNAME).toString(); + } else { + qWarning() << QString("未查询到Gesetting的键值(%1)").arg(UKUI_STYLE_SCHEMA_WIDGETNAME); + return 8; + } + + QFile file(QString("/usr/share/qt5-ukui-platformtheme/themeconfig/%1.json").arg(widgetName)); + if (!file.open(QIODevice::ReadOnly)) { + qWarning() << "无法打开JSON文件"; + return 8; + } + + QByteArray jsonData = file.readAll(); + file.close(); + + // 将JSON数据转换为QJsonDocument对象 + QJsonParseError error; + QJsonDocument jsonDoc = QJsonDocument::fromJson(jsonData, &error); + if (error.error != QJsonParseError::NoError) { + qWarning() << "JSON格式错误:" << error.errorString(); + return 8; + } + + // 获取属性 + QJsonObject rootObj = jsonDoc.object(); + QJsonObject radiusObj = rootObj["Radius"].toObject(); + QJsonObject radiusValueObj = radiusObj[type].toObject(); + + return radiusValueObj["value"].toString().toInt(); +} + +bool WindowManagerInterface::isExtensionMode() +{ + return m_modelhandler->isExtensionMode(); +} + +int WindowManagerInterface::logicalScreenCount() const +{ + return m_modelhandler->logicalScreenCount(); +} + +bool WindowManagerInterface::isTabletMode() const +{ + // default to PC mode. + bool tabletMode = false; + QDBusMessage message = QDBusMessage::createMethodCall("com.kylin.statusmanager.interface", + "/", + "com.kylin.statusmanager.interface", + "get_current_tabletmode"); + QDBusMessage response = QDBusConnection::sessionBus().call(message); + if (response.type() == QDBusMessage::ReplyMessage) { + tabletMode = response.arguments().takeFirst().toBool(); + } else { + qDebug() << "get tablet mode failed " << response.type(); + } + return tabletMode; +} + +bool WindowManagerInterface::isTouchState() const +{ + return m_isTouchState; +} + +QStringList WindowManagerInterface::getDesktopNames() const +{ + QSettings desktopSettings(DESKTOP_CONFIG, QSettings::IniFormat); + desktopSettings.setIniCodec("utf-8"); + QStringList nameList = desktopSettings.value("desktops/name").toStringList(); + return nameList; +} + +void WindowManagerInterface::saveDesktopNames(const QStringList &nameList) +{ + QDir configDir; + if (!configDir.exists(DESKTOP_CONFIG_DIR)) { + configDir.mkdir(DESKTOP_CONFIG_DIR); + } + + QSettings desktopSettings(DESKTOP_CONFIG, QSettings::IniFormat); + desktopSettings.setIniCodec("utf-8"); + desktopSettings.beginGroup("desktops"); + desktopSettings.setValue("name", QVariant(nameList)); + desktopSettings.endGroup(); + //qDebug() << "[MultitaskViewModel] save custom desktop names" << desktopSettings.value("desktops/name").toStringList(); +} + +QList WindowManagerInterface::screenRectList() +{ + return m_screenRectList; +} + +void WindowManagerInterface::updateScreenRectList() +{ + m_screenRectList = QList(); + QList screenList = m_screenManager->screens(); + for (int index = 0; index < screenList.size(); ++index) { + m_screenRectList.append(screenList[index]->geometry()); + } + emit screenRectListChanged(); +} + +QString WindowManagerInterface::getCurrentLanguage() const +{ + // default to "Chinese". + QLocale locale = QLocale::system(); + QString language = "Chinese"; + if (locale.language() == QLocale::Chinese) { + language = "Chinese"; + } else if (locale.language() == QLocale::Tibetan) { + language = "Tibetan"; + } + return language; +} + +bool WindowManagerInterface::validateDesktopIndex(int desktopIndex) const +{ + return desktopIndex >= 1 && desktopIndex <= m_modelhandler->getNumberOfDesktops(); +} + +bool WindowManagerInterface::validateScreenIndex(int screenIndex) const +{ + return screenIndex >= 0 || screenIndex < logicalScreenCount(); +} + +void WindowManagerInterface::connectSignals() +{ + QObject::connect(m_modelhandler, &MultitaskViewAbstractModelHandler::currentDesktopChanged, + this, &WindowManagerInterface::currentDesktopChanged, Qt::QueuedConnection); + QObject::connect(m_modelhandler, &MultitaskViewAbstractModelHandler::desktopNumberChanged, + this, &WindowManagerInterface::desktopNumberChanged, Qt::QueuedConnection); + QObject::connect(m_modelhandler, &MultitaskViewAbstractModelHandler::desktopRemoved, + this, &WindowManagerInterface::desktopRemoved, Qt::QueuedConnection); + QObject::connect(m_modelhandler, &MultitaskViewAbstractModelHandler::desktopAppended, + this, &WindowManagerInterface::desktopAppended, Qt::QueuedConnection); + QObject::connect(m_modelhandler, &MultitaskViewAbstractModelHandler::desktopMoved, + this, &WindowManagerInterface::desktopMoved, Qt::QueuedConnection); + + QObject::connect(m_modelhandler, &MultitaskViewAbstractModelHandler::appWindowCreated, + this, &WindowManagerInterface::appWindowCreated, Qt::QueuedConnection); + QObject::connect(m_modelhandler, &MultitaskViewAbstractModelHandler::appWindowAdd, + this, &WindowManagerInterface::appWindowAdd, Qt::QueuedConnection); + QObject::connect(m_modelhandler, &MultitaskViewAbstractModelHandler::appWindowRemoved, + this, &WindowManagerInterface::appWindowRemoved, Qt::QueuedConnection); + QObject::connect(m_modelhandler, &MultitaskViewAbstractModelHandler::appWindowActivated, + this, &WindowManagerInterface::appWindowActivated, Qt::QueuedConnection); + QObject::connect(m_modelhandler, &MultitaskViewAbstractModelHandler::appWindowUpdated, + this, &WindowManagerInterface::appWindowUpdated, Qt::QueuedConnection); + QObject::connect(m_modelhandler, &MultitaskViewAbstractModelHandler::appWindowDesktopChanged, + this, &WindowManagerInterface::appWindowDesktopChanged, Qt::QueuedConnection); + + QObject::connect(m_modelhandler, &MultitaskViewAbstractModelHandler::screenSizeChanged, + this, &WindowManagerInterface::onScreenSizeChanged, Qt::QueuedConnection); + connect(m_screenManager, &ScreensManager::screenAdded, this, &WindowManagerInterface::onScreenAdd); + connect(m_screenManager, &ScreensManager::screenRemoved, this, &WindowManagerInterface::onScreenRemove); + + QDBusConnection::sessionBus().connect(UKUI_FRAMEWORK_SERVICE, + UKUI_FRAMEWORK_MOUSE_PATH, + UKUI_FRAMEWORK_MOUSE_INTERFACE, + "MouseCountChanged", + this, + SLOT(onMouseCountChanged(const int))); + QDBusConnection::sessionBus().connect(UKUI_FRAMEWORK_SERVICE, + UKUI_FRAMEWORK_TOUCHPAD_PATH, + UKUI_FRAMEWORK_TOUCHPAD_INTERFACE, + "TouchpadChanged", + this, + SLOT(onTouchpadCountChanged(const int))); + QDBusConnection::sessionBus().connect("com.kylin.statusmanager.interface", + "/", + "com.kylin.statusmanager.interface", + "mode_change_signal", + this, + SIGNAL(tabletModeChanged(bool))); +} + +void WindowManagerInterface::onMouseCountChanged(const int count) +{ + m_flagNeedGetMouse = false; + if (count == -1) { + // 接口返回 -1 代表获取设备数量失败 + qDebug() << UKUI_FRAMEWORK_SERVICE << "mouse count reply -1, keep default"; + return; + } + m_mouseAvailable = count > 0 ? true : false; + updateTouchState(); +} + +void WindowManagerInterface::onTouchpadCountChanged(const int count) +{ + m_flagNeedGetTouchpad = false; + if (count == -1) { + // 接口返回 -1 代表获取设备数量失败 + qDebug() << UKUI_FRAMEWORK_SERVICE << "touchpad count reply -1, keep default"; + return; + } + m_touchpadAvailable = count > 0 ? true : false; + updateTouchState(); +} + +void WindowManagerInterface::initTouchState() +{ + asyncGetGenericPointerCount(UKUI_FRAMEWORK_SERVICE, + UKUI_FRAMEWORK_MOUSE_PATH, + UKUI_FRAMEWORK_MOUSE_INTERFACE, + "GetMouseCount"); + asyncGetGenericPointerCount(UKUI_FRAMEWORK_SERVICE, + UKUI_FRAMEWORK_TOUCHPAD_PATH, + UKUI_FRAMEWORK_TOUCHPAD_INTERFACE, + "GetTouchpadCount"); +} + +void WindowManagerInterface::updateTouchState() +{ + bool currentState = !(m_mouseAvailable || m_touchpadAvailable); + if (m_isTouchState == currentState) { + return; + } + m_isTouchState = currentState; + emit touchStateChanged(m_isTouchState); +} + +void WindowManagerInterface::asyncGetGenericPointerCount(const QString &destination, const QString &path, + const QString &interface, const QString &method) +{ + QDBusMessage message = QDBusMessage::createMethodCall(destination, path, interface, method); + QDBusPendingCall pendingCall = QDBusConnection::sessionBus().asyncCall(message); + QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingCall); + QObject::connect(watcher, &QDBusPendingCallWatcher::finished, this, [method, this](QDBusPendingCallWatcher *w) { + QDBusPendingReply reply = *w; + w->deleteLater(); + if (!reply.isValid()) { + qDebug() << "Error:" << reply.error().message(); + return; + } + + if (method.contains("Mouse") && this->m_flagNeedGetMouse) { + this->onMouseCountChanged(reply.value()); + } else if (method.contains("Touchpad") && this->m_flagNeedGetTouchpad) { + this->onTouchpadCountChanged(reply.value()); + } + }); +} + +void WindowManagerInterface::onScreenSizeChanged() +{ + emit screenSizeChanged(); + updateScreenRectList(); +} + +// 屏幕增加时,先更新屏幕列表,再发送信号screenCountChanged;屏幕移除时,反之 +// 否则qml读取screenRect时会报错,如:MultitaskView.qml:84: TypeError: Cannot read property 'height' of undefined +void WindowManagerInterface::onScreenAdd(Screen *screen) +{ + if (screen != nullptr) { + connect(screen, &Screen::geometryChanged, this, &WindowManagerInterface::onScreenSizeChanged); + } + updateScreenRectList(); + emit screenCountChanged(); +} + +void WindowManagerInterface::onScreenRemove() +{ + emit screenCountChanged(); + updateScreenRectList(); +} diff --git a/windowsview/windowmanagerinterface.h b/windowsview/windowmanagerinterface.h new file mode 100644 index 0000000000000000000000000000000000000000..11793fe44c44e6f7487d28e414e9be9f13f2b636 --- /dev/null +++ b/windowsview/windowmanagerinterface.h @@ -0,0 +1,152 @@ +/* + * Copyright (C) 2022, KylinSoft Co., Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef WINDOWMANAGERINTERFACE_H +#define WINDOWMANAGERINTERFACE_H + +#include +#include +#include +#include +#include +#include +#include +#include "multitaskviewabstractmodelhandler.h" +#include "screens-manager.h" + +class QGSettings; +class Window; + +class WindowManagerInterface : public QObject +{ + Q_OBJECT + Q_PROPERTY(int logicalScreenCount READ logicalScreenCount NOTIFY screenCountChanged) + Q_PROPERTY(int highlightDesktop READ getCurrentDesktop WRITE setCurrentDesktop NOTIFY currentDesktopChanged) + Q_PROPERTY(bool isTabletMode READ isTabletMode NOTIFY tabletModeChanged) + Q_PROPERTY(bool isTouchState READ isTouchState NOTIFY touchStateChanged) + Q_PROPERTY(QList screenRectList READ screenRectList NOTIFY screenRectListChanged) + +public: + static WindowManagerInterface *getInstance(); + ~WindowManagerInterface(); + + Q_INVOKABLE QString getCurrentLanguage() const; + Q_INVOKABLE QString getUKUIStyleName() const; + Q_INVOKABLE double getUKUIFontSize() const; + Q_INVOKABLE QString getUKUIFont() const; + Q_INVOKABLE int getRadius(QString type) const; + void setIsOpenGLBackend(bool isOpenGLBackend); + + Q_INVOKABLE QRect getFullScreenGeometry(int desktopIndex, int screenIndex) const; + + // window + Q_INVOKABLE void removeAppWindow(QString windowId); + Q_INVOKABLE void moveAppWindowToDesktop(QString windowId, int srcDesktopInex, int destDesktopInex) const; + Q_INVOKABLE void activateAppWindow(QString windowId); + Q_INVOKABLE QVariant getWindowIcon(QString windowId); + Q_INVOKABLE bool hasModalChildWindow(QString windowId); + + // desktop + Q_INVOKABLE void removeDesktop(int desktopIndex); + Q_INVOKABLE void moveDesktop(int srcDesktopIndex, int destDesktopIndex); + Q_INVOKABLE void appendDesktop(); + Q_INVOKABLE void setCurrentDesktop(int desktopIndex); + Q_INVOKABLE QList createWindowList(int desktopIndex, int screenIndex); + Q_INVOKABLE QString getDesktopUuid(int desktopIndex); + Q_INVOKABLE QString getOutputUuid(int outputIndex); + Q_INVOKABLE void removeAllAppWindowOnDesktop(int desktopIndex, int screenIndex); + Q_INVOKABLE bool isCurrentDesktopShowingDesktop() const; + Q_INVOKABLE bool currentDesktopHasWindow() const; + void setDesktopName(const int desktopIndex, const QString name); + + int getNumberOfDesktops() const; + int getCurrentDesktop() const; + + int logicalScreenCount() const; + bool isTabletMode() const; + bool isTouchState() const; + + QStringList getDesktopNames() const; + void saveDesktopNames(const QStringList &nameList); + + QList screenRectList(); + void updateScreenRectList(); + +signals: + void appWindowCreated(); + void appWindowAdd(const Window &window); + void appWindowRemoved(QString windowId); + void appWindowUpdated(const Window &window); + void appWindowActivated(); + void appWindowDesktopChanged(QString windowId, int oldDesktopIndex,int newDesktopIndex); + void desktopRemoved(int desktopIndex); + void desktopAppended(int desktopIndex); + void desktopMoved(int oldDesktopIndex, int newDesktopIndex); + void desktopNumberChanged(); + void currentDesktopChanged(int oldCurrentDesktopIndex, int newCurrentDesktopIndex); + void screenCountChanged(); + void screenSizeChanged(); + void tabletModeChanged(bool); + void touchStateChanged(bool); + void screenRectListChanged(); + void logicalScreenCountChanged(); + +private slots: + void onMouseCountChanged(const int count); + void onTouchpadCountChanged(const int count); + void onScreenSizeChanged(); + void onScreenAdd(Screen *screen); + void onScreenRemove(); + +private: + explicit WindowManagerInterface(QObject *parent = nullptr); + bool isExtensionMode(); + bool validateDesktopIndex(int desktopIndex) const; + bool validateScreenIndex(int screenIndex) const; + void connectSignals(); + int getUKUIRadius(QString type) const; + + /** + * @brief "TouchState"是否处于无鼠标触摸屏场景 + */ + void initTouchState(); + void updateTouchState(); + + /** + * @brief 异步获取指针类设备数量 + * @param 获取某类设备的dbus方法名称 + * @param callback + */ + void asyncGetGenericPointerCount(const QString &destination, const QString &path, + const QString &interface, const QString &method); + +private: + QGSettings* m_settings = nullptr; + bool m_isOpenGLBackend = true; + MultitaskViewAbstractModelHandler *m_modelhandler = nullptr; + bool m_isTouchState = false; + bool m_mouseAvailable = true; + bool m_touchpadAvailable = true; + bool m_flagNeedGetMouse = true; + bool m_flagNeedGetTouchpad = true; + ScreensManager *m_screenManager = nullptr; + QList m_screenRectList; +}; + +#endif // WINDOWMANAGERINTERFACE_H diff --git a/windowsview/windowthumbnail.cpp b/windowsview/windowthumbnail.cpp deleted file mode 100644 index a460df75502ae4263df337b678c11eecff5a1d81..0000000000000000000000000000000000000000 --- a/windowsview/windowthumbnail.cpp +++ /dev/null @@ -1,1016 +0,0 @@ -/* - * Copyright 2013 by Martin Gräßlin - - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as - * published by the Free Software Foundation; either version 2, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -#include "windowthumbnail.h" -// KF5 -#include -// Qt -#include -#include -#include -#include -#include -#include -// X11 -#if HAVE_XCB_COMPOSITE -#include -#include -#if HAVE_GLX -#include -typedef void (*glXBindTexImageEXT_func)(Display *dpy, GLXDrawable drawable, - int buffer, const int *attrib_list); -typedef void (*glXReleaseTexImageEXT_func)(Display *dpy, GLXDrawable drawable, int buffer); -#endif -#if HAVE_EGL -typedef EGLImageKHR(*eglCreateImageKHR_func)(EGLDisplay, EGLContext, EGLenum, EGLClientBuffer, const EGLint *); -typedef EGLBoolean(*eglDestroyImageKHR_func)(EGLDisplay, EGLImageKHR); -typedef GLvoid(*glEGLImageTargetTexture2DOES_func)(GLenum, GLeglImageOES); -#endif // HAVE_EGL -#include -#endif - -#include - -namespace Plasma -{ - -#if HAVE_XCB_COMPOSITE -#if HAVE_GLX -class DiscardGlxPixmapRunnable : public QRunnable { -public: - DiscardGlxPixmapRunnable( - uint, - QFunctionPointer, - xcb_pixmap_t - ); - void run() override; -private: - uint m_texture; - QFunctionPointer m_releaseTexImage; - xcb_pixmap_t m_glxPixmap; -}; - -DiscardGlxPixmapRunnable::DiscardGlxPixmapRunnable(uint texture, QFunctionPointer deleteFunction, xcb_pixmap_t pixmap) - : QRunnable(), - m_texture(texture), - m_releaseTexImage(deleteFunction), - m_glxPixmap(pixmap) -{} - -void DiscardGlxPixmapRunnable::run() -{ - if (m_glxPixmap != XCB_PIXMAP_NONE) { - Display *d = QX11Info::display(); - ((glXReleaseTexImageEXT_func)(m_releaseTexImage))(d, m_glxPixmap, GLX_FRONT_LEFT_EXT); - glXDestroyPixmap(d, m_glxPixmap); - glDeleteTextures(1, &m_texture); - } -} -#endif //HAVE_GLX - -#if HAVE_EGL -class DiscardEglPixmapRunnable : public QRunnable { -public: - DiscardEglPixmapRunnable( - uint, - QFunctionPointer, - EGLImageKHR - ); - void run() override; -private: - uint m_texture; - QFunctionPointer m_eglDestroyImageKHR; - EGLImageKHR m_image; -}; - -DiscardEglPixmapRunnable::DiscardEglPixmapRunnable(uint texture, QFunctionPointer deleteFunction, EGLImageKHR image) - : QRunnable(), - m_texture(texture), - m_eglDestroyImageKHR(deleteFunction), - m_image(image) -{} - -void DiscardEglPixmapRunnable::run() -{ - if (m_image != EGL_NO_IMAGE_KHR) { - ((eglDestroyImageKHR_func)(m_eglDestroyImageKHR))(eglGetCurrentDisplay(), m_image); - glDeleteTextures(1, &m_texture); - } -} -#endif//HAVE_EGL -#endif //HAVE_XCB_COMPOSITE - -WindowTextureNode::WindowTextureNode() - : QSGSimpleTextureNode() -{ -} - -WindowTextureNode::~WindowTextureNode() -{ -} - -void WindowTextureNode::reset(QSGTexture *texture) -{ - setTexture(texture); - m_texture.reset(texture); -} - -WindowThumbnail::WindowThumbnail(QQuickItem *parent) - : QQuickItem(parent) - , QAbstractNativeEventFilter() - , m_xcb(false) - , m_composite(false) - , m_winId(0) - , m_paintedSize(QSizeF()) - , m_thumbnailAvailable(false) - , m_redirecting(false) - , m_damaged(false) - , m_depth(0) -#if HAVE_XCB_COMPOSITE - , m_openGLFunctionsResolved(false) - , m_damageEventBase(0) - , m_damage(XCB_NONE) - , m_pixmap(XCB_PIXMAP_NONE) - , m_texture(0) -#if HAVE_GLX - , m_glxPixmap(XCB_PIXMAP_NONE) - , m_bindTexImage(nullptr) - , m_releaseTexImage(nullptr) -#endif // HAVE_GLX -#if HAVE_EGL - , m_eglFunctionsResolved(false) - , m_image(EGL_NO_IMAGE_KHR) - , m_eglCreateImageKHR(nullptr) - , m_eglDestroyImageKHR(nullptr) - , m_glEGLImageTargetTexture2DOES(nullptr) -#endif // HAVE_EGL -#endif -{ - setFlag(ItemHasContents); - - if (QGuiApplication *gui = dynamic_cast(QCoreApplication::instance())) { - m_xcb = (gui->platformName() == QLatin1String("xcb")); - if (m_xcb) { - gui->installNativeEventFilter(this); -#if HAVE_XCB_COMPOSITE - xcb_connection_t *c = QX11Info::connection(); - xcb_prefetch_extension_data(c, &xcb_composite_id); - const auto *compositeReply = xcb_get_extension_data(c, &xcb_composite_id); - m_composite = (compositeReply && compositeReply->present); - - xcb_prefetch_extension_data(c, &xcb_damage_id); - const auto *reply = xcb_get_extension_data(c, &xcb_damage_id); - m_damageEventBase = reply->first_event; - if (reply->present) { - xcb_damage_query_version_unchecked(c, XCB_DAMAGE_MAJOR_VERSION, XCB_DAMAGE_MINOR_VERSION); - } -#endif - } - } -} - -WindowThumbnail::~WindowThumbnail() -{ - if (m_xcb) { - QCoreApplication::instance()->removeNativeEventFilter(this); - stopRedirecting(); - } -} - -void WindowThumbnail::itemChange(ItemChange change, const ItemChangeData &data) -{ - switch (change) { - case ItemSceneChange: - if (m_scene) { - disconnect(m_scene.data(), &QWindow::visibleChanged, this, &WindowThumbnail::sceneVisibilityChanged); - } - m_scene = data.window; - if (m_scene) { - connect(m_scene.data(), &QWindow::visibleChanged, this, &WindowThumbnail::sceneVisibilityChanged); - // restart the redirection, it might not have been active yet - stopRedirecting(); - if (startRedirecting()) { - update(); - } - } - break; - - case ItemEnabledHasChanged: - Q_FALLTHROUGH(); - case ItemVisibleHasChanged: - if (data.boolValue) { - if (startRedirecting()) { - update(); - } - } else { - stopRedirecting(); - releaseResources(); - } - break; - - default: - break; - } -} - -void WindowThumbnail::releaseResources() -{ -#if HAVE_XCB_COMPOSITE - -#if HAVE_GLX && HAVE_EGL - //only one (or none) should be set, but never both - Q_ASSERT(m_glxPixmap == XCB_PIXMAP_NONE || m_image == EGL_NO_IMAGE_KHR); -#endif -#if HAVE_GLX || HAVE_EGL - QQuickWindow::RenderStage m_renderStage = QQuickWindow::BeforeSynchronizingStage; -#endif - - //data is deleted in the render thread (with relevant GLX calls) - //note runnable may be called *after* this is deleted - //but the pointer is held by the WindowThumbnail which is in the main thread -#if HAVE_GLX - if (m_glxPixmap != XCB_PIXMAP_NONE) { - window()->scheduleRenderJob(new DiscardGlxPixmapRunnable(m_texture, - m_releaseTexImage, - m_glxPixmap), - m_renderStage); - - m_glxPixmap = XCB_PIXMAP_NONE; - m_texture = 0; - } -#endif -#if HAVE_EGL - if (m_image != EGL_NO_IMAGE_KHR) { - window()->scheduleRenderJob(new DiscardEglPixmapRunnable(m_texture, - m_eglDestroyImageKHR, - m_image), - m_renderStage); - - m_image = EGL_NO_IMAGE_KHR; - m_texture = 0; - } -#endif -#endif -} - - - -uint32_t WindowThumbnail::winId() const -{ - return m_winId; -} - -void WindowThumbnail::setWinId(uint32_t winId) -{ - if (m_winId == winId) { - return; - } - if (!KWindowSystem::self()->hasWId(winId)) { - // invalid Id, don't updated - return; - } - if (window() && winId == window()->winId()) { - // don't redirect to yourself - return; - } - stopRedirecting(); - m_winId = winId; - - if (isEnabled() && isVisible()) { - startRedirecting(); - } - - emit winIdChanged(); -} - -qreal WindowThumbnail::paintedWidth() const -{ - return m_paintedSize.width(); -} - -qreal WindowThumbnail::paintedHeight() const -{ - return m_paintedSize.height(); -} - -bool WindowThumbnail::thumbnailAvailable() const -{ - return m_thumbnailAvailable; -} - - -QSGNode *WindowThumbnail::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *updatePaintNodeData) -{ -// QSGSimpleRectNode *n = static_cast(oldNode); -// if (!n) { -// int num = rand() % 6; -// n = new QSGSimpleRectNode; -// if(num == 0) n->setColor(Qt::red); -// else if(num == 1) n->setColor(Qt::green); -// else if(num == 2) n->setColor(Qt::blue); -// else if(num == 3) n->setColor(Qt::gray); -// else if(num == 4) n->setColor(Qt::white); -// else if(num == 5) n->setColor(Qt::yellow); - -// } -// n->setRect(boundingRect()); -// return n; - - - Q_UNUSED(updatePaintNodeData) - auto *node = static_cast(oldNode); - if (!node) { - node = new WindowTextureNode(); - node->setFiltering(QSGTexture::Linear); - } - if (!m_xcb || m_winId == 0 || (window() && window()->winId() == m_winId)) { - iconToTexture(node); - } else { - windowToTexture(node); - } - node->setRect(boundingRect()); - const QSizeF size(node->texture()->textureSize().scaled(boundingRect().size().toSize(), Qt::KeepAspectRatio)); - if (size != m_paintedSize) { - m_paintedSize = size; - emit paintedSizeChanged(); - } - const qreal x = boundingRect().x() + (boundingRect().width() - size.width()) / 2; - const qreal y = boundingRect().y() + (boundingRect().height() - size.height()) / 2; - node->setRect(QRectF(QPointF(x, y), size)); - return node; -} - -bool WindowThumbnail::nativeEventFilter(const QByteArray &eventType, void *message, long int *result) -{ - Q_UNUSED(result) - if (!m_xcb || !m_composite || eventType != QByteArrayLiteral("xcb_generic_event_t")) { - // currently we are only interested in XCB events - return false; - } -#if HAVE_XCB_COMPOSITE - xcb_generic_event_t *event = static_cast(message); - const uint8_t responseType = event->response_type & ~0x80; - if (responseType == m_damageEventBase + XCB_DAMAGE_NOTIFY) { - if (reinterpret_cast(event)->drawable == m_winId) { - m_damaged = true; - update(); - } - } else if (responseType == XCB_CONFIGURE_NOTIFY) { - if (reinterpret_cast(event)->window == m_winId) { - releaseResources(); - m_damaged = true; - update(); - } - } else if (responseType == XCB_MAP_NOTIFY) { - if (reinterpret_cast(event)->window == m_winId) { - releaseResources(); - m_damaged = true; - update(); - } - } -#else - Q_UNUSED(message) -#endif - // do not filter out any events, there might be further WindowThumbnails for the same window - return false; -} - -void WindowThumbnail::iconToTexture(WindowTextureNode *textureNode) -{ - QIcon icon; - if (KWindowSystem::self()->hasWId(m_winId)) { - icon = KWindowSystem::self()->icon(m_winId, boundingRect().width(), boundingRect().height()); - } else { - // fallback to plasma icon - icon = QIcon::fromTheme(QStringLiteral("plasma")); - } - QImage image = icon.pixmap(window(), boundingRect().size().toSize()).toImage(); - textureNode->reset(window()->createTextureFromImage(image, QQuickWindow::TextureCanUseAtlas)); -} - -#if HAVE_XCB_COMPOSITE -#if HAVE_GLX -bool WindowThumbnail::windowToTextureGLX(WindowTextureNode *textureNode) -{ - if (glXGetCurrentContext()) { - if (!m_openGLFunctionsResolved) { - resolveGLXFunctions(); - } - if (!m_bindTexImage || !m_releaseTexImage) { - return false; - } - if (m_glxPixmap == XCB_PIXMAP_NONE) { - xcb_connection_t *c = QX11Info::connection(); - auto attrCookie = xcb_get_window_attributes_unchecked(c, m_winId); - auto geometryCookie = xcb_get_geometry_unchecked(c, m_pixmap); - QScopedPointer attr(xcb_get_window_attributes_reply(c, attrCookie, nullptr)); - QScopedPointer geo(xcb_get_geometry_reply(c, geometryCookie, nullptr)); - - if (attr.isNull()) { - return false; - } - - if (geo.isNull()) { - return false; - } - - m_depth = geo->depth; - m_visualid = attr->visual; - - if (!loadGLXTexture()) { - return false; - } - - textureNode->reset(window()->createTextureFromId(m_texture, QSize(geo->width, geo->height), QQuickWindow::TextureCanUseAtlas)); - } - textureNode->texture()->bind(); - bindGLXTexture(); - return true; - } - return false; -} -#endif // HAVE_GLX - -#if HAVE_EGL -bool WindowThumbnail::xcbWindowToTextureEGL(WindowTextureNode *textureNode) -{ - EGLContext context = eglGetCurrentContext(); - - if (context != EGL_NO_CONTEXT) { - if (!m_eglFunctionsResolved) { - resolveEGLFunctions(); - } - if (QByteArray((char *)glGetString(GL_RENDERER)).contains("llvmpipe")) { - return false; - } - if (!m_eglCreateImageKHR || !m_eglDestroyImageKHR || !m_glEGLImageTargetTexture2DOES) { - return false; - } - if (m_image == EGL_NO_IMAGE_KHR) { - xcb_connection_t *c = QX11Info::connection(); - auto geometryCookie = xcb_get_geometry_unchecked(c, m_pixmap); - - const EGLint attribs[] = { - EGL_IMAGE_PRESERVED_KHR, EGL_TRUE, - EGL_NONE - }; - m_image = ((eglCreateImageKHR_func)(m_eglCreateImageKHR))(eglGetCurrentDisplay(), EGL_NO_CONTEXT, - EGL_NATIVE_PIXMAP_KHR, - (EGLClientBuffer)m_pixmap, attribs); - - if (m_image == EGL_NO_IMAGE_KHR) { - // qDebug() << "failed to create egl image"; - return false; - } - - glGenTextures(1, &m_texture); - QScopedPointer geo(xcb_get_geometry_reply(c, geometryCookie, nullptr)); - QSize size(100, 100); - if (!geo.isNull()) { - size.setWidth(geo->width); - size.setHeight(geo->height); - } - textureNode->reset(window()->createTextureFromId(m_texture, size, QQuickWindow::TextureCanUseAtlas)); - } - textureNode->texture()->bind(); - bindEGLTexture(); - return true; - } - return false; -} - -void WindowThumbnail::resolveEGLFunctions() -{ - EGLDisplay display = eglGetCurrentDisplay(); - if (display == EGL_NO_DISPLAY) { - return; - } - auto *context = window()->openglContext(); - QList extensions = QByteArray(eglQueryString(display, EGL_EXTENSIONS)).split(' '); - if (extensions.contains(QByteArrayLiteral("EGL_KHR_image")) || - (extensions.contains(QByteArrayLiteral("EGL_KHR_image_base")) && - extensions.contains(QByteArrayLiteral("EGL_KHR_image_pixmap")))) { - if (context->hasExtension(QByteArrayLiteral("GL_OES_EGL_image"))) { - // qDebug() << "Have EGL texture from pixmap"; - m_eglCreateImageKHR = context->getProcAddress(QByteArrayLiteral("eglCreateImageKHR")); - m_eglDestroyImageKHR = context->getProcAddress(QByteArrayLiteral("eglDestroyImageKHR")); - m_glEGLImageTargetTexture2DOES = context->getProcAddress(QByteArrayLiteral("glEGLImageTargetTexture2DOES")); - } - } - m_eglFunctionsResolved = true; -} - -void WindowThumbnail::bindEGLTexture() -{ - ((glEGLImageTargetTexture2DOES_func)(m_glEGLImageTargetTexture2DOES))(GL_TEXTURE_2D, (GLeglImageOES)m_image); - resetDamaged(); -} -#endif // HAVE_EGL - -QImage WindowThumbnail::convertToQImage(XImage* ximage) -{ - QImage::Format format = QImage::Format_ARGB32_Premultiplied; - if (ximage->depth == 24) - format = QImage::Format_RGB32; - else if (ximage->depth == 16) - format = QImage::Format_RGB16; - - QImage image = QImage(reinterpret_cast(ximage->data), - ximage->width, ximage->height, - ximage->bytes_per_line, format).copy(); - - // 大端还是小端? - if ((QSysInfo::ByteOrder == QSysInfo::LittleEndian && ximage->byte_order == MSBFirst) - || (QSysInfo::ByteOrder == QSysInfo::BigEndian && ximage->byte_order == LSBFirst)) { - - for (int i = 0; i < image.height(); i++) { - if (ximage->depth == 16) { - ushort* p = reinterpret_cast(image.scanLine(i)); - ushort* end = p + image.width(); - while (p < end) { - *p = ((*p << 8) & 0xff00) | ((*p >> 8) & 0x00ff); - p++; - } - } else { - uint* p = reinterpret_cast(image.scanLine(i)); - uint* end = p + image.width(); - while (p < end) { - *p = ((*p << 24) & 0xff000000) | ((*p << 8) & 0x00ff0000) - | ((*p >> 8) & 0x0000ff00) | ((*p >> 24) & 0x000000ff); - p++; - } - } - } - } - - // 修复alpha通道 - if (format == QImage::Format_RGB32) { - QRgb* p = reinterpret_cast(image.bits()); - for (int y = 0; y < ximage->height; ++y) { - for (int x = 0; x < ximage->width; ++x) - p[x] |= 0xff000000; - p += ximage->bytes_per_line / 4; - } - } - - return image; -} -bool WindowThumbnail::xlibWindowToTexture(WindowTextureNode *textureNode) -{ - XWindowAttributes attr; - Display *display = QX11Info::display(); - - XGetWindowAttributes(display, m_winId, &attr); - XImage *image = XGetImage(display, m_winId, 0, 0, attr.width, attr.height, 0xffffffff, ZPixmap); - - if (image) { - QImage thumbnail = convertToQImage(image); - XDestroyImage(image); - - textureNode->reset(window()->createTextureFromImage(thumbnail, QQuickWindow::TextureCanUseAtlas)); - return true; - } - - qDebug() << "[Warning]: No window thumbnails from X."; - return false; -} - -#endif // HAVE_XCB_COMPOSITE - -void WindowThumbnail::windowToTexture(WindowTextureNode *textureNode) -{ - if (!m_damaged && textureNode->texture()) { - return; - } -#if HAVE_XCB_COMPOSITE - if (!textureNode->texture()) { - // the texture got discarded by the scene graph, but our mapping is still valid - // let's discard the pixmap to have a clean state again - releaseResources(); - } - if (m_pixmap == XCB_PIXMAP_NONE) { - m_pixmap = pixmapForWindow(); - } - if (m_pixmap == XCB_PIXMAP_NONE) { - // create above failed - iconToTexture(textureNode); - setThumbnailAvailable(false); - return; - } - bool fallbackToIcon = true; -#if HAVE_GLX - fallbackToIcon = !windowToTextureGLX(textureNode); -#endif // HAVE_GLX -#if HAVE_EGL - if (fallbackToIcon) { - // if glx succeeded fallbackToIcon is false, thus we shouldn't try egl - fallbackToIcon = !xcbWindowToTextureEGL(textureNode); - } -#endif // HAVE_EGL - if (fallbackToIcon) { - // incase both GLX and EGL are unavailable. - fallbackToIcon = !xlibWindowToTexture(textureNode); - } - if (fallbackToIcon) { - // just for safety to not crash - iconToTexture(textureNode); - } - setThumbnailAvailable(!fallbackToIcon); - textureNode->markDirty(QSGNode::DirtyForceUpdate); -#else - iconToTexture(textureNode); -#endif -} - -#if HAVE_XCB_COMPOSITE -xcb_pixmap_t WindowThumbnail::pixmapForWindow() -{ - if (!m_composite) { - return XCB_PIXMAP_NONE; - } - - xcb_connection_t *c = QX11Info::connection(); - xcb_pixmap_t pix = xcb_generate_id(c); - auto cookie = xcb_composite_name_window_pixmap_checked(c, m_winId, pix); - QScopedPointer error(xcb_request_check(c, cookie)); - if (error) { - return XCB_PIXMAP_NONE; - } - return pix; -} - -#if HAVE_GLX -void WindowThumbnail::resolveGLXFunctions() -{ - auto *context = window()->openglContext(); - QList extensions = QByteArray(glXQueryExtensionsString(QX11Info::display(), QX11Info::appScreen())).split(' '); - if (extensions.contains(QByteArrayLiteral("GLX_EXT_texture_from_pixmap"))) { - m_bindTexImage = context->getProcAddress(QByteArrayLiteral("glXBindTexImageEXT")); - m_releaseTexImage = context->getProcAddress(QByteArrayLiteral("glXReleaseTexImageEXT")); - } else { - // qWarning() << "couldn't resolve GLX_EXT_texture_from_pixmap functions"; - } - m_openGLFunctionsResolved = true; -} - -void WindowThumbnail::bindGLXTexture() -{ - Display *d = QX11Info::display(); - ((glXReleaseTexImageEXT_func)(m_releaseTexImage))(d, m_glxPixmap, GLX_FRONT_LEFT_EXT); - ((glXBindTexImageEXT_func)(m_bindTexImage))(d, m_glxPixmap, GLX_FRONT_LEFT_EXT, nullptr); - resetDamaged(); -} - -struct FbConfigInfo -{ - GLXFBConfig fbConfig; - int textureFormat; -}; - -struct GlxGlobalData -{ - GlxGlobalData() { - xcb_connection_t * const conn = QX11Info::connection(); - - // Fetch the render pict formats - reply = xcb_render_query_pict_formats_reply(conn, - xcb_render_query_pict_formats_unchecked(conn), nullptr); - - // Init the visual ID -> format ID hash table - for (auto screens = xcb_render_query_pict_formats_screens_iterator(reply); screens.rem; xcb_render_pictscreen_next(&screens)) { - for (auto depths = xcb_render_pictscreen_depths_iterator(screens.data); depths.rem; xcb_render_pictdepth_next(&depths)) { - const xcb_render_pictvisual_t *visuals = xcb_render_pictdepth_visuals(depths.data); - const int len = xcb_render_pictdepth_visuals_length(depths.data); - - for (int i = 0; i < len; i++) - visualPictFormatHash.insert(visuals[i].visual, visuals[i].format); - } - } - - // Init the format ID -> xcb_render_directformat_t* hash table - const xcb_render_pictforminfo_t *formats = xcb_render_query_pict_formats_formats(reply); - const int len = xcb_render_query_pict_formats_formats_length(reply); - - for (int i = 0; i < len; i++) { - if (formats[i].type == XCB_RENDER_PICT_TYPE_DIRECT) - formatInfoHash.insert(formats[i].id, &formats[i].direct); - } - - // Init the visual ID -> depth hash table - const xcb_setup_t *setup = xcb_get_setup(conn); - - for (auto screen = xcb_setup_roots_iterator(setup); screen.rem; xcb_screen_next(&screen)) { - for (auto depth = xcb_screen_allowed_depths_iterator(screen.data); depth.rem; xcb_depth_next(&depth)) { - const int len = xcb_depth_visuals_length(depth.data); - const xcb_visualtype_t *visuals = xcb_depth_visuals(depth.data); - - for (int i = 0; i < len; i++) - visualDepthHash.insert(visuals[i].visual_id, depth.data->depth); - } - } - } - - ~GlxGlobalData() { - qDeleteAll(visualFbConfigHash); - std::free(reply); - } - - xcb_render_query_pict_formats_reply_t *reply; - QHash visualPictFormatHash; - QHash visualDepthHash; - QHash visualFbConfigHash; - QHash formatInfoHash; -}; - -Q_GLOBAL_STATIC(GlxGlobalData, g_glxGlobalData) - -static xcb_render_pictformat_t findPictFormat(xcb_visualid_t visual) -{ - GlxGlobalData *d = g_glxGlobalData; - return d->visualPictFormatHash.value(visual); -} - -static const xcb_render_directformat_t *findPictFormatInfo(xcb_render_pictformat_t format) -{ - GlxGlobalData *d = g_glxGlobalData; - return d->formatInfoHash.value(format); -} - -static int visualDepth(xcb_visualid_t visual) -{ - GlxGlobalData *d = g_glxGlobalData; - return d->visualDepthHash.value(visual); -} - -FbConfigInfo *getConfig(xcb_visualid_t visual) -{ - Display *dpy = QX11Info::display(); - const xcb_render_pictformat_t format = findPictFormat(visual); - const xcb_render_directformat_t *direct = findPictFormatInfo(format); - - if (!direct) { - return nullptr; - } - - const int red_bits = qPopulationCount(direct->red_mask); - const int green_bits = qPopulationCount(direct->green_mask); - const int blue_bits = qPopulationCount(direct->blue_mask); - const int alpha_bits = qPopulationCount(direct->alpha_mask); - - const int depth = visualDepth(visual); - - const auto rgb_sizes = std::tie(red_bits, green_bits, blue_bits); - - const int attribs[] = { - GLX_RENDER_TYPE, GLX_RGBA_BIT, - GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT | GLX_PIXMAP_BIT, - GLX_X_VISUAL_TYPE, GLX_TRUE_COLOR, - GLX_X_RENDERABLE, True, - GLX_CONFIG_CAVEAT, int(GLX_DONT_CARE), // The ARGB32 visual is marked non-conformant in Catalyst - GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT, int(GLX_DONT_CARE), - GLX_BUFFER_SIZE, red_bits + green_bits + blue_bits + alpha_bits, - GLX_RED_SIZE, red_bits, - GLX_GREEN_SIZE, green_bits, - GLX_BLUE_SIZE, blue_bits, - GLX_ALPHA_SIZE, alpha_bits, - GLX_STENCIL_SIZE, 0, - GLX_DEPTH_SIZE, 0, - 0 - }; - - int count = 0; - GLXFBConfig *configs = glXChooseFBConfig(dpy, QX11Info::appScreen(), attribs, &count); - if (count < 1) { - return nullptr; - } - - struct FBConfig { - GLXFBConfig config; - int depth; - int stencil; - int format; - }; - - QList candidates; - - for (int i = 0; i < count; i++) { - int red, green, blue; - glXGetFBConfigAttrib(dpy, configs[i], GLX_RED_SIZE, &red); - glXGetFBConfigAttrib(dpy, configs[i], GLX_GREEN_SIZE, &green); - glXGetFBConfigAttrib(dpy, configs[i], GLX_BLUE_SIZE, &blue); - - if (std::tie(red, green, blue) != rgb_sizes) - continue; - - xcb_visualid_t visual; - glXGetFBConfigAttrib(dpy, configs[i], GLX_VISUAL_ID, (int *) &visual); - - if (visualDepth(visual) != depth) - continue; - - int bind_rgb, bind_rgba; - glXGetFBConfigAttrib(dpy, configs[i], GLX_BIND_TO_TEXTURE_RGBA_EXT, &bind_rgba); - glXGetFBConfigAttrib(dpy, configs[i], GLX_BIND_TO_TEXTURE_RGB_EXT, &bind_rgb); - - if (!bind_rgb && !bind_rgba) - continue; - - int texture_targets; - glXGetFBConfigAttrib(dpy, configs[i], GLX_BIND_TO_TEXTURE_TARGETS_EXT, &texture_targets); - - if ((texture_targets & GLX_TEXTURE_2D_BIT_EXT) == 0) - continue; - - int depth, stencil; - glXGetFBConfigAttrib(dpy, configs[i], GLX_DEPTH_SIZE, &depth); - glXGetFBConfigAttrib(dpy, configs[i], GLX_STENCIL_SIZE, &stencil); - - int texture_format; - if (alpha_bits) - texture_format = bind_rgba ? GLX_TEXTURE_FORMAT_RGBA_EXT : GLX_TEXTURE_FORMAT_RGB_EXT; - else - texture_format = bind_rgb ? GLX_TEXTURE_FORMAT_RGB_EXT : GLX_TEXTURE_FORMAT_RGBA_EXT; - - candidates.append(FBConfig{configs[i], depth, stencil, texture_format}); - } - - if (count > 0) - XFree(configs); - - std::stable_sort(candidates.begin(), candidates.end(), [](const FBConfig &left, const FBConfig &right) { - if (left.depth < right.depth) - return true; - - if (left.stencil < right.stencil) - return true; - - return false; - }); - - FbConfigInfo *info = nullptr; - - if (!candidates.isEmpty()) { - const FBConfig &candidate = candidates.front(); - - info = new FbConfigInfo; - info->fbConfig = candidate.config; - info->textureFormat = candidate.format; - } - - - return info; -} - -bool WindowThumbnail::loadGLXTexture() -{ - GLXContext glxContext = glXGetCurrentContext(); - if (!glxContext) { - return false; - } - - FbConfigInfo *info = nullptr; - - auto &hashTable = g_glxGlobalData->visualFbConfigHash; - auto it = hashTable.constFind(m_visualid); - - if (it != hashTable.constEnd()) { - info = *it; - } else { - info = getConfig(m_visualid); - hashTable.insert(m_visualid, info); - } - - if (!info) { - return false; - } - - glGenTextures(1, &m_texture); - - const int attrs[] = { - GLX_TEXTURE_FORMAT_EXT, info->textureFormat, - GLX_MIPMAP_TEXTURE_EXT, false, - GLX_TEXTURE_TARGET_EXT, GLX_TEXTURE_2D_EXT, - XCB_NONE - }; - - m_glxPixmap = glXCreatePixmap(QX11Info::display(), info->fbConfig, m_pixmap, attrs); - - return true; -} -#endif - -#endif - -void WindowThumbnail::resetDamaged() -{ - m_damaged = false; -#if HAVE_XCB_COMPOSITE - if (m_damage == XCB_NONE) { - return; - } - xcb_damage_subtract(QX11Info::connection(), m_damage, XCB_NONE, XCB_NONE); -#endif -} - -void WindowThumbnail::stopRedirecting() -{ - if (!m_xcb || !m_composite) { - return; - } -#if HAVE_XCB_COMPOSITE - xcb_connection_t *c = QX11Info::connection(); - if (m_pixmap != XCB_PIXMAP_NONE) { - xcb_free_pixmap(c, m_pixmap); - m_pixmap = XCB_PIXMAP_NONE; - } - if (m_winId == XCB_WINDOW_NONE) { - return; - } - if (m_redirecting) { - xcb_composite_unredirect_window(c, m_winId, XCB_COMPOSITE_REDIRECT_AUTOMATIC); - } - m_redirecting = false; - if (m_damage == XCB_NONE) { - return; - } - xcb_damage_destroy(c, m_damage); - m_damage = XCB_NONE; -#endif -} - -bool WindowThumbnail::startRedirecting() -{ - if (!m_xcb || !m_composite || !window() || window()->winId() == m_winId) { - return false; - } -#if HAVE_XCB_COMPOSITE - if (m_winId == XCB_WINDOW_NONE) { - return false; - } - xcb_connection_t *c = QX11Info::connection(); - - // need to get the window attributes for the existing event mask - const auto attribsCookie = xcb_get_window_attributes_unchecked(c, m_winId); - - // redirect the window - xcb_composite_redirect_window(c, m_winId, XCB_COMPOSITE_REDIRECT_AUTOMATIC); - m_redirecting = true; - - // generate the damage handle - m_damage = xcb_generate_id(c); - xcb_damage_create(c, m_damage, m_winId, XCB_DAMAGE_REPORT_LEVEL_NON_EMPTY); - - QScopedPointer attr(xcb_get_window_attributes_reply(c, attribsCookie, nullptr)); - uint32_t events = XCB_EVENT_MASK_STRUCTURE_NOTIFY; - if (!attr.isNull()) { - events = events | attr->your_event_mask; - } - // the event mask will not be removed again. We cannot track whether another component also needs STRUCTURE_NOTIFY (e.g. KWindowSystem). - // if we would remove the event mask again, other areas will break. - xcb_change_window_attributes(c, m_winId, XCB_CW_EVENT_MASK, &events); - // force to update the texture - m_damaged = true; - return true; -#else - return false; -#endif -} - - - -void WindowThumbnail::setThumbnailAvailable(bool thumbnailAvailable) -{ - if (m_thumbnailAvailable != thumbnailAvailable) { - m_thumbnailAvailable = thumbnailAvailable; - emit thumbnailAvailableChanged(); - } -} - -void WindowThumbnail::sceneVisibilityChanged(bool visible) -{ - if (visible) { - if (startRedirecting()) { - update(); - } - } else { - stopRedirecting(); - releaseResources(); - } -} - -} // namespace diff --git a/windowsview/windowthumbnail.h b/windowsview/windowthumbnail.h deleted file mode 100644 index da3ebf4c8995564b1cafec83c6b1a62bc546a35b..0000000000000000000000000000000000000000 --- a/windowsview/windowthumbnail.h +++ /dev/null @@ -1,188 +0,0 @@ -/* - * Copyright 2013 by Martin Gräßlin - - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as - * published by the Free Software Foundation; either version 2, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -#ifndef PLASMA_WINDOWTHUMBNAIL_H -#define PLASMA_WINDOWTHUMBNAIL_H - -#define PLASMA_NO_KDEWEBKIT 0 -#define PLASMA_NO_KUTILS 0 -#define HAVE_X11 1 -#define HAVE_GLX 1 -#define HAVE_EGL 1 -#define HAVE_KWAYLAND 1 - -#define PLASMA_RELATIVE_DATA_INSTALL_DIR "plasma" - -#define HAVE_X11 1 -#define HAVE_XCB_COMPOSITE 1 - -#include - -// Qt -#include -#include -#include -#include -#include -// xcb -#if HAVE_XCB_COMPOSITE -#include -#include - -#if HAVE_EGL -#include -#include -#include // egl.h could include XLib.h - -#endif // HAVE_EGL - -#endif // HAVE_XCB_COMPOSITE -class KWindowInfo; - -namespace Plasma -{ - -class WindowTextureNode; - -/** - * @brief Renders a thumbnail for the window specified by the @c winId property. - * - * This declarative item is able to render a live updating thumbnail for the - * window specified by the given @c winId property. If it is not possible to get - * the thumbnail, the window's icon is rendered instead or in case that the window - * Id is invalid a generic fallback icon is used. - * - * The thumbnail does not necessarily fill out the complete geometry as the - * thumbnail gets scaled keeping the aspect ratio. This means the thumbnail gets - * rendered into the center of the item's geometry. - * - * Note: live updating thumbnails are only implemented on the X11 platform. On X11 - * a running compositor is not required as this item takes care of redirecting the - * window. For technical reasons the window's frame is not included on X11. - * - * If the window closes, the thumbnail does not get destroyed, which allows to have - * a window close animation. - * - * Example usage: - * @code - * WindowThumbnail { - * winId: 102760466 - * } - * @endcode - * - */ -class WindowThumbnail : public QQuickItem, public QAbstractNativeEventFilter -{ - Q_OBJECT - Q_PROPERTY(uint winId READ winId WRITE setWinId NOTIFY winIdChanged) - Q_PROPERTY(qreal paintedWidth READ paintedWidth NOTIFY paintedSizeChanged) - Q_PROPERTY(qreal paintedHeight READ paintedHeight NOTIFY paintedSizeChanged) - Q_PROPERTY(bool thumbnailAvailable READ thumbnailAvailable NOTIFY thumbnailAvailableChanged) - -public: - explicit WindowThumbnail(QQuickItem *parent = nullptr); - ~WindowThumbnail() override; - bool nativeEventFilter(const QByteArray &eventType, void *message, long int *result) override; - QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *updatePaintNodeData) override; - - uint32_t winId() const; - void setWinId(uint32_t winId); - - qreal paintedWidth() const; - qreal paintedHeight() const; - bool thumbnailAvailable() const; - -Q_SIGNALS: - void winIdChanged(); - void paintedSizeChanged(); - void thumbnailAvailableChanged(); - -protected: - void itemChange(ItemChange change, const ItemChangeData &data) override; - void releaseResources() override; - -private: - void iconToTexture(WindowTextureNode *textureNode); - void windowToTexture(WindowTextureNode *textureNode); - bool startRedirecting(); - void stopRedirecting(); - void resetDamaged(); - void setThumbnailAvailable(bool thumbnailAvailable); - void sceneVisibilityChanged(bool visible); - - bool m_xcb; - bool m_composite; - QPointer m_scene; - uint32_t m_winId; - QSizeF m_paintedSize; - bool m_thumbnailAvailable; - bool m_redirecting; - bool m_damaged; - int m_depth; -#if HAVE_XCB_COMPOSITE - xcb_pixmap_t pixmapForWindow(); - bool m_openGLFunctionsResolved; - uint8_t m_damageEventBase; - xcb_damage_damage_t m_damage; - xcb_pixmap_t m_pixmap; - -/*The following must *only* be used from the render thread*/ - uint m_texture; -#if HAVE_GLX - bool windowToTextureGLX(WindowTextureNode *textureNode); - void resolveGLXFunctions(); - bool loadGLXTexture(); - void bindGLXTexture(); - xcb_pixmap_t m_glxPixmap; - xcb_visualid_t m_visualid; - QFunctionPointer m_bindTexImage; - QFunctionPointer m_releaseTexImage; -#endif // HAVE_GLX -#if HAVE_EGL - bool xcbWindowToTextureEGL(WindowTextureNode *textureNode); - void resolveEGLFunctions(); - void bindEGLTexture(); - bool m_eglFunctionsResolved; - EGLImageKHR m_image; - QFunctionPointer m_eglCreateImageKHR; - QFunctionPointer m_eglDestroyImageKHR; - QFunctionPointer m_glEGLImageTargetTexture2DOES; -#endif // HAVE_EGL - // incase that both GLX and EGL are unavailable. - QImage convertToQImage(XImage* ximage); - bool xlibWindowToTexture(WindowTextureNode *textureNode); -#endif -}; - -/** - * @brief SimpleTextureNode which cleans up the texture - * - */ -class WindowTextureNode : public QSGSimpleTextureNode -{ -public: - WindowTextureNode(); - virtual ~WindowTextureNode(); - void reset(QSGTexture *texture); -private: - QScopedPointer m_texture; -}; - -} - -#endif // PLASMA_WINDOWTHUMBNAIL_H diff --git a/windowswitchers/thumbnail_grid/contents/ui/main.qml b/windowswitchers/thumbnail_grid/contents/ui/main.qml index ecb07b9da04cfd8cad62420327434c253df915fa..ed78815ada9e4b703dfd47d6d41de588ae008ef5 100644 --- a/windowswitchers/thumbnail_grid/contents/ui/main.qml +++ b/windowswitchers/thumbnail_grid/contents/ui/main.qml @@ -19,9 +19,10 @@ along with this program. If not, see . *********************************************************************/ import QtQuick 2.0 -import QtQuick.Layouts 1.1 +import QtQuick.Layouts 1.3 import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.components 3.0 as PlasmaComponents3 +import QtQuick.Controls 2.5 import org.kde.kquickcontrolsaddons 2.0 import org.kde.kwin 2.0 as KWin @@ -35,7 +36,10 @@ KWin.Switcher { id: dialog location: PlasmaCore.Types.Floating visible: tabBox.visible + // visualParent: tabBox + backgroundHints: PlasmaCore.Dialog.NoBackground + //opacity: 0.1 flags: Qt.X11BypassWindowManagerHint x: tabBox.screenGeometry.x + tabBox.screenGeometry.width * 0.5 - dialogMainItem.width * 0.5 y: tabBox.screenGeometry.y + tabBox.screenGeometry.height * 0.5 - dialogMainItem.height * 0.5 @@ -48,11 +52,14 @@ KWin.Switcher { } } + mainItem: Rectangle { - id: dialogMainItem + id: dialogMainItem focus: true - color: Qt.rgba(35/255, 36/255, 38/255, 0.45) + color: (tabBox.theme === "ukui-default" || tabBox.theme === "ukui-white" + || tabBox.theme === "ukui" || tabBox.theme === "ukui-light")? Qt.rgba(245/255, 245/255, 245/255, 0.45) : Qt.rgba(35/255, 36/255, 38/255, 0.45) + property int maxWidth: tabBox.screenGeometry.width property int maxHeight: tabBox.screenGeometry.height * 0.8 @@ -137,7 +144,7 @@ KWin.Switcher { anchors.rightMargin: count > dialogMainItem.maxGridColumnsByWidth ? (dialogMainItem.width-dialogMainItem.maxGridColumnsByWidth * cellWidth)/2 : (dialogMainItem.width-count * cellWidth)/2 - + LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLeft model: tabBox.model @@ -162,33 +169,43 @@ KWin.Switcher { dialogMainItem.calculateColumnCount(); highCount = count; } + if (count <= dialogMainItem.maxGridColumnsByWidth) { + + } + } delegate: Item { id: thumbnailGridItem width: thumbnailGridView.cellWidth height: thumbnailGridView.cellHeight + property bool isLayoutLeftToRight: Qt.application.layoutDirection === Qt.LeftToRight MouseArea { anchors.fill: parent + Accessible.role: Accessible.Button + Accessible.name: "active-window-" + model.caption + Accessible.description: "preview-window, click to active the app window" + onClicked: { thumbnailGridItem.select(); } hoverEnabled: true onEntered: { - thumbnailBackItem.border.width= 4; + thumbnailBackItem.border.width= 2 * units.devicePixelRatio; } - onExited: { + onExited: {(tabBox.theme === "ukui-default" || tabBox.theme === "ukui-white" + || tabBox.theme === "ukui" || tabBox.theme === "ukui-light") thumbnailBackItem.border.width= 0; - } } function select() { thumbnailGridView.currentIndex = index; thumbnailGridView.currentIndexChanged(thumbnailGridView.currentIndex); + tabBox.selectWindow(); } ColumnLayout { @@ -203,6 +220,7 @@ KWin.Switcher { RowLayout { id: captionRow spacing: 4 * units.devicePixelRatio + layoutDirection: isLayoutLeftToRight ? Qt.LeftToRight : Qt.RightToLeft QIconItem { id: iconItem @@ -214,23 +232,17 @@ KWin.Switcher { state: index == thumbnailGridView.currentIndex ? QIconItem.ActiveState : QIconItem.DefaultState } - PlasmaComponents3.Label { + Label { id: label Layout.fillWidth: true height: 20 - color: "#FFFFFF" + color: (tabBox.theme === "ukui-default" || tabBox.theme === "ukui-white" + || tabBox.theme === "ukui" || tabBox.theme === "ukui-light") ? "#000000" : "#FFFFFF" text: model.caption - elide: Text.ElideRight + horizontalAlignment: isLayoutLeftToRight ? Qt.AlignLeft : Qt.AlignRight + elide : isLayoutLeftToRight ? Text.ElideRight : Text.ElideLeft } - PlasmaComponents3.ToolButton { - id: closeButton - visible: false - icon.name: 'window-close-symbolic' - onClicked: { - tabBox.model.close(index); - } - } } // KWin.ThumbnailItem needs a container @@ -241,9 +253,10 @@ KWin.Switcher { Layout.fillHeight: true // color: Qt.rgba(255,255,255, 0.5) color: "transparent" - border.color: "#FFFFFF"; + border.color: (tabBox.theme === "ukui-default" || tabBox.theme === "ukui-white" + || tabBox.theme === "ukui" || tabBox.theme === "ukui-light") ? "#262626" : "#FFFFFF" border.width: 0; - radius: 8; + radius: tabBox.themeRadius * units.devicePixelRatio; // Cannot draw anything (like an icon) on top of thumbnail @@ -257,7 +270,6 @@ KWin.Switcher { wId: windowId clip: true - clipTo: parent } } } @@ -266,15 +278,16 @@ KWin.Switcher { highlight: Rectangle { id: highlightItem color: "transparent" - border.color: "#FFFFFF" - border.width:4; - radius: 8; + border.color: (tabBox.theme === "ukui-default" || tabBox.theme === "ukui-white" + || tabBox.theme === "ukui" || tabBox.theme === "ukui-light") ? "#262626" : "#FFFFFF" + border.width: 4 * units.devicePixelRatio; + radius: tabBox.themeRadius * units.devicePixelRatio; } Connections { target: tabBox - onCurrentIndexChanged: { + function onCurrentIndexChanged() { thumbnailGridView.currentIndex = tabBox.currentIndex; } }