forked from openkylin/ukui-panel
Compare commits
No commits in common. "upstream" and "openkylin/yangtze" have entirely different histories.
upstream
...
openkylin/
|
@ -0,0 +1,86 @@
|
|||
name: Check build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
|
||||
schedule:
|
||||
- cron: '0 0 * * *'
|
||||
|
||||
jobs:
|
||||
archlinux:
|
||||
name: on Archlinux
|
||||
runs-on: ubuntu-20.04
|
||||
container: docker.io/library/archlinux:latest
|
||||
steps:
|
||||
- name: Checkout ukui-panel source code
|
||||
uses: actions/checkout@v2
|
||||
- name: Refresh pacman repository and force upgrade
|
||||
run: pacman -Syyu --noconfirm
|
||||
- name: Install build dependencies
|
||||
run: pacman -S --noconfirm base-devel glibc qt5-base cmake qt5-tools dconf libdbusmenu-qt5 gsettings-qt kwindowsystem libqtxdg qt5-webkit peony
|
||||
- name: CMake configure & Make
|
||||
run: |
|
||||
mkdir build;
|
||||
cd build;
|
||||
cmake ..;
|
||||
make -j$(nproc);
|
||||
debian:
|
||||
name: on Debian Sid
|
||||
runs-on: ubuntu-20.04
|
||||
container: docker.io/library/debian:sid
|
||||
env:
|
||||
DEBIAN_FRONTEND: noninteractive
|
||||
steps:
|
||||
- name: Checkout ukui-panel source code
|
||||
uses: actions/checkout@v2
|
||||
- name: Update apt repository
|
||||
run: apt-get update -y
|
||||
- name: Install build dependcies
|
||||
run: apt-get install -y build-essential qt5-default qttools5-dev-tools debhelper-compat cmake libasound2-dev libdbusmenu-qt5-dev libglib2.0-dev libicu-dev libkf5solid-dev libkf5windowsystem-dev libpulse-dev libqt5svg5-dev libqt5x11extras5-dev libsensors4-dev libstatgrab-dev libsysstat-qt5-0-dev libx11-dev libxcb-damage0-dev libxcb-util0-dev libxcb-xkb-dev libxcomposite-dev libxdamage-dev libxkbcommon-dev libxkbcommon-x11-dev libxrender-dev libqt5webkit5-dev qttools5-dev libqt5xdg-dev libgsettings-qt-dev libpoppler-dev libpoppler-qt5-dev libpeony-dev libdconf-dev
|
||||
- name: CMake configure & Make
|
||||
run: |
|
||||
mkdir build;
|
||||
cd build;
|
||||
cmake ..;
|
||||
make -j$(nproc);
|
||||
|
||||
fedora:
|
||||
name: on Fedora 32
|
||||
runs-on: ubuntu-20.04
|
||||
container: docker.io/library/fedora:32
|
||||
steps:
|
||||
- name: Checkout ukui-panel source code
|
||||
uses: actions/checkout@v2
|
||||
- name: Install build dependencies
|
||||
run: dnf install -y make gcc gcc-c++ which cmake cmake-rpm-macros autoconf automake intltool rpm-build qt5-devel qt5-rpm-macros qt5-qtbase-devel qt5-qttools-devel glib2-devel qt5-qtbase-devel dbusmenu-qt5-devel gsettings-qt-devel kf5-kwindowsystem-devel poppler-qt5-devel qt5-qtx11extras-devel qt5-qtbase-private-devel libqtxdg-devel libXcomposite-devel libXdamage-devel libXrender-devel dconf-devel libxcb-devel xcb-util-devel xcb-util-cursor-devel xcb-util-keysyms-devel xcb-util-image-devel xcb-util-wm-devel xcb-util-renderutil-devel
|
||||
- name: CMake configure & Make
|
||||
run: |
|
||||
mkdir build;
|
||||
cd build;
|
||||
cmake ..;
|
||||
make -j$(nproc);
|
||||
ubuntu:
|
||||
name: on Ubuntu 20.04
|
||||
runs-on: ubuntu-20.04
|
||||
container: docker.io/library/ubuntu:focal
|
||||
env:
|
||||
DEBIAN_FRONTEND: noninteractive
|
||||
steps:
|
||||
- name: Checkout ukui-panel source code
|
||||
uses: actions/checkout@v2
|
||||
- name: Update apt repository
|
||||
run: apt-get update -y
|
||||
- name: Install build dependcies
|
||||
run: apt-get install -y build-essential qt5-default qttools5-dev-tools debhelper-compat cmake libasound2-dev libdbusmenu-qt5-dev libglib2.0-dev libicu-dev libkf5solid-dev libkf5windowsystem-dev libpulse-dev libqt5svg5-dev libqt5x11extras5-dev libsensors4-dev libstatgrab-dev libsysstat-qt5-0-dev libx11-dev libxcb-damage0-dev libxcb-util0-dev libxcb-xkb-dev libxcomposite-dev libxdamage-dev libxkbcommon-dev libxkbcommon-x11-dev libxrender-dev libqt5webkit5-dev qttools5-dev libqt5xdg-dev libgsettings-qt-dev libpoppler-dev libpoppler-qt5-dev libpeony-dev libdconf-dev
|
||||
- name: CMake configure & Make
|
||||
run: |
|
||||
mkdir build;
|
||||
cd build;
|
||||
cmake ..;
|
||||
make -j$(nproc);
|
|
@ -0,0 +1,12 @@
|
|||
Upstream Authors:
|
||||
LXQT team: https://lxqt.org
|
||||
Razor team: http://razor-qt.org
|
||||
kylin team: https://www.ukui.com
|
||||
|
||||
Copyright:
|
||||
Copyright (c) 2010-2012 Razor team
|
||||
Copyright (c) 2012-2017 iLXQT team
|
||||
Copyright (c) 2019 Tianjin KYLIN Information Technology Co., Ltd. *
|
||||
|
||||
License: LGPL-2.1+
|
||||
The full text of the licenses can be found in the 'COPYING' file.
|
176
CMakeLists.txt
176
CMakeLists.txt
|
@ -1,6 +1,176 @@
|
|||
cmake_minimum_required(VERSION 3.16)
|
||||
cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
|
||||
project(ukui-panel)
|
||||
|
||||
project(ukui-panel VERSION 4.1)
|
||||
option(WITH_SCREENSAVER_FALLBACK "Include support for converting the deprecated 'screensaver' plugin to 'quicklaunch'. This requires the ukui-leave (ukui-session) to be installed in runtime." OFF)
|
||||
|
||||
# additional cmake files
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
||||
|
||||
macro(setByDefault VAR_NAME VAR_VALUE)
|
||||
if(NOT DEFINED ${VAR_NAME})
|
||||
set (${VAR_NAME} ${VAR_VALUE})
|
||||
endif(NOT DEFINED ${VAR_NAME})
|
||||
endmacro()
|
||||
|
||||
include(GNUInstallDirs)
|
||||
|
||||
setByDefault(CUSTOM_QT_5_6_VERSION Yes)
|
||||
setByDefault(CUSTOM_QT_5_12_VERSION No)
|
||||
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
|
||||
set(KF5_MINIMUM_VERSION "5.18.0")
|
||||
set(QT_MINIMUM_VERSION "5.6.1")
|
||||
set(QTXDG_MINIMUM_VERSION "3.3.1")
|
||||
|
||||
find_package(KF5WindowSystem ${KF5_MINIMUM_VERSION} REQUIRED)
|
||||
find_package(Qt5 ${QT_MINIMUM_VERSION} CONFIG REQUIRED Widgets Core Quick QuickWidgets DBus X11Extras LinguistTools Xml)
|
||||
find_package(Qt5Xdg ${QTXDG_MINIMUM_VERSION} REQUIRED)
|
||||
find_package(X11 REQUIRED)
|
||||
|
||||
find_package(PkgConfig)
|
||||
pkg_check_modules(Gsetting REQUIRED gsettings-qt)
|
||||
include_directories(${Gsetting_INCLUDE_DIRS})
|
||||
set(LIBRARIES
|
||||
${Gsetting_LIBRARIES}
|
||||
-lukui-log4qt
|
||||
)
|
||||
|
||||
# Patch Version
|
||||
set(UKUI_VERSION 3.0)
|
||||
set(UKUI_PANEL_PATCH_VERSION 0)
|
||||
set(UKUI_MAJOR_VERSION 3)
|
||||
set(UKUI_MINOR_VERSION 0)
|
||||
|
||||
#set(UKUI_TRANSLATIONS_DIR "${CMAKE_INSTALL_FULL_DATAROOTDIR}/ukui/translations/")
|
||||
set(UKUI_PANEL_VERSION ${UKUI_MAJOR_VERSION}.${UKUI_MINOR_VERSION}.${UKUI_PANEL_PATCH_VERSION})
|
||||
add_definitions("-DUKUI_PANEL_VERSION=\"${UKUI_PANEL_VERSION}\"")
|
||||
|
||||
include(./cmake/ukui-build-tools/modules/UKUiPreventInSourceBuilds.cmake)
|
||||
#include(./cmake/ukui-build-tools/modules/UKUiTranslate.cmake)
|
||||
|
||||
# All UKUiCompilerSettings except CMAKE_MODULE_LINKER_FLAGS work just fine
|
||||
# So we reset only these Flags after loading UKUiCompilerSettings
|
||||
# ukui-build-tools:
|
||||
# set(CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined ${SYMBOLIC_FLAGS} ${CMAKE_MODULE_LINKER_FLAGS}")
|
||||
message(STATUS "==OLD== CMAKE_MODULE_LINKER_FLAGS: ${CMAKE_MODULE_LINKER_FLAGS}")
|
||||
set( OLD_CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS}")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "${OLD_CMAKE_MODULE_LINKER_FLAGS} ${SYMBOLIC_FLAGS}")
|
||||
|
||||
# Warning: This must be before add_subdirectory(panel). Move with caution.
|
||||
set(PLUGIN_DIR "${CMAKE_INSTALL_FULL_LIBDIR}/ukui-panel")
|
||||
add_definitions(
|
||||
-DPLUGIN_DIR=\"${PLUGIN_DIR}\"
|
||||
)
|
||||
#Add PACKAGE_DATA_DIR
|
||||
set(PACKAGE_DATA_DIR "/usr/share/ukui-panel")
|
||||
add_definitions(
|
||||
-DPACKAGE_DATA_DIR=\"${PACKAGE_DATA_DIR}\"
|
||||
-DQT_MESSAGELOGCONTEXT
|
||||
)
|
||||
|
||||
message(STATUS "CMAKE Module linker flags: ${CMAKE_MODULE_LINKER_FLAGS}")
|
||||
message(STATUS "Panel plugins location: ${PLUGIN_DIR}")
|
||||
|
||||
#########################################################################
|
||||
# Plugin system
|
||||
# You can enable/disable building of the plugin using cmake options.
|
||||
# cmake -DWORLDCLOCK_PLUGIN=Yes .. # Enable worldclock plugin
|
||||
# cmake -DWORLDCLOCK_PLUGIN=No .. # Disable worldclock plugin
|
||||
|
||||
include("cmake/BuildPlugin.cmake")
|
||||
include(./cmake/ukui-build-tools/modules/UKUiTranslateDesktop.cmake)
|
||||
include(./cmake/ukui-build-tools/modules/UKUiTranslationLoader.cmake)
|
||||
set(ENABLED_PLUGINS) # list of enabled plugins
|
||||
set(STATIC_PLUGINS) # list of statically linked plugins
|
||||
|
||||
setByDefault(QUICKLAUNCH_PLUGIN No)
|
||||
if(QUICKLAUNCH_PLUGIN)
|
||||
list(APPEND STATIC_PLUGINS "quicklaunch")
|
||||
add_definitions(-DWITH_QUICKLAUNCH_PLUGIN)
|
||||
list(APPEND ENABLED_PLUGINS "Quicklaunch")
|
||||
add_subdirectory(plugin-quicklaunch)
|
||||
endif()
|
||||
|
||||
|
||||
setByDefault(SHOWDESKTOP_PLUGIN Yes)
|
||||
if(SHOWDESKTOP_PLUGIN)
|
||||
list(APPEND ENABLED_PLUGINS "Show Desktop")
|
||||
add_subdirectory(plugin-showdesktop)
|
||||
endif()
|
||||
|
||||
|
||||
setByDefault(TASKBAR_PLUGIN Yes)
|
||||
if(TASKBAR_PLUGIN)
|
||||
list(APPEND ENABLED_PLUGINS "taskbar")
|
||||
add_subdirectory(plugin-taskbar)
|
||||
endif()
|
||||
|
||||
add_subdirectory(panel-daemon)
|
||||
add_subdirectory(sni-daemon)
|
||||
add_subdirectory(sni-xembed-proxy)
|
||||
add_subdirectory(plugin-ukcc)
|
||||
|
||||
setByDefault(STATUSNOTIFIER_PLUGIN Yes)
|
||||
if(STATUSNOTIFIER_PLUGIN)
|
||||
list(APPEND ENABLED_PLUGINS "statusnotifier")
|
||||
add_subdirectory(plugin-statusnotifier)
|
||||
endif()
|
||||
|
||||
setByDefault(SPACER_PLUGIN Yes)
|
||||
if(SPACER_PLUGIN)
|
||||
list(APPEND STATIC_PLUGINS "spacer")
|
||||
add_definitions(-DWITH_SPACER_PLUGIN)
|
||||
list(APPEND ENABLED_PLUGINS "Spacer")
|
||||
add_subdirectory(plugin-spacer)
|
||||
endif()
|
||||
|
||||
setByDefault(CALENDAR_PLUGIN Yes)
|
||||
if(CALENDAR_PLUGIN)
|
||||
list(APPEND ENABLED_PLUGINS "calendar")
|
||||
add_subdirectory(plugin-calendar)
|
||||
endif(CALENDAR_PLUGIN)
|
||||
|
||||
setByDefault(STARTBAR_PLUGIN Yes)
|
||||
if(STARTBAR_PLUGIN)
|
||||
list(APPEND ENABLED_PLUGINS "startbar")
|
||||
add_subdirectory(plugin-startbar)
|
||||
endif(STARTBAR_PLUGIN)
|
||||
|
||||
#########################################################################
|
||||
|
||||
message(STATUS "**************** The following plugins will be built ****************")
|
||||
foreach (PLUGIN_STR ${ENABLED_PLUGINS})
|
||||
message(STATUS " ${PLUGIN_STR}")
|
||||
endforeach()
|
||||
message(STATUS "*********************************************************************")
|
||||
|
||||
add_subdirectory(panel)
|
||||
add_subdirectory(widgets)
|
||||
|
||||
file(GLOB_RECURSE QRC_SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.qrc)
|
||||
|
||||
## translation
|
||||
#set(UKUI_TRANSLATIONS_DIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/ukui/)
|
||||
#add_definitions(
|
||||
# -DUKUI_TRANSLATIONS_DIR="${UKUI_TRANSLATIONS_DIR}"
|
||||
#)
|
||||
#if (NOT DEFINED UPDATE_TRANSLATIONS)
|
||||
# set(UPDATE_TRANSLATIONS "No")
|
||||
#endif()
|
||||
|
||||
## To create a new ts file: lupdate -recursive . -target-language zh_CN -ts panel/resources/ukui-panel_zh_CN.ts
|
||||
#file(GLOB TS_FILES "${CMAKE_CURRENT_SOURCE_DIR}/panel/resources/*.ts")
|
||||
|
||||
## cmake -DUPDATE_TRANSLATIONS=yes
|
||||
#if (UPDATE_TRANSLATIONS)
|
||||
# qt5_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES})
|
||||
#else()
|
||||
# qt5_add_translation(QM_FILES ${TS_FILES})
|
||||
#endif()
|
||||
#add_custom_target(translations ALL DEPENDS ${QM_FILES})
|
||||
#install(FILES ${QM_FILES} DESTINATION ${UKUI_TRANSLATIONS_DIR})
|
||||
|
||||
|
|
|
@ -0,0 +1,458 @@
|
|||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
674
LICENSE
674
LICENSE
|
@ -1,674 +0,0 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
7
NEWS
7
NEWS
|
@ -1,3 +1,6 @@
|
|||
### ukui-panel 4.10.1.0
|
||||
### ukui-panel 2.0.0
|
||||
* fork from lxqt-panel
|
||||
|
||||
* A new start.
|
||||
### ukui-panel 1.0.0
|
||||
|
||||
* Initial release.
|
||||
|
|
49
README.md
49
README.md
|
@ -1,28 +1,39 @@
|
|||
# ukui-panel
|
||||
ukui-panel represents the taskbar of UKUI
|
||||
|
||||
## 这是什么?
|
||||
> Panel(面板)
|
||||
## Table of Contents
|
||||
|
||||
## 项目结构
|
||||
|
||||
* **panel**
|
||||
* 应用程序入口
|
||||
* 外部接口
|
||||
* 视图,小组件显示
|
||||
* 布局管理
|
||||
* [About Project](#About-Project)
|
||||
* [Getting Started](#Getting-Started)
|
||||
* [Document Introduction](#Document-Introduction)
|
||||
|
||||
|
||||
* **framework**
|
||||
* 小组件接口
|
||||
* 小组件视图
|
||||
* 小组件加载,卸载工具
|
||||
* 图形组件
|
||||
* 菜单,弹窗,ToolTip
|
||||
## About Project
|
||||
|
||||
ukui-panel contains the following plugins:
|
||||
* startbar
|
||||
* taskbar
|
||||
* statusnotifier
|
||||
* calendar
|
||||
* showdesktop ...
|
||||
|
||||
* TODO List
|
||||
* 翻译加载
|
||||
## Getting Started
|
||||
|
||||
```bash
|
||||
# Install ukui-panel
|
||||
apt install ukui-panel
|
||||
|
||||
* **widgets**
|
||||
* 内部小组件
|
||||
# build from source and test
|
||||
mkdir build & cd build
|
||||
cmake ..
|
||||
make
|
||||
sudo make install
|
||||
./panel/ukui-panel
|
||||
```
|
||||
|
||||
## Document Introduction
|
||||
|
||||
ukui-panel has plugins configuration file in ~/.config/ukui/panel.conf
|
||||
it decide the count and order of the ukui-panel's plugins
|
||||
|
||||
For more details, please see ukui panel.md
|
||||
|
|
|
@ -0,0 +1,95 @@
|
|||
# - Try to find the UDev library
|
||||
# Once done this will define
|
||||
#
|
||||
# UDEV_FOUND - system has UDev
|
||||
# UDEV_INCLUDE_DIR - the libudev include directory
|
||||
# UDEV_LIBS - The libudev libraries
|
||||
|
||||
# Copyright (c) 2010, Rafael Fernández López, <ereslibre@kde.org>
|
||||
# Copyright (c) 2016, Luís Pereira, <luis.artur.pereira@gmail.com>
|
||||
# Copyright (c) 2019 Tianjin KYLIN Information Technology Co., Ltd. *
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the University 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 REGENTS 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 REGENTS 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.
|
||||
|
||||
|
||||
MACRO (BUILD_UKUI_PLUGIN NAME)
|
||||
set(PROGRAM "ukui-panel")
|
||||
project(${PROGRAM}_${NAME})
|
||||
|
||||
set(PROG_SHARE_DIR ${CMAKE_INSTALL_FULL_DATAROOTDIR}/ukui/${PROGRAM})
|
||||
set(PLUGIN_SHARE_DIR ${PROG_SHARE_DIR}/${NAME})
|
||||
|
||||
# Translations **********************************
|
||||
# ukui_translate_ts(${PROJECT_NAME}_QM_FILES
|
||||
# UPDATE_TRANSLATIONS ${UPDATE_TRANSLATIONS}
|
||||
# SOURCES
|
||||
# ${HEADERS}
|
||||
# ${SOURCES}
|
||||
# ${MOCS}
|
||||
# ${UIS}
|
||||
# TEMPLATE
|
||||
# ${NAME}
|
||||
# INSTALL_DIR
|
||||
# ${UKUI_TRANSLATIONS_DIR}/${PROGRAM}/${NAME}
|
||||
# )
|
||||
|
||||
file (GLOB ${PROJECT_NAME}_DESKTOP_FILES_IN resources/*.desktop.in)
|
||||
ukui_translate_desktop(DESKTOP_FILES
|
||||
SOURCES
|
||||
${${PROJECT_NAME}_DESKTOP_FILES_IN}
|
||||
)
|
||||
|
||||
#************************************************
|
||||
|
||||
file (GLOB CONFIG_FILES resources/*.conf)
|
||||
|
||||
if (NOT DEFINED PLUGIN_DIR)
|
||||
set (PLUGIN_DIR ${CMAKE_INSTALL_FULL_LIBDIR}/${PROGRAM})
|
||||
endif (NOT DEFINED PLUGIN_DIR)
|
||||
|
||||
set(QTX_LIBRARIES Qt5::Widgets)
|
||||
if(QT_USE_QTXML)
|
||||
set(QTX_LIBRARIES ${QTX_LIBRARIES} Qt5::Xml)
|
||||
endif()
|
||||
if(QT_USE_QTDBUS)
|
||||
set(QTX_LIBRARIES ${QTX_LIBRARIES} Qt5::DBus)
|
||||
endif()
|
||||
|
||||
list(FIND STATIC_PLUGINS ${NAME} IS_STATIC)
|
||||
set(SRC ${HEADERS} ${SOURCES} ${QM_LOADER} ${MOC_SOURCES} ${${NAME}_QM_FILES} ${RESOURCES} ${UIS} ${DESKTOP_FILES})
|
||||
if (${IS_STATIC} EQUAL -1) # not static
|
||||
add_library(${NAME} MODULE ${SRC}) # build dynamically loadable modules
|
||||
install(TARGETS ${NAME} DESTINATION ${PLUGIN_DIR}) # install the *.so file
|
||||
else() # static
|
||||
add_library(${NAME} STATIC ${SRC}) # build statically linked lib
|
||||
endif()
|
||||
#target_link_libraries(${NAME} ${QTX_LIBRARIES} ${LIBRARIES} KF5::WindowSystem)
|
||||
target_link_libraries(${NAME} ${QTX_LIBRARIES} ${LIBRARIES} KF5::WindowSystem)
|
||||
install(FILES ${CONFIG_FILES} DESTINATION ${PLUGIN_SHARE_DIR})
|
||||
install(FILES ${DESKTOP_FILES} DESTINATION ${PROG_SHARE_DIR})
|
||||
|
||||
|
||||
|
||||
ENDMACRO(BUILD_UKUI_PLUGIN)
|
|
@ -0,0 +1,101 @@
|
|||
macro(ukui_plugin_translate_ts PLUGIN)
|
||||
set(TS_FILES ${CMAKE_CURRENT_SOURCE_DIR}/translation/${PLUGIN}_zh_CN.ts)
|
||||
set(BO_TS_FILES ${CMAKE_CURRENT_SOURCE_DIR}/translation/${PLUGIN}_bo_CN.ts)
|
||||
set(B_QM_FILES ${CMAKE_CURRENT_BINARY_DIR}/translation/)
|
||||
|
||||
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/translation/)
|
||||
else()
|
||||
execute_process(
|
||||
COMMAND mkdir ${CMAKE_CURRENT_SOURCE_DIR}/translation/
|
||||
)
|
||||
endif()
|
||||
|
||||
if(EXISTS ${TS_FILES})
|
||||
message(STATUS "${TS_FILES} is EXISTS")
|
||||
execute_process(
|
||||
COMMAND lupdate -recursive ${CMAKE_CURRENT_SOURCE_DIR} -target-language zh_CN -ts ${TS_FILES}
|
||||
)
|
||||
execute_process(
|
||||
COMMAND lrelease ${TS_FILES}
|
||||
)
|
||||
else()
|
||||
execute_process(
|
||||
COMMAND lupdate -recursive ${CMAKE_CURRENT_SOURCE_DIR} -target-language zh_CN -ts ${TS_FILES}
|
||||
)
|
||||
execute_process(
|
||||
COMMAND lrelease ${TS_FILES}
|
||||
)
|
||||
endif()
|
||||
|
||||
if(EXISTS ${BO_TS_FILES})
|
||||
message(STATUS "${BO_TS_FILES} is EXISTS")
|
||||
execute_process(
|
||||
COMMAND lupdate -recursive ${CMAKE_CURRENT_SOURCE_DIR} -target-language bo_CN -ts ${BO_TS_FILES}
|
||||
)
|
||||
execute_process(
|
||||
COMMAND lrelease ${BO_TS_FILES}
|
||||
)
|
||||
else()
|
||||
execute_process(
|
||||
COMMAND lupdate -recursive ${CMAKE_CURRENT_SOURCE_DIR} -target-language bo_CN -ts ${BO_TS_FILES}
|
||||
)
|
||||
execute_process(
|
||||
COMMAND lrelease ${BO_TS_FILES}
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
if(EXISTS ${B_QM_FILES})
|
||||
message(STATUS "${PLUGIN} buildQM dir is EXISTS")
|
||||
else()
|
||||
message(STATUS "${PLUGIN} buildQM dir is not EXISTS")
|
||||
execute_process(
|
||||
COMMAND mkdir ${B_QM_FILES}
|
||||
)
|
||||
message(STATUS "${PLUGIN} buildQM dir is created")
|
||||
endif()
|
||||
|
||||
set(P_QM_FILES ${CMAKE_CURRENT_SOURCE_DIR}/translation/${PLUGIN}_zh_CN.qm)
|
||||
set(BO_QM_FILES ${CMAKE_CURRENT_SOURCE_DIR}/translation/${PLUGIN}_bo_CN.qm)
|
||||
|
||||
if(EXISTS ${P_QM_FILES})
|
||||
message(STATUS "${PLUGIN} proQM file is EXISTS")
|
||||
execute_process(
|
||||
COMMAND cp -f ${P_QM_FILES} ${B_QM_FILES}
|
||||
)
|
||||
execute_process(
|
||||
COMMAND rm -f ${P_QM_FILES}
|
||||
)
|
||||
message(STATUS "${PLUGIN} buildQM file is created")
|
||||
else()
|
||||
message(STATUS "${PLUGIN} buildQM file is not EXISTS")
|
||||
endif()
|
||||
|
||||
if(EXISTS ${BO_QM_FILES})
|
||||
message(STATUS "${PLUGIN} proQM file is EXISTS")
|
||||
execute_process(
|
||||
COMMAND cp -f ${BO_QM_FILES} ${B_QM_FILES}
|
||||
)
|
||||
execute_process(
|
||||
COMMAND rm -f ${BO_QM_FILES}
|
||||
)
|
||||
message(STATUS "${PLUGIN} buildQM file is created")
|
||||
else()
|
||||
message(STATUS "${PLUGIN} buildQM file is not EXISTS")
|
||||
endif()
|
||||
|
||||
if(${PLUGIN} STREQUAL "panel")
|
||||
set(P_QM_INSTALL ${PACKAGE_DATA_DIR}/${PLUGIN}/translation)
|
||||
message(STATUS " panel translation install : ${P_QM_INSTALL}")
|
||||
else()
|
||||
set(P_QM_INSTALL ${PACKAGE_DATA_DIR}/plugin-${PLUGIN}/translation)
|
||||
message(STATUS " plugin ${PLUGIN} translation install : ${P_QM_INSTALL}")
|
||||
endif()
|
||||
|
||||
install(DIRECTORY ${B_QM_FILES}
|
||||
DESTINATION ${P_QM_INSTALL})
|
||||
|
||||
ADD_DEFINITIONS(-DQM_INSTALL=\"${P_QM_INSTALL}/${PLUGIN}_zh_CN.qm\")
|
||||
ADD_DEFINITIONS(-DBO_QM_INSTALL=\"${P_QM_INSTALL}/${PLUGIN}_bo_CN.qm\")
|
||||
ADD_DEFINITIONS(-DPLUGINNAME=\"${PLUGIN}\")
|
||||
endmacro()
|
|
@ -0,0 +1,105 @@
|
|||
# Copyright (c) 2010, Rafael Fernández López, <ereslibre@kde.org>
|
||||
# Copyright (c) 2016, Luís Pereira, <luis.artur.pereira@gmail.com>
|
||||
# Copyright (c) 2019 Tianjin KYLIN Information Technology Co., Ltd. *
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the University 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 REGENTS 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 REGENTS 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.
|
||||
|
||||
#.rst:
|
||||
# FindExif
|
||||
# -----------
|
||||
#
|
||||
# Try to find the Exif library
|
||||
#
|
||||
# Once done this will define
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# EXIF_FOUND - System has the Exif library
|
||||
# EXIF_INCLUDE_DIR - The Exif library include directory
|
||||
# EXIF_INCLUDE_DIRS - Location of the headers needed to use the Exif library
|
||||
# EXIF_LIBRARIES - The libraries needed to use the Exif library
|
||||
# EXIF_DEFINITIONS - Compiler switches required for using the Exif library
|
||||
# EXIF_VERSION_STRING - the version of the Exif library found
|
||||
|
||||
|
||||
# use pkg-config to get the directories and then use these values
|
||||
# in the find_path() and find_library() calls
|
||||
find_package(PkgConfig)
|
||||
pkg_check_modules(PC_EXIF libexif)
|
||||
set(EXIF_DEFINITIONS ${PC_EXIF_CFLAGS_OTHER})
|
||||
|
||||
find_path(EXIF_INCLUDE_DIR NAMES libexif/exif-data.h
|
||||
HINTS
|
||||
${PC_EXIF_INCLUDEDIR}
|
||||
${PC_EXIF_INCLUDE_DIRS}
|
||||
PATH_SUFFIXES libexif
|
||||
)
|
||||
|
||||
find_library(EXIF_LIBRARIES NAMES exif libexif
|
||||
HINTS
|
||||
${PC_EXIF_LIBDIR}
|
||||
${PC_EXIF_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
|
||||
# iterate over all dependencies
|
||||
unset(FD_LIBRARIES)
|
||||
foreach(depend ${PC_EXIF_LIBRARIES})
|
||||
find_library(_DEPEND_LIBRARIES
|
||||
NAMES
|
||||
${depend}
|
||||
HINTS
|
||||
${PC_EXIF_LIBDIR}
|
||||
${PC_EXIF_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
if (_DEPEND_LIBRARIES)
|
||||
list(APPEND FD_LIBRARIES ${_DEPEND_LIBRARIES})
|
||||
endif()
|
||||
unset(_DEPEND_LIBRARIES CACHE)
|
||||
endforeach()
|
||||
|
||||
set(EXIF_VERSION_STRING ${PC_EXIF_VERSION})
|
||||
set(EXIF_INCLUDE_DIR ${PC_EXIF_INCLUDEDIR})
|
||||
|
||||
list(APPEND EXIF_INCLUDE_DIRS
|
||||
${EXIF_INCLUDE_DIR}
|
||||
${PC_EXIF_INCLUDE_DIRS}
|
||||
)
|
||||
list(REMOVE_DUPLICATES EXIF_INCLUDE_DIRS)
|
||||
|
||||
list(APPEND EXIF_LIBRARIES
|
||||
${FD_LIBRARIES}
|
||||
)
|
||||
|
||||
list(REMOVE_DUPLICATES EXIF_LIBRARIES)
|
||||
# handle the QUIETLY and REQUIRED arguments and set EXIF_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Exif
|
||||
REQUIRED_VARS EXIF_LIBRARIES EXIF_INCLUDE_DIR EXIF_INCLUDE_DIRS
|
||||
VERSION_VAR EXIF_VERSION_STRING)
|
||||
|
||||
mark_as_advanced(EXIF_INCLUDE_DIR EXIF_LIBRARIES)
|
|
@ -0,0 +1,126 @@
|
|||
# - Try to find Glib and its components (gio, gobject etc)
|
||||
# Once done, this will define
|
||||
#
|
||||
# GLIB_FOUND - system has Glib
|
||||
# GLIB_INCLUDE_DIRS - the Glib include directories
|
||||
# GLIB_LIBRARIES - link these to use Glib
|
||||
#
|
||||
# Optionally, the COMPONENTS keyword can be passed to find_package()
|
||||
# and Glib components can be looked for. Currently, the following
|
||||
# components can be used, and they define the following variables if
|
||||
# found:
|
||||
#
|
||||
# gio: GLIB_GIO_LIBRARIES
|
||||
# gobject: GLIB_GOBJECT_LIBRARIES
|
||||
# gmodule: GLIB_GMODULE_LIBRARIES
|
||||
# gthread: GLIB_GTHREAD_LIBRARIES
|
||||
#
|
||||
# Note that the respective _INCLUDE_DIR variables are not set, since
|
||||
# all headers are in the same directory as GLIB_INCLUDE_DIRS.
|
||||
#
|
||||
# Copyright (C) 2012 Raphael Kubo da Costa <rakuco@webkit.org>
|
||||
# Copyright (C) 2016 Luís Pereira <luis.artur.pereira@gmail.com>
|
||||
# Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd.
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS
|
||||
# IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS
|
||||
# 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.
|
||||
|
||||
find_package(PkgConfig)
|
||||
pkg_check_modules(PC_GLIB glib-2.0)
|
||||
|
||||
find_library(GLIB_LIBRARIES
|
||||
NAMES glib-2.0
|
||||
HINTS ${PC_GLIB_LIBDIR}
|
||||
${PC_GLIB_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
# Files in glib's main include path may include glibconfig.h, which,
|
||||
# for some odd reason, is normally in $LIBDIR/glib-2.0/include.
|
||||
get_filename_component(_GLIB_LIBRARY_DIR ${GLIB_LIBRARIES} PATH)
|
||||
find_path(GLIBCONFIG_INCLUDE_DIR
|
||||
NAMES glibconfig.h
|
||||
HINTS ${PC_LIBDIR} ${PC_LIBRARY_DIRS} ${_GLIB_LIBRARY_DIR}
|
||||
${PC_GLIB_INCLUDEDIR} ${PC_GLIB_INCLUDE_DIRS}
|
||||
PATH_SUFFIXES glib-2.0/include
|
||||
)
|
||||
|
||||
find_path(GLIB_INCLUDE_DIR
|
||||
NAMES glib.h
|
||||
HINTS ${PC_GLIB_INCLUDEDIR}
|
||||
${PC_GLIB_INCLUDE_DIRS}
|
||||
PATH_SUFFIXES glib-2.0
|
||||
)
|
||||
|
||||
set(GLIB_INCLUDE_DIRS ${GLIB_INCLUDE_DIR} ${GLIBCONFIG_INCLUDE_DIR})
|
||||
|
||||
# Version detection
|
||||
if (EXISTS "${GLIBCONFIG_INCLUDE_DIR}/glibconfig.h")
|
||||
file(READ "${GLIBCONFIG_INCLUDE_DIR}/glibconfig.h" GLIBCONFIG_H_CONTENTS)
|
||||
string(REGEX MATCH "#define GLIB_MAJOR_VERSION ([0-9]+)" _dummy "${GLIBCONFIG_H_CONTENTS}")
|
||||
set(GLIB_VERSION_MAJOR "${CMAKE_MATCH_1}")
|
||||
string(REGEX MATCH "#define GLIB_MINOR_VERSION ([0-9]+)" _dummy "${GLIBCONFIG_H_CONTENTS}")
|
||||
set(GLIB_VERSION_MINOR "${CMAKE_MATCH_1}")
|
||||
string(REGEX MATCH "#define GLIB_MICRO_VERSION ([0-9]+)" _dummy "${GLIBCONFIG_H_CONTENTS}")
|
||||
set(GLIB_VERSION_MICRO "${CMAKE_MATCH_1}")
|
||||
set(GLIB_VERSION "${GLIB_VERSION_MAJOR}.${GLIB_VERSION_MINOR}.${GLIB_VERSION_MICRO}")
|
||||
endif ()
|
||||
|
||||
# Additional Glib components. We only look for libraries, as not all of them
|
||||
# have corresponding headers and all headers are installed alongside the main
|
||||
# glib ones.
|
||||
foreach (_component ${GLIB_FIND_COMPONENTS})
|
||||
if (${_component} STREQUAL "gio")
|
||||
find_library(GLIB_GIO_LIBRARIES NAMES gio-2.0 HINTS ${_GLIB_LIBRARY_DIR})
|
||||
set(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GIO_LIBRARIES)
|
||||
elseif (${_component} STREQUAL "gobject")
|
||||
find_library(GLIB_GOBJECT_LIBRARIES NAMES gobject-2.0 HINTS ${_GLIB_LIBRARY_DIR})
|
||||
set(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GOBJECT_LIBRARIES)
|
||||
elseif (${_component} STREQUAL "gmodule")
|
||||
find_library(GLIB_GMODULE_LIBRARIES NAMES gmodule-2.0 HINTS ${_GLIB_LIBRARY_DIR})
|
||||
set(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GMODULE_LIBRARIES)
|
||||
elseif (${_component} STREQUAL "gthread")
|
||||
find_library(GLIB_GTHREAD_LIBRARIES NAMES gthread-2.0 HINTS ${_GLIB_LIBRARY_DIR})
|
||||
set(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GTHREAD_LIBRARIES)
|
||||
elseif (${_component} STREQUAL "gio-unix")
|
||||
pkg_check_modules(GIO_UNIX gio-unix-2.0)
|
||||
find_path(GLIB_GIO_UNIX_INCLUDE_DIR
|
||||
NAMES gio/gunixconnection.h
|
||||
HINTS ${GIO_UNIX_INCLUDEDIR}
|
||||
PATH_SUFFIXES gio-unix-2.0)
|
||||
|
||||
set(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GIO_UNIX_INCLUDE_DIR)
|
||||
endif ()
|
||||
endforeach ()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLIB REQUIRED_VARS GLIB_INCLUDE_DIRS GLIB_LIBRARIES ${ADDITIONAL_REQUIRED_VARS}
|
||||
VERSION_VAR GLIB_VERSION)
|
||||
|
||||
mark_as_advanced(
|
||||
GLIBCONFIG_INCLUDE_DIR
|
||||
GLIB_GIO_LIBRARIES
|
||||
GLIB_GIO_UNIX_INCLUDE_DIR
|
||||
GLIB_GMODULE_LIBRARIES
|
||||
GLIB_GOBJECT_LIBRARIES
|
||||
GLIB_GTHREAD_LIBRARIES
|
||||
GLIB_INCLUDE_DIR
|
||||
GLIB_INCLUDE_DIRS
|
||||
GLIB_LIBRARIES
|
||||
)
|
|
@ -0,0 +1,113 @@
|
|||
# Copyright (c) 2010, Rafael Fernández López, <ereslibre@kde.org>
|
||||
# Copyright (c) 2016, Luís Pereira, <luis.artur.pereira@gmail.com>
|
||||
# Copyright (c) 2019 Tianjin KYLIN Information Technology Co., Ltd. *
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the University 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 REGENTS 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 REGENTS 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.
|
||||
|
||||
#.rst:
|
||||
# FindMenuCache
|
||||
# -----------
|
||||
#
|
||||
# Try to find the MenuCache library
|
||||
#
|
||||
# Once done this will define
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# MENUCACHE_FOUND - System has the MenuCache library
|
||||
# MENUCACHE_INCLUDE_DIR - The MenuCache library include directory
|
||||
# MENUCACHE_INCLUDE_DIRS - Location of the headers needed to use the MenuCache library
|
||||
# MENUCACHE_LIBRARIES - The libraries needed to the MenuCache library
|
||||
# MENUCACHE_DEFINITIONS - Compiler switches required for using the MenuCache library
|
||||
# MENUCACHE_VERSION_STRING - the version of MenuCache library found
|
||||
|
||||
|
||||
# use pkg-config to get the directories and then use these values
|
||||
# in the find_path() and find_library() calls
|
||||
find_package(PkgConfig)
|
||||
pkg_check_modules(PC_MENUCACHE libmenu-cache)
|
||||
set(MENUCACHE_DEFINITIONS ${PC_MENUCACHE_CFLAGS_OTHER})
|
||||
|
||||
find_path(MENUCACHE_INCLUDE_DIRS
|
||||
NAMES
|
||||
menu-cache.h
|
||||
menu-cache/menu-cache.h
|
||||
HINTS
|
||||
${PC_MENUCACHE_INCLUDEDIR}
|
||||
${PC_MENUCACHE_INCLUDE_DIRS}
|
||||
PATH_SUFFIXES
|
||||
libmenu-cache
|
||||
)
|
||||
|
||||
find_library(MENUCACHE_LIBRARIES
|
||||
NAMES
|
||||
menu-cache
|
||||
libmenu-cache
|
||||
HINTS
|
||||
${PC_MENUCACHE_LIBDIR}
|
||||
${PC_MENUCACHE_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
|
||||
# iterate over all dependencies
|
||||
unset(FD_LIBRARIES)
|
||||
foreach(depend ${PC_MENUCACHE_LIBRARIES})
|
||||
find_library(_DEPEND_LIBRARIES
|
||||
NAMES
|
||||
${depend}
|
||||
HINTS
|
||||
${PC_MENUCACHE_LIBDIR}
|
||||
${PC_MENUCACHE_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
if (_DEPEND_LIBRARIES)
|
||||
list(APPEND FD_LIBRARIES ${_DEPEND_LIBRARIES})
|
||||
endif()
|
||||
unset(_DEPEND_LIBRARIES CACHE)
|
||||
endforeach()
|
||||
|
||||
set(MENUCACHE_VERSION_STRING ${PC_MENUCACHE_VERSION})
|
||||
set(MENUCACHE_INCLUDE_DIR ${PC_MENUCACHE_INCLUDEDIR})
|
||||
|
||||
list(APPEND MENUCACHE_INCLUDE_DIRS
|
||||
${MENUCACHE_INCLUDE_DIR}
|
||||
${PC_MENUCACHE_INCLUDE_DIRS}
|
||||
)
|
||||
list(REMOVE_DUPLICATES MENUCACHE_INCLUDE_DIRS)
|
||||
|
||||
list(APPEND MENUCACHE_LIBRARIES
|
||||
${FD_LIBRARIES}
|
||||
)
|
||||
|
||||
list(REMOVE_DUPLICATES MENUCACHE_LIBRARIES)
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set MENUCACHE_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(MenuCache
|
||||
REQUIRED_VARS MENUCACHE_LIBRARIES MENUCACHE_INCLUDE_DIR MENUCACHE_INCLUDE_DIRS
|
||||
VERSION_VAR MENUCACHE_VERSION_STRING)
|
||||
|
||||
mark_as_advanced(MENUCACHE_INCLUDE_DIR MENUCACHE_LIBRARIES)
|
|
@ -0,0 +1,65 @@
|
|||
# - Try to find the UDev library
|
||||
# Once done this will define
|
||||
#
|
||||
# UDEV_FOUND - system has UDev
|
||||
# UDEV_INCLUDE_DIR - the libudev include directory
|
||||
# UDEV_LIBS - The libudev libraries
|
||||
|
||||
# Copyright (c) 2010, Rafael Fernández López, <ereslibre@kde.org>
|
||||
# Copyright (c) 2016, Luís Pereira, <luis.artur.pereira@gmail.com>
|
||||
# Copyright (c) 2019 Tianjin KYLIN Information Technology Co., Ltd. *
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the University 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 REGENTS 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 REGENTS 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.
|
||||
|
||||
find_package(PkgConfig)
|
||||
pkg_check_modules(PC_UDEV libudev)
|
||||
|
||||
find_path(UDEV_INCLUDE_DIR libudev.h
|
||||
HINTS ${PC_UDEV_INCLUDEDIR} ${PC_UDEV_INCLUDE_DIRS})
|
||||
|
||||
find_library(UDEV_LIBS udev HINTS ${PC_UDEV_LIBDIR} ${PC_UDEV_LIBRARY_DIRS})
|
||||
|
||||
if(UDEV_INCLUDE_DIR AND UDEV_LIBS)
|
||||
include(CheckFunctionExists)
|
||||
include(CMakePushCheckState)
|
||||
cmake_push_check_state()
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${UDEV_LIBS} )
|
||||
|
||||
cmake_pop_check_state()
|
||||
|
||||
endif()
|
||||
|
||||
set(UDEV_VERSION_STRING ${PC_UDEV_VERSION})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(UDev
|
||||
REQUIRED_VARS UDEV_INCLUDE_DIR UDEV_LIBS
|
||||
VERSION_VAR ${UDEV_VERSION_STRING})
|
||||
|
||||
mark_as_advanced(UDEV_INCLUDE_DIR UDEV_LIBS)
|
||||
|
||||
include(FeatureSummary)
|
||||
set_package_properties(UDev PROPERTIES
|
||||
URL "https://www.kernel.org/pub/linux/utils/kernel/hotplug/udev/udev.html"
|
||||
DESCRIPTION "Linux dynamic device management")
|
|
@ -0,0 +1,53 @@
|
|||
#.rst:
|
||||
# FindXCB
|
||||
# -------
|
||||
#
|
||||
# Find XCB libraries
|
||||
#
|
||||
# Tries to find xcb libraries on unix systems.
|
||||
#
|
||||
# - Be sure to set the COMPONENTS to the components you want to link to
|
||||
# - The XCB_LIBRARIES variable is set ONLY to your COMPONENTS list
|
||||
# - To use only a specific component check the XCB_LIBRARIES_${COMPONENT} variable
|
||||
#
|
||||
# The following values are defined
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# XCB_FOUND - True if xcb is available
|
||||
# XCB_INCLUDE_DIRS - Include directories for xcb
|
||||
# XCB_LIBRARIES - List of libraries for xcb
|
||||
# XCB_DEFINITIONS - List of definitions for xcb
|
||||
#
|
||||
#=============================================================================
|
||||
# Copyright (c) 2015 Jari Vetoniemi
|
||||
# Copyright (c) 2019 Tianjin KYLIN Information Technology Co., Ltd. *
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
|
||||
include(FeatureSummary)
|
||||
set_package_properties(XCB PROPERTIES
|
||||
URL "https://xcb.freedesktop.org/"
|
||||
DESCRIPTION "X protocol C-language Binding")
|
||||
|
||||
find_package(PkgConfig)
|
||||
pkg_check_modules(PC_XCB xcb ${XCB_FIND_COMPONENTS})
|
||||
|
||||
find_library(XCB_LIBRARIES xcb HINTS ${PC_XCB_LIBRARY_DIRS})
|
||||
find_path(XCB_INCLUDE_DIRS xcb/xcb.h PATH_SUFFIXES xcb HINTS ${PC_XCB_INCLUDE_DIRS})
|
||||
|
||||
foreach(COMPONENT ${XCB_FIND_COMPONENTS})
|
||||
find_library(XCB_LIBRARIES_${COMPONENT} ${COMPONENT} HINTS ${PC_XCB_LIBRARY_DIRS})
|
||||
list(APPEND XCB_LIBRARIES ${XCB_LIBRARIES_${COMPONENT}})
|
||||
mark_as_advanced(XCB_LIBRARIES_${COMPONENT})
|
||||
endforeach(COMPONENT ${XCB_FIND_COMPONENTS})
|
||||
|
||||
set(XCB_DEFINITIONS ${PC_XCB_CFLAGS_OTHER})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(XCB DEFAULT_MSG XCB_LIBRARIES XCB_INCLUDE_DIRS)
|
||||
mark_as_advanced(XCB_INCLUDE_DIRS XCB_LIBRARIES XCB_DEFINITIONS)
|
|
@ -0,0 +1,107 @@
|
|||
#.rst:
|
||||
# FindXKBCommon
|
||||
# -----------
|
||||
#
|
||||
# Try to find XKBCommon.
|
||||
#
|
||||
# This is a component-based find module, which makes use of the COMPONENTS
|
||||
# and OPTIONAL_COMPONENTS arguments to find_module. The following components
|
||||
# are available::
|
||||
#
|
||||
# XKBCommon X11
|
||||
#
|
||||
# If no components are specified, this module will act as though all components
|
||||
# were passed to OPTIONAL_COMPONENTS.
|
||||
#
|
||||
# This module will define the following variables, independently of the
|
||||
# components searched for or found:
|
||||
#
|
||||
# ``XKBCommon_FOUND``
|
||||
# TRUE if (the requested version of) XKBCommon is available
|
||||
# ``XKBCommon_VERSION``
|
||||
# Found XKBCommon version
|
||||
# ``XKBCommon_TARGETS``
|
||||
# A list of all targets imported by this module (note that there may be more
|
||||
# than the components that were requested)
|
||||
# ``XKBCommon_LIBRARIES``
|
||||
# This can be passed to target_link_libraries() instead of the imported
|
||||
# targets
|
||||
# ``XKBCommon_INCLUDE_DIRS``
|
||||
# This should be passed to target_include_directories() if the targets are
|
||||
# not used for linking
|
||||
# ``XKBCommon_DEFINITIONS``
|
||||
# This should be passed to target_compile_options() if the targets are not
|
||||
# used for linking
|
||||
#
|
||||
# For each searched-for components, ``XKBCommon_<component>_FOUND`` will be set to
|
||||
# TRUE if the corresponding XKBCommon library was found, and FALSE otherwise. If
|
||||
# ``XKBCommon_<component>_FOUND`` is TRUE, the imported target
|
||||
# ``XKBCommon::<component>`` will be defined.
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2017 Luís Pereira <luis.artur.pereira@gmail.com>
|
||||
# Copyright (c) 2019 Tianjin KYLIN Information Technology Co., Ltd. *
|
||||
# Documentation adapted from the KF5 FindWayland module.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. The name of the author may not be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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(ECMFindModuleHelpers)
|
||||
|
||||
ecm_find_package_version_check(XKBCommon)
|
||||
|
||||
set(XKBCommon_known_components
|
||||
XKBCommon
|
||||
X11)
|
||||
|
||||
unset(XKBCommon_XKBCommon_component_deps)
|
||||
set(XKBCommon_XKBCommon_pkg_config "xkbcommon")
|
||||
set(XKBCommon_XKBCommon_lib "xkbcommon")
|
||||
set(XKBCommon_XKBCommon_header "xkbcommon/xkbcommon.h")
|
||||
|
||||
set(XKBCommon_X11_component_deps XKBCommon)
|
||||
set(XKBCommon_X11_pkg_config "xkbcommon-x11")
|
||||
set(XKBCommon_X11_lib "xkbcommon-x11")
|
||||
set(XKBCommon_X11_header "xkbcommon/xkbcommon-x11.h")
|
||||
|
||||
ecm_find_package_parse_components(XKBCommon
|
||||
RESULT_VAR XKBCommon_components
|
||||
KNOWN_COMPONENTS ${XKBCommon_known_components}
|
||||
)
|
||||
ecm_find_package_handle_library_components(XKBCommon
|
||||
COMPONENTS ${XKBCommon_components}
|
||||
)
|
||||
|
||||
find_package_handle_standard_args(XKBCommon
|
||||
FOUND_VAR XKBCommon_FOUND
|
||||
REQUIRED_VARS XKBCommon_LIBRARIES XKBCommon_INCLUDE_DIRS
|
||||
VERSION_VAR XKBCommon_VERSION
|
||||
HANDLE_COMPONENTS
|
||||
)
|
||||
|
||||
include(FeatureSummary)
|
||||
set_package_properties(XKBCommon PROPERTIES
|
||||
URL "https://xkbcommon.org"
|
||||
DESCRIPTION "A library to handle keyboard descriptions"
|
||||
)
|
|
@ -0,0 +1,56 @@
|
|||
#=============================================================================
|
||||
# Copyright 2015 Luís Pereira <luis.artur.pereira@gmail.com>
|
||||
# Copyright (c) 2019 Tianjin KYLIN Information Technology Co., Ltd. *
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. The name of the author may not be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
|
||||
#=============================================================================
|
||||
# FindXdgUserDirs
|
||||
#
|
||||
# Try to find xdg-user-dirs-update.
|
||||
#
|
||||
# If the xdg-user-dirs-update executable is not in your PATH, you can provide
|
||||
# an alternative name or full path location with the
|
||||
# `XdgUserDirsUpdate_EXECUTABLE` variable.
|
||||
#
|
||||
# This will define the following variables:
|
||||
#
|
||||
# `XdgUserDirs_FOUND`
|
||||
# True if xdg-user-dirs-update is available.
|
||||
#
|
||||
# `XdgUserDirsUpdate_EXECUTABLE`
|
||||
# The xdg-user-dirs-update executable.
|
||||
#
|
||||
|
||||
# Find xdg-user-dirs-update
|
||||
find_program(XdgUserDirsUpdate_EXECUTABLE NAMES xdg-user-dirs-update)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package_handle_standard_args(XdgUserDirs
|
||||
FOUND_VAR
|
||||
XdgUserDirs_FOUND
|
||||
REQUIRED_VARS
|
||||
XdgUserDirsUpdate_EXECUTABLE
|
||||
)
|
||||
|
||||
mark_as_advanced(XdgUserDirsUpdate_EXECUTABLE)
|
|
@ -0,0 +1,297 @@
|
|||
#.rst:
|
||||
# ECMFindModuleHelpers
|
||||
# --------------------
|
||||
#
|
||||
# Helper macros for find modules: ecm_find_package_version_check(),
|
||||
# ecm_find_package_parse_components() and
|
||||
# ecm_find_package_handle_library_components().
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# ecm_find_package_version_check(<name>)
|
||||
#
|
||||
# Prints warnings if the CMake version or the project's required CMake version
|
||||
# is older than that required by extra-cmake-modules.
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# ecm_find_package_parse_components(<name>
|
||||
# RESULT_VAR <variable>
|
||||
# KNOWN_COMPONENTS <component1> [<component2> [...]]
|
||||
# [SKIP_DEPENDENCY_HANDLING])
|
||||
#
|
||||
# This macro will populate <variable> with a list of components found in
|
||||
# <name>_FIND_COMPONENTS, after checking that all those components are in the
|
||||
# list of KNOWN_COMPONENTS; if there are any unknown components, it will print
|
||||
# an error or warning (depending on the value of <name>_FIND_REQUIRED) and call
|
||||
# return().
|
||||
#
|
||||
# The order of components in <variable> is guaranteed to match the order they
|
||||
# are listed in the KNOWN_COMPONENTS argument.
|
||||
#
|
||||
# If SKIP_DEPENDENCY_HANDLING is not set, for each component the variable
|
||||
# <name>_<component>_component_deps will be checked for dependent components.
|
||||
# If <component> is listed in <name>_FIND_COMPONENTS, then all its (transitive)
|
||||
# dependencies will also be added to <variable>.
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# ecm_find_package_handle_library_components(<name>
|
||||
# COMPONENTS <component> [<component> [...]]
|
||||
# [SKIP_DEPENDENCY_HANDLING])
|
||||
# [SKIP_PKG_CONFIG])
|
||||
#
|
||||
# Creates an imported library target for each component. The operation of this
|
||||
# macro depends on the presence of a number of CMake variables.
|
||||
#
|
||||
# The <name>_<component>_lib variable should contain the name of this library,
|
||||
# and <name>_<component>_header variable should contain the name of a header
|
||||
# file associated with it (whatever relative path is normally passed to
|
||||
# '#include'). <name>_<component>_header_subdir variable can be used to specify
|
||||
# which subdirectory of the include path the headers will be found in.
|
||||
# ecm_find_package_components() will then search for the library
|
||||
# and include directory (creating appropriate cache variables) and create an
|
||||
# imported library target named <name>::<component>.
|
||||
#
|
||||
# Additional variables can be used to provide additional information:
|
||||
#
|
||||
# If SKIP_PKG_CONFIG, the <name>_<component>_pkg_config variable is set, and
|
||||
# pkg-config is found, the pkg-config module given by
|
||||
# <name>_<component>_pkg_config will be searched for and used to help locate the
|
||||
# library and header file. It will also be used to set
|
||||
# <name>_<component>_VERSION.
|
||||
#
|
||||
# Note that if version information is found via pkg-config,
|
||||
# <name>_<component>_FIND_VERSION can be set to require a particular version
|
||||
# for each component.
|
||||
#
|
||||
# If SKIP_DEPENDENCY_HANDLING is not set, the INTERFACE_LINK_LIBRARIES property
|
||||
# of the imported target for <component> will be set to contain the imported
|
||||
# targets for the components listed in <name>_<component>_component_deps.
|
||||
# <component>_FOUND will also be set to false if any of the compoments in
|
||||
# <name>_<component>_component_deps are not found. This requires the components
|
||||
# in <name>_<component>_component_deps to be listed before <component> in the
|
||||
# COMPONENTS argument.
|
||||
#
|
||||
# The following variables will be set:
|
||||
#
|
||||
# ``<name>_TARGETS``
|
||||
# the imported targets
|
||||
# ``<name>_LIBRARIES``
|
||||
# the found libraries
|
||||
# ``<name>_INCLUDE_DIRS``
|
||||
# the combined required include directories for the components
|
||||
# ``<name>_DEFINITIONS``
|
||||
# the "other" CFLAGS provided by pkg-config, if any
|
||||
# ``<name>_VERSION``
|
||||
# the value of ``<name>_<component>_VERSION`` for the first component that
|
||||
# has this variable set (note that components are searched for in the order
|
||||
# they are passed to the macro), although if it is already set, it will not
|
||||
# be altered
|
||||
#
|
||||
# Note that these variables are never cleared, so if
|
||||
# ecm_find_package_handle_library_components() is called multiple times with
|
||||
# different components (typically because of multiple find_package() calls) then
|
||||
# ``<name>_TARGETS``, for example, will contain all the targets found in any
|
||||
# call (although no duplicates).
|
||||
#
|
||||
# Since pre-1.0.0.
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2014 Alex Merry <alex.merry@kde.org>
|
||||
# Copyright (c) 2019 Tianjin KYLIN Information Technology Co., Ltd. *
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. The name of the author may not be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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(CMakeParseArguments)
|
||||
|
||||
macro(ecm_find_package_version_check module_name)
|
||||
if(CMAKE_VERSION VERSION_LESS 3.1.0)
|
||||
message(FATAL_ERROR "CMake 3.1.0 is required by ukui-build-tools!")
|
||||
endif()
|
||||
if(CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 3.1.0)
|
||||
message(AUTHOR_WARNING "Your project should require at least CMake 3.1.0!")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro(ecm_find_package_parse_components module_name)
|
||||
set(ecm_fppc_options SKIP_DEPENDENCY_HANDLING)
|
||||
set(ecm_fppc_oneValueArgs RESULT_VAR)
|
||||
set(ecm_fppc_multiValueArgs KNOWN_COMPONENTS DEFAULT_COMPONENTS)
|
||||
cmake_parse_arguments(ECM_FPPC "${ecm_fppc_options}" "${ecm_fppc_oneValueArgs}" "${ecm_fppc_multiValueArgs}" ${ARGN})
|
||||
|
||||
if(ECM_FPPC_UNPARSED_ARGUMENTS)
|
||||
message(FATAL_ERROR "Unexpected arguments to ecm_find_package_parse_components: ${ECM_FPPC_UNPARSED_ARGUMENTS}")
|
||||
endif()
|
||||
if(NOT ECM_FPPC_RESULT_VAR)
|
||||
message(FATAL_ERROR "Missing RESULT_VAR argument to ecm_find_package_parse_components")
|
||||
endif()
|
||||
if(NOT ECM_FPPC_KNOWN_COMPONENTS)
|
||||
message(FATAL_ERROR "Missing KNOWN_COMPONENTS argument to ecm_find_package_parse_components")
|
||||
endif()
|
||||
if(NOT ECM_FPPC_DEFAULT_COMPONENTS)
|
||||
set(ECM_FPPC_DEFAULT_COMPONENTS ${ECM_FPPC_KNOWN_COMPONENTS})
|
||||
endif()
|
||||
|
||||
if(${module_name}_FIND_COMPONENTS)
|
||||
set(ecm_fppc_requestedComps ${${module_name}_FIND_COMPONENTS})
|
||||
|
||||
if(NOT ECM_FPPC_SKIP_DEPENDENCY_HANDLING)
|
||||
# Make sure deps are included
|
||||
foreach(ecm_fppc_comp ${ecm_fppc_requestedComps})
|
||||
foreach(ecm_fppc_dep_comp ${${module_name}_${ecm_fppc_comp}_component_deps})
|
||||
list(FIND ecm_fppc_requestedComps "${ecm_fppc_dep_comp}" ecm_fppc_index)
|
||||
if("${ecm_fppc_index}" STREQUAL "-1")
|
||||
if(NOT ${module_name}_FIND_QUIETLY)
|
||||
message(STATUS "${module_name}: ${ecm_fppc_comp} requires ${${module_name}_${ecm_fppc_comp}_component_deps}")
|
||||
endif()
|
||||
list(APPEND ecm_fppc_requestedComps "${ecm_fppc_dep_comp}")
|
||||
endif()
|
||||
endforeach()
|
||||
endforeach()
|
||||
else()
|
||||
message(STATUS "Skipping dependency handling for ${module_name}")
|
||||
endif()
|
||||
list(REMOVE_DUPLICATES ecm_fppc_requestedComps)
|
||||
|
||||
# This makes sure components are listed in the same order as
|
||||
# KNOWN_COMPONENTS (potentially important for inter-dependencies)
|
||||
set(${ECM_FPPC_RESULT_VAR})
|
||||
foreach(ecm_fppc_comp ${ECM_FPPC_KNOWN_COMPONENTS})
|
||||
list(FIND ecm_fppc_requestedComps "${ecm_fppc_comp}" ecm_fppc_index)
|
||||
if(NOT "${ecm_fppc_index}" STREQUAL "-1")
|
||||
list(APPEND ${ECM_FPPC_RESULT_VAR} "${ecm_fppc_comp}")
|
||||
list(REMOVE_AT ecm_fppc_requestedComps ${ecm_fppc_index})
|
||||
endif()
|
||||
endforeach()
|
||||
# if there are any left, they are unknown components
|
||||
if(ecm_fppc_requestedComps)
|
||||
set(ecm_fppc_msgType STATUS)
|
||||
if(${module_name}_FIND_REQUIRED)
|
||||
set(ecm_fppc_msgType FATAL_ERROR)
|
||||
endif()
|
||||
if(NOT ${module_name}_FIND_QUIETLY)
|
||||
message(${ecm_fppc_msgType} "${module_name}: requested unknown components ${ecm_fppc_requestedComps}")
|
||||
endif()
|
||||
return()
|
||||
endif()
|
||||
else()
|
||||
set(${ECM_FPPC_RESULT_VAR} ${ECM_FPPC_DEFAULT_COMPONENTS})
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro(ecm_find_package_handle_library_components module_name)
|
||||
set(ecm_fpwc_options SKIP_PKG_CONFIG SKIP_DEPENDENCY_HANDLING)
|
||||
set(ecm_fpwc_oneValueArgs)
|
||||
set(ecm_fpwc_multiValueArgs COMPONENTS)
|
||||
cmake_parse_arguments(ECM_FPWC "${ecm_fpwc_options}" "${ecm_fpwc_oneValueArgs}" "${ecm_fpwc_multiValueArgs}" ${ARGN})
|
||||
|
||||
if(ECM_FPWC_UNPARSED_ARGUMENTS)
|
||||
message(FATAL_ERROR "Unexpected arguments to ecm_find_package_handle_components: ${ECM_FPWC_UNPARSED_ARGUMENTS}")
|
||||
endif()
|
||||
if(NOT ECM_FPWC_COMPONENTS)
|
||||
message(FATAL_ERROR "Missing COMPONENTS argument to ecm_find_package_handle_components")
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package(PkgConfig)
|
||||
foreach(ecm_fpwc_comp ${ECM_FPWC_COMPONENTS})
|
||||
set(ecm_fpwc_dep_vars)
|
||||
set(ecm_fpwc_dep_targets)
|
||||
if(NOT SKIP_DEPENDENCY_HANDLING)
|
||||
foreach(ecm_fpwc_dep ${${module_name}_${ecm_fpwc_comp}_component_deps})
|
||||
list(APPEND ecm_fpwc_dep_vars "${module_name}_${ecm_fpwc_dep}_FOUND")
|
||||
list(APPEND ecm_fpwc_dep_targets "${module_name}::${ecm_fpwc_dep}")
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if(NOT ECM_FPWC_SKIP_PKG_CONFIG AND ${module_name}_${ecm_fpwc_comp}_pkg_config)
|
||||
pkg_check_modules(PKG_${module_name}_${ecm_fpwc_comp}
|
||||
${${module_name}_${ecm_fpwc_comp}_pkg_config})
|
||||
endif()
|
||||
|
||||
find_path(${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR
|
||||
NAMES ${${module_name}_${ecm_fpwc_comp}_header}
|
||||
HINTS ${PKG_${module_name}_${ecm_fpwc_comp}_INCLUDE_DIRS}
|
||||
PATH_SUFFIXES ${${module_name}_${ecm_fpwc_comp}_header_subdir}
|
||||
)
|
||||
find_library(${module_name}_${ecm_fpwc_comp}_LIBRARY
|
||||
NAMES ${${module_name}_${ecm_fpwc_comp}_lib}
|
||||
HINTS ${PKG_${module_name}_${ecm_fpwc_comp}_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
set(${module_name}_${ecm_fpwc_comp}_VERSION "${PKG_${module_name}_${ecm_fpwc_comp}_VERSION}")
|
||||
if(NOT ${module_name}_VERSION)
|
||||
set(${module_name}_VERSION ${${module_name}_${ecm_fpwc_comp}_VERSION})
|
||||
endif()
|
||||
|
||||
find_package_handle_standard_args(${module_name}_${ecm_fpwc_comp}
|
||||
FOUND_VAR
|
||||
${module_name}_${ecm_fpwc_comp}_FOUND
|
||||
REQUIRED_VARS
|
||||
${module_name}_${ecm_fpwc_comp}_LIBRARY
|
||||
${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR
|
||||
${ecm_fpwc_dep_vars}
|
||||
VERSION_VAR
|
||||
${module_name}_${ecm_fpwc_comp}_VERSION
|
||||
)
|
||||
|
||||
mark_as_advanced(
|
||||
${module_name}_${ecm_fpwc_comp}_LIBRARY
|
||||
${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR
|
||||
)
|
||||
|
||||
if(${module_name}_${ecm_fpwc_comp}_FOUND)
|
||||
list(APPEND ${module_name}_LIBRARIES
|
||||
"${${module_name}_${ecm_fpwc_comp}_LIBRARY}")
|
||||
list(APPEND ${module_name}_INCLUDE_DIRS
|
||||
"${${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR}")
|
||||
set(${module_name}_DEFINITIONS
|
||||
${${module_name}_DEFINITIONS}
|
||||
${PKG_${module_name}_${ecm_fpwc_comp}_DEFINITIONS})
|
||||
if(NOT TARGET ${module_name}::${ecm_fpwc_comp})
|
||||
add_library(${module_name}::${ecm_fpwc_comp} UNKNOWN IMPORTED)
|
||||
set_target_properties(${module_name}::${ecm_fpwc_comp} PROPERTIES
|
||||
IMPORTED_LOCATION "${${module_name}_${ecm_fpwc_comp}_LIBRARY}"
|
||||
INTERFACE_COMPILE_OPTIONS "${PKG_${module_name}_${ecm_fpwc_comp}_DEFINITIONS}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR}"
|
||||
INTERFACE_LINK_LIBRARIES "${ecm_fpwc_dep_targets}"
|
||||
)
|
||||
endif()
|
||||
list(APPEND ${module_name}_TARGETS
|
||||
"${module_name}::${ecm_fpwc_comp}")
|
||||
endif()
|
||||
endforeach()
|
||||
if(${module_name}_LIBRARIES)
|
||||
list(REMOVE_DUPLICATES ${module_name}_LIBRARIES)
|
||||
endif()
|
||||
if(${module_name}_INCLUDE_DIRS)
|
||||
list(REMOVE_DUPLICATES ${module_name}_INCLUDE_DIRS)
|
||||
endif()
|
||||
if(${module_name}_DEFINITIONS)
|
||||
list(REMOVE_DUPLICATES ${module_name}_DEFINITIONS)
|
||||
endif()
|
||||
if(${module_name}_TARGETS)
|
||||
list(REMOVE_DUPLICATES ${module_name}_TARGETS)
|
||||
endif()
|
||||
endmacro()
|
|
@ -0,0 +1,113 @@
|
|||
#=============================================================================
|
||||
# Copyright 2005-2011 Kitware, Inc.
|
||||
# Copyright (c) 2019 Tianjin KYLIN Information Technology Co., Ltd. *
|
||||
# All rights reserved.
|
||||
#
|
||||
# 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 Kitware, Inc. nor the names of its
|
||||
# contributors may be used to endorse or promote products derived
|
||||
# from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#=============================================================================
|
||||
|
||||
include(CMakeParseArguments)
|
||||
|
||||
function(QT5_PATCHED_CREATE_TRANSLATION _qm_files)
|
||||
set(options)
|
||||
set(oneValueArgs)
|
||||
set(multiValueArgs OPTIONS)
|
||||
|
||||
cmake_parse_arguments(_LUPDATE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||
set(_lupdate_files ${_LUPDATE_UNPARSED_ARGUMENTS})
|
||||
set(_lupdate_options ${_LUPDATE_OPTIONS})
|
||||
|
||||
set(_my_sources)
|
||||
set(_my_tsfiles)
|
||||
foreach(_file ${_lupdate_files})
|
||||
get_filename_component(_ext ${_file} EXT)
|
||||
get_filename_component(_abs_FILE ${_file} ABSOLUTE)
|
||||
if(_ext MATCHES "ts")
|
||||
list(APPEND _my_tsfiles ${_abs_FILE})
|
||||
else()
|
||||
list(APPEND _my_sources ${_abs_FILE})
|
||||
endif()
|
||||
endforeach()
|
||||
foreach(_ts_file ${_my_tsfiles})
|
||||
if(_my_sources)
|
||||
# make a list file to call lupdate on, so we don't make our commands too
|
||||
# long for some systems
|
||||
# get_filename_component(_ts_name ${_ts_file} NAME_WE)
|
||||
|
||||
get_filename_component(_name ${_ts_file} NAME)
|
||||
string(REGEX REPLACE "^(.+)(\\.[^.]+)$" "\\1" _ts_name ${_name})
|
||||
|
||||
set(_ts_lst_file "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${_ts_name}_lst_file")
|
||||
set(_lst_file_srcs)
|
||||
foreach(_lst_file_src ${_my_sources})
|
||||
set(_lst_file_srcs "${_lst_file_src}\n${_lst_file_srcs}")
|
||||
endforeach()
|
||||
|
||||
get_directory_property(_inc_DIRS INCLUDE_DIRECTORIES)
|
||||
foreach(_pro_include ${_inc_DIRS})
|
||||
get_filename_component(_abs_include "${_pro_include}" ABSOLUTE)
|
||||
set(_lst_file_srcs "-I${_pro_include}\n${_lst_file_srcs}")
|
||||
endforeach()
|
||||
|
||||
file(WRITE ${_ts_lst_file} "${_lst_file_srcs}")
|
||||
endif()
|
||||
add_custom_command(OUTPUT ${_ts_file}
|
||||
COMMAND ${Qt5_LUPDATE_EXECUTABLE}
|
||||
ARGS ${_lupdate_options} "@${_ts_lst_file}" -ts ${_ts_file}
|
||||
DEPENDS ${_my_sources} ${_ts_lst_file} VERBATIM)
|
||||
endforeach()
|
||||
qt5_patched_add_translation(${_qm_files} ${_my_tsfiles})
|
||||
set(${_qm_files} ${${_qm_files}} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
|
||||
function(QT5_PATCHED_ADD_TRANSLATION _qm_files)
|
||||
foreach(_current_FILE ${ARGN})
|
||||
get_filename_component(_abs_FILE ${_current_FILE} ABSOLUTE)
|
||||
# get_filename_component(qm ${_abs_FILE} NAME_WE)
|
||||
|
||||
get_filename_component(_name ${_abs_FILE} NAME)
|
||||
string(REGEX REPLACE "^(.+)(\\.[^.]+)$" "\\1" qm ${_name})
|
||||
|
||||
get_source_file_property(output_location ${_abs_FILE} OUTPUT_LOCATION)
|
||||
if(output_location)
|
||||
file(MAKE_DIRECTORY "${output_location}")
|
||||
set(qm "${output_location}/${qm}.qm")
|
||||
else()
|
||||
set(qm "${CMAKE_CURRENT_BINARY_DIR}/${qm}.qm")
|
||||
endif()
|
||||
|
||||
add_custom_command(OUTPUT ${qm}
|
||||
COMMAND ${Qt5_LRELEASE_EXECUTABLE}
|
||||
ARGS ${_abs_FILE} -qm ${qm}
|
||||
DEPENDS ${_abs_FILE} VERBATIM
|
||||
)
|
||||
list(APPEND ${_qm_files} ${qm})
|
||||
endforeach()
|
||||
set(${_qm_files} ${${_qm_files}} PARENT_SCOPE)
|
||||
endfunction()
|
|
@ -0,0 +1,47 @@
|
|||
#=============================================================================
|
||||
# Copyright 2014 Luís Pereira <luis.artur.pereira@gmail.com>
|
||||
# Copyright (c) 2019 Tianjin KYLIN Information Technology Co., Ltd. *
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. The name of the author may not be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
|
||||
#=============================================================================
|
||||
#
|
||||
# These functions enables "automatic" translation loading in Qt5 apps
|
||||
# and libs. They generate a .cpp file that takes care of everything. The
|
||||
# user doesn't have to do anything in the source code.
|
||||
#
|
||||
# qt5_translation_loader(<source_files> <translations_dir> <catalog_name>)
|
||||
#
|
||||
# Output:
|
||||
# <source_files> Appends the generated file to this variable.
|
||||
#
|
||||
# Input:
|
||||
# <translations_dir> Full path name to the translations dir.
|
||||
# <catalog_name> Translation catalog to be loaded.
|
||||
|
||||
function(qt5_translation_loader source_files translations_dir catalog_name)
|
||||
configure_file(
|
||||
${UKUI_CMAKE_MODULES_DIR}/Qt5TranslationLoader.cpp.in
|
||||
Qt5TranslationLoader.cpp @ONLY
|
||||
)
|
||||
set(${source_files} ${${source_files}} ${CMAKE_CURRENT_BINARY_DIR}/Qt5TranslationLoader.cpp PARENT_SCOPE)
|
||||
endfunction()
|
|
@ -0,0 +1,34 @@
|
|||
/* This file has been generated by the CMake qt_translation_loader().
|
||||
* It loads Qt application translations.
|
||||
*
|
||||
* Attention: All changes will be overwritten!!!
|
||||
*/
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QLocale>
|
||||
#include <QLatin1String>
|
||||
#include <QTranslator>
|
||||
#include <QLibraryInfo>
|
||||
|
||||
static void loadQtTranslation()
|
||||
{
|
||||
QString locale = QLocale::system().name();
|
||||
QTranslator *qtTranslator = new QTranslator(qApp);
|
||||
|
||||
if (qtTranslator->load(QLatin1String("qt_") + locale, QLibraryInfo::location(QLibraryInfo::TranslationsPath))) {
|
||||
qApp->installTranslator(qtTranslator);
|
||||
} else {
|
||||
delete qtTranslator;
|
||||
}
|
||||
|
||||
QTranslator *appTranslator = new QTranslator(qApp);
|
||||
if (appTranslator->load(QString::fromLocal8Bit("@translations_dir@/@catalog_name@_%1.qm").arg(locale))) {
|
||||
QCoreApplication::installTranslator(appTranslator);
|
||||
} else if (locale == QLatin1String("C") ||
|
||||
locale.startsWith(QLatin1String("en"))) {
|
||||
// English is the default. It's translated anyway.
|
||||
delete appTranslator;
|
||||
}
|
||||
}
|
||||
|
||||
Q_COREAPP_STARTUP_FUNCTION(loadQtTranslation)
|
|
@ -0,0 +1,15 @@
|
|||
/* This file has been generated by the CMake ukui_app_translation_loader().
|
||||
* It loads UKUi application translations.
|
||||
*
|
||||
* Attention: All changes will be overwritten!!!
|
||||
*/
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include "../panel/common/ukuitranslator.h"
|
||||
|
||||
static void loadAppTranslation()
|
||||
{
|
||||
UKUi::Translator::translateApplication(QStringLiteral("@catalog_name@"));
|
||||
}
|
||||
|
||||
Q_COREAPP_STARTUP_FUNCTION(loadAppTranslation)
|
|
@ -0,0 +1,183 @@
|
|||
#=============================================================================
|
||||
# Copyright 2015 Luís Pereira <luis.artur.pereira@gmail.com>
|
||||
# Copyright 2015 Palo Kisa <palo.kisa@gmail.com>
|
||||
# Copyright 2013 Hong Jen Yee (PCMan) <pcman.tw@gmail.com>
|
||||
# Copyright (c) 2019 Tianjin KYLIN Information Technology Co., Ltd. *
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. The name of the author may not be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
|
||||
#=============================================================================
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Build with release mode by default (turn on compiler optimizations)
|
||||
#-----------------------------------------------------------------------------
|
||||
if (NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE Release)
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Honor visibility properties for all target types.
|
||||
#
|
||||
# The ``<LANG>_VISIBILITY_PRESET`` and
|
||||
# ``VISIBILITY_INLINES_HIDDEN`` target properties affect visibility
|
||||
# of symbols during dynamic linking. When first introduced these properties
|
||||
# affected compilation of sources only in shared libraries, module libraries,
|
||||
# and executables with the ``ENABLE_EXPORTS`` property set. This
|
||||
# was sufficient for the basic use cases of shared libraries and executables
|
||||
# with plugins. However, some sources may be compiled as part of static
|
||||
# libraries or object libraries and then linked into a shared library later.
|
||||
# CMake 3.3 and above prefer to honor these properties for sources compiled
|
||||
# in all target types. This policy preserves compatibility for projects
|
||||
# expecting the properties to work only for some target types.
|
||||
#
|
||||
# The ``OLD`` behavior for this policy is to ignore the visibility properties
|
||||
# for static libraries, object libraries, and executables without exports.
|
||||
# The ``NEW`` behavior for this policy is to honor the visibility properties
|
||||
# for all target types.
|
||||
#
|
||||
# This policy was introduced in CMake version 3.3. CMake version
|
||||
# 3.3.0 warns when the policy is not set and uses ``OLD`` behavior. Use
|
||||
# the ``cmake_policy()`` command to set it to ``OLD`` or ``NEW``
|
||||
# explicitly.
|
||||
#-----------------------------------------------------------------------------
|
||||
if(COMMAND CMAKE_POLICY)
|
||||
if (POLICY CMP0063)
|
||||
cmake_policy(SET CMP0063 NEW)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include(CheckCXXCompilerFlag)
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Global definitions
|
||||
#-----------------------------------------------------------------------------
|
||||
add_definitions(
|
||||
-DQT_USE_QSTRINGBUILDER
|
||||
-DQT_NO_FOREACH
|
||||
)
|
||||
|
||||
if (CMAKE_BUILD_TYPE MATCHES "Debug")
|
||||
add_definitions(-DQT_STRICT_ITERATORS)
|
||||
endif()
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Detect Clang compiler
|
||||
#-----------------------------------------------------------------------------
|
||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
set(UKUI_COMPILER_IS_CLANGCXX 1)
|
||||
endif()
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Set visibility to hidden to hide symbols, unless they're exported manually
|
||||
# in the code
|
||||
#-----------------------------------------------------------------------------
|
||||
set(CMAKE_C_VISIBILITY_PRESET hidden)
|
||||
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
|
||||
set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Disable exceptions
|
||||
#-----------------------------------------------------------------------------
|
||||
if (CMAKE_COMPILER_IS_GNUCXX OR UKUI_COMPILER_IS_CLANGCXX)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions")
|
||||
endif()
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Common warning flags
|
||||
#-----------------------------------------------------------------------------
|
||||
set(__UKUI_COMMON_WARNING_FLAGS "-Wall -Wextra -Wchar-subscripts -Wno-long-long -Wpointer-arith -Wundef -Wformat-security")
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Warning flags
|
||||
#-----------------------------------------------------------------------------
|
||||
if (CMAKE_COMPILER_IS_GNUCXX OR UKUI_COMPILER_IS_CLANGCXX)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${__UKUI_COMMON_WARNING_FLAGS} -Wnon-virtual-dtor -Woverloaded-virtual -Wpedantic")
|
||||
endif()
|
||||
|
||||
if (UKUI_COMPILER_IS_CLANGCXX)
|
||||
# qCDebug(), qCWarning, etc trigger a very verbose warning, about.... nothing. Disable it.
|
||||
# Found when building ukui-session.
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-gnu-zero-variadic-macro-arguments")
|
||||
endif()
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Linker flags
|
||||
# Do not allow undefined symbols
|
||||
#-----------------------------------------------------------------------------
|
||||
if (CMAKE_COMPILER_IS_GNUCXX OR UKUI_COMPILER_IS_CLANGCXX)
|
||||
# -Bsymbolic-functions: replace dynamic symbols used internally in
|
||||
# shared libs with direct addresses.
|
||||
set(SYMBOLIC_FLAGS
|
||||
"-Wl,-Bsymbolic-functions -Wl,-Bsymbolic"
|
||||
)
|
||||
set(CMAKE_SHARED_LINKER_FLAGS
|
||||
"-Wl,--no-undefined ${SYMBOLIC_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS}"
|
||||
)
|
||||
set(CMAKE_MODULE_LINKER_FLAGS
|
||||
"-Wl,--no-undefined ${SYMBOLIC_FLAGS} ${CMAKE_MODULE_LINKER_FLAGS}"
|
||||
)
|
||||
set(CMAKE_EXE_LINKER_FLAGS
|
||||
"${SYMBOLIC_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}"
|
||||
)
|
||||
|
||||
endif()
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# CXX14 requirements - no checks, we just set it
|
||||
#-----------------------------------------------------------------------------
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
||||
set(CMAKE_CXX_STANDARD 14 CACHE STRING "C++ ISO Standard")
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Enable colored diagnostics for the CLang/Ninja combination
|
||||
#-----------------------------------------------------------------------------
|
||||
if (CMAKE_GENERATOR STREQUAL "Ninja" AND
|
||||
# Rationale: https://public.kitware.com/Bug/view.php?id=15502
|
||||
((CMAKE_COMPILER_IS_GNUCXX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9) OR
|
||||
(UKUI_COMPILER_IS_CLANGCXX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.5)))
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-color=always")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=always")
|
||||
endif()
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Enable exceptions for an target
|
||||
#
|
||||
# ukui_enable_target_exceptions(<target>
|
||||
# <INTERFACE|PUBLIC|PRIVATE>
|
||||
# )
|
||||
#
|
||||
#-----------------------------------------------------------------------------
|
||||
function(ukui_enable_target_exceptions target mode)
|
||||
target_compile_options(${target} ${mode}
|
||||
"$<$<OR:$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:Clang>>:-fexceptions>"
|
||||
)
|
||||
endfunction()
|
|
@ -0,0 +1,34 @@
|
|||
# The module defines the following variables
|
||||
#
|
||||
# UKUI_SHARE_DIR - This allows to install and read the configs from non-standard locations
|
||||
#
|
||||
# UKUI_TRANSLATIONS_DIR - The default translations directory
|
||||
#
|
||||
# UKUI_ETC_XDG_DIR - XDG standards expects system-wide configuration files in the
|
||||
# /etc/xdg/ukui location. Unfortunately QSettings we are using internally
|
||||
# can be overriden in the Qt compilation time to use different path for
|
||||
# system-wide configs. (for example configure ... -sysconfdir /etc/settings ...)
|
||||
# This path can be found calling Qt's qmake:
|
||||
# qmake -query QT_INSTALL_CONFIGURATION
|
||||
#
|
||||
# UKUI_DATA_DIR - UKUi base directory relative to which data files should
|
||||
# be searched.Defaults to CMAKE_INSTALL_FULL_DATADIR. It's
|
||||
# added to XDG_DATA_DIRS by the startukui script.
|
||||
|
||||
|
||||
set(UKUI_LIBRARY_NAME "ukui")
|
||||
set(UKUI_RELATIVE_SHARE_DIR "ukui")
|
||||
set(UKUI_SHARE_DIR "/usr/share/ukui")
|
||||
set(UKUI_RELATIVE_TRANSLATIONS_DIR "ukui/translations")
|
||||
set(UKUI_TRANSLATIONS_DIR "/usr/share/ukui/translations")
|
||||
set(UKUI_GRAPHICS_DIR "/usr/share/ukui/graphics")
|
||||
set(UKUI_ETC_XDG_DIR "/etc/xdg")
|
||||
set(UKUI_DATA_DIR "/usr/share")
|
||||
|
||||
add_definitions("-DUKUI_RELATIVE_SHARE_DIR=\"${UKUI_RELATIVE_SHARE_DIR}\"")
|
||||
add_definitions("-DUKUI_SHARE_DIR=\"${UKUI_SHARE_DIR}\"")
|
||||
add_definitions("-DUKUI_RELATIVE_SHARE_TRANSLATIONS_DIR=\"${UKUI_RELATIVE_TRANSLATIONS_DIR}\"")
|
||||
add_definitions("-DUKUI_SHARE_TRANSLATIONS_DIR=\"${UKUI_TRANSLATIONS_DIR}\"")
|
||||
add_definitions("-DUKUI_GRAPHICS_DIR=\"${UKUI_GRAPHICS_DIR}\"")
|
||||
add_definitions("-DUKUI_ETC_XDG_DIR=\"${UKUI_ETC_XDG_DIR}\"")
|
||||
add_definitions("-DUKUI_DATA_DIR=\"${UKUI_DATA_DIR}\"")
|
|
@ -0,0 +1,252 @@
|
|||
#=============================================================================
|
||||
# Copyright 2015 Luís Pereira <luis.artur.pereira@gmail.com>
|
||||
# Copyright (c) 2019 Tianjin KYLIN Information Technology Co., Ltd. *
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. The name of the author may not be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
|
||||
#=============================================================================#
|
||||
|
||||
# ukui_create_pkgconfig_file(PACKAGE_NAME <package_name>
|
||||
# VERSION <version>
|
||||
# [PREFIX <path>]
|
||||
# [EXEC_PREFIX <path>]
|
||||
# [INCLUDEDIR_PREFIX <path>]
|
||||
# [INCLUDEDIRS <path1> <path2> ... <path3>]
|
||||
# [LIBDIR_PREFIX <path>]
|
||||
# [DESCRIPTIVE_NAME <name>]
|
||||
# [DESCRIPTION <description>]
|
||||
# [URL <url>]
|
||||
# [REQUIRES <dep1> <dep2> ... <dep3>]
|
||||
# [REQUIRES_PRIVATE <dep1> <dep2> ... <dep3>]
|
||||
# [LIB_INSTALLDIR <dir>]
|
||||
# [CFLAGS <cflags>]
|
||||
# [PATH <path>]
|
||||
# [INSTALL]
|
||||
# [COMPONENT] component)
|
||||
#
|
||||
#
|
||||
# PACKAGE_NAME and VERSION are mandatory. Everything else is optional
|
||||
|
||||
include(CMakeParseArguments)
|
||||
include(GNUInstallDirs)
|
||||
|
||||
function(ukui_create_pkgconfig_file)
|
||||
set(options INSTALL)
|
||||
set(oneValueArgs
|
||||
PACKAGE_NAME
|
||||
PREFIX
|
||||
EXEC_PREFIX
|
||||
INCLUDEDIR_PREFIX
|
||||
LIBDIR_PREFIX
|
||||
DESCRIPTIVE_NAME
|
||||
DESCRIPTION
|
||||
URL
|
||||
VERSION
|
||||
PATH
|
||||
COMPONENT
|
||||
)
|
||||
set(multiValueArgs
|
||||
INCLUDEDIRS
|
||||
REQUIRES
|
||||
REQUIRES_PRIVATE
|
||||
CONFLICTS
|
||||
CFLAGS
|
||||
LIBS
|
||||
LIBS_PRIVATE
|
||||
)
|
||||
|
||||
cmake_parse_arguments(USER "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||
|
||||
if (USER_UNPARSED_ARGUMENTS)
|
||||
message(FATAL_ERROR "Unknown keywords given to create_pkgconfig_file(): \"${USER_UNPARSED_ARGUMENTS}\"")
|
||||
endif()
|
||||
|
||||
# Check for mandatory args. Abort if not set
|
||||
if (NOT DEFINED USER_PACKAGE_NAME)
|
||||
message(FATAL_ERROR "Required argument PACKAGE_NAME missing in generate_pkgconfig_file() call")
|
||||
else()
|
||||
set(_PKGCONFIG_PACKAGE_NAME "${USER_PACKAGE_NAME}")
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED USER_VERSION)
|
||||
message(FATAL_ERROR "Required argument VERSION missing in generate_pkgconfig_file() call")
|
||||
else()
|
||||
set(_PKGCONFIG_VERSION "${USER_VERSION}")
|
||||
endif()
|
||||
|
||||
|
||||
# Optional args
|
||||
if (NOT DEFINED USER_PREFIX)
|
||||
set(_PKGCONFIG_PREFIX "${CMAKE_INSTALL_PREFIX}")
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED USER_EXEC_PREFIX)
|
||||
set(_PKGCONFIG_EXEC_PREFIX "\${prefix}")
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED USER_INCLUDEDIR_PREFIX)
|
||||
set(_PKGCONFIG_INCLUDEDIR_PREFIX "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED USER_LIBDIR_PREFIX)
|
||||
set(_PKGCONFIG_LIBDIR_PREFIX "\${prefix}/${CMAKE_INSTALL_LIBDIR}")
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED USER_DESCRIPTIVE_NAME)
|
||||
set(_PKGCONFIG_DESCRIPTIVE_NAME "")
|
||||
else()
|
||||
set(_PKGCONFIG_DESCRIPTIVE_NAME "${USER_DESCRIPTIVE_NAME}")
|
||||
endif()
|
||||
|
||||
if (DEFINED USER_INCLUDEDIRS)
|
||||
set(tmp "")
|
||||
foreach(dir ${USER_INCLUDEDIRS})
|
||||
if (NOT IS_ABSOLUTE "${dir}")
|
||||
list(APPEND tmp "-I\${includedir}/${dir}")
|
||||
endif()
|
||||
endforeach()
|
||||
string(REPLACE ";" " " _INCLUDEDIRS "${tmp}")
|
||||
endif()
|
||||
|
||||
if (DEFINED USER_REQUIRES)
|
||||
string(REPLACE ";" ", " _PKGCONFIG_REQUIRES "${USER_REQUIRES}")
|
||||
endif()
|
||||
|
||||
if (DEFINED USER_REQUIRES_PRIVATE)
|
||||
string(REPLACE ";" ", " _PKGCONFIG_REQUIRES_PRIVATE "${USER_REQUIRES_PRIVATE}")
|
||||
else()
|
||||
set(_PKGCONFIG_REQUIRES_PRIVATE "")
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED USER_CFLAGS)
|
||||
set(_PKGCONFIG_CFLAGS "-I\${includedir} ${_INCLUDEDIRS}")
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED USER_LIBS)
|
||||
set(_PKGCONFIG_LIBS "-L\${libdir}")
|
||||
else()
|
||||
set(tmp "-L\${libdir}")
|
||||
set(_libs "${USER_LIBS}")
|
||||
foreach(lib ${_libs})
|
||||
list(APPEND tmp "-l${lib}")
|
||||
endforeach()
|
||||
string(REPLACE ";" " " _PKGCONFIG_LIBS "${tmp}")
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED USER_LIBS_PRIVATE)
|
||||
set(PKGCONFIG_LIBS "-L\${libdir}")
|
||||
else()
|
||||
set(tmp "")
|
||||
set(_libs "${USER_LIBS_PRIVATE}")
|
||||
foreach(lib ${_libs})
|
||||
list(APPEND tmp "-l${lib}")
|
||||
endforeach()
|
||||
string(REPLACE ";" " " _PKGCONFIG_LIBS_PRIVATE "${tmp}")
|
||||
endif()
|
||||
|
||||
if (DEFINED USER_DESCRIPTION)
|
||||
set(_PKGCONFIG_DESCRIPTION "${USER_DESCRIPTION}")
|
||||
else()
|
||||
set(_PKGCONFIG_DESCRIPTION "")
|
||||
endif()
|
||||
|
||||
if (DEFINED USER_URL)
|
||||
set(_PKFCONFIG_URL "${USER_URL}")
|
||||
else()
|
||||
set(_PKGCONFIG_URL "")
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED USER_PATH)
|
||||
set(_PKGCONFIG_FILE "${PROJECT_BINARY_DIR}/${_PKGCONFIG_PACKAGE_NAME}.pc")
|
||||
else()
|
||||
if (IS_ABSOLUTE "${USER_PATH}")
|
||||
set(_PKGCONFIG_FILE "${USER_PATH}/${_PKGCONFIG_PACKAGE_NAME}.pc")
|
||||
else()
|
||||
set(_PKGCONFIG_FILE "${PROJECT_BINARY_DIR}/${USER_PATH}/${_PKGCONFIG_PACKAGE_NAME}.pc")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Write the .pc file
|
||||
FILE(WRITE "${_PKGCONFIG_FILE}"
|
||||
"# file generated by create_pkgconfig_file()\n"
|
||||
"prefix=${_PKGCONFIG_PREFIX}\n"
|
||||
"exec_prefix=${_PKGCONFIG_EXEC_PREFIX}\n"
|
||||
"libdir=${_PKGCONFIG_LIBDIR_PREFIX}\n"
|
||||
"includedir=${_PKGCONFIG_INCLUDEDIR_PREFIX}\n"
|
||||
"\n"
|
||||
"Name: ${_PKGCONFIG_DESCRIPTIVE_NAME}\n"
|
||||
)
|
||||
|
||||
if (NOT "${_PKGCONFIG_DESCRIPTION}" STREQUAL "")
|
||||
FILE(APPEND ${_PKGCONFIG_FILE}
|
||||
"Description: ${_PKGCONFIG_DESCRIPTION}\n"
|
||||
)
|
||||
endif()
|
||||
|
||||
if (NOT "${_PKGCONFIG_URL}" STREQUAL "")
|
||||
FILE(APPEND ${_PKGCONFIG_FILE} "URL: ${_PKGCONFIG_URL}\n")
|
||||
endif()
|
||||
|
||||
FILE(APPEND ${_PKGCONFIG_FILE} "Version: ${_PKGCONFIG_VERSION}\n")
|
||||
|
||||
if (NOT "${_PKGCONFIG_REQUIRES}" STREQUAL "")
|
||||
FILE(APPEND ${_PKGCONFIG_FILE} "Requires: ${_PKGCONFIG_REQUIRES}\n")
|
||||
endif()
|
||||
|
||||
if (NOT "${_PKGCONFIG_REQUIRES_PRIVATE}" STREQUAL "")
|
||||
FILE(APPEND ${_PKGCONFIG_FILE}
|
||||
"Requires.private: ${_PKGCONFIG_REQUIRES_PRIVATE}\n"
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
FILE(APPEND ${_PKGCONFIG_FILE}
|
||||
"Cflags: ${_PKGCONFIG_CFLAGS}\n"
|
||||
"Libs: ${_PKGCONFIG_LIBS}\n"
|
||||
)
|
||||
|
||||
if (NOT "${_PKGCONFIG_LIBS_PRIVATE}" STREQUAL "")
|
||||
FILE(APPEND ${_PKGCONFIG_FILE}
|
||||
"Libs.private: ${_PKGCONFIG_REQUIRES_PRIVATE}\n"
|
||||
)
|
||||
endif()
|
||||
|
||||
if (DEFINED USER_INSTALL)
|
||||
# FreeBSD loves to install files to different locations
|
||||
# https://www.freebsd.org/doc/handbook/dirstructure.html
|
||||
if(${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
|
||||
set(_PKGCONFIG_INSTALL_DESTINATION "libdata/pkgconfig")
|
||||
else()
|
||||
set(_PKGCONFIG_INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
|
||||
endif()
|
||||
|
||||
if (DEFINED USER_COMPONENT)
|
||||
set(_COMPONENT "${USER_COMPONENT}")
|
||||
else()
|
||||
set(_COMPONENT "Devel")
|
||||
endif()
|
||||
|
||||
install(FILES "${_PKGCONFIG_FILE}"
|
||||
DESTINATION "${_PKGCONFIG_INSTALL_DESTINATION}"
|
||||
COMPONENT "${_COMPONENT}")
|
||||
endif()
|
||||
endfunction()
|
|
@ -0,0 +1,111 @@
|
|||
#=============================================================================
|
||||
# Copyright 2015 Luís Pereira <luis.artur.pereira@gmail.com>
|
||||
# Copyright (c) 2019 Tianjin KYLIN Information Technology Co., Ltd. *
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. The name of the author may not be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
|
||||
#=============================================================================
|
||||
|
||||
# ukui_create_portable_headers(<portable_headers>
|
||||
# HEADER_NAMES <CamelCaseName> [<CamelCaseName1> [...]]
|
||||
# [OUTPUT_DIR <output_dir>]
|
||||
# )
|
||||
#
|
||||
# Creates portable headers; e.g.:
|
||||
# Creates XdgAction from xdgaction.h
|
||||
# XdgAction contents:
|
||||
# #include "xdgaction.h"
|
||||
#
|
||||
# Output:
|
||||
# portable_headers File locations of the created headers
|
||||
#
|
||||
# Input:
|
||||
# HEADER_NAMES Header CamelCaseNames. An CamelCaseName header will be created
|
||||
# that includes camelcasename.h file
|
||||
#
|
||||
# OUTPUT_DIR Specifies where the files will be created. Defaults to
|
||||
# ``${CMAKE_CURRENT_BINARY_DIR}``. If the value is an relative path, it
|
||||
# will be appended to ``${CMAKE_CURRENT_BINARY_DIR}``.
|
||||
#
|
||||
# Use:
|
||||
# set(PUBLIC_CLASSES MyClass YourClass)
|
||||
# ukui_create_portable_headers(PORTABLE_HEADERS ${PUBLIC_CLASSES})
|
||||
# PORTABLE_HEADER is an return value that contains the full name of the
|
||||
# generated headers.
|
||||
|
||||
function(ukui_create_portable_headers outfiles)
|
||||
set(options)
|
||||
set(oneValueArgs OUTPUT_DIR PATH_PREFIX NAME_PREFIX)
|
||||
set(multiValueArgs HEADER_NAMES)
|
||||
|
||||
cmake_parse_arguments(USER "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||
|
||||
if (USER_UNPARSED_ARGUMENTS)
|
||||
message(FATAL_ERROR "Unknown keywords given to ukui_create_portable_headers(): \"${USER_UNPARSED_ARGUMENTS}\"")
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED USER_HEADER_NAMES)
|
||||
message(FATAL_ERROR "Required argument HEADER_NAMES missing in ukui_create_portable_headers() call")
|
||||
else()
|
||||
set(_HEADER_NAMES "${USER_HEADER_NAMES}")
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED USER_OUTPUT_DIR)
|
||||
set(_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
else()
|
||||
if (IS_ABSOLUTE "${USER_OUTPUT_DIR}")
|
||||
set(_OUTPUT_DIR "${USER_OUTPUT_DIR}")
|
||||
else()
|
||||
set(_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/${USER_OUTPUT_DIR}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED USER_PATH_PREFIX)
|
||||
set(_PATH_PREFIX "")
|
||||
else()
|
||||
set(_PATH_PREFIX "${USER_PATH_PREFIX}")
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED USER_NAME_PREFIX)
|
||||
set(_NAME_PREFIX "")
|
||||
else()
|
||||
set(_NAME_PREFIX "${USER_NAME_PREFIX}")
|
||||
endif()
|
||||
|
||||
|
||||
set(class_list ${_HEADER_NAMES})
|
||||
foreach(f ${class_list})
|
||||
string(TOLOWER "${f}.h" _filename)
|
||||
if ("${_PATH_PREFIX}" STREQUAL "")
|
||||
file(WRITE "${_OUTPUT_DIR}/${f}"
|
||||
"#include \"${_NAME_PREFIX}${_filename}\"")
|
||||
else()
|
||||
file(WRITE "${_OUTPUT_DIR}/${f}"
|
||||
"#include \"${_PATH_PREFIX}${_NAME_PREFIX}/${_filename}\"")
|
||||
endif()
|
||||
|
||||
list(APPEND ${outfiles} "${_OUTPUT_DIR}/${f}")
|
||||
endforeach()
|
||||
|
||||
set(${outfiles} ${${outfiles}} PARENT_SCOPE)
|
||||
endfunction()
|
|
@ -0,0 +1,15 @@
|
|||
/* This file has been generated by the CMake ukui_app_translation_loader().
|
||||
* It loads UKUi libraries translations.
|
||||
*
|
||||
* Attention: All changes will be overwritten!!!
|
||||
*/
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <UKUi/Translator>
|
||||
|
||||
static void loadLibTranslation()
|
||||
{
|
||||
UKUi::Translator::translateLibrary(QStringLiteral("@catalog_name@"));
|
||||
}
|
||||
|
||||
Q_COREAPP_STARTUP_FUNCTION(loadLibTranslation)
|
|
@ -0,0 +1,25 @@
|
|||
/* This file has been generated by the CMake ukui_plugin_translation_loader().
|
||||
* It loads UKUi plugin translations.
|
||||
*
|
||||
* Attention: All changes will be overwritten!!!
|
||||
*/
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QLatin1String>
|
||||
|
||||
#include "../panel/common/ukuitranslator.h"
|
||||
|
||||
/* Dummy helper symbol for referencing.
|
||||
* In case plugin is linked as static (lib*.a) unreferenced objects are stripped in linking time
|
||||
* => we need to reference some symbol from this file to be not stripped as a whole.
|
||||
*/
|
||||
void * loadPluginTranslation_@catalog_name@_helper = nullptr;
|
||||
|
||||
static void loadPluginTranslation()
|
||||
{
|
||||
//XXX: we don't use the QStringLiteral here because it causes SEGFAULT in static finalization time
|
||||
// (the string is stored in static QHash and it's destructor can reference already deleted static QString (generated by QStringLiteral))
|
||||
UKUi::Translator::translatePlugin(QLatin1String("@catalog_name@"), QLatin1String("@plugin_type@"));
|
||||
}
|
||||
|
||||
Q_COREAPP_STARTUP_FUNCTION(loadPluginTranslation)
|
|
@ -0,0 +1,66 @@
|
|||
#=============================================================================
|
||||
# Copyright (c) 2018 Luís Pereira <luis.artur.pereira@gmail.com>
|
||||
# Copyright (c) 2019 Tianjin KYLIN Information Technology Co., Ltd. *
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. The name of the author may not be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
|
||||
#=============================================================================
|
||||
|
||||
function(ukui_prevent_in_source_builds)
|
||||
|
||||
# Handle smarties with symlinks
|
||||
get_filename_component(srcdir "${CMAKE_SOURCE_DIR}" REALPATH)
|
||||
get_filename_component(bindir "${CMAKE_BINARY_DIR}" REALPATH)
|
||||
|
||||
if("${srcdir}" STREQUAL "${bindir}")
|
||||
# We are in a in source build
|
||||
message("##############################################################")
|
||||
message("# In Source Build detected.")
|
||||
message("# UKUi does not support in source builds.")
|
||||
message("# Out of source build is required.")
|
||||
message("#")
|
||||
message("# The general approach to out of source builds is:")
|
||||
message("# mkdir build")
|
||||
message("# cd build")
|
||||
message("# cmake <path to sources>")
|
||||
message("# make")
|
||||
message("#")
|
||||
message("# An in source build was attemped. Some files were created.")
|
||||
message("# Use 'git status' to check them. Remove them with:")
|
||||
message("# cd <path to sources>")
|
||||
message("#")
|
||||
message("# # Don’t actually remove anything, just show what would be done")
|
||||
message("# git clean -n -d")
|
||||
message("#")
|
||||
message("# # Actually remove the files")
|
||||
message("# git clean -f -d")
|
||||
message("#")
|
||||
message("# checkout files out of the index")
|
||||
message("# git checkout --")
|
||||
message("##############################################################")
|
||||
|
||||
message(FATAL_ERROR "Aborting configuration")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
ukui_prevent_in_source_builds()
|
|
@ -0,0 +1,32 @@
|
|||
#=============================================================================
|
||||
# Copyright 2014 Luís Pereira <luis.artur.pereira@gmail.com>
|
||||
# Copyright (c) 2019 Tianjin KYLIN Information Technology Co., Ltd. *
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. The name of the author may not be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
|
||||
#=============================================================================
|
||||
#
|
||||
# An convenience module that loads all the UKUi translations modules at once.
|
||||
|
||||
include(/usr/share/cmake/ukui-build-tools/modules/UKUiTranslateTs.cmake)
|
||||
include(/usr/share/cmake/ukui-build-tools/modules/UKUiTranslateDesktop.cmake)
|
||||
include(/usr/share/cmake/ukui-build-tools/modules/UKUiTranslationLoader.cmake)
|
|
@ -0,0 +1,107 @@
|
|||
#=============================================================================
|
||||
# The ukui_translate_desktop() function was copied from the
|
||||
# UKUi UKUiTranslate.cmake
|
||||
#
|
||||
# Original Author: Alexander Sokolov <sokoloff.a@gmail.com>
|
||||
#
|
||||
# funtion ukui_translate_desktop(_RESULT
|
||||
# SOURCES <sources>
|
||||
# [TRANSLATION_DIR] translation_directory
|
||||
# )
|
||||
# Output:
|
||||
# _RESULT The generated .desktop (.desktop) files
|
||||
#
|
||||
# Input:
|
||||
#
|
||||
# SOURCES List of input desktop files (.destktop.in) to be translated
|
||||
# (merged), relative to the CMakeList.txt.
|
||||
#
|
||||
# TRANSLATION_DIR Optional path to the directory with the .ts files,
|
||||
# relative to the CMakeList.txt. Defaults to
|
||||
# "translations".
|
||||
#
|
||||
#=============================================================================
|
||||
|
||||
function(ukui_translate_desktop _RESULT)
|
||||
# Parse arguments ***************************************
|
||||
set(oneValueArgs TRANSLATION_DIR)
|
||||
set(multiValueArgs SOURCES)
|
||||
|
||||
cmake_parse_arguments(_ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||
|
||||
# check for unknown arguments
|
||||
set(_UNPARSED_ARGS ${_ARGS_UNPARSED_ARGUMENTS})
|
||||
if (NOT ${_UNPARSED_ARGS} STREQUAL "")
|
||||
MESSAGE(FATAL_ERROR
|
||||
"Unknown arguments '${_UNPARSED_ARGS}'.\n"
|
||||
"See ukui_translate_desktop() documentation for more information.\n"
|
||||
)
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED _ARGS_SOURCES)
|
||||
set(${_RESULT} "" PARENT_SCOPE)
|
||||
return()
|
||||
else()
|
||||
set(_sources ${_ARGS_SOURCES})
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED _ARGS_TRANSLATION_DIR)
|
||||
set(_translationDir "translations")
|
||||
else()
|
||||
set(_translationDir ${_ARGS_TRANSLATION_DIR})
|
||||
endif()
|
||||
|
||||
|
||||
get_filename_component (_translationDir ${_translationDir} ABSOLUTE)
|
||||
|
||||
foreach (_inFile ${_sources})
|
||||
get_filename_component(_inFile ${_inFile} ABSOLUTE)
|
||||
get_filename_component(_fileName ${_inFile} NAME_WE)
|
||||
#Extract the real extension ............
|
||||
get_filename_component(_fileExt ${_inFile} EXT)
|
||||
string(REPLACE ".in" "" _fileExt ${_fileExt})
|
||||
#.......................................
|
||||
set(_outFile "${CMAKE_CURRENT_BINARY_DIR}/${_fileName}${_fileExt}")
|
||||
|
||||
file(GLOB _translations
|
||||
${_translationDir}/${_fileName}_*${_fileExt}
|
||||
)
|
||||
|
||||
set(_pattern "'\\[.*]\\s*='")
|
||||
if (_translations)
|
||||
list(SORT _translations)
|
||||
add_custom_command(OUTPUT ${_outFile}
|
||||
COMMAND grep -v -a "'#TRANSLATIONS_DIR='" ${_inFile} > ${_outFile}
|
||||
COMMAND grep -h -a ${_pattern} ${_translations} >> ${_outFile}
|
||||
COMMENT "Generating ${_fileName}${_fileExt}"
|
||||
)
|
||||
else()
|
||||
add_custom_command(OUTPUT ${_outFile}
|
||||
COMMAND grep -v -a "'#TRANSLATIONS_DIR='" ${_inFile} > ${_outFile}
|
||||
COMMENT "Generating ${_fileName}${_fileExt}"
|
||||
)
|
||||
endif()
|
||||
|
||||
set(__result ${__result} ${_outFile})
|
||||
|
||||
|
||||
# TX file ***********************************************
|
||||
set(_txFile "${CMAKE_BINARY_DIR}/tx/${_fileName}${_fileExt}.tx.sh")
|
||||
string(REPLACE "${CMAKE_SOURCE_DIR}/" "" _tx_translationDir ${_translationDir})
|
||||
string(REPLACE "${CMAKE_SOURCE_DIR}/" "" _tx_inFile ${_inFile})
|
||||
string(REPLACE "." "" _fileType ${_fileExt})
|
||||
|
||||
file(WRITE ${_txFile}
|
||||
"[ -f ${_inFile} ] || exit 0\n"
|
||||
"echo '[ukui.${_fileName}_${_fileType}]'\n"
|
||||
"echo 'type = DESKTOP'\n"
|
||||
"echo 'source_lang = en'\n"
|
||||
"echo 'source_file = ${_tx_inFile}'\n"
|
||||
"echo 'file_filter = ${_tx_translationDir}/${_fileName}_<lang>${_fileExt}'\n"
|
||||
"echo ''\n"
|
||||
)
|
||||
|
||||
endforeach()
|
||||
|
||||
set(${_RESULT} ${__result} PARENT_SCOPE)
|
||||
endfunction(ukui_translate_desktop)
|
|
@ -0,0 +1,157 @@
|
|||
#=============================================================================
|
||||
# Copyright 2014 Luís Pereira <luis.artur.pereira@gmail.com>
|
||||
# Copyright (c) 2019 Tianjin KYLIN Information Technology Co., Ltd. *
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. The name of the author may not be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
|
||||
#=============================================================================
|
||||
#
|
||||
# funtion ukui_translate_ts(qmFiles
|
||||
# [USE_QT5 [Yes | No]]
|
||||
# [UPDATE_TRANSLATIONS [Yes | No]]
|
||||
# SOURCES <sources>
|
||||
# [UPDATE_OPTIONS] update_options
|
||||
# [TEMPLATE] translation_template
|
||||
# [TRANSLATION_DIR] translation_directory
|
||||
# [INSTALL_DIR] install_directory
|
||||
# [COMPONENT] component
|
||||
# )
|
||||
# Output:
|
||||
# qmFiles The generated compiled translations (.qm) files
|
||||
#
|
||||
# Input:
|
||||
# USE_QT5 Optional flag to choose between Qt4 and Qt5. Defaults to Qt5
|
||||
#
|
||||
# UPDATE_TRANSLATIONS Optional flag. Setting it to Yes, extracts and
|
||||
# compiles the translations. Setting it No, only
|
||||
# compiles them.
|
||||
#
|
||||
# UPDATE_OPTIONS Optional options to lupdate when UPDATE_TRANSLATIONS
|
||||
# is True.
|
||||
#
|
||||
# TEMPLATE Optional translations files base name. Defaults to
|
||||
# ${PROJECT_NAME}. An .ts extensions is added.
|
||||
#
|
||||
# TRANSLATION_DIR Optional path to the directory with the .ts files,
|
||||
# relative to the CMakeList.txt. Defaults to
|
||||
# "translations".
|
||||
#
|
||||
# INSTALL_DIR Optional destination of the file compiled files (qmFiles).
|
||||
# If not present no installation is performed
|
||||
#
|
||||
# COMPONENT Optional install component. Only effective if INSTALL_DIR
|
||||
# present. Defaults to "Runtime".
|
||||
#
|
||||
|
||||
# We use our patched version to round a annoying bug.
|
||||
include(Qt5PatchedLinguistToolsMacros)
|
||||
|
||||
function(ukui_translate_ts qmFiles)
|
||||
set(oneValueArgs
|
||||
USE_QT5
|
||||
UPDATE_TRANSLATIONS
|
||||
TEMPLATE
|
||||
TRANSLATION_DIR
|
||||
INSTALL_DIR
|
||||
COMPONENT
|
||||
)
|
||||
set(multiValueArgs SOURCES UPDATE_OPTIONS)
|
||||
cmake_parse_arguments(TR "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||
|
||||
if (NOT DEFINED TR_UPDATE_TRANSLATIONS)
|
||||
set(TR_UPDATE_TRANSLATIONS "No")
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED TR_UPDATE_OPTIONS)
|
||||
set(TR_UPDATE_OPTIONS "")
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED TR_USE_QT5)
|
||||
set(TR_USE_QT5 "Yes")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED TR_TEMPLATE)
|
||||
set(TR_TEMPLATE "${PROJECT_NAME}")
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED TR_TRANSLATION_DIR)
|
||||
set(TR_TRANSLATION_DIR "translations")
|
||||
endif()
|
||||
get_filename_component(TR_TRANSLATION_DIR "${TR_TRANSLATION_DIR}" ABSOLUTE)
|
||||
|
||||
if (EXISTS "${TR_TRANSLATION_DIR}")
|
||||
file(GLOB tsFiles "${TR_TRANSLATION_DIR}/${TR_TEMPLATE}_*.ts")
|
||||
set(templateFile "${TR_TRANSLATION_DIR}/${TR_TEMPLATE}.ts")
|
||||
endif ()
|
||||
|
||||
if(TR_USE_QT5)
|
||||
# Qt5
|
||||
if (TR_UPDATE_TRANSLATIONS)
|
||||
qt5_patched_create_translation(QMS
|
||||
${TR_SOURCES}
|
||||
${templateFile}
|
||||
OPTIONS ${TR_UPDATE_OPTIONS}
|
||||
)
|
||||
qt5_patched_create_translation(QM
|
||||
${TR_SOURCES}
|
||||
${tsFiles}
|
||||
OPTIONS ${TR_UPDATE_OPTIONS}
|
||||
)
|
||||
else()
|
||||
qt5_patched_add_translation(QM ${tsFiles})
|
||||
endif()
|
||||
else()
|
||||
# Qt4
|
||||
if(TR_UPDATE_TRANSLATIONS)
|
||||
qt4_create_translation(QMS
|
||||
${TR_SOURCES}
|
||||
${templateFile}
|
||||
OPTIONS ${TR_UPDATE_OPTIONS}
|
||||
)
|
||||
qt4_create_translation(QM
|
||||
${TR_SOURCES}
|
||||
${tsFiles}
|
||||
OPTIONS ${TR_UPDATE_OPTIONS}
|
||||
)
|
||||
else()
|
||||
qt4_add_translation(QM ${tsFiles})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(TR_UPDATE_TRANSLATIONS)
|
||||
add_custom_target("update_${TR_TEMPLATE}_ts" ALL DEPENDS ${QMS})
|
||||
endif()
|
||||
|
||||
if(DEFINED TR_INSTALL_DIR)
|
||||
if(NOT DEFINED TR_COMPONENT)
|
||||
set(TR_COMPONENT "Runtime")
|
||||
endif()
|
||||
|
||||
install(FILES ${QM}
|
||||
DESTINATION "${TR_INSTALL_DIR}"
|
||||
COMPONENT "${TR_COMPONENT}"
|
||||
)
|
||||
endif()
|
||||
|
||||
set(${qmFiles} ${QM} PARENT_SCOPE)
|
||||
endfunction()
|
|
@ -0,0 +1,77 @@
|
|||
#=============================================================================
|
||||
# Copyright 2014 Luís Pereira <luis.artur.pereira@gmail.com>
|
||||
# Copyright 2019 Tianjin KYLIN Information Technology Co., Ltd. *
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. The name of the author may not be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
|
||||
#=============================================================================
|
||||
#
|
||||
# These functions enables "automatic" translation loading in UKUi Qt5 apps
|
||||
# and libs. They generate a .cpp file that takes care of everything. The
|
||||
# user doesn't have to do anything in the source code.
|
||||
#
|
||||
# Typical use:
|
||||
# include(UKUiTranslationLoader)
|
||||
# ukui_app_translation_loader(ukui-app_QM_LOADER ${PROJECT_NAME})
|
||||
# add_executable(${PROJECT_NAME}
|
||||
# ${ukui-app_QM_LOADER}
|
||||
# ...
|
||||
# )
|
||||
|
||||
|
||||
# ukui_app_translation_loader(<source_files> <catalog_name>)
|
||||
# <source_files> The generated .cpp file is added to <source_files>
|
||||
# <catalog_name> Translations catalog to be loaded
|
||||
function(ukui_app_translation_loader source_files catalog_name)
|
||||
configure_file(
|
||||
#${UKUI_CMAKE_MODULES_DIR}/UKUiAppTranslationLoader.cpp.in
|
||||
../cmake/ukui-build-tools/modules/UKUiAppTranslationLoader.cpp.in
|
||||
UKUiAppTranslationLoader.cpp @ONLY
|
||||
)
|
||||
set(${source_files} ${${source_files}} ${CMAKE_CURRENT_BINARY_DIR}/UKUiAppTranslationLoader.cpp PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# ukui_lib_translation_loader(<source_files> <catalog_name>)
|
||||
# <source_files> The generated .cpp file is added to <source_files>
|
||||
# <catalog_name> Translations catalog to be loaded
|
||||
function(ukui_lib_translation_loader source_files catalog_name)
|
||||
configure_file(
|
||||
#${UKUI_CMAKE_MODULES_DIR}/UKUiLibTranslationLoader.cpp.in
|
||||
../cmake/ukui-build-tools/modules/UKUiLibTranslationLoader.cpp.in
|
||||
UKUiLibTranslationLoader.cpp @ONLY
|
||||
)
|
||||
set(${source_files} ${${source_files}} ${CMAKE_CURRENT_BINARY_DIR}/UKUiLibTranslationLoader.cpp PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# ukui_plugin_translation_loader(<source_files> <catalog_name>)
|
||||
# <source_files> The generated .cpp file is added to <source_files>
|
||||
# <catalog_name> Translations catalog to be loaded
|
||||
# <plugin_type> Plugin type. Example: ukui-panel
|
||||
function(ukui_plugin_translation_loader source_files catalog_name plugin_type)
|
||||
configure_file(
|
||||
#${UKUI_CMAKE_MODULES_DIR}/UKUiPluginTranslationLoader.cpp.in
|
||||
#/usr/share/cmake/ukui-build-tools/modules/UKUiPluginTranslationLoader.cpp.in
|
||||
../cmake/ukui-build-tools/modules/UKUiPluginTranslationLoader.cpp.in
|
||||
UKUiPluginTranslationLoader.cpp @ONLY
|
||||
)
|
||||
set(${source_files} ${${source_files}} ${CMAKE_CURRENT_BINARY_DIR}/UKUiPluginTranslationLoader.cpp PARENT_SCOPE)
|
||||
endfunction()
|
|
@ -0,0 +1,43 @@
|
|||
# UDEV_FOUND - system has UDev
|
||||
# UDEV_INCLUDE_DIR - the libudev include directory
|
||||
# UDEV_LIBS - The libudev libraries
|
||||
|
||||
# Copyright (c) 2010, Rafael Fernández López, <ereslibre@kde.org>
|
||||
# Copyright (c) 2016, Luís Pereira, <luis.artur.pereira@gmail.com>
|
||||
# Copyright (c) 2019 Tianjin KYLIN Information Technology Co., Ltd. *
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the University 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 REGENTS 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 REGENTS 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.
|
||||
|
||||
|
||||
set(PACKAGE_VERSION "0.6.0")
|
||||
|
||||
if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
|
||||
set(PACKAGE_VERSION_COMPATIBLE FALSE)
|
||||
else()
|
||||
set(PACKAGE_VERSION_COMPATIBLE TRUE)
|
||||
if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
|
||||
set(PACKAGE_VERSION_EXACT TRUE)
|
||||
endif()
|
||||
endif()
|
|
@ -0,0 +1,64 @@
|
|||
# UDEV_FOUND - system has UDev
|
||||
# UDEV_INCLUDE_DIR - the libudev include directory
|
||||
# UDEV_LIBS - The libudev libraries
|
||||
|
||||
# Copyright (c) 2010, Rafael Fernández López, <ereslibre@kde.org>
|
||||
# Copyright (c) 2016, Luís Pereira, <luis.artur.pereira@gmail.com>
|
||||
# Copyright (c) 2019 Tianjin KYLIN Information Technology Co., Ltd. *
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the University 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 REGENTS 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 REGENTS 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.
|
||||
|
||||
####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() #######
|
||||
####### Any changes to this file will be overwritten by the next CMake run ####
|
||||
####### The input file was ukui-build-tools-config.cmake.in ########
|
||||
|
||||
get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE)
|
||||
|
||||
macro(set_and_check _var _file)
|
||||
set(${_var} "${_file}")
|
||||
if(NOT EXISTS "${_file}")
|
||||
message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro(check_required_components _NAME)
|
||||
foreach(comp ${${_NAME}_FIND_COMPONENTS})
|
||||
if(NOT ${_NAME}_${comp}_FOUND)
|
||||
if(${_NAME}_FIND_REQUIRED_${comp})
|
||||
set(${_NAME}_FOUND FALSE)
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
####################################################################################
|
||||
|
||||
set(UKUI_CMAKE_MODULES_DIR "${PACKAGE_PREFIX_DIR}/share/cmake/ukui-build-tools/modules/")
|
||||
set(UKUI_CMAKE_FIND_MODULES_DIR "${PACKAGE_PREFIX_DIR}/share/cmake/ukui-build-tools/find-modules/")
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH
|
||||
"${UKUI_CMAKE_MODULES_DIR}"
|
||||
"${UKUI_CMAKE_FIND_MODULES_DIR}"
|
||||
)
|
|
@ -0,0 +1,245 @@
|
|||
ukui-panel (4.0.0.0-ok0.20) yangtze; urgency=medium
|
||||
|
||||
* issue:I987X1 任务栏上已打开软件的右键菜单会自动关闭
|
||||
* 需求:无
|
||||
* 其他改动说明:无
|
||||
* 其他改动影响域:无
|
||||
|
||||
-- buxiaoqing <buxiaoqing@kylinos.cn> Thu, 14 Mar 2024 10:11:09 +0800
|
||||
|
||||
ukui-panel (4.0.0.0-ok0.19) yangtze; urgency=medium
|
||||
|
||||
* issues:I8RZ77 右键任务栏时间和日期,弹窗显示异常
|
||||
* 需求号:无
|
||||
* 其他改动说明:处理2024年宜忌冲突问题
|
||||
* 其他改动影响域:无
|
||||
|
||||
-- buxiaoqing <buxiaoqing@kylinos.cn> Wed, 31 Jan 2024 15:58:14 +0800
|
||||
|
||||
ukui-panel (4.0.0.0-ok0.18) yangtze; urgency=medium
|
||||
|
||||
* BUG: 209437 【日历】日历今天的宜忌里边都有“入宅”
|
||||
* 任务号:无
|
||||
* 需求号:无
|
||||
* 其他改动说明:处理2024年宜忌冲突问题
|
||||
* 其他改动影响域:无
|
||||
|
||||
-- jiawei <jiawei@kylinos.cn> Mon, 29 Jan 2024 17:17:30 +0800
|
||||
|
||||
ukui-panel (4.0.0.0-ok0.17) yangtze; urgency=medium
|
||||
|
||||
* fix(plugin):切换到平板模式再切回来快速启动栏有遮挡 (#I7I27A)
|
||||
* fix(panel):锁定任务栏后还能拖拽任务的位置(#I81CX1)
|
||||
|
||||
-- buxiaoqing <buxiaoqing@kylinos.cn> Fri, 12 Jan 2024 16:38:01 +0800
|
||||
|
||||
ukui-panel (4.0.0.0-ok0.16) yangtze; urgency=medium
|
||||
|
||||
* fix(button):解决微信打开链接后按钮和预览图显示异常问题(#I8PXQD)
|
||||
* fix(预览图):适配主题圆角(#I7WEJ2)
|
||||
* fix(button):按钮三态适配主题(#I7WDZO)
|
||||
* fix(button):修复任务栏图标间距之间参差不齐(#I7GTC6, #I8AYPC)
|
||||
* fix(右键菜单):无任务栏设置功能(#I8IGUF)
|
||||
* fix(thumbnail):根据硬件环境判断是否使用动态预览
|
||||
* fix(button):拖拽和初始化时更新icongeometry
|
||||
|
||||
-- buxiaoqing <buxiaoqing@kylinos.cn> Wed, 03 Jan 2024 15:23:54 +0800
|
||||
|
||||
ukui-panel (4.0.0.0-ok0.15) yangtze; urgency=medium
|
||||
|
||||
* 增加libukcc-dev依赖
|
||||
|
||||
-- buxiaoqing <buxiaoqing@kylinos.cn> Wed, 29 Nov 2023 15:58:22 +0800
|
||||
|
||||
ukui-panel (4.0.0.0-ok0.14) yangtze; urgency=medium
|
||||
|
||||
* 同步主线重构后的任务栏版本
|
||||
|
||||
-- buxiaoqing <buxiaoqing@kylinos.cn> Wed, 29 Nov 2023 14:41:08 +0800
|
||||
|
||||
ukui-panel (4.0.0.0-ok0.13) yangtze; urgency=medium
|
||||
|
||||
* fix(preview): remove preview on wayland
|
||||
* fix(任务栏位置):解决切换分辨率导致任务栏消失问题
|
||||
* fix(taskbar): fix crash when close window by group
|
||||
|
||||
-- Mouse Zhang <mousezhang@openkylin.top> Thu, 24 Aug 2023 10:30:04 +0800
|
||||
|
||||
ukui-panel (4.0.0.0-ok0.12) yangtze; urgency=medium
|
||||
|
||||
* fix(日历按钮):解决日历右键托盘位置异常并且有标题栏问题(issue#I7DBUM)
|
||||
|
||||
-- zhaikangning <zhaikangning@kylinos.cn> Thu, 03 Aug 2023 18:09:54 +0800
|
||||
|
||||
ukui-panel (4.0.0.0-ok0.11) yangtze; urgency=medium
|
||||
|
||||
* 回退动态预览相关功能,彻底改为静态预览
|
||||
|
||||
-- buxiaoqing <buxiaoqing@kylinos.cn> Thu, 27 Jul 2023 15:06:16 +0800
|
||||
|
||||
ukui-panel (4.0.0.0-ok0.10) yangtze; urgency=medium
|
||||
|
||||
* fix : I7GYN5 【wayland】【任务栏】无法调整任务栏位置为"上"
|
||||
|
||||
-- buxiaoqing <buxiaoqing@kylinos.cn> Tue, 04 Jul 2023 13:36:23 +0800
|
||||
|
||||
ukui-panel (4.0.0.0-ok0.9) yangtze; urgency=medium
|
||||
|
||||
* X环境下预览图退回静态预览
|
||||
|
||||
-- buxiaoqing <buxiaoqing@kylinos.cn> Tue, 27 Jun 2023 17:04:44 +0800
|
||||
|
||||
ukui-panel (4.0.0.0-ok0.8) yangtze; urgency=medium
|
||||
|
||||
* 解决0.7编译失败问题
|
||||
|
||||
-- buxiaoqing <buxiaoqing@kylinos.cn> Wed, 07 Jun 2023 18:16:03 +0800
|
||||
|
||||
ukui-panel (4.0.0.0-ok0.7) yangtze; urgency=medium
|
||||
|
||||
* fix: #I72LCE:【wayland】【任务栏】打开任意应用,鼠标悬浮在任务栏图标上,无缩略图
|
||||
|
||||
-- buxiaoqing <buxiaoqing@kylinos.cn> Tue, 06 Jun 2023 18:12:15 +0800
|
||||
|
||||
ukui-panel (4.0.0.0-ok0.6) yangtze; urgency=medium
|
||||
|
||||
* close: #I77O3F, 修复切换平板模式,仍存在pc模式任务栏.
|
||||
|
||||
-- handsome_feng <jianfengli@ubuntukylin.com> Sun, 04 Jun 2023 18:38:02 +0800
|
||||
|
||||
ukui-panel (4.0.0.0-ok0.5) yangtze; urgency=medium
|
||||
|
||||
* BUG: I69TB2 修改分辨率任务栏位置显示的不对
|
||||
* 需求:无
|
||||
* 其他改动:无
|
||||
|
||||
-- buxiaoqing <buxiaoqing@kylinos.cn> Fri, 05 May 2023 18:35:39 +0800
|
||||
|
||||
ukui-panel (4.0.0.0-ok0.3) yangtze; urgency=medium
|
||||
|
||||
* BUG:无
|
||||
* 需求:无
|
||||
* 其他改动:修复悬浮预览窗偶先崩溃问题
|
||||
|
||||
-- buxiaoqing <buxiaoqing@kylinos.cn> Mon, 17 Apr 2023 17:25:18 +0800
|
||||
|
||||
ukui-panel (4.0.0.0-ok0.2) yangtze; urgency=medium
|
||||
|
||||
* BUG:无
|
||||
* 需求:无
|
||||
* 其他改动:修复升级任务栏版本后配置文件没有被安装问题
|
||||
|
||||
-- buxiaoqing <buxiaoqing@kylinos.cn> Sat, 15 Apr 2023 14:19:24 +0800
|
||||
|
||||
ukui-panel (4.0.0.0-ok0.1) yangtze; urgency=medium
|
||||
|
||||
* 解决编译依赖问题
|
||||
|
||||
-- buxiaoqing <buxiaoqing@kylinos.cn> Thu, 13 Apr 2023 17:47:18 +0800
|
||||
|
||||
ukui-panel (4.0.0.0-ok0.0build1) yangtze; urgency=medium
|
||||
|
||||
* 版本号升级到4.0.0.0
|
||||
|
||||
-- buxiaoqing <buxiaoqing@kylinos.cn> Thu, 13 Apr 2023 16:28:49 +0800
|
||||
|
||||
ukui-panel (3.14.0.1-ok3.4) yangtze; urgency=medium
|
||||
|
||||
* BUG:#130885 触摸长安容易同时出现日历和右键菜单
|
||||
需求:无
|
||||
其他改动:
|
||||
其他改动说明:
|
||||
|
||||
-- zhangyinjie <zhangyinjie@kylinos.cn> Mon, 16 Jan 2023 16:53:40 +0800
|
||||
|
||||
ukui-panel (3.14.0.1-ok3.3) yangtze; urgency=medium
|
||||
|
||||
* fix position error bug
|
||||
|
||||
-- buxiaoqing <buxiaoqing@kylinos.cn> Fri, 06 Jan 2023 11:34:29 +0800
|
||||
|
||||
ukui-panel (3.14.0.1-ok3.2) yangtze; urgency=medium
|
||||
|
||||
* fix two screens bug
|
||||
* showdesktop button use SDK interface instead
|
||||
|
||||
-- kylin <kylin@klyin> Thu, 05 Jan 2023 10:34:09 +0800
|
||||
|
||||
ukui-panel (3.14.0.1-ok3.1) yangtze; urgency=medium
|
||||
|
||||
* TASK #I67H4F : 新增2023年节假日信息
|
||||
|
||||
-- Xin Li <lixin@kylinos.cn> Tue, 03 Jan 2023 17:06:27 +0800
|
||||
|
||||
ukui-panel (3.14.0.1-ok3) yangtze; urgency=medium
|
||||
|
||||
* 任务栏双屏适配,改用KScreen监听屏幕的改变信号
|
||||
|
||||
-- buxiaoqing <buxiaoqing@kylinos.cn> Thu, 15 Dec 2022 17:06:27 +0800
|
||||
|
||||
|
||||
ukui-panel (3.14.0.1-ok2~0822) yangtze; urgency=medium
|
||||
|
||||
* 更新debian/control文件
|
||||
-- buxiaoqing <buxiaoqing@kylinos.cn> Wed, 03 Aug 2022 20:38:48 +0800
|
||||
|
||||
|
||||
ukui-panel (3.14.0.1-ok2~0805) yangtze; urgency=medium
|
||||
|
||||
* BUG:132829 使用过程中任务栏偏移到屏幕中间
|
||||
* BUG:130980 125404 任务栏无法调整位置为上
|
||||
其他改动:增加多任务试图需要屏蔽的中文名的窗口
|
||||
其他改动影响域:对任务栏无影响,多任务视图多屏蔽了两个窗口
|
||||
|
||||
-- buxiaoqing <buxiaoqing@kylinos.cn> Wed, 03 Aug 2022 20:38:48 +0800
|
||||
|
||||
ukui-panel (3.14.0.1-ok2~0726.1) yangtze; urgency=medium
|
||||
|
||||
* BUG:无
|
||||
需求:无
|
||||
其他改动:修改版本号,删除ukui-flash-disk代码
|
||||
其他改动说明:对代码无影响
|
||||
|
||||
-- buxiaoqing <buxiaoqing@kylinos.cn> Wed, 20 Jul 2022 17:55:39 +0800
|
||||
|
||||
ukui-panel (3.14.0.1-ok2~0720.4) yangtze; urgency=medium
|
||||
|
||||
ukui-panel (3.14.0.1-ok2~0720.2) yangtze; urgency=medium
|
||||
|
||||
* BUG #130312 切换平板再切回PC,已经打开的应用窗口消失
|
||||
* 其他改动:taskbar刷新逻辑优化;屏蔽窗口的逻辑优化
|
||||
|
||||
-- buxiaoqing <buxiaoqing@kylinos.cn> Wed, 20 Jul 2022 17:55:39 +0800
|
||||
|
||||
ukui-panel (3.14.0.1-ok2~0720.1) yangtze; urgency=medium
|
||||
|
||||
* Bug #130143 : wayland 下日历窗口可以挪动
|
||||
* BUG #125354:修复多次点击侧边栏,侧边栏显示偏离正确位置过多
|
||||
* BUG #128674: 插入移动U盘或硬盘或光驱后,未在右下角显示设备信息
|
||||
* BUG #130322 【任务栏】已打开应用在任务栏的图标显示异常
|
||||
* BUG #127640 【任务栏】右键任务栏应用图标,关闭界面弹出位置错误
|
||||
* BUG #127646 【任务栏】右键任务栏图标应用,选择关闭,关不掉应用,所有应用均有此情况
|
||||
* BUG #126857 【wayland】【任务栏】右键点击任务栏任意图标显示的右键菜单均显示在任务栏上(右键菜单应该显示在任务栏上方)
|
||||
* BUG #127691 【搜狗输入法】右键点击任务栏输入法窗口后,弹出的菜单显示位置不在任务栏
|
||||
* BUG #130312 切换平板再切回PC,已经打开的应用图标消失
|
||||
* 需求:无
|
||||
* 其他改动:新增x下跳过任务栏的属性;新增黑名单屏蔽窗口功能;适配跳过任务栏接口;逻辑优化
|
||||
* 影响域:无
|
||||
|
||||
-- handsome_feng <jianfengli@ubuntukylin.com> Tue, 19 Jul 2022 15:47:57 +0800
|
||||
|
||||
ukui-panel (3.14.0.1-ok2~0715) yangtze; urgency=medium
|
||||
* 修改为quilt格式
|
||||
* 通过AppManager判断是否具有平板特性
|
||||
* wayland适配desktop文件修改
|
||||
* 修复wayland下日历位置错误问题
|
||||
* 修复任务栏日期右键菜单位置错误问题
|
||||
* 使用图标代替窗口预览
|
||||
* 任务栏隐藏不使用动画,直接设置位置
|
||||
* bug修复
|
||||
- #125312 托盘图标颜色未反白
|
||||
- #126789 托盘日历同步商业版代码,修复显示错误问题
|
||||
- #127655 【托盘】选择隐藏任务栏后任务栏还在
|
||||
- #129638 【任务栏】任务栏右键菜单"关于麒麟"需要改为"关于开放麒麟"
|
||||
|
||||
-- Xie Wei <xiewei@kylinos.cn> Fri, 20 May 2022 16:38:45 +0800
|
|
@ -0,0 +1,55 @@
|
|||
Source: ukui-panel
|
||||
Section: x11
|
||||
Priority: optional
|
||||
Maintainer: kylin Team <team+kylin@tracker.debian.org>
|
||||
Uploaders: Aron Xu <aron@debian.org>,
|
||||
handsome_feng <jianfengli@ubuntukylin.com>
|
||||
Build-Depends: cmake,
|
||||
debhelper-compat (= 12),
|
||||
extra-cmake-modules,
|
||||
libdbusmenu-qt5-dev,
|
||||
libdrm-dev,
|
||||
libglib2.0-dev(>=2.36),
|
||||
libgsettings-qt-dev,
|
||||
libkf5i18n-dev,
|
||||
libkf5screen-dev,
|
||||
libkf5wayland-dev,
|
||||
libkf5windowsystem-dev,
|
||||
libkysdk-sysinfo-dev,
|
||||
libkysdk-qtwidgets-dev,
|
||||
libkysdk-waylandhelper-dev,
|
||||
libkysdk-systime-dev,
|
||||
libpipewire-0.3-dev,
|
||||
libqt5x11extras5-dev,
|
||||
libqt5xdg-dev,
|
||||
libukui-log4qt-dev,
|
||||
libx11-dev,
|
||||
libxcb-composite0-dev,
|
||||
libxcb-damage0-dev,
|
||||
libxcb-image0-dev,
|
||||
libxcb-shape0-dev,
|
||||
libxcb-util0-dev,
|
||||
libxtst-dev,
|
||||
plasma-wayland-protocols,
|
||||
qtbase5-dev,
|
||||
qtbase5-private-dev,
|
||||
qtdeclarative5-dev,
|
||||
qttools5-dev,
|
||||
qtwayland5-dev-tools,
|
||||
libukcc-dev
|
||||
Standards-Version: 4.5.0
|
||||
Rules-Requires-Root: no
|
||||
Vcs-Browser: https://github.com/ukui/ukui-panel
|
||||
Vcs-Git: https://github.com/ukui/ukui-panel
|
||||
Homepage: https://github.com/ukui/ukui-panel
|
||||
|
||||
Package: ukui-panel
|
||||
Architecture: any
|
||||
Depends: libkysdk-system, ${misc:Depends}, ${shlibs:Depends}
|
||||
Provides: ukui-indicators
|
||||
Suggests: time-shutdown, ukui-window-switch (>=3.0.0-3)
|
||||
Description: ukui desktop panel
|
||||
The ukui desktop panel is used on ukui desktop and has some plugins like
|
||||
starmenu, quicklaunch and other useful tools.
|
||||
.
|
||||
This package contains the ukui panel.
|
|
@ -0,0 +1,403 @@
|
|||
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Upstream-Name: ukui-panel
|
||||
Source: https://github.com/ukui/ukui-panel
|
||||
|
||||
Files: *
|
||||
Copyright: 2019, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: AUTHORS
|
||||
Copyright: 2010-2012, Razor team
|
||||
2019, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
2012-2017, iLXQT team
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: cmake/*
|
||||
Copyright: 2019, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
2012-2019, LXQt team
|
||||
2010-2012, Razor team
|
||||
License: BSD-3-Clause
|
||||
|
||||
Files: panel/*
|
||||
Copyright: 2019, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
2010-2011, Razor team
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: panel/comm_func.cpp
|
||||
panel/comm_func.h
|
||||
panel/iukuipanel.h
|
||||
panel/iukuipanelplugin.h
|
||||
panel/pluginmoveprocessor.h
|
||||
panel/ukuipanellimits.h
|
||||
Copyright: 2019, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
2012, Razor team
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: panel/common/cmake/*
|
||||
Copyright: 2019, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
2010-2012, Razor team
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: panel/common/dbus/*
|
||||
Copyright: 2019, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
2010-2012, Razor team
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: panel/common/ukuiapplication.cpp
|
||||
panel/common/ukuiapplication.h
|
||||
Copyright: 2019, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
2012-2013, Razor team
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: panel/common/ukuiglobals.h
|
||||
Copyright: 2019, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
2013, - LXQt team
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: panel/common/ukuigridlayout.cpp
|
||||
panel/common/ukuigridlayout.h
|
||||
Copyright: 2019, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
2012, Razor team
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: panel/common/ukuisingleapplication.cpp
|
||||
panel/common/ukuisingleapplication.h
|
||||
Copyright: 2019, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
2014, LXQt team
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: panel/common/ukuitranslator.cpp
|
||||
panel/common/ukuitranslator.h
|
||||
Copyright: 2019, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
2013, LXQt team
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: panel/common_fun/*
|
||||
Copyright: 2019, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
2010, 2011, Razor team
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: panel/common_fun/dbus-adaptor.cpp
|
||||
panel/common_fun/dbus-adaptor.h
|
||||
Copyright: 2020, The Qt Company Ltd.
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: panel/customstyle.cpp
|
||||
panel/customstyle.h
|
||||
panel/highlight-effect.cpp
|
||||
panel/highlight-effect.h
|
||||
panel/ukuicontrolstyle.cpp
|
||||
panel/ukuicontrolstyle.h
|
||||
Copyright: 2019, 2020, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: panel/img/*
|
||||
Copyright: 2019, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: panel/pluginsettings.cpp
|
||||
panel/pluginsettings.h
|
||||
panel/pluginsettings_p.h
|
||||
panel/windownotifier.cpp
|
||||
panel/windownotifier.h
|
||||
Copyright: 2019, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
2015, LXQt team
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: panel/resources/*
|
||||
Copyright: 2019, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: panel/ukuipanelapplication_p.h
|
||||
Copyright: 2019, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
2016, Luís Pereira <luis.artur.pereira@gmail.com>
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: panel/ukuipanelglobals.h
|
||||
Copyright: 2019, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
2013, LXQt team
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: plugin-calendar/*
|
||||
Copyright: 2019, 2020, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: plugin-calendar/lunarcalendarwidget/customstylePushbutton.cpp
|
||||
plugin-calendar/lunarcalendarwidget/customstylePushbutton.h
|
||||
plugin-calendar/lunarcalendarwidget/picturetowhite.cpp
|
||||
plugin-calendar/lunarcalendarwidget/picturetowhite.h
|
||||
Copyright: 2019, 2020, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
License: GPL-3+
|
||||
|
||||
Files: plugin-calendar/resources/*
|
||||
Copyright: 2019, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: plugin-calendar/ukuicalendar.cpp
|
||||
plugin-calendar/ukuicalendar.h
|
||||
Copyright: 2019, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
2012-2013, Razor team
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: plugin-nightmode/*
|
||||
Copyright: 2019, 2020, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: plugin-nightmode/resources/*
|
||||
Copyright: 2019, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: plugin-quicklaunch/*
|
||||
Copyright: 2019, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
2010-2012, Razor team
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: plugin-quicklaunch/json.cpp
|
||||
plugin-quicklaunch/json.h
|
||||
Copyright: 2011, Eeli Reilin
|
||||
License: GPL-3+
|
||||
|
||||
Files: plugin-quicklaunch/quicklaunchaction.cpp
|
||||
plugin-quicklaunch/quicklaunchaction.h
|
||||
plugin-quicklaunch/quicklaunchbutton.cpp
|
||||
Copyright: 2019, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
2010-2011, Razor team
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: plugin-quicklaunch/resources/*
|
||||
Copyright: 2019, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
2010-2012, Razor team
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: plugin-quicklaunch/ukuiquicklaunchplugin.cpp
|
||||
plugin-quicklaunch/ukuiquicklaunchplugin.h
|
||||
Copyright: 2019, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
2013, Razor team
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: plugin-segmentation/*
|
||||
Copyright: 2019, 2020, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: plugin-segmentation/resources/*
|
||||
Copyright: 2019, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: plugin-showdesktop/*
|
||||
Copyright: 2019, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
2010-2011, Razor team
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: plugin-showdesktop/resources/*
|
||||
Copyright: 2019, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
2010-2012, Razor team
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: plugin-spacer/*
|
||||
Copyright: 2019, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
2015, LXQt team
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: plugin-spacer/resources/*
|
||||
Copyright: 2019, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
2012-2018, LXQt team
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: plugin-startmenu/*
|
||||
Copyright: 2019, 2020, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: plugin-startmenu/resources/*
|
||||
Copyright: 2019, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: plugin-statusnotifier/*
|
||||
Copyright: 2015, LXQt team
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: plugin-statusnotifier/resources/*
|
||||
Copyright: 2019, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: plugin-statusnotifier/statusnotifier_storagearrow.cpp
|
||||
plugin-statusnotifier/statusnotifier_storagearrow.h
|
||||
Copyright: 2019, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: plugin-taskbar-wayland/*
|
||||
Copyright: 2011, Razor team
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: plugin-taskbar-wayland/resources/*
|
||||
Copyright: 2019, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: plugin-taskbar-wayland/ukuitaskbaricon.cpp
|
||||
plugin-taskbar-wayland/ukuitaskbaricon.h
|
||||
plugin-taskbar-wayland/ukuitaskclosebutton.cpp
|
||||
plugin-taskbar-wayland/ukuitaskclosebutton.h
|
||||
plugin-taskbar-wayland/ukuitaskwidget.cpp
|
||||
plugin-taskbar-wayland/ukuitaskwidget.h
|
||||
Copyright: 2019, 2020, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: plugin-taskbar-wayland/ukuitaskbarplugin.cpp
|
||||
plugin-taskbar-wayland/ukuitaskbarplugin.h
|
||||
Copyright: 2019, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
2012, Razor team
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: plugin-taskbar/*
|
||||
Copyright: 2011, Razor team
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: plugin-taskbar/resources/*
|
||||
Copyright: 2019, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: plugin-taskbar/ukuitaskbarplugin.cpp
|
||||
plugin-taskbar/ukuitaskbarplugin.h
|
||||
Copyright: 2019, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
2012, Razor team
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: plugin-taskbar/ukuitaskclosebutton.cpp
|
||||
plugin-taskbar/ukuitaskclosebutton.h
|
||||
plugin-taskbar/ukuitaskwidget.cpp
|
||||
plugin-taskbar/ukuitaskwidget.h
|
||||
Copyright: 2019, 2020, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: plugin-taskview/*
|
||||
Copyright: 2019, 2020, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: plugin-taskview/resources/*
|
||||
Copyright: 2019, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: plugin-tray/*
|
||||
Copyright: 2019, 2020, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: plugin-tray/resources/*
|
||||
Copyright: 2019, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: ukui-flash-disk/*
|
||||
Copyright: 2019, 2020, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: ukui-flash-disk/MainController.h
|
||||
ukui-flash-disk/ui_mainwindow.h
|
||||
Copyright: 2019, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: ukui-flash-disk/QtSingleApplication/*
|
||||
Copyright: 2013, Digia Plc and/or its subsidiary(-ies).
|
||||
License: BSD-3-clause
|
||||
|
||||
Files: ukui-flash-disk/QtSingleApplication/QtLockedFile
|
||||
ukui-flash-disk/QtSingleApplication/QtSingleApplication
|
||||
Copyright: 2019, 2020, Tianjin KYLIN Information Technology Co., Ltd.
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: ukui-flash-disk/datacdrom.cpp
|
||||
ukui-flash-disk/datacdrom.h
|
||||
Copyright: 2020, KylinSoft Co., Ltd.
|
||||
License: LGPL-3+
|
||||
|
||||
Files: ukui-flash-disk/device-manager.cpp
|
||||
ukui-flash-disk/device-manager.h
|
||||
ukui-flash-disk/device-operation.cpp
|
||||
ukui-flash-disk/device-operation.h
|
||||
ukui-flash-disk/fdapplication.cpp
|
||||
ukui-flash-disk/fdapplication.h
|
||||
ukui-flash-disk/fdclickwidget.cpp
|
||||
ukui-flash-disk/fdclickwidget.h
|
||||
ukui-flash-disk/fdframe.cpp
|
||||
ukui-flash-disk/fdframe.h
|
||||
ukui-flash-disk/flashdiskdata.cpp
|
||||
ukui-flash-disk/flashdiskdata.h
|
||||
ukui-flash-disk/repair-dialog-box.cpp
|
||||
ukui-flash-disk/repair-dialog-box.h
|
||||
Copyright: 2021, KylinSoft Co., Ltd.
|
||||
License: LGPL-2.1+
|
||||
|
||||
License: BSD-3-clause
|
||||
This software is Copyright (c) 2021 by X. Ample.
|
||||
.
|
||||
This is free software, licensed under:
|
||||
.
|
||||
The (three-clause) BSD License
|
||||
.
|
||||
The BSD License
|
||||
.
|
||||
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 X. Ample nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
.
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
License: GPL-3+
|
||||
This software is Copyright (c) 2021 by X. Ample.
|
||||
.
|
||||
This is free software, licensed under:
|
||||
.
|
||||
The GNU General Public License, Version 3, June 2007
|
||||
.
|
||||
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; version 3 dated June, 2007, or (at
|
||||
your option) any later version.
|
||||
On Debian systems, the complete text of version 3 of the GNU General
|
||||
Public License can be found in '/usr/share/common-licenses/GPL-3'.
|
||||
|
||||
License: LGPL-2.1+
|
||||
This program or library is free software; you can redistribute it
|
||||
and/or modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
.
|
||||
This 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
|
||||
Lesser General Public License for more details.
|
||||
.
|
||||
On Debian systems, the complete text of the GNU Lesser General
|
||||
Public License version 2.1 can be found in "/usr/share/common-licenses/LGPL-2.1".
|
||||
|
||||
License: LGPL-3+
|
||||
This software is Copyright (c) 2021 by X. Ample.
|
||||
.
|
||||
This is free software, licensed under:
|
||||
.
|
||||
The GNU Lesser General Public License, Version 3, June 2007
|
||||
.
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Lesser General Public License as published by the
|
||||
Free Software Foundation; version 3 of the License, or (at
|
||||
your option) any later version.
|
||||
On Debian systems, the complete text of version 3 of the GNU Lesser
|
||||
General Public License can be found in '/usr/share/common-licenses/LGPL-3'.
|
|
@ -0,0 +1,2 @@
|
|||
man/ukui-flash-disk.1
|
||||
man/ukui-panel.1
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,34 @@
|
|||
From: cckylin-cibot <cckylin-cibot@kylinos.cn>
|
||||
Date: Fri, 17 Jun 2022 10:53:00 +0000
|
||||
Subject: =?utf-8?b?ITIg6Kej5YazcXVpY2tsYXVuY2jkuK3lh73mlbDlr7zoh7TnvJbor5E=?=
|
||||
=?utf-8?b?5aSx6LSl55qE6Zeu6aKY?=
|
||||
|
||||
---
|
||||
plugin-taskbar/quicklaunchaction.cpp | 7 ++++---
|
||||
1 file changed, 4 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/plugin-taskbar/quicklaunchaction.cpp b/plugin-taskbar/quicklaunchaction.cpp
|
||||
index cfbc7cb..41afd45 100644
|
||||
--- a/plugin-taskbar/quicklaunchaction.cpp
|
||||
+++ b/plugin-taskbar/quicklaunchaction.cpp
|
||||
@@ -88,8 +88,8 @@ QuickLaunchAction::QuickLaunchAction(const XdgDesktopFile * xdg,
|
||||
}
|
||||
}
|
||||
|
||||
-//#if USE_STARTUP_INFO
|
||||
-#if HAVE_STARTUP_ICON_GEOMETRY
|
||||
+#if USE_STARTUP_INFO
|
||||
+//#if HAVE_STARTUP_ICON_GEOMETRY
|
||||
void pid_callback(GDesktopAppInfo *appinfo, GPid pid, gpointer user_data) {
|
||||
KStartupInfoId* startInfoId = static_cast<KStartupInfoId*>(user_data);
|
||||
KStartupInfoData data;
|
||||
@@ -120,7 +120,8 @@ void QuickLaunchAction::execAction(QString additionalAction)
|
||||
XdgDesktopFile xdg;
|
||||
if (xdg.load(exec)) {
|
||||
if (additionalAction.isEmpty()) {
|
||||
-#if HAVE_STARTUP_ICON_GEOMETRY
|
||||
+//#if HAVE_STARTUP_ICON_GEOMETRY
|
||||
+#if USE_STARTUP_INFO
|
||||
bool needCleanup = true;
|
||||
QWidget * pw = static_cast<QWidget*>(parent());
|
||||
float scale = qApp->devicePixelRatio();
|
|
@ -0,0 +1,50 @@
|
|||
From: cckylin-cibot <cckylin-cibot@kylinos.cn>
|
||||
Date: Sat, 18 Jun 2022 07:36:54 +0000
|
||||
Subject: =?utf-8?b?ITMg6Kej5Yaz5L6d6LWW5YWz57O75a+86Ie057yW6K+R5aSx6LSl55qE?=
|
||||
=?utf-8?b?6Zeu6aKY?=
|
||||
|
||||
---
|
||||
plugin-taskbar/CMakeLists.txt | 10 ++++------
|
||||
1 file changed, 4 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/plugin-taskbar/CMakeLists.txt b/plugin-taskbar/CMakeLists.txt
|
||||
index a18f407..710218e 100644
|
||||
--- a/plugin-taskbar/CMakeLists.txt
|
||||
+++ b/plugin-taskbar/CMakeLists.txt
|
||||
@@ -31,7 +31,7 @@ find_package(X11 REQUIRED)
|
||||
find_package(PkgConfig)
|
||||
pkg_check_modules(GIOUNIX2 REQUIRED gio-unix-2.0)
|
||||
pkg_check_modules(GLIB2 REQUIRED glib-2.0 gio-2.0)
|
||||
-pkg_check_modules(KYSDKWIDGETWAYLANDHELPER_PKG kysdk-waylandhelper)
|
||||
+pkg_check_modules(KYSDKWAYLANDHELPER_PKG kysdk-waylandhelper)
|
||||
find_package(KF5WindowSystem)
|
||||
find_package(KF5Wayland)
|
||||
include_directories(${GLIB2_INCLUDE_DIRS})
|
||||
@@ -41,15 +41,15 @@ include_directories(
|
||||
${UKUI_INCLUDE_DIRS}
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/../panel"
|
||||
${GIOUNIX2_INCLUDE_DIRS}
|
||||
- ${KYSDKWIDGETWAYLANDHELPER_PKG_INCLUDE_DIRS}
|
||||
+ ${KYSDKWAYLANDHELPER_PKG_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
link_directories(
|
||||
- ${KYSDKWIDGETWAYLANDHELPER_PKG_LIBRARY_DIRS}
|
||||
+ ${KYSDKWAYLANDHELPER_PKG_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
link_libraries(
|
||||
- ${KYSDKWIDGETWAYLANDHELPER_PKG_LIBRARIES}
|
||||
+ ${KYSDKWAYLANDHELPER_PKG_LIBRARIES}
|
||||
)
|
||||
|
||||
set(LIBRARIES
|
||||
@@ -57,8 +57,6 @@ set(LIBRARIES
|
||||
${GIOUNIX2_LIBRARIES}
|
||||
${X11_LIBRARIES}
|
||||
Qt5X11Extras
|
||||
- KF5::WaylandClient
|
||||
- KF5::WaylandServer
|
||||
KF5::WindowSystem
|
||||
)
|
||||
|
|
@ -0,0 +1,247 @@
|
|||
From: cckylin-cibot <cckylin-cibot@kylinos.cn>
|
||||
Date: Wed, 22 Jun 2022 07:07:13 +0000
|
||||
Subject: =?utf-8?b?5L2/55SoU0RL5o6l5Y+j6K6+572u56qX5Y+j5L2N572u?=
|
||||
|
||||
---
|
||||
ukui-flash-disk/CMakeLists.txt | 4 +++
|
||||
ukui-flash-disk/ejectInterface.cpp | 8 +++---
|
||||
ukui-flash-disk/ejectInterface.h | 1 +
|
||||
ukui-flash-disk/gpartedinterface.cpp | 8 +++---
|
||||
ukui-flash-disk/gpartedinterface.h | 1 +
|
||||
ukui-flash-disk/interactivedialog.cpp | 8 +++---
|
||||
ukui-flash-disk/interactivedialog.h | 1 +
|
||||
ukui-flash-disk/mainwindow.cpp | 54 +++++++++++++++++++----------------
|
||||
8 files changed, 48 insertions(+), 37 deletions(-)
|
||||
|
||||
diff --git a/ukui-flash-disk/CMakeLists.txt b/ukui-flash-disk/CMakeLists.txt
|
||||
index 0562620..5593301 100644
|
||||
--- a/ukui-flash-disk/CMakeLists.txt
|
||||
+++ b/ukui-flash-disk/CMakeLists.txt
|
||||
@@ -22,6 +22,7 @@ find_package(Qt5DBus REQUIRED)
|
||||
find_package(PkgConfig REQUIRED)
|
||||
find_package(KF5WindowSystem REQUIRED)
|
||||
|
||||
+pkg_check_modules(KYSDKWAYLANDHELPER_PKG kysdk-waylandhelper)
|
||||
pkg_check_modules(GLIB2 REQUIRED glib-2.0 gio-2.0 udisks2)
|
||||
pkg_check_modules(QGS REQUIRED gsettings-qt)
|
||||
|
||||
@@ -88,6 +89,9 @@ add_definitions(-DQT_NO_KEYWORDS)
|
||||
add_definitions(-DQT_MESSAGELOGCONTEXT)
|
||||
|
||||
target_link_libraries(${PROJECT_NAME} Qt5::Widgets Qt5::DBus Qt5::Network ${GLIB2_LIBRARIES} ${QGS_LIBRARIES} KF5::WindowSystem -lukui-log4qt)
|
||||
+target_include_directories(${PROJECT_NAME} PRIVATE ${KYSDKWAYLANDHELPER_PKG_INCLUDE_DIRS})
|
||||
+target_link_directories(${PROJECT_NAME} PRIVATE ${KYSDKWAYLANDHELPER_PKG_LIBRARY_DIRS} KF5::WindowSystem)
|
||||
+target_link_libraries(${PROJECT_NAME} ${KYSDKWAYLANDHELPER_PKG_LIBRARIES})
|
||||
|
||||
install(TARGETS ukui-flash-disk DESTINATION bin)
|
||||
|
||||
diff --git a/ukui-flash-disk/ejectInterface.cpp b/ukui-flash-disk/ejectInterface.cpp
|
||||
index 6e22f03..e2c53e0 100644
|
||||
--- a/ukui-flash-disk/ejectInterface.cpp
|
||||
+++ b/ukui-flash-disk/ejectInterface.cpp
|
||||
@@ -198,13 +198,13 @@ void ejectInterface::moveEjectInterfaceRight()
|
||||
int y=QApplication::primaryScreen()->geometry().y();
|
||||
|
||||
if(position==0)
|
||||
- this->setGeometry(QRect(x + QApplication::primaryScreen()->geometry().width()-this->width(),y+QApplication::primaryScreen()->geometry().height()-panelSize-this->height(),this->width(),this->height()));
|
||||
+ kdk::WindowManager::setGeometry(this->windowHandle(), QRect(x + QApplication::primaryScreen()->geometry().width()-this->width(),y+QApplication::primaryScreen()->geometry().height()-panelSize-this->height(),this->width(),this->height()));
|
||||
else if(position==1)
|
||||
- this->setGeometry(QRect(x + QApplication::primaryScreen()->geometry().width()-this->width(),y+panelSize,this->width(),this->height())); // Style::minw,Style::minh the width and the height of the interface which you want to show
|
||||
+ kdk::WindowManager::setGeometry(this->windowHandle(), QRect(x + QApplication::primaryScreen()->geometry().width()-this->width(),y+panelSize,this->width(),this->height())); // Style::minw,Style::minh the width and the height of the interface which you want to show
|
||||
else if(position==2)
|
||||
- this->setGeometry(QRect(x+panelSize,y + QApplication::primaryScreen()->geometry().height() - this->height(),this->width(),this->height()));
|
||||
+ kdk::WindowManager::setGeometry(this->windowHandle(), QRect(x+panelSize,y + QApplication::primaryScreen()->geometry().height() - this->height(),this->width(),this->height()));
|
||||
else
|
||||
- this->setGeometry(QRect(x+QApplication::primaryScreen()->geometry().width()-panelSize-this->width(),y + QApplication::primaryScreen()->geometry().height() - this->height(),this->width(),this->height()));
|
||||
+ kdk::WindowManager::setGeometry(this->windowHandle(), QRect(x+QApplication::primaryScreen()->geometry().width()-panelSize-this->width(),y + QApplication::primaryScreen()->geometry().height() - this->height(),this->width(),this->height()));
|
||||
}
|
||||
|
||||
int ejectInterface::getPanelPosition(QString str)
|
||||
diff --git a/ukui-flash-disk/ejectInterface.h b/ukui-flash-disk/ejectInterface.h
|
||||
index 2537688..9ea53d6 100644
|
||||
--- a/ukui-flash-disk/ejectInterface.h
|
||||
+++ b/ukui-flash-disk/ejectInterface.h
|
||||
@@ -43,6 +43,7 @@
|
||||
|
||||
#include "MacroFile.h"
|
||||
#include "UnionVariable.h"
|
||||
+#include "windowmanager/windowmanager.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
namespace Ui { class ejectInterface; }
|
||||
diff --git a/ukui-flash-disk/gpartedinterface.cpp b/ukui-flash-disk/gpartedinterface.cpp
|
||||
index 1463d0b..9a08daf 100644
|
||||
--- a/ukui-flash-disk/gpartedinterface.cpp
|
||||
+++ b/ukui-flash-disk/gpartedinterface.cpp
|
||||
@@ -98,13 +98,13 @@ void gpartedInterface::moveChooseDialogRight()
|
||||
qDebug()<<"QApplication::primaryScreen()->geometry().x();"<<QApplication::primaryScreen()->geometry().x();
|
||||
qDebug()<<"QApplication::primaryScreen()->geometry().y();"<<QApplication::primaryScreen()->geometry().y();
|
||||
if(position==0)
|
||||
- this->setGeometry(QRect(x + QApplication::primaryScreen()->geometry().width()-this->width() - DISTANCEPADDING - DISTANCEMEND,y+QApplication::primaryScreen()->geometry().height()-panelSize-this->height() - DISTANCEPADDING,this->width(),this->height()));
|
||||
+ kdk::WindowManager::setGeometry(this->windowHandle(), QRect(x + QApplication::primaryScreen()->geometry().width()-this->width() - DISTANCEPADDING - DISTANCEMEND,y+QApplication::primaryScreen()->geometry().height()-panelSize-this->height() - DISTANCEPADDING,this->width(),this->height()));
|
||||
else if(position==1)
|
||||
- this->setGeometry(QRect(x + QApplication::primaryScreen()->geometry().width()-this->width() - DISTANCEPADDING - DISTANCEMEND,y+panelSize + DISTANCEPADDING,this->width(),this->height())); // Style::minw,Style::minh the width and the height of the interface which you want to show
|
||||
+ kdk::WindowManager::setGeometry(this->windowHandle(),QRect(x + QApplication::primaryScreen()->geometry().width()-this->width() - DISTANCEPADDING - DISTANCEMEND,y+panelSize + DISTANCEPADDING,this->width(),this->height())); // Style::minw,Style::minh the width and the height of the interface which you want to show
|
||||
else if(position==2)
|
||||
- this->setGeometry(QRect(x+panelSize + DISTANCEPADDING,y + QApplication::primaryScreen()->geometry().height() - this->height() - DISTANCEPADDING,this->width(),this->height()));
|
||||
+ kdk::WindowManager::setGeometry(this->windowHandle(),QRect(x+panelSize + DISTANCEPADDING,y + QApplication::primaryScreen()->geometry().height() - this->height() - DISTANCEPADDING,this->width(),this->height()));
|
||||
else
|
||||
- this->setGeometry(QRect(x+QApplication::primaryScreen()->geometry().width()-panelSize-this->width() - DISTANCEPADDING,y + QApplication::primaryScreen()->geometry().height() - this->height() - DISTANCEPADDING,this->width(),this->height()));
|
||||
+ kdk::WindowManager::setGeometry(this->windowHandle(),QRect(x+QApplication::primaryScreen()->geometry().width()-panelSize-this->width() - DISTANCEPADDING,y + QApplication::primaryScreen()->geometry().height() - this->height() - DISTANCEPADDING,this->width(),this->height()));
|
||||
}
|
||||
gpartedInterface::~gpartedInterface()
|
||||
{
|
||||
diff --git a/ukui-flash-disk/gpartedinterface.h b/ukui-flash-disk/gpartedinterface.h
|
||||
index dc585d2..72c8580 100644
|
||||
--- a/ukui-flash-disk/gpartedinterface.h
|
||||
+++ b/ukui-flash-disk/gpartedinterface.h
|
||||
@@ -38,6 +38,7 @@
|
||||
#include <QPushButton>
|
||||
#include <QLabel>
|
||||
#include <qgsettings.h>
|
||||
+#include "windowmanager/windowmanager.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
namespace Ui { class gpartedInterface; }
|
||||
diff --git a/ukui-flash-disk/interactivedialog.cpp b/ukui-flash-disk/interactivedialog.cpp
|
||||
index 76d7aaa..8c6c71f 100644
|
||||
--- a/ukui-flash-disk/interactivedialog.cpp
|
||||
+++ b/ukui-flash-disk/interactivedialog.cpp
|
||||
@@ -165,13 +165,13 @@ void interactiveDialog::moveChooseDialogRight()
|
||||
qDebug()<<"QApplication::primaryScreen()->geometry().x();"<<QApplication::primaryScreen()->geometry().x();
|
||||
qDebug()<<"QApplication::primaryScreen()->geometry().y();"<<QApplication::primaryScreen()->geometry().y();
|
||||
if(position==0)
|
||||
- this->setGeometry(QRect(x + QApplication::primaryScreen()->geometry().width()-this->width() - DISTANCEPADDING - DISTANCEMEND,y+QApplication::primaryScreen()->geometry().height()-panelSize-this->height() - DISTANCEPADDING,this->width(),this->height()));
|
||||
+ kdk::WindowManager::setGeometry(this->windowHandle(), QRect(x + QApplication::primaryScreen()->geometry().width()-this->width() - DISTANCEPADDING - DISTANCEMEND,y+QApplication::primaryScreen()->geometry().height()-panelSize-this->height() - DISTANCEPADDING,this->width(),this->height()));
|
||||
else if(position==1)
|
||||
- this->setGeometry(QRect(x + QApplication::primaryScreen()->geometry().width()-this->width() - DISTANCEPADDING - DISTANCEMEND,y+panelSize + DISTANCEPADDING,this->width(),this->height())); // Style::minw,Style::minh the width and the height of the interface which you want to show
|
||||
+ kdk::WindowManager::setGeometry(this->windowHandle(), QRect(x + QApplication::primaryScreen()->geometry().width()-this->width() - DISTANCEPADDING - DISTANCEMEND,y+panelSize + DISTANCEPADDING,this->width(),this->height())); // Style::minw,Style::minh the width and the height of the interface which you want to show
|
||||
else if(position==2)
|
||||
- this->setGeometry(QRect(x+panelSize + DISTANCEPADDING,y + QApplication::primaryScreen()->geometry().height() - this->height() - DISTANCEPADDING,this->width(),this->height()));
|
||||
+ kdk::WindowManager::setGeometry(this->windowHandle(), QRect(x+panelSize + DISTANCEPADDING,y + QApplication::primaryScreen()->geometry().height() - this->height() - DISTANCEPADDING,this->width(),this->height()));
|
||||
else
|
||||
- this->setGeometry(QRect(x+QApplication::primaryScreen()->geometry().width()-panelSize-this->width() - DISTANCEPADDING,y + QApplication::primaryScreen()->geometry().height() - this->height() - DISTANCEPADDING,this->width(),this->height()));
|
||||
+ kdk::WindowManager::setGeometry(this->windowHandle(), QRect(x+QApplication::primaryScreen()->geometry().width()-panelSize-this->width() - DISTANCEPADDING,y + QApplication::primaryScreen()->geometry().height() - this->height() - DISTANCEPADDING,this->width(),this->height()));
|
||||
}
|
||||
|
||||
interactiveDialog::~interactiveDialog()
|
||||
diff --git a/ukui-flash-disk/interactivedialog.h b/ukui-flash-disk/interactivedialog.h
|
||||
index 71d1dd7..fc5d844 100644
|
||||
--- a/ukui-flash-disk/interactivedialog.h
|
||||
+++ b/ukui-flash-disk/interactivedialog.h
|
||||
@@ -19,6 +19,7 @@
|
||||
#define INTERACTIVEDIALOG_H
|
||||
|
||||
#include "MacroFile.h"
|
||||
+#include "windowmanager/windowmanager.h"
|
||||
|
||||
#include <QWidget>
|
||||
#include <QtWidgets>
|
||||
diff --git a/ukui-flash-disk/mainwindow.cpp b/ukui-flash-disk/mainwindow.cpp
|
||||
index 6865ff5..d584c7e 100755
|
||||
--- a/ukui-flash-disk/mainwindow.cpp
|
||||
+++ b/ukui-flash-disk/mainwindow.cpp
|
||||
@@ -34,6 +34,7 @@
|
||||
#include "clickLabel.h"
|
||||
#include "MacroFile.h"
|
||||
#include "datacdrom.h"
|
||||
+#include "windowmanager/windowmanager.h"
|
||||
|
||||
#if UDFAUTOMOUNT
|
||||
static void mount_cdrom (GDrive* drive, gpointer u);
|
||||
@@ -1704,33 +1705,35 @@ void MainWindow::moveBottomRight()
|
||||
// reply.value();
|
||||
qInfo()<<reply.value().at(4).toInt();
|
||||
QVariantList position_list=reply.value();
|
||||
+ QRect rect;
|
||||
|
||||
switch(reply.value().at(4).toInt()){
|
||||
case 1:
|
||||
//任务栏位于上方
|
||||
- this->setGeometry(position_list.at(0).toInt()+position_list.at(2).toInt()-this->width()-MARGIN,
|
||||
- position_list.at(1).toInt()+MARGIN,
|
||||
- this->width(),this->height());
|
||||
+ rect = QRect(position_list.at(0).toInt()+position_list.at(2).toInt()-this->width()-MARGIN,
|
||||
+ position_list.at(1).toInt()+MARGIN,
|
||||
+ this->width(),this->height());
|
||||
break;
|
||||
//任务栏位于左边
|
||||
case 2:
|
||||
- this->setGeometry(position_list.at(0).toInt()+MARGIN,
|
||||
- position_list.at(1).toInt()+reply.value().at(3).toInt()-this->height()-MARGIN,
|
||||
- this->width(),this->height());
|
||||
+ rect = QRect(position_list.at(0).toInt()+MARGIN,
|
||||
+ position_list.at(1).toInt()+reply.value().at(3).toInt()-this->height()-MARGIN,
|
||||
+ this->width(),this->height());
|
||||
break;
|
||||
//任务栏位于右边
|
||||
case 3:
|
||||
- this->setGeometry(position_list.at(0).toInt()+position_list.at(2).toInt()-this->width()-MARGIN,
|
||||
- position_list.at(1).toInt()+reply.value().at(3).toInt()-this->height()-MARGIN,
|
||||
- this->width(),this->height());
|
||||
+ rect = QRect(position_list.at(0).toInt()+position_list.at(2).toInt()-this->width()-MARGIN,
|
||||
+ position_list.at(1).toInt()+reply.value().at(3).toInt()-this->height()-MARGIN,
|
||||
+ this->width(),this->height());
|
||||
break;
|
||||
//任务栏位于下方
|
||||
default:
|
||||
- this->setGeometry(position_list.at(0).toInt()+position_list.at(2).toInt()-this->width()-MARGIN,
|
||||
- position_list.at(1).toInt()+reply.value().at(3).toInt()-this->height()-MARGIN,
|
||||
- this->width(),this->height());
|
||||
+ rect = QRect(position_list.at(0).toInt()+position_list.at(2).toInt()-this->width()-MARGIN,
|
||||
+ position_list.at(1).toInt()+reply.value().at(3).toInt()-this->height()-MARGIN,
|
||||
+ this->width(),this->height());
|
||||
break;
|
||||
}
|
||||
+ kdk::WindowManager::setGeometry(this->windowHandle(), rect);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2357,33 +2360,34 @@ void MainWindow::moveBottomNoBase()
|
||||
} else {
|
||||
// reply获取的参数共5个,分别是 主屏可用区域的起点x坐标,主屏可用区域的起点y坐标,主屏可用区域的宽度,主屏可用区域高度,任务栏位置
|
||||
QVariantList position_list=reply.value();
|
||||
-
|
||||
+ QRect rect;
|
||||
switch(reply.value().at(4).toInt()){
|
||||
case 1:
|
||||
// 任务栏位于上方
|
||||
- ui->centralWidget->setGeometry(position_list.at(0).toInt()+position_list.at(2).toInt()-ui->centralWidget->width()-MARGIN,
|
||||
- position_list.at(1).toInt()+MARGIN,
|
||||
- ui->centralWidget->width(),ui->centralWidget->height());
|
||||
+ rect = QRect(position_list.at(0).toInt()+position_list.at(2).toInt()-ui->centralWidget->width()-MARGIN,
|
||||
+ position_list.at(1).toInt()+MARGIN,
|
||||
+ ui->centralWidget->width(),ui->centralWidget->height());
|
||||
break;
|
||||
// 任务栏位于左边
|
||||
case 2:
|
||||
- ui->centralWidget->setGeometry(position_list.at(0).toInt()+MARGIN,
|
||||
- position_list.at(1).toInt()+reply.value().at(3).toInt()-ui->centralWidget->height()-MARGIN,
|
||||
- ui->centralWidget->width(),this->height());
|
||||
+ rect = QRect(position_list.at(0).toInt()+MARGIN,
|
||||
+ position_list.at(1).toInt()+reply.value().at(3).toInt()-ui->centralWidget->height()-MARGIN,
|
||||
+ ui->centralWidget->width(),this->height());
|
||||
break;
|
||||
// 任务栏位于右边
|
||||
case 3:
|
||||
- ui->centralWidget->setGeometry(position_list.at(0).toInt()+position_list.at(2).toInt()-ui->centralWidget->width()-MARGIN,
|
||||
- position_list.at(1).toInt()+reply.value().at(3).toInt()-ui->centralWidget->height()-MARGIN,
|
||||
- ui->centralWidget->width(),ui->centralWidget->height());
|
||||
+ rect = QRect(position_list.at(0).toInt()+position_list.at(2).toInt()-ui->centralWidget->width()-MARGIN,
|
||||
+ position_list.at(1).toInt()+reply.value().at(3).toInt()-ui->centralWidget->height()-MARGIN,
|
||||
+ ui->centralWidget->width(),ui->centralWidget->height());
|
||||
break;
|
||||
// 任务栏位于下方
|
||||
default:
|
||||
- ui->centralWidget->setGeometry(position_list.at(0).toInt()+position_list.at(2).toInt()-ui->centralWidget->width()-MARGIN,
|
||||
- position_list.at(1).toInt()+reply.value().at(3).toInt()-ui->centralWidget->height()-MARGIN,
|
||||
- ui->centralWidget->width(),ui->centralWidget->height());
|
||||
+ rect = QRect(position_list.at(0).toInt()+position_list.at(2).toInt()-ui->centralWidget->width()-MARGIN,
|
||||
+ position_list.at(1).toInt()+reply.value().at(3).toInt()-ui->centralWidget->height()-MARGIN,
|
||||
+ ui->centralWidget->width(),ui->centralWidget->height());
|
||||
break;
|
||||
}
|
||||
+ kdk::WindowManager::setGeometry(ui->centralWidget->windowHandle(), rect);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
From: cckylin-cibot <cckylin-cibot@kylinos.cn>
|
||||
Date: Wed, 22 Jun 2022 10:07:19 +0000
|
||||
Subject: =?utf-8?b?ITYg6Kej5YazQlVHIzEyNTQ5MyDlpJrku7vliqHor5Xlm77kuK3lrZg=?=
|
||||
=?utf-8?b?5Zyo5Lu75Yqh5qCP?=
|
||||
|
||||
---
|
||||
panel/ukuipanel.cpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/panel/ukuipanel.cpp b/panel/ukuipanel.cpp
|
||||
index 9c73e42..4a65fdd 100644
|
||||
--- a/panel/ukuipanel.cpp
|
||||
+++ b/panel/ukuipanel.cpp
|
||||
@@ -1119,7 +1119,7 @@ bool UKUIPanel::event(QEvent *event)
|
||||
// Qt::WA_X11NetWmWindowTypeDock becomes ineffective in Qt 5
|
||||
// See QTBUG-39887: https://bugreports.qt-project.org/browse/QTBUG-39887
|
||||
// Let's use KWindowSystem for that
|
||||
- //KWindowSystem::setType(effectiveWinId(), NET::Dock);
|
||||
+ KWindowSystem::setType(effectiveWinId(), NET::Dock);
|
||||
|
||||
updateWmStrut(); // reserve screen space for the panel
|
||||
KWindowSystem::setOnAllDesktops(effectiveWinId(), true);
|
|
@ -0,0 +1,115 @@
|
|||
From: cckylin-cibot <cckylin-cibot@kylinos.cn>
|
||||
Date: Thu, 23 Jun 2022 06:09:33 +0000
|
||||
Subject: =?utf-8?b?ITcgd2F5bGFuZOeJiOmAgumFjeW6lOeUqOeuoeeQhuaOpeWPow==?=
|
||||
|
||||
---
|
||||
plugin-taskbar/quicklaunchaction.cpp | 63 +++++++++++++++++++++++++++++-------
|
||||
plugin-taskbar/quicklaunchaction.h | 2 ++
|
||||
2 files changed, 54 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/plugin-taskbar/quicklaunchaction.cpp b/plugin-taskbar/quicklaunchaction.cpp
|
||||
index 41afd45..6c04e19 100644
|
||||
--- a/plugin-taskbar/quicklaunchaction.cpp
|
||||
+++ b/plugin-taskbar/quicklaunchaction.cpp
|
||||
@@ -42,6 +42,7 @@
|
||||
#include <QFileInfo>
|
||||
#include <QtX11Extras/QX11Info>
|
||||
#include <kstartupinfo.h>
|
||||
+#include <ukuisdk/kylin-com4cxx.h>
|
||||
|
||||
#define USE_STARTUP_INFO false
|
||||
|
||||
@@ -104,9 +105,31 @@ void pid_callback(GDesktopAppInfo *appinfo, GPid pid, gpointer user_data) {
|
||||
}
|
||||
#endif
|
||||
|
||||
+bool QuickLaunchAction::getCurrentMode()
|
||||
+{
|
||||
+ static QString projectCode = nullptr;
|
||||
+ QString deviceName = "v10sp1";
|
||||
+ bool isTabletmode = false;
|
||||
+
|
||||
+ if (nullptr == projectCode) {
|
||||
+ QString arg = QString::fromStdString(KDKGetPrjCodeName());
|
||||
+ projectCode = arg.toLower();
|
||||
+ }
|
||||
+ if (QString::compare(projectCode,deviceName) == 0) {
|
||||
+ QString feature = QString::fromStdString(KDKGetOSRelease("PRODUCT_FEATURES"));
|
||||
+ if (feature == "3") {
|
||||
+ isTabletmode = true; //XC
|
||||
+ } else {
|
||||
+ isTabletmode = false;//主线
|
||||
+ }
|
||||
+ }
|
||||
+ return isTabletmode;
|
||||
+}
|
||||
+
|
||||
/*解析Exec字段*/
|
||||
void QuickLaunchAction::execAction(QString additionalAction)
|
||||
{
|
||||
+ m_tabletMode = getCurrentMode();
|
||||
UKUITaskBar *uqk = qobject_cast<UKUITaskBar*>(parent());
|
||||
QString exec(data().toString());
|
||||
bool showQMessage = false;
|
||||
@@ -140,19 +163,37 @@ void QuickLaunchAction::execAction(QString additionalAction)
|
||||
data.setDescription("Launch by ukui-panel");
|
||||
KStartupInfo::sendStartup(*startInfoId, data);
|
||||
|
||||
- GDesktopAppInfo * appinfo=g_desktop_app_info_new_from_filename(xdg.fileName().toStdString().data());
|
||||
- needCleanup = !g_desktop_app_info_launch_uris_as_manager(appinfo, nullptr, nullptr,
|
||||
- GSpawnFlags::G_SPAWN_DEFAULT, nullptr, nullptr,
|
||||
- pid_callback, (gpointer)startInfoId, nullptr);
|
||||
- if (needCleanup) {
|
||||
- showQMessage =true;
|
||||
- delete startInfoId;
|
||||
- g_object_unref(appinfo);
|
||||
+
|
||||
+ if (m_tabletMode) {
|
||||
+ QDBusInterface iface("com.kylin.AppManager",
|
||||
+ "/com/kylin/AppManager",
|
||||
+ "com.kylin.AppManager",
|
||||
+ QDBusConnection::sessionBus());
|
||||
+ iface.call("LaunchApp",exec);
|
||||
+ } else {
|
||||
+ GDesktopAppInfo * appinfo=g_desktop_app_info_new_from_filename(xdg.fileName().toStdString().data());
|
||||
+ needCleanup = !g_desktop_app_info_launch_uris_as_manager(appinfo, nullptr, nullptr,
|
||||
+ GSpawnFlags::G_SPAWN_DEFAULT, nullptr, nullptr,
|
||||
+ pid_callback, (gpointer)startInfoId, nullptr);
|
||||
+ if (needCleanup) {
|
||||
+ showQMessage =true;
|
||||
+ delete startInfoId;
|
||||
+ g_object_unref(appinfo);
|
||||
+ }
|
||||
}
|
||||
#else
|
||||
- GDesktopAppInfo * appinfo=g_desktop_app_info_new_from_filename(xdg.fileName().toStdString().data());
|
||||
- if (!g_app_info_launch_uris(G_APP_INFO(appinfo),nullptr, nullptr, nullptr)) {
|
||||
- showQMessage =true;
|
||||
+ if (m_tabletMode) {
|
||||
+ QDBusInterface iface("com.kylin.AppManager",
|
||||
+ "/com/kylin/AppManager",
|
||||
+ "com.kylin.AppManager",
|
||||
+ QDBusConnection::sessionBus());
|
||||
+ iface.call("LaunchApp",exec);
|
||||
+ } else {
|
||||
+ GDesktopAppInfo * appinfo=g_desktop_app_info_new_from_filename(xdg.fileName().toStdString().data());
|
||||
+ if (!g_app_info_launch_uris(G_APP_INFO(appinfo),nullptr, nullptr, nullptr)) {
|
||||
+ showQMessage =true;
|
||||
+ }
|
||||
+ g_object_unref(appinfo);
|
||||
}
|
||||
g_object_unref(appinfo);
|
||||
#endif
|
||||
diff --git a/plugin-taskbar/quicklaunchaction.h b/plugin-taskbar/quicklaunchaction.h
|
||||
index db30021..8aa9854 100644
|
||||
--- a/plugin-taskbar/quicklaunchaction.h
|
||||
+++ b/plugin-taskbar/quicklaunchaction.h
|
||||
@@ -70,6 +70,8 @@ private:
|
||||
QString m_data;
|
||||
bool m_valid;
|
||||
QList<QAction *> m_addtitionalActions;
|
||||
+ bool m_tabletMode;
|
||||
+ bool getCurrentMode();
|
||||
};
|
||||
|
||||
#endif
|
|
@ -0,0 +1,41 @@
|
|||
From: cckylin-cibot <cckylin-cibot@kylinos.cn>
|
||||
Date: Thu, 23 Jun 2022 06:51:51 +0000
|
||||
Subject: =?utf-8?b?ITgg5Y+q5Yik5pat5piv5ZCm5YW35pyJ5bmz5p2/54m55oCn?=
|
||||
|
||||
---
|
||||
plugin-taskbar/quicklaunchaction.cpp | 19 ++++++-------------
|
||||
1 file changed, 6 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/plugin-taskbar/quicklaunchaction.cpp b/plugin-taskbar/quicklaunchaction.cpp
|
||||
index 6c04e19..6827a88 100644
|
||||
--- a/plugin-taskbar/quicklaunchaction.cpp
|
||||
+++ b/plugin-taskbar/quicklaunchaction.cpp
|
||||
@@ -107,22 +107,15 @@ void pid_callback(GDesktopAppInfo *appinfo, GPid pid, gpointer user_data) {
|
||||
|
||||
bool QuickLaunchAction::getCurrentMode()
|
||||
{
|
||||
- static QString projectCode = nullptr;
|
||||
- QString deviceName = "v10sp1";
|
||||
bool isTabletmode = false;
|
||||
|
||||
- if (nullptr == projectCode) {
|
||||
- QString arg = QString::fromStdString(KDKGetPrjCodeName());
|
||||
- projectCode = arg.toLower();
|
||||
- }
|
||||
- if (QString::compare(projectCode,deviceName) == 0) {
|
||||
- QString feature = QString::fromStdString(KDKGetOSRelease("PRODUCT_FEATURES"));
|
||||
- if (feature == "3") {
|
||||
- isTabletmode = true; //XC
|
||||
- } else {
|
||||
- isTabletmode = false;//主线
|
||||
- }
|
||||
+ QString feature = QString::fromStdString(KDKGetOSRelease("PRODUCT_FEATURES"));
|
||||
+ if (feature == "3") {
|
||||
+ isTabletmode = true;
|
||||
+ } else {
|
||||
+ isTabletmode = false;
|
||||
}
|
||||
+
|
||||
return isTabletmode;
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
From: cckylin-cibot <cckylin-cibot@kylinos.cn>
|
||||
Date: Wed, 29 Jun 2022 01:26:27 +0000
|
||||
Subject: =?utf-8?b?ITEwIOWPquWIpOaWreaYr+WQpuWFt+acieW5s+adv+eJueaApyBNZXJn?=
|
||||
=?utf-8?b?ZSBwdWxsIHJlcXVlc3QgITEwIGZyb20g5Y2c6JCn5bqGL29wZW5reWxpbi95YW5n?=
|
||||
=?utf-8?b?dHpl?=
|
||||
|
||||
---
|
||||
plugin-taskbar/quicklaunchaction.cpp | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/plugin-taskbar/quicklaunchaction.cpp b/plugin-taskbar/quicklaunchaction.cpp
|
||||
index 6827a88..e8fb58c 100644
|
||||
--- a/plugin-taskbar/quicklaunchaction.cpp
|
||||
+++ b/plugin-taskbar/quicklaunchaction.cpp
|
||||
@@ -188,7 +188,6 @@ void QuickLaunchAction::execAction(QString additionalAction)
|
||||
}
|
||||
g_object_unref(appinfo);
|
||||
}
|
||||
- g_object_unref(appinfo);
|
||||
#endif
|
||||
} else {
|
||||
if (!xdg.actionActivate(additionalAction, QStringList{})) {
|
|
@ -0,0 +1,98 @@
|
|||
From: cckylin-cibot <cckylin-cibot@kylinos.cn>
|
||||
Date: Thu, 30 Jun 2022 07:57:01 +0000
|
||||
Subject: =?utf-8?b?5bCG5Yik5pat5bmz5p2/54m55oCn5o6l5Y+j5pS55Li65Yik5patQXBw?=
|
||||
=?utf-8?b?TWFuYWdlcuaOpeWPo+aYr+WQpuWtmOWcqA==?=
|
||||
|
||||
---
|
||||
plugin-taskbar/quicklaunchaction.cpp | 48 ++++++++++++++----------------------
|
||||
plugin-taskbar/quicklaunchaction.h | 1 -
|
||||
2 files changed, 19 insertions(+), 30 deletions(-)
|
||||
|
||||
diff --git a/plugin-taskbar/quicklaunchaction.cpp b/plugin-taskbar/quicklaunchaction.cpp
|
||||
index e8fb58c..af33a8c 100644
|
||||
--- a/plugin-taskbar/quicklaunchaction.cpp
|
||||
+++ b/plugin-taskbar/quicklaunchaction.cpp
|
||||
@@ -105,24 +105,9 @@ void pid_callback(GDesktopAppInfo *appinfo, GPid pid, gpointer user_data) {
|
||||
}
|
||||
#endif
|
||||
|
||||
-bool QuickLaunchAction::getCurrentMode()
|
||||
-{
|
||||
- bool isTabletmode = false;
|
||||
-
|
||||
- QString feature = QString::fromStdString(KDKGetOSRelease("PRODUCT_FEATURES"));
|
||||
- if (feature == "3") {
|
||||
- isTabletmode = true;
|
||||
- } else {
|
||||
- isTabletmode = false;
|
||||
- }
|
||||
-
|
||||
- return isTabletmode;
|
||||
-}
|
||||
-
|
||||
/*解析Exec字段*/
|
||||
void QuickLaunchAction::execAction(QString additionalAction)
|
||||
{
|
||||
- m_tabletMode = getCurrentMode();
|
||||
UKUITaskBar *uqk = qobject_cast<UKUITaskBar*>(parent());
|
||||
QString exec(data().toString());
|
||||
bool showQMessage = false;
|
||||
@@ -157,13 +142,16 @@ void QuickLaunchAction::execAction(QString additionalAction)
|
||||
KStartupInfo::sendStartup(*startInfoId, data);
|
||||
|
||||
|
||||
- if (m_tabletMode) {
|
||||
- QDBusInterface iface("com.kylin.AppManager",
|
||||
- "/com/kylin/AppManager",
|
||||
- "com.kylin.AppManager",
|
||||
- QDBusConnection::sessionBus());
|
||||
- iface.call("LaunchApp",exec);
|
||||
- } else {
|
||||
+
|
||||
+ QDBusInterface iface("com.kylin.AppManager",
|
||||
+ "/com/kylin/AppManager",
|
||||
+ "com.kylin.AppManager",
|
||||
+ QDBusConnection::sessionBus());
|
||||
+ QDBusReply<bool> reply;
|
||||
+ if (iface.isValid()) {
|
||||
+ reply = iface.call("LaunchApp",exec);
|
||||
+ }
|
||||
+ if (!iface.isValid() || !reply.isValid() || !reply) {
|
||||
GDesktopAppInfo * appinfo=g_desktop_app_info_new_from_filename(xdg.fileName().toStdString().data());
|
||||
needCleanup = !g_desktop_app_info_launch_uris_as_manager(appinfo, nullptr, nullptr,
|
||||
GSpawnFlags::G_SPAWN_DEFAULT, nullptr, nullptr,
|
||||
@@ -175,13 +163,15 @@ void QuickLaunchAction::execAction(QString additionalAction)
|
||||
}
|
||||
}
|
||||
#else
|
||||
- if (m_tabletMode) {
|
||||
- QDBusInterface iface("com.kylin.AppManager",
|
||||
- "/com/kylin/AppManager",
|
||||
- "com.kylin.AppManager",
|
||||
- QDBusConnection::sessionBus());
|
||||
- iface.call("LaunchApp",exec);
|
||||
- } else {
|
||||
+ QDBusInterface iface("com.kylin.AppManager",
|
||||
+ "/com/kylin/AppManager",
|
||||
+ "com.kylin.AppManager",
|
||||
+ QDBusConnection::sessionBus());
|
||||
+ QDBusReply<bool> reply;
|
||||
+ if (iface.isValid()) {
|
||||
+ reply = iface.call("LaunchApp",exec);
|
||||
+ }
|
||||
+ if (!iface.isValid() || !reply.isValid() || !reply) {
|
||||
GDesktopAppInfo * appinfo=g_desktop_app_info_new_from_filename(xdg.fileName().toStdString().data());
|
||||
if (!g_app_info_launch_uris(G_APP_INFO(appinfo),nullptr, nullptr, nullptr)) {
|
||||
showQMessage =true;
|
||||
diff --git a/plugin-taskbar/quicklaunchaction.h b/plugin-taskbar/quicklaunchaction.h
|
||||
index 8aa9854..02e0c40 100644
|
||||
--- a/plugin-taskbar/quicklaunchaction.h
|
||||
+++ b/plugin-taskbar/quicklaunchaction.h
|
||||
@@ -71,7 +71,6 @@ private:
|
||||
bool m_valid;
|
||||
QList<QAction *> m_addtitionalActions;
|
||||
bool m_tabletMode;
|
||||
- bool getCurrentMode();
|
||||
};
|
||||
|
||||
#endif
|
|
@ -0,0 +1,44 @@
|
|||
From: cckylin-cibot <cckylin-cibot@kylinos.cn>
|
||||
Date: Thu, 30 Jun 2022 08:30:17 +0000
|
||||
Subject: =?utf-8?b?ITQgd2F5bGFuZOmAgumFjWRlc2t0b3Dmlofku7bkv67mlLk=?=
|
||||
|
||||
---
|
||||
panel/CMakeLists.txt | 6 ++++++
|
||||
panel/resources/ukui-panel.desktop | 3 ++-
|
||||
2 files changed, 8 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/panel/CMakeLists.txt b/panel/CMakeLists.txt
|
||||
index ccea40c..0aed8cf 100644
|
||||
--- a/panel/CMakeLists.txt
|
||||
+++ b/panel/CMakeLists.txt
|
||||
@@ -171,6 +171,12 @@ install(FILES
|
||||
COMPONENT Runtime
|
||||
)
|
||||
|
||||
+install(FILES
|
||||
+ resources/ukui-panel.desktop
|
||||
+ DESTINATION "/usr/share/applications/"
|
||||
+ COMPONENT Runtime
|
||||
+)
|
||||
+
|
||||
install(DIRECTORY
|
||||
./img/
|
||||
DESTINATION "${PACKAGE_DATA_DIR}/panel/img"
|
||||
diff --git a/panel/resources/ukui-panel.desktop b/panel/resources/ukui-panel.desktop
|
||||
index 4d5fe8a..785f5a6 100644
|
||||
--- a/panel/resources/ukui-panel.desktop
|
||||
+++ b/panel/resources/ukui-panel.desktop
|
||||
@@ -2,7 +2,7 @@
|
||||
Name=ukui-panel
|
||||
comment=Panel
|
||||
Comment[zh_CN]=任务栏
|
||||
-Exec=ukui-panel
|
||||
+Exec=/usr/bin/ukui-panel
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Icon=panel
|
||||
@@ -10,3 +10,4 @@ X-UKUI-AutoRestart=true
|
||||
OnlyShowIn=UKUI
|
||||
NoDisplay=true
|
||||
X-UKUI-Autostart-Phase=Panel
|
||||
+X-KDE-Wayland-Interfaces=org_kde_plasma_window_management,org_kde_plasma_activation_feedback,org_kde_kwin_keystate,org_kde_kwin_fake_input,zkde_screencast_unstable_v1
|
|
@ -0,0 +1,129 @@
|
|||
From: cckylin-cibot <cckylin-cibot@kylinos.cn>
|
||||
Date: Thu, 30 Jun 2022 08:35:40 +0000
|
||||
Subject: =?utf-8?b?ITkg5L+u5aSNd2F5bGFuZOS4i+aJmOebmOaXpeWOhuS9jee9rumXrg==?=
|
||||
=?utf-8?b?6aKY?=
|
||||
|
||||
---
|
||||
.../lunarcalendarwidget/lunarcalendaritem.cpp | 2 +-
|
||||
plugin-calendar/ukuicalendar.cpp | 44 +++++++++++++++-------
|
||||
2 files changed, 31 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/plugin-calendar/lunarcalendarwidget/lunarcalendaritem.cpp b/plugin-calendar/lunarcalendarwidget/lunarcalendaritem.cpp
|
||||
index ab6951c..18c9635 100644
|
||||
--- a/plugin-calendar/lunarcalendarwidget/lunarcalendaritem.cpp
|
||||
+++ b/plugin-calendar/lunarcalendarwidget/lunarcalendaritem.cpp
|
||||
@@ -328,7 +328,7 @@ void LunarCalendarItem::drawLunar(QPainter *painter)
|
||||
int day;
|
||||
QString strHoliday;
|
||||
QLocale locale = (QLocale::system().name() == "zh_CN" ? (QLocale::Chinese) : (QLocale::English));
|
||||
- qDebug()<<"LunarCalendarItem语言模式:"<<locale;
|
||||
+ //qDebug()<<"LunarCalendarItem语言模式:"<<locale;
|
||||
painter->save();
|
||||
|
||||
if (!showLunar) {
|
||||
diff --git a/plugin-calendar/ukuicalendar.cpp b/plugin-calendar/ukuicalendar.cpp
|
||||
index 92b77b7..059f70d 100644
|
||||
--- a/plugin-calendar/ukuicalendar.cpp
|
||||
+++ b/plugin-calendar/ukuicalendar.cpp
|
||||
@@ -48,6 +48,8 @@
|
||||
#include <QSettings>
|
||||
#include <QDir>
|
||||
|
||||
+#include "kysdk/applications/windowmanager/windowmanager.h"
|
||||
+
|
||||
#define CALENDAR_HEIGHT (46)
|
||||
#define CALENDAR_WIDTH (104)
|
||||
|
||||
@@ -482,8 +484,12 @@ void IndicatorCalendar::CalendarWidgetShow()
|
||||
if (iScreenHeight >= WEBVIEW_MIN_HEIGHT)
|
||||
mViewHeight = WEBVIEW_MIN_HEIGHT;;
|
||||
}
|
||||
- if(qgetenv("XDG_SESSION_TYPE")=="wayland") mWebViewDiag->setGeometry(calculatePopupWindowPos(QSize(mViewWidht+POPUP_BORDER_SPACING,mViewHeight+POPUP_BORDER_SPACING)));
|
||||
- else modifyCalendarWidget();
|
||||
+ if(qgetenv("XDG_SESSION_TYPE")=="wayland") {
|
||||
+ kdk::WindowManager::setGeometry(mWebViewDiag->windowHandle(),
|
||||
+ calculatePopupWindowPos(QSize(mViewWidht+POPUP_BORDER_SPACING,mViewHeight+POPUP_BORDER_SPACING)));
|
||||
+ } else {
|
||||
+ modifyCalendarWidget();
|
||||
+ }
|
||||
#if 0
|
||||
mWebViewDiag->show();
|
||||
mWebViewDiag->activateWindow();
|
||||
@@ -569,22 +575,27 @@ void IndicatorCalendar::modifyCalendarWidget()
|
||||
{
|
||||
int totalHeight = qApp->primaryScreen()->size().height() + qApp->primaryScreen()->geometry().y();
|
||||
int totalWidth = qApp->primaryScreen()->size().width() + qApp->primaryScreen()->geometry().x();
|
||||
-
|
||||
+ QRect rect;
|
||||
switch (panel()->position()) {
|
||||
case IUKUIPanel::PositionBottom:
|
||||
- mWebViewDiag->setGeometry(totalWidth-mViewWidht-4,totalHeight-panel()->panelSize()-mViewHeight-4,mViewWidht,mViewHeight);
|
||||
+ rect.setRect(totalWidth-mViewWidht-4,totalHeight-panel()->panelSize()-mViewHeight-4,mViewWidht,mViewHeight);
|
||||
+ kdk::WindowManager::setGeometry(mWebViewDiag->windowHandle(),rect);
|
||||
break;
|
||||
case IUKUIPanel::PositionTop:
|
||||
- mWebViewDiag->setGeometry(totalWidth-mViewWidht-4,qApp->primaryScreen()->geometry().y()+panel()->panelSize()+4,mViewWidht,mViewHeight);
|
||||
+ rect.setRect(totalWidth-mViewWidht-4,qApp->primaryScreen()->geometry().y()+panel()->panelSize()+4,mViewWidht,mViewHeight);
|
||||
+ kdk::WindowManager::setGeometry(mWebViewDiag->windowHandle(),rect);
|
||||
break;
|
||||
case IUKUIPanel::PositionLeft:
|
||||
- mWebViewDiag->setGeometry(qApp->primaryScreen()->geometry().x()+panel()->panelSize()+4,totalHeight-mViewHeight-4,mViewWidht,mViewHeight);
|
||||
+ rect.setRect(qApp->primaryScreen()->geometry().x()+panel()->panelSize()+4,totalHeight-mViewHeight-4,mViewWidht,mViewHeight);
|
||||
+ kdk::WindowManager::setGeometry(mWebViewDiag->windowHandle(),rect);
|
||||
break;
|
||||
case IUKUIPanel::PositionRight:
|
||||
- mWebViewDiag->setGeometry(totalWidth-panel()->panelSize()-mViewWidht-4,totalHeight-mViewHeight-4,mViewWidht,mViewHeight);
|
||||
+ rect.setRect(totalWidth-panel()->panelSize()-mViewWidht-4,totalHeight-mViewHeight-4,mViewWidht,mViewHeight);
|
||||
+ kdk::WindowManager::setGeometry(mWebViewDiag->windowHandle(),rect);
|
||||
break;
|
||||
default:
|
||||
- mWebViewDiag->setGeometry(qApp->primaryScreen()->geometry().x()+panel()->panelSize()+4,totalHeight-mViewHeight,mViewWidht,mViewHeight);
|
||||
+ rect.setRect(qApp->primaryScreen()->geometry().x()+panel()->panelSize()+4,totalHeight-mViewHeight,mViewWidht,mViewHeight);
|
||||
+ kdk::WindowManager::setGeometry(mWebViewDiag->windowHandle(),rect);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -647,24 +658,28 @@ void CalendarActiveLabel::changeWidowpos()
|
||||
{
|
||||
int totalHeight = qApp->primaryScreen()->size().height() + qApp->primaryScreen()->geometry().y();
|
||||
int totalWidth = qApp->primaryScreen()->size().width() + qApp->primaryScreen()->geometry().x();
|
||||
+ QRect rect;
|
||||
switch (mPlugin->panel()->position()) {
|
||||
case IUKUIPanel::PositionBottom:
|
||||
- w->setGeometry(totalWidth-mViewWidht-4,totalHeight-mPlugin->panel()->panelSize()-mViewHeight-4-changeHight,mViewWidht,mViewHeight);
|
||||
+ rect.setRect(totalWidth-mViewWidht-4,totalHeight-mPlugin->panel()->panelSize()-mViewHeight-4-changeHight,mViewWidht,mViewHeight);
|
||||
break;
|
||||
case IUKUIPanel::PositionTop:
|
||||
- w->setGeometry(totalWidth-mViewWidht-4,qApp->primaryScreen()->geometry().y()+mPlugin->panel()->panelSize()+4,mViewWidht,mViewHeight);
|
||||
+ rect.setRect(totalWidth-mViewWidht-4,qApp->primaryScreen()->geometry().y()+mPlugin->panel()->panelSize()+4,mViewWidht,mViewHeight);
|
||||
break;
|
||||
case IUKUIPanel::PositionLeft:
|
||||
- w->setGeometry(qApp->primaryScreen()->geometry().x()+mPlugin->panel()->panelSize()+4,totalHeight-mViewHeight-4-changeHight,mViewWidht,mViewHeight);
|
||||
+ rect.setRect(qApp->primaryScreen()->geometry().x()+mPlugin->panel()->panelSize()+4,totalHeight-mViewHeight-4-changeHight,mViewWidht,mViewHeight);
|
||||
break;
|
||||
case IUKUIPanel::PositionRight:
|
||||
- w->setGeometry(totalWidth-mPlugin->panel()->panelSize()-mViewWidht-4,totalHeight-mViewHeight-4-changeHight,mViewWidht,mViewHeight);
|
||||
+ rect.setRect(totalWidth-mPlugin->panel()->panelSize()-mViewWidht-4,totalHeight-mViewHeight-4-changeHight,mViewWidht,mViewHeight);
|
||||
break;
|
||||
default:
|
||||
- w->setGeometry(qApp->primaryScreen()->geometry().x()+mPlugin->panel()->panelSize()+4,totalHeight-mViewHeight,mViewWidht,mViewHeight);
|
||||
+ rect.setRect(qApp->primaryScreen()->geometry().x()+mPlugin->panel()->panelSize()+4,totalHeight-mViewHeight,mViewWidht,mViewHeight);
|
||||
break;
|
||||
}
|
||||
+ qDebug() << rect;
|
||||
w->show();
|
||||
+ kdk::WindowManager::setGeometry(w->windowHandle(),rect);
|
||||
+
|
||||
}
|
||||
|
||||
void CalendarActiveLabel::contextMenuEvent(QContextMenuEvent *event)
|
||||
@@ -676,7 +691,8 @@ void CalendarActiveLabel::contextMenuEvent(QContextMenuEvent *event)
|
||||
tr("Time and Date Setting"),
|
||||
this, SLOT(setControlTime())
|
||||
);
|
||||
- menuCalender->setGeometry(mPlugin->panel()->calculatePopupWindowPos(mapToGlobal(event->pos()), menuCalender->sizeHint()));
|
||||
+ kdk::WindowManager::setGeometry(menuCalender->windowHandle(),
|
||||
+ mPlugin->panel()->calculatePopupWindowPos(mapToGlobal(event->pos()), menuCalender->sizeHint()));
|
||||
menuCalender->show();
|
||||
}
|
||||
|
|
@ -0,0 +1,93 @@
|
|||
From: cckylin-cibot <cckylin-cibot@kylinos.cn>
|
||||
Date: Mon, 4 Jul 2022 07:38:30 +0000
|
||||
Subject: =?utf-8?b?KkZpeDojMTI1MzEyIOaJmOebmOWbvuagh+minOiJsuacquWPjeeZvQ==?=
|
||||
|
||||
---
|
||||
plugin-statusnotifier/statusnotifierbutton.cpp | 34 +++-----------------------
|
||||
plugin-statusnotifier/statusnotifierbutton.h | 1 -
|
||||
2 files changed, 3 insertions(+), 32 deletions(-)
|
||||
|
||||
diff --git a/plugin-statusnotifier/statusnotifierbutton.cpp b/plugin-statusnotifier/statusnotifierbutton.cpp
|
||||
index 241774f..0394840 100644
|
||||
--- a/plugin-statusnotifier/statusnotifierbutton.cpp
|
||||
+++ b/plugin-statusnotifier/statusnotifierbutton.cpp
|
||||
@@ -35,7 +35,6 @@
|
||||
#include "../panel/iukuipanelplugin.h"
|
||||
#include "sniasync.h"
|
||||
#include "../panel/customstyle.h"
|
||||
-#include "../panel/highlight-effect.h"
|
||||
#include <QDebug>
|
||||
#include <KWindowEffects>
|
||||
//#include <XdgIcon>
|
||||
@@ -106,7 +105,7 @@ StatusNotifierButton::StatusNotifierButton(QString service, QString objectPath,
|
||||
refetchIcon(Passive);
|
||||
refetchIcon(NeedsAttention);
|
||||
});
|
||||
- this->setProperty("useIconHighlightEffect", 0x2);
|
||||
+ this->setProperty("useIconHighlightEffect", 0x10);
|
||||
newToolTip();
|
||||
systemThemeChanges();
|
||||
|
||||
@@ -194,9 +193,7 @@ void StatusNotifierButton::refetchIcon(Status status)
|
||||
}
|
||||
}
|
||||
}
|
||||
- nextIcon=HighLightEffect::drawSymbolicColoredIcon(nextIcon);
|
||||
-
|
||||
- switch (status)
|
||||
+ switch (status)
|
||||
{
|
||||
case Active:
|
||||
mOverlayIcon = nextIcon;
|
||||
@@ -231,12 +228,9 @@ void StatusNotifierButton::refetchIcon(Status status)
|
||||
for (const uchar *src = image.constBits(); src < end; src += 4, dest += 4)
|
||||
qToUnaligned(qToBigEndian<quint32>(qFromUnaligned<quint32>(src)), dest);
|
||||
|
||||
- //图标反白
|
||||
- QImage currentImage= getBlackThemeIcon(image);
|
||||
- nextIcon.addPixmap(QPixmap::fromImage(currentImage));
|
||||
+ nextIcon.addPixmap(QPixmap::fromImage(image));
|
||||
}
|
||||
}
|
||||
-
|
||||
switch (status)
|
||||
{
|
||||
case Active:
|
||||
@@ -521,25 +515,3 @@ QString StatusNotifierButton::hideAbleStatusNotifierButton()
|
||||
});
|
||||
return mId;
|
||||
}
|
||||
-
|
||||
-QImage StatusNotifierButton::getBlackThemeIcon(QImage image)
|
||||
-{
|
||||
- QColor standard (31,32,34);
|
||||
- for (int x = 0; x < image.width(); x++) {
|
||||
- for (int y = 0; y < image.height(); y++) {
|
||||
- auto color = image.pixelColor(x, y);
|
||||
- if (color.alpha() > 0) {
|
||||
- if(qAbs(color.red()-standard.red())<20 && qAbs(color.green()-standard.green())<20 && qAbs(color.blue()-standard.blue())<20){
|
||||
- color.setRed(255);
|
||||
- color.setGreen(255);
|
||||
- color.setBlue(255);
|
||||
- image.setPixelColor(x, y, color);
|
||||
- }
|
||||
- else{
|
||||
- image.setPixelColor(x, y, color);
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
- return image;
|
||||
-}
|
||||
diff --git a/plugin-statusnotifier/statusnotifierbutton.h b/plugin-statusnotifier/statusnotifierbutton.h
|
||||
index a4e7460..ff90562 100644
|
||||
--- a/plugin-statusnotifier/statusnotifierbutton.h
|
||||
+++ b/plugin-statusnotifier/statusnotifierbutton.h
|
||||
@@ -92,7 +92,6 @@ public:
|
||||
};
|
||||
QString hideAbleStatusNotifierButton();
|
||||
static QString mimeDataFormat() { return QLatin1String("x-ukui/statusnotifier-button"); }
|
||||
- QImage getBlackThemeIcon(QImage image);
|
||||
|
||||
public slots:
|
||||
void newIcon();
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,37 @@
|
|||
From: cckylin-cibot <cckylin-cibot@kylinos.cn>
|
||||
Date: Mon, 11 Jul 2022 09:19:57 +0000
|
||||
Subject: =?utf-8?b?ITE1ICN1cHN0cmVhbTog5Yig6Zmk5aSa5L2Z55qEd2lkZ2V0ICogI3Vw?=
|
||||
=?utf-8?b?c3RyZWFtOiDliKDpmaTlpJrkvZnnmoR3aWRnZXQgKiDlsIbliKTmlq3lubPmnb8=?=
|
||||
=?utf-8?b?54m55oCn5o6l5Y+j5pS55Li65Yik5patQXBwTWFuYWdlcuaOpeWPo+aYr+WQpg==?=
|
||||
=?utf-8?b?5a2Y5Zyo?=
|
||||
|
||||
---
|
||||
panel/ukuipanel.cpp | 14 +++-----------
|
||||
1 file changed, 3 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/panel/ukuipanel.cpp b/panel/ukuipanel.cpp
|
||||
index 4a65fdd..1751f48 100644
|
||||
--- a/panel/ukuipanel.cpp
|
||||
+++ b/panel/ukuipanel.cpp
|
||||
@@ -181,18 +181,10 @@ UKUIPanel::UKUIPanel(const QString &configGroup, UKUi::Settings *settings, QWidg
|
||||
PanelCommission::panelConfigFileReset(true);
|
||||
qDebug()<<"Panel :: PanelCommission config finished";
|
||||
|
||||
-
|
||||
- //UKUIPanel (inherits QFrame) -> lav (QGridLayout) -> UKUIPanelWidget (QFrame) -> UKUIPanelLayout
|
||||
- UKUIPanelWidget = new QFrame(this);
|
||||
- UKUIPanelWidget->setObjectName("BackgroundWidget");
|
||||
- QGridLayout* lav = new QGridLayout();
|
||||
- lav->setContentsMargins(0, 0, 0, 0);
|
||||
- setLayout(lav);
|
||||
- this->layout()->addWidget(UKUIPanelWidget);
|
||||
-
|
||||
- m_layout = new UKUIPanelLayout(UKUIPanelWidget);
|
||||
+ m_layout = new UKUIPanelLayout(this);
|
||||
+ m_layout->setContentsMargins(0, 0, 0, 0);
|
||||
connect(m_layout, &UKUIPanelLayout::pluginMoved, this, &UKUIPanel::pluginMoved);
|
||||
- UKUIPanelWidget->setLayout(m_layout);
|
||||
+ this->setLayout(m_layout);
|
||||
m_layout->setLineCount(m_lineCount);
|
||||
|
||||
mDelaySave.setSingleShot(true);
|
|
@ -0,0 +1,23 @@
|
|||
From: buxiaoqing <buxiaoqing@kylinos.cn>
|
||||
Date: Thu, 14 Jul 2022 21:22:21 +0800
|
||||
Subject: =?utf-8?b?6aKE6KeI5Zu+5pi+56S65Zu+5qCH?=
|
||||
|
||||
---
|
||||
plugin-taskbar/ukuitaskgroup.cpp | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/plugin-taskbar/ukuitaskgroup.cpp b/plugin-taskbar/ukuitaskgroup.cpp
|
||||
index de02962..50c4767 100644
|
||||
--- a/plugin-taskbar/ukuitaskgroup.cpp
|
||||
+++ b/plugin-taskbar/ukuitaskgroup.cpp
|
||||
@@ -1379,7 +1379,9 @@ void UKUITaskGroup::showAllWindowByThumbnail()
|
||||
btn->setThumbScale(true);
|
||||
}
|
||||
}
|
||||
- btn->setThumbNail(btn->windowIcon().pixmap(100,100));
|
||||
+
|
||||
+ QIcon ico = KWindowSystem::icon(it.key());
|
||||
+ btn->setThumbNail(ico.pixmap(QSize(160,160)));
|
||||
btn->updateTitle();
|
||||
btn->setFixedSize((int)imgWidth, (int)imgHeight);
|
||||
m_widget->layout()->setContentsMargins(0,0,0,0);
|
|
@ -0,0 +1,212 @@
|
|||
From: buxiaoqing <buxiaoqing@kylinos.cn>
|
||||
Date: Sat, 16 Jul 2022 10:57:04 +0800
|
||||
Subject: =?utf-8?b?Y2hhbmdlbG9n5pu05paw5bey5L+u5aSNQlVH?=
|
||||
|
||||
---
|
||||
panel/translation/panel_zh_CN.ts | 2 +-
|
||||
panel/ukuipanel.cpp | 117 ++++++++++++++-------------------------
|
||||
panel/ukuipanel.h | 2 +
|
||||
plugin-taskbar/ukuitaskgroup.cpp | 2 +-
|
||||
4 files changed, 45 insertions(+), 78 deletions(-)
|
||||
|
||||
diff --git a/panel/translation/panel_zh_CN.ts b/panel/translation/panel_zh_CN.ts
|
||||
index 4d528f0..4a40f9f 100644
|
||||
--- a/panel/translation/panel_zh_CN.ts
|
||||
+++ b/panel/translation/panel_zh_CN.ts
|
||||
@@ -85,7 +85,7 @@
|
||||
<message>
|
||||
<location filename="../ukuipanel.cpp" line="1471"/>
|
||||
<source>About Kylin</source>
|
||||
- <translation>关于麒麟</translation>
|
||||
+ <translation>关于开放麒麟</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukuipanel.cpp" line="1636"/>
|
||||
diff --git a/panel/ukuipanel.cpp b/panel/ukuipanel.cpp
|
||||
index 1751f48..e9cb995 100644
|
||||
--- a/panel/ukuipanel.cpp
|
||||
+++ b/panel/ukuipanel.cpp
|
||||
@@ -501,13 +501,7 @@ void UKUIPanel::priScreenChanged(int x, int y, int width, int height)
|
||||
realign();
|
||||
}
|
||||
|
||||
-/*
|
||||
- The setting frame of the old panel does not follow the main screen
|
||||
- but can be displayed on any screen
|
||||
- but the current desktop environment of ukui is set to follow the main screen
|
||||
- All default parameters desktop()->screenGeometry are 0
|
||||
- */
|
||||
-void UKUIPanel::setPanelGeometry(bool animate)
|
||||
+QRect UKUIPanel::caculPanelGeometry()
|
||||
{
|
||||
QRect currentScreen;
|
||||
QRect rect;
|
||||
@@ -516,33 +510,10 @@ void UKUIPanel::setPanelGeometry(bool animate)
|
||||
|
||||
if (isHorizontal()) {
|
||||
rect.setHeight(qMax(PANEL_MINIMUM_SIZE, m_panelSize));
|
||||
- if (m_lengthInPercents)
|
||||
- rect.setWidth(currentScreen.width() * m_length / 100.0);
|
||||
- else{
|
||||
- if (m_length <= 0)
|
||||
- rect.setWidth(currentScreen.width() + m_length);
|
||||
- else
|
||||
- rect.setWidth(m_length);
|
||||
- }
|
||||
+ rect.setWidth(currentScreen.width());
|
||||
rect.setWidth(qMax(rect.size().width(), m_layout->minimumSize().width()));
|
||||
|
||||
- // Horiz ......................
|
||||
- switch (m_alignment)
|
||||
- {
|
||||
- case UKUIPanel::AlignmentLeft:
|
||||
- rect.moveLeft(currentScreen.left());
|
||||
- break;
|
||||
-
|
||||
- case UKUIPanel::AlignmentCenter:
|
||||
- rect.moveCenter(currentScreen.center());
|
||||
- break;
|
||||
-
|
||||
- case UKUIPanel::AlignmentRight:
|
||||
- rect.moveRight(currentScreen.right());
|
||||
- break;
|
||||
- }
|
||||
-
|
||||
- // Vert .......................
|
||||
+ // Horiz panel***************************
|
||||
if (m_position == IUKUIPanel::PositionTop) {
|
||||
if (m_hidden)
|
||||
rect.moveBottom(currentScreen.top() + PANEL_HIDE_SIZE);
|
||||
@@ -558,34 +529,9 @@ void UKUIPanel::setPanelGeometry(bool animate)
|
||||
} else {
|
||||
// Vert panel ***************************
|
||||
rect.setWidth(qMax(PANEL_MINIMUM_SIZE, m_panelSize));
|
||||
- if (m_lengthInPercents)
|
||||
- rect.setHeight(currentScreen.height() * m_length / 100.0);
|
||||
- else {
|
||||
- if (m_length <= 0)
|
||||
- rect.setHeight(currentScreen.height() + m_length);
|
||||
- else
|
||||
- rect.setHeight(m_length);
|
||||
- }
|
||||
-
|
||||
+ rect.setHeight(currentScreen.height());
|
||||
rect.setHeight(qMax(rect.size().height(), m_layout->minimumSize().height()));
|
||||
|
||||
- // Vert .......................
|
||||
- switch (m_alignment)
|
||||
- {
|
||||
- case UKUIPanel::AlignmentLeft:
|
||||
- rect.moveTop(currentScreen.top());
|
||||
- break;
|
||||
-
|
||||
- case UKUIPanel::AlignmentCenter:
|
||||
- rect.moveCenter(currentScreen.center());
|
||||
- break;
|
||||
-
|
||||
- case UKUIPanel::AlignmentRight:
|
||||
- rect.moveBottom(currentScreen.bottom());
|
||||
- break;
|
||||
- }
|
||||
-
|
||||
- // Horiz ......................
|
||||
if (m_position == IUKUIPanel::PositionLeft) {
|
||||
if (m_hidden)
|
||||
rect.moveRight(currentScreen.left() + PANEL_HIDE_SIZE);
|
||||
@@ -598,26 +544,27 @@ void UKUIPanel::setPanelGeometry(bool animate)
|
||||
rect.moveRight(currentScreen.right());
|
||||
}
|
||||
}
|
||||
+ return rect;
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ The setting frame of the old panel does not follow the main screen
|
||||
+ but can be displayed on any screen
|
||||
+ but the current desktop environment of ukui is set to follow the main screen
|
||||
+ All default parameters desktop()->screenGeometry are 0
|
||||
+ */
|
||||
+void UKUIPanel::setPanelGeometry(bool animate)
|
||||
+{
|
||||
+ QRect currentScreen;
|
||||
+ QRect rect;
|
||||
+
|
||||
+ currentScreen=QGuiApplication::screens().at(0)->geometry();
|
||||
+ rect = caculPanelGeometry();
|
||||
+
|
||||
if (rect != geometry()) {
|
||||
setFixedSize(rect.size());
|
||||
- if (animate) {
|
||||
- if (m_animation == nullptr) {
|
||||
- m_animation = new QPropertyAnimation(this, "geometry");
|
||||
- m_animation->setEasingCurve(QEasingCurve::Linear);
|
||||
- //Note: for hiding, the margins are set after animation is finished
|
||||
- connect(m_animation, &QAbstractAnimation::finished, [this] { if (m_hidden) setMargins(); });
|
||||
- }
|
||||
- m_animation->setDuration(m_animationTime);
|
||||
- m_animation->setStartValue(geometry());
|
||||
- m_animation->setEndValue(rect);
|
||||
- //Note: for showing-up, the margins are removed instantly
|
||||
- if (!m_hidden)
|
||||
- setMargins();
|
||||
- m_animation->start();
|
||||
- } else {
|
||||
- setMargins();
|
||||
- kdk::WindowManager::setGeometry(this->windowHandle(), rect);
|
||||
- }
|
||||
+ setMargins();
|
||||
+ kdk::WindowManager::setGeometry(this->windowHandle(), rect);
|
||||
}
|
||||
QDBusMessage message =QDBusMessage::createSignal("/panel/position", "org.ukui.panel", "UKuiPanelPosition");
|
||||
QList<QVariant> args;
|
||||
@@ -631,6 +578,24 @@ void UKUIPanel::setPanelGeometry(bool animate)
|
||||
QDBusConnection::sessionBus().send(message);
|
||||
}
|
||||
|
||||
+void UKUIPanel::setPanelAnimation(QRect startrect, QRect endrect)
|
||||
+{
|
||||
+ if (m_animation == nullptr) {
|
||||
+ m_animation = new QPropertyAnimation(this, "geometry");
|
||||
+ m_animation->setEasingCurve(QEasingCurve::Linear);
|
||||
+ //Note: for hiding, the margins are set after animation is finished
|
||||
+ connect(m_animation, &QAbstractAnimation::finished, [this] { if (m_hidden) setMargins(); });
|
||||
+ }
|
||||
+ m_animation->setDuration(m_animationTime);
|
||||
+ m_animation->setStartValue(startrect);
|
||||
+ m_animation->setEndValue(endrect);
|
||||
+ //Note: for showing-up, the margins are removed instantly
|
||||
+ if (!m_hidden) {
|
||||
+ setMargins();
|
||||
+ }
|
||||
+ m_animation->start();
|
||||
+}
|
||||
+
|
||||
/*设置边距*/
|
||||
void UKUIPanel::setMargins()
|
||||
{
|
||||
diff --git a/panel/ukuipanel.h b/panel/ukuipanel.h
|
||||
index 8a88842..1547f0d 100644
|
||||
--- a/panel/ukuipanel.h
|
||||
+++ b/panel/ukuipanel.h
|
||||
@@ -512,6 +512,8 @@ private:
|
||||
* \param animate flag if showing/hiding the panel should be animated.
|
||||
*/
|
||||
void setPanelGeometry(bool animate = false);
|
||||
+ QRect caculPanelGeometry();
|
||||
+ void setPanelAnimation(QRect startrect, QRect endrect);
|
||||
/**
|
||||
* @brief Sets the contents margins of the panel according to its position
|
||||
* and hiddenness. All margins are zero for visible panels.
|
||||
diff --git a/plugin-taskbar/ukuitaskgroup.cpp b/plugin-taskbar/ukuitaskgroup.cpp
|
||||
index 50c4767..596cda5 100644
|
||||
--- a/plugin-taskbar/ukuitaskgroup.cpp
|
||||
+++ b/plugin-taskbar/ukuitaskgroup.cpp
|
||||
@@ -1380,7 +1380,7 @@ void UKUITaskGroup::showAllWindowByThumbnail()
|
||||
}
|
||||
}
|
||||
|
||||
- QIcon ico = KWindowSystem::icon(it.key());
|
||||
+ QIcon ico = WindowManager::getWindowIcon((WindowId)(it.key()));
|
||||
btn->setThumbNail(ico.pixmap(QSize(160,160)));
|
||||
btn->updateTitle();
|
||||
btn->setFixedSize((int)imgWidth, (int)imgHeight);
|
|
@ -0,0 +1,20 @@
|
|||
From: Xin Li <lixin@kylinos.cn>
|
||||
Date: Mon, 18 Jul 2022 15:47:35 +0800
|
||||
Subject: =?utf-8?b?YnVpbGQoZGViaWFuKTog5L+u5pS5Y2hhbmdlbG9n?=
|
||||
|
||||
---
|
||||
plugin-calendar/lunarcalendarwidget/frmlunarcalendarwidget.cpp | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/plugin-calendar/lunarcalendarwidget/frmlunarcalendarwidget.cpp b/plugin-calendar/lunarcalendarwidget/frmlunarcalendarwidget.cpp
|
||||
index df83425..5b773b5 100644
|
||||
--- a/plugin-calendar/lunarcalendarwidget/frmlunarcalendarwidget.cpp
|
||||
+++ b/plugin-calendar/lunarcalendarwidget/frmlunarcalendarwidget.cpp
|
||||
@@ -60,6 +60,7 @@ frmLunarCalendarWidget::frmLunarCalendarWidget(QWidget *parent) : QWidget(parent
|
||||
ckShowLunar_stateChanged(false);
|
||||
cboxWeekNameFormat_currentIndexChanged(false);
|
||||
}
|
||||
+ setProperty("useStyleWindowManager",false);
|
||||
}
|
||||
|
||||
frmLunarCalendarWidget::~frmLunarCalendarWidget()
|
|
@ -0,0 +1,24 @@
|
|||
From: openKylin CI Bot <10071196+openkylin-cibot@user.noreply.gitee.com>
|
||||
Date: Mon, 18 Jul 2022 08:43:28 +0000
|
||||
Subject: =?utf-8?b?ITE4IGZpeGJ1ZyB3YXlsYW5k5LiLVeebmOiuvuWkh+WIl+ihqOS9jQ==?=
|
||||
=?utf-8?b?572u5byC5bi4IE1lcmdlIHB1bGwgcmVxdWVzdCAhMTggZnJvbSB0aWFudGlhbi9v?=
|
||||
=?utf-8?b?cGVua3lsaW4veWFuZ3R6ZQ==?=
|
||||
|
||||
---
|
||||
ukui-flash-disk/mainwindow.cpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/ukui-flash-disk/mainwindow.cpp b/ukui-flash-disk/mainwindow.cpp
|
||||
index d584c7e..93fabe0 100755
|
||||
--- a/ukui-flash-disk/mainwindow.cpp
|
||||
+++ b/ukui-flash-disk/mainwindow.cpp
|
||||
@@ -2273,8 +2273,8 @@ void MainWindow::MainWindowShow(bool isUpdate)
|
||||
hign = 0;
|
||||
ui->centralWidget->setFixedSize(0, 0);
|
||||
}
|
||||
- moveBottomNoBase();
|
||||
ui->centralWidget->show();
|
||||
+ moveBottomNoBase();
|
||||
}
|
||||
|
||||
void MainWindow::ifgetPinitMount()
|
|
@ -0,0 +1,20 @@
|
|||
From: sunzhen <13820329802@163.com>
|
||||
Date: Mon, 18 Jul 2022 16:31:22 +0800
|
||||
Subject: =?utf-8?b?6YWN5ZCIU0RLICx3b3JrYXJvdW5kIEJVRyMxMjUzNTQ=?=
|
||||
|
||||
---
|
||||
panel/ukuipanel.cpp | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/panel/ukuipanel.cpp b/panel/ukuipanel.cpp
|
||||
index e9cb995..5eb2163 100644
|
||||
--- a/panel/ukuipanel.cpp
|
||||
+++ b/panel/ukuipanel.cpp
|
||||
@@ -564,6 +564,7 @@ void UKUIPanel::setPanelGeometry(bool animate)
|
||||
if (rect != geometry()) {
|
||||
setFixedSize(rect.size());
|
||||
setMargins();
|
||||
+ this->windowHandle()->setProperty("noHide",true);
|
||||
kdk::WindowManager::setGeometry(this->windowHandle(), rect);
|
||||
}
|
||||
QDBusMessage message =QDBusMessage::createSignal("/panel/position", "org.ukui.panel", "UKuiPanelPosition");
|
|
@ -0,0 +1,119 @@
|
|||
From: =?utf-8?b?5L2V5py05bCn?= <18373370753@163.com>
|
||||
Date: Tue, 19 Jul 2022 07:15:41 +0000
|
||||
Subject: =?utf-8?b?ITIyIOino+WGs3Rhc2tiYXLlj7PplK7oj5zljZXkubHpo57nmoTpl64=?=
|
||||
=?utf-8?b?6aKYICYmIOWPs+mUruiPnOWNleWFs+mXremAiemhueS4jeeUn+aViOmXrumimCBN?=
|
||||
=?utf-8?b?ZXJnZSBwdWxsIHJlcXVlc3QgITIyIGZyb20g5Y2c6JCn5bqGL29wZW5reWxpbi95?=
|
||||
=?utf-8?b?YW5ndHpl?=
|
||||
|
||||
---
|
||||
panel/ukuipanel.cpp | 2 ++
|
||||
plugin-startbar/startmenu_button.cpp | 8 ++++----
|
||||
plugin-statusnotifier/statusnotifierbutton.cpp | 3 +--
|
||||
plugin-taskbar/ukuitaskbutton.cpp | 2 +-
|
||||
plugin-taskbar/ukuitaskgroup.cpp | 21 +++------------------
|
||||
5 files changed, 11 insertions(+), 25 deletions(-)
|
||||
|
||||
diff --git a/panel/ukuipanel.cpp b/panel/ukuipanel.cpp
|
||||
index 5eb2163..6587f32 100644
|
||||
--- a/panel/ukuipanel.cpp
|
||||
+++ b/panel/ukuipanel.cpp
|
||||
@@ -301,7 +301,9 @@ void UKUIPanel::setPanelHide(bool model)
|
||||
if (model) {
|
||||
hide();
|
||||
} else {
|
||||
+ setAttribute(Qt::WA_X11NetWmWindowTypeDock);
|
||||
show();
|
||||
+ KWindowSystem::setType(effectiveWinId(), NET::Dock);
|
||||
realign();
|
||||
}
|
||||
}
|
||||
diff --git a/plugin-startbar/startmenu_button.cpp b/plugin-startbar/startmenu_button.cpp
|
||||
index 258f65c..9197f28 100644
|
||||
--- a/plugin-startbar/startmenu_button.cpp
|
||||
+++ b/plugin-startbar/startmenu_button.cpp
|
||||
@@ -87,12 +87,12 @@ void StartMenuButton::mousePressEvent(QMouseEvent* event)
|
||||
|
||||
void StartMenuButton::contextMenuEvent(QContextMenuEvent *event)
|
||||
{
|
||||
- rightPressMenu=new QMenu();
|
||||
+ rightPressMenu=new QMenu(this);
|
||||
rightPressMenu->setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
- QMenu *pUserAction=new QMenu(tr("User Action")); //用户操作
|
||||
- QMenu *pSleepHibernate=new QMenu(tr("Sleep or Hibernate")); //重启或休眠
|
||||
- QMenu *pPowerSupply=new QMenu(tr("Power Supply")); //电源
|
||||
+ QMenu *pUserAction=new QMenu(tr("User Action"), this); //用户操作
|
||||
+ QMenu *pSleepHibernate=new QMenu(tr("Sleep or Hibernate"), this); //重启或休眠
|
||||
+ QMenu *pPowerSupply=new QMenu(tr("Power Supply"), this); //电源
|
||||
rightPressMenu->addMenu(pUserAction);
|
||||
rightPressMenu->addMenu(pSleepHibernate);
|
||||
rightPressMenu->addMenu(pPowerSupply);
|
||||
diff --git a/plugin-statusnotifier/statusnotifierbutton.cpp b/plugin-statusnotifier/statusnotifierbutton.cpp
|
||||
index 0394840..78a6d4f 100644
|
||||
--- a/plugin-statusnotifier/statusnotifierbutton.cpp
|
||||
+++ b/plugin-statusnotifier/statusnotifierbutton.cpp
|
||||
@@ -399,10 +399,9 @@ void StatusNotifierButton::systemThemeChanges()
|
||||
|
||||
void StatusNotifierButton::updataItemMenu()
|
||||
{
|
||||
- mMenu = mMenuImporter->menu();
|
||||
if (mMenu && !mMenu->isEmpty()){
|
||||
mPlugin->willShowWindow(mMenu);
|
||||
- mMenu->exec(mPlugin->panel()->calculatePopupWindowPos(mCursorLeftPos, mMenu->sizeHint()).topLeft()); //任务栏显示右键菜单
|
||||
+ mMenu->exec(mMenuImporter->menu()->actions(), mPlugin->panel()->calculatePopupWindowPos(mCursorLeftPos, mMenu->sizeHint()).topLeft(), nullptr, this); //任务栏显示右键菜单
|
||||
}
|
||||
else{
|
||||
interface->ContextMenu(mCursorLeftPos.x(), mCursorLeftPos.y()); //应用显示右键菜单
|
||||
diff --git a/plugin-taskbar/ukuitaskbutton.cpp b/plugin-taskbar/ukuitaskbutton.cpp
|
||||
index 9776bd4..1b90379 100644
|
||||
--- a/plugin-taskbar/ukuitaskbutton.cpp
|
||||
+++ b/plugin-taskbar/ukuitaskbutton.cpp
|
||||
@@ -948,7 +948,7 @@ void UKUITaskButton::modifyQuicklaunchMenuAction(bool direction)
|
||||
m_deleteAct = new QAction(QIcon::fromTheme("ukui-unfixed"), tr("delete from quicklaunch"), this);
|
||||
connect(m_deleteAct, SIGNAL(triggered()), this, SLOT(selfRemove()));
|
||||
//addAction(m_deleteAct);
|
||||
- m_menu = new QuicklaunchMenu();
|
||||
+ m_menu = new QMenu(this);
|
||||
m_menu->addAction(m_act);
|
||||
m_menu->addActions(m_act->addtitionalActions());
|
||||
m_menu->addSeparator();
|
||||
diff --git a/plugin-taskbar/ukuitaskgroup.cpp b/plugin-taskbar/ukuitaskgroup.cpp
|
||||
index 596cda5..1193bc5 100644
|
||||
--- a/plugin-taskbar/ukuitaskgroup.cpp
|
||||
+++ b/plugin-taskbar/ukuitaskgroup.cpp
|
||||
@@ -239,7 +239,7 @@ void UKUITaskGroup::contextMenuEvent(QContextMenuEvent *event)
|
||||
return;
|
||||
}
|
||||
|
||||
- QMenu * menu = new QMenu(tr("Group"));
|
||||
+ QMenu * menu = new QMenu(this);
|
||||
menu->setAttribute(Qt::WA_DeleteOnClose);
|
||||
if (!m_fileName.isEmpty() && !m_isWaylandGroup) {
|
||||
menu->addAction(m_act);
|
||||
@@ -278,24 +278,9 @@ void UKUITaskGroup::AddtoTaskBar()
|
||||
************************************************/
|
||||
void UKUITaskGroup::closeGroup()
|
||||
{
|
||||
- if (m_isWaylandGroup) {
|
||||
- closeGroup_wl();
|
||||
- return;
|
||||
- }
|
||||
-#if (QT_VERSION < QT_VERSION_CHECK(5,7,0))
|
||||
- for(auto it=m_buttonHash.begin();it!=m_buttonHash.end();it++)
|
||||
- {
|
||||
- UKUITaskWidget *button =it.value();
|
||||
- if (button->isOnDesktop(KWindowSystem::currentDesktop()))
|
||||
- button->closeApplication();
|
||||
+ for (UKUISdkTaskButtonHash::const_iterator it = m_sdkButtonHash.begin(); it != m_sdkButtonHash.end(); ++it) {
|
||||
+ WindowManager::closeWindow(it.key());
|
||||
}
|
||||
-#else
|
||||
- for (UKUITaskWidget *button : qAsConst(m_sdkButtonHash) ) {
|
||||
- if (button->isOnDesktop(KWindowSystem::currentDesktop())) {
|
||||
- button->closeApplication();
|
||||
- }
|
||||
- }
|
||||
-#endif
|
||||
}
|
||||
|
||||
/************************************************
|
|
@ -0,0 +1,128 @@
|
|||
From: =?utf-8?b?5L2V5py05bCn?= <18373370753@163.com>
|
||||
Date: Tue, 19 Jul 2022 07:16:26 +0000
|
||||
Subject: =?utf-8?b?ITIzIOi3s+i/h+S7u+WKoeagj+WxnuaAp+abtOaWsCBNZXJnZSBwdWxs?=
|
||||
=?utf-8?b?IHJlcXVlc3QgITIzIGZyb20g5L2V5py05bCnL29wZW5reWxpbi95YW5ndHpl?=
|
||||
|
||||
---
|
||||
plugin-startbar/startmenu_button.cpp | 4 +-
|
||||
plugin-taskbar/ukuitaskbar.cpp | 80 +++++++++++++++++-------------------
|
||||
2 files changed, 40 insertions(+), 44 deletions(-)
|
||||
|
||||
diff --git a/plugin-startbar/startmenu_button.cpp b/plugin-startbar/startmenu_button.cpp
|
||||
index 9197f28..a1b26b3 100644
|
||||
--- a/plugin-startbar/startmenu_button.cpp
|
||||
+++ b/plugin-startbar/startmenu_button.cpp
|
||||
@@ -107,7 +107,7 @@ void StartMenuButton::contextMenuEvent(QContextMenuEvent *event)
|
||||
this, SLOT(SessionSwitch())
|
||||
); //切换用户
|
||||
}
|
||||
- pUserAction->addAction(QIcon::fromTheme("ukui-system-logout-symbolic"),
|
||||
+ pUserAction->addAction(QIcon::fromTheme("ukui-system-logout-symbolic",QIcon::fromTheme("system-shutdown-symbolic"),
|
||||
tr("Logout"),
|
||||
this, SLOT(SessionLogout())
|
||||
); //注销
|
||||
@@ -125,7 +125,7 @@ void StartMenuButton::contextMenuEvent(QContextMenuEvent *event)
|
||||
this, SLOT(SessionSuspend())
|
||||
); //睡眠
|
||||
}
|
||||
- pPowerSupply->addAction(QIcon::fromTheme("ukui-system-restart-symbolic"),
|
||||
+ pPowerSupply->addAction(QIcon::fromTheme("ukui-system-restart-symbolic",QIcon::fromTheme("system-reboot-symbolic"),
|
||||
tr("Restart"),
|
||||
this, SLOT(SessionReboot())
|
||||
); //重启
|
||||
diff --git a/plugin-taskbar/ukuitaskbar.cpp b/plugin-taskbar/ukuitaskbar.cpp
|
||||
index 7b974a1..41c7885 100644
|
||||
--- a/plugin-taskbar/ukuitaskbar.cpp
|
||||
+++ b/plugin-taskbar/ukuitaskbar.cpp
|
||||
@@ -260,53 +260,49 @@ QList<QMap<QString, QVariant> > UKUITaskBar::copyQuicklaunchConfig()
|
||||
return array;
|
||||
}
|
||||
|
||||
-//bool UKUITaskBar::acceptWindow(WId window) const
|
||||
-//{
|
||||
-// QFlags<NET::WindowTypeMask> ignoreList;
|
||||
-// ignoreList |= NET::DesktopMask;
|
||||
-// ignoreList |= NET::DockMask;
|
||||
-// ignoreList |= NET::SplashMask;
|
||||
-// ignoreList |= NET::ToolbarMask;
|
||||
-// ignoreList |= NET::MenuMask;
|
||||
-// ignoreList |= NET::PopupMenuMask;
|
||||
-// ignoreList |= NET::NotificationMask;
|
||||
-
|
||||
-// KWindowInfo info(window, NET::WMWindowType | NET::WMState, NET::WM2TransientFor);
|
||||
-// if (!info.valid()) {
|
||||
-// return false;
|
||||
-// }
|
||||
-
|
||||
-// if (NET::typeMatchesMask(info.windowType(NET::AllTypesMask), ignoreList)) {
|
||||
-// return false;
|
||||
-// }
|
||||
-
|
||||
-// if (info.state() & NET::SkipTaskbar) {
|
||||
-// return false;
|
||||
-// }
|
||||
-
|
||||
-// // WM_TRANSIENT_FOR hint not set - normal window
|
||||
-// WId transFor = info.transientFor();
|
||||
-// if (transFor == 0 || transFor == window || transFor == (WId) QX11Info::appRootWindow()) {
|
||||
-// return true;
|
||||
-// }
|
||||
-
|
||||
-// info = KWindowInfo(transFor, NET::WMWindowType);
|
||||
-
|
||||
-// QFlags<NET::WindowTypeMask> normalFlag;
|
||||
-// normalFlag |= NET::NormalMask;
|
||||
-// normalFlag |= NET::DialogMask;
|
||||
-// normalFlag |= NET::UtilityMask;
|
||||
-
|
||||
-// return !NET::typeMatchesMask(info.windowType(NET::AllTypesMask), normalFlag);
|
||||
-//}
|
||||
-
|
||||
-bool UKUITaskBar::acceptWindow(const WindowId& window) const
|
||||
+bool UKUITaskBar::acceptWindow(WId window) const
|
||||
{
|
||||
+ QFlags<NET::WindowTypeMask> ignoreList;
|
||||
+ ignoreList |= NET::DesktopMask;
|
||||
+ ignoreList |= NET::DockMask;
|
||||
+ ignoreList |= NET::SplashMask;
|
||||
+ ignoreList |= NET::ToolbarMask;
|
||||
+ ignoreList |= NET::MenuMask;
|
||||
+ ignoreList |= NET::PopupMenuMask;
|
||||
+ ignoreList |= NET::NotificationMask;
|
||||
+
|
||||
+ KWindowInfo info(window, NET::WMWindowType | NET::WMState, NET::WM2TransientFor);
|
||||
+ if (!info.valid()) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ if (NET::typeMatchesMask(info.windowType(NET::AllTypesMask), ignoreList)) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ if (info.state() & NET::SkipTaskbar) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
QString windowTitle = WindowManager::getWindowTitle(window);
|
||||
if (windowTitle == "UKUI Panel" || windowTitle == "桌面") {
|
||||
return false;
|
||||
}
|
||||
- return true;
|
||||
+
|
||||
+ // WM_TRANSIENT_FOR hint not set - normal window
|
||||
+ WId transFor = info.transientFor();
|
||||
+ if (transFor == 0 || transFor == window || transFor == (WId) QX11Info::appRootWindow()) {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ info = KWindowInfo(transFor, NET::WMWindowType);
|
||||
+
|
||||
+ QFlags<NET::WindowTypeMask> normalFlag;
|
||||
+ normalFlag |= NET::NormalMask;
|
||||
+ normalFlag |= NET::DialogMask;
|
||||
+ normalFlag |= NET::UtilityMask;
|
||||
+
|
||||
+ return !NET::typeMatchesMask(info.windowType(NET::AllTypesMask), normalFlag);
|
||||
}
|
||||
|
||||
void UKUITaskBar::dragEnterEvent(QDragEnterEvent* event)
|
|
@ -0,0 +1,22 @@
|
|||
From: =?utf-8?b?5L2V5py05bCn?= <18373370753@163.com>
|
||||
Date: Tue, 19 Jul 2022 07:38:12 +0000
|
||||
Subject: =?utf-8?b?ITI0IOS/ruaUueWktOaWh+S7tueahOWPmOmHj+WjsOaYjiBNZXJnZSBw?=
|
||||
=?utf-8?b?dWxsIHJlcXVlc3QgITI0IGZyb20g5Y2c6JCn5bqGL29wZW5reWxpbi95YW5ndHpl?=
|
||||
|
||||
---
|
||||
plugin-taskbar/ukuitaskbutton.h | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/plugin-taskbar/ukuitaskbutton.h b/plugin-taskbar/ukuitaskbutton.h
|
||||
index 50ae722..c786c6f 100644
|
||||
--- a/plugin-taskbar/ukuitaskbutton.h
|
||||
+++ b/plugin-taskbar/ukuitaskbutton.h
|
||||
@@ -203,7 +203,7 @@ private:
|
||||
///////////////////////////////////
|
||||
QuickLaunchAction *m_act;
|
||||
QAction *m_deleteAct;
|
||||
- QuicklaunchMenu *m_menu;
|
||||
+ QMenu *m_menu;
|
||||
QPoint m_dragStart;
|
||||
TaskButtonStatus m_quickLanuchStatus;
|
||||
CustomStyle m_toolButtonStyle;
|
|
@ -0,0 +1,98 @@
|
|||
From: =?utf-8?b?5L2V5py05bCn?= <18373370753@163.com>
|
||||
Date: Tue, 19 Jul 2022 09:18:06 +0000
|
||||
Subject: =?utf-8?b?ITI2IOino+WGs+S7u+WKoeagj+WkmuWHuuW+iOWkmuaXoOeUqOWbvg==?=
|
||||
=?utf-8?b?5qCH55qE6Zeu6aKYIE1lcmdlIHB1bGwgcmVxdWVzdCAhMjYgZnJvbSDljZzokKc=?=
|
||||
=?utf-8?b?5bqGL29wZW5reWxpbi95YW5ndHpl?=
|
||||
|
||||
---
|
||||
plugin-startbar/startmenu_button.cpp | 10 +++++-----
|
||||
plugin-taskbar/ukuitaskbar.cpp | 20 +++++++++++++++-----
|
||||
plugin-taskbar/ukuitaskbar.h | 2 +-
|
||||
3 files changed, 21 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/plugin-startbar/startmenu_button.cpp b/plugin-startbar/startmenu_button.cpp
|
||||
index a1b26b3..aa46f34 100644
|
||||
--- a/plugin-startbar/startmenu_button.cpp
|
||||
+++ b/plugin-startbar/startmenu_button.cpp
|
||||
@@ -90,9 +90,9 @@ void StartMenuButton::contextMenuEvent(QContextMenuEvent *event)
|
||||
rightPressMenu=new QMenu(this);
|
||||
rightPressMenu->setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
- QMenu *pUserAction=new QMenu(tr("User Action"), this); //用户操作
|
||||
- QMenu *pSleepHibernate=new QMenu(tr("Sleep or Hibernate"), this); //重启或休眠
|
||||
- QMenu *pPowerSupply=new QMenu(tr("Power Supply"), this); //电源
|
||||
+ QMenu *pUserAction=new QMenu(tr("User Action"),this); //用户操作
|
||||
+ QMenu *pSleepHibernate=new QMenu(tr("Sleep or Hibernate"),this); //重启或休眠
|
||||
+ QMenu *pPowerSupply=new QMenu(tr("Power Supply"),this); //电源
|
||||
rightPressMenu->addMenu(pUserAction);
|
||||
rightPressMenu->addMenu(pSleepHibernate);
|
||||
rightPressMenu->addMenu(pPowerSupply);
|
||||
@@ -107,7 +107,7 @@ void StartMenuButton::contextMenuEvent(QContextMenuEvent *event)
|
||||
this, SLOT(SessionSwitch())
|
||||
); //切换用户
|
||||
}
|
||||
- pUserAction->addAction(QIcon::fromTheme("ukui-system-logout-symbolic",QIcon::fromTheme("system-shutdown-symbolic"),
|
||||
+ pUserAction->addAction(QIcon::fromTheme("ukui-system-logout-symbolic"),
|
||||
tr("Logout"),
|
||||
this, SLOT(SessionLogout())
|
||||
); //注销
|
||||
@@ -125,7 +125,7 @@ void StartMenuButton::contextMenuEvent(QContextMenuEvent *event)
|
||||
this, SLOT(SessionSuspend())
|
||||
); //睡眠
|
||||
}
|
||||
- pPowerSupply->addAction(QIcon::fromTheme("ukui-system-restart-symbolic",QIcon::fromTheme("system-reboot-symbolic"),
|
||||
+ pPowerSupply->addAction(QIcon::fromTheme("ukui-system-restart-symbolic"),
|
||||
tr("Restart"),
|
||||
this, SLOT(SessionReboot())
|
||||
); //重启
|
||||
diff --git a/plugin-taskbar/ukuitaskbar.cpp b/plugin-taskbar/ukuitaskbar.cpp
|
||||
index 41c7885..07f286a 100644
|
||||
--- a/plugin-taskbar/ukuitaskbar.cpp
|
||||
+++ b/plugin-taskbar/ukuitaskbar.cpp
|
||||
@@ -284,11 +284,6 @@ bool UKUITaskBar::acceptWindow(WId window) const
|
||||
return false;
|
||||
}
|
||||
|
||||
- QString windowTitle = WindowManager::getWindowTitle(window);
|
||||
- if (windowTitle == "UKUI Panel" || windowTitle == "桌面") {
|
||||
- return false;
|
||||
- }
|
||||
-
|
||||
// WM_TRANSIENT_FOR hint not set - normal window
|
||||
WId transFor = info.transientFor();
|
||||
if (transFor == 0 || transFor == window || transFor == (WId) QX11Info::appRootWindow()) {
|
||||
@@ -305,6 +300,21 @@ bool UKUITaskBar::acceptWindow(WId window) const
|
||||
return !NET::typeMatchesMask(info.windowType(NET::AllTypesMask), normalFlag);
|
||||
}
|
||||
|
||||
+bool UKUITaskBar::acceptWindow(const WindowId& window) const
|
||||
+{
|
||||
+ QString windowTitle = WindowManager::getWindowTitle(window);
|
||||
+ if (windowTitle == "UKUI Panel" || windowTitle == "桌面") {
|
||||
+ return false;
|
||||
+ }
|
||||
+ //临时方案:任务栏屏蔽掉没有窗口图标的窗口
|
||||
+ QIcon windowIcon = WindowManager::getWindowIcon(window);
|
||||
+ if (windowIcon.name() == "" || windowIcon.name() == NULL) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
void UKUITaskBar::dragEnterEvent(QDragEnterEvent* event)
|
||||
{
|
||||
}
|
||||
diff --git a/plugin-taskbar/ukuitaskbar.h b/plugin-taskbar/ukuitaskbar.h
|
||||
index db8254a..6c029d1 100644
|
||||
--- a/plugin-taskbar/ukuitaskbar.h
|
||||
+++ b/plugin-taskbar/ukuitaskbar.h
|
||||
@@ -238,7 +238,7 @@ private:
|
||||
bool m_cycleOnWheelScroll; //!< flag for processing the wheelEvent
|
||||
|
||||
bool acceptWindow(const WindowId& window) const;
|
||||
-// bool acceptWindow(WId window) const;
|
||||
+ bool acceptWindow(WId window) const;
|
||||
void setButtonStyle(Qt::ToolButtonStyle buttonStyle);
|
||||
void settingsChanged();
|
||||
QList<QMap<QString, QVariant> > copyQuicklaunchConfig();
|
|
@ -0,0 +1,41 @@
|
|||
From: =?utf-8?b?5L2V5py05bCn?= <18373370753@163.com>
|
||||
Date: Tue, 19 Jul 2022 13:09:54 +0000
|
||||
Subject: =?utf-8?b?ITI3IOabtOaNouS4tOaXtuaWueahiO+8muWwhuWxj+iUveaJgOaciQ==?=
|
||||
=?utf-8?b?5rKh5pyJ5Zu+5qCH55qE56qX5Y+j5L+u5pS55Li65qC55o2u6buR5ZCN5Y2V6YeM?=
|
||||
=?utf-8?b?55qE6L+b56iL5ZCN5bGP6JS956qX5Y+jIE1lcmdlIHB1bGwgcmVxdWVzdCAhMjcg?=
|
||||
=?utf-8?b?ZnJvbSDljZzokKfluoYvb3Blbmt5bGluL3lhbmd0emU=?=
|
||||
|
||||
---
|
||||
panel/resources/panel-commission.ini | 2 +-
|
||||
plugin-taskbar/ukuitaskbar.cpp | 8 ++++----
|
||||
2 files changed, 5 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/panel/resources/panel-commission.ini b/panel/resources/panel-commission.ini
|
||||
index cfb9939..888f5f2 100755
|
||||
--- a/panel/resources/panel-commission.ini
|
||||
+++ b/panel/resources/panel-commission.ini
|
||||
@@ -13,4 +13,4 @@ CalendarVersion=new
|
||||
trayname=ukui-volume-control-applet-qt,kylin-nm,ukui-sidebar,indicator-china-weather,ukui-flash-disk,fcitx,sogouimebs-qimpanel,fcitx-qimpanel,explorer.exe,ukui-power-manager-tray,baidu-qimpanel,iflyime-qim,hedronagent,CTJManageTool
|
||||
|
||||
[IgnoreWindow]
|
||||
-ignoreWindow=ukui-menu,ukui-sidebar,ukui-search
|
||||
+ignoreWindow=ukui-menu,ukui-sidebar,ukui-search,bluetooth,Form,kylin-nm,ukui-notifications,ukui-power-manager-tray,ukui-volume-control-applet-qt,ukui-flash-disk,ukui-screensaver-dialog
|
||||
diff --git a/plugin-taskbar/ukuitaskbar.cpp b/plugin-taskbar/ukuitaskbar.cpp
|
||||
index 07f286a..88bb592 100644
|
||||
--- a/plugin-taskbar/ukuitaskbar.cpp
|
||||
+++ b/plugin-taskbar/ukuitaskbar.cpp
|
||||
@@ -307,10 +307,10 @@ bool UKUITaskBar::acceptWindow(const WindowId& window) const
|
||||
return false;
|
||||
}
|
||||
//临时方案:任务栏屏蔽掉没有窗口图标的窗口
|
||||
- QIcon windowIcon = WindowManager::getWindowIcon(window);
|
||||
- if (windowIcon.name() == "" || windowIcon.name() == NULL) {
|
||||
- return false;
|
||||
- }
|
||||
+// QIcon windowIcon = WindowManager::getWindowIcon(window);
|
||||
+// if (windowIcon.name() == "" || windowIcon.name() == NULL) {
|
||||
+// return false;
|
||||
+// }
|
||||
|
||||
return true;
|
||||
}
|
|
@ -0,0 +1,118 @@
|
|||
From: =?utf-8?b?5Y2c6JCn5bqG?= <9500352+nicole_123@user.noreply.gitee.com>
|
||||
Date: Wed, 20 Jul 2022 07:35:28 +0000
|
||||
Subject: =?utf-8?b?ITI5IOino+WGs+WNjuS4ung4NuacuuWZqOautemUmeivr+mXrumimCAm?=
|
||||
=?utf-8?b?JiDop6PlhrNidWcjMTMwMzEyICYmIOmAgumFjVNES+eahOi3s+i/h+S7u+WKoQ==?=
|
||||
=?utf-8?b?5qCP5o6l5Y+jICogdXBkYXRlIGNoYW5nZWxvZyAqIOino+WGs2J1ZyMxMzAzMTIg?=
|
||||
=?utf-8?b?JiYg6YCC6YWNU0RL55qE6Lez6L+H5Lu75Yqh5qCP5o6l5Y+jICog6Kej5Yaz5Y2O?=
|
||||
=?utf-8?b?5Li6eDg25py65Zmo5q616ZSZ6K+v6Zeu6aKYICogTWVyZ2UgcmVtb3RlLXRyYWNr?=
|
||||
=?utf-8?b?aW5nIGJyYW5jaCAndXBzdHJlYW0vb3Blbmt5bGluL3lhbmd0emUnIGludG8gb3Bl?=
|
||||
=?utf-8?b?bmt5bGluL3lhbmd0emUgKiBNZXJnZSBicmFuY2ggJ29wZW5reWxpbi95YW5ndHpl?=
|
||||
=?utf-8?b?JyBvZiBodHRwczovL2dpdGVlLmNvbS9uaWNvbGVfMTIzL3VrdWkt4oCmICogIHVw?=
|
||||
=?utf-8?b?ZGF0ZSBjaGFuZ2Vsb2c=?=
|
||||
|
||||
---
|
||||
panel/ukuipanel.cpp | 1 -
|
||||
plugin-taskbar/ukuitaskbar.cpp | 29 ++++++++++++++++++++++-------
|
||||
plugin-taskbar/ukuitaskbar.h | 2 ++
|
||||
3 files changed, 24 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/panel/ukuipanel.cpp b/panel/ukuipanel.cpp
|
||||
index 6587f32..6f83078 100644
|
||||
--- a/panel/ukuipanel.cpp
|
||||
+++ b/panel/ukuipanel.cpp
|
||||
@@ -566,7 +566,6 @@ void UKUIPanel::setPanelGeometry(bool animate)
|
||||
if (rect != geometry()) {
|
||||
setFixedSize(rect.size());
|
||||
setMargins();
|
||||
- this->windowHandle()->setProperty("noHide",true);
|
||||
kdk::WindowManager::setGeometry(this->windowHandle(), rect);
|
||||
}
|
||||
QDBusMessage message =QDBusMessage::createSignal("/panel/position", "org.ukui.panel", "UKuiPanelPosition");
|
||||
diff --git a/plugin-taskbar/ukuitaskbar.cpp b/plugin-taskbar/ukuitaskbar.cpp
|
||||
index 88bb592..bce0ee9 100644
|
||||
--- a/plugin-taskbar/ukuitaskbar.cpp
|
||||
+++ b/plugin-taskbar/ukuitaskbar.cpp
|
||||
@@ -159,6 +159,10 @@ UKUITaskBar::UKUITaskBar(IUKUIPanelPlugin *plugin, QWidget *parent) :
|
||||
|
||||
QDBusConnection::sessionBus().connect(QString(), QString("/taskbar/quicklaunch"), "org.ukui.panel.taskbar", "AddToTaskbar", this, SLOT(addToTaskbar(QString)));
|
||||
QDBusConnection::sessionBus().connect(QString(), QString("/taskbar/quicklaunch"), "org.ukui.panel.taskbar", "RemoveFromTaskbar", this, SLOT(removeFromTaskbar(QString)));
|
||||
+
|
||||
+ QDBusConnection::sessionBus().connect("com.kylin.statusmanager.interface","/",
|
||||
+ "com.kylin.statusmanager.interface","mode_change_signal",
|
||||
+ this,SLOT(readPanelConfig(bool)));
|
||||
}
|
||||
|
||||
/************************************************
|
||||
@@ -173,6 +177,13 @@ UKUITaskBar::~UKUITaskBar()
|
||||
m_vBtn.clear();
|
||||
}
|
||||
|
||||
+void UKUITaskBar::readPanelConfig(bool isTabletMode)
|
||||
+{
|
||||
+ if(!isTabletMode) {
|
||||
+ refreshQuickLaunch();
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
QString UKUITaskBar::readFile(const QString &filename)
|
||||
{
|
||||
QFile f(filename);
|
||||
@@ -306,11 +317,10 @@ bool UKUITaskBar::acceptWindow(const WindowId& window) const
|
||||
if (windowTitle == "UKUI Panel" || windowTitle == "桌面") {
|
||||
return false;
|
||||
}
|
||||
- //临时方案:任务栏屏蔽掉没有窗口图标的窗口
|
||||
-// QIcon windowIcon = WindowManager::getWindowIcon(window);
|
||||
-// if (windowIcon.name() == "" || windowIcon.name() == NULL) {
|
||||
-// return false;
|
||||
-// }
|
||||
+ bool isSkipTaskbar = kdk::WindowManager::skipTaskBar(window);
|
||||
+ if(isSkipTaskbar) {
|
||||
+ return false;
|
||||
+ }
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -666,6 +676,7 @@ void UKUITaskBar::realignSdk()
|
||||
if (panel->isHorizontal()) {
|
||||
this->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
|
||||
this->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
+ this->setMinimumHeight(panel->panelSize());
|
||||
m_allFrame->setMinimumSize(QSize((m_layout->count()+5)*panel->panelSize(),panel->panelSize()));
|
||||
if (m_allFrame->width() < this->width()) {
|
||||
m_allFrame->setFixedWidth(this->width());
|
||||
@@ -676,6 +687,7 @@ void UKUITaskBar::realignSdk()
|
||||
} else {
|
||||
this->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
this->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
|
||||
+ this->setMinimumWidth(panel->panelSize());
|
||||
m_allFrame->setMinimumSize(QSize(panel->panelSize(),(m_layout->count()+3)*panel->panelSize()));
|
||||
if (m_allFrame->height() < this->height()) {
|
||||
m_allFrame->setFixedHeight(this->height());
|
||||
@@ -717,8 +729,11 @@ void UKUITaskBar::realignSdk()
|
||||
emit showOnlySettingChanged();
|
||||
emit refreshIconGeometry();
|
||||
|
||||
- horizontalScrollBar()->setMaximum(m_allFrame->width() - this->width());
|
||||
- verticalScrollBar()->setMaximum(m_allFrame->height() - this->height());
|
||||
+ if (panel->isHorizontal()) {
|
||||
+ horizontalScrollBar()->setMaximum(m_allFrame->width() - this->width());
|
||||
+ } else {
|
||||
+ verticalScrollBar()->setMaximum(m_allFrame->height() - this->height());
|
||||
+ }
|
||||
}
|
||||
|
||||
void UKUITaskBar::wheelEvent(QWheelEvent* event)
|
||||
diff --git a/plugin-taskbar/ukuitaskbar.h b/plugin-taskbar/ukuitaskbar.h
|
||||
index 6c029d1..bc3a341 100644
|
||||
--- a/plugin-taskbar/ukuitaskbar.h
|
||||
+++ b/plugin-taskbar/ukuitaskbar.h
|
||||
@@ -173,6 +173,8 @@ private slots:
|
||||
void activateSdkTask(int pos);
|
||||
void onDesktopChanged();
|
||||
|
||||
+ void readPanelConfig(bool isTabletMode);
|
||||
+
|
||||
////////////////////////////
|
||||
/// quicklaunch slots
|
||||
///
|
|
@ -0,0 +1,41 @@
|
|||
From: =?utf-8?b?5L2V5py05bCn?= <18373370753@163.com>
|
||||
Date: Wed, 20 Jul 2022 10:48:52 +0000
|
||||
Subject: =?utf-8?b?ITMwIOmAu+i+keS8mOWMliBNZXJnZSBwdWxsIHJlcXVlc3QgITMwIGZy?=
|
||||
=?utf-8?b?b20g5Y2c6JCn5bqGL29wZW5reWxpbi95YW5ndHpl?=
|
||||
|
||||
---
|
||||
plugin-taskbar/ukuitaskbar.cpp | 7 ++++---
|
||||
1 file changed, 4 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/plugin-taskbar/ukuitaskbar.cpp b/plugin-taskbar/ukuitaskbar.cpp
|
||||
index bce0ee9..9d78b62 100644
|
||||
--- a/plugin-taskbar/ukuitaskbar.cpp
|
||||
+++ b/plugin-taskbar/ukuitaskbar.cpp
|
||||
@@ -428,7 +428,8 @@ void UKUITaskBar::addWindow(const WindowId& window)
|
||||
{
|
||||
// If grouping disabled group behaves like regular button
|
||||
const QString group_id = m_groupingEnabled ? WindowManager::getWindowGroup(window) : QString("%1").arg(window.toInt());
|
||||
- if (m_ignoreWindow.contains(group_id)) {
|
||||
+ qDebug()<<"****** group_id is "<<group_id;
|
||||
+ if (m_ignoreWindow.contains(group_id) || group_id == "") {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -676,7 +677,7 @@ void UKUITaskBar::realignSdk()
|
||||
if (panel->isHorizontal()) {
|
||||
this->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
|
||||
this->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
- this->setMinimumHeight(panel->panelSize());
|
||||
+ this->setMinimumSize(m_layout->count() * panel->panelSize(),panel->panelSize());
|
||||
m_allFrame->setMinimumSize(QSize((m_layout->count()+5)*panel->panelSize(),panel->panelSize()));
|
||||
if (m_allFrame->width() < this->width()) {
|
||||
m_allFrame->setFixedWidth(this->width());
|
||||
@@ -687,7 +688,7 @@ void UKUITaskBar::realignSdk()
|
||||
} else {
|
||||
this->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
this->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
|
||||
- this->setMinimumWidth(panel->panelSize());
|
||||
+ this->setMinimumSize(panel->panelSize(), m_layout->count() * panel->panelSize());
|
||||
m_allFrame->setMinimumSize(QSize(panel->panelSize(),(m_layout->count()+3)*panel->panelSize()));
|
||||
if (m_allFrame->height() < this->height()) {
|
||||
m_allFrame->setFixedHeight(this->height());
|
|
@ -0,0 +1,31 @@
|
|||
From: =?utf-8?b?5L2V5py05bCn?= <18373370753@163.com>
|
||||
Date: Wed, 20 Jul 2022 14:28:23 +0000
|
||||
Subject: =?utf-8?b?ITMxIOa3u+WKoOWkh+S7veWbvuaghyBNZXJnZSBwdWxsIHJlcXVlc3Qg?=
|
||||
=?utf-8?b?ITMxIGZyb20g5L2V5py05bCnL29wZW5reWxpbi95YW5ndHpl?=
|
||||
|
||||
---
|
||||
plugin-startbar/startmenu_button.cpp | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/plugin-startbar/startmenu_button.cpp b/plugin-startbar/startmenu_button.cpp
|
||||
index aa46f34..b989fec 100644
|
||||
--- a/plugin-startbar/startmenu_button.cpp
|
||||
+++ b/plugin-startbar/startmenu_button.cpp
|
||||
@@ -107,7 +107,7 @@ void StartMenuButton::contextMenuEvent(QContextMenuEvent *event)
|
||||
this, SLOT(SessionSwitch())
|
||||
); //切换用户
|
||||
}
|
||||
- pUserAction->addAction(QIcon::fromTheme("ukui-system-logout-symbolic"),
|
||||
+ pUserAction->addAction(QIcon::fromTheme("ukui-system-logout-symbolic",QIcon::fromTheme("system-shutdown-symbolic"),
|
||||
tr("Logout"),
|
||||
this, SLOT(SessionLogout())
|
||||
); //注销
|
||||
@@ -125,7 +125,7 @@ void StartMenuButton::contextMenuEvent(QContextMenuEvent *event)
|
||||
this, SLOT(SessionSuspend())
|
||||
); //睡眠
|
||||
}
|
||||
- pPowerSupply->addAction(QIcon::fromTheme("ukui-system-restart-symbolic"),
|
||||
+ pPowerSupply->addAction(QIcon::fromTheme("ukui-system-restart-symbolic",QIcon::fromTheme("system-reboot-symbolic"),
|
||||
tr("Restart"),
|
||||
this, SLOT(SessionReboot())
|
||||
); //重启
|
|
@ -0,0 +1,31 @@
|
|||
From: =?utf-8?b?5L2V5py05bCn?= <18373370753@163.com>
|
||||
Date: Wed, 20 Jul 2022 14:41:16 +0000
|
||||
Subject: =?utf-8?b?ITMyIOWbvuagh+WQjeensOS/ruaUuSBNZXJnZSBwdWxsIHJlcXVlc3Qg?=
|
||||
=?utf-8?b?ITMyIGZyb20g5L2V5py05bCnL29wZW5reWxpbi95YW5ndHpl?=
|
||||
|
||||
---
|
||||
plugin-startbar/startmenu_button.cpp | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/plugin-startbar/startmenu_button.cpp b/plugin-startbar/startmenu_button.cpp
|
||||
index b989fec..5aefc2d 100644
|
||||
--- a/plugin-startbar/startmenu_button.cpp
|
||||
+++ b/plugin-startbar/startmenu_button.cpp
|
||||
@@ -107,7 +107,7 @@ void StartMenuButton::contextMenuEvent(QContextMenuEvent *event)
|
||||
this, SLOT(SessionSwitch())
|
||||
); //切换用户
|
||||
}
|
||||
- pUserAction->addAction(QIcon::fromTheme("ukui-system-logout-symbolic",QIcon::fromTheme("system-shutdown-symbolic"),
|
||||
+ pUserAction->addAction(QIcon::fromTheme("system-log-out-symbolic"),
|
||||
tr("Logout"),
|
||||
this, SLOT(SessionLogout())
|
||||
); //注销
|
||||
@@ -125,7 +125,7 @@ void StartMenuButton::contextMenuEvent(QContextMenuEvent *event)
|
||||
this, SLOT(SessionSuspend())
|
||||
); //睡眠
|
||||
}
|
||||
- pPowerSupply->addAction(QIcon::fromTheme("ukui-system-restart-symbolic",QIcon::fromTheme("system-reboot-symbolic"),
|
||||
+ pPowerSupply->addAction(QIcon::fromTheme("system-reboot-symbolic"),
|
||||
tr("Restart"),
|
||||
this, SLOT(SessionReboot())
|
||||
); //重启
|
|
@ -0,0 +1,27 @@
|
|||
From: =?utf-8?b?5L2V5py05bCn?= <18373370753@163.com>
|
||||
Date: Tue, 26 Jul 2022 06:53:47 +0000
|
||||
Subject: =?utf-8?b?5Yig6ZmkdWt1aS1mbGFzaC1kaXNr?=
|
||||
|
||||
---
|
||||
CMakeLists.txt | 4 +---
|
||||
1 file changed, 1 insertion(+), 3 deletions(-)
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 57005fa..bbf1474 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -1,4 +1,4 @@
|
||||
-cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
|
||||
+cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
|
||||
project(ukui-panel)
|
||||
|
||||
option(WITH_SCREENSAVER_FALLBACK "Include support for converting the deprecated 'screensaver' plugin to 'quicklaunch'. This requires the ukui-leave (ukui-session) to be installed in runtime." OFF)
|
||||
@@ -128,8 +128,6 @@ if(TASKBAR_PLUGIN)
|
||||
add_subdirectory(plugin-taskbar)
|
||||
endif()
|
||||
|
||||
-add_subdirectory(ukui-flash-disk)
|
||||
-#add_subdirectory(ukui-calendar)
|
||||
add_subdirectory(panel-daemon)
|
||||
add_subdirectory(sni-daemon)
|
||||
add_subdirectory(sni-xembed-proxy)
|
|
@ -0,0 +1,103 @@
|
|||
From: buxiaoqing <buxiaoqing@kylinos.cn>
|
||||
Date: Fri, 5 Aug 2022 10:41:46 +0800
|
||||
Subject: =?utf-8?b?5aKe5Yqg5aSa5Lu75Yqh6KeG5Zu+6ZyA6KaB5bGP6JS955qE5Lik5Liq?=
|
||||
=?utf-8?b?5Lit5paH5ZCN55qE56qX5Y+j?=
|
||||
|
||||
---
|
||||
panel/resources/panel-commission.ini | 2 +-
|
||||
panel/ukuipanel.cpp | 26 +++++++++++++++-----------
|
||||
2 files changed, 16 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/panel/resources/panel-commission.ini b/panel/resources/panel-commission.ini
|
||||
index 888f5f2..630c096 100755
|
||||
--- a/panel/resources/panel-commission.ini
|
||||
+++ b/panel/resources/panel-commission.ini
|
||||
@@ -13,4 +13,4 @@ CalendarVersion=new
|
||||
trayname=ukui-volume-control-applet-qt,kylin-nm,ukui-sidebar,indicator-china-weather,ukui-flash-disk,fcitx,sogouimebs-qimpanel,fcitx-qimpanel,explorer.exe,ukui-power-manager-tray,baidu-qimpanel,iflyime-qim,hedronagent,CTJManageTool
|
||||
|
||||
[IgnoreWindow]
|
||||
-ignoreWindow=ukui-menu,ukui-sidebar,ukui-search,bluetooth,Form,kylin-nm,ukui-notifications,ukui-power-manager-tray,ukui-volume-control-applet-qt,ukui-flash-disk,ukui-screensaver-dialog
|
||||
+ignoreWindow=ukui-menu,ukui-sidebar,ukui-search,bluetooth,Form,kylin-nm,ukui-notifications,ukui-power-manager-tray,ukui-volume-control-applet-qt,ukui-flash-disk,ukui-screensaver-dialog,网络工具,蓝牙
|
||||
diff --git a/panel/ukuipanel.cpp b/panel/ukuipanel.cpp
|
||||
index 6f83078..7fb2da2 100644
|
||||
--- a/panel/ukuipanel.cpp
|
||||
+++ b/panel/ukuipanel.cpp
|
||||
@@ -304,6 +304,8 @@ void UKUIPanel::setPanelHide(bool model)
|
||||
setAttribute(Qt::WA_X11NetWmWindowTypeDock);
|
||||
show();
|
||||
KWindowSystem::setType(effectiveWinId(), NET::Dock);
|
||||
+ QRect rect = caculPanelGeometry();
|
||||
+ kdk::WindowManager::setGeometry(this->windowHandle(), rect);
|
||||
realign();
|
||||
}
|
||||
}
|
||||
@@ -527,7 +529,6 @@ QRect UKUIPanel::caculPanelGeometry()
|
||||
else
|
||||
rect.moveBottom(currentScreen.bottom());
|
||||
}
|
||||
- qDebug()<<"ukui-panel Rect is :"<<rect;
|
||||
} else {
|
||||
// Vert panel ***************************
|
||||
rect.setWidth(qMax(PANEL_MINIMUM_SIZE, m_panelSize));
|
||||
@@ -546,6 +547,7 @@ QRect UKUIPanel::caculPanelGeometry()
|
||||
rect.moveRight(currentScreen.right());
|
||||
}
|
||||
}
|
||||
+ qDebug()<<"ukui-panel Rect is :"<<rect;
|
||||
return rect;
|
||||
}
|
||||
|
||||
@@ -634,16 +636,12 @@ void UKUIPanel::realign()
|
||||
emit realigned();
|
||||
if (!isVisible())
|
||||
return;
|
||||
-#if 0
|
||||
qDebug() << "** Realign *********************";
|
||||
- qDebug() << "PanelSize: " << mPanelSize;
|
||||
- qDebug() << "IconSize: " << mIconSize;
|
||||
- qDebug() << "LineCount: " << mLineCount;
|
||||
- qDebug() << "Length: " << mLength << (mLengthInPercents ? "%" : "px");
|
||||
- qDebug() << "Alignment: " << (mAlignment == 0 ? "center" : (mAlignment < 0 ? "left" : "right"));
|
||||
- qDebug() << "Position: " << positionToStr(mPosition) << "on" << mScreenNum;
|
||||
- qDebug() << "Plugins count: " << mPlugins.count();
|
||||
-#endif
|
||||
+ qDebug() << "PanelSize: " << m_panelSize;
|
||||
+ qDebug() << "IconSize: " << m_iconSize;
|
||||
+ qDebug() << "LineCount: " << m_lineCount;
|
||||
+ qDebug() << "Position: " << m_position;
|
||||
+ qDebug() << "geometry: " << this->geometry();
|
||||
|
||||
setPanelGeometry();
|
||||
|
||||
@@ -821,16 +819,21 @@ void UKUIPanel::adjustPanel()
|
||||
m_gsettings->set(PANEL_SIZE_KEY,PANEL_SIZE_SMALL);
|
||||
m_gsettings->set(ICON_SIZE_KEY,ICON_SIZE_SMALL);
|
||||
setIconSize(ICON_SIZE_SMALL,true);
|
||||
+ setPanelSize(PANEL_SIZE_SMALL, true);
|
||||
});
|
||||
connect(pmenuaction_m,&QAction::triggered,[this] {
|
||||
m_gsettings->set(PANEL_SIZE_KEY,PANEL_SIZE_MEDIUM);
|
||||
m_gsettings->set(ICON_SIZE_KEY,ICON_SIZE_MEDIUM);
|
||||
setIconSize(ICON_SIZE_MEDIUM,true);
|
||||
+ setPanelSize(PANEL_SIZE_MEDIUM, true);
|
||||
+
|
||||
});
|
||||
connect(pmenuaction_l,&QAction::triggered,[this] {
|
||||
m_gsettings->set(PANEL_SIZE_KEY,PANEL_SIZE_LARGE);
|
||||
m_gsettings->set(ICON_SIZE_KEY,ICON_SIZE_LARGE);
|
||||
setIconSize(ICON_SIZE_LARGE,true);
|
||||
+ setPanelSize(PANEL_SIZE_LARGE, true);
|
||||
+
|
||||
});
|
||||
pmenu_panelsize->setDisabled(m_lockPanel);
|
||||
|
||||
@@ -1025,7 +1028,8 @@ void UKUIPanel::setPosition(int screen, IUKUIPanel::Position position, bool save
|
||||
|
||||
realign();
|
||||
m_gsettings->set(PANEL_POSITION_KEY,position);
|
||||
- setPanelGeometry(true);
|
||||
+ QRect rect = caculPanelGeometry();
|
||||
+ kdk::WindowManager::setGeometry(this->windowHandle(), rect);
|
||||
}
|
||||
|
||||
/************************************************
|
|
@ -0,0 +1,274 @@
|
|||
From: =?utf-8?b?5L2V5py05bCn?= <18373370753@163.com>
|
||||
Date: Fri, 16 Dec 2022 06:02:40 +0000
|
||||
Subject: =?utf-8?b?ITM4IOS7u+WKoeagj+WPjOWxj+mAgumFjSBNZXJnZSBwdWxsIHJlcXVl?=
|
||||
=?utf-8?b?c3QgITM4IGZyb20g5Y2c6JCn5bqGL29wZW5reWxpbi95YW5ndHpl?=
|
||||
|
||||
---
|
||||
panel/CMakeLists.txt | 5 ++-
|
||||
panel/ukuipanel.cpp | 95 ++++++++++++++++++++++++++++++++++++++++------------
|
||||
panel/ukuipanel.h | 8 ++++-
|
||||
3 files changed, 85 insertions(+), 23 deletions(-)
|
||||
|
||||
diff --git a/panel/CMakeLists.txt b/panel/CMakeLists.txt
|
||||
index 0aed8cf..e797d9e 100644
|
||||
--- a/panel/CMakeLists.txt
|
||||
+++ b/panel/CMakeLists.txt
|
||||
@@ -62,7 +62,6 @@ set(SOURCES
|
||||
highlight-effect.cpp
|
||||
)
|
||||
|
||||
-file(GLOB CONFIG_FILES resources/*.conf resources/*.qss)
|
||||
############################################
|
||||
|
||||
add_definitions(-DCOMPILE_UKUI_PANEL)
|
||||
@@ -117,6 +116,7 @@ include_directories(${Gsetting_INCLUDE_DIRS})
|
||||
|
||||
find_package(PkgConfig REQUIRED)
|
||||
find_package(KF5WindowSystem)
|
||||
+find_package(KF5Screen)
|
||||
pkg_check_modules(KYSDKWAYLANDHELPER_PKG kysdk-waylandhelper)
|
||||
|
||||
#ADD_DEFINITIONS(-DQT_NO_KEYWORDS)
|
||||
@@ -129,6 +129,7 @@ target_link_libraries(${PROJECT}
|
||||
${GLIB2_LIBRARIES}
|
||||
${GIO2_LIBRARIES}
|
||||
${Gsetting_LIBRARIES}
|
||||
+ KF5::Screen
|
||||
)
|
||||
|
||||
target_include_directories(${PROJECT} PRIVATE ${KYSDKWAYLANDHELPER_PKG_INCLUDE_DIRS})
|
||||
@@ -158,7 +159,9 @@ target_compile_definitions(${PROJECT}
|
||||
|
||||
|
||||
install(TARGETS ${PROJECT} RUNTIME DESTINATION bin)
|
||||
+file(GLOB CONFIG_FILES resources/*.conf resources/*.qss)
|
||||
install(FILES ${CONFIG_FILES} DESTINATION ${CMAKE_INSTALL_DATADIR}/ukui)
|
||||
+
|
||||
install(FILES ${PUB_HEADERS} DESTINATION include/ukui)
|
||||
install(FILES
|
||||
../man/ukui-panel.1
|
||||
diff --git a/panel/ukuipanel.cpp b/panel/ukuipanel.cpp
|
||||
index 7fb2da2..7a172ea 100644
|
||||
--- a/panel/ukuipanel.cpp
|
||||
+++ b/panel/ukuipanel.cpp
|
||||
@@ -53,11 +53,11 @@
|
||||
#include <KWindowSystem/KWindowSystem>
|
||||
#include "windowmanager/windowmanager.h"
|
||||
#include <KWindowSystem/NETWM>
|
||||
-//#include <glib.h>
|
||||
-//#include <gio/gio.h>
|
||||
+#include <KF5/KScreen/kscreen/output.h>
|
||||
+#include <KF5/KScreen/kscreen/configmonitor.h>
|
||||
+
|
||||
#include <QGSettings>
|
||||
// Turn on this to show the time required to load each plugin during startup
|
||||
-// #define DEBUG_PLUGIN_LOADTIME
|
||||
|
||||
#include "common_fun/ukuipanel_infomation.h"
|
||||
#include "common_fun/dbus-adaptor.h"
|
||||
@@ -206,17 +206,20 @@ UKUIPanel::UKUIPanel(const QString &configGroup, UKUi::Settings *settings, QWidg
|
||||
*/
|
||||
connect(QApplication::desktop(), &QDesktopWidget::resized, this, &UKUIPanel::ensureVisible);
|
||||
connect(QApplication::desktop(), &QDesktopWidget::screenCountChanged, this, &UKUIPanel::ensureVisible);
|
||||
- connect(qApp,&QApplication::primaryScreenChanged,this,&UKUIPanel::ensureVisible);
|
||||
+// connect(qApp,&QApplication::primaryScreenChanged,this,&UKUIPanel::ensureVisible);
|
||||
|
||||
// connecting to QDesktopWidget::workAreaResized shouldn't be necessary,
|
||||
// as we've already connceted to QDesktopWidget::resized, but it actually
|
||||
connect(QApplication::desktop(), &QDesktopWidget::workAreaResized,
|
||||
this, &UKUIPanel::ensureVisible);
|
||||
UKUIPanelApplication *a = reinterpret_cast<UKUIPanelApplication*>(qApp);
|
||||
- connect(a, &UKUIPanelApplication::primaryScreenChanged, [=]{
|
||||
- setPanelGeometry();
|
||||
+ m_primaryScreenGeometry = QGuiApplication::screens().at(0)->geometry();
|
||||
+ KScreen::GetConfigOperation *op = new KScreen::GetConfigOperation();
|
||||
+ connect(op, &KScreen::GetConfigOperation::finished, this, [this](KScreen::ConfigOperation *op) {
|
||||
+ configWatch(op);
|
||||
});
|
||||
|
||||
+
|
||||
connect(UKUi::Settings::globalSettings(), SIGNAL(settingsChanged()), this, SLOT(update()));
|
||||
|
||||
connect(m_standaloneWindows.data(), &WindowNotifier::firstShown, [this] { showPanel(true); });
|
||||
@@ -296,6 +299,31 @@ UKUIPanel::UKUIPanel(const QString &configGroup, UKUi::Settings *settings, QWidg
|
||||
}
|
||||
}
|
||||
|
||||
+void UKUIPanel::configWatch(KScreen::ConfigOperation *op)
|
||||
+{
|
||||
+ m_config = op->config();
|
||||
+
|
||||
+ KScreen::ConfigMonitor::instance()->addConfig(m_config);
|
||||
+
|
||||
+ connect(m_config.data(), &KScreen::Config::primaryOutputChanged,
|
||||
+ this, [=](const KScreen::OutputPtr &output){
|
||||
+ if (!output.isNull()) {
|
||||
+ qDebug() << "primaryOutputChanged:" << output->name() << output->geometry();
|
||||
+ m_primaryScreenGeometry = output->geometry();
|
||||
+ QRect rect = caculPanelGeometry(output->geometry());
|
||||
+ kdk::WindowManager::setGeometry(this->windowHandle(), rect);
|
||||
+ }
|
||||
+ });
|
||||
+ connect(m_config.data(), &KScreen::Config::outputAdded,
|
||||
+ this, [=](const KScreen::OutputPtr &output){
|
||||
+ qDebug() << "output added:" << output.data()->name();
|
||||
+ });
|
||||
+ connect(m_config.data(), &KScreen::Config::outputRemoved,
|
||||
+ this, [=](){
|
||||
+ qDebug() << "output removed";
|
||||
+ });
|
||||
+}
|
||||
+
|
||||
void UKUIPanel::setPanelHide(bool model)
|
||||
{
|
||||
if (model) {
|
||||
@@ -304,7 +332,7 @@ void UKUIPanel::setPanelHide(bool model)
|
||||
setAttribute(Qt::WA_X11NetWmWindowTypeDock);
|
||||
show();
|
||||
KWindowSystem::setType(effectiveWinId(), NET::Dock);
|
||||
- QRect rect = caculPanelGeometry();
|
||||
+ QRect rect = caculPanelGeometry(m_primaryScreenGeometry);
|
||||
kdk::WindowManager::setGeometry(this->windowHandle(), rect);
|
||||
realign();
|
||||
}
|
||||
@@ -505,29 +533,42 @@ void UKUIPanel::priScreenChanged(int x, int y, int width, int height)
|
||||
realign();
|
||||
}
|
||||
|
||||
-QRect UKUIPanel::caculPanelGeometry()
|
||||
+QRect UKUIPanel::caculPanelGeometry(QRect primaryscreen)
|
||||
{
|
||||
QRect currentScreen;
|
||||
QRect rect;
|
||||
|
||||
- currentScreen=QGuiApplication::screens().at(0)->geometry();
|
||||
-
|
||||
+// currentScreen=QGuiApplication::screens().at(0)->geometry();
|
||||
+ currentScreen = primaryscreen;
|
||||
if (isHorizontal()) {
|
||||
rect.setHeight(qMax(PANEL_MINIMUM_SIZE, m_panelSize));
|
||||
rect.setWidth(currentScreen.width());
|
||||
- rect.setWidth(qMax(rect.size().width(), m_layout->minimumSize().width()));
|
||||
+ rect.setWidth(qMax(rect.size().width(), m_layout->minimumSize().width()));
|
||||
|
||||
// Horiz panel***************************
|
||||
if (m_position == IUKUIPanel::PositionTop) {
|
||||
- if (m_hidden)
|
||||
+ if (m_hidden) {
|
||||
rect.moveBottom(currentScreen.top() + PANEL_HIDE_SIZE);
|
||||
- else
|
||||
+ rect.setX(currentScreen.x());
|
||||
+ rect.setY(currentScreen.y() - rect.height() + PANEL_HIDE_SIZE);
|
||||
+
|
||||
+ }else {
|
||||
rect.moveTop(currentScreen.top());
|
||||
+ rect.setX(currentScreen.x());
|
||||
+ rect.setY(currentScreen.y());
|
||||
+ rect.setWidth(currentScreen.width());
|
||||
+ }
|
||||
} else {
|
||||
- if (m_hidden)
|
||||
+ if (m_hidden) {
|
||||
rect.moveTop(currentScreen.bottom() - PANEL_HIDE_SIZE);
|
||||
- else
|
||||
+ rect.setX(currentScreen.x());
|
||||
+ rect.setY(currentScreen.y() + currentScreen.height() - PANEL_HIDE_SIZE);
|
||||
+ }else {
|
||||
rect.moveBottom(currentScreen.bottom());
|
||||
+ rect.setX(currentScreen.x());
|
||||
+ rect.setY(currentScreen.y() + currentScreen.height() - m_panelSize);
|
||||
+ rect.setWidth(currentScreen.width());
|
||||
+ }
|
||||
}
|
||||
} else {
|
||||
// Vert panel ***************************
|
||||
@@ -536,15 +577,27 @@ QRect UKUIPanel::caculPanelGeometry()
|
||||
rect.setHeight(qMax(rect.size().height(), m_layout->minimumSize().height()));
|
||||
|
||||
if (m_position == IUKUIPanel::PositionLeft) {
|
||||
- if (m_hidden)
|
||||
+ if (m_hidden) {
|
||||
rect.moveRight(currentScreen.left() + PANEL_HIDE_SIZE);
|
||||
- else
|
||||
+ rect.setX(currentScreen.x() - rect.width() + PANEL_HIDE_SIZE);
|
||||
+ rect.setY(currentScreen.y());
|
||||
+ }else {
|
||||
rect.moveLeft(currentScreen.left());
|
||||
+ rect.setX(currentScreen.x());
|
||||
+ rect.setY(currentScreen.y());
|
||||
+ rect.setHeight(currentScreen.height());
|
||||
+ }
|
||||
} else {
|
||||
- if (m_hidden)
|
||||
+ if (m_hidden) {
|
||||
rect.moveLeft(currentScreen.right() - PANEL_HIDE_SIZE);
|
||||
- else
|
||||
+ rect.setX(currentScreen.x() + currentScreen.width() + m_panelSize - PANEL_HIDE_SIZE);
|
||||
+ rect.setY(currentScreen.y());
|
||||
+ }else {
|
||||
rect.moveRight(currentScreen.right());
|
||||
+ rect.setX(currentScreen.x() + currentScreen.width() - m_panelSize);
|
||||
+ rect.setY(currentScreen.y());
|
||||
+ rect.setHeight(currentScreen.height());
|
||||
+ }
|
||||
}
|
||||
}
|
||||
qDebug()<<"ukui-panel Rect is :"<<rect;
|
||||
@@ -563,7 +616,7 @@ void UKUIPanel::setPanelGeometry(bool animate)
|
||||
QRect rect;
|
||||
|
||||
currentScreen=QGuiApplication::screens().at(0)->geometry();
|
||||
- rect = caculPanelGeometry();
|
||||
+ rect = caculPanelGeometry(currentScreen);
|
||||
|
||||
if (rect != geometry()) {
|
||||
setFixedSize(rect.size());
|
||||
@@ -1028,7 +1081,7 @@ void UKUIPanel::setPosition(int screen, IUKUIPanel::Position position, bool save
|
||||
|
||||
realign();
|
||||
m_gsettings->set(PANEL_POSITION_KEY,position);
|
||||
- QRect rect = caculPanelGeometry();
|
||||
+ QRect rect = caculPanelGeometry(m_primaryScreenGeometry);
|
||||
kdk::WindowManager::setGeometry(this->windowHandle(), rect);
|
||||
}
|
||||
|
||||
diff --git a/panel/ukuipanel.h b/panel/ukuipanel.h
|
||||
index 1547f0d..4cf9457 100644
|
||||
--- a/panel/ukuipanel.h
|
||||
+++ b/panel/ukuipanel.h
|
||||
@@ -40,6 +40,9 @@
|
||||
#include "common/ukuisettings.h"
|
||||
#include "iukuipanel.h"
|
||||
#include "ukuipanelglobals.h"
|
||||
+#include <KF5/KScreen/kscreen/config.h>
|
||||
+#include <KF5/KScreen/kscreen/getconfigoperation.h>
|
||||
+
|
||||
|
||||
class QMenu;
|
||||
class Plugin;
|
||||
@@ -90,6 +93,8 @@ class UKUI_PANEL_API UKUIPanel : public QFrame, public IUKUIPanel
|
||||
friend class PanelPluginsModel;
|
||||
|
||||
public:
|
||||
+ void configWatch(KScreen::ConfigOperation *op);
|
||||
+ QRect m_primaryScreenGeometry;
|
||||
/**
|
||||
* @brief Stores how the panel should be aligned. Obviously, this applies
|
||||
* only if the panel does not occupy 100 % of the available space. If the
|
||||
@@ -437,6 +442,7 @@ private slots:
|
||||
*/
|
||||
void pluginMoved(Plugin * plug);
|
||||
private:
|
||||
+ KScreen::ConfigPtr m_config;
|
||||
/**
|
||||
* @brief The UKUIPanelLayout of this panel. All the Plugins will be added
|
||||
* to the UI via this layout.
|
||||
@@ -512,7 +518,7 @@ private:
|
||||
* \param animate flag if showing/hiding the panel should be animated.
|
||||
*/
|
||||
void setPanelGeometry(bool animate = false);
|
||||
- QRect caculPanelGeometry();
|
||||
+ QRect caculPanelGeometry(QRect primaryscreen);
|
||||
void setPanelAnimation(QRect startrect, QRect endrect);
|
||||
/**
|
||||
* @brief Sets the contents margins of the panel according to its position
|
|
@ -0,0 +1,33 @@
|
|||
From: Xin Li <lixin@kylinos.cn>
|
||||
Date: Tue, 3 Jan 2023 17:35:26 +0800
|
||||
Subject: =?utf-8?b?YnVpbGQoZGViaWFuKTog5pu05pawQ2hhbmdlbG9n?=
|
||||
|
||||
Closes #I67H4F
|
||||
---
|
||||
plugin-calendar/html/jiejiari.js | 12 ++++++++----
|
||||
1 file changed, 8 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/plugin-calendar/html/jiejiari.js b/plugin-calendar/html/jiejiari.js
|
||||
index aff7d2a..0174633 100644
|
||||
--- a/plugin-calendar/html/jiejiari.js
|
||||
+++ b/plugin-calendar/html/jiejiari.js
|
||||
@@ -31,11 +31,15 @@
|
||||
"d0501":"2","d0502":"2","d0503":"2","d0504":"2","d0507":"1",
|
||||
"d0603":"2","d0604":"2","d0605":"2",
|
||||
"d0910":"2","d0911":"2","d0912":"2",
|
||||
- "d1001":"2","d1002":"2","d1003":"2","d1004":"2","d1005":"2","d1006":"2","d1007":"2","d1008":"1","d1009":"1"
|
||||
-
|
||||
+ "d1001":"2","d1002":"2","d1003":"2","d1004":"2","d1005":"2","d1006":"2","d1007":"2","d1008":"1","d1009":"1",
|
||||
+ "d1231":"2"
|
||||
},
|
||||
"worktime.y2023":{
|
||||
- "d0101":"2","d0102":"2","d0103":"2"
|
||||
-
|
||||
+ "d0101":"2","d0102":"2","d0121":"2","d0122":"2","d0123":"2","d0124":"2","d0125":"2","d0126":"2","d0127":"2","d0128":"1","d0129":"1",
|
||||
+ "d0405":"2","d0423":"1","d0429":"2","d0430":"2",
|
||||
+ "d0501":"2","d0502":"2","d0503":"2","d0506":"1",
|
||||
+ "d0622":"2","d0623":"2","d0624":"2","d0625":"1",
|
||||
+ "d0929":"2","d0930":"2",
|
||||
+ "d1001":"2","d1002":"2","d1003":"2","d1004":"2","d1005":"2","d1006":"2","d1007":"1","d1008":"1"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,73 @@
|
|||
From: hepuyao <hepuyao@kylinos.cn>
|
||||
Date: Thu, 5 Jan 2023 10:36:00 +0800
|
||||
Subject: =?utf-8?b?6Kej5Yaz5Y+M5bGP5byC5bi46Zeu6aKY5ZKM57yW6K+R5oql6ZSZ?=
|
||||
|
||||
---
|
||||
panel/ukuipanel.cpp | 14 +++++++++++---
|
||||
plugin-showdesktop/showdesktop.cpp | 9 ++++++++-
|
||||
2 files changed, 19 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/panel/ukuipanel.cpp b/panel/ukuipanel.cpp
|
||||
index 7a172ea..b93da7e 100644
|
||||
--- a/panel/ukuipanel.cpp
|
||||
+++ b/panel/ukuipanel.cpp
|
||||
@@ -311,12 +311,21 @@ void UKUIPanel::configWatch(KScreen::ConfigOperation *op)
|
||||
qDebug() << "primaryOutputChanged:" << output->name() << output->geometry();
|
||||
m_primaryScreenGeometry = output->geometry();
|
||||
QRect rect = caculPanelGeometry(output->geometry());
|
||||
+ qDebug()<<"primaryOutputChanged panel rect is"<<rect;
|
||||
kdk::WindowManager::setGeometry(this->windowHandle(), rect);
|
||||
+ realign();
|
||||
}
|
||||
});
|
||||
connect(m_config.data(), &KScreen::Config::outputAdded,
|
||||
this, [=](const KScreen::OutputPtr &output){
|
||||
- qDebug() << "output added:" << output.data()->name();
|
||||
+ if (!output.isNull()) {
|
||||
+ KScreen::OutputPtr primary = m_config->primaryOutput();
|
||||
+ m_primaryScreenGeometry = primary->geometry();
|
||||
+ qDebug()<<"output added primary geometry is"<<primary->geometry();
|
||||
+ QRect rect = caculPanelGeometry(primary->geometry());
|
||||
+ qDebug()<<"output added panel rect is"<<rect;
|
||||
+ kdk::WindowManager::setGeometry(this->windowHandle(), rect);
|
||||
+ }
|
||||
});
|
||||
connect(m_config.data(), &KScreen::Config::outputRemoved,
|
||||
this, [=](){
|
||||
@@ -615,8 +624,7 @@ void UKUIPanel::setPanelGeometry(bool animate)
|
||||
QRect currentScreen;
|
||||
QRect rect;
|
||||
|
||||
- currentScreen=QGuiApplication::screens().at(0)->geometry();
|
||||
- rect = caculPanelGeometry(currentScreen);
|
||||
+ rect = caculPanelGeometry(m_primaryScreenGeometry);
|
||||
|
||||
if (rect != geometry()) {
|
||||
setFixedSize(rect.size());
|
||||
diff --git a/plugin-showdesktop/showdesktop.cpp b/plugin-showdesktop/showdesktop.cpp
|
||||
index 2339ebf..ef95cd1 100644
|
||||
--- a/plugin-showdesktop/showdesktop.cpp
|
||||
+++ b/plugin-showdesktop/showdesktop.cpp
|
||||
@@ -36,6 +36,8 @@
|
||||
//panel
|
||||
#include "showdesktop.h"
|
||||
#include "../panel/pluginsettings.h"
|
||||
+//SDK
|
||||
+#include "kysdk/applications/windowmanager/windowmanager.h"
|
||||
|
||||
#define DEFAULT_SHORTCUT "Control+Alt+D"
|
||||
|
||||
@@ -89,7 +91,12 @@ void ShowDesktop::realign()
|
||||
|
||||
void ShowDesktop::mousePressEvent(QMouseEvent *)
|
||||
{
|
||||
- KWindowSystem::setShowingDesktop(!KWindowSystem::showingDesktop());
|
||||
+ qDebug()<<"****** isShowingDesktop " << kdk::WindowManager::isShowingDesktop();
|
||||
+ if (kdk::WindowManager::isShowingDesktop()) {
|
||||
+ kdk::WindowManager::hideDesktop();
|
||||
+ } else {
|
||||
+ kdk::WindowManager::showDesktop();
|
||||
+ }
|
||||
}
|
||||
|
||||
void ShowDesktop::paintEvent(QPaintEvent *)
|
|
@ -0,0 +1,29 @@
|
|||
From: =?utf-8?b?5L2V5py05bCn?= <18373370753@163.com>
|
||||
Date: Fri, 6 Jan 2023 11:16:20 +0000
|
||||
Subject: =?utf-8?b?ITQyIOino+WGs+S7u+WKoeagj+S9jee9rkRCdXPmjqXlj6PplJnor68=?=
|
||||
=?utf-8?b?6Zeu6aKYIE1lcmdlIHB1bGwgcmVxdWVzdCAhNDIgZnJvbSDljZzokKfluoYvZml4?=
|
||||
=?utf-8?b?X3Bvc2l0aW9uX2RidXM=?=
|
||||
|
||||
---
|
||||
panel/ukuipanel.cpp | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/panel/ukuipanel.cpp b/panel/ukuipanel.cpp
|
||||
index b93da7e..42f0b18 100644
|
||||
--- a/panel/ukuipanel.cpp
|
||||
+++ b/panel/ukuipanel.cpp
|
||||
@@ -633,10 +633,10 @@ void UKUIPanel::setPanelGeometry(bool animate)
|
||||
}
|
||||
QDBusMessage message =QDBusMessage::createSignal("/panel/position", "org.ukui.panel", "UKuiPanelPosition");
|
||||
QList<QVariant> args;
|
||||
- args.append(currentScreen.x());
|
||||
- args.append(currentScreen.y());
|
||||
- args.append(currentScreen.width());
|
||||
- args.append(currentScreen.height());
|
||||
+ args.append(m_primaryScreenGeometry.x());
|
||||
+ args.append(m_primaryScreenGeometry.y());
|
||||
+ args.append(m_primaryScreenGeometry.width());
|
||||
+ args.append(m_primaryScreenGeometry.height());
|
||||
args.append(panelSize());
|
||||
args.append(m_gsettings->get(PANEL_POSITION_KEY).toInt());
|
||||
message.setArguments(args);
|
|
@ -0,0 +1,37 @@
|
|||
From: =?utf-8?b?5L2V5py05bCn?= <18373370753@163.com>
|
||||
Date: Wed, 8 Feb 2023 01:37:39 +0000
|
||||
Subject: =?utf-8?b?ITQzICpGaXg6IzEzMDg4NSDop6bmkbjplb/lronlrrnmmJPlkIzml7Y=?=
|
||||
=?utf-8?b?5Ye6546w5pel5Y6G5ZKM5Y+z6ZSu6I+c5Y2VIE1lcmdlIHB1bGwgcmVxdWVzdCAh?=
|
||||
=?utf-8?b?NDMgZnJvbSB6aGFuZ3lpbmppZS9vcGVua3lsaW4veWFuZ3R6ZQ==?=
|
||||
|
||||
---
|
||||
plugin-calendar/ukuicalendar.cpp | 2 +-
|
||||
plugin-calendar/ukuicalendar.h | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/plugin-calendar/ukuicalendar.cpp b/plugin-calendar/ukuicalendar.cpp
|
||||
index baa8915..0b30a49 100644
|
||||
--- a/plugin-calendar/ukuicalendar.cpp
|
||||
+++ b/plugin-calendar/ukuicalendar.cpp
|
||||
@@ -636,7 +636,7 @@ CalendarActiveLabel::CalendarActiveLabel(IUKUIPanelPlugin *plugin, QWidget *pare
|
||||
QTimer::singleShot(1000,[this] {setToolTip(tr("Time and Date")); });
|
||||
}
|
||||
|
||||
-void CalendarActiveLabel::mousePressEvent(QMouseEvent *event)
|
||||
+void CalendarActiveLabel::mouseReleaseEvent(QMouseEvent *event)
|
||||
{
|
||||
if (Qt::LeftButton == event->button()){
|
||||
if(calendar_version == "old"){
|
||||
diff --git a/plugin-calendar/ukuicalendar.h b/plugin-calendar/ukuicalendar.h
|
||||
index 88d7148..299d707 100644
|
||||
--- a/plugin-calendar/ukuicalendar.h
|
||||
+++ b/plugin-calendar/ukuicalendar.h
|
||||
@@ -136,7 +136,7 @@ protected:
|
||||
* @param event
|
||||
*/
|
||||
virtual void contextMenuEvent(QContextMenuEvent *event);
|
||||
- void mousePressEvent(QMouseEvent *event);
|
||||
+ void mouseReleaseEvent(QMouseEvent *event);
|
||||
private:
|
||||
frmLunarCalendarWidget *w;
|
||||
QDBusInterface *mInterface;
|
|
@ -0,0 +1,26 @@
|
|||
#!/usr/bin/make -f
|
||||
# export DH_VERBOSE=1
|
||||
|
||||
export LC_ALL=C.UTF-8
|
||||
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
|
||||
|
||||
WHICH_OS := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS 2>/dev/null)
|
||||
|
||||
ifeq ($(WHICH_OS), kfreebsd)
|
||||
NOT_LINUX := -DCPULOAD_PLUGIN=NO -DNETWORKMONITOR_PLUGIN=NO -DVOLUME_PLUGIN=NO
|
||||
endif
|
||||
|
||||
ifeq ($(WHICH_OS), hurd)
|
||||
NOT_LINUX := -DCPULOAD_PLUGIN=NO -DNETWORKMONITOR_PLUGIN=NO -DVOLUME_PLUGIN=NO -DSENSORS_PLUGIN=NO
|
||||
endif
|
||||
|
||||
%:
|
||||
dh ${@} --buildsystem cmake
|
||||
|
||||
override_dh_auto_configure:
|
||||
dh_auto_configure -- -D_FORTIFY_SOURCE=2\
|
||||
-DPULL_TRANSLATIONS=OFF \
|
||||
-DUPDATE_TRANSLATIONS=OFF \
|
||||
-DDOM_PLUGIN=OFF \
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
$(NOT_LINUX)
|
|
@ -0,0 +1 @@
|
|||
3.0 (native)
|
|
@ -0,0 +1 @@
|
|||
tar-ignore=.gitignore
|
|
@ -0,0 +1,8 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
glib-compile-schemas /usr/share/glib-2.0/schemas/
|
||||
|
||||
|
||||
#DEBHELPER#
|
|
@ -0,0 +1,2 @@
|
|||
version=4
|
||||
https://github.com/ukui/ukui-panel/releases .*/ukui-panel_(\d\S+)\.orig\.tar\.gz
|
|
@ -0,0 +1,96 @@
|
|||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
project(taskmanager LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
#find QT modules
|
||||
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core Gui Quick Widgets DBus X11Extras REQUIRED)
|
||||
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Gui Quick Widgets DBus X11Extras REQUIRED)
|
||||
|
||||
#find kde modules
|
||||
find_package(Qt5Xdg REQUIRED)
|
||||
find_package(KF5Wayland)
|
||||
find_package(KF5I18n)
|
||||
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
|
||||
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
|
||||
include(FindQtWaylandScanner)
|
||||
include(ECMQtDeclareLoggingCategory)
|
||||
|
||||
#find other modules
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(GLIB2 REQUIRED glib-2.0)
|
||||
pkg_check_modules(GIO2 REQUIRED gio-2.0)
|
||||
pkg_check_modules(Gsetting REQUIRED gsettings-qt)
|
||||
pkg_check_modules(PipeWire REQUIRED libpipewire-0.3)
|
||||
include_directories(${GLIB2_INCLUDE_DIRS})
|
||||
include_directories(${GIO2_INCLUDE_DIRS})
|
||||
include_directories(${Gsetting_INCLUDE_DIRS})
|
||||
include_directories(${PipeWire_INCLUDE_DIRS})
|
||||
|
||||
#generate libtaskmanager.so
|
||||
set (PLUGIN_SRCS
|
||||
screencastingrequest.cpp screencastingrequest.h
|
||||
screencasting.cpp screencasting.h
|
||||
pipewirecore.cpp pipewirecore.h
|
||||
pipewiresourcestream.cpp pipewiresourcestream.h
|
||||
pipewiresourceitem.cpp pipewiresourceitem.h
|
||||
taskmanagerplugin.cpp taskmanagerplugin.h
|
||||
)
|
||||
|
||||
add_library(${PROJECT_NAME} SHARED ${PLUGIN_SRCS})
|
||||
target_compile_definitions(${PROJECT_NAME} PRIVATE PLUGIN_IMPORT_URI="${PLUGIN_IMPORT_URI}")
|
||||
target_link_libraries(${PROJECT_NAME}
|
||||
PRIVATE
|
||||
Qt5::Core
|
||||
Qt5::Gui
|
||||
Qt5::Gui_EGL
|
||||
Qt::GuiPrivate
|
||||
Qt5::Quick
|
||||
Qt5::Widgets
|
||||
Qt5::DBus
|
||||
Qt5::X11Extras
|
||||
Qt5Xdg
|
||||
${GLIB2_LIBRARIES}
|
||||
${GIO2_LIBRARIES}
|
||||
${Gsetting_LIBRARIES}
|
||||
${PipeWire_LIBRARIES}
|
||||
KF5::WaylandClient
|
||||
KF5::I18n
|
||||
)
|
||||
|
||||
#generate log files
|
||||
ecm_qt_declare_logging_category(SRCS
|
||||
HEADER logging.h
|
||||
IDENTIFIER PIPEWIRE_LOGGING
|
||||
CATEGORY_NAME plasma_workspace_pipewire_logging
|
||||
DESCRIPTION "PipeWire components for window thumbnails"
|
||||
EXPORT PlasmaWorkspacePipeWire)
|
||||
ecm_qt_install_logging_categories(
|
||||
EXPORT PlasmaWorkspacePipeWire
|
||||
FILE myproject.categories
|
||||
DESTINATION "./"
|
||||
)
|
||||
|
||||
#generate wayland protocol files
|
||||
set(PLASMA_WAYLAND_PROTOCOLS_DIR /usr/share/plasma-wayland-protocols)
|
||||
ecm_add_qtwayland_client_protocol(SRCS
|
||||
PROTOCOL ${PLASMA_WAYLAND_PROTOCOLS_DIR}/screencast.xml
|
||||
BASENAME zkde-screencast-unstable-v1
|
||||
)
|
||||
|
||||
target_sources(${PROJECT_NAME} PUBLIC pipewirecore.cpp pipewiresourceitem.cpp pipewiresourcestream.cpp
|
||||
screencasting.cpp screencastingrequest.cpp ${SRCS})
|
||||
|
||||
set(PLUGIN_IMPORT_URI "org.ukui.panel.taskmanager")
|
||||
set(PLUGIN_INSTALL_PATH "/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}/qt5/qml/org/ukui/panel/taskmanager")
|
||||
set(taskmanager_LIB_DIR /usr/share/ukui/ukui-panel/libtaskmanager)
|
||||
install(FILES qmldir DESTINATION ${PLUGIN_INSTALL_PATH})
|
||||
install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${PLUGIN_INSTALL_PATH})
|
||||
|
||||
|
|
@ -0,0 +1,93 @@
|
|||
#include "pipewirecore.h"
|
||||
#include "logging.h"
|
||||
#include <KLocalizedString>
|
||||
#include <QSocketNotifier>
|
||||
#include <spa/utils/result.h>
|
||||
|
||||
PipeWireCore::PipeWireCore()
|
||||
{
|
||||
pw_init(nullptr, nullptr);
|
||||
pwCoreEvents.version = PW_VERSION_CORE_EVENTS;
|
||||
pwCoreEvents.error = &PipeWireCore::onCoreError;
|
||||
}
|
||||
|
||||
void PipeWireCore::onCoreError(void *data, uint32_t id, int seq, int res, const char *message)
|
||||
{
|
||||
Q_UNUSED(seq)
|
||||
|
||||
qCWarning(PIPEWIRE_LOGGING) << "PipeWire remote error: " << message;
|
||||
if (id == PW_ID_CORE && res == -EPIPE) {
|
||||
PipeWireCore *pw = static_cast<PipeWireCore *>(data);
|
||||
Q_EMIT pw->pipewireFailed(QString::fromUtf8(message));
|
||||
}
|
||||
}
|
||||
|
||||
PipeWireCore::~PipeWireCore()
|
||||
{
|
||||
if (pwMainLoop) {
|
||||
pw_loop_leave(pwMainLoop);
|
||||
}
|
||||
|
||||
if (pwCore) {
|
||||
pw_core_disconnect(pwCore);
|
||||
}
|
||||
|
||||
if (pwContext) {
|
||||
pw_context_destroy(pwContext);
|
||||
}
|
||||
|
||||
if (pwMainLoop) {
|
||||
pw_loop_destroy(pwMainLoop);
|
||||
}
|
||||
}
|
||||
|
||||
bool PipeWireCore::init()
|
||||
{
|
||||
pwMainLoop = pw_loop_new(nullptr);
|
||||
pw_loop_enter(pwMainLoop);
|
||||
|
||||
QSocketNotifier *notifier = new QSocketNotifier(pw_loop_get_fd(pwMainLoop), QSocketNotifier::Read, this);
|
||||
connect(notifier, &QSocketNotifier::activated, this, [this] {
|
||||
int result = pw_loop_iterate(pwMainLoop, 0);
|
||||
if (result < 0)
|
||||
qCWarning(PIPEWIRE_LOGGING) << "pipewire_loop_iterate failed: " << spa_strerror(result);
|
||||
});
|
||||
|
||||
pwContext = pw_context_new(pwMainLoop, nullptr, 0);
|
||||
if (!pwContext) {
|
||||
qCWarning(PIPEWIRE_LOGGING) << "Failed to create PipeWire context";
|
||||
m_error = i18n("Failed to create PipeWire context");
|
||||
return false;
|
||||
}
|
||||
|
||||
pwCore = pw_context_connect(pwContext, nullptr, 0);
|
||||
if (!pwCore) {
|
||||
qCWarning(PIPEWIRE_LOGGING) << "Failed to connect PipeWire context";
|
||||
m_error = i18n("Failed to connect PipeWire context");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (pw_loop_iterate(pwMainLoop, 0) < 0) {
|
||||
qCWarning(PIPEWIRE_LOGGING) << "Failed to start main PipeWire loop";
|
||||
m_error = i18n("Failed to start main PipeWire loop");
|
||||
return false;
|
||||
}
|
||||
|
||||
pw_core_add_listener(pwCore, &coreListener, &pwCoreEvents, this);
|
||||
return true;
|
||||
}
|
||||
|
||||
QSharedPointer<PipeWireCore> PipeWireCore::self()
|
||||
{
|
||||
static QWeakPointer<PipeWireCore> global;
|
||||
QSharedPointer<PipeWireCore> ret;
|
||||
if (global) {
|
||||
ret = global.toStrongRef();
|
||||
} else {
|
||||
ret.reset(new PipeWireCore);
|
||||
if (ret->init()) {
|
||||
global = ret;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
#ifndef PIPEWIRECORE_H
|
||||
#define PIPEWIRECORE_H
|
||||
|
||||
|
||||
#include <QObject>
|
||||
#include <pipewire/pipewire.h>
|
||||
|
||||
class PipeWireCore : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
PipeWireCore();
|
||||
|
||||
static void onCoreError(void *data, uint32_t id, int seq, int res, const char *message);
|
||||
|
||||
~PipeWireCore();
|
||||
|
||||
bool init();
|
||||
|
||||
static QSharedPointer<PipeWireCore> self();
|
||||
|
||||
struct pw_core *pwCore = nullptr;
|
||||
struct pw_context *pwContext = nullptr;
|
||||
struct pw_loop *pwMainLoop = nullptr;
|
||||
spa_hook coreListener;
|
||||
QString m_error;
|
||||
|
||||
pw_core_events pwCoreEvents = {};
|
||||
|
||||
Q_SIGNALS:
|
||||
void pipewireFailed(const QString &message);
|
||||
};
|
||||
|
||||
#endif // PIPEWIRECORE_H
|
|
@ -0,0 +1,284 @@
|
|||
#include "pipewiresourceitem.h"
|
||||
#include "pipewiresourcestream.h"
|
||||
#include <QGuiApplication>
|
||||
#include <QOpenGLContext>
|
||||
#include <QOpenGLTexture>
|
||||
#include <QQuickWindow>
|
||||
#include <QRunnable>
|
||||
#include <QSGImageNode>
|
||||
#include <QSocketNotifier>
|
||||
#include <QThread>
|
||||
#include <qpa/qplatformnativeinterface.h>
|
||||
|
||||
#include <EGL/egl.h>
|
||||
#include <EGL/eglext.h>
|
||||
#include <libdrm/drm_fourcc.h>
|
||||
|
||||
#include <QtPlatformHeaders/QEGLNativeContext>
|
||||
|
||||
static void pwInit()
|
||||
{
|
||||
pw_init(nullptr, nullptr);
|
||||
}
|
||||
Q_COREAPP_STARTUP_FUNCTION(pwInit);
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
PipeWireSourceItem::PipeWireSourceItem(QQuickItem *parent)
|
||||
: QQuickItem(parent)
|
||||
{
|
||||
setFlag(ItemHasContents, true);
|
||||
|
||||
connect(this, &QQuickItem::visibleChanged, this, [this]() {
|
||||
if (m_stream)
|
||||
m_stream->setActive(isVisible());
|
||||
});
|
||||
}
|
||||
|
||||
PipeWireSourceItem::~PipeWireSourceItem()
|
||||
{
|
||||
}
|
||||
|
||||
void PipeWireSourceItem::itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &data)
|
||||
{
|
||||
switch (change) {
|
||||
case ItemVisibleHasChanged:
|
||||
if (m_stream)
|
||||
m_stream->setActive(isVisible() && data.boolValue && isComponentComplete());
|
||||
break;
|
||||
case ItemSceneChange:
|
||||
m_needsRecreateTexture = true;
|
||||
releaseResources();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void PipeWireSourceItem::releaseResources()
|
||||
{
|
||||
if (window()) {
|
||||
window()->scheduleRenderJob(new DiscardEglPixmapRunnable(m_image, m_texture.take()), QQuickWindow::NoStage);
|
||||
m_image = EGL_NO_IMAGE_KHR;
|
||||
}
|
||||
}
|
||||
|
||||
void PipeWireSourceItem::setNodeId(uint nodeId)
|
||||
{
|
||||
if (nodeId == m_nodeId)
|
||||
return;
|
||||
|
||||
m_nodeId = nodeId;
|
||||
|
||||
if (m_nodeId == 0) {
|
||||
m_stream.reset(nullptr);
|
||||
m_createNextTexture = [] {
|
||||
return nullptr;
|
||||
};
|
||||
} else {
|
||||
m_stream.reset(new PipeWireSourceStream(this));
|
||||
m_stream->createStream(m_nodeId);
|
||||
if (!m_stream->error().isEmpty()) {
|
||||
m_stream.reset(nullptr);
|
||||
m_nodeId = 0;
|
||||
return;
|
||||
}
|
||||
m_stream->setActive(isVisible() && isComponentComplete());
|
||||
|
||||
connect(m_stream.data(), &PipeWireSourceStream::dmabufTextureReceived, this, &PipeWireSourceItem::updateTextureDmaBuf);
|
||||
connect(m_stream.data(), &PipeWireSourceStream::imageTextureReceived, this, &PipeWireSourceItem::updateTextureImage);
|
||||
}
|
||||
|
||||
Q_EMIT nodeIdChanged(nodeId);
|
||||
}
|
||||
|
||||
QSGNode *PipeWireSourceItem::updatePaintNode(QSGNode *node, QQuickItem::UpdatePaintNodeData *)
|
||||
{
|
||||
if (Q_UNLIKELY(!m_createNextTexture)) {
|
||||
return node;
|
||||
}
|
||||
|
||||
auto texture = m_createNextTexture();
|
||||
if (!texture) {
|
||||
delete node;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (m_needsRecreateTexture) {
|
||||
delete node;
|
||||
node = nullptr;
|
||||
m_needsRecreateTexture = false;
|
||||
}
|
||||
|
||||
QSGImageNode *textureNode = static_cast<QSGImageNode *>(node);
|
||||
if (!textureNode) {
|
||||
textureNode = window()->createImageNode();
|
||||
textureNode->setOwnsTexture(true);
|
||||
}
|
||||
textureNode->setTexture(texture);
|
||||
|
||||
const auto br = boundingRect().toRect();
|
||||
QRect rect({0, 0}, texture->textureSize().scaled(br.size(), Qt::KeepAspectRatio));
|
||||
rect.moveCenter(br.center());
|
||||
textureNode->setRect(rect);
|
||||
|
||||
return textureNode;
|
||||
}
|
||||
|
||||
QString PipeWireSourceItem::error() const
|
||||
{
|
||||
return m_stream->error();
|
||||
}
|
||||
|
||||
static EGLImage createImage(EGLDisplay display, const QVector<DmaBufPlane> &planes, uint32_t format, const QSize &size)
|
||||
{
|
||||
const bool hasModifiers = planes[0].modifier != DRM_FORMAT_MOD_INVALID;
|
||||
|
||||
QVector<EGLint> attribs;
|
||||
attribs << EGL_WIDTH << size.width() << EGL_HEIGHT << size.height() << EGL_LINUX_DRM_FOURCC_EXT << EGLint(format)
|
||||
|
||||
<< EGL_DMA_BUF_PLANE0_FD_EXT << planes[0].fd << EGL_DMA_BUF_PLANE0_OFFSET_EXT << EGLint(planes[0].offset) << EGL_DMA_BUF_PLANE0_PITCH_EXT
|
||||
<< EGLint(planes[0].stride);
|
||||
|
||||
if (hasModifiers) {
|
||||
attribs << EGL_DMA_BUF_PLANE0_MODIFIER_LO_EXT << EGLint(planes[0].modifier & 0xffffffff) << EGL_DMA_BUF_PLANE0_MODIFIER_HI_EXT
|
||||
<< EGLint(planes[0].modifier >> 32);
|
||||
}
|
||||
|
||||
if (planes.count() > 1) {
|
||||
attribs << EGL_DMA_BUF_PLANE1_FD_EXT << planes[1].fd << EGL_DMA_BUF_PLANE1_OFFSET_EXT << EGLint(planes[1].offset) << EGL_DMA_BUF_PLANE1_PITCH_EXT
|
||||
<< EGLint(planes[1].stride);
|
||||
|
||||
if (hasModifiers) {
|
||||
attribs << EGL_DMA_BUF_PLANE1_MODIFIER_LO_EXT << EGLint(planes[1].modifier & 0xffffffff) << EGL_DMA_BUF_PLANE1_MODIFIER_HI_EXT
|
||||
<< EGLint(planes[1].modifier >> 32);
|
||||
}
|
||||
}
|
||||
|
||||
if (planes.count() > 2) {
|
||||
attribs << EGL_DMA_BUF_PLANE2_FD_EXT << planes[2].fd << EGL_DMA_BUF_PLANE2_OFFSET_EXT << EGLint(planes[2].offset) << EGL_DMA_BUF_PLANE2_PITCH_EXT
|
||||
<< EGLint(planes[2].stride);
|
||||
|
||||
if (hasModifiers) {
|
||||
attribs << EGL_DMA_BUF_PLANE2_MODIFIER_LO_EXT << EGLint(planes[2].modifier & 0xffffffff) << EGL_DMA_BUF_PLANE2_MODIFIER_HI_EXT
|
||||
<< EGLint(planes[2].modifier >> 32);
|
||||
}
|
||||
}
|
||||
|
||||
if (planes.count() > 3) {
|
||||
attribs << EGL_DMA_BUF_PLANE3_FD_EXT << planes[3].fd << EGL_DMA_BUF_PLANE3_OFFSET_EXT << EGLint(planes[3].offset) << EGL_DMA_BUF_PLANE3_PITCH_EXT
|
||||
<< EGLint(planes[3].stride);
|
||||
|
||||
if (hasModifiers) {
|
||||
attribs << EGL_DMA_BUF_PLANE3_MODIFIER_LO_EXT << EGLint(planes[3].modifier & 0xffffffff) << EGL_DMA_BUF_PLANE3_MODIFIER_HI_EXT
|
||||
<< EGLint(planes[3].modifier >> 32);
|
||||
}
|
||||
}
|
||||
|
||||
attribs << EGL_NONE;
|
||||
|
||||
static auto eglCreateImageKHR = (PFNEGLCREATEIMAGEKHRPROC)eglGetProcAddress("eglCreateImageKHR");
|
||||
Q_ASSERT(eglCreateImageKHR);
|
||||
|
||||
EGLImage ret = eglCreateImageKHR(display, EGL_NO_CONTEXT, EGL_LINUX_DMA_BUF_EXT, (EGLClientBuffer) nullptr, attribs.data());
|
||||
if (ret == EGL_NO_IMAGE_KHR) {
|
||||
qWarning() << "invalid image" << glGetError();
|
||||
}
|
||||
// Q_ASSERT(ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void PipeWireSourceItem::updateTextureDmaBuf(const QVector<DmaBufPlane> &planes, uint32_t format)
|
||||
{
|
||||
static auto s_glEGLImageTargetTexture2DOES = (PFNGLEGLIMAGETARGETTEXTURE2DOESPROC)eglGetProcAddress("glEGLImageTargetTexture2DOES");
|
||||
if (!s_glEGLImageTargetTexture2DOES) {
|
||||
qWarning() << "glEGLImageTargetTexture2DOES is not available" << window();
|
||||
return;
|
||||
}
|
||||
if (!window() || !window()->openglContext() || !m_stream) {
|
||||
qWarning() << "need a window and a context" << window();
|
||||
return;
|
||||
}
|
||||
|
||||
const EGLDisplay display = static_cast<EGLDisplay>(QGuiApplication::platformNativeInterface()->nativeResourceForIntegration("egldisplay"));
|
||||
if (m_image) {
|
||||
static auto eglDestroyImageKHR = (PFNEGLDESTROYIMAGEKHRPROC)eglGetProcAddress("eglDestroyImageKHR");
|
||||
eglDestroyImageKHR(display, m_image);
|
||||
}
|
||||
|
||||
const auto size = m_stream->size();
|
||||
m_image = createImage(display, planes, format, size);
|
||||
if (m_image == EGL_NO_IMAGE_KHR) {
|
||||
QImage img(200, 200, QImage::Format_ARGB32_Premultiplied);
|
||||
img.fill(Qt::blue);
|
||||
updateTextureImage(img);
|
||||
return;
|
||||
}
|
||||
|
||||
m_createNextTexture = [this, size, format] {
|
||||
if (!m_texture) {
|
||||
m_texture.reset(new QOpenGLTexture(QOpenGLTexture::Target2D));
|
||||
bool created = m_texture->create();
|
||||
Q_ASSERT(created);
|
||||
}
|
||||
|
||||
m_texture->bind();
|
||||
|
||||
s_glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, (GLeglImageOES)m_image);
|
||||
|
||||
m_texture->setWrapMode(QOpenGLTexture::ClampToEdge);
|
||||
m_texture->setMinMagFilters(QOpenGLTexture::Linear, QOpenGLTexture::Linear);
|
||||
m_texture->release();
|
||||
m_texture->setSize(size.width(), size.height());
|
||||
|
||||
int textureId = m_texture->textureId();
|
||||
QQuickWindow::CreateTextureOption textureOption = format == DRM_FORMAT_ARGB8888 ? QQuickWindow::TextureHasAlphaChannel : QQuickWindow::TextureIsOpaque;
|
||||
return window()->createTextureFromNativeObject(QQuickWindow::NativeObjectTexture, &textureId, 0 /*a vulkan thing?*/, size, textureOption);
|
||||
};
|
||||
if (window()->isVisible()) {
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
void PipeWireSourceItem::updateTextureImage(const QImage &image)
|
||||
{
|
||||
if (!window()) {
|
||||
qWarning() << "pass";
|
||||
return;
|
||||
}
|
||||
|
||||
m_createNextTexture = [this, image] {
|
||||
return window()->createTextureFromImage(image, QQuickWindow::TextureIsOpaque);
|
||||
};
|
||||
if (window()->isVisible())
|
||||
update();
|
||||
}
|
||||
|
||||
void PipeWireSourceItem::componentComplete()
|
||||
{
|
||||
if (m_stream)
|
||||
m_stream->setActive(isVisible());
|
||||
QQuickItem::componentComplete();
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
#ifndef PIPEWIRESOURCEITEM_H
|
||||
#define PIPEWIRESOURCEITEM_H
|
||||
|
||||
#include <QQuickItem>
|
||||
#include <functional>
|
||||
|
||||
#include <pipewire/pipewire.h>
|
||||
#include <spa/param/format-utils.h>
|
||||
#include <spa/param/props.h>
|
||||
#include <spa/param/video/format-utils.h>
|
||||
|
||||
struct DmaBufPlane;
|
||||
class PipeWireSourceStream;
|
||||
class QSGTexture;
|
||||
class QOpenGLTexture;
|
||||
typedef void *EGLImage;
|
||||
|
||||
class PipeWireSourceItem : public QQuickItem
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(uint nodeId READ nodeId WRITE setNodeId NOTIFY nodeIdChanged)
|
||||
|
||||
public:
|
||||
PipeWireSourceItem(QQuickItem *parent = nullptr);
|
||||
~PipeWireSourceItem() override;
|
||||
|
||||
QSGNode *updatePaintNode(QSGNode *node, UpdatePaintNodeData *data) override;
|
||||
Q_SCRIPTABLE QString error() const;
|
||||
|
||||
void setNodeId(uint nodeId);
|
||||
uint nodeId() const
|
||||
{
|
||||
return m_nodeId;
|
||||
}
|
||||
|
||||
void componentComplete() override;
|
||||
void releaseResources() override;
|
||||
|
||||
Q_SIGNALS:
|
||||
void nodeIdChanged(uint nodeId);
|
||||
|
||||
private:
|
||||
void itemChange(ItemChange change, const ItemChangeData &data) override;
|
||||
void updateTextureDmaBuf(const QVector<DmaBufPlane> &plane, uint32_t format);
|
||||
void updateTextureImage(const QImage &image);
|
||||
|
||||
uint m_nodeId = 0;
|
||||
std::function<QSGTexture *()> m_createNextTexture;
|
||||
QScopedPointer<PipeWireSourceStream> m_stream;
|
||||
QScopedPointer<QOpenGLTexture> m_texture;
|
||||
|
||||
EGLImage m_image = nullptr;
|
||||
bool m_needsRecreateTexture = false;
|
||||
};
|
||||
|
||||
#endif // PIPEWIRESOURCEITEM_H
|
|
@ -0,0 +1,364 @@
|
|||
#include "pipewiresourcestream.h"
|
||||
|
||||
#include "logging.h"
|
||||
#include "pipewirecore.h"
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <libdrm/drm_fourcc.h>
|
||||
#include <spa/utils/result.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/mman.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <QGuiApplication>
|
||||
#include <QLoggingCategory>
|
||||
#include <QOpenGLTexture>
|
||||
#include <QSocketNotifier>
|
||||
#include <QVersionNumber>
|
||||
#include <qpa/qplatformnativeinterface.h>
|
||||
|
||||
#include <KLocalizedString>
|
||||
|
||||
#include <EGL/egl.h>
|
||||
#include <EGL/eglext.h>
|
||||
|
||||
#include <QtPlatformHeaders/QEGLNativeContext>
|
||||
#undef Status
|
||||
|
||||
#if !PW_CHECK_VERSION(0, 3, 29)
|
||||
#define SPA_POD_PROP_FLAG_MANDATORY (1u << 3)
|
||||
#endif
|
||||
#if !PW_CHECK_VERSION(0, 3, 33)
|
||||
#define SPA_POD_PROP_FLAG_DONT_FIXATE (1u << 4)
|
||||
#endif
|
||||
|
||||
static uint32_t SpaPixelFormatToDrmFormat(uint32_t spa_format)
|
||||
{
|
||||
switch (spa_format) {
|
||||
case SPA_VIDEO_FORMAT_RGBA:
|
||||
return DRM_FORMAT_ABGR8888;
|
||||
case SPA_VIDEO_FORMAT_RGBx:
|
||||
return DRM_FORMAT_XBGR8888;
|
||||
case SPA_VIDEO_FORMAT_BGRA:
|
||||
return DRM_FORMAT_ARGB8888;
|
||||
case SPA_VIDEO_FORMAT_BGRx:
|
||||
return DRM_FORMAT_XRGB8888;
|
||||
default:
|
||||
return DRM_FORMAT_INVALID;
|
||||
}
|
||||
}
|
||||
|
||||
static std::vector<uint64_t> queryDmaBufModifiers(EGLDisplay display, uint32_t format)
|
||||
{
|
||||
static auto eglQueryDmaBufModifiersEXT = (PFNEGLQUERYDMABUFMODIFIERSEXTPROC)eglGetProcAddress("eglQueryDmaBufModifiersEXT");
|
||||
static auto eglQueryDmaBufFormatsEXT = (PFNEGLQUERYDMABUFFORMATSEXTPROC)eglGetProcAddress("eglQueryDmaBufFormatsEXT");
|
||||
if (!eglQueryDmaBufFormatsEXT || !eglQueryDmaBufModifiersEXT) {
|
||||
return {};
|
||||
}
|
||||
|
||||
uint32_t drm_format = SpaPixelFormatToDrmFormat(format);
|
||||
if (drm_format == DRM_FORMAT_INVALID) {
|
||||
qCDebug(PIPEWIRE_LOGGING) << "Failed to find matching DRM format." << format;
|
||||
return {};
|
||||
}
|
||||
|
||||
EGLint count = 0;
|
||||
EGLBoolean success = eglQueryDmaBufFormatsEXT(display, 0, nullptr, &count);
|
||||
|
||||
if (!success || count == 0) {
|
||||
qCWarning(PIPEWIRE_LOGGING) << "Failed to query DMA-BUF format count.";
|
||||
return {};
|
||||
}
|
||||
|
||||
std::vector<uint32_t> formats(count);
|
||||
if (!eglQueryDmaBufFormatsEXT(display, count, reinterpret_cast<EGLint *>(formats.data()), &count)) {
|
||||
if (!success)
|
||||
qCWarning(PIPEWIRE_LOGGING) << "Failed to query DMA-BUF formats.";
|
||||
return {};
|
||||
}
|
||||
|
||||
if (std::find(formats.begin(), formats.end(), drm_format) == formats.end()) {
|
||||
qCDebug(PIPEWIRE_LOGGING) << "Format " << drm_format << " not supported for modifiers.";
|
||||
return {DRM_FORMAT_MOD_INVALID};
|
||||
}
|
||||
|
||||
success = eglQueryDmaBufModifiersEXT(display, drm_format, 0, nullptr, nullptr, &count);
|
||||
if (!success) {
|
||||
qCWarning(PIPEWIRE_LOGGING) << "Failed to query DMA-BUF modifier count.";
|
||||
return {};
|
||||
}
|
||||
|
||||
std::vector<uint64_t> modifiers(count);
|
||||
if (count > 0) {
|
||||
if (!eglQueryDmaBufModifiersEXT(display, drm_format, count, modifiers.data(), nullptr, &count)) {
|
||||
qCWarning(PIPEWIRE_LOGGING) << "Failed to query DMA-BUF modifiers.";
|
||||
}
|
||||
}
|
||||
|
||||
// Support modifier-less buffers
|
||||
modifiers.push_back(DRM_FORMAT_MOD_INVALID);
|
||||
return modifiers;
|
||||
}
|
||||
|
||||
void PipeWireSourceStream::onStreamStateChanged(void *data, pw_stream_state old, pw_stream_state state, const char *error_message)
|
||||
{
|
||||
PipeWireSourceStream *pw = static_cast<PipeWireSourceStream *>(data);
|
||||
qCDebug(PIPEWIRE_LOGGING) << "state changed" << pw_stream_state_as_string(old) << "->" << pw_stream_state_as_string(state) << error_message;
|
||||
|
||||
switch (state) {
|
||||
case PW_STREAM_STATE_ERROR:
|
||||
qCWarning(PIPEWIRE_LOGGING) << "Stream error: " << error_message;
|
||||
break;
|
||||
case PW_STREAM_STATE_PAUSED:
|
||||
Q_EMIT pw->streamReady();
|
||||
break;
|
||||
case PW_STREAM_STATE_STREAMING:
|
||||
Q_EMIT pw->startStreaming();
|
||||
break;
|
||||
case PW_STREAM_STATE_CONNECTING:
|
||||
break;
|
||||
case PW_STREAM_STATE_UNCONNECTED:
|
||||
if (!pw->m_stopped) {
|
||||
Q_EMIT pw->stopStreaming();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static spa_pod *buildFormat(spa_pod_builder *builder, spa_video_format format, const std::vector<uint64_t> &modifiers = {})
|
||||
{
|
||||
spa_pod_frame f[2];
|
||||
const spa_rectangle pw_min_screen_bounds{1, 1};
|
||||
const spa_rectangle pw_max_screen_bounds{UINT32_MAX, UINT32_MAX};
|
||||
|
||||
spa_pod_builder_push_object(builder, &f[0], SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat);
|
||||
spa_pod_builder_add(builder, SPA_FORMAT_mediaType, SPA_POD_Id(SPA_MEDIA_TYPE_video), 0);
|
||||
spa_pod_builder_add(builder, SPA_FORMAT_mediaSubtype, SPA_POD_Id(SPA_MEDIA_SUBTYPE_raw), 0);
|
||||
spa_pod_builder_add(builder, SPA_FORMAT_VIDEO_format, SPA_POD_Id(format), 0);
|
||||
|
||||
if (modifiers.size()) {
|
||||
auto pw_version = QVersionNumber::fromString(pw_get_library_version());
|
||||
|
||||
// SPA_POD_PROP_FLAG_DONT_FIXATE can be used with PipeWire >= 0.3.33
|
||||
if (pw_version >= QVersionNumber(0, 3, 33)) {
|
||||
spa_pod_builder_prop(builder, SPA_FORMAT_VIDEO_modifier, SPA_POD_PROP_FLAG_MANDATORY | SPA_POD_PROP_FLAG_DONT_FIXATE);
|
||||
} else {
|
||||
spa_pod_builder_prop(builder, SPA_FORMAT_VIDEO_modifier, SPA_POD_PROP_FLAG_MANDATORY);
|
||||
}
|
||||
spa_pod_builder_push_choice(builder, &f[1], SPA_CHOICE_Enum, 0);
|
||||
// mofifiers from the array
|
||||
for (auto it = modifiers.begin(); it != modifiers.end(); it++) {
|
||||
spa_pod_builder_long(builder, *it);
|
||||
if (it == modifiers.begin()) {
|
||||
spa_pod_builder_long(builder, *it);
|
||||
}
|
||||
}
|
||||
spa_pod_builder_pop(builder, &f[1]);
|
||||
}
|
||||
|
||||
spa_pod_builder_add(builder, SPA_FORMAT_VIDEO_size, SPA_POD_CHOICE_RANGE_Rectangle(&pw_min_screen_bounds, &pw_min_screen_bounds, &pw_max_screen_bounds), 0);
|
||||
|
||||
return static_cast<spa_pod *>(spa_pod_builder_pop(builder, &f[0]));
|
||||
}
|
||||
|
||||
void PipeWireSourceStream::onStreamParamChanged(void *data, uint32_t id, const struct spa_pod *format)
|
||||
{
|
||||
if (!format || id != SPA_PARAM_Format) {
|
||||
return;
|
||||
}
|
||||
|
||||
PipeWireSourceStream *pw = static_cast<PipeWireSourceStream *>(data);
|
||||
spa_format_video_raw_parse(format, &pw->videoFormat);
|
||||
|
||||
const int32_t width = pw->videoFormat.size.width;
|
||||
const int32_t height = pw->videoFormat.size.height;
|
||||
const int bpp = pw->videoFormat.format == SPA_VIDEO_FORMAT_RGB || pw->videoFormat.format == SPA_VIDEO_FORMAT_BGR ? 3 : 4;
|
||||
const quint32 stride = SPA_ROUND_UP_N(width * bpp, 4);
|
||||
qCDebug(PIPEWIRE_LOGGING) << "Stream format changed";
|
||||
const int32_t size = height * stride;
|
||||
|
||||
uint8_t paramsBuffer[1024];
|
||||
spa_pod_builder pod_builder = SPA_POD_BUILDER_INIT(paramsBuffer, sizeof(paramsBuffer));
|
||||
|
||||
const auto bufferTypes = pw->m_allowDmaBuf && spa_pod_find_prop(format, nullptr, SPA_FORMAT_VIDEO_modifier)
|
||||
? (1 << SPA_DATA_DmaBuf) | (1 << SPA_DATA_MemFd) | (1 << SPA_DATA_MemPtr)
|
||||
: (1 << SPA_DATA_MemFd) | (1 << SPA_DATA_MemPtr);
|
||||
|
||||
const spa_pod *param = (spa_pod *)spa_pod_builder_add_object(&pod_builder,
|
||||
SPA_TYPE_OBJECT_ParamBuffers,
|
||||
SPA_PARAM_Buffers,
|
||||
SPA_PARAM_BUFFERS_buffers,
|
||||
SPA_POD_CHOICE_RANGE_Int(16, 2, 16),
|
||||
SPA_PARAM_BUFFERS_blocks,
|
||||
SPA_POD_Int(1),
|
||||
SPA_PARAM_BUFFERS_size,
|
||||
SPA_POD_Int(size),
|
||||
SPA_PARAM_BUFFERS_stride,
|
||||
SPA_POD_CHOICE_RANGE_Int(stride, stride, INT32_MAX),
|
||||
SPA_PARAM_BUFFERS_align,
|
||||
SPA_POD_Int(16),
|
||||
SPA_PARAM_BUFFERS_dataType,
|
||||
SPA_POD_CHOICE_FLAGS_Int(bufferTypes));
|
||||
pw_stream_update_params(pw->pwStream, ¶m, 1);
|
||||
}
|
||||
|
||||
static void onProcess(void *data)
|
||||
{
|
||||
PipeWireSourceStream *stream = static_cast<PipeWireSourceStream *>(data);
|
||||
stream->process();
|
||||
}
|
||||
|
||||
PipeWireSourceStream::PipeWireSourceStream(QObject *parent)
|
||||
: QObject(parent)
|
||||
{
|
||||
pwStreamEvents.version = PW_VERSION_STREAM_EVENTS;
|
||||
pwStreamEvents.process = &onProcess;
|
||||
pwStreamEvents.state_changed = &PipeWireSourceStream::onStreamStateChanged;
|
||||
pwStreamEvents.param_changed = &PipeWireSourceStream::onStreamParamChanged;
|
||||
}
|
||||
|
||||
PipeWireSourceStream::~PipeWireSourceStream()
|
||||
{
|
||||
m_stopped = true;
|
||||
if (pwStream) {
|
||||
pw_stream_destroy(pwStream);
|
||||
}
|
||||
}
|
||||
|
||||
uint PipeWireSourceStream::framerate()
|
||||
{
|
||||
if (pwStream) {
|
||||
return videoFormat.max_framerate.num / videoFormat.max_framerate.denom;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint PipeWireSourceStream::nodeId()
|
||||
{
|
||||
return pwNodeId;
|
||||
}
|
||||
|
||||
bool PipeWireSourceStream::createStream(uint nodeid)
|
||||
{
|
||||
pwCore = PipeWireCore::self();
|
||||
if (!pwCore->m_error.isEmpty()) {
|
||||
m_error = pwCore->m_error;
|
||||
return false;
|
||||
}
|
||||
|
||||
connect(pwCore.data(), &PipeWireCore::pipewireFailed, this, &PipeWireSourceStream::coreFailed);
|
||||
|
||||
pwStream = pw_stream_new(pwCore->pwCore, "plasma-screencast", nullptr);
|
||||
pwNodeId = nodeid;
|
||||
pw_stream_add_listener(pwStream, &streamListener, &pwStreamEvents, this);
|
||||
|
||||
uint8_t buffer[4096];
|
||||
spa_pod_builder podBuilder = SPA_POD_BUILDER_INIT(buffer, sizeof(buffer));
|
||||
|
||||
const QVector<spa_video_format> formats =
|
||||
{SPA_VIDEO_FORMAT_RGBx, SPA_VIDEO_FORMAT_RGBA, SPA_VIDEO_FORMAT_BGRx, SPA_VIDEO_FORMAT_BGRA, SPA_VIDEO_FORMAT_RGB, SPA_VIDEO_FORMAT_BGR};
|
||||
QVector<const spa_pod *> params;
|
||||
params.reserve(formats.size() * 2);
|
||||
const EGLDisplay display = static_cast<EGLDisplay>(QGuiApplication::platformNativeInterface()->nativeResourceForIntegration("egldisplay"));
|
||||
for (spa_video_format format : formats) {
|
||||
if (m_allowDmaBuf) {
|
||||
if (auto modifiers = queryDmaBufModifiers(display, format); modifiers.size() > 0) {
|
||||
params += buildFormat(&podBuilder, format, modifiers);
|
||||
}
|
||||
}
|
||||
|
||||
params += buildFormat(&podBuilder, format, {});
|
||||
}
|
||||
|
||||
pw_stream_flags s = (pw_stream_flags)(PW_STREAM_FLAG_DONT_RECONNECT | PW_STREAM_FLAG_AUTOCONNECT);
|
||||
if (pw_stream_connect(pwStream, PW_DIRECTION_INPUT, pwNodeId, s, params.data(), params.size()) != 0) {
|
||||
qCWarning(PIPEWIRE_LOGGING) << "Could not connect to stream";
|
||||
pw_stream_destroy(pwStream);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void PipeWireSourceStream::handleFrame(struct pw_buffer *buffer)
|
||||
{
|
||||
spa_buffer *spaBuffer = buffer->buffer;
|
||||
|
||||
if (spaBuffer->datas->chunk->size == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (spaBuffer->datas->type == SPA_DATA_MemFd) {
|
||||
uint8_t *map =
|
||||
static_cast<uint8_t *>(mmap(nullptr, spaBuffer->datas->maxsize + spaBuffer->datas->mapoffset, PROT_READ, MAP_PRIVATE, spaBuffer->datas->fd, 0));
|
||||
|
||||
if (map == MAP_FAILED) {
|
||||
qCWarning(PIPEWIRE_LOGGING) << "Failed to mmap the memory: " << strerror(errno);
|
||||
return;
|
||||
}
|
||||
const QImage::Format format = spaBuffer->datas->chunk->stride / videoFormat.size.width == 3 ? QImage::Format_RGB888 : QImage::Format_ARGB32;
|
||||
|
||||
QImage img(map, videoFormat.size.width, videoFormat.size.height, spaBuffer->datas->chunk->stride, format);
|
||||
Q_EMIT imageTextureReceived(img.copy());
|
||||
|
||||
munmap(map, spaBuffer->datas->maxsize + spaBuffer->datas->mapoffset);
|
||||
} else if (spaBuffer->datas->type == SPA_DATA_DmaBuf) {
|
||||
QVector<DmaBufPlane> planes;
|
||||
planes.reserve(spaBuffer->n_datas);
|
||||
for (uint i = 0; i < spaBuffer->n_datas; ++i) {
|
||||
const auto &data = spaBuffer->datas[i];
|
||||
|
||||
DmaBufPlane plane;
|
||||
plane.fd = data.fd;
|
||||
plane.stride = data.chunk->stride;
|
||||
plane.offset = data.chunk->offset;
|
||||
plane.modifier = DRM_FORMAT_MOD_INVALID;
|
||||
planes += plane;
|
||||
}
|
||||
Q_EMIT dmabufTextureReceived(planes, DRM_FORMAT_ARGB8888);
|
||||
} else if (spaBuffer->datas->type == SPA_DATA_MemPtr) {
|
||||
QImage img(static_cast<uint8_t *>(spaBuffer->datas->data),
|
||||
videoFormat.size.width,
|
||||
videoFormat.size.height,
|
||||
spaBuffer->datas->chunk->stride,
|
||||
QImage::Format_ARGB32);
|
||||
Q_EMIT imageTextureReceived(img);
|
||||
} else {
|
||||
qWarning() << "unsupported buffer type" << spaBuffer->datas->type;
|
||||
QImage errorImage(200, 200, QImage::Format_ARGB32_Premultiplied);
|
||||
errorImage.fill(Qt::red);
|
||||
Q_EMIT imageTextureReceived(errorImage);
|
||||
}
|
||||
}
|
||||
|
||||
void PipeWireSourceStream::coreFailed(const QString &errorMessage)
|
||||
{
|
||||
m_error = errorMessage;
|
||||
Q_EMIT stopStreaming();
|
||||
}
|
||||
|
||||
void PipeWireSourceStream::process()
|
||||
{
|
||||
pw_buffer *buf = pw_stream_dequeue_buffer(pwStream);
|
||||
if (!buf) {
|
||||
return;
|
||||
}
|
||||
|
||||
handleFrame(buf);
|
||||
|
||||
pw_stream_queue_buffer(pwStream, buf);
|
||||
}
|
||||
|
||||
void PipeWireSourceStream::stop()
|
||||
{
|
||||
if (!m_stopped)
|
||||
pw_stream_set_active(pwStream, false);
|
||||
m_stopped = true;
|
||||
delete this;
|
||||
}
|
||||
|
||||
void PipeWireSourceStream::setActive(bool active)
|
||||
{
|
||||
Q_ASSERT(pwStream);
|
||||
pw_stream_set_active(pwStream, active);
|
||||
}
|
|
@ -0,0 +1,86 @@
|
|||
#ifndef PIPEWIRESOURCESTREAM_H
|
||||
#define PIPEWIRESOURCESTREAM_H
|
||||
|
||||
#include <QHash>
|
||||
#include <QObject>
|
||||
#include <QSharedPointer>
|
||||
#include <QSize>
|
||||
|
||||
#include <pipewire/pipewire.h>
|
||||
#include <spa/param/format-utils.h>
|
||||
#include <spa/param/props.h>
|
||||
#include <spa/param/video/format-utils.h>
|
||||
|
||||
#undef Status
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
class AbstractEglBackend;
|
||||
class GLTexture;
|
||||
}
|
||||
class PipeWireCore;
|
||||
|
||||
typedef void *EGLDisplay;
|
||||
|
||||
struct DmaBufPlane {
|
||||
int fd; /// The dmabuf file descriptor
|
||||
uint32_t offset; /// The offset from the start of buffer
|
||||
uint32_t stride; /// The distance from the start of a row to the next row in bytes
|
||||
uint64_t modifier = 0; /// The layout modifier
|
||||
};
|
||||
|
||||
class PipeWireSourceStream : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit PipeWireSourceStream(QObject *parent);
|
||||
~PipeWireSourceStream();
|
||||
|
||||
static void onStreamParamChanged(void *data, uint32_t id, const struct spa_pod *format);
|
||||
static void onStreamStateChanged(void *data, pw_stream_state old, pw_stream_state state, const char *error_message);
|
||||
|
||||
uint framerate();
|
||||
uint nodeId();
|
||||
QString error() const
|
||||
{
|
||||
return m_error;
|
||||
}
|
||||
|
||||
QSize size() const
|
||||
{
|
||||
return QSize(videoFormat.size.width, videoFormat.size.height);
|
||||
}
|
||||
bool createStream(uint nodeid);
|
||||
void stop();
|
||||
void setActive(bool active);
|
||||
|
||||
void handleFrame(struct pw_buffer *buffer);
|
||||
void process();
|
||||
|
||||
bool setAllowDmaBuf(bool allowed);
|
||||
|
||||
Q_SIGNALS:
|
||||
void streamReady();
|
||||
void startStreaming();
|
||||
void stopStreaming();
|
||||
void dmabufTextureReceived(const QVector<DmaBufPlane> &planes, uint32_t format);
|
||||
void imageTextureReceived(const QImage &image);
|
||||
|
||||
private:
|
||||
void coreFailed(const QString &errorMessage);
|
||||
|
||||
QSharedPointer<PipeWireCore> pwCore;
|
||||
pw_stream *pwStream = nullptr;
|
||||
spa_hook streamListener;
|
||||
pw_stream_events pwStreamEvents = {};
|
||||
|
||||
uint32_t pwNodeId = 0;
|
||||
|
||||
bool m_stopped = false;
|
||||
|
||||
spa_video_info_raw videoFormat;
|
||||
QString m_error;
|
||||
bool m_allowDmaBuf = true;
|
||||
};
|
||||
|
||||
#endif // PIPEWIRESOURCESTREAM_H
|
|
@ -0,0 +1,2 @@
|
|||
module org.ukui.panel.taskmanager
|
||||
plugin taskmanager
|
|
@ -0,0 +1,109 @@
|
|||
#include "screencasting.h"
|
||||
#include "qwayland-zkde-screencast-unstable-v1.h"
|
||||
#include <KWayland/Client/output.h>
|
||||
#include <KWayland/Client/plasmawindowmanagement.h>
|
||||
#include <KWayland/Client/registry.h>
|
||||
#include <QDebug>
|
||||
#include <QRect>
|
||||
|
||||
|
||||
using namespace KWayland::Client;
|
||||
|
||||
class ScreencastingStreamPrivate : public QtWayland::zkde_screencast_stream_unstable_v1
|
||||
{
|
||||
public:
|
||||
ScreencastingStreamPrivate(ScreencastingStream *q)
|
||||
: q(q)
|
||||
{
|
||||
}
|
||||
~ScreencastingStreamPrivate()
|
||||
{
|
||||
close();
|
||||
q->deleteLater();
|
||||
}
|
||||
|
||||
void zkde_screencast_stream_unstable_v1_created(uint32_t node) override
|
||||
{
|
||||
m_nodeId = node;
|
||||
Q_EMIT q->created(node);
|
||||
}
|
||||
|
||||
void zkde_screencast_stream_unstable_v1_closed() override
|
||||
{
|
||||
Q_EMIT q->closed();
|
||||
}
|
||||
|
||||
void zkde_screencast_stream_unstable_v1_failed(const QString &error) override
|
||||
{
|
||||
Q_EMIT q->failed(error);
|
||||
}
|
||||
|
||||
uint m_nodeId = 0;
|
||||
QPointer<ScreencastingStream> q;
|
||||
};
|
||||
|
||||
ScreencastingStream::ScreencastingStream(QObject *parent)
|
||||
: QObject(parent)
|
||||
, d(new ScreencastingStreamPrivate(this))
|
||||
{
|
||||
}
|
||||
|
||||
ScreencastingStream::~ScreencastingStream() = default;
|
||||
|
||||
quint32 ScreencastingStream::nodeId() const
|
||||
{
|
||||
return d->m_nodeId;
|
||||
}
|
||||
|
||||
class ScreencastingPrivate : public QtWayland::zkde_screencast_unstable_v1
|
||||
{
|
||||
public:
|
||||
ScreencastingPrivate(Registry *registry, int id, int version, Screencasting *q)
|
||||
: QtWayland::zkde_screencast_unstable_v1(*registry, id, version)
|
||||
, q(q)
|
||||
{
|
||||
}
|
||||
|
||||
ScreencastingPrivate(::zkde_screencast_unstable_v1 *screencasting, Screencasting *q)
|
||||
: QtWayland::zkde_screencast_unstable_v1(screencasting)
|
||||
, q(q)
|
||||
{
|
||||
}
|
||||
|
||||
~ScreencastingPrivate()
|
||||
{
|
||||
destroy();
|
||||
}
|
||||
|
||||
Screencasting *const q;
|
||||
};
|
||||
|
||||
Screencasting::Screencasting(QObject *parent)
|
||||
:QObject(parent)
|
||||
{
|
||||
}
|
||||
|
||||
Screencasting::Screencasting(Registry *registry, int id, int version, QObject *parent)
|
||||
: QObject(parent)
|
||||
, d(new ScreencastingPrivate(registry, id, version, this))
|
||||
{
|
||||
}
|
||||
|
||||
Screencasting::~Screencasting() = default;
|
||||
|
||||
ScreencastingStream *Screencasting::createWindowStream(const QString &uuid, CursorMode mode)
|
||||
{
|
||||
auto stream = new ScreencastingStream(this);
|
||||
stream->d->init(d->stream_window(uuid, mode));
|
||||
return stream;
|
||||
}
|
||||
|
||||
void Screencasting::setup(::zkde_screencast_unstable_v1 *screencasting)
|
||||
{
|
||||
d.reset(new ScreencastingPrivate(screencasting, this));
|
||||
}
|
||||
|
||||
void Screencasting::destroy()
|
||||
{
|
||||
d.reset(nullptr);
|
||||
}
|
|
@ -0,0 +1,67 @@
|
|||
#ifndef SCREENCASTING_H
|
||||
#define SCREENCASTING_H
|
||||
#include <QObject>
|
||||
#include <QSharedPointer>
|
||||
#include <QVector>
|
||||
#include <optional>
|
||||
|
||||
struct zkde_screencast_unstable_v1;
|
||||
|
||||
namespace KWayland
|
||||
{
|
||||
namespace Client
|
||||
{
|
||||
class PlasmaWindow;
|
||||
class Registry;
|
||||
class Output;
|
||||
}
|
||||
}
|
||||
|
||||
class ScreencastingPrivate;
|
||||
class ScreencastingStreamPrivate;
|
||||
class ScreencastingStream : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ScreencastingStream(QObject *parent);
|
||||
~ScreencastingStream() override;
|
||||
|
||||
quint32 nodeId() const;
|
||||
|
||||
Q_SIGNALS:
|
||||
void created(quint32 nodeid);
|
||||
void failed(const QString &error);
|
||||
void closed();
|
||||
|
||||
private:
|
||||
friend class Screencasting;
|
||||
QScopedPointer<ScreencastingStreamPrivate> d;
|
||||
};
|
||||
|
||||
class Screencasting : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit Screencasting(QObject *parent = nullptr);
|
||||
explicit Screencasting(KWayland::Client::Registry *registry, int id, int version, QObject *parent = nullptr);
|
||||
~Screencasting() override;
|
||||
|
||||
enum CursorMode {
|
||||
Hidden = 1,
|
||||
Embedded = 2,
|
||||
Metadata = 4,
|
||||
};
|
||||
Q_ENUM(CursorMode);
|
||||
|
||||
|
||||
ScreencastingStream *createWindowStream(const QString &uuid, CursorMode mode);
|
||||
|
||||
void setup(zkde_screencast_unstable_v1 *screencasting);
|
||||
void destroy();
|
||||
|
||||
private:
|
||||
QScopedPointer<ScreencastingPrivate> d;
|
||||
|
||||
};
|
||||
|
||||
#endif // SCREENCASTING_H
|
|
@ -0,0 +1,128 @@
|
|||
#include "screencastingrequest.h"
|
||||
#include <KWayland/Client/connection_thread.h>
|
||||
#include <KWayland/Client/registry.h>
|
||||
#include <QCoreApplication>
|
||||
#include <QDebug>
|
||||
#include <QPointer>
|
||||
#include <functional>
|
||||
|
||||
class ScreencastingSingleton : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ScreencastingSingleton(QObject *parent)
|
||||
: QObject(parent)
|
||||
{
|
||||
KWayland::Client::ConnectionThread *connection = KWayland::Client::ConnectionThread::fromApplication(this);
|
||||
if (!connection) {
|
||||
return;
|
||||
}
|
||||
|
||||
KWayland::Client::Registry *registry = new KWayland::Client::Registry(this);
|
||||
|
||||
connect(registry,
|
||||
&KWayland::Client::Registry::interfaceAnnounced,
|
||||
this,
|
||||
[this, registry](const QByteArray &interfaceName, quint32 name, quint32 version) {
|
||||
if (interfaceName != "zkde_screencast_unstable_v1")
|
||||
return;
|
||||
|
||||
m_screencasting = new Screencasting(registry, name, version, this);
|
||||
Q_EMIT created(m_screencasting);
|
||||
});
|
||||
|
||||
registry->create(connection);
|
||||
registry->setup();
|
||||
}
|
||||
|
||||
static ScreencastingSingleton *self()
|
||||
{
|
||||
static QPointer<ScreencastingSingleton> s_self;
|
||||
if (!s_self && QCoreApplication::instance())
|
||||
s_self = new ScreencastingSingleton(QCoreApplication::instance());
|
||||
return s_self;
|
||||
}
|
||||
|
||||
void requestInterface(ScreencastingRequest *item)
|
||||
{
|
||||
if (!m_screencasting) {
|
||||
connect(this, &ScreencastingSingleton::created, item, &ScreencastingRequest::create, Qt::UniqueConnection);
|
||||
} else {
|
||||
item->create(m_screencasting);
|
||||
}
|
||||
}
|
||||
|
||||
Q_SIGNALS:
|
||||
void created(Screencasting *screencasting);
|
||||
|
||||
private:
|
||||
Screencasting *m_screencasting = nullptr;
|
||||
};
|
||||
|
||||
|
||||
ScreencastingRequest::ScreencastingRequest(QObject *parent)
|
||||
:QObject(parent)
|
||||
{
|
||||
}
|
||||
|
||||
ScreencastingRequest::~ScreencastingRequest() = default;
|
||||
|
||||
quint32 ScreencastingRequest::nodeId() const
|
||||
{
|
||||
return m_nodeId;
|
||||
}
|
||||
|
||||
void ScreencastingRequest::setNodeid(uint nodeId)
|
||||
{
|
||||
if (nodeId == m_nodeId) {
|
||||
return;
|
||||
}
|
||||
|
||||
m_nodeId = nodeId;
|
||||
Q_EMIT nodeIdChanged(nodeId);
|
||||
}
|
||||
|
||||
QString ScreencastingRequest::uuid() const
|
||||
{
|
||||
return m_uuid;
|
||||
}
|
||||
|
||||
void ScreencastingRequest::setUuid(const QString &uuid)
|
||||
{
|
||||
if (m_uuid == uuid) {
|
||||
return;
|
||||
}
|
||||
|
||||
Q_EMIT closeRunningStreams();
|
||||
setNodeid(0);
|
||||
|
||||
m_uuid = uuid;
|
||||
if (!m_uuid.isEmpty()) {
|
||||
ScreencastingSingleton::self()->requestInterface(this);
|
||||
}
|
||||
|
||||
Q_EMIT uuidChanged(uuid);
|
||||
}
|
||||
|
||||
void ScreencastingRequest::create(Screencasting *screencasting)
|
||||
{
|
||||
auto stream = screencasting->createWindowStream(m_uuid, Screencasting::CursorMode::Hidden);
|
||||
stream->setObjectName(m_uuid);
|
||||
|
||||
connect(stream, &ScreencastingStream::created, this, [stream, this](int nodeId) {
|
||||
if (stream->objectName() == m_uuid) {
|
||||
setNodeid(nodeId);
|
||||
}
|
||||
});
|
||||
connect(stream, &ScreencastingStream::failed, this, [](const QString &error) {
|
||||
qWarning() << "error creating screencast" << error;
|
||||
});
|
||||
connect(stream, &ScreencastingStream::closed, this, [this, stream] {
|
||||
if (stream->nodeId() == m_nodeId) {
|
||||
setNodeid(0);
|
||||
}
|
||||
});
|
||||
connect(this, &ScreencastingRequest::closeRunningStreams, stream, &QObject::deleteLater);
|
||||
}
|
||||
|
||||
#include "screencastingrequest.moc"
|
|
@ -0,0 +1,39 @@
|
|||
#ifndef SCREENCASTINGREQUEST_H
|
||||
#define SCREENCASTINGREQUEST_H
|
||||
|
||||
#include "screencasting.h"
|
||||
#include <QObject>
|
||||
|
||||
class ScreencastingStream;
|
||||
|
||||
class ScreencastingRequest : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(QString uuid READ uuid WRITE setUuid NOTIFY uuidChanged)
|
||||
Q_PROPERTY(quint32 nodeId READ nodeId NOTIFY nodeIdChanged)
|
||||
|
||||
public:
|
||||
ScreencastingRequest(QObject *parent = nullptr);
|
||||
~ScreencastingRequest();
|
||||
|
||||
void setUuid(const QString &uuid);
|
||||
QString uuid() const;
|
||||
quint32 nodeId() const;
|
||||
|
||||
void create(Screencasting *screencasting);
|
||||
Q_SIGNALS:
|
||||
void nodeIdChanged(quint32 nodeId);
|
||||
void uuidChanged(const QString &uuid);
|
||||
void closeRunningStreams();
|
||||
void cursorModeChanged(Screencasting::CursorMode cursorMode);
|
||||
|
||||
private:
|
||||
void setNodeid(uint nodeId);
|
||||
|
||||
ScreencastingStream *m_stream = nullptr;
|
||||
QString m_uuid;
|
||||
KWayland::Client::Output *m_output = nullptr;
|
||||
quint32 m_nodeId = 0;
|
||||
};
|
||||
|
||||
#endif // SCREENCASTINGREQUEST_H
|
|
@ -0,0 +1,18 @@
|
|||
#include "taskmanagerplugin.h"
|
||||
#include "pipewiresourceitem.h"
|
||||
#include "screencasting.h"
|
||||
#include "screencastingrequest.h"
|
||||
|
||||
|
||||
namespace TaskManager
|
||||
{
|
||||
void TaskManagerPlugin::registerTypes(const char *uri)
|
||||
{
|
||||
Q_ASSERT(QLatin1String(uri) == QLatin1String("org.ukui.panel.taskmanager"));
|
||||
|
||||
qmlRegisterType<PipeWireSourceItem>(uri, 0, 1, "PipeWireSourceItem");
|
||||
qmlRegisterType<ScreencastingRequest>(uri, 0, 1, "ScreencastingRequest");
|
||||
qmlRegisterUncreatableType<Screencasting>(uri, 0, 1, "Screencasting", "Use ScreencastingItem");
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
#ifndef TASKMANAGERPLUGIN_H
|
||||
#define TASKMANAGERPLUGIN_H
|
||||
|
||||
#include <QQmlEngine>
|
||||
#include <QQmlExtensionPlugin>
|
||||
|
||||
namespace TaskManager
|
||||
{
|
||||
class TaskManagerPlugin : public QQmlExtensionPlugin
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
|
||||
|
||||
public:
|
||||
void registerTypes(const char *uri) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // TASKMANAGERPLUGIN_H
|
|
@ -0,0 +1,17 @@
|
|||
.TH ukui "1" "2020-01-01" "UKUI 0.10.0" "UKUI Desktop Environment"
|
||||
.SH NAME
|
||||
ukui-flash-disk \- The Tray Application for the UKUI Desktop Environment
|
||||
.SH SYNOPSIS
|
||||
.B ukui-flash-disk
|
||||
.br
|
||||
.SH DESCRIPTION
|
||||
This is tray application for ukui-panel
|
||||
.SH BEHAVIOR
|
||||
Ukui-flash-disk tray application can detect whether there is external storage medium mounted
|
||||
Click to open the content of the storage medium
|
||||
.P
|
||||
Ukui-flash-disk can according to the detected signal to determine whether to display in the tray bar
|
||||
.SH "REPORTING BUGS"
|
||||
Report bugs to https://github.com/ukui/ukui-panel/issues
|
||||
.SH "SEE ALSO"
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
.TH ukui "1" "2019-08-01" "UKUI 0.10.0" "UKUI Desktop Panel Module"
|
||||
.SH NAME
|
||||
ukui-panel \- The Panel for the UKUI Desktop Environment
|
||||
.SH SYNOPSIS
|
||||
.B ukui-panel
|
||||
.br
|
||||
.SH DESCRIPTION
|
||||
This module adds a panel, with optional plugins, to the desktop.
|
||||
.SH BEHAVIOR
|
||||
The panel can be run independently of \fBUKUI\fR, autostarted at logon, and have
|
||||
multiple instances. A horizontal bottom panel shows by default on the desktop,
|
||||
but the size, autohide, and other attributes
|
||||
.P
|
||||
The panel is comprised of plugins which provide a visual widget; like the startmenu,
|
||||
taskbar, or quicklaunch. They can be added or removed in the panel Widget settings.
|
||||
.P
|
||||
Several plugins are loaded by default; the desktop menu and windows workspaces
|
||||
are also managed here.
|
||||
.SH CONFIGURATIONS
|
||||
Right-click over any plugin to reach the panel Configure settings option, or
|
||||
that of each respective plugin.
|
||||
.SH "REPORTING BUGS"
|
||||
Report bugs to https://github.com/ukui/ukui-panel/issues
|
||||
.SH "SEE ALSO"
|
||||
.SS
|
||||
Ukui Panel documentation can be found under "Help" by right-clicking on \fBukui-panel\fR.
|
||||
Further information may also be available at: http://wiki.ukui-desktop.org/docs
|
||||
.P
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
cmake_minimum_required(VERSION 3.1.0)
|
||||
|
||||
project(panel-daemon)
|
||||
|
||||
#判断编译器类型,如果是gcc编译器,则在编译选项中加入c++11支持
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
|
||||
message(STATUS "optional:-std=c++11")
|
||||
endif(CMAKE_COMPILER_IS_GNUCXX)
|
||||
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
|
||||
if(CMAKE_VERSION VERSION_LESS "3.7.0")
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
endif()
|
||||
|
||||
find_package(Qt5 COMPONENTS Widgets Network REQUIRED)
|
||||
find_package(Qt5DBus REQUIRED)
|
||||
find_package(PkgConfig REQUIRED)
|
||||
find_package(KF5WindowSystem REQUIRED)
|
||||
|
||||
pkg_check_modules(GLIB2 REQUIRED glib-2.0 gio-2.0)
|
||||
pkg_check_modules(QGS REQUIRED gsettings-qt)
|
||||
|
||||
include_directories(${GLIB2_INCLUDE_DIRS})
|
||||
include_directories(${QGS_INCLUDE_DIRS})
|
||||
|
||||
add_executable(panel-daemon
|
||||
jsonwathcer/jsonwacther.cpp
|
||||
jsonwathcer/jsonwacther.h
|
||||
filewatcher/filewatcher.cpp
|
||||
filewatcher/filewatcher.h
|
||||
convert-desktop-windowid/convertdesktoptowinid.cpp
|
||||
convert-desktop-windowid/convertdesktoptowinid.h
|
||||
pin-totaskbar/pintotaskbar.cpp
|
||||
pin-totaskbar/pintotaskbar.h
|
||||
pin-totaskbar/taskbar-dbus-adaptor.cpp
|
||||
pin-totaskbar/taskbar-dbus-adaptor.h
|
||||
dbus-server/server.cpp
|
||||
dbus-server/server.h
|
||||
dbus-server/dbus-adaptor.cpp
|
||||
dbus-server/dbus-adaptor.h
|
||||
datewather/datewatcher.cpp
|
||||
datewather/datewatcher.h
|
||||
watchermanager.cpp
|
||||
watchermanager.h
|
||||
main.cpp
|
||||
)
|
||||
|
||||
|
||||
add_definitions(-DQT_MESSAGELOGCONTEXT)
|
||||
|
||||
pkg_check_modules(KYSDKWAYLANDHELPER_PKG kysdk-waylandhelper)
|
||||
target_include_directories(${PROJECT_NAME} PRIVATE ${KYSDKWAYLANDHELPER_PKG_INCLUDE_DIRS})
|
||||
target_link_directories(${PROJECT_NAME} PRIVATE ${KYSDKWAYLANDHELPER_PKG_LIBRARY_DIRS} KF5::WindowSystem)
|
||||
target_link_libraries(${PROJECT_NAME} ${KYSDKWAYLANDHELPER_PKG_LIBRARIES})
|
||||
|
||||
target_link_libraries(${PROJECT_NAME}
|
||||
Qt5::Widgets
|
||||
Qt5::DBus
|
||||
Qt5::Network
|
||||
${GLIB2_LIBRARIES}
|
||||
${QGS_LIBRARIES}
|
||||
KF5::WindowSystem
|
||||
)
|
||||
|
||||
|
||||
install(TARGETS panel-daemon DESTINATION bin)
|
||||
|
||||
install(FILES
|
||||
resources/ukui-panel-daemon.desktop
|
||||
DESTINATION "/etc/xdg/autostart/"
|
||||
COMPONENT Runtime
|
||||
)
|
|
@ -0,0 +1,345 @@
|
|||
/*
|
||||
* Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2.1, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#include "convertdesktoptowinid.h"
|
||||
#include <KWindowSystem>
|
||||
#include <QFile>
|
||||
#include <QDebug>
|
||||
#include <QDir>
|
||||
#include "kysdk/applications/windowmanager/windowmanager.h"
|
||||
|
||||
ConvertDesktopToWinId::ConvertDesktopToWinId()
|
||||
{
|
||||
//connect(KWindowSystem::self(), &KWindowSystem::windowAdded, this, &ConvertDesktopToWinId::tranIdToDesktop);
|
||||
}
|
||||
|
||||
QString ConvertDesktopToWinId::tranIdToDesktop(int winId)
|
||||
{
|
||||
QString desktopName = confirmDesktopFile(winId);
|
||||
qDebug() << "desktopName is :" << desktopName;
|
||||
return desktopName;
|
||||
}
|
||||
|
||||
int ConvertDesktopToWinId::getPidFromInfo(int winId)
|
||||
{
|
||||
//x环境下输入wid转成pid, wayland下windowId转pid
|
||||
KWindowInfo info(winId, NET::WMPid);
|
||||
if (info.valid(/* withdrawn_is_valid = */ true)) {
|
||||
m_pid = info.pid();
|
||||
} else {
|
||||
m_pid = kdk::WindowManager::getPid(winId);
|
||||
}
|
||||
return m_pid;
|
||||
}
|
||||
|
||||
QString ConvertDesktopToWinId::confirmDesktopFile(int id)
|
||||
{
|
||||
m_pid = getPidFromInfo(id);
|
||||
if (m_pid == 0) {
|
||||
return {};
|
||||
}
|
||||
|
||||
m_desktopfilePath = "";
|
||||
QDir infoDir(DEKSTOP_FILE_PATH);
|
||||
m_list = infoDir.entryInfoList();
|
||||
//跳过 ./ 和 ../ 目录
|
||||
m_list.removeAll(QFile(USR_SHARE_APP_CURRENT));
|
||||
m_list.removeAll(QFile(USR_SHARE_APP_UPER));
|
||||
|
||||
//加入自启动目录下的desktop文件,优先使用/usr/share/applications/下的desktop
|
||||
QDir dir(AUTOSTART_DEKSTOP_FILE_PATH);
|
||||
QFileInfoList autostartList = dir.entryInfoList();
|
||||
m_list.append(autostartList);
|
||||
|
||||
|
||||
//第一种方法:比较名字一致性
|
||||
if (m_desktopfilePath.isEmpty()) {
|
||||
// getWindowGroup 这个方法的实现有异常,如果单例没有初始化会直接返回空,加上 self 保证初始化。
|
||||
m_className = kdk::WindowManager::self()->getWindowGroup(id);
|
||||
|
||||
//匹配安卓兼容
|
||||
if (m_className == "kylin-kmre-window") {
|
||||
searchAndroidApp(id);
|
||||
return m_desktopfilePath;
|
||||
}
|
||||
|
||||
//匹配Inter端腾讯教育
|
||||
if (m_className == "txeduplatform") {
|
||||
searchTXeduApp(id);
|
||||
return m_desktopfilePath;
|
||||
}
|
||||
|
||||
QFile file(QString("/proc/%1/status").arg(m_pid));
|
||||
if (file.open(QIODevice::ReadOnly)) {
|
||||
char buf[1024];
|
||||
qint64 len=file.readLine(buf,sizeof(buf));
|
||||
if (len!=-1) {
|
||||
m_statusName = QString::fromLocal8Bit(buf).remove("Name:").remove("\t").remove("\n");
|
||||
}
|
||||
}
|
||||
compareClassName();
|
||||
}
|
||||
//第二种方法:获取点击应用时大部分desktop文件名
|
||||
if (m_desktopfilePath.isEmpty()) {
|
||||
searchFromEnviron(id);
|
||||
}
|
||||
|
||||
//第三种方法:比较cmd命令行操作一致性
|
||||
if (m_desktopfilePath.isEmpty()) {
|
||||
QFile file(QString("/proc/%1/cmdline").arg(m_pid));
|
||||
if (file.open(QIODevice::ReadOnly)) {
|
||||
char buf[1024];
|
||||
qint64 len=file.readLine(buf,sizeof(buf));
|
||||
if (len!=-1) {
|
||||
m_cmdLine = QString::fromLocal8Bit(buf).remove("\n");
|
||||
}
|
||||
}
|
||||
compareCmdExec();
|
||||
}
|
||||
|
||||
//第四种方法:匹配部分字段
|
||||
if (m_desktopfilePath.isEmpty()) {
|
||||
compareLastStrategy();
|
||||
}
|
||||
return m_desktopfilePath;
|
||||
}
|
||||
|
||||
void ConvertDesktopToWinId::searchAndroidApp(int id)
|
||||
{
|
||||
QDir androidDir(QString(QDir::homePath() + ANDROID_FILE_PATH));
|
||||
m_androidList = androidDir.entryInfoList();
|
||||
m_androidList.removeAll(QDir::homePath() + ANDROID_APP_CURRENT);
|
||||
m_androidList.removeAll(QDir::homePath() + ANDROID_APP_UPER);
|
||||
|
||||
QFile file(QString("/proc/%1/cmdline").arg(m_pid));
|
||||
file.open(QIODevice::ReadOnly);
|
||||
QByteArray cmd = file.readAll();
|
||||
file.close();
|
||||
QList<QByteArray> cmdList = cmd.split('\0');
|
||||
for(int i = 0; i < m_androidList.size(); i++){
|
||||
QFileInfo fileInfo = m_androidList.at(i);
|
||||
QString desktopName = fileInfo.filePath();
|
||||
if(!fileInfo.filePath().endsWith(".desktop")){
|
||||
continue;
|
||||
}
|
||||
desktopName = desktopName.mid(desktopName.lastIndexOf("/") + 1);
|
||||
desktopName = desktopName.left(desktopName.lastIndexOf("."));
|
||||
if(desktopName == cmdList.at(10)){
|
||||
m_desktopfilePath = fileInfo.filePath();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ConvertDesktopToWinId::searchTXeduApp(WId id)
|
||||
{
|
||||
KWindowInfo info(id, NET::WMAllProperties);
|
||||
QString name = info.name();
|
||||
for (int i = 0; i < m_list.size(); i++) {
|
||||
QString cmd;
|
||||
QFileInfo fileInfo = m_list.at(i);
|
||||
if (!fileInfo.filePath().endsWith(".desktop")) {
|
||||
continue;
|
||||
}
|
||||
cmd.sprintf(GET_DESKTOP_NAME_MAIN, fileInfo.filePath().toStdString().data());
|
||||
QString desktopName = getDesktopFileName(cmd).remove("\n");
|
||||
|
||||
if (desktopName == name) {
|
||||
m_desktopfilePath = fileInfo.filePath();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ConvertDesktopToWinId::searchFromEnviron(int id)
|
||||
{
|
||||
QFile file("/proc/" + QString::number(m_pid) + "/environ");
|
||||
file.open(QIODevice::ReadOnly);
|
||||
QByteArray BA = file.readAll();
|
||||
file.close();
|
||||
QList<QByteArray> list_BA = BA.split('\0');
|
||||
for (int i = 0; i < list_BA.length(); i++) {
|
||||
if (list_BA.at(i).startsWith("GIO_LAUNCHED_DESKTOP_FILE=")) {
|
||||
m_desktopfilePath = list_BA.at(i);
|
||||
m_desktopfilePath = m_desktopfilePath.mid(m_desktopfilePath.indexOf("=") + 1);
|
||||
//desktop文件地址需要重写
|
||||
m_desktopfilePath = m_desktopfilePath.mid(m_desktopfilePath.lastIndexOf("/") + 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
//desktop文件地址重写
|
||||
if (!m_desktopfilePath.isEmpty()) {
|
||||
for (int i = 0; i < m_list.size(); i++) {
|
||||
QFileInfo fileInfo = m_list.at(i);;
|
||||
if (fileInfo.filePath() == DEKSTOP_FILE_PATH + m_desktopfilePath) {
|
||||
m_desktopfilePath = fileInfo.filePath();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void ConvertDesktopToWinId::compareClassName()
|
||||
{
|
||||
for (int i = 0; i < m_list.size(); i++) {
|
||||
QFileInfo fileInfo = m_list.at(i);;
|
||||
QString path_desktop_name = fileInfo.filePath();
|
||||
if (!fileInfo.filePath().endsWith(".desktop")) {
|
||||
continue;
|
||||
}
|
||||
path_desktop_name = path_desktop_name.mid(path_desktop_name.lastIndexOf("/") + 1);
|
||||
path_desktop_name = path_desktop_name.left(path_desktop_name.lastIndexOf("."));
|
||||
|
||||
// Chrome 浏览器的 ClassName 是 Google-chrome,destkop 名是 google-crhome,忽略大小写以适配这种情况。
|
||||
if (QString::compare(path_desktop_name, m_className, Qt::CaseInsensitive) == 0
|
||||
|| QString::compare(path_desktop_name, m_statusName, Qt::CaseInsensitive) == 0) {
|
||||
m_desktopfilePath = fileInfo.filePath();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ConvertDesktopToWinId::compareCmdExec()
|
||||
{
|
||||
for (int i = 0; i < m_list.size(); i++) {
|
||||
QString cmd;
|
||||
QFileInfo fileInfo = m_list.at(i);
|
||||
if (!fileInfo.filePath().endsWith(".desktop")) {
|
||||
continue;
|
||||
}
|
||||
cmd.sprintf(GET_DESKTOP_EXEC_NAME_MAIN, fileInfo.filePath().toStdString().data());
|
||||
QString desktopFileExeName = getDesktopFileName(cmd).remove("\n");
|
||||
|
||||
if (desktopFileExeName.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (desktopFileExeName == m_cmdLine || desktopFileExeName.startsWith(m_cmdLine) || m_cmdLine.startsWith(desktopFileExeName)) {
|
||||
m_desktopfilePath = fileInfo.filePath();
|
||||
break;
|
||||
}
|
||||
|
||||
//仅仅是为了适配微信
|
||||
if (m_desktopfilePath.isEmpty()) {
|
||||
desktopFileExeName = "/usr/lib/" + desktopFileExeName;
|
||||
if (desktopFileExeName == m_cmdLine || desktopFileExeName.startsWith(m_cmdLine) || m_cmdLine.startsWith(desktopFileExeName)) {
|
||||
m_desktopfilePath = fileInfo.filePath();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//最后的匹配策略汇总
|
||||
void ConvertDesktopToWinId::compareLastStrategy()
|
||||
{
|
||||
compareCmdName();
|
||||
|
||||
if (m_desktopfilePath.isEmpty()) {
|
||||
compareDesktopClass();
|
||||
}
|
||||
|
||||
if (m_desktopfilePath.isEmpty()) {
|
||||
containsName();
|
||||
}
|
||||
}
|
||||
|
||||
void ConvertDesktopToWinId::compareCmdName()
|
||||
{
|
||||
for (int i = 0; i < m_list.size(); i++) {
|
||||
QString cmd;
|
||||
QFileInfo fileInfo = m_list.at(i);
|
||||
if (!fileInfo.filePath().endsWith(".desktop")) {
|
||||
continue;
|
||||
}
|
||||
cmd.sprintf(GET_DESKTOP_EXEC_NAME_MAIN, fileInfo.filePath().toStdString().data());
|
||||
QString desktopFileExeName = getDesktopFileName(cmd).remove("\n");
|
||||
|
||||
if (desktopFileExeName.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (desktopFileExeName.startsWith(m_className) || desktopFileExeName.endsWith(m_className)) {
|
||||
m_desktopfilePath = fileInfo.filePath();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ConvertDesktopToWinId::compareDesktopClass()
|
||||
{
|
||||
for (int i = 0; i < m_list.size(); i++) {
|
||||
QFileInfo fileInfo = m_list.at(i);
|
||||
QString path_desktop_name = fileInfo.filePath();
|
||||
if (!fileInfo.filePath().endsWith(".desktop")) {
|
||||
continue;
|
||||
}
|
||||
path_desktop_name = path_desktop_name.mid(path_desktop_name.lastIndexOf("/") + 1);
|
||||
path_desktop_name = path_desktop_name.left(path_desktop_name.lastIndexOf("."));
|
||||
|
||||
if (path_desktop_name.startsWith(m_className) || path_desktop_name.endsWith(m_className)) {
|
||||
m_desktopfilePath = fileInfo.filePath();
|
||||
break;
|
||||
}
|
||||
else if (m_className.startsWith(path_desktop_name) || m_className.endsWith(path_desktop_name)) {
|
||||
m_desktopfilePath = fileInfo.filePath();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ConvertDesktopToWinId::containsName()
|
||||
{
|
||||
for (int i = 0; i < m_list.size(); i++) {
|
||||
QString cmd;
|
||||
QFileInfo fileInfo = m_list.at(i);
|
||||
QString path_desktop_name = fileInfo.filePath();
|
||||
|
||||
if (!fileInfo.filePath().endsWith(".desktop")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
cmd.sprintf(GET_DESKTOP_EXEC_NAME_MAIN, fileInfo.filePath().toStdString().data());
|
||||
QString desktopFileExeName = getDesktopFileName(cmd).remove("\n");
|
||||
|
||||
path_desktop_name = path_desktop_name.mid(path_desktop_name.lastIndexOf("/") + 1);
|
||||
path_desktop_name = path_desktop_name.left(path_desktop_name.lastIndexOf("."));
|
||||
|
||||
if (path_desktop_name.contains(m_className) || desktopFileExeName.contains(m_className)) {
|
||||
m_desktopfilePath = fileInfo.filePath();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//执行头文件中宏定义写好的终端指令获取对应的Exec字段
|
||||
QString ConvertDesktopToWinId::getDesktopFileName(QString cmd)
|
||||
{
|
||||
char name[200];
|
||||
FILE *fp1 = NULL;
|
||||
if ((fp1 = popen(cmd.toStdString().data(), "r")) == NULL)
|
||||
return QString();
|
||||
memset(name, 0, sizeof(name));
|
||||
fgets(name, sizeof(name), fp1);
|
||||
pclose(fp1);
|
||||
return QString(name);
|
||||
}
|
||||
|
||||
|
||||
ConvertDesktopToWinId::~ConvertDesktopToWinId()
|
||||
{
|
||||
}
|
|
@ -0,0 +1,87 @@
|
|||
/*
|
||||
* Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2.1, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CONVERTDESKTOPTOWINID_H
|
||||
#define CONVERTDESKTOPTOWINID_H
|
||||
|
||||
#include <QObject>
|
||||
#include <KWindowSystem>
|
||||
#include <QDir>
|
||||
|
||||
#define AUTOSTART_DEKSTOP_FILE_PATH "/etc/xdg/autostart/"
|
||||
#define DEKSTOP_FILE_PATH "/usr/share/applications/"
|
||||
#define USR_SHARE_APP_CURRENT "/usr/share/applications/."
|
||||
#define USR_SHARE_APP_UPER "/usr/share/applications/.."
|
||||
#define PEONY_TRASH "/usr/share/applications/peony-trash.desktop"
|
||||
#define PEONY_COMUTER "/usr/share/applications/peony-computer.desktop"
|
||||
#define PEONY_HOME "/usr/share/applications/peony-home.desktop"
|
||||
#define PEONY_MAIN "/usr/share/applications/peony.desktop"
|
||||
|
||||
#define GET_DESKTOP_EXEC_NAME_MAIN "cat %s | awk '{if($1~\"Exec=\")if($2~\"\%\"){print $1} else print}' | cut -d '=' -f 2"
|
||||
#define GET_DESKTOP_NAME_MAIN "cat %s | awk '{if($1~\"Name=\")if($2~\"\%\"){print $1} else print}' | cut -d '=' -f 2"
|
||||
#define ANDROID_FILE_PATH "/.local/share/applications/"
|
||||
#define ANDROID_APP_CURRENT "/.local/share/applications/."
|
||||
#define ANDROID_APP_UPER "/.local/share/applications/.."
|
||||
|
||||
|
||||
/**
|
||||
* @brief The ConvertDesktopToWinId class
|
||||
* 需要实现的功能,desktop文件与windowId的转换
|
||||
* 需要暴露的dbus接口:
|
||||
* 传入desktop文件的路径,转化为(int)WindowId
|
||||
* 传入WindowId 转化为desktop文件路径
|
||||
*/
|
||||
|
||||
class ConvertDesktopToWinId: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ConvertDesktopToWinId();
|
||||
~ConvertDesktopToWinId();
|
||||
//QList<int> InfoPidList;
|
||||
QString m_desktopfilePath = nullptr;
|
||||
QString m_className = nullptr;
|
||||
QString m_statusName = nullptr;
|
||||
QString m_cmdLine = nullptr;
|
||||
|
||||
QDir *m_dir = nullptr;
|
||||
QDir *m_androidDir = nullptr;
|
||||
QFileInfoList m_list;
|
||||
QFileInfoList m_androidList;
|
||||
|
||||
QString tranIdToDesktop(int winId);
|
||||
int getPidFromInfo(int winId);
|
||||
|
||||
private:
|
||||
QString confirmDesktopFile(int id);
|
||||
void searchFromEnviron(int id);
|
||||
void searchAndroidApp(int id);
|
||||
void searchTXeduApp(WId id);
|
||||
void compareClassName();
|
||||
void compareCmdExec();
|
||||
void compareLastStrategy();
|
||||
void compareCmdName();
|
||||
void compareDesktopClass();
|
||||
void containsName();
|
||||
QString getDesktopFileName(QString cmd);
|
||||
|
||||
int m_pid;
|
||||
};
|
||||
|
||||
#endif // CONVERTDESKTOPTOWINID_H
|
|
@ -0,0 +1,23 @@
|
|||
/*
|
||||
* Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2.1, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#include "datewatcher.h"
|
||||
|
||||
DateWatcher::DateWatcher(QObject *parent) : QObject(parent)
|
||||
{
|
||||
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue