forked from openkylin/ukui-panel
Compare commits
No commits in common. "upstream" and "packaging/openkylin/yangtze" have entirely different histories.
upstream
...
packaging/
|
@ -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);
|
|
@ -1,29 +0,0 @@
|
|||
# Ignore the following files
|
||||
.vscode
|
||||
*~
|
||||
*.[oa]
|
||||
*.diff
|
||||
*.kate-swp
|
||||
*.kdev4
|
||||
.kdev_include_paths
|
||||
*.kdevelop.pcs
|
||||
*.moc
|
||||
*.moc.cpp
|
||||
*.orig
|
||||
*.user
|
||||
.*.swp
|
||||
.swp.*
|
||||
Doxyfile
|
||||
Makefile
|
||||
avail
|
||||
random_seed
|
||||
/build*/
|
||||
CMakeLists.txt.user*
|
||||
*.unc-backup*
|
||||
.clang-format
|
||||
/compile_commands.json
|
||||
.clangd
|
||||
.idea
|
||||
/cmake-build*
|
||||
.cache
|
||||
|
|
@ -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.
|
190
CMakeLists.txt
190
CMakeLists.txt
|
@ -1,6 +1,190 @@
|
|||
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)
|
||||
|
||||
#判断编译器类型,如果是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)
|
||||
|
||||
# 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(REQUIRED_QT_VERSION "5.6.1")
|
||||
set(KF5_MINIMUM_VERSION "5.18.0")
|
||||
set(QT_MINIMUM_VERSION "5.6.1")
|
||||
set(UKUI_MINIMUM_VERSION "0.14.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 QuickWidgets DBus X11Extras LinguistTools Xml)
|
||||
find_package(Qt5Xdg ${QTXDG_MINIMUM_VERSION} REQUIRED)
|
||||
find_package(QT NAMES Qt6 Qt5 COMPONENTS Quick 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 STATIC_PLUGINS "showdesktop")
|
||||
add_definitions(-DWITH_SHOWDESKTOP_PLUGIN)
|
||||
list(APPEND ENABLED_PLUGINS "Show Desktop")
|
||||
add_subdirectory(plugin-showdesktop)
|
||||
endif()
|
||||
|
||||
|
||||
setByDefault(TASKBAR_PLUGIN Yes)
|
||||
if(TASKBAR_PLUGIN)
|
||||
list(APPEND STATIC_PLUGINS "taskbar")
|
||||
add_definitions(-DWITH_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)
|
||||
|
||||
setByDefault(STATUSNOTIFIER_PLUGIN Yes)
|
||||
if(STATUSNOTIFIER_PLUGIN)
|
||||
list(APPEND STATIC_PLUGINS "statusnotifier")
|
||||
add_definitions(-DWITH_STATUSNOTIFIER_PLUGIN)
|
||||
list(APPEND ENABLED_PLUGINS "Status Notifier")
|
||||
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,96 @@
|
|||
# - 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}
|
||||
)
|
||||
|
||||
ukui_plugin_translation_loader(QM_LOADER ${NAME} "ukui-panel")
|
||||
#************************************************
|
||||
|
||||
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} ${${PROJECT_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
|
|
@ -0,0 +1,30 @@
|
|||
From: buxiaoqing <buxiaoqing@kylin.com>
|
||||
Date: Thu, 13 Apr 2023 17:49:51 +0800
|
||||
Subject: ChangeLog: 4.0.0.0-OK0.1
|
||||
|
||||
---
|
||||
panel/contextmenu.cpp | 3 ---
|
||||
1 file changed, 3 deletions(-)
|
||||
|
||||
diff --git a/panel/contextmenu.cpp b/panel/contextmenu.cpp
|
||||
index c3cb5af..5fb0177 100644
|
||||
--- a/panel/contextmenu.cpp
|
||||
+++ b/panel/contextmenu.cpp
|
||||
@@ -95,17 +95,14 @@ void ContextMenu::adjustPanel()
|
||||
connect(pmenuaction_s,&QAction::triggered,[this] {
|
||||
m_gsettings->set(PANEL_SIZE_KEY,PANEL_SIZE_SMALL);
|
||||
m_gsettings->set(ICON_SIZE_KEY,ICON_SIZE_SMALL);
|
||||
- setIconSize(ICON_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);
|
||||
});
|
||||
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);
|
||||
});
|
||||
pmenu_panelsize->setDisabled(m_lockPanel);
|
||||
|
|
@ -0,0 +1,206 @@
|
|||
From: buxiaoqing <buxiaoqing@kylinos.cn>
|
||||
Date: Sat, 15 Apr 2023 14:22:43 +0800
|
||||
Subject: Changelog : 4.0.0.0-ok0.2
|
||||
|
||||
---
|
||||
panel/CMakeLists.txt | 110 ++++++++++++---------------------------------------
|
||||
1 file changed, 26 insertions(+), 84 deletions(-)
|
||||
|
||||
diff --git a/panel/CMakeLists.txt b/panel/CMakeLists.txt
|
||||
index d808986..691bfe6 100644
|
||||
--- a/panel/CMakeLists.txt
|
||||
+++ b/panel/CMakeLists.txt
|
||||
@@ -1,11 +1,9 @@
|
||||
-set(PROJECT ukui-panel)
|
||||
+project(ukui-panel LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
|
||||
add_subdirectory(common)
|
||||
-#add_subdirectory(xdg)
|
||||
-#add_subdirectory(common_fun)
|
||||
|
||||
set(PRIV_HEADERS
|
||||
panelpluginsmodel.h
|
||||
@@ -24,12 +22,10 @@ set(PUB_HEADERS
|
||||
pluginsettings.h
|
||||
iukuipanelplugin.h
|
||||
iukuipanel.h
|
||||
-
|
||||
common/ukuisettings.h
|
||||
common/ukuiplugininfo.h
|
||||
common/ukuitranslator.h
|
||||
common/common.h
|
||||
-
|
||||
common/ukuigridlayout.h
|
||||
common/ukuiglobals.h
|
||||
common_fun/listengsettings.h
|
||||
@@ -49,11 +45,9 @@ set(SOURCES
|
||||
plugin.cpp
|
||||
pluginsettings.cpp
|
||||
contextmenu.cpp
|
||||
-
|
||||
common/ukuiplugininfo.cpp
|
||||
common/ukuisettings.cpp
|
||||
common/ukuitranslator.cpp
|
||||
-
|
||||
common/ukuigridlayout.cpp
|
||||
common_fun/listengsettings.cpp
|
||||
common_fun/ukuipanel_infomation.cpp
|
||||
@@ -62,12 +56,17 @@ set(SOURCES
|
||||
customstyle.cpp
|
||||
)
|
||||
|
||||
-file(GLOB CONFIG_FILES resources/*.conf resources/*.qss)
|
||||
-############################################
|
||||
+set(PLUGIN_DESKTOPS_DIR "${CMAKE_INSTALL_FULL_DATAROOTDIR}/ukui/${PROJECT_NAME}")
|
||||
+set(QTX_LIBRARIES Qt5::Widgets Qt5::Xml Qt5::DBus)
|
||||
+set(UKUI_PANEL_MAN ../man/ukui-panel.1)
|
||||
+set(DESKTOP_FILE resources/ukui-panel.desktop)
|
||||
+set(IMAGE_DIR ./img/)
|
||||
+set(GSETTINGS_FILE resources/org.ukui.panel.settings.gschema.xml)
|
||||
+set(PANEL_GLOBAL_CONFIG_FILES resources/panel-commission.sh resources/panel-commission.ini
|
||||
+ resources/ukui-panel-reset.sh resources/ukui-panel-config.sh)
|
||||
+file(GLOB UKUI_PANEL_CONFIG_FILES resources/*.conf)
|
||||
|
||||
add_definitions(-DCOMPILE_UKUI_PANEL)
|
||||
-
|
||||
-set(PLUGIN_DESKTOPS_DIR "${CMAKE_INSTALL_FULL_DATAROOTDIR}/ukui/${PROJECT}")
|
||||
add_definitions(-DPLUGIN_DESKTOPS_DIR=\"${PLUGIN_DESKTOPS_DIR}\")
|
||||
|
||||
if (WITH_SCREENSAVER_FALLBACK)
|
||||
@@ -75,38 +74,18 @@ if (WITH_SCREENSAVER_FALLBACK)
|
||||
add_definitions(-DWITH_SCREENSAVER_FALLBACK "-DUKUI_LOCK_DESKTOP=\"${CMAKE_INSTALL_FULL_DATAROOTDIR}/applications/ukui-lockscreen.desktop\"")
|
||||
endif ()
|
||||
|
||||
-project(${PROJECT})
|
||||
-
|
||||
-set(QTX_LIBRARIES Qt5::Widgets Qt5::Xml Qt5::DBus)
|
||||
-
|
||||
- #Translations
|
||||
-#ukui_translate_ts(QM_FILES SOURCES
|
||||
-# UPDATE_TRANSLATIONS
|
||||
-# ${UPDATE_TRANSLATIONS}
|
||||
-# SOURCES
|
||||
-# ${PUB_HEADERS}
|
||||
-# ${PRIV_HEADERS}
|
||||
-# ${SOURCES}
|
||||
-# ${UI}
|
||||
-# INSTALL_DIR
|
||||
-# "${UKUI_TRANSLATIONS_DIR}/${PROJECT_NAME}"
|
||||
-#)
|
||||
-
|
||||
ukui_app_translation_loader(SOURCES ${PROJECT_NAME})
|
||||
|
||||
set_property(SOURCE ${DBUS_INTERFACE_SRCS} ${DBUS_ADAPTOR_SRCS} PROPERTY SKIP_AUTOGEN ON)
|
||||
list(APPEND SOURCES "${DBUS_INTERFACE_SRCS}" "${DBUS_ADAPTOR_SRCS}")
|
||||
|
||||
-
|
||||
-
|
||||
-
|
||||
-add_executable(${PROJECT}
|
||||
+add_executable(${PROJECT_NAME}
|
||||
${PUB_HEADERS}
|
||||
${PRIV_HEADERS}
|
||||
${QM_FILES}
|
||||
${SOURCES}
|
||||
- ${UI}
|
||||
)
|
||||
+
|
||||
find_package(PkgConfig)
|
||||
pkg_check_modules(GLIB2 REQUIRED glib-2.0)
|
||||
pkg_check_modules(GIO2 REQUIRED gio-2.0)
|
||||
@@ -121,7 +100,7 @@ find_package(KF5Screen)
|
||||
pkg_check_modules(KYSDKWAYLANDHELPER_PKG kysdk-waylandhelper)
|
||||
|
||||
#ADD_DEFINITIONS(-DQT_NO_KEYWORDS)
|
||||
-target_link_libraries(${PROJECT}
|
||||
+target_link_libraries(${PROJECT_NAME}
|
||||
${LIBRARIES}
|
||||
${QTX_LIBRARIES}
|
||||
KF5::WindowSystem
|
||||
@@ -134,70 +113,33 @@ target_link_libraries(${PROJECT}
|
||||
KF5::Screen
|
||||
)
|
||||
|
||||
-target_include_directories(${PROJECT} PRIVATE ${KYSDKWAYLANDHELPER_PKG_INCLUDE_DIRS})
|
||||
-target_link_directories(${PROJECT} PRIVATE ${KYSDKWAYLANDHELPER_PKG_LIBRARY_DIRS} KF5::WindowSystem)
|
||||
-target_link_libraries(${PROJECT} ${KYSDKWAYLANDHELPER_PKG_LIBRARIES})
|
||||
+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_compile_definitions(${PROJECT}
|
||||
+target_compile_definitions(${PROJECT_NAME}
|
||||
PRIVATE
|
||||
"UKUI_RELATIVE_SHARE_DIR=\"${UKUI_RELATIVE_SHARE_DIR}\""
|
||||
- #"UKUI_SHARE_DIR=\"${UKUI_SHARE_DIR}\""
|
||||
"UKUI_RELATIVE_SHARE_TRANSLATIONS_DIR=\"${UKUI_RELATIVE_TRANSLATIONS_DIR}\""
|
||||
"UKUI_SHARE_TRANSLATIONS_DIR=\"${UKUI_TRANSLATIONS_DIR}\""
|
||||
"UKUI_GRAPHICS_DIR=\"${UKUI_GRAPHICS_DIR}\""
|
||||
- #"UKUI_ETC_XDG_DIR=\"${UKUI_ETC_XDG_DIR}\""
|
||||
"UKUI_DATA_DIR=\"${UKUI_DATA_DIR}\""
|
||||
"UKUI_INSTALL_PREFIX=\"${CMAKE_INSTALL_PREFIX}\""
|
||||
- #"UKUI_VERSION=\"${UKUI_VERSION}\""
|
||||
- #"COMPILE_LIBUKUI"
|
||||
- #"QT_USE_QSTRINGBUILDER"
|
||||
- #"QT_NO_CAST_FROM_ASCII"
|
||||
- #"QT_NO_CAST_TO_ASCII"
|
||||
- #"QT_NO_URL_CAST_FROM_STRING"
|
||||
- #"QT_NO_CAST_FROM_BYTEARRAY"
|
||||
- #"$<$<CONFIG:Release>:QT_NO_DEBUG_OUTPUT>"
|
||||
- #"$<$<CONFIG:Release>:QT_NO_WARNING_OUTPUT>"
|
||||
)
|
||||
|
||||
-
|
||||
-install(TARGETS ${PROJECT} RUNTIME DESTINATION bin)
|
||||
-install(FILES ${CONFIG_FILES} DESTINATION ${CMAKE_INSTALL_DATADIR}/ukui)
|
||||
+#安装ukui-panel
|
||||
+install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin)
|
||||
+#DESKTOP FILE
|
||||
+install(FILES ${DESKTOP_FILE} DESTINATION "/etc/xdg/autostart/" COMPONENT Runtime)
|
||||
+install(FILES ${UKUI_PANEL_CONFIG_FILES} DESTINATION ${CMAKE_INSTALL_DATADIR}/ukui)
|
||||
install(FILES ${PUB_HEADERS} DESTINATION include/ukui)
|
||||
-install(FILES
|
||||
- ../man/ukui-panel.1
|
||||
- DESTINATION "${CMAKE_INSTALL_MANDIR}/man1"
|
||||
- COMPONENT Runtime
|
||||
-)
|
||||
-install(FILES
|
||||
- resources/ukui-panel.desktop
|
||||
- DESTINATION "/etc/xdg/autostart/"
|
||||
- COMPONENT Runtime
|
||||
-)
|
||||
-
|
||||
-install(DIRECTORY
|
||||
- ./img/
|
||||
- DESTINATION "${PACKAGE_DATA_DIR}/panel/img"
|
||||
-)
|
||||
-
|
||||
-install(FILES
|
||||
- resources/ukui-panel_zh_CN.qm resources/ukui-panel_zh_CN.ts resources/ukui-panel_tr.ts
|
||||
- DESTINATION "${PACKAGE_DATA_DIR}/panel/resources"
|
||||
- COMPONENT Runtime
|
||||
-)
|
||||
-
|
||||
-install(FILES
|
||||
- resources/org.ukui.panel.settings.gschema.xml
|
||||
- DESTINATION "/usr/share/glib-2.0/schemas"
|
||||
- COMPONENT Runtime
|
||||
-)
|
||||
-
|
||||
-install(FILES
|
||||
- resources/panel-commission.sh resources/panel-commission.ini resources/ukui-panel-reset.sh resources/ukui-panel-config.sh
|
||||
- DESTINATION "/usr/share/ukui/ukui-panel"
|
||||
- COMPONENT Runtime
|
||||
+install(FILES ${UKUI_PANEL_MAN} DESTINATION "${CMAKE_INSTALL_MANDIR}/man1" COMPONENT Runtime)
|
||||
+install(FILES ${GSETTINGS_FILE} DESTINATION "/usr/share/glib-2.0/schemas" COMPONENT Runtime)
|
||||
+install(FILES ${PANEL_GLOBAL_CONFIG_FILES} DESTINATION "/usr/share/ukui/ukui-panel" COMPONENT Runtime
|
||||
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ GROUP_WRITE WORLD_READ WORLD_WRITE WORLD_EXECUTE
|
||||
GROUP_EXECUTE GROUP_READ
|
||||
)
|
||||
+install(DIRECTORY ${IMAGE_DIR} DESTINATION "${PACKAGE_DATA_DIR}/panel/img")
|
||||
|
||||
set(PLUGIN panel)
|
||||
include(../cmake/UkuiPluginTranslationTs.cmake)
|
|
@ -0,0 +1,51 @@
|
|||
From: buxiaoqing <buxiaoqing@kylinos.cn>
|
||||
Date: Mon, 17 Apr 2023 17:28:47 +0800
|
||||
Subject: Changelog : 4.0.0.0-ok0.3
|
||||
|
||||
---
|
||||
plugin-taskbar/ukuigrouppopup.cpp | 2 +-
|
||||
plugin-taskbar/ukuigrouppopup.h | 9 ++++-----
|
||||
2 files changed, 5 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/plugin-taskbar/ukuigrouppopup.cpp b/plugin-taskbar/ukuigrouppopup.cpp
|
||||
index 48feeca..fba0b34 100644
|
||||
--- a/plugin-taskbar/ukuigrouppopup.cpp
|
||||
+++ b/plugin-taskbar/ukuigrouppopup.cpp
|
||||
@@ -48,7 +48,7 @@
|
||||
#define XRENDER "xrender"
|
||||
#define UKUI_KWIN_SERVICE "org.ukui.KWin"
|
||||
#define UKUI_KWIN_PATH "/Compositor"
|
||||
-#define UKUI_KWIN_INTERFACE "org.ukui.kwin.Compositing"
|
||||
+#define UKUI_KWIN_INTERFACE "org.kde.kwin.Compositing"
|
||||
#define COMPOSITING_TYPE "compositingType"
|
||||
|
||||
QPixmap qimageFromXImage(XImage* ximage)
|
||||
diff --git a/plugin-taskbar/ukuigrouppopup.h b/plugin-taskbar/ukuigrouppopup.h
|
||||
index 2053c10..a544656 100644
|
||||
--- a/plugin-taskbar/ukuigrouppopup.h
|
||||
+++ b/plugin-taskbar/ukuigrouppopup.h
|
||||
@@ -97,20 +97,19 @@ protected:
|
||||
private:
|
||||
UKUITaskGroup *m_group;
|
||||
QTimer m_closeTimer;
|
||||
- bool m_rightclick;
|
||||
-
|
||||
+ bool m_rightclick = false;
|
||||
bool isKeepShow = false;
|
||||
+ bool m_isShowByList = false;
|
||||
+ bool m_useOpenGL = true;
|
||||
+ bool m_isXrender = false;
|
||||
|
||||
UKUISdkTaskWidgetHash m_widgetHash;
|
||||
int m_allWidgetWidth = 0;
|
||||
int m_allWidgetHeight = 0;
|
||||
- bool m_isShowByList = false;
|
||||
QWidget *m_widget;
|
||||
QScrollArea *m_scrollArea = NULL;
|
||||
|
||||
- bool m_useOpenGL;
|
||||
QDBusInterface *m_interface;
|
||||
- bool m_isXrender;
|
||||
QGSettings *m_changeTheme;
|
||||
|
||||
private slots:
|
|
@ -0,0 +1,72 @@
|
|||
From: =?utf-8?b?5Y2c6JCn5bqG?= <9500352+nicole_123@user.noreply.gitee.com>
|
||||
Date: Mon, 8 May 2023 03:40:35 +0000
|
||||
Subject: =?utf-8?q?!69_cherry-pick=3A_use_primaryChanged_signal_from_USD_Me?=
|
||||
=?utf-8?q?rge_pull_request_!69_from_=E5=8D=9C=E8=90=A7=E5=BA=86/cherrypick?=
|
||||
|
||||
---
|
||||
panel/common/common.h | 6 ++++++
|
||||
panel/ukuipanel.cpp | 14 +++++++++++++-
|
||||
panel/ukuipanel.h | 1 +
|
||||
3 files changed, 20 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/panel/common/common.h b/panel/common/common.h
|
||||
index 44c9d68..ba325ac 100644
|
||||
--- a/panel/common/common.h
|
||||
+++ b/panel/common/common.h
|
||||
@@ -99,6 +99,12 @@
|
||||
#define STYLE_NAME_KEY_WHITE "ukui-white"
|
||||
#define STYLE_NAME_KEY_ICONTHEME "iconThemeName"
|
||||
|
||||
+//USD primary screen changed Infomation
|
||||
+#define USD_SERVICE "org.ukui.SettingsDaemon"
|
||||
+#define USD_XRANDER_PATH "/org/ukui/SettingsDaemon/xrandr"
|
||||
+#define USD_XRANDER_INTERFACE "org.ukui.SettingsDaemon.xrandr"
|
||||
+#define PRIMARY_CHANGED "primaryChanged"
|
||||
+
|
||||
#define MAX_SIZE_OF_Thumb 16777215
|
||||
#define PANEL_CONFIG_PATH "/usr/share/ukui/ukui-panel/panel-commission.ini"
|
||||
|
||||
diff --git a/panel/ukuipanel.cpp b/panel/ukuipanel.cpp
|
||||
index c80d245..e7e3378 100644
|
||||
--- a/panel/ukuipanel.cpp
|
||||
+++ b/panel/ukuipanel.cpp
|
||||
@@ -223,6 +223,13 @@ UKUIPanel::UKUIPanel(const QString &configGroup, UKUi::Settings *settings, QWidg
|
||||
// as we've already connceted to QDesktopWidget::resized, but it actually
|
||||
connect(QApplication::desktop(), &QDesktopWidget::workAreaResized,
|
||||
this, &UKUIPanel::ensureVisible);
|
||||
+ //适配KScreen后,分辨率改变的信号无法获取,需要从SettingsDaemon拿分辨率改变的信号
|
||||
+ QDBusConnection::sessionBus().connect(QString(USD_SERVICE),
|
||||
+ QString(USD_XRANDER_PATH),
|
||||
+ QString(USD_XRANDER_INTERFACE),
|
||||
+ QString(PRIMARY_CHANGED),
|
||||
+ this, SLOT(primaryChangedSlot(int, int, int, int, int)));
|
||||
+
|
||||
UKUIPanelApplication *a = reinterpret_cast<UKUIPanelApplication*>(qApp);
|
||||
m_primaryScreenGeometry = QGuiApplication::screens().at(0)->geometry();
|
||||
KScreen::GetConfigOperation *op = new KScreen::GetConfigOperation();
|
||||
@@ -439,7 +446,12 @@ void UKUIPanel::ensureVisible()
|
||||
// the screen size might be changed
|
||||
realign();
|
||||
}
|
||||
-
|
||||
+void UKUIPanel::primaryChangedSlot(int x, int y, int w, int h, int r)
|
||||
+{
|
||||
+ qDebug() << " primaryChanged from USD " << x << y << w << h << r;
|
||||
+ m_primaryScreenGeometry = QRect(x, y, w, h);
|
||||
+ realign();
|
||||
+}
|
||||
|
||||
UKUIPanel::~UKUIPanel()
|
||||
{
|
||||
diff --git a/panel/ukuipanel.h b/panel/ukuipanel.h
|
||||
index 9d9f55c..3b84153 100644
|
||||
--- a/panel/ukuipanel.h
|
||||
+++ b/panel/ukuipanel.h
|
||||
@@ -301,6 +301,7 @@ public Q_SLOTS:
|
||||
* where the desired position is possible.
|
||||
*/
|
||||
void ensureVisible();
|
||||
+ void primaryChangedSlot(int x, int y, int w, int h, int r);
|
||||
|
||||
Q_SIGNALS:
|
||||
/**
|
|
@ -0,0 +1,45 @@
|
|||
From: handsome_feng <jianfengli@ubuntukylin.com>
|
||||
Date: Tue, 16 May 2023 01:08:28 +0000
|
||||
Subject: update debian/changelog.
|
||||
|
||||
Signed-off-by: handsome_feng <jianfengli@ubuntukylin.com>
|
||||
---
|
||||
.gitignore | 29 +++++++++++++++++++++++++++++
|
||||
1 file changed, 29 insertions(+)
|
||||
create mode 100644 .gitignore
|
||||
|
||||
diff --git a/.gitignore b/.gitignore
|
||||
new file mode 100644
|
||||
index 0000000..659c4d2
|
||||
--- /dev/null
|
||||
+++ b/.gitignore
|
||||
@@ -0,0 +1,29 @@
|
||||
+# Ignore the following files
|
||||
+.vscode
|
||||
+*~
|
||||
+*.[oa]
|
||||
+*.diff
|
||||
+*.kate-swp
|
||||
+*.kdev4
|
||||
+.kdev_include_paths
|
||||
+*.kdevelop.pcs
|
||||
+*.moc
|
||||
+*.moc.cpp
|
||||
+*.orig
|
||||
+*.user
|
||||
+.*.swp
|
||||
+.swp.*
|
||||
+Doxyfile
|
||||
+Makefile
|
||||
+avail
|
||||
+random_seed
|
||||
+/build*/
|
||||
+CMakeLists.txt.user*
|
||||
+*.unc-backup*
|
||||
+.clang-format
|
||||
+/compile_commands.json
|
||||
+.clangd
|
||||
+.idea
|
||||
+/cmake-build*
|
||||
+.cache
|
||||
+
|
|
@ -0,0 +1,60 @@
|
|||
From: handsome_feng <jianfengli@ubuntukylin.com>
|
||||
Date: Sun, 4 Jun 2023 18:39:49 +0800
|
||||
Subject: close I77O3F
|
||||
|
||||
---
|
||||
panel/ukuipanel.cpp | 19 +++++++++++++++++++
|
||||
panel/ukuipanel.h | 2 ++
|
||||
2 files changed, 21 insertions(+)
|
||||
|
||||
diff --git a/panel/ukuipanel.cpp b/panel/ukuipanel.cpp
|
||||
index e7e3378..f74023d 100644
|
||||
--- a/panel/ukuipanel.cpp
|
||||
+++ b/panel/ukuipanel.cpp
|
||||
@@ -310,7 +310,9 @@ UKUIPanel::UKUIPanel(const QString &configGroup, UKUi::Settings *settings, QWidg
|
||||
"com.kylin.statusmanager.interface","mode_change_signal",
|
||||
this,SLOT(setPanelHide(bool)));
|
||||
} else {
|
||||
+ qWarning()<<"Cann't connect kylin-status-manager";
|
||||
setPanelHide(false);
|
||||
+ QTimer::singleShot(1000,[this] { connectToStatusManager();});
|
||||
}
|
||||
qDebug()<<"Panel :: show UKuiPanel finished";
|
||||
//给session发信号,告知任务栏已经启动完成,可以启动下一个组件
|
||||
@@ -1221,6 +1223,23 @@ bool UKUIPanel::isPluginSingletonAndRunnig(QString const & pluginId) const
|
||||
return plugin->iPlugin()->flags().testFlag(IUKUIPanelPlugin::SingleInstance);
|
||||
}
|
||||
|
||||
+void UKUIPanel::connectToStatusManager()
|
||||
+{
|
||||
+ m_interface = new QDBusInterface("com.kylin.statusmanager.interface","/",
|
||||
+ "com.kylin.statusmanager.interface",
|
||||
+ QDBusConnection::sessionBus(),this);
|
||||
+
|
||||
+ if (m_interface->isValid()) {
|
||||
+ QDBusReply<bool> status = m_interface->call("get_current_tabletmode");
|
||||
+ setPanelHide(status);
|
||||
+ QDBusConnection::sessionBus().connect("com.kylin.statusmanager.interface","/",
|
||||
+ "com.kylin.statusmanager.interface","mode_change_signal",
|
||||
+ this,SLOT(setPanelHide(bool)));
|
||||
+ } else {
|
||||
+ QTimer::singleShot(1000,[this] { connectToStatusManager();});
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
void UKUIPanel::connectToServer(){
|
||||
m_cloudInterface = new QDBusInterface("org.kylinssoclient.dbus",
|
||||
"/org/kylinssoclient/path",
|
||||
diff --git a/panel/ukuipanel.h b/panel/ukuipanel.h
|
||||
index 3b84153..8abaced 100644
|
||||
--- a/panel/ukuipanel.h
|
||||
+++ b/panel/ukuipanel.h
|
||||
@@ -662,6 +662,8 @@ private:
|
||||
int m_moveLock = -1;
|
||||
|
||||
void connectToServer();
|
||||
+ void connectToStatusManager();
|
||||
+
|
||||
|
||||
private Q_SLOTS:
|
||||
void keyChangedSlot(const QString &key);
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,66 @@
|
|||
From: buxiaoqing <buxiaoqing@kylinos.cn>
|
||||
Date: Wed, 7 Jun 2023 18:20:22 +0800
|
||||
Subject: update changelog : 4.0.0.0-ok0.8
|
||||
|
||||
---
|
||||
panel-daemon/CMakeLists.txt | 2 +-
|
||||
plugin-statusnotifier/statusnotiferscrollarea.cpp | 14 ++++++++++++++
|
||||
plugin-statusnotifier/statusnotiferscrollarea.h | 1 +
|
||||
3 files changed, 16 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/panel-daemon/CMakeLists.txt b/panel-daemon/CMakeLists.txt
|
||||
index e58e87e..e49da1c 100644
|
||||
--- a/panel-daemon/CMakeLists.txt
|
||||
+++ b/panel-daemon/CMakeLists.txt
|
||||
@@ -22,7 +22,7 @@ find_package(Qt5DBus REQUIRED)
|
||||
find_package(PkgConfig REQUIRED)
|
||||
find_package(KF5WindowSystem REQUIRED)
|
||||
|
||||
-pkg_check_modules(GLIB2 REQUIRED glib-2.0 gio-2.0 udisks2)
|
||||
+pkg_check_modules(GLIB2 REQUIRED glib-2.0 gio-2.0)
|
||||
pkg_check_modules(QGS REQUIRED gsettings-qt)
|
||||
|
||||
include_directories(${GLIB2_INCLUDE_DIRS})
|
||||
diff --git a/plugin-statusnotifier/statusnotiferscrollarea.cpp b/plugin-statusnotifier/statusnotiferscrollarea.cpp
|
||||
index 4ad44cf..0b6f53d 100644
|
||||
--- a/plugin-statusnotifier/statusnotiferscrollarea.cpp
|
||||
+++ b/plugin-statusnotifier/statusnotiferscrollarea.cpp
|
||||
@@ -64,6 +64,14 @@ StatusNotiferScrollArea::StatusNotiferScrollArea(IUKUIPanelPlugin *plugin, QWidg
|
||||
settings->setValue("alignment",alignmentBackup);
|
||||
}
|
||||
|
||||
+ //监听平板和PC模式切换
|
||||
+ QDBusConnection::sessionBus().connect("com.kylin.statusmanager.interface",
|
||||
+ "/",
|
||||
+ "com.kylin.statusmanager.interface",
|
||||
+ "mode_change_signal",
|
||||
+ this,
|
||||
+ SLOT(tabletPcSwitch(bool)));
|
||||
+
|
||||
//监听托盘应用注册
|
||||
m_watcher = new StatusNotifierWatcher;
|
||||
connect(m_watcher, &StatusNotifierWatcher::StatusNotifierItemRegistered,
|
||||
@@ -555,5 +563,11 @@ QString StatusNotiferScrollArea::getDisplayId(QString pid)
|
||||
}
|
||||
}
|
||||
|
||||
+void StatusNotiferScrollArea::tabletPcSwitch(bool state)
|
||||
+{
|
||||
+ if(!state) { //切换回PC模式时刷新托盘
|
||||
+ resetLayout();
|
||||
+ }
|
||||
+}
|
||||
|
||||
|
||||
diff --git a/plugin-statusnotifier/statusnotiferscrollarea.h b/plugin-statusnotifier/statusnotiferscrollarea.h
|
||||
index 5854c8a..780fb9f 100644
|
||||
--- a/plugin-statusnotifier/statusnotiferscrollarea.h
|
||||
+++ b/plugin-statusnotifier/statusnotiferscrollarea.h
|
||||
@@ -74,6 +74,7 @@ public Q_SLOTS:
|
||||
private Q_SLOTS:
|
||||
void switchButtons(StatusNotifierButtonAbstract *srcButton, StatusNotifierButtonAbstract *dstButton);
|
||||
void arrowbtnAddButton(StatusNotifierButtonAbstract *srcButton, StatusNotifierButtonAbstract *dstButton);
|
||||
+ void tabletPcSwitch(bool state);
|
||||
|
||||
private:
|
||||
void saveSettings(QString button1,QString button2);
|
|
@ -0,0 +1,276 @@
|
|||
From: =?utf-8?b?5Y2c6JCn5bqG?= <9500352+nicole_123@user.noreply.gitee.com>
|
||||
Date: Tue, 27 Jun 2023 09:11:47 +0000
|
||||
Subject: =?utf-8?b?ITkwIOeOr+Wig+S4i+WKqOaAgemihOiniOWtmOWcqOmXrumimO+8jA==?=
|
||||
=?utf-8?b?5Li05pe26YeH55So6Z2Z5oCB6aKE6KeI5Zu+55qE5pa55byPIE1lcmdlIHB1bGwg?=
|
||||
=?utf-8?b?cmVxdWVzdCAhOTAgZnJvbSDljZzokKfluoYvWEltYWdl?=
|
||||
|
||||
---
|
||||
panel/ukuipanel.cpp | 25 +++------------
|
||||
panel/ukuipanel.h | 4 +--
|
||||
plugin-taskbar/qml/WaylandPreviewItem.qml | 8 ++++-
|
||||
plugin-taskbar/ukuigrouppopup.cpp | 7 +---
|
||||
plugin-taskbar/waylandpreviewpopup.cpp | 53 +++++++++++++++++++++++++++----
|
||||
plugin-taskbar/waylandpreviewpopup.h | 8 +++++
|
||||
6 files changed, 68 insertions(+), 37 deletions(-)
|
||||
|
||||
diff --git a/panel/ukuipanel.cpp b/panel/ukuipanel.cpp
|
||||
index f74023d..50e715b 100644
|
||||
--- a/panel/ukuipanel.cpp
|
||||
+++ b/panel/ukuipanel.cpp
|
||||
@@ -306,14 +306,14 @@ UKUIPanel::UKUIPanel(const QString &configGroup, UKUi::Settings *settings, QWidg
|
||||
if (m_interface->isValid()) {
|
||||
QDBusReply<bool> status = m_interface->call("get_current_tabletmode");
|
||||
setPanelHide(status);
|
||||
- QDBusConnection::sessionBus().connect("com.kylin.statusmanager.interface","/",
|
||||
- "com.kylin.statusmanager.interface","mode_change_signal",
|
||||
- this,SLOT(setPanelHide(bool)));
|
||||
} else {
|
||||
qWarning()<<"Cann't connect kylin-status-manager";
|
||||
setPanelHide(false);
|
||||
- QTimer::singleShot(1000,[this] { connectToStatusManager();});
|
||||
}
|
||||
+ QDBusConnection::sessionBus().connect("com.kylin.statusmanager.interface","/",
|
||||
+ "com.kylin.statusmanager.interface","mode_change_signal",
|
||||
+ this,SLOT(setPanelHide(bool)));
|
||||
+
|
||||
qDebug()<<"Panel :: show UKuiPanel finished";
|
||||
//给session发信号,告知任务栏已经启动完成,可以启动下一个组件
|
||||
QDBusInterface interface(UKUI_SERVICE,
|
||||
@@ -1223,23 +1223,6 @@ bool UKUIPanel::isPluginSingletonAndRunnig(QString const & pluginId) const
|
||||
return plugin->iPlugin()->flags().testFlag(IUKUIPanelPlugin::SingleInstance);
|
||||
}
|
||||
|
||||
-void UKUIPanel::connectToStatusManager()
|
||||
-{
|
||||
- m_interface = new QDBusInterface("com.kylin.statusmanager.interface","/",
|
||||
- "com.kylin.statusmanager.interface",
|
||||
- QDBusConnection::sessionBus(),this);
|
||||
-
|
||||
- if (m_interface->isValid()) {
|
||||
- QDBusReply<bool> status = m_interface->call("get_current_tabletmode");
|
||||
- setPanelHide(status);
|
||||
- QDBusConnection::sessionBus().connect("com.kylin.statusmanager.interface","/",
|
||||
- "com.kylin.statusmanager.interface","mode_change_signal",
|
||||
- this,SLOT(setPanelHide(bool)));
|
||||
- } else {
|
||||
- QTimer::singleShot(1000,[this] { connectToStatusManager();});
|
||||
- }
|
||||
-}
|
||||
-
|
||||
void UKUIPanel::connectToServer(){
|
||||
m_cloudInterface = new QDBusInterface("org.kylinssoclient.dbus",
|
||||
"/org/kylinssoclient/path",
|
||||
diff --git a/panel/ukuipanel.h b/panel/ukuipanel.h
|
||||
index 8abaced..10c4b70 100644
|
||||
--- a/panel/ukuipanel.h
|
||||
+++ b/panel/ukuipanel.h
|
||||
@@ -662,8 +662,6 @@ private:
|
||||
int m_moveLock = -1;
|
||||
|
||||
void connectToServer();
|
||||
- void connectToStatusManager();
|
||||
-
|
||||
|
||||
private Q_SLOTS:
|
||||
void keyChangedSlot(const QString &key);
|
||||
@@ -677,7 +675,7 @@ public:
|
||||
QGSettings *m_transparencyGsettings;
|
||||
QTimer *m_time;
|
||||
|
||||
- QDBusInterface *m_interface;
|
||||
+ QDBusInterface *m_interface = nullptr;
|
||||
|
||||
};
|
||||
|
||||
diff --git a/plugin-taskbar/qml/WaylandPreviewItem.qml b/plugin-taskbar/qml/WaylandPreviewItem.qml
|
||||
index e87658c..6307a1e 100644
|
||||
--- a/plugin-taskbar/qml/WaylandPreviewItem.qml
|
||||
+++ b/plugin-taskbar/qml/WaylandPreviewItem.qml
|
||||
@@ -23,7 +23,7 @@ Item {
|
||||
spacing : 0
|
||||
anchors.fill : parent
|
||||
|
||||
- TitleComponent{
|
||||
+ TitleComponent {
|
||||
height: 40
|
||||
Layout.fillWidth: true
|
||||
visible: true
|
||||
@@ -33,6 +33,12 @@ Item {
|
||||
id : previewArea
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
+ property bool isHidden: waylandPreview.isWindowHide
|
||||
+ onIsHiddenChanged: {
|
||||
+ if (waylandPreview.isWindowHide) {
|
||||
+ waylandThumbnail.windowUuid = ""
|
||||
+ }
|
||||
+ }
|
||||
//Wayland环境下 缩略图
|
||||
PipeWireThumbnail{
|
||||
id: waylandThumbnail
|
||||
diff --git a/plugin-taskbar/ukuigrouppopup.cpp b/plugin-taskbar/ukuigrouppopup.cpp
|
||||
index 8de4e84..1978fe7 100644
|
||||
--- a/plugin-taskbar/ukuigrouppopup.cpp
|
||||
+++ b/plugin-taskbar/ukuigrouppopup.cpp
|
||||
@@ -600,12 +600,7 @@ void UKUIGroupPopup::showAllWindowByThumbnail()
|
||||
} else {
|
||||
m_widget->setLayout(new QVBoxLayout);
|
||||
}
|
||||
-
|
||||
- if (m_useOpenGL && !m_isXrender) {
|
||||
- caculateQmlWidget();
|
||||
- } else {
|
||||
- caculateTaskWidget();
|
||||
- }
|
||||
+ caculateTaskWidget();
|
||||
|
||||
m_group->plugin()->willShowWindow(this);
|
||||
this->layout()->addWidget(m_widget);
|
||||
diff --git a/plugin-taskbar/waylandpreviewpopup.cpp b/plugin-taskbar/waylandpreviewpopup.cpp
|
||||
index 6ccf85c..85db55c 100644
|
||||
--- a/plugin-taskbar/waylandpreviewpopup.cpp
|
||||
+++ b/plugin-taskbar/waylandpreviewpopup.cpp
|
||||
@@ -79,7 +79,8 @@ WaylandPreviewPopup::WaylandPreviewPopup(UKUITaskGroup *group)
|
||||
} else {
|
||||
setLayout(new QVBoxLayout);
|
||||
}
|
||||
- layout()->setSpacing(8);
|
||||
+ this->setAttribute(Qt::WA_TranslucentBackground);
|
||||
+ layout()->setSpacing(0);
|
||||
layout()->setMargin(0);
|
||||
|
||||
//wayland resource
|
||||
@@ -97,20 +98,35 @@ WaylandPreviewPopup::~WaylandPreviewPopup()
|
||||
|
||||
void WaylandPreviewPopup::addWaylandPreviewToPopup(QList<qint64> windowIdList)
|
||||
{
|
||||
+ if (this->layout()->count() > 0) {
|
||||
+ removeAllWidgets();
|
||||
+ }
|
||||
+ m_widget = new QWidget(this);
|
||||
+ m_widget->setAttribute(Qt::WA_TranslucentBackground);
|
||||
+ if (m_group->plugin()->panel()->isHorizontal()) {
|
||||
+ m_widget->setLayout(new QHBoxLayout);
|
||||
+ } else {
|
||||
+ m_widget->setLayout(new QVBoxLayout);
|
||||
+ }
|
||||
+
|
||||
for (int i = 0; i < windowIdList.size(); i++) {
|
||||
QUuid uuid = m_waylandSource->getUuidFromWid(windowIdList.at(i));
|
||||
- if (m_waylandWidgetHash.keys().contains(uuid)) {
|
||||
- continue;
|
||||
- }
|
||||
+// if (m_waylandWidgetHash.keys().contains(uuid)) {
|
||||
+// continue;
|
||||
+// }
|
||||
waylandPreviewAdded(uuid);
|
||||
}
|
||||
- this->setFixedSize(windowIdList.size() * WAYLAND_PREVIEW_WIDTH, WAYLAND_PREVIEW_HEIGHT);
|
||||
+
|
||||
+ this->layout()->addWidget(m_widget);
|
||||
+
|
||||
if (m_group->plugin()->panel()->isHorizontal()) {
|
||||
+ this->setFixedSize(windowIdList.size() * WAYLAND_PREVIEW_WIDTH, WAYLAND_PREVIEW_HEIGHT);
|
||||
int screenwidth = QGuiApplication::screens().at(0)->geometry().width();
|
||||
if (this->width() > screenwidth) {
|
||||
this->setFixedWidth(screenwidth);
|
||||
}
|
||||
} else {
|
||||
+ this->setFixedSize(WAYLAND_PREVIEW_WIDTH, windowIdList.size() * WAYLAND_PREVIEW_HEIGHT);
|
||||
if (this->height() > QGuiApplication::screens().at(0)->geometry().height()) {
|
||||
this->setFixedHeight(QGuiApplication::screens().at(0)->geometry().height());
|
||||
}
|
||||
@@ -143,7 +159,7 @@ void WaylandPreviewPopup::waylandPreviewAdded(QUuid uuid)
|
||||
m_waylandRecl = m_waylandPreviewItem->findChild<QObject *>("waylandThumbnail");
|
||||
m_waylandRecl->setProperty("windowUuid", uuid);
|
||||
m_waylandWidgetHash.insert(uuid, m_waylandPreviewWidget);
|
||||
- this->layout()->addWidget(m_waylandPreviewWidget);
|
||||
+ m_widget->layout()->addWidget(m_waylandPreviewWidget);
|
||||
}
|
||||
|
||||
void WaylandPreviewPopup::removeWaylandPreFromPopup(qint64 windowId)
|
||||
@@ -160,6 +176,25 @@ void WaylandPreviewPopup::waylandPreviewRemove(QUuid uuid)
|
||||
waylandwidget->deleteLater();
|
||||
}
|
||||
|
||||
+void WaylandPreviewPopup::removeAllWidgets()
|
||||
+{
|
||||
+ if (m_widget) {
|
||||
+ this->layout()->removeWidget(m_widget);
|
||||
+ QHBoxLayout *hLayout = dynamic_cast<QHBoxLayout*>(m_widget->layout());
|
||||
+ QVBoxLayout *vLayout = dynamic_cast<QVBoxLayout*>(m_widget->layout());
|
||||
+ if (hLayout != NULL) {
|
||||
+ hLayout->deleteLater();
|
||||
+ hLayout = NULL;
|
||||
+ }
|
||||
+ if (vLayout != NULL) {
|
||||
+ vLayout->deleteLater();
|
||||
+ vLayout = NULL;
|
||||
+ }
|
||||
+ m_widget->deleteLater();
|
||||
+ m_widget = NULL;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
QIcon WaylandPreviewPopup::getWindowIcon()
|
||||
{
|
||||
return WindowManager::getWindowIcon(m_group->sdkWindowId());
|
||||
@@ -172,6 +207,9 @@ QString WaylandPreviewPopup::getWindowTitle()
|
||||
|
||||
void WaylandPreviewPopup::show()
|
||||
{
|
||||
+ m_isHiden = false;
|
||||
+ emit hideStatusChanged();
|
||||
+
|
||||
QWidget::show();
|
||||
kdk::WindowManager::setSkipSwitcher(this->windowHandle(), true);
|
||||
kdk::WindowManager::setSkipTaskBar(this->windowHandle(), true);
|
||||
@@ -180,6 +218,9 @@ void WaylandPreviewPopup::show()
|
||||
|
||||
void WaylandPreviewPopup::hide()
|
||||
{
|
||||
+ m_isHiden = true;
|
||||
+ emit hideStatusChanged();
|
||||
+
|
||||
qDebug() << __func__;
|
||||
if (!m_isKeepShow) {
|
||||
kdk::WindowManager::closeWindow(m_waylandSource->m_popupWinId);
|
||||
diff --git a/plugin-taskbar/waylandpreviewpopup.h b/plugin-taskbar/waylandpreviewpopup.h
|
||||
index fb98ab1..d329435 100644
|
||||
--- a/plugin-taskbar/waylandpreviewpopup.h
|
||||
+++ b/plugin-taskbar/waylandpreviewpopup.h
|
||||
@@ -48,6 +48,7 @@ public:
|
||||
|
||||
Q_INVOKABLE QIcon getWindowIcon();
|
||||
Q_INVOKABLE QString getWindowTitle();
|
||||
+ Q_PROPERTY(bool isWindowHide READ getWindowHideStatus NOTIFY hideStatusChanged);
|
||||
|
||||
void addWaylandPreviewToPopup(QList<qint64> windowIdList);
|
||||
void removeWaylandPreFromPopup(qint64 windowId);
|
||||
@@ -64,12 +65,16 @@ private:
|
||||
WindowId m_previewWinId;
|
||||
QHash<QUuid, QWidget*> m_waylandWidgetHash;
|
||||
QTimer m_hideTimer;
|
||||
+ QWidget *m_widget;
|
||||
bool m_isKeepShow = false;
|
||||
+ bool m_isHiden = true;
|
||||
|
||||
|
||||
void waylandPreviewAdded(QUuid uuid);
|
||||
void waylandPreviewRemove(QUuid uuid);
|
||||
void setPopupGeometry();
|
||||
+ void removeAllWidgets();
|
||||
+ bool getWindowHideStatus() {return m_isHiden;}
|
||||
QRect calculatePopupWindowPos(QPoint const & absolutePos, QSize const & windowSize) const;
|
||||
|
||||
private slots:
|
||||
@@ -87,6 +92,9 @@ private slots:
|
||||
void setWindowKeepAbove();
|
||||
void setWindowClearAbove();
|
||||
|
||||
+signals:
|
||||
+ void hideStatusChanged();
|
||||
+
|
||||
};
|
||||
|
||||
#endif // WAYLANDPREVIEWPOPUP_H
|
|
@ -0,0 +1,23 @@
|
|||
From: =?utf-8?b?5Y2c6JCn5bqG?= <9500352+nicole_123@user.noreply.gitee.com>
|
||||
Date: Tue, 4 Jul 2023 05:50:39 +0000
|
||||
Subject: =?utf-8?b?ITkxIOS/ruWkjeiwg+aVtOS4uuS4iuS4jeeUn+aViOmXrumimCBNZXJn?=
|
||||
=?utf-8?b?ZSBwdWxsIHJlcXVlc3QgITkxIGZyb20g5Y2c6JCn5bqGL2ZpeGlzc3Vlcw==?=
|
||||
|
||||
---
|
||||
panel/ukuipanel.cpp | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/panel/ukuipanel.cpp b/panel/ukuipanel.cpp
|
||||
index 50e715b..cc86e39 100644
|
||||
--- a/panel/ukuipanel.cpp
|
||||
+++ b/panel/ukuipanel.cpp
|
||||
@@ -888,7 +888,8 @@ void UKUIPanel::setPosition(int screen, IUKUIPanel::Position position, bool save
|
||||
|
||||
realign();
|
||||
m_gsettings->set(PANEL_POSITION_KEY,position);
|
||||
- setPanelGeometry(true);
|
||||
+ QRect rect = caculPanelGeometry(m_primaryScreenGeometry);
|
||||
+ kdk::WindowManager::setGeometry(this->windowHandle(), rect);
|
||||
}
|
||||
|
||||
void UKUIPanel::setAlignment(Alignment value, bool save)
|
|
@ -0,0 +1,125 @@
|
|||
From: MouseZhang <sendbypython@foxmail.com>
|
||||
Date: Fri, 28 Jul 2023 02:14:53 +0000
|
||||
Subject: =?utf-8?b?ITkzIOS4tOaXtuWbnumAgFjnjq/looPkuIvliqjmgIHpooTop4jnm7g=?=
|
||||
=?utf-8?b?5YWzIE1lcmdlIHB1bGwgcmVxdWVzdCAhOTMgZnJvbSDljZzokKfluoYveHFtbA==?=
|
||||
|
||||
---
|
||||
plugin-taskbar/ukuitaskbar.cpp | 2 +-
|
||||
plugin-taskbar/ukuitaskwidget.cpp | 64 +++++++++++++++++++--------------------
|
||||
plugin-taskbar/ukuitaskwidget.h | 6 ++--
|
||||
3 files changed, 36 insertions(+), 36 deletions(-)
|
||||
|
||||
diff --git a/plugin-taskbar/ukuitaskbar.cpp b/plugin-taskbar/ukuitaskbar.cpp
|
||||
index c00b13a..ffef1e0 100644
|
||||
--- a/plugin-taskbar/ukuitaskbar.cpp
|
||||
+++ b/plugin-taskbar/ukuitaskbar.cpp
|
||||
@@ -335,7 +335,7 @@ void UKUITaskBar::refreshQuickLaunch()
|
||||
QStringList groupname = user_qsettings.childGroups();
|
||||
//为了兼容3.0版本和3.1版本,3.0版本的固定应用信息在quicklaunch里,3.1版本在taskbar里
|
||||
//备份还原时需要quicklaunch字段,故不能删除
|
||||
- if (apps.isEmpty() && groupname.contains("quicklaunch")) {
|
||||
+ if (apps.isEmpty() && groupname.contains("quicklaunch") && !groupname.contains("taskbar")) {
|
||||
apps = copyQuicklaunchConfig();
|
||||
}
|
||||
addButtonForQuicklanch(apps);
|
||||
diff --git a/plugin-taskbar/ukuitaskwidget.cpp b/plugin-taskbar/ukuitaskwidget.cpp
|
||||
index 017332b..fc1f08d 100644
|
||||
--- a/plugin-taskbar/ukuitaskwidget.cpp
|
||||
+++ b/plugin-taskbar/ukuitaskwidget.cpp
|
||||
@@ -116,26 +116,26 @@ UKUITaskWidget::UKUITaskWidget(const WindowId& window, UKUITaskBar * taskbar, QW
|
||||
connect(m_closeBtn, SIGNAL(sigClicked()), this, SLOT(closeSdkApplication()));
|
||||
//qml动态预览
|
||||
getSysTransparency();
|
||||
- m_tempView = new QQuickView();
|
||||
- m_tempView->setSource(QUrl("qrc:/qml/PreviewItem.qml"));
|
||||
- m_tempView->setResizeMode(QQuickView::SizeRootObjectToView);
|
||||
- QSurfaceFormat surfaceFormat;
|
||||
- surfaceFormat.setAlphaBufferSize(8);//设置透明通道位数
|
||||
- m_tempView->setFormat(surfaceFormat);
|
||||
- m_tempView->setClearBeforeRendering(true);
|
||||
- if (m_tempView->rendererInterface()->graphicsApi() < 2) {
|
||||
- m_canUseOpenGL = false;
|
||||
- }
|
||||
-
|
||||
- m_thumbnailPreview = QWidget::createWindowContainer(m_tempView, this);
|
||||
- m_thumbnailPreview->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||
-
|
||||
- m_tempItem = m_tempView->rootObject();
|
||||
- // emit in qml
|
||||
- QObject::connect(m_tempItem, SIGNAL(sendWinId()), this, SLOT(raiseSdkApplication()));
|
||||
- QObject::connect(m_tempItem, SIGNAL(sendMoveEntered()), this, SLOT(keepShow()));
|
||||
- QObject::connect(m_tempItem, SIGNAL(sendMoveLeaved()), this, SLOT(keepLeave()));
|
||||
- QObject::connect(m_tempItem, SIGNAL(sendRightButtonClicked()), this, SLOT(rightButtonMenu()));
|
||||
+// m_tempView = new QQuickView();
|
||||
+// m_tempView->setSource(QUrl("qrc:/qml/PreviewItem.qml"));
|
||||
+// m_tempView->setResizeMode(QQuickView::SizeRootObjectToView);
|
||||
+// QSurfaceFormat surfaceFormat;
|
||||
+// surfaceFormat.setAlphaBufferSize(8);//设置透明通道位数
|
||||
+// m_tempView->setFormat(surfaceFormat);
|
||||
+// m_tempView->setClearBeforeRendering(true);
|
||||
+// if (m_tempView->rendererInterface()->graphicsApi() < 2) {
|
||||
+// m_canUseOpenGL = false;
|
||||
+// }
|
||||
+
|
||||
+// m_thumbnailPreview = QWidget::createWindowContainer(m_tempView, this);
|
||||
+// m_thumbnailPreview->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||
+
|
||||
+// m_tempItem = m_tempView->rootObject();
|
||||
+// // emit in qml
|
||||
+// QObject::connect(m_tempItem, SIGNAL(sendWinId()), this, SLOT(raiseSdkApplication()));
|
||||
+// QObject::connect(m_tempItem, SIGNAL(sendMoveEntered()), this, SLOT(keepShow()));
|
||||
+// QObject::connect(m_tempItem, SIGNAL(sendMoveLeaved()), this, SLOT(keepLeave()));
|
||||
+// QObject::connect(m_tempItem, SIGNAL(sendRightButtonClicked()), this, SLOT(rightButtonMenu()));
|
||||
|
||||
m_timer->setTimerType(Qt::PreciseTimer);
|
||||
connect(m_timer, SIGNAL(timeout()), SLOT(sendSigToKwin()));
|
||||
@@ -546,20 +546,20 @@ void UKUITaskWidget::addThumbNail()
|
||||
|
||||
void UKUITaskWidget::setLiveThumbNail(int w, int h)
|
||||
{
|
||||
- QColor col;
|
||||
- col = this->palette().color(QPalette::Window);
|
||||
- col.setAlphaF(m_transparency);
|
||||
- m_tempView->setColor(col);
|
||||
+// QColor col;
|
||||
+// col = this->palette().color(QPalette::Window);
|
||||
+// col.setAlphaF(m_transparency);
|
||||
+// m_tempView->setColor(col);
|
||||
|
||||
- m_tempRecl = m_tempItem->findChild<QObject *>("tmpWindowThumbnail");
|
||||
- m_tempRecl->setProperty("winId", m_sdkWindow.toInt());
|
||||
- m_thumbnailPreview->setFixedSize(w,h);
|
||||
- m_vWindowsLayout->addWidget(m_thumbnailPreview);
|
||||
+// m_tempRecl = m_tempItem->findChild<QObject *>("tmpWindowThumbnail");
|
||||
+// m_tempRecl->setProperty("winId", m_sdkWindow.toInt());
|
||||
+// m_thumbnailPreview->setFixedSize(w,h);
|
||||
+// m_vWindowsLayout->addWidget(m_thumbnailPreview);
|
||||
|
||||
- float tmp_imgWidth = w;
|
||||
- float tmp_imgHeight = h;
|
||||
- QObject *pRect = m_tempView->findChild<QObject *>("rect1");
|
||||
- QMetaObject::invokeMethod(pRect, "setValue", Q_ARG(QVariant, QVariant(tmp_imgWidth)), Q_ARG(QVariant, QVariant(tmp_imgHeight)));
|
||||
+// float tmp_imgWidth = w;
|
||||
+// float tmp_imgHeight = h;
|
||||
+// QObject *pRect = m_tempView->findChild<QObject *>("rect1");
|
||||
+// QMetaObject::invokeMethod(pRect, "setValue", Q_ARG(QVariant, QVariant(tmp_imgWidth)), Q_ARG(QVariant, QVariant(tmp_imgHeight)));
|
||||
|
||||
}
|
||||
|
||||
diff --git a/plugin-taskbar/ukuitaskwidget.h b/plugin-taskbar/ukuitaskwidget.h
|
||||
index c2db754..bd0de94 100644
|
||||
--- a/plugin-taskbar/ukuitaskwidget.h
|
||||
+++ b/plugin-taskbar/ukuitaskwidget.h
|
||||
@@ -127,9 +127,9 @@ private:
|
||||
|
||||
QProcess *m_cmdProcess;
|
||||
QWidget *m_thumbnailPreview = nullptr;
|
||||
- QQuickView *m_tempView;
|
||||
- QObject *m_tempItem;
|
||||
- QObject *m_tempRecl;
|
||||
+// QQuickView *m_tempView;
|
||||
+// QObject *m_tempItem;
|
||||
+// QObject *m_tempRecl;
|
||||
bool m_canUseOpenGL = true;
|
||||
|
||||
QGSettings *m_transparencyGsettings;
|
|
@ -0,0 +1,55 @@
|
|||
From: =?utf-8?b?5Y2c6JCn5bqG?= <9500352+nicole_123@user.noreply.gitee.com>
|
||||
Date: Thu, 3 Aug 2023 10:15:28 +0000
|
||||
Subject: =?utf-8?b?ITk0IOino+WGs+aXpeWOhuWPs+mUruiPnOWNleaYvuekuuS9jee9rg==?=
|
||||
=?utf-8?b?5byC5bi45LiU5pyJ5qCH6aKY5qCP6Zeu6aKYIE1lcmdlIHB1bGwgcmVxdWVzdCAh?=
|
||||
=?utf-8?b?OTQgZnJvbSB6aGFpa2FuZ25pbmcvZml4LSNJN0RCVU0=?=
|
||||
|
||||
---
|
||||
plugin-calendar/calendarbutton.cpp | 6 ++----
|
||||
plugin-calendar/calendarbuttontext.cpp | 4 ++--
|
||||
2 files changed, 4 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/plugin-calendar/calendarbutton.cpp b/plugin-calendar/calendarbutton.cpp
|
||||
index 1e61b5c..634b440 100644
|
||||
--- a/plugin-calendar/calendarbutton.cpp
|
||||
+++ b/plugin-calendar/calendarbutton.cpp
|
||||
@@ -66,9 +66,7 @@ CalendarButton::CalendarButton(IUKUIPanelPlugin *plugin, QWidget *parent):
|
||||
//设置按钮样式和属性
|
||||
this->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||
this->setFlat(true);
|
||||
- /*按钮边距固定0px,尽可能多显示日期信息。CalendarButton不继承ToolButton的原因就是
|
||||
- 主题框架提供的ToolButton的边距是固定值,无法修改*/
|
||||
- this->setStyleSheet("padding: 0px;}");
|
||||
+
|
||||
const QByteArray id(ORG_UKUI_STYLE);
|
||||
if (QGSettings::isSchemaInstalled(id)) {
|
||||
m_styleGsettings = new QGSettings(id);
|
||||
@@ -128,7 +126,7 @@ CalendarButton::~CalendarButton()
|
||||
|
||||
void CalendarButton::contextMenuEvent(QContextMenuEvent *event)
|
||||
{
|
||||
- m_menuCalender = new QMenu();
|
||||
+ m_menuCalender = new QMenu(this);
|
||||
m_menuCalender->setAttribute(Qt::WA_DeleteOnClose);
|
||||
m_menuCalender->setGeometry(m_plugin->panel()->calculatePopupWindowPos
|
||||
(mapToGlobal(event->pos()),
|
||||
diff --git a/plugin-calendar/calendarbuttontext.cpp b/plugin-calendar/calendarbuttontext.cpp
|
||||
index c58cca4..5b9dc45 100644
|
||||
--- a/plugin-calendar/calendarbuttontext.cpp
|
||||
+++ b/plugin-calendar/calendarbuttontext.cpp
|
||||
@@ -185,13 +185,13 @@ void CalendarButtonText::setOptimalFont(QStringList textList, int btnMaxLength)
|
||||
|
||||
//判断最长字体的是否可以显示下,选取最优字体
|
||||
int maxFontWidth = fontMetrics.width(textList.at(maxIndex));
|
||||
- if(maxFontWidth > btnMaxLength-INSIDE_SPAC) {
|
||||
+ if(maxFontWidth > (btnMaxLength - INSIDE_SPAC*2)) {
|
||||
int index = systemFonts.indexOf(fontSizeCurrent);
|
||||
if(index>0) {
|
||||
for(int i=index-1; i>=0; i--) {
|
||||
QFontMetrics fontMetrics(QFont(systemFont, systemFonts.at(i)));
|
||||
int width = fontMetrics.width(textList.at(maxIndex));
|
||||
- if(width <= btnMaxLength-INSIDE_SPAC) {
|
||||
+ if(width <= (btnMaxLength - INSIDE_SPAC*2)) {
|
||||
m_parent->setFont(QFont(systemFont, systemFonts.at(i)));
|
||||
break;
|
||||
}
|
|
@ -0,0 +1,83 @@
|
|||
From: Mouse Zhang <mousezhang@openkylin.top>
|
||||
Date: Thu, 24 Aug 2023 10:38:12 +0800
|
||||
Subject: chore(changelog): update changelog 4.0.0.0-ok0.13
|
||||
|
||||
---
|
||||
panel/ukuipanel.cpp | 16 +++++++++++++++-
|
||||
plugin-taskbar/ukuitaskgroup.cpp | 22 +++++++++++-----------
|
||||
2 files changed, 26 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/panel/ukuipanel.cpp b/panel/ukuipanel.cpp
|
||||
index cc86e39..81794cd 100644
|
||||
--- a/panel/ukuipanel.cpp
|
||||
+++ b/panel/ukuipanel.cpp
|
||||
@@ -451,7 +451,20 @@ void UKUIPanel::ensureVisible()
|
||||
void UKUIPanel::primaryChangedSlot(int x, int y, int w, int h, int r)
|
||||
{
|
||||
qDebug() << " primaryChanged from USD " << x << y << w << h << r;
|
||||
- m_primaryScreenGeometry = QRect(x, y, w, h);
|
||||
+ if (QGuiApplication::screens().size() < 1) {
|
||||
+ qWarning() << "No Valid Screen !!!";
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ if (QGuiApplication::screens().at(0)->geometry().width() != w
|
||||
+ || QGuiApplication::screens().at(0)->geometry().height() != h)
|
||||
+ {
|
||||
+ qWarning() << "The Screen size obtained from USD and QGuiApplication dose not match,Follow QGuiApplication !!";
|
||||
+ qWarning() << "---------From USD " << x << y << w << h << r;
|
||||
+ qWarning() << "---------From QGuiApplication " << QGuiApplication::screens().at(0)->geometry();
|
||||
+ }
|
||||
+
|
||||
+ m_primaryScreenGeometry = QGuiApplication::screens().at(0)->geometry();
|
||||
realign();
|
||||
}
|
||||
|
||||
@@ -651,6 +664,7 @@ void UKUIPanel::setPanelGeometry(bool animate)
|
||||
kdk::WindowManager::setGeometry(this->windowHandle(), rect);
|
||||
}
|
||||
}
|
||||
+
|
||||
QDBusMessage message =QDBusMessage::createSignal("/panel/position", "org.ukui.panel", "UKuiPanelPosition");
|
||||
QList<QVariant> args;
|
||||
args.append(m_primaryScreenGeometry.x());
|
||||
diff --git a/plugin-taskbar/ukuitaskgroup.cpp b/plugin-taskbar/ukuitaskgroup.cpp
|
||||
index 1855969..800cbd8 100644
|
||||
--- a/plugin-taskbar/ukuitaskgroup.cpp
|
||||
+++ b/plugin-taskbar/ukuitaskgroup.cpp
|
||||
@@ -189,9 +189,9 @@ void UKUITaskGroup::AddtoTaskBar()
|
||||
************************************************/
|
||||
void UKUITaskGroup::closeGroup()
|
||||
{
|
||||
- for (UKUISdkTaskButtonHash::const_iterator it = m_sdkButtonHash.begin(); it != m_sdkButtonHash.end(); ++it) {
|
||||
- WindowManager::closeWindow(it.key());
|
||||
- }
|
||||
+ for (UKUISdkTaskButtonHash::const_iterator it = m_sdkButtonHash.begin(); it != m_sdkButtonHash.end();) {
|
||||
+ WindowManager::closeWindow(it++.key());
|
||||
+ }
|
||||
}
|
||||
|
||||
/************************************************
|
||||
@@ -654,14 +654,14 @@ void UKUITaskGroup::showPreviewMode()
|
||||
m_popup->showPreviewMode();
|
||||
} else {
|
||||
qDebug() << "Now Is Wayland Environment";
|
||||
- if (!m_waylandPopup) {
|
||||
- m_waylandPopup = new WaylandPreviewPopup(this);
|
||||
- m_waylandPopup->addWaylandPreviewToPopup(m_windowIdList);
|
||||
- m_waylandPopup->show();
|
||||
- } else {
|
||||
- m_waylandPopup->addWaylandPreviewToPopup(m_windowIdList);
|
||||
- m_waylandPopup->show();
|
||||
- }
|
||||
+// if (!m_waylandPopup) {
|
||||
+// m_waylandPopup = new WaylandPreviewPopup(this);
|
||||
+// m_waylandPopup->addWaylandPreviewToPopup(m_windowIdList);
|
||||
+// m_waylandPopup->show();
|
||||
+// } else {
|
||||
+// m_waylandPopup->addWaylandPreviewToPopup(m_windowIdList);
|
||||
+// m_waylandPopup->show();
|
||||
+// }
|
||||
}
|
||||
|
||||
}
|
146435
debian/patches/0014-chore-changelog-update-changelog-4.0.0.0-ok0.14.patch
vendored
Normal file
146435
debian/patches/0014-chore-changelog-update-changelog-4.0.0.0-ok0.14.patch
vendored
Normal file
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,33 @@
|
|||
From: buxiaoqing <buxiaoqing@kylinos.cn>
|
||||
Date: Wed, 20 Dec 2023 15:01:31 +0800
|
||||
Subject: =?utf-8?b?Zml4KGJ1dHRvbik66Kej5Yaz5b6u5L+h5omT5byA6ZO+5o6l5ZCO5oyJ?=
|
||||
=?utf-8?b?6ZKu5ZKM6aKE6KeI5Zu+5pi+56S65byC5bi46Zeu6aKY77yII0k4UFhRRO+8iQ==?=
|
||||
|
||||
---
|
||||
panel/img/ukui-panel-symbolic.svg | 1 +
|
||||
plugin-taskbar/ukuitaskbar.cpp | 3 +++
|
||||
2 files changed, 4 insertions(+)
|
||||
create mode 100644 panel/img/ukui-panel-symbolic.svg
|
||||
|
||||
diff --git a/panel/img/ukui-panel-symbolic.svg b/panel/img/ukui-panel-symbolic.svg
|
||||
new file mode 100644
|
||||
index 0000000..d1add60
|
||||
--- /dev/null
|
||||
+++ b/panel/img/ukui-panel-symbolic.svg
|
||||
@@ -0,0 +1 @@
|
||||
+<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M12.67,1H3.33A2.33,2.33,0,0,0,1,3.33v9.34A2.33,2.33,0,0,0,3.33,15h9.34A2.33,2.33,0,0,0,15,12.67V3.33A2.33,2.33,0,0,0,12.67,1ZM2,11V3.33A1.34,1.34,0,0,1,3.33,2h9.34A1.34,1.34,0,0,1,14,3.33V11Z" fill="#262626"/></svg>
|
||||
\ No newline at end of file
|
||||
diff --git a/plugin-taskbar/ukuitaskbar.cpp b/plugin-taskbar/ukuitaskbar.cpp
|
||||
index e29cdd4..33aad6d 100644
|
||||
--- a/plugin-taskbar/ukuitaskbar.cpp
|
||||
+++ b/plugin-taskbar/ukuitaskbar.cpp
|
||||
@@ -571,6 +571,9 @@ void UKUITaskBar::onWindowAdded(const WindowId& window)
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < m_groupList.size(); i++) {
|
||||
+ if (!m_groupList.at(i)->getGroupName().isEmpty() && m_groupList.at(i)->getGroupName() != groupName) {
|
||||
+ continue;
|
||||
+ }
|
||||
if (m_groupList.at(i)->getGroupName() == groupName) {
|
||||
qDebug() << "this app has been opened";
|
||||
m_groupList.at(i)->addWindow(window);
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,68 @@
|
|||
From: buxiaoqing <buxiaoqing@kylinos.cn>
|
||||
Date: Fri, 12 Jan 2024 16:40:01 +0800
|
||||
Subject: chore(changelog): update changelog 4.0.0.0-ok0.17
|
||||
|
||||
---
|
||||
panel/plugin.cpp | 3 +--
|
||||
panel/ukuipanel.cpp | 24 +++++++++++++++---------
|
||||
2 files changed, 16 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/panel/plugin.cpp b/panel/plugin.cpp
|
||||
index 7306c45..34bd38d 100644
|
||||
--- a/panel/plugin.cpp
|
||||
+++ b/panel/plugin.cpp
|
||||
@@ -341,8 +341,7 @@ void Plugin::mouseDoubleClickEvent(QMouseEvent*)
|
||||
************************************************/
|
||||
void Plugin::showEvent(QShowEvent *)
|
||||
{
|
||||
- if (m_pluginWidget)
|
||||
- m_pluginWidget->adjustSize();
|
||||
+ realign();
|
||||
}
|
||||
|
||||
|
||||
diff --git a/panel/ukuipanel.cpp b/panel/ukuipanel.cpp
|
||||
index 81794cd..5463419 100644
|
||||
--- a/panel/ukuipanel.cpp
|
||||
+++ b/panel/ukuipanel.cpp
|
||||
@@ -252,25 +252,31 @@ UKUIPanel::UKUIPanel(const QString &configGroup, UKUi::Settings *settings, QWidg
|
||||
if (m_gsettingsKeys.contains(HIDE_PANEL_KEY)) {
|
||||
m_hidable = m_gsettings->get(HIDE_PANEL_KEY).toBool();
|
||||
}
|
||||
+ if (m_gsettingsKeys.contains(LOCK_PANEL_KEY)) {
|
||||
+ m_lockPanel = m_gsettings->get(LOCK_PANEL_KEY).toBool();
|
||||
+ }
|
||||
connect(m_gsettings, &QGSettings::changed, this, [=] (const QString &key){
|
||||
- if(key == ICON_SIZE_KEY) {
|
||||
- setIconSize(m_gsettings->get(ICON_SIZE_KEY).toInt(),true);
|
||||
+ if (key == ICON_SIZE_KEY) {
|
||||
+ setIconSize(m_gsettings->get(ICON_SIZE_KEY).toInt(), true);
|
||||
}
|
||||
- if(key == PANEL_SIZE_KEY) {
|
||||
- setPanelSize(m_gsettings->get(PANEL_SIZE_KEY).toInt(),true);
|
||||
+ if (key == PANEL_SIZE_KEY) {
|
||||
+ setPanelSize(m_gsettings->get(PANEL_SIZE_KEY).toInt(), true);
|
||||
}
|
||||
- if(key == PANEL_POSITION_KEY) {
|
||||
- setPosition(0,intToPosition(m_gsettings->get(PANEL_POSITION_KEY).toInt(),PositionBottom),true);
|
||||
+ if (key == PANEL_POSITION_KEY) {
|
||||
+ setPosition(0, intToPosition(m_gsettings->get(PANEL_POSITION_KEY).toInt(), PositionBottom), true);
|
||||
}
|
||||
- if(key == HIDE_PANEL_KEY) {
|
||||
+ if (key == HIDE_PANEL_KEY) {
|
||||
m_hidable = !m_gsettings->get(HIDE_PANEL_KEY).toBool();
|
||||
- if(m_hidable)
|
||||
+ if (m_hidable)
|
||||
m_hideTimer.stop();
|
||||
- setHidable(!m_hidable,true);
|
||||
+ setHidable(!m_hidable, true);
|
||||
m_hidden = m_hidable;
|
||||
m_showDelayTimer.start();
|
||||
m_time->start(1000);
|
||||
}
|
||||
+ if (key == LOCK_PANEL_KEY) {
|
||||
+ m_lockPanel = m_gsettings->get(LOCK_PANEL_KEY).toBool();
|
||||
+ }
|
||||
});
|
||||
}
|
||||
if (m_gsettingsKeys.contains(PANEL_SIZE_KEY)) {
|
66
debian/patches/0018-Merge-branch-openkylin-yangtze-of-gitee.com-openkyli.patch
vendored
Normal file
66
debian/patches/0018-Merge-branch-openkylin-yangtze-of-gitee.com-openkyli.patch
vendored
Normal file
|
@ -0,0 +1,66 @@
|
|||
From: shangxiaoyang <shangxiaoyang@kylinos.cn>
|
||||
Date: Wed, 17 Jan 2024 07:06:58 +0000
|
||||
Subject: Merge branch 'openkylin/yangtze' of gitee.com:openkylin/ukui-panel
|
||||
into openkylin/yangtze
|
||||
|
||||
Signed-off-by: shangxiaoyang <shangxiaoyang@kylinos.cn>
|
||||
---
|
||||
plugin-calendar/html/jiejiari.json | 46 ++++++++++++++++++++++++++++++++++++--
|
||||
1 file changed, 44 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/plugin-calendar/html/jiejiari.json b/plugin-calendar/html/jiejiari.json
|
||||
index 7e61991..fe97252 100644
|
||||
--- a/plugin-calendar/html/jiejiari.json
|
||||
+++ b/plugin-calendar/html/jiejiari.json
|
||||
@@ -473,6 +473,48 @@
|
||||
"d1005": "2",
|
||||
"d1006": "2",
|
||||
"d1007": "1",
|
||||
- "d1008": "1"
|
||||
+ "d1008": "1",
|
||||
+ "d1230": "2",
|
||||
+ "d1231": "2"
|
||||
+ },
|
||||
+ "worktime.y2024":{
|
||||
+ "d0101": "2",
|
||||
+ "d0204": "1",
|
||||
+ "d0210": "2",
|
||||
+ "d0211": "2",
|
||||
+ "d0212": "2",
|
||||
+ "d0213": "2",
|
||||
+ "d0214": "2",
|
||||
+ "d0215": "2",
|
||||
+ "d0216": "2",
|
||||
+ "d0217": "2",
|
||||
+ "d0218": "1",
|
||||
+ "d0404": "2",
|
||||
+ "d0405": "2",
|
||||
+ "d0406": "2",
|
||||
+ "d0407": "1",
|
||||
+ "d0428": "1",
|
||||
+ "d0501": "2",
|
||||
+ "d0502": "2",
|
||||
+ "d0503": "2",
|
||||
+ "d0504": "2",
|
||||
+ "d0505": "2",
|
||||
+ "d0511": "1",
|
||||
+ "d0608": "2",
|
||||
+ "d0609": "2",
|
||||
+ "d0610": "2",
|
||||
+ "d0914": "1",
|
||||
+ "d0915": "2",
|
||||
+ "d0916": "2",
|
||||
+ "d0917": "2",
|
||||
+ "d0929": "1",
|
||||
+ "d1001": "2",
|
||||
+ "d1002": "2",
|
||||
+ "d1003": "2",
|
||||
+ "d1004": "2",
|
||||
+ "d1005": "2",
|
||||
+ "d1006": "2",
|
||||
+ "d1007": "2",
|
||||
+ "d1012": "1"
|
||||
}
|
||||
-}
|
||||
\ No newline at end of file
|
||||
+}
|
109
debian/patches/0019-fix-crossover-app-systemtray-icon-tips-and-click-err.patch
vendored
Normal file
109
debian/patches/0019-fix-crossover-app-systemtray-icon-tips-and-click-err.patch
vendored
Normal file
|
@ -0,0 +1,109 @@
|
|||
From: guorongfei <guorongfei@cvte.com>
|
||||
Date: Wed, 17 Jan 2024 10:58:58 +0800
|
||||
Subject: fix: crossover app systemtray icon tips and click error
|
||||
|
||||
---
|
||||
.../convertdesktoptowinid.cpp | 8 ++++--
|
||||
sni-xembed-proxy/main.cpp | 7 +++++
|
||||
sni-xembed-proxy/sniproxy.cpp | 31 ++++++++++++----------
|
||||
3 files changed, 30 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/panel-daemon/convert-desktop-windowid/convertdesktoptowinid.cpp b/panel-daemon/convert-desktop-windowid/convertdesktoptowinid.cpp
|
||||
index 76feccb..1488a7b 100644
|
||||
--- a/panel-daemon/convert-desktop-windowid/convertdesktoptowinid.cpp
|
||||
+++ b/panel-daemon/convert-desktop-windowid/convertdesktoptowinid.cpp
|
||||
@@ -37,8 +37,8 @@ QString ConvertDesktopToWinId::tranIdToDesktop(int winId)
|
||||
int ConvertDesktopToWinId::getPidFromInfo(int winId)
|
||||
{
|
||||
//x环境下输入wid转成pid, wayland下windowId转pid
|
||||
- KWindowInfo info(winId, 0, NET::WM2AllProperties);
|
||||
- if (info.valid()) {
|
||||
+ KWindowInfo info(winId, NET::WMPid);
|
||||
+ if (info.valid(/* withdrawn_is_valid = */ true)) {
|
||||
m_pid = info.pid();
|
||||
} else {
|
||||
m_pid = kdk::WindowManager::getPid(winId);
|
||||
@@ -49,6 +49,10 @@ int ConvertDesktopToWinId::getPidFromInfo(int winId)
|
||||
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();
|
||||
diff --git a/sni-xembed-proxy/main.cpp b/sni-xembed-proxy/main.cpp
|
||||
index 384c2a6..4626768 100644
|
||||
--- a/sni-xembed-proxy/main.cpp
|
||||
+++ b/sni-xembed-proxy/main.cpp
|
||||
@@ -32,6 +32,13 @@ namespace Xcb {
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
+ QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
||||
+ QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
|
||||
+
|
||||
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
|
||||
+ QApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
|
||||
+#endif
|
||||
+
|
||||
initUkuiLog4qt("sni-xembed-proxy");
|
||||
/*单例+vnc模式*/
|
||||
QStringList homePath = QStandardPaths::standardLocations(QStandardPaths::HomeLocation);
|
||||
diff --git a/sni-xembed-proxy/sniproxy.cpp b/sni-xembed-proxy/sniproxy.cpp
|
||||
index fccb9be..e12d0a9 100755
|
||||
--- a/sni-xembed-proxy/sniproxy.cpp
|
||||
+++ b/sni-xembed-proxy/sniproxy.cpp
|
||||
@@ -571,6 +571,12 @@ void SNIProxy::sendClick(uint8_t mouseButton, int x, int y)
|
||||
//note x,y are not actually where the mouse is, but the plasmoid
|
||||
//ideally we should make this match the plasmoid hit area
|
||||
|
||||
+ // ukui-panel (StatusNotifierHost) send scaled x, y. but pointer get from xcb is not.
|
||||
+ // rescale input x, y to make sure the calculate work with highdpi sacle.
|
||||
+ float scale = qApp->devicePixelRatio();
|
||||
+ x = x * scale;
|
||||
+ y = y * scale;
|
||||
+
|
||||
qDebug() << "Received click" << mouseButton << "with passed x*y" << x << y;
|
||||
sendingClickEvent = true;
|
||||
|
||||
@@ -587,26 +593,23 @@ void SNIProxy::sendClick(uint8_t mouseButton, int x, int y)
|
||||
auto cookie = xcb_query_pointer(c, m_windowId);
|
||||
QScopedPointer<xcb_query_pointer_reply_t, QScopedPointerPodDeleter>
|
||||
pointer(xcb_query_pointer_reply(c, cookie, nullptr));
|
||||
- /*qCDebug(SNIPROXY) << "samescreen" << pointer->same_screen << endl
|
||||
- << "root x*y" << pointer->root_x << pointer->root_y << endl
|
||||
- << "win x*y" << pointer->win_x << pointer->win_y;*/
|
||||
|
||||
//move our window so the mouse is within its geometry
|
||||
uint32_t configVals[2] = {0, 0};
|
||||
const QPoint clickPoint = calculateClickPoint();
|
||||
if (mouseButton >= XCB_BUTTON_INDEX_4) {
|
||||
- //scroll event, take pointer position
|
||||
- configVals[0] = pointer->root_x;
|
||||
- configVals[1] = pointer->root_y;
|
||||
+ //scroll event, take pointer position
|
||||
+ configVals[0] = pointer->root_x;
|
||||
+ configVals[1] = pointer->root_y;
|
||||
} else {
|
||||
- if (pointer->root_x > x + clientGeom->width)
|
||||
- configVals[0] = pointer->root_x - clientGeom->width + 1;
|
||||
- else
|
||||
- configVals[0] = static_cast<uint32_t>(x - clickPoint.x());
|
||||
- if (pointer->root_y > y + clientGeom->height)
|
||||
- configVals[1] = pointer->root_y - clientGeom->height + 1;
|
||||
- else
|
||||
- configVals[1] = static_cast<uint32_t>(y - clickPoint.y());
|
||||
+ if (pointer->root_x > x + clientGeom->width)
|
||||
+ configVals[0] = pointer->root_x - clientGeom->width + 1;
|
||||
+ else
|
||||
+ configVals[0] = static_cast<uint32_t>(x - clickPoint.x() - clientGeom->width / 2);
|
||||
+ if (pointer->root_y > y + clientGeom->height)
|
||||
+ configVals[1] = pointer->root_y - clientGeom->height + 1;
|
||||
+ else
|
||||
+ configVals[1] = static_cast<uint32_t>(y - clickPoint.y() - clientGeom->height / 2);
|
||||
}
|
||||
xcb_configure_window(c, m_containerWid, XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y, configVals);
|
||||
|
|
@ -0,0 +1,122 @@
|
|||
From: chenxuechao <chenxuechao@kylinos.cn>
|
||||
Date: Mon, 11 Dec 2023 15:36:18 +0800
|
||||
Subject: =?utf-8?b?Zml4KOaJmOebmCnvvJpvcGVuS3lsaW7lkIzmraXkuLvnur/miZjnm5g=?=
|
||||
=?utf-8?b?6Zeu6aKY5L+u5pS544CCKEJVR+WPt++8mkk3R1RBQeOAgUk3V0dHTCk=?=
|
||||
|
||||
---
|
||||
plugin-statusnotifier/statusnotiferscrollarea.cpp | 5 +++
|
||||
plugin-statusnotifier/statusnotifierbutton.cpp | 41 +++++++++++++----------
|
||||
2 files changed, 29 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/plugin-statusnotifier/statusnotiferscrollarea.cpp b/plugin-statusnotifier/statusnotiferscrollarea.cpp
|
||||
index 0b6f53d..6d1197b 100644
|
||||
--- a/plugin-statusnotifier/statusnotiferscrollarea.cpp
|
||||
+++ b/plugin-statusnotifier/statusnotiferscrollarea.cpp
|
||||
@@ -266,6 +266,11 @@ void StatusNotiferScrollArea::itemAdded(QString serviceAndPath)
|
||||
}
|
||||
}
|
||||
|
||||
+ if (m_services.contains(serviceAndPath)) {
|
||||
+ qWarning() << serviceAndPath + " has been added.";
|
||||
+ return ;
|
||||
+ }
|
||||
+
|
||||
int slash = serviceAndPath.indexOf('/');
|
||||
QString serv = serviceAndPath.left(slash);
|
||||
QString path = serviceAndPath.mid(slash);
|
||||
diff --git a/plugin-statusnotifier/statusnotifierbutton.cpp b/plugin-statusnotifier/statusnotifierbutton.cpp
|
||||
index 68dc3ed..2db1ee2 100644
|
||||
--- a/plugin-statusnotifier/statusnotifierbutton.cpp
|
||||
+++ b/plugin-statusnotifier/statusnotifierbutton.cpp
|
||||
@@ -51,6 +51,7 @@ StatusNotifierButton::StatusNotifierButton(QString service, QString objectPath,
|
||||
m_plugin(plugin)
|
||||
{
|
||||
this->setAcceptDrops(true);
|
||||
+ this->setFixedSize(m_plugin->panel()->panelSize()*0.7, m_plugin->panel()->panelSize()*0.7);
|
||||
m_interface = new SniAsync(service, objectPath, QDBusConnection::sessionBus(), this);
|
||||
|
||||
connect(m_interface, &SniAsync::NewIcon, this, &StatusNotifierButton::newIcon);
|
||||
@@ -68,9 +69,13 @@ StatusNotifierButton::StatusNotifierButton(QString service, QString objectPath,
|
||||
} else {
|
||||
if(this->m_id.isEmpty()) {
|
||||
if(m_count < 10) { //超过10次将不再获取
|
||||
- QTimer::singleShot(500,[this] {
|
||||
+ QTimer *tmpTimer = new QTimer(this);
|
||||
+ connect(tmpTimer, &QTimer::timeout, this, [=] () {
|
||||
+ tmpTimer->stop();
|
||||
hideAbleStatusNotifierButton();
|
||||
+ tmpTimer->deleteLater();
|
||||
});
|
||||
+ tmpTimer->start(500);
|
||||
qWarning()<<"Get item id for the"<<m_count<<"time";
|
||||
} else {
|
||||
qCritical()<<"count more than 10 times, "<<m_id<<m_toolTipTitle<<service<<"Load failed!";
|
||||
@@ -119,7 +124,10 @@ StatusNotifierButton::StatusNotifierButton(QString service, QString objectPath,
|
||||
|
||||
StatusNotifierButton::~StatusNotifierButton()
|
||||
{
|
||||
- delete m_interface;
|
||||
+ if (m_interface) {
|
||||
+ delete m_interface;
|
||||
+ m_interface = nullptr;
|
||||
+ }
|
||||
if(m_themeSettings) {
|
||||
delete(m_themeSettings);
|
||||
m_themeSettings = NULL;
|
||||
@@ -164,9 +172,12 @@ void StatusNotifierButton::refetchIcon(Status status)
|
||||
if (!iconName.isEmpty()) {
|
||||
if (QIcon::hasThemeIcon(iconName)) {
|
||||
nextIcon = QIcon::fromTheme(iconName);
|
||||
+ } else if (QFile(iconName).exists()) {
|
||||
+ nextIcon.addFile(iconName);
|
||||
} else {
|
||||
- if(m_themePath.isEmpty())
|
||||
+ if(m_themePath.isEmpty()) {
|
||||
m_themePath = "/usr/share/icons/";
|
||||
+ }
|
||||
QDir themeDir(m_themePath);
|
||||
if (themeDir.exists()) {
|
||||
if (themeDir.exists(iconName + ".png")) {
|
||||
@@ -342,9 +353,6 @@ void StatusNotifierButton::mouseMoveEvent(QMouseEvent *e)
|
||||
drag->deleteLater();
|
||||
refetchIcon(ACTIVE);
|
||||
}
|
||||
- QToolButton::mouseMoveEvent(e);
|
||||
-
|
||||
- //QAbstractButton::mouseMoveEvent(e);
|
||||
}
|
||||
|
||||
void StatusNotifierButton::mouseReleaseEvent(QMouseEvent *event)
|
||||
@@ -524,22 +532,21 @@ void StatusNotifierButton::leaveEvent(QEvent *event)
|
||||
|
||||
void StatusNotifierButton::paintEvent(QPaintEvent *event)
|
||||
{
|
||||
- if (m_plugin->panel()->isHorizontal()) {
|
||||
- this->setFixedSize(m_plugin->panel()->panelSize()*0.7, m_plugin->panel()->panelSize()*0.7);
|
||||
- } else {
|
||||
- this->setFixedSize(m_plugin->panel()->panelSize()*0.7, m_plugin->panel()->panelSize()*0.7);
|
||||
- }
|
||||
+ this->setFixedSize(m_plugin->panel()->panelSize()*0.7, m_plugin->panel()->panelSize()*0.7);
|
||||
QToolButton::paintEvent(event);
|
||||
}
|
||||
|
||||
QString StatusNotifierButton::hideAbleStatusNotifierButton()
|
||||
{
|
||||
- m_interface->propertyGetAsync(QLatin1String("Id"), [this] (QString title) {
|
||||
- m_id = "";
|
||||
- m_id = title;
|
||||
- emit paramReady();
|
||||
- });
|
||||
- return m_id;
|
||||
+ if (m_interface) {
|
||||
+ m_interface->propertyGetAsync(QLatin1String("Id"), [this] (QString title) {
|
||||
+ m_id = "";
|
||||
+ m_id = title;
|
||||
+ emit paramReady();
|
||||
+ });
|
||||
+ return m_id;
|
||||
+ }
|
||||
+ return QString();
|
||||
}
|
||||
|
||||
int StatusNotifierButton::getStatus()
|
|
@ -0,0 +1,93 @@
|
|||
From: jiawei <jiawei@kylinos.cn>
|
||||
Date: Mon, 29 Jan 2024 17:21:14 +0800
|
||||
Subject: =?utf-8?b?Zml45a6c5b+M5Yay56qB6Zeu6aKY?=
|
||||
|
||||
---
|
||||
plugin-calendar/html/hlnew/hl2024.json | 18 +++++++++---------
|
||||
1 file changed, 9 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/plugin-calendar/html/hlnew/hl2024.json b/plugin-calendar/html/hlnew/hl2024.json
|
||||
index 4dcc46a..320f5c3 100644
|
||||
--- a/plugin-calendar/html/hlnew/hl2024.json
|
||||
+++ b/plugin-calendar/html/hlnew/hl2024.json
|
||||
@@ -36,7 +36,7 @@
|
||||
"j": "伐木."
|
||||
},
|
||||
"d0110": {
|
||||
-"y": "搬家.装修.结婚.入宅.",
|
||||
+"y": "搬家.装修.结婚.",
|
||||
"j": "入宅."
|
||||
},
|
||||
"d0111": {
|
||||
@@ -113,7 +113,7 @@
|
||||
},
|
||||
"d0129": {
|
||||
"y": "结婚.领证.安床.出行.",
|
||||
-"j": "结婚.领证.安床.出行."
|
||||
+"j": "."
|
||||
},
|
||||
"d0130": {
|
||||
"y": "开业.开工.开张.开市.",
|
||||
@@ -305,7 +305,7 @@
|
||||
},
|
||||
"d0317": {
|
||||
"y": "搬家.开业.开工.动土.",
|
||||
-"j": "搬家.装修.入宅.安门."
|
||||
+"j": "装修.入宅.安门."
|
||||
},
|
||||
"d0318": {
|
||||
"y": "搬家.结婚.入宅.领证.",
|
||||
@@ -493,7 +493,7 @@
|
||||
},
|
||||
"d0503": {
|
||||
"y": "搬家.装修.开业.结婚.",
|
||||
-"j": "祭祀.祭祀.纳畜."
|
||||
+"j": "祭祀.纳畜."
|
||||
},
|
||||
"d0504": {
|
||||
"y": "搬家.装修.开业.结婚.",
|
||||
@@ -788,7 +788,7 @@
|
||||
"j": "."
|
||||
},
|
||||
"d0716": {
|
||||
-"y": "搬家.搬家.装修.结婚.",
|
||||
+"y": "搬家.装修.结婚.",
|
||||
"j": "开业.开工.开张.开市."
|
||||
},
|
||||
"d0717": {
|
||||
@@ -917,7 +917,7 @@
|
||||
},
|
||||
"d0817": {
|
||||
"y": "安床.订婚.安葬.理发.",
|
||||
-"j": "开业.结婚.入宅.入宅."
|
||||
+"j": "开业.结婚.入宅."
|
||||
},
|
||||
"d0818": {
|
||||
"y": "祭祀.解除.造畜稠.平治道涂.",
|
||||
@@ -1229,7 +1229,7 @@
|
||||
},
|
||||
"d1103": {
|
||||
"y": "搬家.装修.结婚.入宅.",
|
||||
-"j": "开业.入宅.开工.安门."
|
||||
+"j": "开业.开工.安门."
|
||||
},
|
||||
"d1104": {
|
||||
"y": "破屋.",
|
||||
@@ -1269,7 +1269,7 @@
|
||||
},
|
||||
"d1113": {
|
||||
"y": "入宅.安床.订婚.求嗣.",
|
||||
-"j": "安床.安葬.作灶."
|
||||
+"j": "安葬.作灶."
|
||||
},
|
||||
"d1114": {
|
||||
"y": "作灶.",
|
||||
@@ -1389,7 +1389,7 @@
|
||||
},
|
||||
"d1213": {
|
||||
"y": "入宅.安床.订婚.求嗣.",
|
||||
-"j": "安床.安葬.作灶."
|
||||
+"j": "安葬.作灶."
|
||||
},
|
||||
"d1214": {
|
||||
"y": "作灶.",
|
|
@ -0,0 +1,21 @@
|
|||
From: buxiaoqing <buxiaoqing@kylinos.cn>
|
||||
Date: Wed, 31 Jan 2024 16:00:17 +0800
|
||||
Subject: chore(changelog): update changelog 4.0.0.0-ok0.18
|
||||
|
||||
---
|
||||
plugin-calendar/calendarbutton.cpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/plugin-calendar/calendarbutton.cpp b/plugin-calendar/calendarbutton.cpp
|
||||
index 42ca346..8454a86 100644
|
||||
--- a/plugin-calendar/calendarbutton.cpp
|
||||
+++ b/plugin-calendar/calendarbutton.cpp
|
||||
@@ -131,7 +131,7 @@ CalendarButton::~CalendarButton()
|
||||
|
||||
void CalendarButton::contextMenuEvent(QContextMenuEvent *event)
|
||||
{
|
||||
- m_menuCalender = new QMenu();
|
||||
+ m_menuCalender = new QMenu(this);
|
||||
m_menuCalender->setAttribute(Qt::WA_DeleteOnClose);
|
||||
m_menuCalender->setGeometry(m_plugin->panel()->calculatePopupWindowPos
|
||||
(mapToGlobal(event->pos()),
|
|
@ -0,0 +1,278 @@
|
|||
From: cxc <chenxuechao@kylinos.cn>
|
||||
Date: Wed, 24 Jan 2024 14:26:07 +0800
|
||||
Subject: =?utf-8?b?5omY55uYIHNuaVdhdGNoZXIg5aKe5Yqg5p+l6K+icGlk5o6l5Y+j77yM?=
|
||||
=?utf-8?b?5ZCI5bm2dWt1aS1zbmnmlrnmoYg=?=
|
||||
|
||||
---
|
||||
sni-daemon/snidaemon.cpp | 86 +++++++++++++++++++++++++++----------------
|
||||
sni-daemon/snidaemon.h | 14 ++++++-
|
||||
sni-xembed-proxy/sniproxy.cpp | 31 ++++++++++++++--
|
||||
sni-xembed-proxy/sniproxy.h | 4 ++
|
||||
4 files changed, 99 insertions(+), 36 deletions(-)
|
||||
|
||||
diff --git a/sni-daemon/snidaemon.cpp b/sni-daemon/snidaemon.cpp
|
||||
index ba4d41e..2076f83 100644
|
||||
--- a/sni-daemon/snidaemon.cpp
|
||||
+++ b/sni-daemon/snidaemon.cpp
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "statusnotifieritem_interface.h"
|
||||
SniDaemon::SniDaemon()
|
||||
{
|
||||
+ qDBusRegisterMetaType<UintList>();
|
||||
QDBusConnection dbus = QDBusConnection::sessionBus();
|
||||
dbus.registerObject(QStringLiteral("/StatusNotifierWatcher"),"org.kde.StatusNotifierWatcher",this,QDBusConnection::ExportAllContents);
|
||||
dbus.registerService(QStringLiteral("org.kde.StatusNotifierWatcher"));
|
||||
@@ -38,59 +39,70 @@ SniDaemon::~SniDaemon()
|
||||
dbus.unregisterService(QStringLiteral("org.kde.StatusNotifierWatcher"));
|
||||
}
|
||||
|
||||
-
|
||||
void SniDaemon::serviceUnregistered(const QString& name)
|
||||
{
|
||||
qDebug()<<"Service "<< name << "unregistered";
|
||||
m_serviceWatcher->removeWatchedService(name);
|
||||
|
||||
QString match = name + QLatin1Char('/');
|
||||
- QStringList::Iterator it = m_registeredServices.begin();
|
||||
- qDebug()<<m_registeredServices;
|
||||
- while (it != m_registeredServices.end()) {
|
||||
- if (it->startsWith(match)) {
|
||||
- QString name = *it;
|
||||
- it = m_registeredServices.erase(it);
|
||||
- emit StatusNotifierItemUnregistered(name);
|
||||
- } else {
|
||||
- ++it;
|
||||
+ for(const QString &servicePath : m_registeredServices.keys()) {
|
||||
+ if(servicePath.startsWith(match)) {
|
||||
+ QString pid = m_registeredServices.take(servicePath);
|
||||
+ Q_EMIT StatusNotifierItemUnregistered(servicePath);
|
||||
+ if(!m_registeredServices.values().contains(pid) && pid.toUInt() > 0) {
|
||||
+ Q_EMIT StatusNotifierItemUnregistered(pid.toUInt());
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
if (m_statusNotifierHostServices.contains(name)) {
|
||||
m_statusNotifierHostServices.remove(name);
|
||||
- emit StatusNotifierHostUnregistered();
|
||||
+ Q_EMIT StatusNotifierHostUnregistered();
|
||||
}
|
||||
}
|
||||
|
||||
-void SniDaemon::RegisterStatusNotifierItem(const QString &serviceOrPath)
|
||||
+void SniDaemon::RegisterStatusNotifierItem(const QString &service)
|
||||
{
|
||||
- QString service;
|
||||
+ QString realService;
|
||||
QString path;
|
||||
- if (serviceOrPath.startsWith(QLatin1Char('/'))) {
|
||||
- service = message().service();
|
||||
- path = serviceOrPath;
|
||||
+ int slash = service.indexOf('/');
|
||||
+ if (slash == 0) {
|
||||
+ realService = message().service();
|
||||
+ path = service;
|
||||
+ } else if (slash > 0){
|
||||
+ realService = service.left(slash);
|
||||
+ path = service.mid(slash);
|
||||
} else {
|
||||
- service = serviceOrPath;
|
||||
+ realService = service;
|
||||
path = QStringLiteral("/StatusNotifierItem");
|
||||
}
|
||||
- QString notifierItemId = service + path;
|
||||
+ QString notifierItemId = realService + path;
|
||||
if (m_registeredServices.contains(notifierItemId)) {
|
||||
return;
|
||||
}
|
||||
- m_serviceWatcher->addWatchedService(service);
|
||||
- if (QDBusConnection::sessionBus().interface()->isServiceRegistered(service).value()) {
|
||||
- //check if the service has registered a SystemTray object
|
||||
- org::kde::StatusNotifierItem trayclient(service, path, QDBusConnection::sessionBus());
|
||||
- if (trayclient.isValid()) {
|
||||
+ if (QDBusConnection::sessionBus().interface()->isServiceRegistered(realService).value()) {
|
||||
+ org::kde::StatusNotifierItem item(realService, path, QDBusConnection::sessionBus());
|
||||
+ if (item.isValid()) {
|
||||
qDebug() << "Registering" << notifierItemId << "to system tray";
|
||||
- m_registeredServices.append(notifierItemId);
|
||||
- emit StatusNotifierItemRegistered(notifierItemId);
|
||||
- } else {
|
||||
- m_serviceWatcher->removeWatchedService(service);
|
||||
+ m_serviceWatcher->addWatchedService(service);
|
||||
+ QString pid = "0";
|
||||
+ if (realService.contains(QStringLiteral("org.ukui.proxy.StatusNotifierItem"))) {
|
||||
+ QString pidStr = realService.section("-", 1, 1);
|
||||
+ if (!pidStr.isEmpty()) {
|
||||
+ pid = pidStr;
|
||||
+ }
|
||||
+ } else {
|
||||
+ QDBusReply<uint> pidReply = connection().interface()->servicePid(message().service());
|
||||
+ if (pidReply.isValid()) {
|
||||
+ pid = QString::number(pidReply.value());
|
||||
+ }
|
||||
+ }
|
||||
+ m_registeredServices.insert(notifierItemId, pid);
|
||||
+ Q_EMIT StatusNotifierItemRegistered(notifierItemId);
|
||||
+ if (pid.toUInt() > 0) {
|
||||
+ Q_EMIT StatusNotifierItemRegistered(pid.toUInt());
|
||||
+ }
|
||||
}
|
||||
- } else {
|
||||
- m_serviceWatcher->removeWatchedService(service);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,13 +115,25 @@ void SniDaemon::RegisterStatusNotifierHost(const QString &service)
|
||||
|
||||
m_statusNotifierHostServices.insert(service);
|
||||
m_serviceWatcher->addWatchedService(service);
|
||||
- emit StatusNotifierHostRegistered();
|
||||
+ Q_EMIT StatusNotifierHostRegistered();
|
||||
}
|
||||
}
|
||||
|
||||
QStringList SniDaemon::RegisteredStatusNotifierItems() const
|
||||
{
|
||||
- return m_registeredServices;
|
||||
+ return m_registeredServices.keys();
|
||||
+}
|
||||
+
|
||||
+UintList SniDaemon::RegisteredStatusNotifierItemPids() const
|
||||
+{
|
||||
+ QStringList pidList = m_registeredServices.values();
|
||||
+ pidList.removeDuplicates();
|
||||
+ pidList.removeAll("0");
|
||||
+ UintList pids;
|
||||
+ for (const QString &pid : pidList) {
|
||||
+ pids.append(pid.toInt());
|
||||
+ }
|
||||
+ return pids;
|
||||
}
|
||||
|
||||
bool SniDaemon::IsStatusNotifierHostRegistered() const
|
||||
diff --git a/sni-daemon/snidaemon.h b/sni-daemon/snidaemon.h
|
||||
index cc1f3fc..3b69f65 100644
|
||||
--- a/sni-daemon/snidaemon.h
|
||||
+++ b/sni-daemon/snidaemon.h
|
||||
@@ -20,14 +20,21 @@
|
||||
#define SNIDAEMON_H
|
||||
|
||||
#include <QtDBus/QtDBus>
|
||||
+#include <QMetaType>
|
||||
#include <QStringList>
|
||||
#include <QDBusAbstractInterface>
|
||||
+#include <QList>
|
||||
+
|
||||
+typedef QList<quint32> UintList;
|
||||
+Q_DECLARE_METATYPE(UintList)
|
||||
+
|
||||
class SniDaemon : public QObject, protected QDBusContext
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_CLASSINFO("D-Bus Interface", "org.kde.StatusNotifierWatcher")
|
||||
|
||||
Q_PROPERTY(QStringList RegisteredStatusNotifierItems READ RegisteredStatusNotifierItems)
|
||||
+ Q_PROPERTY(UintList RegisteredStatusNotifierItemPids READ RegisteredStatusNotifierItemPids)
|
||||
Q_PROPERTY(bool IsStatusNotifierHostRegistered READ IsStatusNotifierHostRegistered)
|
||||
Q_PROPERTY(int ProtocolVersion READ ProtocolVersion)
|
||||
public:
|
||||
@@ -35,7 +42,7 @@ public:
|
||||
~SniDaemon();
|
||||
|
||||
QStringList RegisteredStatusNotifierItems() const;
|
||||
-
|
||||
+ UintList RegisteredStatusNotifierItemPids() const;
|
||||
bool IsStatusNotifierHostRegistered() const;
|
||||
|
||||
int ProtocolVersion() const;
|
||||
@@ -46,7 +53,8 @@ public Q_SLOTS:
|
||||
|
||||
private:
|
||||
QDBusServiceWatcher *m_serviceWatcher = nullptr;
|
||||
- QStringList m_registeredServices;
|
||||
+// QStringList m_registeredServices;
|
||||
+ QMultiMap<QString, QString> m_registeredServices;
|
||||
QSet<QString> m_statusNotifierHostServices;
|
||||
|
||||
Q_SIGNALS:
|
||||
@@ -54,6 +62,8 @@ Q_SIGNALS:
|
||||
void StatusNotifierItemUnregistered(const QString &service);
|
||||
void StatusNotifierHostRegistered();
|
||||
void StatusNotifierHostUnregistered();
|
||||
+ void StatusNotifierItemRegistered(quint32 pid);
|
||||
+ void StatusNotifierItemUnregistered(quint32 pid);
|
||||
|
||||
protected Q_SLOTS:
|
||||
void serviceUnregistered(const QString& name);
|
||||
diff --git a/sni-xembed-proxy/sniproxy.cpp b/sni-xembed-proxy/sniproxy.cpp
|
||||
index e12d0a9..6e8edaf 100755
|
||||
--- a/sni-xembed-proxy/sniproxy.cpp
|
||||
+++ b/sni-xembed-proxy/sniproxy.cpp
|
||||
@@ -100,13 +100,24 @@ SNIProxy::SNIProxy(xcb_window_t wid, QObject* parent):
|
||||
qDBusRegisterMetaType<KDbusImageStruct>();
|
||||
qRegisterMetaType<KDbusImageVector>("KDbusImageVector");
|
||||
qDBusRegisterMetaType<KDbusImageVector>();
|
||||
-
|
||||
+ uint pid = getPid(m_windowId);
|
||||
+ QString serviceName;
|
||||
+ if(pid > 0) {
|
||||
+ uint count = 0;
|
||||
+ if(m_pidToProxyCount.contains(pid)) {
|
||||
+ count = m_pidToProxyCount.value(pid) + 1;
|
||||
+ m_pidToProxyCount.insert(pid, count);
|
||||
+ } else {
|
||||
+ m_pidToProxyCount.insert(pid, 1);
|
||||
+ }
|
||||
+ serviceName = QStringLiteral("org.ukui.proxy.StatusNotifierItem-") + QString::number(pid) + QStringLiteral("-") + QString::number(count);
|
||||
+ m_dbus.registerService(serviceName);
|
||||
+ }
|
||||
m_dbus.registerObject(QStringLiteral("/StatusNotifierItem"), this,QDBusConnection::ExportAllContents);
|
||||
|
||||
-
|
||||
auto statusNotifierWatcher = new org::kde::StatusNotifierWatcher(QStringLiteral(SNI_WATCHER_SERVICE_NAME), QStringLiteral(SNI_WATCHER_PATH), QDBusConnection::sessionBus(), this);
|
||||
qDebug()<<"sni-proxy:RegisterStatusNotifierItem = " <<m_dbus.baseService();
|
||||
- auto reply = statusNotifierWatcher->RegisterStatusNotifierItem(m_dbus.baseService());
|
||||
+ auto reply = statusNotifierWatcher->RegisterStatusNotifierItem(serviceName.isEmpty()? m_dbus.baseService() : serviceName);
|
||||
reply.waitForFinished();
|
||||
if (reply.isError()) {
|
||||
qWarning() << "could not register SNI:" << reply.error().message();
|
||||
@@ -673,3 +684,17 @@ void SNIProxy::sendClick(uint8_t mouseButton, int x, int y)
|
||||
|
||||
sendingClickEvent = false;
|
||||
}
|
||||
+
|
||||
+uint SNIProxy::getPid(const xcb_window_t windowId)
|
||||
+{
|
||||
+ xcb_intern_atom_cookie_t cookie1 = xcb_intern_atom(QX11Info::connection(), false, 11, "_NET_WM_PID");
|
||||
+ xcb_intern_atom_reply_t *reply1 = xcb_intern_atom_reply(QX11Info::connection(), cookie1, nullptr);
|
||||
+ m_pidAtom = reply1->atom;
|
||||
+ free(reply1);
|
||||
+ xcb_get_property_cookie_t cookie2 = xcb_get_property(QX11Info::connection(), false, windowId, m_pidAtom, XCB_ATOM_CARDINAL, 0, 1);
|
||||
+ xcb_get_property_reply_t *reply2 = xcb_get_property_reply(QX11Info::connection(), cookie2, nullptr);
|
||||
+ uint pid = 0;
|
||||
+ pid = *(uint *)xcb_get_property_value(reply2);
|
||||
+ free(reply2);
|
||||
+ return pid;
|
||||
+}
|
||||
diff --git a/sni-xembed-proxy/sniproxy.h b/sni-xembed-proxy/sniproxy.h
|
||||
index f26dfd3..3bf7d0e 100755
|
||||
--- a/sni-xembed-proxy/sniproxy.h
|
||||
+++ b/sni-xembed-proxy/sniproxy.h
|
||||
@@ -159,6 +159,8 @@ private:
|
||||
void stackContainerWindow(const uint32_t stackMode) const;
|
||||
QString winidtoDesktopFileName(const WId& wid) const;
|
||||
|
||||
+ uint getPid(const xcb_window_t windowId);
|
||||
+
|
||||
QDBusConnection m_dbus;
|
||||
xcb_window_t m_windowId;
|
||||
xcb_window_t m_containerWid;
|
||||
@@ -166,6 +168,8 @@ private:
|
||||
QPixmap m_pixmap;
|
||||
bool sendingClickEvent;
|
||||
InjectMode m_injectMode;
|
||||
+ xcb_atom_t m_pidAtom;
|
||||
+ QMap<uint, uint> m_pidToProxyCount;
|
||||
};
|
||||
|
||||
#endif // SNIPROXY_H
|
|
@ -0,0 +1,33 @@
|
|||
From: buxiaoqing <buxiaoqing@kylinos.cn>
|
||||
Date: Thu, 14 Mar 2024 10:13:05 +0800
|
||||
Subject: chore(changelog): update changelog 4.0.0.0-ok0.20
|
||||
|
||||
---
|
||||
plugin-taskbar/ukuitaskbutton.cpp | 1 +
|
||||
plugin-taskbar/windowThumbnailManager.cpp | 1 +
|
||||
2 files changed, 2 insertions(+)
|
||||
|
||||
diff --git a/plugin-taskbar/ukuitaskbutton.cpp b/plugin-taskbar/ukuitaskbutton.cpp
|
||||
index 5b1ea15..a4cba48 100644
|
||||
--- a/plugin-taskbar/ukuitaskbutton.cpp
|
||||
+++ b/plugin-taskbar/ukuitaskbutton.cpp
|
||||
@@ -469,6 +469,7 @@ void UKUITaskButton::leaveEvent(QEvent *e)
|
||||
|
||||
void UKUITaskButton::contextMenuEvent(QContextMenuEvent *e)
|
||||
{
|
||||
+ emit leaveButton(m_windowId.toList(), "", 0, 0);
|
||||
QMenu *rightMenu = new QMenu(this);
|
||||
rightMenu->setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
diff --git a/plugin-taskbar/windowThumbnailManager.cpp b/plugin-taskbar/windowThumbnailManager.cpp
|
||||
index 6dc5abb..416889c 100644
|
||||
--- a/plugin-taskbar/windowThumbnailManager.cpp
|
||||
+++ b/plugin-taskbar/windowThumbnailManager.cpp
|
||||
@@ -76,6 +76,7 @@ void WindowThumbnailManager::hide(QString groupName)
|
||||
Q_UNUSED(groupName);
|
||||
if (!m_view->geometry().contains(QCursor::pos())) {
|
||||
m_view->setViewVisible(false);
|
||||
+ m_view->close();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
From: guorongfei <guorongfei@cvte.com>
|
||||
Date: Mon, 25 Mar 2024 16:42:31 +0800
|
||||
Subject: fix google-chrome context menu error
|
||||
|
||||
---
|
||||
panel-daemon/convert-desktop-windowid/convertdesktoptowinid.cpp | 8 ++++++--
|
||||
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/panel-daemon/convert-desktop-windowid/convertdesktoptowinid.cpp b/panel-daemon/convert-desktop-windowid/convertdesktoptowinid.cpp
|
||||
index 1488a7b..330f825 100644
|
||||
--- a/panel-daemon/convert-desktop-windowid/convertdesktoptowinid.cpp
|
||||
+++ b/panel-daemon/convert-desktop-windowid/convertdesktoptowinid.cpp
|
||||
@@ -68,7 +68,8 @@ QString ConvertDesktopToWinId::confirmDesktopFile(int id)
|
||||
|
||||
//第一种方法:比较名字一致性
|
||||
if (m_desktopfilePath.isEmpty()) {
|
||||
- m_className = kdk::WindowManager::getWindowGroup(id);
|
||||
+ // getWindowGroup 这个方法的实现有异常,如果单例没有初始化会直接返回空,加上 self 保证初始化。
|
||||
+ m_className = kdk::WindowManager::self()->getWindowGroup(id);
|
||||
|
||||
//匹配安卓兼容
|
||||
if (m_className == "kylin-kmre-window") {
|
||||
@@ -203,7 +204,10 @@ void ConvertDesktopToWinId::compareClassName()
|
||||
}
|
||||
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 == m_className || path_desktop_name == m_statusName) {
|
||||
+
|
||||
+ // 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;
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
0001-ChangeLog-4.0.0.0-OK0.1.patch
|
||||
0002-Changelog-4.0.0.0-ok0.2.patch
|
||||
0003-Changelog-4.0.0.0-ok0.3.patch
|
||||
0004-69-cherry-pick-use-primaryChanged-signal-from-USD.patch
|
||||
0005-update-debian-changelog.patch
|
||||
0006-close-I77O3F.patch
|
||||
0007-update-changelog-4.0.0.0-ok0.7.patch
|
||||
0008-update-changelog-4.0.0.0-ok0.8.patch
|
||||
0009-90.patch
|
||||
0010-91.patch
|
||||
0011-93-X.patch
|
||||
0012-94.patch
|
||||
0013-chore-changelog-update-changelog-4.0.0.0-ok0.13.patch
|
||||
0014-chore-changelog-update-changelog-4.0.0.0-ok0.14.patch
|
||||
0015-fix-button-I8PXQD.patch
|
||||
0016-chore-changelog-update-changelog-4.0.0.0-ok0.16.patch
|
||||
0017-chore-changelog-update-changelog-4.0.0.0-ok0.17.patch
|
||||
0018-Merge-branch-openkylin-yangtze-of-gitee.com-openkyli.patch
|
||||
0019-fix-crossover-app-systemtray-icon-tips-and-click-err.patch
|
||||
0020-fix-openKylin-BUG-I7GTAA-I7WGGL.patch
|
||||
0021-fix.patch
|
||||
0022-chore-changelog-update-changelog-4.0.0.0-ok0.18.patch
|
||||
0023-sniWatcher-pid-ukui-sni.patch
|
||||
0024-chore-changelog-update-changelog-4.0.0.0-ok0.20.patch
|
||||
0025-fix-google-chrome-context-menu-error.patch
|
|
@ -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 (quilt)
|
|
@ -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,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 udisks2)
|
||||
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,337 @@
|
|||
/*
|
||||
* 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, 0, NET::WM2AllProperties);
|
||||
if (info.valid()) {
|
||||
m_pid = info.pid();
|
||||
} else {
|
||||
m_pid = kdk::WindowManager::getPid(winId);
|
||||
}
|
||||
return m_pid;
|
||||
}
|
||||
|
||||
QString ConvertDesktopToWinId::confirmDesktopFile(int id)
|
||||
{
|
||||
m_pid = getPidFromInfo(id);
|
||||
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()) {
|
||||
m_className = kdk::WindowManager::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("."));
|
||||
if (path_desktop_name == m_className || path_desktop_name == m_statusName) {
|
||||
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)
|
||||
{
|
||||
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* 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 DATEWATCHER_H
|
||||
#define DATEWATCHER_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class DateWatcher : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit DateWatcher(QObject *parent = nullptr);
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif // DATEWATCHER_H
|
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* 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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
使用工具qdbuscpp2xml从dbus.h生成XML文件;
|
||||
qdbuscpp2xml -M server.h -o org.ukui.panel.daemon.xml
|
||||
|
||||
B.使用工具qdbusxml2cpp从XML文件生成继承自QDBusAbstractAdaptor的类,供服务端使用
|
||||
qdbusxml2cpp org.ukui.panel.daemon.xml -i server.h -a dbus-adaptor
|
||||
|
||||
https://blog.51cto.com/9291927/21184
|
|
@ -0,0 +1,57 @@
|
|||
/*
|
||||
* This file was generated by qdbusxml2cpp version 0.8
|
||||
* Command line was: qdbusxml2cpp org.ukui.panel.daemon.xml -i server.h -a dbus-adaptor
|
||||
*
|
||||
* qdbusxml2cpp is Copyright (C) 2020 The Qt Company Ltd.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* Do not edit! All changes made to it will be lost.
|
||||
*/
|
||||
|
||||
#include "dbus-adaptor.h"
|
||||
#include <QtCore/QMetaObject>
|
||||
#include <QtCore/QByteArray>
|
||||
#include <QtCore/QList>
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QVariant>
|
||||
|
||||
/*
|
||||
* Implementation of adaptor class DaemonAdaptor
|
||||
*/
|
||||
|
||||
DaemonAdaptor::DaemonAdaptor(QObject *parent)
|
||||
: QDBusAbstractAdaptor(parent)
|
||||
{
|
||||
// constructor
|
||||
setAutoRelaySignals(true);
|
||||
}
|
||||
|
||||
DaemonAdaptor::~DaemonAdaptor()
|
||||
{
|
||||
// destructor
|
||||
}
|
||||
|
||||
void DaemonAdaptor::DesktopFileDeleteSlot(const QString &path, const QStringList &deleteFile)
|
||||
{
|
||||
// handle method call org.ukui.panel.daemon.DesktopFileDeleteSlot
|
||||
QMetaObject::invokeMethod(parent(), "DesktopFileDeleteSlot", Q_ARG(QString, path), Q_ARG(QStringList, deleteFile));
|
||||
}
|
||||
|
||||
int DaemonAdaptor::DesktopToWID(const QString &desktop)
|
||||
{
|
||||
// handle method call org.ukui.panel.daemon.DesktopToWID
|
||||
int out0;
|
||||
QMetaObject::invokeMethod(parent(), "DesktopToWID", Q_RETURN_ARG(int, out0), Q_ARG(QString, desktop));
|
||||
return out0;
|
||||
}
|
||||
|
||||
QString DaemonAdaptor::WIDToDesktop(int id)
|
||||
{
|
||||
// handle method call org.ukui.panel.daemon.WIDToDesktop
|
||||
QString out0;
|
||||
QMetaObject::invokeMethod(parent(), "WIDToDesktop", Q_RETURN_ARG(QString, out0), Q_ARG(int, id));
|
||||
return out0;
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
/*
|
||||
* This file was generated by qdbusxml2cpp version 0.8
|
||||
* Command line was: qdbusxml2cpp org.ukui.panel.daemon.xml -i server.h -a dbus-adaptor
|
||||
*
|
||||
* qdbusxml2cpp is Copyright (C) 2020 The Qt Company Ltd.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* This file may have been hand-edited. Look for HAND-EDIT comments
|
||||
* before re-generating it.
|
||||
*/
|
||||
|
||||
#ifndef DBUS-ADAPTOR_H
|
||||
#define DBUS-ADAPTOR_H
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtDBus/QtDBus>
|
||||
#include "server.h"
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QByteArray;
|
||||
template<class T> class QList;
|
||||
template<class Key, class Value> class QMap;
|
||||
class QString;
|
||||
class QStringList;
|
||||
class QVariant;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
/*
|
||||
* Adaptor class for interface org.ukui.panel.daemon
|
||||
*/
|
||||
class DaemonAdaptor: public QDBusAbstractAdaptor
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_CLASSINFO("D-Bus Interface", "org.ukui.panel.daemon")
|
||||
Q_CLASSINFO("D-Bus Introspection", ""
|
||||
" <interface name=\"org.ukui.panel.daemon\">\n"
|
||||
" <method name=\"DesktopToWID\">\n"
|
||||
" <arg direction=\"out\" type=\"i\"/>\n"
|
||||
" <arg direction=\"in\" type=\"s\" name=\"desktop\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"WIDToDesktop\">\n"
|
||||
" <arg direction=\"out\" type=\"s\"/>\n"
|
||||
" <arg direction=\"in\" type=\"i\" name=\"id\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"DesktopFileDeleteSlot\">\n"
|
||||
" <arg direction=\"in\" type=\"s\" name=\"path\"/>\n"
|
||||
" <arg direction=\"in\" type=\"as\" name=\"deleteFile\"/>\n"
|
||||
" </method>\n"
|
||||
" </interface>\n"
|
||||
"")
|
||||
public:
|
||||
DaemonAdaptor(QObject *parent);
|
||||
virtual ~DaemonAdaptor();
|
||||
|
||||
public: // PROPERTIES
|
||||
public Q_SLOTS: // METHODS
|
||||
void DesktopFileDeleteSlot(const QString &path, const QStringList &deleteFile);
|
||||
int DesktopToWID(const QString &desktop);
|
||||
QString WIDToDesktop(int id);
|
||||
Q_SIGNALS: // SIGNALS
|
||||
};
|
||||
|
||||
#endif
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
|
||||
<node>
|
||||
<interface name="org.ukui.panel.daemon">
|
||||
<method name="DesktopToWID">
|
||||
<arg type="i" direction="out"/>
|
||||
<arg name="desktop" type="s" direction="in"/>
|
||||
</method>
|
||||
<method name="WIDToDesktop">
|
||||
<arg type="s" direction="out"/>
|
||||
<arg name="id" type="i" direction="in"/>
|
||||
</method>
|
||||
<method name="DesktopFileDeleteSlot">
|
||||
<arg name="path" type="s" direction="in"/>
|
||||
<arg name="deleteFile" type="as" direction="in"/>
|
||||
</method>
|
||||
</interface>
|
||||
</node>
|
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
* 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 "server.h"
|
||||
//Qt
|
||||
#include <QDebug>
|
||||
#include <QDBusMessage>
|
||||
#include "convert-desktop-windowid/convertdesktoptowinid.h"
|
||||
|
||||
|
||||
Server::Server(QObject *parent) :
|
||||
QObject(parent)
|
||||
{
|
||||
m_fileWatcher = new FileWatcher();
|
||||
connect(m_fileWatcher,&FileWatcher::DesktopDeleteFile,this,&Server::DesktopFileDeleteSlot);
|
||||
m_desktop = new ConvertDesktopToWinId();
|
||||
}
|
||||
|
||||
|
||||
QString Server::WIDToDesktop(int id)
|
||||
{
|
||||
return m_desktop->tranIdToDesktop(id);
|
||||
}
|
||||
|
||||
int Server::DesktopToWID(QString desktop)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Server::DesktopFileDeleteSlot(QString path,QStringList deleteFile){
|
||||
// emit DesktopFileDelete(path,deleteFile);
|
||||
}
|
||||
|
||||
//QString Server::TimeChanged()
|
||||
//{
|
||||
|
||||
//}
|
|
@ -0,0 +1,57 @@
|
|||
/*
|
||||
* 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 _SERVER_H
|
||||
#define _SERVER_H
|
||||
//Qt
|
||||
#include <QObject>
|
||||
#include <QGSettings>
|
||||
#include <QVariant>
|
||||
#include <QtDBus>
|
||||
|
||||
//file
|
||||
#include "filewatcher/filewatcher.h"
|
||||
#include "convert-desktop-windowid/convertdesktoptowinid.h"
|
||||
|
||||
class Server : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_CLASSINFO("D-Bus Interface","org.ukui.panel.daemon")
|
||||
public:
|
||||
explicit Server(QObject *parent = 0);
|
||||
|
||||
public Q_SLOTS:
|
||||
//desktop 文件路径转换为wid
|
||||
int DesktopToWID(QString desktop);
|
||||
//window Id 转化为desktop文件
|
||||
QString WIDToDesktop(int id);
|
||||
void DesktopFileDeleteSlot(QString path,QStringList deleteFile);
|
||||
|
||||
Q_SIGNALS:
|
||||
//desktop文件被删除
|
||||
QString DesktopFileDelete(QString);
|
||||
|
||||
// //时间改变
|
||||
// QString TimeChanged();
|
||||
|
||||
private:
|
||||
FileWatcher *m_fileWatcher;
|
||||
ConvertDesktopToWinId *m_desktop;
|
||||
|
||||
};
|
||||
|
||||
#endif // UKUIPANEL_INFORMATION_H
|
|
@ -0,0 +1,108 @@
|
|||
/*
|
||||
* 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 "filewatcher.h"
|
||||
#include <QDebug>
|
||||
#include <QStringList>
|
||||
#include <QDir>
|
||||
#include <QDBusMessage>
|
||||
#include <QDBusConnection>
|
||||
|
||||
#define APPLICATION_PATH "/usr/share/applications/"
|
||||
|
||||
FileWatcher::FileWatcher()
|
||||
{
|
||||
m_fsWatcher=new QFileSystemWatcher(this);
|
||||
m_fsWatcher->addPath(APPLICATION_PATH);
|
||||
initDirMonitor(APPLICATION_PATH);
|
||||
connect(m_fsWatcher,&QFileSystemWatcher::directoryChanged,[this](){
|
||||
directoryUpdated(APPLICATION_PATH);
|
||||
});
|
||||
|
||||
qDebug()<<"********************";
|
||||
}
|
||||
|
||||
void FileWatcher::initDirMonitor(QString path) {
|
||||
const QDir dir(path);
|
||||
m_currentContentsMap[path] = dir.entryList(QDir::NoDotAndDotDot | QDir::AllDirs | QDir::Files, QDir::DirsFirst);
|
||||
}
|
||||
|
||||
//只要任何监控的目录更新(添加、删除、重命名),就会调用。
|
||||
void FileWatcher::directoryUpdated(const QString &path)
|
||||
{
|
||||
qDebug()<<"********************** "<<path;
|
||||
|
||||
// 比较最新的内容和保存的内容找出区别(变化)
|
||||
QStringList currEntryList = m_currentContentsMap[path];
|
||||
const QDir dir(path);
|
||||
QStringList newEntryList = dir.entryList(QDir::NoDotAndDotDot | QDir::AllDirs | QDir::Files, QDir::DirsFirst);
|
||||
QSet<QString> newDirSet = QSet<QString>::fromList(newEntryList);
|
||||
QSet<QString> currentDirSet = QSet<QString>::fromList(currEntryList);
|
||||
|
||||
// 添加了文件
|
||||
QSet<QString> newFiles = newDirSet - currentDirSet;
|
||||
QStringList newFile = newFiles.toList();
|
||||
|
||||
// 文件已被移除
|
||||
QSet<QString> deletedFiles = currentDirSet - newDirSet;
|
||||
QStringList deleteFile = deletedFiles.toList();
|
||||
|
||||
// 更新当前设置
|
||||
m_currentContentsMap[path] = newEntryList;
|
||||
|
||||
if (!newFile.isEmpty() && !deleteFile.isEmpty())
|
||||
{
|
||||
// 文件/目录重命名
|
||||
if ((newFile.count() == 1) && (deleteFile.count() == 1))
|
||||
{
|
||||
// qDebug() << QString("File Renamed from %1 to %2").arg(deleteFile.first()).arg(newFile.first());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 添加新文件/目录至Dir
|
||||
if (!newFile.isEmpty())
|
||||
{
|
||||
// foreach (QString file, newFile)
|
||||
// {
|
||||
// // 处理操作每个新文件....
|
||||
// }
|
||||
}
|
||||
// 从Dir中删除文件/目录
|
||||
if (!deleteFile.isEmpty())
|
||||
{
|
||||
// qDebug()<<"***************"<<deleteFile;
|
||||
|
||||
|
||||
QDBusMessage msg = QDBusMessage::createSignal("/convert/desktopwid","org.ukui.panel.daemon","DesktopFileDelete");
|
||||
QList<QVariant> args;
|
||||
args.append(path+deleteFile.at(0));
|
||||
qDebug()<<path+deleteFile.at(0);
|
||||
msg.setArguments(args);
|
||||
QDBusConnection::sessionBus().send(msg);
|
||||
|
||||
// emit DesktopDeleteFile(path,deleteFile);
|
||||
// foreach(QString file, deleteFile)
|
||||
// {
|
||||
// // 处理操作每个被删除的文件....
|
||||
//// removeButton(path+file);
|
||||
// qDebug()<<"222找到要删除的文件"<<path+file;
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
* 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 FILEWATCHER_H
|
||||
#define FILEWATCHER_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QFileSystemWatcher>
|
||||
#include <QWidget>
|
||||
#include <QStringList>
|
||||
#include <QMap>
|
||||
|
||||
|
||||
class FileWatcher : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
FileWatcher();
|
||||
|
||||
QFileSystemWatcher *m_fsWatcher;
|
||||
void initDirMonitor(QString path);
|
||||
QMap<QString, QStringList> m_currentContentsMap; // 当前每个监控的内容目录列表
|
||||
void directoryUpdated(const QString &path);
|
||||
|
||||
signals:
|
||||
void DesktopDeleteFile(const QString &path, QStringList deleteFile);
|
||||
};
|
||||
|
||||
#endif // FILEWACTHER_H
|
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
* 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 "jsonwacther.h"
|
||||
|
||||
JsonWacther::JsonWacther()
|
||||
{
|
||||
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
/*
|
||||
* 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 JSONWACTHER_H
|
||||
#define JSONWACTHER_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class JsonWacther
|
||||
{
|
||||
public:
|
||||
JsonWacther();
|
||||
};
|
||||
|
||||
#endif // JSONWACTHER_H
|
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
* 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 "watchermanager.h"
|
||||
#include <QApplication>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
WatcherManager manager;
|
||||
return a.exec();
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* 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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
使用工具qdbuscpp2xml从dbus.h生成XML文件;
|
||||
qdbuscpp2xml -M pintotaskbar.h -o org.ukui.panel.xml
|
||||
|
||||
B.使用工具qdbusxml2cpp从XML文件生成继承自QDBusAbstractAdaptor的类,供服务端使用
|
||||
qdbusxml2cpp org.ukui.panel.xml -i pintotaskbar.h -a taskbar-dbus-adaptor
|
||||
|
||||
https://blog.51cto.com/9291927/21184
|
|
@ -0,0 +1,59 @@
|
|||
/*
|
||||
* This file was generated by qdbusxml2cpp version 0.8
|
||||
* Command line was: qdbusxml2cpp org.ukui.panel.xml -i pintotaskbar.h -a dbus-adaptor
|
||||
*
|
||||
* qdbusxml2cpp is Copyright (C) 2020 The Qt Company Ltd.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* Do not edit! All changes made to it will be lost.
|
||||
*/
|
||||
|
||||
#include "dbus-adaptor.h"
|
||||
#include <QtCore/QMetaObject>
|
||||
#include <QtCore/QByteArray>
|
||||
#include <QtCore/QList>
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QVariant>
|
||||
|
||||
/*
|
||||
* Implementation of adaptor class PanelAdaptor
|
||||
*/
|
||||
|
||||
PanelAdaptor::PanelAdaptor(QObject *parent)
|
||||
: QDBusAbstractAdaptor(parent)
|
||||
{
|
||||
// constructor
|
||||
setAutoRelaySignals(true);
|
||||
}
|
||||
|
||||
PanelAdaptor::~PanelAdaptor()
|
||||
{
|
||||
// destructor
|
||||
}
|
||||
|
||||
bool PanelAdaptor::AddToTaskbar(const QString &desktop)
|
||||
{
|
||||
// handle method call org.ukui.panel.AddToTaskbar
|
||||
bool out0;
|
||||
QMetaObject::invokeMethod(parent(), "AddToTaskbar", Q_RETURN_ARG(bool, out0), Q_ARG(QString, desktop));
|
||||
return out0;
|
||||
}
|
||||
|
||||
bool PanelAdaptor::CheckIfExist(const QString &desktop)
|
||||
{
|
||||
// handle method call org.ukui.panel.CheckIfExist
|
||||
bool out0;
|
||||
QMetaObject::invokeMethod(parent(), "CheckIfExist", Q_RETURN_ARG(bool, out0), Q_ARG(QString, desktop));
|
||||
return out0;
|
||||
}
|
||||
|
||||
bool PanelAdaptor::RemoceFromTaskbar(const QString &desktop)
|
||||
{
|
||||
// handle method call org.ukui.panel.RemoceFromTaskbar
|
||||
bool out0;
|
||||
QMetaObject::invokeMethod(parent(), "RemoceFromTaskbar", Q_RETURN_ARG(bool, out0), Q_ARG(QString, desktop));
|
||||
return out0;
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
/*
|
||||
* This file was generated by qdbusxml2cpp version 0.8
|
||||
* Command line was: qdbusxml2cpp org.ukui.panel.xml -i pintotaskbar.h -a dbus-adaptor
|
||||
*
|
||||
* qdbusxml2cpp is Copyright (C) 2020 The Qt Company Ltd.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* This file may have been hand-edited. Look for HAND-EDIT comments
|
||||
* before re-generating it.
|
||||
*/
|
||||
|
||||
#ifndef DBUS-ADAPTOR_H
|
||||
#define DBUS-ADAPTOR_H
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtDBus/QtDBus>
|
||||
#include "pintotaskbar.h"
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QByteArray;
|
||||
template<class T> class QList;
|
||||
template<class Key, class Value> class QMap;
|
||||
class QString;
|
||||
class QStringList;
|
||||
class QVariant;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
/*
|
||||
* Adaptor class for interface org.ukui.panel
|
||||
*/
|
||||
class PanelAdaptor: public QDBusAbstractAdaptor
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_CLASSINFO("D-Bus Interface", "org.ukui.panel")
|
||||
Q_CLASSINFO("D-Bus Introspection", ""
|
||||
" <interface name=\"org.ukui.panel\">\n"
|
||||
" <method name=\"AddToTaskbar\">\n"
|
||||
" <arg direction=\"out\" type=\"b\"/>\n"
|
||||
" <arg direction=\"in\" type=\"s\" name=\"desktop\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"RemoceFromTaskbar\">\n"
|
||||
" <arg direction=\"out\" type=\"b\"/>\n"
|
||||
" <arg direction=\"in\" type=\"s\" name=\"desktop\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"CheckIfExist\">\n"
|
||||
" <arg direction=\"out\" type=\"b\"/>\n"
|
||||
" <arg direction=\"in\" type=\"s\" name=\"desktop\"/>\n"
|
||||
" </method>\n"
|
||||
" </interface>\n"
|
||||
"")
|
||||
public:
|
||||
PanelAdaptor(QObject *parent);
|
||||
virtual ~PanelAdaptor();
|
||||
|
||||
public: // PROPERTIES
|
||||
public Q_SLOTS: // METHODS
|
||||
bool AddToTaskbar(const QString &desktop);
|
||||
bool CheckIfExist(const QString &desktop);
|
||||
bool RemoceFromTaskbar(const QString &desktop);
|
||||
Q_SIGNALS: // SIGNALS
|
||||
};
|
||||
|
||||
#endif
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
|
||||
<node>
|
||||
<interface name="org.ukui.panel">
|
||||
<method name="AddToTaskbar">
|
||||
<arg type="b" direction="out"/>
|
||||
<arg name="desktop" type="s" direction="in"/>
|
||||
</method>
|
||||
<method name="RemoveFromTaskbar">
|
||||
<arg type="b" direction="out"/>
|
||||
<arg name="desktop" type="s" direction="in"/>
|
||||
</method>
|
||||
<method name="CheckIfExist">
|
||||
<arg type="b" direction="out"/>
|
||||
<arg name="desktop" type="s" direction="in"/>
|
||||
</method>
|
||||
</interface>
|
||||
</node>
|
|
@ -0,0 +1,80 @@
|
|||
/*
|
||||
* 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 "pintotaskbar.h"
|
||||
#include <QtDBus>
|
||||
|
||||
PinToTaskbar::PinToTaskbar(QObject *parent) :
|
||||
QObject(parent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
bool PinToTaskbar::AddToTaskbar(const QString &desktop)
|
||||
{
|
||||
QDBusMessage message = QDBusMessage::createSignal("/taskbar/quicklaunch", "org.ukui.panel.taskbar", "AddToTaskbar");
|
||||
message << desktop;
|
||||
QDBusConnection::sessionBus().send(message);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PinToTaskbar::RemoveFromTaskbar(const QString &desktop)
|
||||
{
|
||||
QDBusMessage message = QDBusMessage::createSignal("/taskbar/quicklaunch", "org.ukui.panel.taskbar", "RemoveFromTaskbar");
|
||||
message << desktop;
|
||||
QDBusConnection::sessionBus().send(message);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PinToTaskbar::CheckIfExist(const QString &desktop)
|
||||
{
|
||||
QString fixdDesktop;
|
||||
const auto apps = getTaskbarFixedList();
|
||||
|
||||
for (const QMap<QString, QVariant> &app : apps) {
|
||||
fixdDesktop = app.value("desktop", "").toString();
|
||||
|
||||
if (fixdDesktop.contains(desktop)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
QList<QMap<QString, QVariant> > PinToTaskbar::getTaskbarFixedList()
|
||||
{
|
||||
QSettings settings(QDir::homePath() + "/.config/ukui/panel.conf", QSettings::IniFormat);
|
||||
QList<QMap<QString, QVariant> > array;
|
||||
int size = settings.beginReadArray("/taskbar/apps");
|
||||
|
||||
for (int i = 0; i < size; ++i) {
|
||||
settings.setArrayIndex(i);
|
||||
QMap<QString, QVariant> hash;
|
||||
const auto keys = settings.childKeys();
|
||||
|
||||
for (const QString &key : keys) {
|
||||
hash[key] = settings.value(key);
|
||||
}
|
||||
|
||||
array << hash;
|
||||
}
|
||||
|
||||
return array;
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* 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 PINTOTASKBAR_H
|
||||
#define PINTOTASKBAR_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class PinToTaskbar : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_CLASSINFO("D-Bus Interface","com.ukui.panel.desktop")
|
||||
public:
|
||||
PinToTaskbar(QObject *parent = 0);
|
||||
|
||||
public Q_SLOTS:
|
||||
bool AddToTaskbar(const QString &desktop);
|
||||
bool RemoveFromTaskbar(const QString &desktop);
|
||||
bool CheckIfExist(const QString &desktop);
|
||||
|
||||
private:
|
||||
QList<QMap<QString, QVariant> > getTaskbarFixedList();
|
||||
};
|
||||
|
||||
#endif // PINTOTASKBAR_H
|
|
@ -0,0 +1,59 @@
|
|||
/*
|
||||
* This file was generated by qdbusxml2cpp version 0.8
|
||||
* Command line was: qdbusxml2cpp org.ukui.panel.xml -i pintotaskbar.h -a taskbar-dbus-adaptor
|
||||
*
|
||||
* qdbusxml2cpp is Copyright (C) 2020 The Qt Company Ltd.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* Do not edit! All changes made to it will be lost.
|
||||
*/
|
||||
|
||||
#include "taskbar-dbus-adaptor.h"
|
||||
#include <QtCore/QMetaObject>
|
||||
#include <QtCore/QByteArray>
|
||||
#include <QtCore/QList>
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QVariant>
|
||||
|
||||
/*
|
||||
* Implementation of adaptor class PanelAdaptor
|
||||
*/
|
||||
|
||||
PanelAdaptor::PanelAdaptor(QObject *parent)
|
||||
: QDBusAbstractAdaptor(parent)
|
||||
{
|
||||
// constructor
|
||||
setAutoRelaySignals(true);
|
||||
}
|
||||
|
||||
PanelAdaptor::~PanelAdaptor()
|
||||
{
|
||||
// destructor
|
||||
}
|
||||
|
||||
bool PanelAdaptor::AddToTaskbar(const QString &desktop)
|
||||
{
|
||||
// handle method call org.ukui.panel.AddToTaskbar
|
||||
bool out0;
|
||||
QMetaObject::invokeMethod(parent(), "AddToTaskbar", Q_RETURN_ARG(bool, out0), Q_ARG(QString, desktop));
|
||||
return out0;
|
||||
}
|
||||
|
||||
bool PanelAdaptor::CheckIfExist(const QString &desktop)
|
||||
{
|
||||
// handle method call org.ukui.panel.CheckIfExist
|
||||
bool out0;
|
||||
QMetaObject::invokeMethod(parent(), "CheckIfExist", Q_RETURN_ARG(bool, out0), Q_ARG(QString, desktop));
|
||||
return out0;
|
||||
}
|
||||
|
||||
bool PanelAdaptor::RemoveFromTaskbar(const QString &desktop)
|
||||
{
|
||||
// handle method call org.ukui.panel.RemoveFromTaskbar
|
||||
bool out0;
|
||||
QMetaObject::invokeMethod(parent(), "RemoveFromTaskbar", Q_RETURN_ARG(bool, out0), Q_ARG(QString, desktop));
|
||||
return out0;
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
/*
|
||||
* This file was generated by qdbusxml2cpp version 0.8
|
||||
* Command line was: qdbusxml2cpp org.ukui.panel.xml -i pintotaskbar.h -a taskbar-dbus-adaptor
|
||||
*
|
||||
* qdbusxml2cpp is Copyright (C) 2020 The Qt Company Ltd.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* This file may have been hand-edited. Look for HAND-EDIT comments
|
||||
* before re-generating it.
|
||||
*/
|
||||
|
||||
#ifndef TASKBAR-DBUS-ADAPTOR_H
|
||||
#define TASKBAR-DBUS-ADAPTOR_H
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtDBus/QtDBus>
|
||||
#include "pintotaskbar.h"
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QByteArray;
|
||||
template<class T> class QList;
|
||||
template<class Key, class Value> class QMap;
|
||||
class QString;
|
||||
class QStringList;
|
||||
class QVariant;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
/*
|
||||
* Adaptor class for interface org.ukui.panel
|
||||
*/
|
||||
class PanelAdaptor: public QDBusAbstractAdaptor
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_CLASSINFO("D-Bus Interface", "org.ukui.panel")
|
||||
Q_CLASSINFO("D-Bus Introspection", ""
|
||||
" <interface name=\"org.ukui.panel\">\n"
|
||||
" <method name=\"AddToTaskbar\">\n"
|
||||
" <arg direction=\"out\" type=\"b\"/>\n"
|
||||
" <arg direction=\"in\" type=\"s\" name=\"desktop\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"RemoveFromTaskbar\">\n"
|
||||
" <arg direction=\"out\" type=\"b\"/>\n"
|
||||
" <arg direction=\"in\" type=\"s\" name=\"desktop\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"CheckIfExist\">\n"
|
||||
" <arg direction=\"out\" type=\"b\"/>\n"
|
||||
" <arg direction=\"in\" type=\"s\" name=\"desktop\"/>\n"
|
||||
" </method>\n"
|
||||
" </interface>\n"
|
||||
"")
|
||||
public:
|
||||
PanelAdaptor(QObject *parent);
|
||||
virtual ~PanelAdaptor();
|
||||
|
||||
public: // PROPERTIES
|
||||
public Q_SLOTS: // METHODS
|
||||
bool AddToTaskbar(const QString &desktop);
|
||||
bool CheckIfExist(const QString &desktop);
|
||||
bool RemoveFromTaskbar(const QString &desktop);
|
||||
Q_SIGNALS: // SIGNALS
|
||||
};
|
||||
|
||||
#endif
|
|
@ -0,0 +1,10 @@
|
|||
[Desktop Entry]
|
||||
Name=Panel Daemon
|
||||
Name[zh_CN]=任务栏后台服务
|
||||
Comment=ukui panel daemon
|
||||
Exec=panel-daemon
|
||||
Type=Desktop
|
||||
OnlyShowIn=UKUI;
|
||||
NoDisplay=true;
|
||||
X-UKUI-AutoRestart=true
|
||||
X-UKUI-Autostart-Phase=Initialization
|
|
@ -0,0 +1,69 @@
|
|||
/*
|
||||
* 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 "watchermanager.h"
|
||||
#include <QtDBus>
|
||||
|
||||
|
||||
|
||||
WatcherManager::WatcherManager(QObject *parent) : QObject(parent)
|
||||
{
|
||||
register_dbus();
|
||||
}
|
||||
|
||||
WatcherManager::~WatcherManager()
|
||||
{
|
||||
delete m_taskbarDBus;
|
||||
}
|
||||
|
||||
void WatcherManager::register_dbus()
|
||||
{
|
||||
Server* dbus=new Server;
|
||||
connect(dbus,&Server::DesktopFileDelete, this,[=](){
|
||||
qDebug()<<"signal send success!";
|
||||
});
|
||||
new DaemonAdaptor(dbus);
|
||||
QDBusConnection con=QDBusConnection::sessionBus();
|
||||
|
||||
if(!con.registerService("org.ukui.panel.daemon"))
|
||||
{
|
||||
qDebug()<<"error1:"<<con.lastError().message();
|
||||
}
|
||||
if(!con.registerObject("/convert/desktopwid",dbus,
|
||||
QDBusConnection::ExportAllSlots|
|
||||
QDBusConnection::ExportAllSignals))
|
||||
{
|
||||
qDebug()<<"error2:"<<con.lastError().message();
|
||||
}
|
||||
|
||||
|
||||
m_taskbarDBus=new PinToTaskbar;
|
||||
new PanelAdaptor(m_taskbarDBus);
|
||||
QDBusConnection taskbar_connection=QDBusConnection::sessionBus();
|
||||
|
||||
if(!taskbar_connection.registerService("com.ukui.panel.desktop"))
|
||||
{
|
||||
qDebug()<<"error1:"<<con.lastError().message();
|
||||
}
|
||||
if(!taskbar_connection.registerObject("/",m_taskbarDBus,
|
||||
QDBusConnection::ExportAllSlots|
|
||||
QDBusConnection::ExportAllSignals))
|
||||
{
|
||||
qDebug()<<"error2:"<<taskbar_connection.lastError().message();
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue