forked from openkylin/ukui-panel
Compare commits
No commits in common. "upstream" and "dev_dragapplications" have entirely different histories.
upstream
...
dev_dragap
|
@ -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.
|
201
CMakeLists.txt
201
CMakeLists.txt
|
@ -1,6 +1,201 @@
|
|||
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(Qt5DBus ${REQUIRED_QT_VERSION} REQUIRED)
|
||||
find_package(Qt5LinguistTools ${REQUIRED_QT_VERSION} REQUIRED)
|
||||
find_package(Qt5Widgets ${REQUIRED_QT_VERSION} REQUIRED)
|
||||
find_package(Qt5X11Extras ${REQUIRED_QT_VERSION} REQUIRED)
|
||||
find_package(Qt5Xml ${REQUIRED_QT_VERSION} REQUIRED)
|
||||
find_package(KF5WindowSystem ${KF5_MINIMUM_VERSION} REQUIRED)
|
||||
find_package(Qt5 ${QT_MINIMUM_VERSION} CONFIG REQUIRED Widgets DBus X11Extras LinguistTools)
|
||||
find_package(Qt5Xdg ${QTXDG_MINIMUM_VERSION} REQUIRED)
|
||||
find_package(X11 REQUIRED)
|
||||
find_package(Qt5LinguistTools)
|
||||
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core Quick Widgets REQUIRED)
|
||||
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Quick Widgets REQUIRED)
|
||||
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS QuickWidgets 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(ukui-flash-disk)
|
||||
#add_subdirectory(ukui-calendar)
|
||||
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,474 @@
|
|||
ukui-panel (3.20.1.13) v101; urgency=medium
|
||||
|
||||
* BUG:#130798 【GXB】【SW】【日历】藏文,日历的星期是英文
|
||||
* 需求:无
|
||||
* 其他改动:无
|
||||
* 其他改动说明:无
|
||||
|
||||
-- buxiaoqing <buxiaoqing@kylinos.cn> Fri, 14 Oct 2022 13:49:54 +0800
|
||||
|
||||
ukui-panel (3.20.1.12) v101; urgency=medium
|
||||
|
||||
* BUG:#142957 【传书】任务栏预览框关闭按键显示不全
|
||||
* BUG:#137678 【整机生态-SP1-2209】【超翔TF830】【任务栏】任务栏点击图标不放,拖拽后,任务栏图标状态错误
|
||||
* BUG:#140579 【HWE-Base1】【蓝牙】任务栏上蓝牙图标显示异常且点击无反应
|
||||
* BUG:#143639 【任务栏-托盘】【前场问题】建行-安全准入(scclient)任务栏图标显示异常
|
||||
* BUG:#140386 【rc6走查】【任务栏】右键菜单内容未按照设计稿实现
|
||||
* 需求:无
|
||||
* 其他改动:无
|
||||
* 其他改动说明:无
|
||||
|
||||
-- buxiaoqing <buxiaoqing@kylinos.cn> Fri, 14 Oct 2022 13:48:11 +0800
|
||||
|
||||
ukui-panel (3.20.1.11) v101; urgency=medium
|
||||
|
||||
* BUG:#135838 【系统主题】系统主题切换时,任务栏生效不同步
|
||||
* BUG:#141777 【系统主题】切换主题时任务栏图标同步卡顿
|
||||
* BUG:#128830 输入法右键菜单存在半透明边框
|
||||
* BUG:#140398 周几改成星期几
|
||||
* BUG:#140360 托盘三态按照设计稿实现
|
||||
* 需求:无
|
||||
* 其他改动:无
|
||||
* 其他改动说明:无
|
||||
|
||||
-- buxiaoqing <buxiaoqing@kylinos.cn> Mon, 26 Sep 2022 09:39:25 +0800
|
||||
|
||||
ukui-panel (3.20.1.10) v101; urgency=medium
|
||||
|
||||
* BUG:140369 【rc6走查】【任务栏】预览窗三态未按照设计稿实现
|
||||
* BUG:126598 【云桌面】【任务栏】当任务栏固定窗口填满时,继续固定应用窗口或打开应用,无法显示完整
|
||||
* 需求:无
|
||||
* 其他改动:无
|
||||
* 其他改动说明:无
|
||||
|
||||
-- buxiaoqing <buxiaoqing@kylinos.cn> Fri, 23 Sep 2022 10:54:06 +0800
|
||||
|
||||
ukui-panel (3.20.1.9) v101; urgency=medium
|
||||
|
||||
* BUG:140375 【rc6走查】【任务栏】未支持拖拽尺寸
|
||||
* BUG:140374 【rc6走查】【任务栏】未支持拖拽方位
|
||||
* BUG:140364 【rc6走查】【任务栏】应用窗口状态提示未按照设计稿实现
|
||||
* BUG:140367 【rc6走查】【任务栏】预览窗样式未按照设计稿实现
|
||||
* 需求:无
|
||||
* 其他改动:无
|
||||
* 其他改动说明:无
|
||||
|
||||
-- buxiaoqing <buxiaoqing@kylinos.cn> Wed, 21 Sep 2022 09:30:35 +0800
|
||||
|
||||
ukui-panel (3.20.1.8) v101; urgency=medium
|
||||
|
||||
* BUG:139515 【开始菜单】点击开始菜单无反应
|
||||
* BUG:137124
|
||||
【冒烟1级】【窗口列表】任务栏在左右侧时重启后固定应用图标不能全部显示
|
||||
* BUG:135962 【窗口列表】任务栏显示功能异常
|
||||
* BUG:130400 【任务栏】打开任意软件,将鼠标悬浮在任务栏的该软件图标上,任务栏消失(或消失再出现)
|
||||
* 需求:无
|
||||
* 其他改动:无
|
||||
* 其他改动说明:无
|
||||
|
||||
-- buxiaoqing <buxiaoqing@kylinos.cn> Thu, 15 Sep 2022 16:50:06 +0800
|
||||
|
||||
ukui-panel (3.20.1.7) v101; urgency=medium
|
||||
|
||||
* BUG#130442 【窗口管理器】【自动化】当打开软件商店或者文件管理器时,已经打开的应用窗口会闪一下(第一次打开时必现)
|
||||
* 需求:无
|
||||
* 其他改动:无
|
||||
* 其他改动说明:无
|
||||
|
||||
-- buxiaoqing <buxiaoqing@kylinos.cn> Fri, 02 Sep 2022 17:52:20 +0800
|
||||
|
||||
ukui-panel (3.20.1.6) v101; urgency=medium
|
||||
|
||||
* BUG:102108 【v10-sp1-1227在线升级推送】【0521+1227升级推送】升级后点击任务栏微信图标无反应,无法将主界面显示到桌面
|
||||
* BUG:125050 【多任务视图】在多个工作区打开文件管理器,关闭任意工作区的文件管理器,任务栏图标消失
|
||||
* BUG:134286 【整机生态-SP1-2209】【任务栏】任务栏打开应用窗口异常,焦点捕捉不到
|
||||
* BUG:133110 【多任务视图】在桌面1打开程序后,在桌面2打开相同程序,点击桌面2任务栏的程序,会自动跳转至桌面1
|
||||
* BUG:137684 【整机生态-SP1-2209】【超翔TF830】【任务栏】当文件夹打开多个,切换任务栏图标,图标展示错误
|
||||
* 需求:无,完成任务106951
|
||||
* 其他改动:无
|
||||
* 其他改动说明:无
|
||||
|
||||
-- buxiaoqing <buxiaoqing@kylinos.cn> Thu, 01 Sep 2022 10:20:25 +0800
|
||||
|
||||
ukui-panel (3.20.1.5) v101; urgency=medium
|
||||
|
||||
* BUG:136774 调节字体时,任务栏日期显示不完全
|
||||
* BUG:137124 【冒烟1级】【窗口列表】任务栏在左右侧时重启后固定应用图标不能全部显示
|
||||
* BUG:135962 【窗口列表】任务栏显示功能异常
|
||||
* BUG:127304 【窗口切换】任务栏小窗口没有进行实时预览
|
||||
* BUG:123042 【窗口管理器】loongarch64机器无预览效果
|
||||
* BUG:132483 【任务栏】多开窗口,鼠标悬浮在任务栏图标上,列表预览图颜色与主题不符,边界有白框
|
||||
* BUG:131912 【整机生态-SP1-2209】【任务栏】任务栏预览界面显示异常
|
||||
* BUG:130400 【任务栏】打开任意软件,将鼠标悬浮在任务栏的该软件图标上,任务栏消失(或消失再出现)
|
||||
* BUG:93088 【用例145964】【任务栏】预览窗口不适配透明度
|
||||
* BUG:117950 【UKUI 3.1.4 走查】【设计】【任务栏】预览窗未跟随深浅主题切换
|
||||
* BUG:133159 【任务栏】【x100】【通有】窗口的预览框底部被任务栏遮挡
|
||||
* BUG:125691 【UKUI 3.20 走查】【任务栏】日期字号未根据控制面板调整
|
||||
* BUG:123493 【NR定制】【现场】【任务栏】调整字号12 15 16,任务栏中日期的字号不跟随变化
|
||||
* BUG:135472 【日历】字体第三档时任务栏时间显示异常
|
||||
* BUG:134381 【日历】字体大小修改后,桌面右下角时间日期字体显示异常
|
||||
* BUG:132698 【时间和日期】【x100】【通有】切换字体后,任务栏时间显示不全
|
||||
* 需求:无
|
||||
* 其他改动:无
|
||||
* 其他改动说明:无
|
||||
|
||||
-- buxiaoqing <buxiaoqing@kylinos.cn> Thu, 25 Aug 2022 14:46:18 +0800
|
||||
|
||||
ukui-panel (3.20.1.4) v101; urgency=medium
|
||||
|
||||
* BUG:130400 【任务栏】打开任意软件,将鼠标悬浮在任务栏的该软件图标上,任务栏消失(或消失再出现)
|
||||
* BUG:131912 【整机生态-SP1-2209】【任务栏】任务栏预览界面显示异常
|
||||
* BUG:127304 【窗口切换】任务栏小窗口没有进行实时预览
|
||||
* 其他改动:从任务栏点击图标激活和最小化无窗管动画问题修复
|
||||
* 其他改动影响域:设置了图标位置便于窗管获取动画的起始位置,对任务栏功能无影响
|
||||
|
||||
-- buxiaoqing <buxiaoqing@kylinos.cn> Fri, 19 Aug 2022 16:21:35 +0800
|
||||
|
||||
ukui-panel (3.20.1.3) v101; urgency=medium
|
||||
|
||||
* BUG: #117112 【开始菜单】开始菜单右键注销和重启图标缺失
|
||||
* BUG: #125074 【开始菜单】右键开始菜单注销和重启图标缺失
|
||||
* BUG: #128698 【任务栏】右键点击开始菜单-电源,重启与注销没有图标
|
||||
* 需求:无
|
||||
* 其他改动:无
|
||||
* 其他改动说明:无
|
||||
|
||||
-- buxiaoqing <buxiaoqing@kylinos.cn> Thu, 11 Aug 2022 11:32:27 +0800
|
||||
|
||||
ukui-panel (3.20.1.1) v101; urgency=medium
|
||||
|
||||
*BUG 号:
|
||||
*需求号:
|
||||
*其他改动说明:解决编译问题,加入libkysdk-waylandhelper-dev依赖
|
||||
|
||||
-- yinjie-zhang <zhangyinjie@kylinos.cn> Fri, 22 Jul 2022 14:26:17 +0800
|
||||
|
||||
ukui-panel (3.20.1.0) v101; urgency=medium
|
||||
|
||||
*BUG 号:#125691 日期字号跟随系统字体大小,UI遵循设计图
|
||||
*需求号:#12958 动态预览功能
|
||||
*其他改动说明:日历:Mavis触控需求合入主线,修复2209bug和ukui3.2需求
|
||||
|
||||
-- yinjie-zhang <zhangyinjie@kylinos.cn> Thu, 21 Jul 2022 13:58:27 +0800
|
||||
|
||||
ukui-panel (3.20.0.5) v101; urgency=medium
|
||||
|
||||
* BUG: 解决126162 【快速启动栏】任务栏中置顶、未置顶、从任务栏取消固定图标不显示 * BUG:解决125288 【主题】【图标主题】【任务栏】对于已固定到任务栏的图标,在未开启窗口时"从任务栏取消固定"左侧图标不显示(必现)
|
||||
* 需求:无
|
||||
* 其他改动:无
|
||||
* 其他改动说明:无
|
||||
|
||||
-- buxiqoqing <buxiaoqing@kylinos.cn> Thu, 30 Jun 2022 15:44:22 +0800
|
||||
|
||||
ukui-panel (3.20.0.4) v101; urgency=medium
|
||||
|
||||
* BUG:解决113258 【日历】两次修改字体,日历界面字体未同步更新
|
||||
* 需求:无
|
||||
* 其他改动:无
|
||||
* 其他改动说明:无
|
||||
|
||||
-- hepuyao <hepuyao@kylinos.cn> Tue, 28 Jun 2022 01:55:12 +0800
|
||||
|
||||
ukui-panel (3.1.0-14.2) v101; urgency=medium
|
||||
|
||||
* 解决BUG#92324 【任务栏】任务栏右键取消勾选显示任务视图按钮无效
|
||||
|
||||
-- buxiaoqing <buxiaoqing@kylinos.cn> Thu, 25 Nov 2021 10:27:18 +0800
|
||||
|
||||
ukui-panel (3.1.0-14.1) v101; urgency=medium
|
||||
|
||||
* 解决BUG#76872,75964,88966
|
||||
|
||||
-- buxiaoqing <buxiaoqing@kylinos.cn> Sat, 20 Nov 2021 10:50:14 +0800
|
||||
|
||||
ukui-panel (3.1.0-10.4) v101; urgency=medium
|
||||
|
||||
* 解决bug#88606 【开始菜单】应用右键的固定到任务栏失效
|
||||
|
||||
-- hepuyao <hepuyao@kylinos.cn> Wed, 03 Nov 2021 09:58:24 +0800
|
||||
|
||||
ukui-panel (3.1.0-7.1) v101; urgency=medium
|
||||
|
||||
* 解决bug#77699
|
||||
|
||||
-- buxiaoqing <buxiaoqing@kylinos.cn> Fri, 17 Sep 2021 09:37:28 +0800
|
||||
|
||||
ukui-panel (3.1.0-1.1) v101; urgency=medium
|
||||
|
||||
* 0710 新需求
|
||||
|
||||
-- hepuyao <hepuyao@kylinos.cn> Wed, 30 Jun 2021 21:25:21 +0800
|
||||
|
||||
ukui-panel (3.0.1-80) v101; urgency=medium
|
||||
|
||||
* 解决bug#45664 quicklaunch插件部分翻译未生效的问题
|
||||
解决bug#47196 【任务栏】部分应用任务栏预览窗口未自适应
|
||||
解决bug#43504 【开始菜单】控制面板中切换图标主题为经典模式后,麒麟传书的图标不一致;微信桌面图标不显示;任务栏中的显示预览窗口图标不显示
|
||||
解决bug#50971【任务栏】打开多个相同的应用,任务栏点击关闭单个窗口,导致任务栏闪退
|
||||
解决bug#50946 【任务栏】悬浮任务栏麒麟影音图标,对预览图右键,导致任务栏闪退
|
||||
|
||||
其他改动:添加双屏异常时候的打印信息
|
||||
-- hepuyao <hepuyao@kylinos.cn> Mon, 26 Apr 2021 19:17:37 +0800
|
||||
|
||||
ukui-panel (3.0.1-79) v101; urgency=medium
|
||||
|
||||
* 解决托盘图标显示异常的问题
|
||||
|
||||
-- <hepuyao@kylinos.cn> Mon, 26 Apr 2021 09:00:37 +0800
|
||||
|
||||
ukui-panel (3.0.1-78hw4) v101; urgency=medium
|
||||
|
||||
* 解决华为冒烟测试问题:4358441 时间和日期刷新不及时的问题
|
||||
* 解决华为冒烟测试问题:4358216 日历需要点击两次的问题
|
||||
* 其他改动说明 :增加了一个任务栏变化的时候的dbus信号
|
||||
解决麒麟影音的显示问题
|
||||
|
||||
*影响域:影响时间与日期的显示
|
||||
影响日历的弹出功能
|
||||
影响开始菜单位置的显示
|
||||
|
||||
-- hepuyao <hepuyao@kylinos.cn> Thu, 22 Apr 2021 19:34:18 +0800
|
||||
|
||||
ukui-panel (3.0.1-77) v101; urgency=medium
|
||||
|
||||
* 解决u盘弹出位置错误的问题 bug#45607
|
||||
影响域:影响u盘弹出位置,包括单屏和双屏
|
||||
|
||||
-- hepuyao <hepuyao@kylinos.cn> Tue, 13 Apr 2021 07:38:13 +0800
|
||||
|
||||
ukui-panel (3.0.1-72) v101; urgency=medium
|
||||
|
||||
* 解决bug#38710 电源托盘图标位置更新
|
||||
|
||||
-- hepuyao <hepuyao@kylinos.cn> Mon, 22 Mar 2021 10:58:26 +0800
|
||||
|
||||
ukui-panel (3.0.1-71) v101; urgency=medium
|
||||
|
||||
* 任务栏隐藏QTool类型窗口显示
|
||||
|
||||
-- hepuyao <hepuyao@kylinos.cn> Mon, 22 Mar 2021 09:08:30 +0800
|
||||
|
||||
ukui-panel (3.0.1-69) v101; urgency=medium
|
||||
|
||||
* 屏蔽UtilityMask 属性窗口
|
||||
华为990 夜间模式,休眠的特殊处理
|
||||
|
||||
-- hepuyao <hepuyao@kylinos.cn> Fri, 19 Mar 2021 11:22:37 +0800
|
||||
|
||||
ukui-panel (3.0.1-68) v101; urgency=medium
|
||||
|
||||
* u盘管理工具更新,解决usb接入不识别的问题,解决U盘为dev/sda卷时不识别的问题
|
||||
|
||||
-- hepuyao <hepuyao@kylinos.cn> Mon, 15 Mar 2021 01:09:44 +0800
|
||||
|
||||
ukui-panel (3.0.1-66) v101; urgency=medium
|
||||
|
||||
* u盘管理工具更新 解决bug#41579 40744 31019 40451
|
||||
|
||||
-- <hepuyao@kylinos.cn> Fri, 12 Mar 2021 10:52:23 +0800
|
||||
|
||||
ukui-panel (3.0.1-65) v101; urgency=medium
|
||||
|
||||
* 解决 #40253 任务栏崩溃问题
|
||||
#40306 任务栏时间刷新格式不及时的问题
|
||||
|
||||
-- hepuyao <hepuyao@kylinos.cn> Thu, 04 Mar 2021 20:36:10 +0800
|
||||
|
||||
ukui-panel (3.0.1-64) v101; urgency=medium
|
||||
|
||||
* 支持华为990上双屏
|
||||
|
||||
-- hepuyao <hepuyao@kylinos.cn> Thu, 25 Feb 2021 18:51:27 +0800
|
||||
|
||||
ukui-panel (3.0.1-62) v101; urgency=medium
|
||||
|
||||
* 暂时屏蔽任务栏消息通知区域 移入 任务栏/收纳功能
|
||||
|
||||
-- hepuyao <hepuyao@kylinos.cn> Sun, 21 Feb 2021 10:12:23 +0800
|
||||
|
||||
ukui-panel (3.0.1-61) v101; urgency=medium
|
||||
|
||||
* 快速启动栏应用更新
|
||||
|
||||
-- hepuyao <hepuyao@kylinos.cn> Fri, 19 Feb 2021 14:22:16 +0800
|
||||
|
||||
ukui-panel (3.0.1-60) v101; urgency=medium
|
||||
|
||||
* 任务栏消息通知区域图标新增 移入 任务栏/收纳 功能
|
||||
|
||||
-- <hepuyao@kylinos.cn> Sun, 07 Feb 2021 19:20:23 +0800
|
||||
|
||||
ukui-panel (3.0.1-59) v101; urgency=medium
|
||||
|
||||
* 任务栏隐藏的时候发出信号 Link#31042
|
||||
增加预览右键置顶选项
|
||||
|
||||
-- hepuyao <hepuyao@kylinos.cn> Sat, 30 Jan 2021 10:04:40 +0800
|
||||
|
||||
ukui-panel (3.0.1-58) v101; urgency=medium
|
||||
|
||||
* 解决任务栏异常退出的时候输入法可能无法显示的问题 #35498
|
||||
* 解决可能出现的任务栏收纳栏中没有应用但是存在收纳箭头的问题 #33259
|
||||
|
||||
-- <hepuyao@kylinos.cn> Thu, 28 Jan 2021 10:34:27 +0800
|
||||
|
||||
ukui-panel (3.0.1-55) v101; urgency=medium
|
||||
|
||||
* 解决任务栏第一次进入系统点击收纳按钮的崩溃问题
|
||||
|
||||
-- hepuyao <hepuyao@kylinos.cn> Fri, 22 Jan 2021 16:02:22 +0800
|
||||
|
||||
ukui-panel (3.0.1-54) v101; urgency=medium
|
||||
|
||||
* solve the problem : nightmode SetUp icon is error
|
||||
|
||||
-- hepuyao <hepuyao@kylinos.cn> Thu, 21 Jan 2021 19:24:50 +0800
|
||||
|
||||
ukui-panel (3.0.1-53) v101; urgency=medium
|
||||
|
||||
* solve the plugin-tray Storage Widget can't click
|
||||
|
||||
-- hepuyao <hepuyao@kylinos.cn> Thu, 21 Jan 2021 15:31:44 +0800
|
||||
|
||||
ukui-panel (3.0.1-52) v101; urgency=medium
|
||||
|
||||
* 解决文件夹添加造成的编译报错的问题
|
||||
|
||||
-- hepuyao <hepuyao@kylinos.cn> Thu, 21 Jan 2021 13:36:07 +0800
|
||||
|
||||
ukui-panel (3.0.1-51) v101; urgency=medium
|
||||
|
||||
* 针对华为990 开始菜单,侧边栏,飞行模式的特殊处理
|
||||
|
||||
-- hepuyao <hepuyao@kylinos.cn> Thu, 20 Jan 2021 17:17:38 +0800
|
||||
|
||||
ukui-panel (3.0.1-1) unstable; urgency=medium
|
||||
|
||||
* New upstream release.
|
||||
|
||||
-- handsome_feng <jianfengli@ubuntukylin.com> Sat, 01 Aug 2020 03:11:43 +0000
|
||||
|
||||
ukui-panel (3.0.0-1) unstable; urgency=medium
|
||||
|
||||
* New upstream release.
|
||||
* debian:
|
||||
- Update ukui-panel.postinst.
|
||||
- Update copyright.
|
||||
|
||||
-- handsome_feng <jianfengli@ubuntukylin.com> Mon, 27 Jul 2020 01:05:06 +0000
|
||||
|
||||
ukui-panel (2.0.7-1) unstable; urgency=medium
|
||||
|
||||
* New upstream bugfix release:
|
||||
- Fix that panel stuck after invoke ukui-control-center.
|
||||
- Fix that night mode causes the screen flicker.
|
||||
- Don't exit if ukui-window-switch does not exist.
|
||||
* debian/control:
|
||||
- Add ukui-window-switch to suggests.
|
||||
|
||||
-- handsome_feng <jianfengli@ubuntukylin.com> Thu, 16 Apr 2020 16:33:48 +0800
|
||||
|
||||
ukui-panel (2.0.6-1) unstable; urgency=medium
|
||||
|
||||
* New upstream bugfix release:
|
||||
- Fix that the applet window not autohide.
|
||||
- Fix the i18n issue in night mode and calendar.
|
||||
- Fix the coffliction between preview window and warkspace.
|
||||
- Fix the wrong position of right-click menu.
|
||||
- Fix the missing icon of disk.
|
||||
|
||||
-- handsome_feng <jianfengli@ubuntukylin.com> Thu, 09 Apr 2020 17:35:53 +0800
|
||||
|
||||
ukui-panel (2.0.5-1) unstable; urgency=medium
|
||||
|
||||
* New upstream bugfix release.
|
||||
- Fix that disk popup window don't disappear.
|
||||
- Fix calendar i18n issue.
|
||||
- Fix the sorting issue of applets.
|
||||
- Fix that sometimes applets disappear.
|
||||
- Fix the wrong time of calendar.
|
||||
- Fix the error when select holiday.
|
||||
- Fix that panel doesn't follow the primary screen.
|
||||
- Fix the wrong position of preview windows.
|
||||
- Fix the error when adding application to quick launch area.
|
||||
- Fix the wrong gsettings key.
|
||||
|
||||
-- handsome_feng <jianfengli@ubuntukylin.com> Mon, 06 Apr 2020 19:53:00 +0800
|
||||
|
||||
ukui-panel (2.0.4-1) unstable; urgency=medium
|
||||
|
||||
* New upstream bugfix-only release.
|
||||
|
||||
-- handsome_feng <jianfengli@ubuntukylin.com> Mon, 30 Mar 2020 21:34:53 +0800
|
||||
|
||||
ukui-panel (2.0.3-1) unstable; urgency=medium
|
||||
|
||||
* New upstream bugfix-only release.
|
||||
* debian/control:
|
||||
- Update the vcs location.
|
||||
|
||||
-- handsome_feng <jianfengli@ubuntukylin.com> Mon, 23 Mar 2020 12:35:10 +0800
|
||||
|
||||
ukui-panel (2.0.2-1) unstable; urgency=medium
|
||||
|
||||
* New upstream release:
|
||||
- Update the UI of calendar by new design.
|
||||
- Update the UI of plugin ukui-flash-disk.
|
||||
- Fix the wrong position when panel changed direction.
|
||||
|
||||
-- handsome_feng <jianfengli@ubuntukylin.com> Sat, 21 Mar 2020 16:52:54 +0800
|
||||
|
||||
ukui-panel (2.0.1-1) unstable; urgency=medium
|
||||
|
||||
* New upstream release:
|
||||
- Fix build under Arch.
|
||||
- Fix the error when click calendar.
|
||||
- Fix the error when show preview.
|
||||
- Adjust the style.
|
||||
- Add dbus interface.
|
||||
- Add disk plugin.
|
||||
- Add close button to preview.
|
||||
- Add tray storage area.
|
||||
* debian/control:
|
||||
- Add libpoppler-dev, libpopplet-qt5-dev and libpeony-dev to
|
||||
build-depends.
|
||||
|
||||
-- handsome_feng <jianfengli@ubuntukylin.com> Thu, 12 Mar 2020 10:45:13 +0800
|
||||
|
||||
ukui-panel (2.0.0-1) unstable; urgency=medium
|
||||
|
||||
* New upstream release.
|
||||
- Migrate from gtk to qt.
|
||||
* Debian/{control,compat}:
|
||||
- Use debhelper-compat notation.
|
||||
- Bump standards-version to 4.5.0.
|
||||
- Set Rules-Requires-Root to no.
|
||||
|
||||
-- handsome_feng <jianfengli@ubuntukylin.com> Sun, 02 Feb 2020 14:07:37 +0800
|
||||
|
||||
ukui-panel (1.1.6-1) unstable; urgency=medium
|
||||
|
||||
* Change the default grouping type of window-list.
|
||||
* Fix that window-list disappears after multi restart.
|
||||
* Update the copyright.
|
||||
* debian/control:
|
||||
- Bump standards-version to 4.4.0.
|
||||
- Drop mate-polkit.
|
||||
|
||||
-- handsome_feng <jianfengli@ubuntukylin.com> Wed, 07 Aug 2019 11:25:09 +0800
|
||||
|
||||
ukui-panel (1.1.5-1) unstable; urgency=medium
|
||||
|
||||
* Update es.po, fr.po, pt.po, ru.po.
|
||||
* Update the theme when system theme changes.
|
||||
* Fix the bug that window-list disappears accidentally.
|
||||
* Fix the bug that the icon stuck after multiple clicks.
|
||||
* Fix the bug that can't move the applet to the right of window-list.
|
||||
|
||||
-- handsome_feng <jianfengli@ubuntukylin.com> Thu, 27 Dec 2018 20:12:06 +0800
|
||||
|
||||
ukui-panel (1.1.4-1) unstable; urgency=medium
|
||||
|
||||
* Initial release. (Closes: #903943)
|
||||
|
||||
-- handsome_feng <jianfengli@ubuntukylin.com> Tue, 17 Jul 2018 11:15:52 +0800
|
|
@ -0,0 +1,63 @@
|
|||
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: debhelper-compat (= 12),
|
||||
cmake,
|
||||
libdbusmenu-qt5-dev,
|
||||
libglib2.0-dev(>=2.36),
|
||||
libkf5windowsystem-dev,
|
||||
libqt5svg5-dev,
|
||||
libqt5x11extras5-dev,
|
||||
libx11-dev,
|
||||
libxcb-damage0-dev,
|
||||
libxcb-util0-dev,
|
||||
libxcb-xkb-dev,
|
||||
libxcomposite-dev,
|
||||
libxdamage-dev,
|
||||
libxkbcommon-dev,
|
||||
libxkbcommon-x11-dev,
|
||||
libxrender-dev,
|
||||
libqt5xdg-dev,
|
||||
qttools5-dev,
|
||||
libgsettings-qt-dev,
|
||||
libdconf-dev,
|
||||
libukui-log4qt-dev,
|
||||
qtbase5-dev,
|
||||
qtbase5-dev-tools,
|
||||
qttools5-dev-tools,
|
||||
libx11-dev,
|
||||
libxtst-dev,
|
||||
libudisks2-dev,
|
||||
libxcb-render-util0-dev,
|
||||
libxcb-image0-dev,
|
||||
libxcb-composite0-dev,
|
||||
libxcb-shape0-dev,
|
||||
libkysdk-qtwidgets-dev,
|
||||
libqt5quick5,
|
||||
libqt5quickwidgets5,
|
||||
libkf5plasmaquick5,
|
||||
qtdeclarative5-dev,
|
||||
libkysdk-waylandhelper-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: ${misc:Depends},
|
||||
${shlibs:Depends},
|
||||
kylin-device-daemon (>=3.20.0.0),
|
||||
libkysdk-system
|
||||
Provides: ukui-indicators
|
||||
Suggests: ukui-window-switch (>=3.0.0-3),
|
||||
time-shutdown
|
||||
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,395 @@
|
|||
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-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-panel.1
|
||||
man/ukui-flash-disk.1
|
|
@ -0,0 +1,26 @@
|
|||
#!/usr/bin/make -f
|
||||
# export DH_VERBOSE=1
|
||||
|
||||
export LC_ALL=C.UTF-8
|
||||
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
|
||||
|
||||
WHICH_OS := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS 2>/dev/null)
|
||||
|
||||
ifeq ($(WHICH_OS), kfreebsd)
|
||||
NOT_LINUX := -DCPULOAD_PLUGIN=NO -DNETWORKMONITOR_PLUGIN=NO -DVOLUME_PLUGIN=NO
|
||||
endif
|
||||
|
||||
ifeq ($(WHICH_OS), hurd)
|
||||
NOT_LINUX := -DCPULOAD_PLUGIN=NO -DNETWORKMONITOR_PLUGIN=NO -DVOLUME_PLUGIN=NO -DSENSORS_PLUGIN=NO
|
||||
endif
|
||||
|
||||
%:
|
||||
dh ${@} --buildsystem cmake
|
||||
|
||||
override_dh_auto_configure:
|
||||
dh_auto_configure -- -D_FORTIFY_SOURCE=2\
|
||||
-DPULL_TRANSLATIONS=OFF \
|
||||
-DUPDATE_TRANSLATIONS=OFF \
|
||||
-DDOM_PLUGIN=OFF \
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
$(NOT_LINUX)
|
|
@ -0,0 +1 @@
|
|||
3.0 (native)
|
|
@ -0,0 +1 @@
|
|||
tar-ignore=.gitignore
|
|
@ -0,0 +1,14 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
glib-compile-schemas /usr/share/glib-2.0/schemas/
|
||||
|
||||
#判断命令是否存在
|
||||
if [ -x /usr/share/kylin-system-updater/kylin-reboot-required ]; then
|
||||
#执行请求重启提示
|
||||
/usr/share/kylin-system-updater/kylin-reboot-required
|
||||
fi
|
||||
|
||||
|
||||
#DEBHELPER#
|
|
@ -0,0 +1,2 @@
|
|||
version=4
|
||||
https://github.com/ukui/ukui-panel/releases .*/ukui-panel_(\d\S+)\.orig\.tar\.gz
|
|
@ -0,0 +1,24 @@
|
|||
+ukui-panel (3.0.1-42) v101; urgency=medium
|
||||
+
|
||||
+ * 更新任务栏高分屏适配代码 Link#28059
|
||||
+ 提供给输入法显示toolTips的相关接口 Link #20236
|
||||
+ 点击快速启动栏打开应用改为gio的方式加载 Link #24172
|
||||
+ 解决任务栏注释出现的段错误问题 Link #29586
|
||||
+
|
||||
+ -- hepuyao <hepuyao@kylinos.cn> Thu, 24 Dec 2020 15:10:02 +0800
|
||||
+
|
||||
+ukui-panel (3.0.1-40~1224) v101; urgency=medium
|
||||
+
|
||||
+ * 解决u盘图标不消失的问题
|
||||
+
|
||||
+ -- hepuyao <hepuyao@kylinos.cn> Fri, 11 Dec 2020 13:49:52 +0800
|
||||
+
|
||||
+ukui-panel (3.0.1-39) v101; urgency=medium
|
||||
+
|
||||
+ * 任务栏判断配置文件异常
|
||||
+ 解决翻译文件“睡眠”和“休眠”统一 #27572
|
||||
+ 任务栏托盘图标高亮逻辑优化 #22328
|
||||
+ 修改判断右键是否需要添加系统监视器的接口
|
||||
+
|
||||
+ -- hepuyao <hepuyao@kylinos.cn> Thu, 10 Dec 2020 20:25:05 +0800
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
Qt拖放(1):拖放基本原理(QDrag类)
|
||||
https://blog.csdn.net/hyongilfmmm/article/details/83238239
|
||||
QT---之Q_D和d指针概念2
|
||||
https://blog.csdn.net/weixin_39609623/article/details/83152662
|
||||
Qt中使用Q指针和D指针
|
||||
https://blog.csdn.net/u013399898/article/details/83930426
|
Binary file not shown.
|
@ -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,64 @@
|
|||
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)
|
||||
|
||||
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,327 @@
|
|||
/*
|
||||
* 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>
|
||||
|
||||
|
||||
ConvertDesktopToWinId::ConvertDesktopToWinId()
|
||||
{
|
||||
//connect(KWindowSystem::self(), &KWindowSystem::windowAdded, this, &ConvertDesktopToWinId::tranIdToDesktop);
|
||||
}
|
||||
|
||||
QString ConvertDesktopToWinId::tranIdToDesktop(WId id)
|
||||
{
|
||||
QString desktopName = confirmDesktopFile(id);
|
||||
qDebug() << "desktopName is :" << desktopName;
|
||||
return desktopName;
|
||||
}
|
||||
|
||||
QString ConvertDesktopToWinId::confirmDesktopFile(WId id)
|
||||
{
|
||||
KWindowInfo info(id, 0, NET::WM2AllProperties);
|
||||
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_classClass = info.windowClassClass().toLower();
|
||||
m_className = info.windowClassName();
|
||||
|
||||
//匹配安卓兼容
|
||||
if (m_className == "kylin-kmre-window") {
|
||||
searchAndroidApp(info);
|
||||
return m_desktopfilePath;
|
||||
}
|
||||
|
||||
//匹配Inter端腾讯教育
|
||||
if (m_className == "txeduplatform") {
|
||||
searchTXeduApp(id);
|
||||
return m_desktopfilePath;
|
||||
}
|
||||
|
||||
QFile file(QString("/proc/%1/status").arg(info.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(info);
|
||||
}
|
||||
|
||||
//第三种方法:比较cmd命令行操作一致性
|
||||
if (m_desktopfilePath.isEmpty()) {
|
||||
QFile file(QString("/proc/%1/cmdline").arg(info.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(KWindowInfo info)
|
||||
{
|
||||
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(info.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(KWindowInfo info)
|
||||
{
|
||||
QFile file("/proc/" + QString::number(info.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_classClass || 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,86 @@
|
|||
/*
|
||||
* 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 "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_classClass = 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(WId id);
|
||||
|
||||
private:
|
||||
QString confirmDesktopFile(WId id);
|
||||
void searchFromEnviron(KWindowInfo info);
|
||||
void searchAndroidApp(KWindowInfo info);
|
||||
void searchTXeduApp(WId id);
|
||||
void compareClassName();
|
||||
void compareCmdExec();
|
||||
void compareLastStrategy();
|
||||
void compareCmdName();
|
||||
void compareDesktopClass();
|
||||
void containsName();
|
||||
QString getDesktopFileName(QString cmd);
|
||||
};
|
||||
|
||||
#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,82 @@
|
|||
/*
|
||||
* 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)
|
||||
{
|
||||
//兼容处理,传入desktop路径和文件名都可以匹配
|
||||
QString desktopName;
|
||||
if(desktop.contains("/")) {
|
||||
desktopName = desktop.section('/', -1, -1);
|
||||
} else
|
||||
desktopName = desktop;
|
||||
QString fixdDesktopName;
|
||||
const auto apps = getTaskbarFixedList();
|
||||
for (const QMap<QString, QVariant> &app : apps) {
|
||||
fixdDesktopName = app.value("desktop", "").toString().section('/', -1, -1);
|
||||
if (fixdDesktopName.contains(desktopName)) {
|
||||
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();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* 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 WATCHERMANAGER_H
|
||||
#define WATCHERMANAGER_H
|
||||
|
||||
#include <QObject>
|
||||
#include "filewatcher/filewatcher.h"
|
||||
|
||||
#include "dbus-server/server.h"
|
||||
#include "dbus-server/dbus-adaptor.h"
|
||||
#include "pin-totaskbar/pintotaskbar.h"
|
||||
#include "pin-totaskbar/taskbar-dbus-adaptor.h"
|
||||
|
||||
class WatcherManager : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit WatcherManager(QObject *parent = nullptr);
|
||||
~WatcherManager();
|
||||
private:
|
||||
void register_dbus();
|
||||
|
||||
PinToTaskbar* m_taskbarDBus;
|
||||
};
|
||||
|
||||
#endif // WATCHERMANAGER_H
|
|
@ -1,13 +0,0 @@
|
|||
cmake_minimum_required(VERSION 3.16)
|
||||
project(qtsingleapplication)
|
||||
|
||||
find_package(Qt5 COMPONENTS
|
||||
Core Gui Widgets Network
|
||||
REQUIRED)
|
||||
|
||||
include_directories(src)
|
||||
set(SRCS src/qtsingleapplication.h src/qtsingleapplication.cpp src/qtlocalpeer.h src/qtlocalpeer.cpp)
|
||||
|
||||
add_library(${PROJECT_NAME} STATIC ${SRCS})
|
||||
target_include_directories(${PROJECT_NAME} PRIVATE src)
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Network)
|
|
@ -1,254 +0,0 @@
|
|||
INSTALLATION INSTRUCTIONS
|
||||
|
||||
These instructions refer to the package you are installing as
|
||||
some-package.tar.gz or some-package.zip. The .zip file is intended for use
|
||||
on Windows.
|
||||
|
||||
The directory you choose for the installation will be referred to as
|
||||
your-install-dir.
|
||||
|
||||
Note to Qt Visual Studio Integration users: In the instructions below,
|
||||
instead of building from command line with nmake, you can use the menu
|
||||
command 'Qt->Open Solution from .pro file' on the .pro files in the
|
||||
example and plugin directories, and then build from within Visual
|
||||
Studio.
|
||||
|
||||
Unpacking and installation
|
||||
--------------------------
|
||||
|
||||
1. Unpacking the archive (if you have not done so already).
|
||||
|
||||
On Unix and Mac OS X (in a terminal window):
|
||||
|
||||
cd your-install-dir
|
||||
gunzip some-package.tar.gz
|
||||
tar xvf some-package.tar
|
||||
|
||||
This creates the subdirectory some-package containing the files.
|
||||
|
||||
On Windows:
|
||||
|
||||
Unpack the .zip archive by right-clicking it in explorer and
|
||||
choosing "Extract All...". If your version of Windows does not
|
||||
have zip support, you can use the infozip tools available
|
||||
from www.info-zip.org.
|
||||
|
||||
If you are using the infozip tools (in a command prompt window):
|
||||
cd your-install-dir
|
||||
unzip some-package.zip
|
||||
|
||||
2. Configuring the package.
|
||||
|
||||
The configure script is called "configure" on unix/mac and
|
||||
"configure.bat" on Windows. It should be run from a command line
|
||||
after cd'ing to the package directory.
|
||||
|
||||
You can choose whether you want to use the component by including
|
||||
its source code directly into your project, or build the component
|
||||
as a dynamic shared library (DLL) that is loaded into the
|
||||
application at run-time. The latter may be preferable for
|
||||
technical or licensing (LGPL) reasons. If you want to build a DLL,
|
||||
run the configure script with the argument "-library". Also see
|
||||
the note about usage below.
|
||||
|
||||
(Components that are Qt plugins, e.g. styles and image formats,
|
||||
are by default built as a plugin DLL.)
|
||||
|
||||
The configure script will prompt you in some cases for further
|
||||
information. Answer these questions and carefully read the license text
|
||||
before accepting the license conditions. The package cannot be used if
|
||||
you do not accept the license conditions.
|
||||
|
||||
3. Building the component and examples (when required).
|
||||
|
||||
If a DLL is to be built, or if you would like to build the
|
||||
examples, next give the commands
|
||||
|
||||
qmake
|
||||
make [or nmake if your are using Microsoft Visual C++]
|
||||
|
||||
The example program(s) can be found in the directory called
|
||||
"examples" or "example".
|
||||
|
||||
Components that are Qt plugins, e.g. styles and image formats, are
|
||||
ready to be used as soon as they are built, so the rest of this
|
||||
installation instruction can be skipped.
|
||||
|
||||
4. Building the Qt Designer plugin (optional).
|
||||
|
||||
Some of the widget components are provided with plugins for Qt
|
||||
Designer. To build and install the plugin, cd into the
|
||||
some-package/plugin directory and give the commands
|
||||
|
||||
qmake
|
||||
make [or nmake if your are using Microsoft Visual C++]
|
||||
|
||||
Restart Qt Designer to make it load the new widget plugin.
|
||||
|
||||
Note: If you are using the built-in Qt Designer from the Qt Visual
|
||||
Studio Integration, you will need to manually copy the plugin DLL
|
||||
file, i.e. copy
|
||||
%QTDIR%\plugins\designer\some-component.dll
|
||||
to the Qt Visual Studio Integration plugin path, typically:
|
||||
C:\Program Files\Trolltech\Qt VS Integration\plugins
|
||||
|
||||
Note: If you for some reason are using a Qt Designer that is built
|
||||
in debug mode, you will need to build the plugin in debug mode
|
||||
also. Edit the file plugin.pro in the plugin directory, changing
|
||||
'release' to 'debug' in the CONFIG line, before running qmake.
|
||||
|
||||
|
||||
|
||||
Solutions components are intended to be used directly from the package
|
||||
directory during development, so there is no 'make install' procedure.
|
||||
|
||||
|
||||
Using a component in your project
|
||||
---------------------------------
|
||||
|
||||
To use this component in your project, add the following line to the
|
||||
project's .pro file (or do the equivalent in your IDE):
|
||||
|
||||
include(your-install-dir/some-package/src/some-package.pri)
|
||||
|
||||
This adds the package's sources and headers to the SOURCES and HEADERS
|
||||
project variables respectively (or, if the component has been
|
||||
configured as a DLL, it adds that library to the LIBS variable), and
|
||||
updates INCLUDEPATH to contain the package's src
|
||||
directory. Additionally, the .pri file may include some dependencies
|
||||
needed by the package.
|
||||
|
||||
To include a header file from the package in your sources, you can now
|
||||
simply use:
|
||||
|
||||
#include <SomeClass>
|
||||
|
||||
or alternatively, in pre-Qt 4 style:
|
||||
|
||||
#include <some-class.h>
|
||||
|
||||
Refer to the documentation to see the classes and headers this
|
||||
components provides.
|
||||
|
||||
|
||||
|
||||
Install documentation (optional)
|
||||
--------------------------------
|
||||
|
||||
The HTML documentation for the package's classes is located in the
|
||||
your-install-dir/some-package/doc/html/index.html. You can open this
|
||||
file and read the documentation with any web browser.
|
||||
|
||||
To install the documentation into Qt Assistant (for Qt version 4.4 and
|
||||
later):
|
||||
|
||||
1. In Assistant, open the Edit->Preferences dialog and choose the
|
||||
Documentation tab. Click the Add... button and select the file
|
||||
your-install-dir/some-package/doc/html/some-package.qch
|
||||
|
||||
For Qt versions prior to 4.4, do instead the following:
|
||||
|
||||
1. The directory your-install-dir/some-package/doc/html contains a
|
||||
file called some-package.dcf. Execute the following commands in a
|
||||
shell, command prompt or terminal window:
|
||||
|
||||
cd your-install-dir/some-package/doc/html/
|
||||
assistant -addContentFile some-package.dcf
|
||||
|
||||
The next time you start Qt Assistant, you can access the package's
|
||||
documentation.
|
||||
|
||||
|
||||
Removing the documentation from assistant
|
||||
-----------------------------------------
|
||||
|
||||
If you have installed the documentation into Qt Assistant, and want to uninstall it, do as follows, for Qt version 4.4 and later:
|
||||
|
||||
1. In Assistant, open the Edit->Preferences dialog and choose the
|
||||
Documentation tab. In the list of Registered Documentation, select
|
||||
the item com.nokia.qtsolutions.some-package_version, and click
|
||||
the Remove button.
|
||||
|
||||
For Qt versions prior to 4.4, do instead the following:
|
||||
|
||||
1. The directory your-install-dir/some-package/doc/html contains a
|
||||
file called some-package.dcf. Execute the following commands in a
|
||||
shell, command prompt or terminal window:
|
||||
|
||||
cd your-install-dir/some-package/doc/html/
|
||||
assistant -removeContentFile some-package.dcf
|
||||
|
||||
|
||||
|
||||
Using the component as a DLL
|
||||
----------------------------
|
||||
|
||||
1. Normal components
|
||||
|
||||
The shared library (DLL) is built and placed in the
|
||||
some-package/lib directory. It is intended to be used directly
|
||||
from there during development. When appropriate, both debug and
|
||||
release versions are built, since the run-time linker will in some
|
||||
cases refuse to load a debug-built DLL into a release-built
|
||||
application or vice versa.
|
||||
|
||||
The following steps are taken by default to help the dynamic
|
||||
linker to locate the DLL at run-time (during development):
|
||||
|
||||
Unix: The some-package.pri file will add linker instructions to
|
||||
add the some-package/lib directory to the rpath of the
|
||||
executable. (When distributing, or if your system does not support
|
||||
rpath, you can copy the shared library to another place that is
|
||||
searched by the dynamic linker, e.g. the "lib" directory of your
|
||||
Qt installation.)
|
||||
|
||||
Mac: The full path to the library is hardcoded into the library
|
||||
itself, from where it is copied into the executable at link time,
|
||||
and ready by the dynamic linker at run-time. (When distributing,
|
||||
you will want to edit these hardcoded paths in the same way as for
|
||||
the Qt DLLs. Refer to the document "Deploying an Application on
|
||||
Mac OS X" in the Qt Reference Documentation.)
|
||||
|
||||
Windows: the .dll file(s) are copied into the "bin" directory of
|
||||
your Qt installation. The Qt installation will already have set up
|
||||
that directory to be searched by the dynamic linker.
|
||||
|
||||
|
||||
2. Plugins
|
||||
|
||||
For Qt Solutions plugins (e.g. image formats), both debug and
|
||||
release versions of the plugin are built by default when
|
||||
appropriate, since in some cases the release Qt library will not
|
||||
load a debug plugin, and vice versa. The plugins are automatically
|
||||
copied into the plugins directory of your Qt installation when
|
||||
built, so no further setup is required.
|
||||
|
||||
Plugins may also be built statically, i.e. as a library that will be
|
||||
linked into your application executable, and so will not need to
|
||||
be redistributed as a separate plugin DLL to end users. Static
|
||||
building is required if Qt itself is built statically. To do it,
|
||||
just add "static" to the CONFIG variable in the plugin/plugin.pro
|
||||
file before building. Refer to the "Static Plugins" section in the
|
||||
chapter "How to Create Qt Plugins" for explanation of how to use a
|
||||
static plugin in your application. The source code of the example
|
||||
program(s) will also typically contain the relevant instructions
|
||||
as comments.
|
||||
|
||||
|
||||
|
||||
Uninstalling
|
||||
------------
|
||||
|
||||
The following command will remove any fils that have been
|
||||
automatically placed outside the package directory itself during
|
||||
installation and building
|
||||
|
||||
make distclean [or nmake if your are using Microsoft Visual C++]
|
||||
|
||||
If Qt Assistant documentation or Qt Designer plugins have been
|
||||
installed, they can be uninstalled manually, ref. above.
|
||||
|
||||
|
||||
Enjoy! :)
|
||||
|
||||
- The Qt Solutions Team.
|
|
@ -1,33 +0,0 @@
|
|||
Qt Solutions Component: Single Application
|
||||
|
||||
The QtSingleApplication component provides support for
|
||||
applications that can be only started once per user.
|
||||
|
||||
|
||||
|
||||
Version history:
|
||||
|
||||
2.0: - Version 1.3 ported to Qt 4.
|
||||
|
||||
2.1: - Fix compilation problem on Mac.
|
||||
|
||||
2.2: - Really fix the Mac compilation problem.
|
||||
- Mac: fix crash due to wrong object releasing.
|
||||
- Mac: Fix memory leak.
|
||||
|
||||
2.3: - Windows: Force creation of internal widget to make it work
|
||||
with Qt 4.2.
|
||||
|
||||
2.4: - Fix the system for automatic window raising on message
|
||||
reception. NOTE: minor API change.
|
||||
|
||||
2.5: - Mac: Fix isRunning() to work and report correctly.
|
||||
|
||||
2.6: - - initialize() is now obsolete, no longer necessary to call
|
||||
it
|
||||
- - Fixed race condition where multiple instances migth be started
|
||||
- - QtSingleCoreApplication variant provided for non-GUI (console)
|
||||
usage
|
||||
- Complete reimplementation. Visible changes:
|
||||
- LGPL release.
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
TEMPLATE=lib
|
||||
CONFIG += qt dll qtsingleapplication-buildlib
|
||||
mac:CONFIG += absolute_library_soname
|
||||
win32|mac:!wince*:!win32-msvc:!macx-xcode:CONFIG += debug_and_release build_all
|
||||
include(../src/qtsingleapplication.pri)
|
||||
TARGET = $$QTSINGLEAPPLICATION_LIBNAME
|
||||
DESTDIR = $$QTSINGLEAPPLICATION_LIBDIR
|
||||
win32 {
|
||||
DLLDESTDIR = $$[QT_INSTALL_BINS]
|
||||
QMAKE_DISTCLEAN += $$[QT_INSTALL_BINS]\\$${QTSINGLEAPPLICATION_LIBNAME}.dll
|
||||
}
|
||||
target.path = $$DESTDIR
|
||||
INSTALLS += target
|
|
@ -1,14 +0,0 @@
|
|||
exists(config.pri):infile(config.pri, SOLUTIONS_LIBRARY, yes): CONFIG += qtsingleapplication-uselib
|
||||
|
||||
TEMPLATE += fakelib
|
||||
greaterThan(QT_MAJOR_VERSION, 5)|\
|
||||
if(equals(QT_MAJOR_VERSION, 5):greaterThan(QT_MINOR_VERSION, 4))|\
|
||||
if(equals(QT_MAJOR_VERSION, 5):equals(QT_MINOR_VERSION, 4):greaterThan(QT_PATCH_VERSION, 1)) {
|
||||
QTSINGLEAPPLICATION_LIBNAME = $$qt5LibraryTarget(QtSolutions_SingleApplication-head)
|
||||
} else {
|
||||
QTSINGLEAPPLICATION_LIBNAME = $$qtLibraryTarget(QtSolutions_SingleApplication-head)
|
||||
}
|
||||
TEMPLATE -= fakelib
|
||||
|
||||
QTSINGLEAPPLICATION_LIBDIR = $$PWD/lib
|
||||
unix:qtsingleapplication-uselib:!qtsingleapplication-buildlib:QMAKE_RPATHDIR += $$QTSINGLEAPPLICATION_LIBDIR
|
|
@ -1,25 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ "x$1" != "x" -a "x$1" != "x-library" ]; then
|
||||
echo "Usage: $0 [-library]"
|
||||
echo
|
||||
echo "-library: Build the component as a dynamic library (DLL). Default is to"
|
||||
echo " include the component source code directly in the application."
|
||||
echo
|
||||
exit 0
|
||||
fi
|
||||
|
||||
rm -f config.pri
|
||||
if [ "x$1" = "x-library" ]; then
|
||||
echo "Configuring to build this component as a dynamic library."
|
||||
echo "SOLUTIONS_LIBRARY = yes" > config.pri
|
||||
fi
|
||||
|
||||
echo
|
||||
echo "This component is now configured."
|
||||
echo
|
||||
echo "To build the component library (if requested) and example(s),"
|
||||
echo "run qmake and your make command."
|
||||
echo
|
||||
echo "To remove or reconfigure, run make distclean."
|
||||
echo
|
|
@ -1,43 +0,0 @@
|
|||
:: Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
||||
:: SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
@echo off
|
||||
|
||||
rem
|
||||
rem "Main"
|
||||
rem
|
||||
|
||||
if not "%1"=="" (
|
||||
if not "%1"=="-library" (
|
||||
call :PrintUsage
|
||||
goto EOF
|
||||
)
|
||||
)
|
||||
|
||||
if exist config.pri. del config.pri
|
||||
if "%1"=="-library" (
|
||||
echo Configuring to build this component as a dynamic library.
|
||||
echo SOLUTIONS_LIBRARY = yes > config.pri
|
||||
)
|
||||
|
||||
echo .
|
||||
echo This component is now configured.
|
||||
echo .
|
||||
echo To build the component library (if requested) and example(s),
|
||||
echo run qmake and your make or nmake command.
|
||||
echo .
|
||||
echo To remove or reconfigure, run make (nmake) distclean.
|
||||
echo .
|
||||
goto EOF
|
||||
|
||||
:PrintUsage
|
||||
echo Usage: configure.bat [-library]
|
||||
echo .
|
||||
echo -library: Build the component as a dynamic library (DLL). Default is to
|
||||
echo include the component source directly in the application.
|
||||
echo A DLL may be preferable for technical or licensing (LGPL) reasons.
|
||||
echo .
|
||||
goto EOF
|
||||
|
||||
|
||||
:EOF
|
|
@ -1,284 +0,0 @@
|
|||
BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV {
|
||||
font-family: Arial, Geneva, Helvetica, sans-serif;
|
||||
}
|
||||
H1 {
|
||||
text-align: center;
|
||||
font-size: 160%;
|
||||
}
|
||||
H2 {
|
||||
font-size: 120%;
|
||||
}
|
||||
H3 {
|
||||
font-size: 100%;
|
||||
}
|
||||
|
||||
h3.fn,span.fn
|
||||
{
|
||||
background-color: #eee;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: #ddd;
|
||||
font-weight: bold;
|
||||
padding: 6px 0px 6px 10px;
|
||||
margin: 42px 0px 0px 0px;
|
||||
}
|
||||
|
||||
hr {
|
||||
border: 0;
|
||||
color: #a0a0a0;
|
||||
background-color: #ccc;
|
||||
height: 1px;
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
margin: 34px 0px 34px 0px;
|
||||
}
|
||||
|
||||
table.valuelist {
|
||||
border-width: 1px 1px 1px 1px;
|
||||
border-style: solid;
|
||||
border-color: #dddddd;
|
||||
border-collapse: collapse;
|
||||
background-color: #f0f0f0;
|
||||
}
|
||||
|
||||
table.indextable {
|
||||
border-width: 1px 1px 1px 1px;
|
||||
border-style: solid;
|
||||
border-collapse: collapse;
|
||||
background-color: #f0f0f0;
|
||||
border-color:#555;
|
||||
font-size: 100%;
|
||||
}
|
||||
|
||||
table td.largeindex {
|
||||
border-width: 1px 1px 1px 1px;
|
||||
border-collapse: collapse;
|
||||
background-color: #f0f0f0;
|
||||
border-color:#555;
|
||||
font-size: 120%;
|
||||
}
|
||||
|
||||
table.valuelist th {
|
||||
border-width: 1px 1px 1px 2px;
|
||||
padding: 4px;
|
||||
border-style: solid;
|
||||
border-color: #666;
|
||||
color:white;
|
||||
background-color:#666;
|
||||
}
|
||||
|
||||
th.titleheader {
|
||||
border-width: 1px 0px 1px 0px;
|
||||
padding: 2px;
|
||||
border-style: solid;
|
||||
border-color: #666;
|
||||
color:white;
|
||||
background-color:#555;
|
||||
background-image:url('images/gradient.png')};
|
||||
background-repeat: repeat-x;
|
||||
font-size: 100%;
|
||||
}
|
||||
|
||||
|
||||
th.largeheader {
|
||||
border-width: 1px 0px 1px 0px;
|
||||
padding: 4px;
|
||||
border-style: solid;
|
||||
border-color: #444;
|
||||
color:white;
|
||||
background-color:#555555;
|
||||
font-size: 120%;
|
||||
}
|
||||
|
||||
p {
|
||||
|
||||
margin-left: 4px;
|
||||
margin-top: 8px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
a:link
|
||||
{
|
||||
color: #0046ad;
|
||||
text-decoration: none
|
||||
}
|
||||
|
||||
a:visited
|
||||
{
|
||||
color: #672967;
|
||||
text-decoration: none
|
||||
}
|
||||
|
||||
a.obsolete
|
||||
{
|
||||
color: #661100;
|
||||
text-decoration: none
|
||||
}
|
||||
|
||||
a.compat
|
||||
{
|
||||
color: #661100;
|
||||
text-decoration: none
|
||||
}
|
||||
|
||||
a.obsolete:visited
|
||||
{
|
||||
color: #995500;
|
||||
text-decoration: none
|
||||
}
|
||||
|
||||
a.compat:visited
|
||||
{
|
||||
color: #995500;
|
||||
text-decoration: none
|
||||
}
|
||||
|
||||
body
|
||||
{
|
||||
background: #ffffff;
|
||||
color: black
|
||||
}
|
||||
|
||||
table.generic, table.annotated
|
||||
{
|
||||
border-width: 1px;
|
||||
border-color:#bbb;
|
||||
border-style:solid;
|
||||
border-collapse:collapse;
|
||||
}
|
||||
|
||||
table td.memItemLeft {
|
||||
width: 180px;
|
||||
padding: 2px 0px 0px 8px;
|
||||
margin: 4px;
|
||||
border-width: 1px;
|
||||
border-color: #E0E0E0;
|
||||
border-style: none;
|
||||
font-size: 100%;
|
||||
white-space: nowrap
|
||||
}
|
||||
|
||||
table td.memItemRight {
|
||||
padding: 2px 8px 0px 8px;
|
||||
margin: 4px;
|
||||
border-width: 1px;
|
||||
border-color: #E0E0E0;
|
||||
border-style: none;
|
||||
font-size: 100%;
|
||||
}
|
||||
|
||||
table tr.odd {
|
||||
background: #f0f0f0;
|
||||
color: black;
|
||||
}
|
||||
|
||||
table tr.even {
|
||||
background: #e4e4e4;
|
||||
color: black;
|
||||
}
|
||||
|
||||
table.annotated th {
|
||||
padding: 3px;
|
||||
text-align: left
|
||||
}
|
||||
|
||||
table.annotated td {
|
||||
padding: 3px;
|
||||
}
|
||||
|
||||
table tr pre
|
||||
{
|
||||
padding-top: 0px;
|
||||
padding-bottom: 0px;
|
||||
padding-left: 0px;
|
||||
padding-right: 0px;
|
||||
border: none;
|
||||
background: none
|
||||
}
|
||||
|
||||
tr.qt-style
|
||||
{
|
||||
background: #96E066;
|
||||
color: black
|
||||
}
|
||||
|
||||
body pre
|
||||
{
|
||||
padding: 0.2em;
|
||||
border: #e7e7e7 1px solid;
|
||||
background: #f1f1f1;
|
||||
color: black
|
||||
}
|
||||
|
||||
table tr.qt-code pre
|
||||
{
|
||||
padding: 0.2em;
|
||||
border: #e7e7e7 1px solid;
|
||||
background: #f1f1f1;
|
||||
color: black
|
||||
}
|
||||
|
||||
span.preprocessor, span.preprocessor a
|
||||
{
|
||||
color: darkblue;
|
||||
}
|
||||
|
||||
span.comment
|
||||
{
|
||||
color: darkred;
|
||||
font-style: italic
|
||||
}
|
||||
|
||||
span.string,span.char
|
||||
{
|
||||
color: darkgreen;
|
||||
}
|
||||
|
||||
.title
|
||||
{
|
||||
text-align: center
|
||||
}
|
||||
|
||||
.subtitle
|
||||
{
|
||||
font-size: 0.8em
|
||||
}
|
||||
|
||||
.small-subtitle
|
||||
{
|
||||
font-size: 0.65em
|
||||
}
|
||||
|
||||
.qmlitem {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.qmlname {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.qmltype {
|
||||
text-align: center;
|
||||
font-size: 160%;
|
||||
}
|
||||
|
||||
.qmlproto {
|
||||
background-color: #eee;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: #ddd;
|
||||
font-weight: bold;
|
||||
padding: 6px 10px 6px 10px;
|
||||
margin: 42px 0px 0px 0px;
|
||||
}
|
||||
|
||||
.qmlreadonly {
|
||||
float: right;
|
||||
color: red
|
||||
}
|
||||
|
||||
.qmldoc {
|
||||
}
|
||||
|
||||
*.qmlitem p {
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 4.0 KiB |
|
@ -1,48 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<!-- index.qdoc -->
|
||||
<head>
|
||||
<title>Single Application</title>
|
||||
<link href="classic.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td align="left" valign="top" width="32"><img src="images/qt-logo.png" align="left" width="57" height="67" border="0" /></td>
|
||||
<td width="1"> </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a></td>
|
||||
</tr></table><h1 class="title">Single Application<br /><span class="subtitle"></span>
|
||||
</h1>
|
||||
<a name="description"></a>
|
||||
<h2>Description</h2>
|
||||
<p>The <a href="qtsingleapplication.html">QtSingleApplication</a> component provides support for applications that can be only started once per user.</p>
|
||||
<p>For some applications it is useful or even critical that they are started only once by any user. Future attempts to start the application should activate any already running instance, and possibly perform requested actions, e.g. loading a file, in that instance.</p>
|
||||
<p>The <a href="qtsingleapplication.html">QtSingleApplication</a> class provides an interface to detect a running instance, and to send command strings to that instance. For console (non-GUI) applications, the <a href="qtsinglecoreapplication.html">QtSingleCoreApplication</a> variant is provided, which avoids dependency on <a href="http://qt.nokia.com/doc/4.6/qtgui.html">QtGui</a>.</p>
|
||||
<a name="classes"></a>
|
||||
<h2>Classes</h2>
|
||||
<ul>
|
||||
<li><a href="qtsingleapplication.html">QtSingleApplication</a></li>
|
||||
<li><a href="qtsinglecoreapplication.html">QtSingleCoreApplication</a></li>
|
||||
</ul>
|
||||
<a name="examples"></a>
|
||||
<h2>Examples</h2>
|
||||
<ul>
|
||||
<li><a href="qtsingleapplication-example-trivial.html">A Trivial Example</a></li>
|
||||
<li><a href="qtsingleapplication-example-loader.html">Loading Documents</a></li>
|
||||
<li><a href="qtsinglecoreapplication-example-console.html">A Non-GUI Example</a></li>
|
||||
</ul>
|
||||
<a name="tested-platforms"></a>
|
||||
<h2>Tested platforms</h2>
|
||||
<ul>
|
||||
<li>Qt 4.4, 4.5 / Windows XP / MSVC.NET 2005</li>
|
||||
<li>Qt 4.4, 4.5 / Linux / gcc</li>
|
||||
<li>Qt 4.4, 4.5 / MacOS X 10.5 / gcc</li>
|
||||
</ul>
|
||||
<p /><address><hr /><div align="center">
|
||||
<table width="100%" cellspacing="0" border="0"><tr class="address">
|
||||
<td width="30%" align="left">Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies)</td>
|
||||
<td width="40%" align="center"><a href="http://qt.nokia.com/doc/trademarks.html">Trademarks</a></td>
|
||||
<td width="30%" align="right"><div align="right">Qt Solutions</div></td>
|
||||
</tr></table></div></address></body>
|
||||
</html>
|
|
@ -1,175 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<!-- loader.qdoc -->
|
||||
<head>
|
||||
<title>Loading Documents</title>
|
||||
<link href="classic.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td align="left" valign="top" width="32"><img src="images/qt-logo.png" align="left" width="57" height="67" border="0" /></td>
|
||||
<td width="1"> </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a></td>
|
||||
</tr></table><h1 class="title">Loading Documents<br /><span class="subtitle"></span>
|
||||
</h1>
|
||||
<p>The application in this example loads or prints the documents passed as commandline parameters to further instances of this application.</p>
|
||||
<pre><span class="comment"> /****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of the Qt Solutions component.
|
||||
**
|
||||
** You may use this file under the terms of the BSD license as follows:
|
||||
**
|
||||
** "Redistribution and use in source and binary forms, with or without
|
||||
** modification, are permitted provided that the following conditions are
|
||||
** met:
|
||||
** * Redistributions of source code must retain the above copyright
|
||||
** notice, this list of conditions and the following disclaimer.
|
||||
** * Redistributions in binary form must reproduce the above copyright
|
||||
** notice, this list of conditions and the following disclaimer in
|
||||
** the documentation and/or other materials provided with the
|
||||
** distribution.
|
||||
** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
|
||||
** the names of its contributors may be used to endorse or promote
|
||||
** products derived from this software without specific prior written
|
||||
** permission.
|
||||
**
|
||||
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
||||
**
|
||||
****************************************************************************/</span>
|
||||
|
||||
#include <qtsingleapplication.h>
|
||||
#include <QtCore/QFile>
|
||||
#include <QtGui/QMainWindow>
|
||||
#include <QtGui/QPrinter>
|
||||
#include <QtGui/QPainter>
|
||||
#include <QtGui/QTextEdit>
|
||||
#include <QtGui/QMdiArea>
|
||||
#include <QtCore/QTextStream>
|
||||
|
||||
class MainWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
MainWindow();
|
||||
|
||||
public slots:
|
||||
void handleMessage(const QString& message);
|
||||
|
||||
signals:
|
||||
void needToShow();
|
||||
|
||||
private:
|
||||
QMdiArea *workspace;
|
||||
};</pre>
|
||||
<p>The user interface in this application is a <a href="http://qt.nokia.com/doc/4.6/qmainwindow.html">QMainWindow</a> subclass with a <a href="http://qt.nokia.com/doc/4.6/qmdiarea.html">QMdiArea</a> as the central widget. It implements a slot <tt>handleMessage()</tt> that will be connected to the messageReceived() signal of the <a href="qtsingleapplication.html">QtSingleApplication</a> class.</p>
|
||||
<pre> MainWindow::MainWindow()
|
||||
{
|
||||
workspace = new QMdiArea(this);
|
||||
|
||||
setCentralWidget(workspace);
|
||||
}</pre>
|
||||
<p>The <a href="http://qt.nokia.com/doc/4.6/designer-to-know.html">MainWindow</a> constructor creates a minimal user interface.</p>
|
||||
<pre> void MainWindow::handleMessage(const QString& message)
|
||||
{
|
||||
enum Action {
|
||||
Nothing,
|
||||
Open,
|
||||
Print
|
||||
} action;
|
||||
|
||||
action = Nothing;
|
||||
QString filename = message;
|
||||
if (message.toLower().startsWith("/print ")) {
|
||||
filename = filename.mid(7);
|
||||
action = Print;
|
||||
} else if (!message.isEmpty()) {
|
||||
action = Open;
|
||||
}
|
||||
if (action == Nothing) {
|
||||
emit needToShow();
|
||||
return;
|
||||
}
|
||||
|
||||
QFile file(filename);
|
||||
QString contents;
|
||||
if (file.open(QIODevice::ReadOnly))
|
||||
contents = file.readAll();
|
||||
else
|
||||
contents = "[[Error: Could not load file " + filename + "]]";
|
||||
|
||||
QTextEdit *view = new QTextEdit;
|
||||
view->setPlainText(contents);
|
||||
|
||||
switch(action) {</pre>
|
||||
<p>The handleMessage() slot interprets the message passed in as a filename that can be prepended with <i>/print</i> to indicate that the file should just be printed rather than loaded.</p>
|
||||
<pre> case Print:
|
||||
{
|
||||
QPrinter printer;
|
||||
view->print(&printer);
|
||||
delete view;
|
||||
}
|
||||
break;
|
||||
|
||||
case Open:
|
||||
{
|
||||
workspace->addSubWindow(view);
|
||||
view->setWindowTitle(message);
|
||||
view->show();
|
||||
emit needToShow();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
}</pre>
|
||||
<p>Loading the file will also activate the window.</p>
|
||||
<pre> #include "main.moc"
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
QtSingleApplication instance("File loader QtSingleApplication example", argc, argv);
|
||||
QString message;
|
||||
for (int a = 1; a < argc; ++a) {
|
||||
message += argv[a];
|
||||
if (a < argc-1)
|
||||
message += " ";
|
||||
}
|
||||
|
||||
if (instance.sendMessage(message))
|
||||
return 0;</pre>
|
||||
<p>The <tt>main</tt> entry point function creates a <a href="qtsingleapplication.html">QtSingleApplication</a> object, and creates a message to send to a running instance of the application. If the message was sent successfully the process exits immediately.</p>
|
||||
<pre> MainWindow mw;
|
||||
mw.handleMessage(message);
|
||||
mw.show();
|
||||
|
||||
QObject::connect(&instance, SIGNAL(messageReceived(const QString&)),
|
||||
&mw, SLOT(handleMessage(const QString&)));
|
||||
|
||||
instance.setActivationWindow(&mw, false);
|
||||
QObject::connect(&mw, SIGNAL(needToShow()), &instance, SLOT(activateWindow()));
|
||||
|
||||
return instance.exec();
|
||||
}</pre>
|
||||
<p>If the message could not be sent the application starts up. Note that <tt>false</tt> is passed to the call to setActivationWindow() to prevent automatic activation for every message received, e.g. when the application should just print a file. Instead, the message handling function determines whether activation is requested, and signals that by emitting the needToShow() signal. This is then simply connected directly to <a href="qtsingleapplication.html">QtSingleApplication</a>'s activateWindow() slot.</p>
|
||||
<p /><address><hr /><div align="center">
|
||||
<table width="100%" cellspacing="0" border="0"><tr class="address">
|
||||
<td width="30%" align="left">Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies)</td>
|
||||
<td width="40%" align="center"><a href="http://qt.nokia.com/doc/trademarks.html">Trademarks</a></td>
|
||||
<td width="30%" align="right"><div align="right">Qt Solutions</div></td>
|
||||
</tr></table></div></address></body>
|
||||
</html>
|
|
@ -1,101 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<!-- trivial.qdoc -->
|
||||
<head>
|
||||
<title>A Trivial Example</title>
|
||||
<link href="classic.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td align="left" valign="top" width="32"><img src="images/qt-logo.png" align="left" width="57" height="67" border="0" /></td>
|
||||
<td width="1"> </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a></td>
|
||||
</tr></table><h1 class="title">A Trivial Example<br /><span class="subtitle"></span>
|
||||
</h1>
|
||||
<p>The application in this example has a log-view that displays messages sent by further instances of the same application.</p>
|
||||
<p>The example demonstrates the use of the <a href="qtsingleapplication.html">QtSingleApplication</a> class to detect and communicate with a running instance of the application using the sendMessage() API. The messageReceived() signal is used to display received messages in a <a href="http://qt.nokia.com/doc/4.6/qtextedit.html">QTextEdit</a> log.</p>
|
||||
<pre><span class="comment"> /****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of the Qt Solutions component.
|
||||
**
|
||||
** You may use this file under the terms of the BSD license as follows:
|
||||
**
|
||||
** "Redistribution and use in source and binary forms, with or without
|
||||
** modification, are permitted provided that the following conditions are
|
||||
** met:
|
||||
** * Redistributions of source code must retain the above copyright
|
||||
** notice, this list of conditions and the following disclaimer.
|
||||
** * Redistributions in binary form must reproduce the above copyright
|
||||
** notice, this list of conditions and the following disclaimer in
|
||||
** the documentation and/or other materials provided with the
|
||||
** distribution.
|
||||
** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
|
||||
** the names of its contributors may be used to endorse or promote
|
||||
** products derived from this software without specific prior written
|
||||
** permission.
|
||||
**
|
||||
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
||||
**
|
||||
****************************************************************************/</span>
|
||||
|
||||
#include <qtsingleapplication.h>
|
||||
#include <QtGui/QTextEdit>
|
||||
|
||||
class TextEdit : public QTextEdit
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
TextEdit(QWidget *parent = 0)
|
||||
: QTextEdit(parent)
|
||||
{}
|
||||
public slots:
|
||||
void append(const QString &str)
|
||||
{
|
||||
QTextEdit::append(str);
|
||||
}
|
||||
};
|
||||
|
||||
#include "main.moc"
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
QtSingleApplication instance(argc, argv);</pre>
|
||||
<p>The example has only the <tt>main</tt> entry point function. A <a href="qtsingleapplication.html">QtSingleApplication</a> object is created immediately.</p>
|
||||
<pre> if (instance.sendMessage("Wake up!"))
|
||||
return 0;</pre>
|
||||
<p>If another instance of this application is already running, sendMessage() will succeed, and this instance just exits immediately.</p>
|
||||
<pre> TextEdit logview;
|
||||
logview.setReadOnly(true);
|
||||
logview.show();</pre>
|
||||
<p>Otherwise the instance continues as normal and creates the user interface.</p>
|
||||
<pre> instance.setActivationWindow(&logview);
|
||||
|
||||
QObject::connect(&instance, SIGNAL(messageReceived(const QString&)),
|
||||
&logview, SLOT(append(const QString&)));
|
||||
|
||||
return instance.exec();</pre>
|
||||
<p>The <tt>logview</tt> object is also set as the application's activation window. Every time a message is received, the window will be raised and activated automatically.</p>
|
||||
<p>The messageReceived() signal is also connected to the <a href="http://qt.nokia.com/doc/4.6/qtextedit.html">QTextEdit</a>'s append() slot. Every message received from further instances of this application will be displayed in the log.</p>
|
||||
<p>Finally the event loop is entered.</p>
|
||||
<p /><address><hr /><div align="center">
|
||||
<table width="100%" cellspacing="0" border="0"><tr class="address">
|
||||
<td width="30%" align="left">Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies)</td>
|
||||
<td width="40%" align="center"><a href="http://qt.nokia.com/doc/trademarks.html">Trademarks</a></td>
|
||||
<td width="30%" align="right"><div align="right">Qt Solutions</div></td>
|
||||
</tr></table></div></address></body>
|
||||
</html>
|
|
@ -1,235 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<!-- qtsingleapplication.cpp -->
|
||||
<head>
|
||||
<title>List of All Members for QtSingleApplication</title>
|
||||
<link href="classic.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td align="left" valign="top" width="32"><img src="images/qt-logo.png" align="left" width="57" height="67" border="0" /></td>
|
||||
<td width="1"> </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a></td>
|
||||
</tr></table><h1 class="title">List of All Members for QtSingleApplication</h1>
|
||||
<p>This is the complete list of members for <a href="qtsingleapplication.html">QtSingleApplication</a>, including inherited members.</p>
|
||||
<p><table class="propsummary" width="100%" border="0" cellpadding="0" cellspacing="0">
|
||||
<tr><td width="45%" valign="top"><ul>
|
||||
<li><div class="fn">enum <b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#ColorSpec-enum">ColorSpec</a></b></div></li>
|
||||
<li><div class="fn">enum <b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#Encoding-enum">Encoding</a></b></div></li>
|
||||
<li><div class="fn">typedef <b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#EventFilter-typedef">EventFilter</a></b></div></li>
|
||||
<li><div class="fn">typedef <b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#QS60MainApplicationFactory-typedef">QS60MainApplicationFactory</a></b></div></li>
|
||||
<li><div class="fn">enum <b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#Type-enum">Type</a></b></div></li>
|
||||
<li><div class="fn"><b><a href="qtsingleapplication.html#QtSingleApplication">QtSingleApplication</a></b> ( int &, char **, bool )</div></li>
|
||||
<li><div class="fn"><b><a href="qtsingleapplication.html#QtSingleApplication-2">QtSingleApplication</a></b> ( const QString &, int &, char ** )</div></li>
|
||||
<li><div class="fn"><b><a href="qtsingleapplication.html#QtSingleApplication-3">QtSingleApplication</a></b> ( int &, char **, Type )</div></li>
|
||||
<li><div class="fn"><b><a href="qtsingleapplication.html#QtSingleApplication-4">QtSingleApplication</a></b> ( Display *, Qt::HANDLE, Qt::HANDLE )</div></li>
|
||||
<li><div class="fn"><b><a href="qtsingleapplication.html#QtSingleApplication-5">QtSingleApplication</a></b> ( Display *, int &, char **, Qt::HANDLE, Qt::HANDLE )</div></li>
|
||||
<li><div class="fn"><b><a href="qtsingleapplication.html#QtSingleApplication-6">QtSingleApplication</a></b> ( Display *, const QString &, int, char **, Qt::HANDLE, Qt::HANDLE )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#aboutQt">aboutQt</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#aboutToQuit">aboutToQuit</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="qtsingleapplication.html#activateWindow">activateWindow</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="qtsingleapplication.html#activationWindow">activationWindow</a></b> () const : QWidget *</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#activeModalWidget">activeModalWidget</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#activePopupWidget">activePopupWidget</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#activeWindow">activeWindow</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#addLibraryPath">addLibraryPath</a></b> ( const QString & )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#alert">alert</a></b> ( QWidget *, int )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#allWidgets">allWidgets</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#applicationDirPath">applicationDirPath</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#applicationFilePath">applicationFilePath</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#applicationName-prop">applicationName</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#applicationPid">applicationPid</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#applicationVersion-prop">applicationVersion</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#arguments">arguments</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#autoMaximizeThreshold-prop">autoMaximizeThreshold</a></b> () const</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#autoSipEnabled-prop">autoSipEnabled</a></b> () const</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#beep">beep</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#blockSignals">blockSignals</a></b> ( bool )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#changeOverrideCursor">changeOverrideCursor</a></b> ( const QCursor & )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#childEvent">childEvent</a></b> ( QChildEvent * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#children">children</a></b> () const</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#clipboard">clipboard</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#closeAllWindows">closeAllWindows</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#closingDown">closingDown</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#colorSpec">colorSpec</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#commitData">commitData</a></b> ( QSessionManager & )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#commitDataRequest">commitDataRequest</a></b> ( QSessionManager & )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#connect">connect</a></b> ( const QObject *, const char *, const QObject *, const char *, Qt::ConnectionType )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#connect-2">connect</a></b> ( const QObject *, const char *, const char *, Qt::ConnectionType ) const</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#connectNotify">connectNotify</a></b> ( const char * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#cursorFlashTime-prop">cursorFlashTime</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#customEvent">customEvent</a></b> ( QEvent * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#d_ptr-var">d_ptr</a></b> : </div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#deleteLater">deleteLater</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#desktop">desktop</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#desktopSettingsAware">desktopSettingsAware</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#destroyed">destroyed</a></b> ( QObject * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#disconnect">disconnect</a></b> ( const QObject *, const char *, const QObject *, const char * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#disconnect-2">disconnect</a></b> ( const char *, const QObject *, const char * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#disconnect-3">disconnect</a></b> ( const QObject *, const char * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#disconnectNotify">disconnectNotify</a></b> ( const char * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#doubleClickInterval-prop">doubleClickInterval</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#dumpObjectInfo">dumpObjectInfo</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#dumpObjectTree">dumpObjectTree</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#dynamicPropertyNames">dynamicPropertyNames</a></b> () const</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#event">event</a></b> ( QEvent * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#eventFilter">eventFilter</a></b> ( QObject *, QEvent * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#exec">exec</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#exit">exit</a></b> ( int )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#filterEvent">filterEvent</a></b> ( void *, long * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#findChild">findChild</a></b> ( const QString & ) const</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#findChildren">findChildren</a></b> ( const QString & ) const</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#findChildren-2">findChildren</a></b> ( const QRegExp & ) const</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#flush">flush</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#focusChanged">focusChanged</a></b> ( QWidget *, QWidget * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#focusWidget">focusWidget</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#font">font</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#font-2">font</a></b> ( const QWidget * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#font-3">font</a></b> ( const char * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#fontDatabaseChanged">fontDatabaseChanged</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#fontMetrics">fontMetrics</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#globalStrut-prop">globalStrut</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#hasPendingEvents">hasPendingEvents</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="qtsingleapplication.html#id">id</a></b> () const : QString</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#inherits">inherits</a></b> ( const char * ) const</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#inputContext">inputContext</a></b> () const</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#installEventFilter">installEventFilter</a></b> ( QObject * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#installTranslator">installTranslator</a></b> ( QTranslator * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#instance">instance</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#isEffectEnabled">isEffectEnabled</a></b> ( Qt::UIEffect )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#isLeftToRight">isLeftToRight</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#isRightToLeft">isRightToLeft</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="qtsingleapplication.html#isRunning">isRunning</a></b> () : bool</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#isSessionRestored">isSessionRestored</a></b> () const</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#isWidgetType">isWidgetType</a></b> () const</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#keyboardInputDirection">keyboardInputDirection</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#keyboardInputInterval-prop">keyboardInputInterval</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#keyboardInputLocale">keyboardInputLocale</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#keyboardModifiers">keyboardModifiers</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#keypadNavigationEnabled">keypadNavigationEnabled</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#killTimer">killTimer</a></b> ( int )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#lastWindowClosed">lastWindowClosed</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#layoutDirection-prop">layoutDirection</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#libraryPaths">libraryPaths</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#macEventFilter">macEventFilter</a></b> ( EventHandlerCallRef, EventRef )</div></li>
|
||||
<li><div class="fn"><b><a href="qtsingleapplication.html#messageReceived">messageReceived</a></b> ( const QString & )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#metaObject">metaObject</a></b> () const</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#mouseButtons">mouseButtons</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#moveToThread">moveToThread</a></b> ( QThread * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#navigationMode">navigationMode</a></b> ()</div></li>
|
||||
</ul></td><td valign="top"><ul>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#notify">notify</a></b> ( QObject *, QEvent * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#objectName-prop">objectName</a></b> () const</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#organizationDomain-prop">organizationDomain</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#organizationName-prop">organizationName</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#overrideCursor">overrideCursor</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#palette">palette</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#palette-2">palette</a></b> ( const QWidget * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#palette-3">palette</a></b> ( const char * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#parent">parent</a></b> () const</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#postEvent">postEvent</a></b> ( QObject *, QEvent * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#postEvent-2">postEvent</a></b> ( QObject *, QEvent *, int )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#processEvents">processEvents</a></b> ( QFlags<QEventLoop::ProcessEventsFlag> )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#processEvents-2">processEvents</a></b> ( QFlags<QEventLoop::ProcessEventsFlag>, int )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#property">property</a></b> ( const char * ) const</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#quit">quit</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#quitOnLastWindowClosed-prop">quitOnLastWindowClosed</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#qwsDecoration">qwsDecoration</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#qwsEventFilter">qwsEventFilter</a></b> ( QWSEvent * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#qwsSetCustomColors">qwsSetCustomColors</a></b> ( QRgb *, int, int )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#qwsSetDecoration">qwsSetDecoration</a></b> ( QDecoration * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#qwsSetDecoration-2">qwsSetDecoration</a></b> ( const QString & )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#receivers">receivers</a></b> ( const char * ) const</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#removeEventFilter">removeEventFilter</a></b> ( QObject * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#removeLibraryPath">removeLibraryPath</a></b> ( const QString & )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#removePostedEvents">removePostedEvents</a></b> ( QObject * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#removePostedEvents-2">removePostedEvents</a></b> ( QObject *, int )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#removeTranslator">removeTranslator</a></b> ( QTranslator * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#restoreOverrideCursor">restoreOverrideCursor</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#saveState">saveState</a></b> ( QSessionManager & )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#saveStateRequest">saveStateRequest</a></b> ( QSessionManager & )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#sendEvent">sendEvent</a></b> ( QObject *, QEvent * )</div></li>
|
||||
<li><div class="fn"><b><a href="qtsingleapplication.html#sendMessage">sendMessage</a></b> ( const QString &, int ) : bool</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#sendPostedEvents">sendPostedEvents</a></b> ( QObject *, int )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#sendPostedEvents-2">sendPostedEvents</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#sender">sender</a></b> () const</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#sessionId">sessionId</a></b> () const</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#sessionKey">sessionKey</a></b> () const</div></li>
|
||||
<li><div class="fn"><b><a href="qtsingleapplication.html#setActivationWindow">setActivationWindow</a></b> ( QWidget *, bool )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#setActiveWindow">setActiveWindow</a></b> ( QWidget * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#applicationName-prop">setApplicationName</a></b> ( const QString & )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#applicationVersion-prop">setApplicationVersion</a></b> ( const QString & )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#setAttribute">setAttribute</a></b> ( Qt::ApplicationAttribute, bool )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#autoMaximizeThreshold-prop">setAutoMaximizeThreshold</a></b> ( const int )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#autoSipEnabled-prop">setAutoSipEnabled</a></b> ( const bool )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#setColorSpec">setColorSpec</a></b> ( int )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#cursorFlashTime-prop">setCursorFlashTime</a></b> ( int )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#setDesktopSettingsAware">setDesktopSettingsAware</a></b> ( bool )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#doubleClickInterval-prop">setDoubleClickInterval</a></b> ( int )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#setEffectEnabled">setEffectEnabled</a></b> ( Qt::UIEffect, bool )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#setEventFilter">setEventFilter</a></b> ( EventFilter )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#setFont">setFont</a></b> ( const QFont &, const char * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#globalStrut-prop">setGlobalStrut</a></b> ( const QSize & )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#setGraphicsSystem">setGraphicsSystem</a></b> ( const QString & )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#setInputContext">setInputContext</a></b> ( QInputContext * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#keyboardInputInterval-prop">setKeyboardInputInterval</a></b> ( int )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#layoutDirection-prop">setLayoutDirection</a></b> ( Qt::LayoutDirection )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#setLibraryPaths">setLibraryPaths</a></b> ( const QStringList & )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#setNavigationMode">setNavigationMode</a></b> ( Qt::NavigationMode )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#objectName-prop">setObjectName</a></b> ( const QString & )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#organizationDomain-prop">setOrganizationDomain</a></b> ( const QString & )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#organizationName-prop">setOrganizationName</a></b> ( const QString & )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#setOverrideCursor">setOverrideCursor</a></b> ( const QCursor & )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#setPalette">setPalette</a></b> ( const QPalette &, const char * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#setParent">setParent</a></b> ( QObject * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#setProperty">setProperty</a></b> ( const char *, const QVariant & )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#quitOnLastWindowClosed-prop">setQuitOnLastWindowClosed</a></b> ( bool )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#startDragDistance-prop">setStartDragDistance</a></b> ( int )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#startDragTime-prop">setStartDragTime</a></b> ( int )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#setStyle">setStyle</a></b> ( QStyle * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#setStyle-2">setStyle</a></b> ( const QString & )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#styleSheet-prop">setStyleSheet</a></b> ( const QString & )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#wheelScrollLines-prop">setWheelScrollLines</a></b> ( int )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#windowIcon-prop">setWindowIcon</a></b> ( const QIcon & )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#signalsBlocked">signalsBlocked</a></b> () const</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#startDragDistance-prop">startDragDistance</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#startDragTime-prop">startDragTime</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#startTimer">startTimer</a></b> ( int )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#startingUp">startingUp</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#staticMetaObject-var">staticMetaObject</a></b> : </div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#staticQtMetaObject-var">staticQtMetaObject</a></b> : </div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#style">style</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#styleSheet-prop">styleSheet</a></b> () const</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#symbianEventFilter">symbianEventFilter</a></b> ( const QSymbianEvent * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#symbianProcessEvent">symbianProcessEvent</a></b> ( const QSymbianEvent * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#syncX">syncX</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#testAttribute">testAttribute</a></b> ( Qt::ApplicationAttribute )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#thread">thread</a></b> () const</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#timerEvent">timerEvent</a></b> ( QTimerEvent * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#topLevelAt">topLevelAt</a></b> ( const QPoint & )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#topLevelAt-2">topLevelAt</a></b> ( int, int )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#topLevelWidgets">topLevelWidgets</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#tr">tr</a></b> ( const char *, const char *, int )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#trUtf8">trUtf8</a></b> ( const char *, const char *, int )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#translate">translate</a></b> ( const char *, const char *, const char *, Encoding, int )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#translate-2">translate</a></b> ( const char *, const char *, const char *, Encoding )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#type">type</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#wheelScrollLines-prop">wheelScrollLines</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#widgetAt">widgetAt</a></b> ( const QPoint & )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#widgetAt-4">widgetAt</a></b> ( int, int )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#winEventFilter">winEventFilter</a></b> ( MSG *, long * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#windowIcon-prop">windowIcon</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#x11EventFilter">x11EventFilter</a></b> ( XEvent * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qapplication.html#x11ProcessEvent">x11ProcessEvent</a></b> ( XEvent * )</div></li>
|
||||
</ul>
|
||||
</td></tr>
|
||||
</table></p>
|
||||
<p /><address><hr /><div align="center">
|
||||
<table width="100%" cellspacing="0" border="0"><tr class="address">
|
||||
<td width="30%" align="left">Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies)</td>
|
||||
<td width="40%" align="center"><a href="http://qt.nokia.com/doc/trademarks.html">Trademarks</a></td>
|
||||
<td width="30%" align="right"><div align="right">Qt Solutions</div></td>
|
||||
</tr></table></div></address></body>
|
||||
</html>
|
|
@ -1,31 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<!-- qtsingleapplication.cpp -->
|
||||
<head>
|
||||
<title>Obsolete Members for QtSingleApplication</title>
|
||||
<link href="classic.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td align="left" valign="top" width="32"><img src="images/qt-logo.png" align="left" width="57" height="67" border="0" /></td>
|
||||
<td width="1"> </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a></td>
|
||||
</tr></table><h1 class="title">Obsolete Members for QtSingleApplication</h1>
|
||||
<p><b>The following class members are obsolete.</b> They are provided to keep old source code working. We strongly advise against using them in new code.</p>
|
||||
<p><ul><li><a href="qtsingleapplication.html">QtSingleApplication class reference</a></li></ul></p>
|
||||
<h2>Public Functions</h2>
|
||||
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qtsingleapplication-obsolete.html#initialize">initialize</a></b> ( bool <i>dummy</i> = true ) <tt> (obsolete)</tt></td></tr>
|
||||
</table>
|
||||
<hr />
|
||||
<h2>Member Function Documentation</h2>
|
||||
<h3 class="fn"><a name="initialize"></a>void QtSingleApplication::initialize ( bool <i>dummy</i> = true )</h3>
|
||||
<p /><address><hr /><div align="center">
|
||||
<table width="100%" cellspacing="0" border="0"><tr class="address">
|
||||
<td width="30%" align="left">Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies)</td>
|
||||
<td width="40%" align="center"><a href="http://qt.nokia.com/doc/trademarks.html">Trademarks</a></td>
|
||||
<td width="30%" align="right"><div align="right">Qt Solutions</div></td>
|
||||
</tr></table></div></address></body>
|
||||
</html>
|
|
@ -1,40 +0,0 @@
|
|||
<!DOCTYPE DCF>
|
||||
<DCF ref="index.html" icon="qtsingleapplication.png" imagedir="../../gif" title="Qt Solutions: Single Application Documentation">
|
||||
<section ref="classes.html" title="Classes">
|
||||
<section ref="qtsingleapplication.html" title="QtSingleApplication Class Reference">
|
||||
<keyword ref="qtsingleapplication.html">QtSingleApplication</keyword>
|
||||
<keyword ref="qtsingleapplication.html#activateWindow">activateWindow</keyword>
|
||||
<keyword ref="qtsingleapplication.html#activationWindow">activationWindow</keyword>
|
||||
<keyword ref="qtsingleapplication.html#id">id</keyword>
|
||||
<keyword ref="qtsingleapplication.html#isRunning">isRunning</keyword>
|
||||
<keyword ref="qtsingleapplication.html#messageReceived">messageReceived</keyword>
|
||||
<keyword ref="qtsingleapplication.html#sendMessage">sendMessage</keyword>
|
||||
<keyword ref="qtsingleapplication.html#setActivationWindow">setActivationWindow</keyword>
|
||||
<section ref="qtsingleapplication-members.html" title="List of all members"/>
|
||||
<section ref="qtsingleapplication-obsolete.html" title="Obsolete members"/>
|
||||
</section>
|
||||
<section ref="qtsinglecoreapplication.html" title="QtSingleCoreApplication Class Reference">
|
||||
<keyword ref="qtsinglecoreapplication.html">QtSingleCoreApplication</keyword>
|
||||
<keyword ref="qtsinglecoreapplication.html#id">id</keyword>
|
||||
<keyword ref="qtsinglecoreapplication.html#isRunning">isRunning</keyword>
|
||||
<keyword ref="qtsinglecoreapplication.html#messageReceived">messageReceived</keyword>
|
||||
<keyword ref="qtsinglecoreapplication.html#sendMessage">sendMessage</keyword>
|
||||
<section ref="qtsinglecoreapplication-members.html" title="List of all members"/>
|
||||
</section>
|
||||
</section>
|
||||
<section ref="overviews.html" title="Overviews">
|
||||
<section ref="qtsinglecoreapplication-example-console.html" title="A non-GUI example">
|
||||
<keyword ref="qtsinglecoreapplication-example-console.html">A non-GUI example</keyword>
|
||||
</section>
|
||||
<section ref="qtsingleapplication-example-trivial.html" title="A Trivial Example">
|
||||
<keyword ref="qtsingleapplication-example-trivial.html">A Trivial Example</keyword>
|
||||
</section>
|
||||
<section ref="qtsingleapplication-example-loader.html" title="Loading Documents">
|
||||
<keyword ref="qtsingleapplication-example-loader.html">Loading Documents</keyword>
|
||||
</section>
|
||||
<section ref="index.html" title="Single Application">
|
||||
<keyword ref="index.html">Single Application</keyword>
|
||||
</section>
|
||||
</section>
|
||||
<section ref="examples.html" title="Tutorial & Examples"/>
|
||||
</DCF>
|
|
@ -1,162 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<!-- qtsingleapplication.cpp -->
|
||||
<head>
|
||||
<title>QtSingleApplication Class Reference</title>
|
||||
<link href="classic.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td align="left" valign="top" width="32"><img src="images/qt-logo.png" align="left" width="57" height="67" border="0" /></td>
|
||||
<td width="1"> </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a></td>
|
||||
</tr></table><h1 class="title">QtSingleApplication Class Reference</h1>
|
||||
<p>The QtSingleApplication class provides an API to detect and communicate with running instances of an application. <a href="#details">More...</a></p>
|
||||
<pre> #include <QtSingleApplication></pre><p>Inherits <a href="http://qt.nokia.com/doc/4.6/qapplication.html">QApplication</a>.</p>
|
||||
<ul>
|
||||
<li><a href="qtsingleapplication-members.html">List of all members, including inherited members</a></li>
|
||||
<li><a href="qtsingleapplication-obsolete.html">Obsolete members</a></li>
|
||||
</ul>
|
||||
<hr />
|
||||
<a name="public-functions"></a>
|
||||
<h2>Public Functions</h2>
|
||||
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qtsingleapplication.html#QtSingleApplication">QtSingleApplication</a></b> ( int & <i>argc</i>, char ** <i>argv</i>, bool <i>GUIenabled</i> = true )</td></tr>
|
||||
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qtsingleapplication.html#QtSingleApplication-2">QtSingleApplication</a></b> ( const QString & <i>appId</i>, int & <i>argc</i>, char ** <i>argv</i> )</td></tr>
|
||||
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qtsingleapplication.html#QtSingleApplication-3">QtSingleApplication</a></b> ( int & <i>argc</i>, char ** <i>argv</i>, Type <i>type</i> )</td></tr>
|
||||
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qtsingleapplication.html#QtSingleApplication-4">QtSingleApplication</a></b> ( Display * <i>dpy</i>, Qt::HANDLE <i>visual</i> = 0, Qt::HANDLE <i>cmap</i> = 0 )</td></tr>
|
||||
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qtsingleapplication.html#QtSingleApplication-5">QtSingleApplication</a></b> ( Display * <i>dpy</i>, int & <i>argc</i>, char ** <i>argv</i>, Qt::HANDLE <i>visual</i> = 0, Qt::HANDLE <i>cmap</i> = 0 )</td></tr>
|
||||
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qtsingleapplication.html#QtSingleApplication-6">QtSingleApplication</a></b> ( Display * <i>dpy</i>, const QString & <i>appId</i>, int <i>argc</i>, char ** <i>argv</i>, Qt::HANDLE <i>visual</i> = 0, Qt::HANDLE <i>cmap</i> = 0 )</td></tr>
|
||||
<tr><td class="memItemLeft" align="right" valign="top">QWidget * </td><td class="memItemRight" valign="bottom"><b><a href="qtsingleapplication.html#activationWindow">activationWindow</a></b> () const</td></tr>
|
||||
<tr><td class="memItemLeft" align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><b><a href="qtsingleapplication.html#id">id</a></b> () const</td></tr>
|
||||
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qtsingleapplication.html#isRunning">isRunning</a></b> ()</td></tr>
|
||||
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qtsingleapplication.html#setActivationWindow">setActivationWindow</a></b> ( QWidget * <i>aw</i>, bool <i>activateOnMessage</i> = true )</td></tr>
|
||||
</table>
|
||||
<ul>
|
||||
<li><div bar="2" class="fn"></div>16 public functions inherited from <a href="http://qt.nokia.com/doc/4.6/qapplication.html#public-functions">QApplication</a></li>
|
||||
<li><div bar="2" class="fn"></div>4 public functions inherited from <a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#public-functions">QCoreApplication</a></li>
|
||||
<li><div bar="2" class="fn"></div>29 public functions inherited from <a href="http://qt.nokia.com/doc/4.6/qobject.html#public-functions">QObject</a></li>
|
||||
</ul>
|
||||
<hr />
|
||||
<a name="public-slots"></a>
|
||||
<h2>Public Slots</h2>
|
||||
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qtsingleapplication.html#activateWindow">activateWindow</a></b> ()</td></tr>
|
||||
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qtsingleapplication.html#sendMessage">sendMessage</a></b> ( const QString & <i>message</i>, int <i>timeout</i> = 5000 )</td></tr>
|
||||
</table>
|
||||
<ul>
|
||||
<li><div bar="2" class="fn"></div>7 public slots inherited from <a href="http://qt.nokia.com/doc/4.6/qapplication.html#public-slots">QApplication</a></li>
|
||||
<li><div bar="2" class="fn"></div>1 public slot inherited from <a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#public-slots">QCoreApplication</a></li>
|
||||
<li><div bar="2" class="fn"></div>1 public slot inherited from <a href="http://qt.nokia.com/doc/4.6/qobject.html#public-slots">QObject</a></li>
|
||||
</ul>
|
||||
<hr />
|
||||
<a name="signals"></a>
|
||||
<h2>Signals</h2>
|
||||
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qtsingleapplication.html#messageReceived">messageReceived</a></b> ( const QString & <i>message</i> )</td></tr>
|
||||
</table>
|
||||
<ul>
|
||||
<li><div bar="2" class="fn"></div>5 signals inherited from <a href="http://qt.nokia.com/doc/4.6/qapplication.html#signals">QApplication</a></li>
|
||||
<li><div bar="2" class="fn"></div>1 signal inherited from <a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#signals">QCoreApplication</a></li>
|
||||
<li><div bar="2" class="fn"></div>1 signal inherited from <a href="http://qt.nokia.com/doc/4.6/qobject.html#signals">QObject</a></li>
|
||||
</ul>
|
||||
<h3>Additional Inherited Members</h3>
|
||||
<ul>
|
||||
<li><div class="fn"></div>13 properties inherited from <a href="http://qt.nokia.com/doc/4.6/qapplication.html#properties">QApplication</a></li>
|
||||
<li><div class="fn"></div>4 properties inherited from <a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#properties">QCoreApplication</a></li>
|
||||
<li><div class="fn"></div>1 property inherited from <a href="http://qt.nokia.com/doc/4.6/qobject.html#properties">QObject</a></li>
|
||||
<li><div class="fn"></div>1 public type inherited from <a href="http://qt.nokia.com/doc/4.6/qobject.html#public-variables">QObject</a></li>
|
||||
<li><div class="fn"></div>73 static public members inherited from <a href="http://qt.nokia.com/doc/4.6/qapplication.html#static-public-members">QApplication</a></li>
|
||||
<li><div class="fn"></div>38 static public members inherited from <a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#static-public-members">QCoreApplication</a></li>
|
||||
<li><div class="fn"></div>4 static public members inherited from <a href="http://qt.nokia.com/doc/4.6/qobject.html#static-public-members">QObject</a></li>
|
||||
<li><div class="fn"></div>1 protected function inherited from <a href="http://qt.nokia.com/doc/4.6/qapplication.html#protected-functions">QApplication</a></li>
|
||||
<li><div class="fn"></div>1 protected function inherited from <a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#protected-functions">QCoreApplication</a></li>
|
||||
<li><div class="fn"></div>7 protected functions inherited from <a href="http://qt.nokia.com/doc/4.6/qobject.html#protected-functions">QObject</a></li>
|
||||
<li><div class="fn"></div>2 protected variables inherited from <a href="http://qt.nokia.com/doc/4.6/qobject.html#protected-variables">QObject</a></li>
|
||||
</ul>
|
||||
<a name="details"></a>
|
||||
<hr />
|
||||
<h2>Detailed Description</h2>
|
||||
<p>The QtSingleApplication class provides an API to detect and communicate with running instances of an application.</p>
|
||||
<p>This class allows you to create applications where only one instance should be running at a time. I.e., if the user tries to launch another instance, the already running instance will be activated instead. Another usecase is a client-server system, where the first started instance will assume the role of server, and the later instances will act as clients of that server.</p>
|
||||
<p>By default, the full path of the executable file is used to determine whether two processes are instances of the same application. You can also provide an explicit identifier string that will be compared instead.</p>
|
||||
<p>The application should create the QtSingleApplication object early in the startup phase, and call <a href="qtsingleapplication.html#isRunning">isRunning</a>() to find out if another instance of this application is already running. If <a href="qtsingleapplication.html#isRunning">isRunning</a>() returns false, it means that no other instance is running, and this instance has assumed the role as the running instance. In this case, the application should continue with the initialization of the application user interface before entering the event loop with <a href="http://qt.nokia.com/doc/4.6/qapplication.html#exec">exec</a>(), as normal.</p>
|
||||
<p>The <a href="qtsingleapplication.html#messageReceived">messageReceived</a>() signal will be emitted when the running application receives messages from another instance of the same application. When a message is received it might be helpful to the user to raise the application so that it becomes visible. To facilitate this, QtSingleApplication provides the <a href="qtsingleapplication.html#setActivationWindow">setActivationWindow</a>() function and the <a href="qtsingleapplication.html#activateWindow">activateWindow</a>() slot.</p>
|
||||
<p>If <a href="qtsingleapplication.html#isRunning">isRunning</a>() returns true, another instance is already running. It may be alerted to the fact that another instance has started by using the <a href="qtsingleapplication.html#sendMessage">sendMessage</a>() function. Also data such as startup parameters (e.g. the name of the file the user wanted this new instance to open) can be passed to the running instance with this function. Then, the application should terminate (or enter client mode).</p>
|
||||
<p>If <a href="qtsingleapplication.html#isRunning">isRunning</a>() returns true, but <a href="qtsingleapplication.html#sendMessage">sendMessage</a>() fails, that is an indication that the running instance is frozen.</p>
|
||||
<p>Here's an example that shows how to convert an existing application to use QtSingleApplication. It is very simple and does not make use of all QtSingleApplication's functionality (see the examples for that).</p>
|
||||
<pre><span class="comment"> // Original</span>
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
QApplication app(argc, argv);
|
||||
|
||||
MyMainWidget mmw;
|
||||
mmw.show();
|
||||
return app.exec();
|
||||
}
|
||||
|
||||
<span class="comment"> // Single instance</span>
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
QtSingleApplication app(argc, argv);
|
||||
|
||||
if (app.isRunning())
|
||||
return !app.sendMessage(someDataString);
|
||||
|
||||
MyMainWidget mmw;
|
||||
app.setActivationWindow(&mmw);
|
||||
mmw.show();
|
||||
return app.exec();
|
||||
}</pre>
|
||||
<p>Once this QtSingleApplication instance is destroyed (normally when the process exits or crashes), when the user next attempts to run the application this instance will not, of course, be encountered. The next instance to call <a href="qtsingleapplication.html#isRunning">isRunning</a>() or <a href="qtsingleapplication.html#sendMessage">sendMessage</a>() will assume the role as the new running instance.</p>
|
||||
<p>For console (non-GUI) applications, <a href="qtsinglecoreapplication.html">QtSingleCoreApplication</a> may be used instead of this class, to avoid the dependency on the <a href="http://qt.nokia.com/doc/4.6/qtgui.html">QtGui</a> library.</p>
|
||||
<p>See also <a href="qtsinglecoreapplication.html">QtSingleCoreApplication</a>.</p>
|
||||
<hr />
|
||||
<h2>Member Function Documentation</h2>
|
||||
<h3 class="fn"><a name="QtSingleApplication"></a>QtSingleApplication::QtSingleApplication ( int & <i>argc</i>, char ** <i>argv</i>, bool <i>GUIenabled</i> = true )</h3>
|
||||
<p>Creates a <a href="qtsingleapplication.html">QtSingleApplication</a> object. The application identifier will be <a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#applicationFilePath">QCoreApplication::applicationFilePath</a>(). <i>argc</i>, <i>argv</i>, and <i>GUIenabled</i> are passed on to the QAppliation constructor.</p>
|
||||
<p>If you are creating a console application (i.e. setting <i>GUIenabled</i> to false), you may consider using <a href="qtsinglecoreapplication.html">QtSingleCoreApplication</a> instead.</p>
|
||||
<h3 class="fn"><a name="QtSingleApplication-2"></a>QtSingleApplication::QtSingleApplication ( const <a href="http://qt.nokia.com/doc/4.6/qstring.html">QString</a> & <i>appId</i>, int & <i>argc</i>, char ** <i>argv</i> )</h3>
|
||||
<p>Creates a <a href="qtsingleapplication.html">QtSingleApplication</a> object with the application identifier <i>appId</i>. <i>argc</i> and <i>argv</i> are passed on to the QAppliation constructor.</p>
|
||||
<h3 class="fn"><a name="QtSingleApplication-3"></a>QtSingleApplication::QtSingleApplication ( int & <i>argc</i>, char ** <i>argv</i>, <a href="http://qt.nokia.com/doc/4.6/qapplication.html#Type-enum">Type</a> <i>type</i> )</h3>
|
||||
<p>Creates a <a href="qtsingleapplication.html">QtSingleApplication</a> object. The application identifier will be <a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#applicationFilePath">QCoreApplication::applicationFilePath</a>(). <i>argc</i>, <i>argv</i>, and <i>type</i> are passed on to the QAppliation constructor.</p>
|
||||
<h3 class="fn"><a name="QtSingleApplication-4"></a>QtSingleApplication::QtSingleApplication ( Display * <i>dpy</i>, <a href="http://qt.nokia.com/doc/4.6/qt.html#HANDLE-typedef">Qt::HANDLE</a> <i>visual</i> = 0, <a href="http://qt.nokia.com/doc/4.6/qt.html#HANDLE-typedef">Qt::HANDLE</a> <i>cmap</i> = 0 )</h3>
|
||||
<p>Special constructor for X11, ref. the documentation of <a href="http://qt.nokia.com/doc/4.6/qapplication.html">QApplication</a>'s corresponding constructor. The application identifier will be <a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#applicationFilePath">QCoreApplication::applicationFilePath</a>(). <i>dpy</i>, <i>visual</i>, and <i>cmap</i> are passed on to the <a href="http://qt.nokia.com/doc/4.6/qapplication.html">QApplication</a> constructor.</p>
|
||||
<h3 class="fn"><a name="QtSingleApplication-5"></a>QtSingleApplication::QtSingleApplication ( Display * <i>dpy</i>, int & <i>argc</i>, char ** <i>argv</i>, <a href="http://qt.nokia.com/doc/4.6/qt.html#HANDLE-typedef">Qt::HANDLE</a> <i>visual</i> = 0, <a href="http://qt.nokia.com/doc/4.6/qt.html#HANDLE-typedef">Qt::HANDLE</a> <i>cmap</i> = 0 )</h3>
|
||||
<p>Special constructor for X11, ref. the documentation of <a href="http://qt.nokia.com/doc/4.6/qapplication.html">QApplication</a>'s corresponding constructor. The application identifier will be <a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#applicationFilePath">QCoreApplication::applicationFilePath</a>(). <i>dpy</i>, <i>argc</i>, <i>argv</i>, <i>visual</i>, and <i>cmap</i> are passed on to the <a href="http://qt.nokia.com/doc/4.6/qapplication.html">QApplication</a> constructor.</p>
|
||||
<h3 class="fn"><a name="QtSingleApplication-6"></a>QtSingleApplication::QtSingleApplication ( Display * <i>dpy</i>, const <a href="http://qt.nokia.com/doc/4.6/qstring.html">QString</a> & <i>appId</i>, int <i>argc</i>, char ** <i>argv</i>, <a href="http://qt.nokia.com/doc/4.6/qt.html#HANDLE-typedef">Qt::HANDLE</a> <i>visual</i> = 0, <a href="http://qt.nokia.com/doc/4.6/qt.html#HANDLE-typedef">Qt::HANDLE</a> <i>cmap</i> = 0 )</h3>
|
||||
<p>Special constructor for X11, ref. the documentation of <a href="http://qt.nokia.com/doc/4.6/qapplication.html">QApplication</a>'s corresponding constructor. The application identifier will be <i>appId</i>. <i>dpy</i>, <i>argc</i>, <i>argv</i>, <i>visual</i>, and <i>cmap</i> are passed on to the <a href="http://qt.nokia.com/doc/4.6/qapplication.html">QApplication</a> constructor.</p>
|
||||
<h3 class="fn"><a name="activateWindow"></a>void QtSingleApplication::activateWindow () <tt> [slot]</tt></h3>
|
||||
<p>De-minimizes, raises, and activates this application's activation window. This function does nothing if no activation window has been set.</p>
|
||||
<p>This is a convenience function to show the user that this application instance has been activated when he has tried to start another instance.</p>
|
||||
<p>This function should typically be called in response to the <a href="qtsingleapplication.html#messageReceived">messageReceived</a>() signal. By default, that will happen automatically, if an activation window has been set.</p>
|
||||
<p>See also <a href="qtsingleapplication.html#setActivationWindow">setActivationWindow</a>(), <a href="qtsingleapplication.html#messageReceived">messageReceived</a>(), and <a href="qtsingleapplication-obsolete.html#initialize" class="obsolete">initialize</a>().</p>
|
||||
<h3 class="fn"><a name="activationWindow"></a><a href="http://qt.nokia.com/doc/4.6/qwidget.html">QWidget</a> * QtSingleApplication::activationWindow () const</h3>
|
||||
<p>Returns the applications activation window if one has been set by calling <a href="qtsingleapplication.html#setActivationWindow">setActivationWindow</a>(), otherwise returns 0.</p>
|
||||
<p>See also <a href="qtsingleapplication.html#setActivationWindow">setActivationWindow</a>().</p>
|
||||
<h3 class="fn"><a name="id"></a><a href="http://qt.nokia.com/doc/4.6/qstring.html">QString</a> QtSingleApplication::id () const</h3>
|
||||
<p>Returns the application identifier. Two processes with the same identifier will be regarded as instances of the same application.</p>
|
||||
<h3 class="fn"><a name="isRunning"></a>bool QtSingleApplication::isRunning ()</h3>
|
||||
<p>Returns true if another instance of this application is running; otherwise false.</p>
|
||||
<p>This function does not find instances of this application that are being run by a different user (on Windows: that are running in another session).</p>
|
||||
<p>See also <a href="qtsingleapplication.html#sendMessage">sendMessage</a>().</p>
|
||||
<h3 class="fn"><a name="messageReceived"></a>void QtSingleApplication::messageReceived ( const <a href="http://qt.nokia.com/doc/4.6/qstring.html">QString</a> & <i>message</i> ) <tt> [signal]</tt></h3>
|
||||
<p>This signal is emitted when the current instance receives a <i>message</i> from another instance of this application.</p>
|
||||
<p>See also <a href="qtsingleapplication.html#sendMessage">sendMessage</a>(), <a href="qtsingleapplication.html#setActivationWindow">setActivationWindow</a>(), and <a href="qtsingleapplication.html#activateWindow">activateWindow</a>().</p>
|
||||
<h3 class="fn"><a name="sendMessage"></a>bool QtSingleApplication::sendMessage ( const <a href="http://qt.nokia.com/doc/4.6/qstring.html">QString</a> & <i>message</i>, int <i>timeout</i> = 5000 ) <tt> [slot]</tt></h3>
|
||||
<p>Tries to send the text <i>message</i> to the currently running instance. The <a href="qtsingleapplication.html">QtSingleApplication</a> object in the running instance will emit the <a href="qtsingleapplication.html#messageReceived">messageReceived</a>() signal when it receives the message.</p>
|
||||
<p>This function returns true if the message has been sent to, and processed by, the current instance. If there is no instance currently running, or if the running instance fails to process the message within <i>timeout</i> milliseconds, this function return false.</p>
|
||||
<p>See also <a href="qtsingleapplication.html#isRunning">isRunning</a>() and <a href="qtsingleapplication.html#messageReceived">messageReceived</a>().</p>
|
||||
<h3 class="fn"><a name="setActivationWindow"></a>void QtSingleApplication::setActivationWindow ( <a href="http://qt.nokia.com/doc/4.6/qwidget.html">QWidget</a> * <i>aw</i>, bool <i>activateOnMessage</i> = true )</h3>
|
||||
<p>Sets the activation window of this application to <i>aw</i>. The activation window is the widget that will be activated by <a href="qtsingleapplication.html#activateWindow">activateWindow</a>(). This is typically the application's main window.</p>
|
||||
<p>If <i>activateOnMessage</i> is true (the default), the window will be activated automatically every time a message is received, just prior to the <a href="qtsingleapplication.html#messageReceived">messageReceived</a>() signal being emitted.</p>
|
||||
<p>See also <a href="qtsingleapplication.html#activationWindow">activationWindow</a>(), <a href="qtsingleapplication.html#activateWindow">activateWindow</a>(), and <a href="qtsingleapplication.html#messageReceived">messageReceived</a>().</p>
|
||||
<p /><address><hr /><div align="center">
|
||||
<table width="100%" cellspacing="0" border="0"><tr class="address">
|
||||
<td width="30%" align="left">Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies)</td>
|
||||
<td width="40%" align="center"><a href="http://qt.nokia.com/doc/trademarks.html">Trademarks</a></td>
|
||||
<td width="30%" align="right"><div align="right">Qt Solutions</div></td>
|
||||
</tr></table></div></address></body>
|
||||
</html>
|
|
@ -1,90 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QDOCINDEX>
|
||||
<INDEX url="" title="Qt Solutions: Single Application Documentation" version="">
|
||||
<namespace access="public" threadsafety="unspecified" status="commendable" name="" href="" location="" module="">
|
||||
<class access="public" threadsafety="unspecified" status="commendable" name="QtSingleCoreApplication" href="qtsinglecoreapplication.html" location="qtsinglecoreapplication.h" bases="QCoreApplication" module="">
|
||||
<function access="public" threadsafety="unspecified" status="commendable" name="QtSingleCoreApplication" fullname="QtSingleCoreApplication::QtSingleCoreApplication" href="qtsinglecoreapplication.html#QtSingleCoreApplication" location="qtsinglecoreapplication.h" virtual="non" meta="constructor" const="false" static="false" overload="false" type="" signature="QtSingleCoreApplication(int & argc, char ** argv)">
|
||||
<parameter left="int &" right="" name="argc" default=""/>
|
||||
<parameter left="char **" right="" name="argv" default=""/>
|
||||
</function>
|
||||
<function access="public" threadsafety="unspecified" status="commendable" name="QtSingleCoreApplication" fullname="QtSingleCoreApplication::QtSingleCoreApplication" href="qtsinglecoreapplication.html#QtSingleCoreApplication-2" location="qtsinglecoreapplication.h" virtual="non" meta="constructor" const="false" static="false" overload="true" overload-number="2" type="" signature="QtSingleCoreApplication(const QString & appId, int & argc, char ** argv)">
|
||||
<parameter left="const QString &" right="" name="appId" default=""/>
|
||||
<parameter left="int &" right="" name="argc" default=""/>
|
||||
<parameter left="char **" right="" name="argv" default=""/>
|
||||
</function>
|
||||
<function access="public" threadsafety="unspecified" status="commendable" name="isRunning" fullname="QtSingleCoreApplication::isRunning" href="qtsinglecoreapplication.html#isRunning" location="qtsinglecoreapplication.h" virtual="non" meta="plain" const="false" static="false" overload="false" type="bool" signature="isRunning()"/>
|
||||
<function access="public" threadsafety="unspecified" status="commendable" name="id" fullname="QtSingleCoreApplication::id" href="qtsinglecoreapplication.html#id" location="qtsinglecoreapplication.h" virtual="non" meta="plain" const="true" static="false" overload="false" type="QString" signature="id() const"/>
|
||||
<function access="public" threadsafety="unspecified" status="commendable" name="sendMessage" fullname="QtSingleCoreApplication::sendMessage" href="qtsinglecoreapplication.html#sendMessage" location="qtsinglecoreapplication.h" virtual="non" meta="slot" const="false" static="false" overload="false" type="bool" signature="sendMessage(const QString & message, int timeout)">
|
||||
<parameter left="const QString &" right="" name="message" default=""/>
|
||||
<parameter left="int" right="" name="timeout" default="5000"/>
|
||||
</function>
|
||||
<function access="public" threadsafety="unspecified" status="commendable" name="messageReceived" fullname="QtSingleCoreApplication::messageReceived" href="qtsinglecoreapplication.html#messageReceived" location="qtsinglecoreapplication.h" virtual="non" meta="signal" const="false" static="false" overload="false" type="void" signature="messageReceived(const QString & message)">
|
||||
<parameter left="const QString &" right="" name="message" default=""/>
|
||||
</function>
|
||||
</class>
|
||||
<class access="public" threadsafety="unspecified" status="commendable" name="QtSingleApplication" href="qtsingleapplication.html" location="qtsingleapplication.h" bases="QApplication" module="">
|
||||
<function access="public" threadsafety="unspecified" status="commendable" name="QtSingleApplication" fullname="QtSingleApplication::QtSingleApplication" href="qtsingleapplication.html#QtSingleApplication" location="qtsingleapplication.h" virtual="non" meta="constructor" const="false" static="false" overload="false" type="" signature="QtSingleApplication(int & argc, char ** argv, bool GUIenabled)">
|
||||
<parameter left="int &" right="" name="argc" default=""/>
|
||||
<parameter left="char **" right="" name="argv" default=""/>
|
||||
<parameter left="bool" right="" name="GUIenabled" default="true"/>
|
||||
</function>
|
||||
<function access="public" threadsafety="unspecified" status="commendable" name="QtSingleApplication" fullname="QtSingleApplication::QtSingleApplication" href="qtsingleapplication.html#QtSingleApplication-2" location="qtsingleapplication.h" virtual="non" meta="constructor" const="false" static="false" overload="true" overload-number="2" type="" signature="QtSingleApplication(const QString & appId, int & argc, char ** argv)">
|
||||
<parameter left="const QString &" right="" name="appId" default=""/>
|
||||
<parameter left="int &" right="" name="argc" default=""/>
|
||||
<parameter left="char **" right="" name="argv" default=""/>
|
||||
</function>
|
||||
<function access="public" threadsafety="unspecified" status="commendable" name="QtSingleApplication" fullname="QtSingleApplication::QtSingleApplication" href="qtsingleapplication.html#QtSingleApplication-3" location="qtsingleapplication.h" virtual="non" meta="constructor" const="false" static="false" overload="true" overload-number="3" type="" signature="QtSingleApplication(int & argc, char ** argv, Type type)">
|
||||
<parameter left="int &" right="" name="argc" default=""/>
|
||||
<parameter left="char **" right="" name="argv" default=""/>
|
||||
<parameter left="Type" right="" name="type" default=""/>
|
||||
</function>
|
||||
<function access="public" threadsafety="unspecified" status="commendable" name="QtSingleApplication" fullname="QtSingleApplication::QtSingleApplication" href="qtsingleapplication.html#QtSingleApplication-4" location="qtsingleapplication.h" virtual="non" meta="constructor" const="false" static="false" overload="true" overload-number="4" type="" signature="QtSingleApplication(Display * dpy, Qt::HANDLE visual, Qt::HANDLE cmap)">
|
||||
<parameter left="Display *" right="" name="dpy" default=""/>
|
||||
<parameter left="Qt::HANDLE" right="" name="visual" default="0"/>
|
||||
<parameter left="Qt::HANDLE" right="" name="cmap" default="0"/>
|
||||
</function>
|
||||
<function access="public" threadsafety="unspecified" status="commendable" name="QtSingleApplication" fullname="QtSingleApplication::QtSingleApplication" href="qtsingleapplication.html#QtSingleApplication-5" location="qtsingleapplication.h" virtual="non" meta="constructor" const="false" static="false" overload="true" overload-number="5" type="" signature="QtSingleApplication(Display * dpy, int & argc, char ** argv, Qt::HANDLE visual, Qt::HANDLE cmap)">
|
||||
<parameter left="Display *" right="" name="dpy" default=""/>
|
||||
<parameter left="int &" right="" name="argc" default=""/>
|
||||
<parameter left="char **" right="" name="argv" default=""/>
|
||||
<parameter left="Qt::HANDLE" right="" name="visual" default="0"/>
|
||||
<parameter left="Qt::HANDLE" right="" name="cmap" default="0"/>
|
||||
</function>
|
||||
<function access="public" threadsafety="unspecified" status="commendable" name="QtSingleApplication" fullname="QtSingleApplication::QtSingleApplication" href="qtsingleapplication.html#QtSingleApplication-6" location="qtsingleapplication.h" virtual="non" meta="constructor" const="false" static="false" overload="true" overload-number="6" type="" signature="QtSingleApplication(Display * dpy, const QString & appId, int argc, char ** argv, Qt::HANDLE visual, Qt::HANDLE cmap)">
|
||||
<parameter left="Display *" right="" name="dpy" default=""/>
|
||||
<parameter left="const QString &" right="" name="appId" default=""/>
|
||||
<parameter left="int" right="" name="argc" default=""/>
|
||||
<parameter left="char **" right="" name="argv" default=""/>
|
||||
<parameter left="Qt::HANDLE" right="" name="visual" default="0"/>
|
||||
<parameter left="Qt::HANDLE" right="" name="cmap" default="0"/>
|
||||
</function>
|
||||
<function access="public" threadsafety="unspecified" status="commendable" name="isRunning" fullname="QtSingleApplication::isRunning" href="qtsingleapplication.html#isRunning" location="qtsingleapplication.h" virtual="non" meta="plain" const="false" static="false" overload="false" type="bool" signature="isRunning()"/>
|
||||
<function access="public" threadsafety="unspecified" status="commendable" name="id" fullname="QtSingleApplication::id" href="qtsingleapplication.html#id" location="qtsingleapplication.h" virtual="non" meta="plain" const="true" static="false" overload="false" type="QString" signature="id() const"/>
|
||||
<function access="public" threadsafety="unspecified" status="commendable" name="setActivationWindow" fullname="QtSingleApplication::setActivationWindow" href="qtsingleapplication.html#setActivationWindow" location="qtsingleapplication.h" virtual="non" meta="plain" const="false" static="false" overload="false" type="void" signature="setActivationWindow(QWidget * aw, bool activateOnMessage)">
|
||||
<parameter left="QWidget *" right="" name="aw" default=""/>
|
||||
<parameter left="bool" right="" name="activateOnMessage" default="true"/>
|
||||
</function>
|
||||
<function access="public" threadsafety="unspecified" status="commendable" name="activationWindow" fullname="QtSingleApplication::activationWindow" href="qtsingleapplication.html#activationWindow" location="qtsingleapplication.h" virtual="non" meta="plain" const="true" static="false" overload="false" type="QWidget *" signature="activationWindow() const"/>
|
||||
<function access="public" threadsafety="unspecified" status="obsolete" name="initialize" fullname="QtSingleApplication::initialize" href="qtsingleapplication-obsolete.html#initialize" location="qtsingleapplication.h" virtual="non" meta="plain" const="false" static="false" overload="false" type="void" signature="initialize(bool dummy)">
|
||||
<parameter left="bool" right="" name="dummy" default="true"/>
|
||||
</function>
|
||||
<function access="public" threadsafety="unspecified" status="commendable" name="sendMessage" fullname="QtSingleApplication::sendMessage" href="qtsingleapplication.html#sendMessage" location="qtsingleapplication.h" virtual="non" meta="slot" const="false" static="false" overload="false" type="bool" signature="sendMessage(const QString & message, int timeout)">
|
||||
<parameter left="const QString &" right="" name="message" default=""/>
|
||||
<parameter left="int" right="" name="timeout" default="5000"/>
|
||||
</function>
|
||||
<function access="public" threadsafety="unspecified" status="commendable" name="activateWindow" fullname="QtSingleApplication::activateWindow" href="qtsingleapplication.html#activateWindow" location="qtsingleapplication.h" virtual="non" meta="slot" const="false" static="false" overload="false" type="void" signature="activateWindow()"/>
|
||||
<function access="public" threadsafety="unspecified" status="commendable" name="messageReceived" fullname="QtSingleApplication::messageReceived" href="qtsingleapplication.html#messageReceived" location="qtsingleapplication.h" virtual="non" meta="signal" const="false" static="false" overload="false" type="void" signature="messageReceived(const QString & message)">
|
||||
<parameter left="const QString &" right="" name="message" default=""/>
|
||||
</function>
|
||||
</class>
|
||||
<page access="public" status="commendable" name="index.html" href="index.html" subtype="page" title="Single Application" fulltitle="Single Application" subtitle="" location="index.qdoc">
|
||||
<contents name="description" title="Description" level="1"/>
|
||||
<contents name="classes" title="Classes" level="1"/>
|
||||
<contents name="examples" title="Examples" level="1"/>
|
||||
<contents name="tested-platforms" title="Tested platforms" level="1"/>
|
||||
</page>
|
||||
<page access="public" status="commendable" name="qtsingleapplication-example-trivial.html" href="qtsingleapplication-example-trivial.html" subtype="page" title="A Trivial Example" fulltitle="A Trivial Example" subtitle="" location="trivial.qdoc"/>
|
||||
<page access="public" status="commendable" name="qtsinglecoreapplication-example-console.html" href="qtsinglecoreapplication-example-console.html" subtype="page" title="A non-GUI example" fulltitle="A non-GUI example" subtitle="" location="console.qdoc"/>
|
||||
<page access="public" status="commendable" name="qtsingleapplication-example-loader.html" href="qtsingleapplication-example-loader.html" subtype="page" title="Loading Documents" fulltitle="Loading Documents" subtitle="" location="loader.qdoc"/>
|
||||
</namespace>
|
||||
</INDEX>
|
|
@ -1,53 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<QtHelpProject version="1.0">
|
||||
<namespace>com.nokia.qtsolutions.qtsingleapplication_head</namespace>
|
||||
<virtualFolder>qdoc</virtualFolder>
|
||||
<customFilter name="Qt Solutions: Single Application">
|
||||
<filterAttribute>qt</filterAttribute>
|
||||
<filterAttribute>solutions</filterAttribute>
|
||||
<filterAttribute>qtsingleapplication</filterAttribute>
|
||||
</customFilter>
|
||||
<filterSection>
|
||||
<filterAttribute>qt</filterAttribute>
|
||||
<filterAttribute>solutions</filterAttribute>
|
||||
<filterAttribute>qtsingleapplication</filterAttribute>
|
||||
<toc>
|
||||
<section ref="index.html" title="Qt Solutions: Single Application Documentation">
|
||||
<section ref="qtsingleapplication-example-trivial.html" title="A Trivial Example"/>
|
||||
<section ref="qtsinglecoreapplication-example-console.html" title="A non-GUI example"/>
|
||||
<section ref="qtsingleapplication-example-loader.html" title="Loading Documents"/>
|
||||
<section ref="index.html" title="Single Application"/>
|
||||
</section>
|
||||
</toc>
|
||||
<keywords>
|
||||
<keyword name="A Trivial Example" id="A Trivial Example" ref="qtsingleapplication-example-trivial.html"/>
|
||||
<keyword name="A non-GUI example" id="A non-GUI example" ref="qtsinglecoreapplication-example-console.html"/>
|
||||
<keyword name="Loading Documents" id="Loading Documents" ref="qtsingleapplication-example-loader.html"/>
|
||||
<keyword name="QtSingleApplication" id="QtSingleApplication" ref="qtsingleapplication.html"/>
|
||||
<keyword name="activateWindow" id="QtSingleApplication::activateWindow" ref="qtsingleapplication.html#activateWindow"/>
|
||||
<keyword name="activationWindow" id="QtSingleApplication::activationWindow" ref="qtsingleapplication.html#activationWindow"/>
|
||||
<keyword name="id" id="QtSingleApplication::id" ref="qtsingleapplication.html#id"/>
|
||||
<keyword name="initialize" id="QtSingleApplication::initialize" ref="qtsingleapplication-obsolete.html#initialize"/>
|
||||
<keyword name="isRunning" id="QtSingleApplication::isRunning" ref="qtsingleapplication.html#isRunning"/>
|
||||
<keyword name="messageReceived" id="QtSingleApplication::messageReceived" ref="qtsingleapplication.html#messageReceived"/>
|
||||
<keyword name="sendMessage" id="QtSingleApplication::sendMessage" ref="qtsingleapplication.html#sendMessage"/>
|
||||
<keyword name="setActivationWindow" id="QtSingleApplication::setActivationWindow" ref="qtsingleapplication.html#setActivationWindow"/>
|
||||
<keyword name="QtSingleCoreApplication" id="QtSingleCoreApplication" ref="qtsinglecoreapplication.html"/>
|
||||
<keyword name="id" id="QtSingleCoreApplication::id" ref="qtsinglecoreapplication.html#id"/>
|
||||
<keyword name="isRunning" id="QtSingleCoreApplication::isRunning" ref="qtsinglecoreapplication.html#isRunning"/>
|
||||
<keyword name="messageReceived" id="QtSingleCoreApplication::messageReceived" ref="qtsinglecoreapplication.html#messageReceived"/>
|
||||
<keyword name="sendMessage" id="QtSingleCoreApplication::sendMessage" ref="qtsinglecoreapplication.html#sendMessage"/>
|
||||
<keyword name="Single Application" id="Single Application" ref="index.html"/>
|
||||
</keywords>
|
||||
<files>
|
||||
<file>qtsingleapplication.html</file>
|
||||
<file>index.html</file>
|
||||
<file>qtsingleapplication-example-trivial.html</file>
|
||||
<file>qtsinglecoreapplication.html</file>
|
||||
<file>qtsingleapplication-example-loader.html</file>
|
||||
<file>qtsinglecoreapplication-example-console.html</file>
|
||||
<file>classic.css</file>
|
||||
<file>images/qt-logo.png</file>
|
||||
</files>
|
||||
</filterSection>
|
||||
</QtHelpProject>
|
|
@ -1,118 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<!-- console.qdoc -->
|
||||
<head>
|
||||
<title>A non-GUI example</title>
|
||||
<link href="classic.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td align="left" valign="top" width="32"><img src="images/qt-logo.png" align="left" width="57" height="67" border="0" /></td>
|
||||
<td width="1"> </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a></td>
|
||||
</tr></table><h1 class="title">A non-GUI example<br /><span class="subtitle"></span>
|
||||
</h1>
|
||||
<p>This example shows how to use the single-application functionality in a console application. It does not require the <tt>QtGui</tt> library at all.</p>
|
||||
<p>The only differences from the GUI application usage demonstrated in the other examples are:</p>
|
||||
<p>1) The <tt>.pro</tt> file should include <tt>qtsinglecoreapplication.pri</tt> instead of <tt>qtsingleapplication.pri</tt></p>
|
||||
<p>2) The class name is <tt>QtSingleCoreApplication</tt> instead of <tt>QtSingleApplication</tt>.</p>
|
||||
<p>3) No calls are made regarding window activation, for obvious reasons.</p>
|
||||
<p>console.pro:</p>
|
||||
<pre> TEMPLATE = app
|
||||
CONFIG += console
|
||||
SOURCES += main.cpp
|
||||
include(../../src/qtsinglecoreapplication.pri)
|
||||
QT -= gui</pre>
|
||||
<p>main.cpp:</p>
|
||||
<pre><span class="comment"> /****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of the Qt Solutions component.
|
||||
**
|
||||
** You may use this file under the terms of the BSD license as follows:
|
||||
**
|
||||
** "Redistribution and use in source and binary forms, with or without
|
||||
** modification, are permitted provided that the following conditions are
|
||||
** met:
|
||||
** * Redistributions of source code must retain the above copyright
|
||||
** notice, this list of conditions and the following disclaimer.
|
||||
** * Redistributions in binary form must reproduce the above copyright
|
||||
** notice, this list of conditions and the following disclaimer in
|
||||
** the documentation and/or other materials provided with the
|
||||
** distribution.
|
||||
** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
|
||||
** the names of its contributors may be used to endorse or promote
|
||||
** products derived from this software without specific prior written
|
||||
** permission.
|
||||
**
|
||||
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
||||
**
|
||||
****************************************************************************/</span>
|
||||
|
||||
#include "qtsinglecoreapplication.h"
|
||||
#include <QtCore/QDebug>
|
||||
|
||||
void report(const QString& msg)
|
||||
{
|
||||
qDebug("[%i] %s", (int)QCoreApplication::applicationPid(), qPrintable(msg));
|
||||
}
|
||||
|
||||
class MainClass : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
MainClass()
|
||||
: QObject()
|
||||
{}
|
||||
|
||||
public slots:
|
||||
void handleMessage(const QString& message)
|
||||
{
|
||||
report( "Message received: \"" + message + "\"");
|
||||
}
|
||||
};
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
report("Starting up");
|
||||
|
||||
QtSingleCoreApplication app(argc, argv);
|
||||
|
||||
if (app.isRunning()) {
|
||||
QString msg(QString("Hi master, I am %1.").arg(QCoreApplication::applicationPid()));
|
||||
bool sentok = app.sendMessage(msg, 2000);
|
||||
QString rep("Another instance is running, so I will exit.");
|
||||
rep += sentok ? " Message sent ok." : " Message sending failed; the other instance may be frozen.";
|
||||
report(rep);
|
||||
return 0;
|
||||
} else {
|
||||
report("No other instance is running; so I will.");
|
||||
MainClass mainObj;
|
||||
QObject::connect(&app, SIGNAL(messageReceived(const QString&)),
|
||||
&mainObj, SLOT(handleMessage(const QString&)));
|
||||
return app.exec();
|
||||
}
|
||||
}
|
||||
|
||||
#include "main.moc"</pre>
|
||||
<p /><address><hr /><div align="center">
|
||||
<table width="100%" cellspacing="0" border="0"><tr class="address">
|
||||
<td width="30%" align="left">Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies)</td>
|
||||
<td width="40%" align="center"><a href="http://qt.nokia.com/doc/trademarks.html">Trademarks</a></td>
|
||||
<td width="30%" align="right"><div align="right">Qt Solutions</div></td>
|
||||
</tr></table></div></address></body>
|
||||
</html>
|
|
@ -1,126 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<!-- qtsinglecoreapplication.cpp -->
|
||||
<head>
|
||||
<title>List of All Members for QtSingleCoreApplication</title>
|
||||
<link href="classic.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td align="left" valign="top" width="32"><img src="images/qt-logo.png" align="left" width="57" height="67" border="0" /></td>
|
||||
<td width="1"> </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a></td>
|
||||
</tr></table><h1 class="title">List of All Members for QtSingleCoreApplication</h1>
|
||||
<p>This is the complete list of members for <a href="qtsinglecoreapplication.html">QtSingleCoreApplication</a>, including inherited members.</p>
|
||||
<p><table class="propsummary" width="100%" border="0" cellpadding="0" cellspacing="0">
|
||||
<tr><td width="45%" valign="top"><ul>
|
||||
<li><div class="fn">enum <b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#Encoding-enum">Encoding</a></b></div></li>
|
||||
<li><div class="fn">typedef <b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#EventFilter-typedef">EventFilter</a></b></div></li>
|
||||
<li><div class="fn"><b><a href="qtsinglecoreapplication.html#QtSingleCoreApplication">QtSingleCoreApplication</a></b> ( int &, char ** )</div></li>
|
||||
<li><div class="fn"><b><a href="qtsinglecoreapplication.html#QtSingleCoreApplication-2">QtSingleCoreApplication</a></b> ( const QString &, int &, char ** )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#aboutToQuit">aboutToQuit</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#addLibraryPath">addLibraryPath</a></b> ( const QString & )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#applicationDirPath">applicationDirPath</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#applicationFilePath">applicationFilePath</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#applicationName-prop">applicationName</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#applicationPid">applicationPid</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#applicationVersion-prop">applicationVersion</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#arguments">arguments</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#blockSignals">blockSignals</a></b> ( bool )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#childEvent">childEvent</a></b> ( QChildEvent * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#children">children</a></b> () const</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#closingDown">closingDown</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#connect">connect</a></b> ( const QObject *, const char *, const QObject *, const char *, Qt::ConnectionType )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#connect-2">connect</a></b> ( const QObject *, const char *, const char *, Qt::ConnectionType ) const</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#connectNotify">connectNotify</a></b> ( const char * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#customEvent">customEvent</a></b> ( QEvent * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#d_ptr-var">d_ptr</a></b> : </div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#deleteLater">deleteLater</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#destroyed">destroyed</a></b> ( QObject * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#disconnect">disconnect</a></b> ( const QObject *, const char *, const QObject *, const char * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#disconnect-2">disconnect</a></b> ( const char *, const QObject *, const char * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#disconnect-3">disconnect</a></b> ( const QObject *, const char * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#disconnectNotify">disconnectNotify</a></b> ( const char * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#dumpObjectInfo">dumpObjectInfo</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#dumpObjectTree">dumpObjectTree</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#dynamicPropertyNames">dynamicPropertyNames</a></b> () const</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#event">event</a></b> ( QEvent * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#eventFilter">eventFilter</a></b> ( QObject *, QEvent * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#exec">exec</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#exit">exit</a></b> ( int )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#filterEvent">filterEvent</a></b> ( void *, long * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#findChild">findChild</a></b> ( const QString & ) const</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#findChildren">findChildren</a></b> ( const QString & ) const</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#findChildren-2">findChildren</a></b> ( const QRegExp & ) const</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#flush">flush</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#hasPendingEvents">hasPendingEvents</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="qtsinglecoreapplication.html#id">id</a></b> () const : QString</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#inherits">inherits</a></b> ( const char * ) const</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#installEventFilter">installEventFilter</a></b> ( QObject * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#installTranslator">installTranslator</a></b> ( QTranslator * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#instance">instance</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="qtsinglecoreapplication.html#isRunning">isRunning</a></b> () : bool</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#isWidgetType">isWidgetType</a></b> () const</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#killTimer">killTimer</a></b> ( int )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#libraryPaths">libraryPaths</a></b> ()</div></li>
|
||||
</ul></td><td valign="top"><ul>
|
||||
<li><div class="fn"><b><a href="qtsinglecoreapplication.html#messageReceived">messageReceived</a></b> ( const QString & )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#metaObject">metaObject</a></b> () const</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#moveToThread">moveToThread</a></b> ( QThread * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#notify">notify</a></b> ( QObject *, QEvent * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#objectName-prop">objectName</a></b> () const</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#organizationDomain-prop">organizationDomain</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#organizationName-prop">organizationName</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#parent">parent</a></b> () const</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#postEvent">postEvent</a></b> ( QObject *, QEvent * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#postEvent-2">postEvent</a></b> ( QObject *, QEvent *, int )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#processEvents">processEvents</a></b> ( QFlags<QEventLoop::ProcessEventsFlag> )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#processEvents-2">processEvents</a></b> ( QFlags<QEventLoop::ProcessEventsFlag>, int )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#property">property</a></b> ( const char * ) const</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#quit">quit</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#receivers">receivers</a></b> ( const char * ) const</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#removeEventFilter">removeEventFilter</a></b> ( QObject * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#removeLibraryPath">removeLibraryPath</a></b> ( const QString & )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#removePostedEvents">removePostedEvents</a></b> ( QObject * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#removePostedEvents-2">removePostedEvents</a></b> ( QObject *, int )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#removeTranslator">removeTranslator</a></b> ( QTranslator * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#sendEvent">sendEvent</a></b> ( QObject *, QEvent * )</div></li>
|
||||
<li><div class="fn"><b><a href="qtsinglecoreapplication.html#sendMessage">sendMessage</a></b> ( const QString &, int ) : bool</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#sendPostedEvents">sendPostedEvents</a></b> ( QObject *, int )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#sendPostedEvents-2">sendPostedEvents</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#sender">sender</a></b> () const</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#applicationName-prop">setApplicationName</a></b> ( const QString & )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#applicationVersion-prop">setApplicationVersion</a></b> ( const QString & )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#setAttribute">setAttribute</a></b> ( Qt::ApplicationAttribute, bool )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#setEventFilter">setEventFilter</a></b> ( EventFilter )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#setLibraryPaths">setLibraryPaths</a></b> ( const QStringList & )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#objectName-prop">setObjectName</a></b> ( const QString & )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#organizationDomain-prop">setOrganizationDomain</a></b> ( const QString & )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#organizationName-prop">setOrganizationName</a></b> ( const QString & )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#setParent">setParent</a></b> ( QObject * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#setProperty">setProperty</a></b> ( const char *, const QVariant & )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#signalsBlocked">signalsBlocked</a></b> () const</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#startTimer">startTimer</a></b> ( int )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#startingUp">startingUp</a></b> ()</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#staticMetaObject-var">staticMetaObject</a></b> : </div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#staticQtMetaObject-var">staticQtMetaObject</a></b> : </div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#testAttribute">testAttribute</a></b> ( Qt::ApplicationAttribute )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#thread">thread</a></b> () const</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#timerEvent">timerEvent</a></b> ( QTimerEvent * )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#tr">tr</a></b> ( const char *, const char *, int )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qobject.html#trUtf8">trUtf8</a></b> ( const char *, const char *, int )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#translate">translate</a></b> ( const char *, const char *, const char *, Encoding, int )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#translate-2">translate</a></b> ( const char *, const char *, const char *, Encoding )</div></li>
|
||||
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#winEventFilter">winEventFilter</a></b> ( MSG *, long * )</div></li>
|
||||
</ul>
|
||||
</td></tr>
|
||||
</table></p>
|
||||
<p /><address><hr /><div align="center">
|
||||
<table width="100%" cellspacing="0" border="0"><tr class="address">
|
||||
<td width="30%" align="left">Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies)</td>
|
||||
<td width="40%" align="center"><a href="http://qt.nokia.com/doc/trademarks.html">Trademarks</a></td>
|
||||
<td width="30%" align="right"><div align="right">Qt Solutions</div></td>
|
||||
</tr></table></div></address></body>
|
||||
</html>
|
|
@ -1,98 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<!-- qtsinglecoreapplication.cpp -->
|
||||
<head>
|
||||
<title>QtSingleCoreApplication Class Reference</title>
|
||||
<link href="classic.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td align="left" valign="top" width="32"><img src="images/qt-logo.png" align="left" width="57" height="67" border="0" /></td>
|
||||
<td width="1"> </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a></td>
|
||||
</tr></table><h1 class="title">QtSingleCoreApplication Class Reference</h1>
|
||||
<p>A variant of the <a href="qtsingleapplication.html">QtSingleApplication</a> class for non-GUI applications. <a href="#details">More...</a></p>
|
||||
<pre> #include <QtSingleCoreApplication></pre><p>Inherits <a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html">QCoreApplication</a>.</p>
|
||||
<ul>
|
||||
<li><a href="qtsinglecoreapplication-members.html">List of all members, including inherited members</a></li>
|
||||
</ul>
|
||||
<hr />
|
||||
<a name="public-functions"></a>
|
||||
<h2>Public Functions</h2>
|
||||
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qtsinglecoreapplication.html#QtSingleCoreApplication">QtSingleCoreApplication</a></b> ( int & <i>argc</i>, char ** <i>argv</i> )</td></tr>
|
||||
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qtsinglecoreapplication.html#QtSingleCoreApplication-2">QtSingleCoreApplication</a></b> ( const QString & <i>appId</i>, int & <i>argc</i>, char ** <i>argv</i> )</td></tr>
|
||||
<tr><td class="memItemLeft" align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><b><a href="qtsinglecoreapplication.html#id">id</a></b> () const</td></tr>
|
||||
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qtsinglecoreapplication.html#isRunning">isRunning</a></b> ()</td></tr>
|
||||
</table>
|
||||
<ul>
|
||||
<li><div bar="2" class="fn"></div>4 public functions inherited from <a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#public-functions">QCoreApplication</a></li>
|
||||
<li><div bar="2" class="fn"></div>29 public functions inherited from <a href="http://qt.nokia.com/doc/4.6/qobject.html#public-functions">QObject</a></li>
|
||||
</ul>
|
||||
<hr />
|
||||
<a name="public-slots"></a>
|
||||
<h2>Public Slots</h2>
|
||||
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qtsinglecoreapplication.html#sendMessage">sendMessage</a></b> ( const QString & <i>message</i>, int <i>timeout</i> = 5000 )</td></tr>
|
||||
</table>
|
||||
<ul>
|
||||
<li><div bar="2" class="fn"></div>1 public slot inherited from <a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#public-slots">QCoreApplication</a></li>
|
||||
<li><div bar="2" class="fn"></div>1 public slot inherited from <a href="http://qt.nokia.com/doc/4.6/qobject.html#public-slots">QObject</a></li>
|
||||
</ul>
|
||||
<hr />
|
||||
<a name="signals"></a>
|
||||
<h2>Signals</h2>
|
||||
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qtsinglecoreapplication.html#messageReceived">messageReceived</a></b> ( const QString & <i>message</i> )</td></tr>
|
||||
</table>
|
||||
<ul>
|
||||
<li><div bar="2" class="fn"></div>1 signal inherited from <a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#signals">QCoreApplication</a></li>
|
||||
<li><div bar="2" class="fn"></div>1 signal inherited from <a href="http://qt.nokia.com/doc/4.6/qobject.html#signals">QObject</a></li>
|
||||
</ul>
|
||||
<h3>Additional Inherited Members</h3>
|
||||
<ul>
|
||||
<li><div class="fn"></div>4 properties inherited from <a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#properties">QCoreApplication</a></li>
|
||||
<li><div class="fn"></div>1 property inherited from <a href="http://qt.nokia.com/doc/4.6/qobject.html#properties">QObject</a></li>
|
||||
<li><div class="fn"></div>1 public type inherited from <a href="http://qt.nokia.com/doc/4.6/qobject.html#public-variables">QObject</a></li>
|
||||
<li><div class="fn"></div>38 static public members inherited from <a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#static-public-members">QCoreApplication</a></li>
|
||||
<li><div class="fn"></div>4 static public members inherited from <a href="http://qt.nokia.com/doc/4.6/qobject.html#static-public-members">QObject</a></li>
|
||||
<li><div class="fn"></div>1 protected function inherited from <a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#protected-functions">QCoreApplication</a></li>
|
||||
<li><div class="fn"></div>7 protected functions inherited from <a href="http://qt.nokia.com/doc/4.6/qobject.html#protected-functions">QObject</a></li>
|
||||
<li><div class="fn"></div>2 protected variables inherited from <a href="http://qt.nokia.com/doc/4.6/qobject.html#protected-variables">QObject</a></li>
|
||||
</ul>
|
||||
<a name="details"></a>
|
||||
<hr />
|
||||
<h2>Detailed Description</h2>
|
||||
<p>A variant of the <a href="qtsingleapplication.html">QtSingleApplication</a> class for non-GUI applications.</p>
|
||||
<p>This class is a variant of <a href="qtsingleapplication.html">QtSingleApplication</a> suited for use in console (non-GUI) applications. It is an extension of <a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html">QCoreApplication</a> (instead of <a href="http://qt.nokia.com/doc/4.6/qapplication.html">QApplication</a>). It does not require the <a href="http://qt.nokia.com/doc/4.6/qtgui.html">QtGui</a> library.</p>
|
||||
<p>The API and usage is identical to <a href="qtsingleapplication.html">QtSingleApplication</a>, except that functions relating to the "activation window" are not present, for obvious reasons. Please refer to the <a href="qtsingleapplication.html">QtSingleApplication</a> documentation for explanation of the usage.</p>
|
||||
<p>A QtSingleCoreApplication instance can communicate to a <a href="qtsingleapplication.html">QtSingleApplication</a> instance if they share the same application id. Hence, this class can be used to create a light-weight command-line tool that sends commands to a GUI application.</p>
|
||||
<p>See also <a href="qtsingleapplication.html">QtSingleApplication</a>.</p>
|
||||
<hr />
|
||||
<h2>Member Function Documentation</h2>
|
||||
<h3 class="fn"><a name="QtSingleCoreApplication"></a>QtSingleCoreApplication::QtSingleCoreApplication ( int & <i>argc</i>, char ** <i>argv</i> )</h3>
|
||||
<p>Creates a <a href="qtsinglecoreapplication.html">QtSingleCoreApplication</a> object. The application identifier will be <a href="http://qt.nokia.com/doc/4.6/qcoreapplication.html#applicationFilePath">QCoreApplication::applicationFilePath</a>(). <i>argc</i> and <i>argv</i> are passed on to the QCoreAppliation constructor.</p>
|
||||
<h3 class="fn"><a name="QtSingleCoreApplication-2"></a>QtSingleCoreApplication::QtSingleCoreApplication ( const <a href="http://qt.nokia.com/doc/4.6/qstring.html">QString</a> & <i>appId</i>, int & <i>argc</i>, char ** <i>argv</i> )</h3>
|
||||
<p>Creates a <a href="qtsinglecoreapplication.html">QtSingleCoreApplication</a> object with the application identifier <i>appId</i>. <i>argc</i> and <i>argv</i> are passed on to the QCoreAppliation constructor.</p>
|
||||
<h3 class="fn"><a name="id"></a><a href="http://qt.nokia.com/doc/4.6/qstring.html">QString</a> QtSingleCoreApplication::id () const</h3>
|
||||
<p>Returns the application identifier. Two processes with the same identifier will be regarded as instances of the same application.</p>
|
||||
<h3 class="fn"><a name="isRunning"></a>bool QtSingleCoreApplication::isRunning ()</h3>
|
||||
<p>Returns true if another instance of this application is running; otherwise false.</p>
|
||||
<p>This function does not find instances of this application that are being run by a different user (on Windows: that are running in another session).</p>
|
||||
<p>See also <a href="qtsinglecoreapplication.html#sendMessage">sendMessage</a>().</p>
|
||||
<h3 class="fn"><a name="messageReceived"></a>void QtSingleCoreApplication::messageReceived ( const <a href="http://qt.nokia.com/doc/4.6/qstring.html">QString</a> & <i>message</i> ) <tt> [signal]</tt></h3>
|
||||
<p>This signal is emitted when the current instance receives a <i>message</i> from another instance of this application.</p>
|
||||
<p>See also <a href="qtsinglecoreapplication.html#sendMessage">sendMessage</a>().</p>
|
||||
<h3 class="fn"><a name="sendMessage"></a>bool QtSingleCoreApplication::sendMessage ( const <a href="http://qt.nokia.com/doc/4.6/qstring.html">QString</a> & <i>message</i>, int <i>timeout</i> = 5000 ) <tt> [slot]</tt></h3>
|
||||
<p>Tries to send the text <i>message</i> to the currently running instance. The <a href="qtsinglecoreapplication.html">QtSingleCoreApplication</a> object in the running instance will emit the <a href="qtsinglecoreapplication.html#messageReceived">messageReceived</a>() signal when it receives the message.</p>
|
||||
<p>This function returns true if the message has been sent to, and processed by, the current instance. If there is no instance currently running, or if the running instance fails to process the message within <i>timeout</i> milliseconds, this function return false.</p>
|
||||
<p>See also <a href="qtsinglecoreapplication.html#isRunning">isRunning</a>() and <a href="qtsinglecoreapplication.html#messageReceived">messageReceived</a>().</p>
|
||||
<p /><address><hr /><div align="center">
|
||||
<table width="100%" cellspacing="0" border="0"><tr class="address">
|
||||
<td width="30%" align="left">Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies)</td>
|
||||
<td width="40%" align="center"><a href="http://qt.nokia.com/doc/trademarks.html">Trademarks</a></td>
|
||||
<td width="30%" align="right"><div align="right">Qt Solutions</div></td>
|
||||
</tr></table></div></address></body>
|
||||
</html>
|
Binary file not shown.
Before Width: | Height: | Size: 4.0 KiB |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue