mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-05-30 22:01:41 +00:00
fix: 删除任务栏对libdframeworkdbus-dev库的依赖
1、删除项目中对libdframeworkdbus-dev库的依赖,通过使用xml2cpp的工具来自动生成dbus接口文件,在使用到dbus库的项目中包含生成文件的目录 2、修改相关服务中v20的接口(com.deepin...)为v23的接口(org.deepin...) Log: Influence: 打开控制中心,鼠标移动唤醒任务栏、加载插件等,观察相关功能是否正常 Task: https://pms.uniontech.com/task-view-182009.html Change-Id: I960c849d06ed271ebbb9f8e479d9879967523581
This commit is contained in:
parent
29647bf7a1
commit
c7826edd46
3
.gitignore
vendored
3
.gitignore
vendored
@ -22,3 +22,6 @@ CMakeLists.txt.user*
|
|||||||
# binary file
|
# binary file
|
||||||
dde-dock
|
dde-dock
|
||||||
.vscode
|
.vscode
|
||||||
|
|
||||||
|
*/dbusinterface/generation_dbus_interface/
|
||||||
|
*/*/dbusinterface/generation_dbus_interface/
|
@ -55,6 +55,24 @@ if (${EXIT_CODE} EQUAL 0)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
function(generation_dbus_interface xmldir outdir)
|
||||||
|
IF(NOT EXISTS ${outdir})
|
||||||
|
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${outdir})
|
||||||
|
ENDIF()
|
||||||
|
file(GLOB_RECURSE allXmls ${xmldir}/*.xml)
|
||||||
|
foreach(XMLFILE ${allXmls})
|
||||||
|
string(FIND ${XMLFILE} "/" INDEX REVERSE)
|
||||||
|
string(SUBSTRING ${XMLFILE} ${INDEX} -1 classname)
|
||||||
|
string(REPLACE "/" "" classname ${classname})
|
||||||
|
string(REPLACE ".xml" "" classname ${classname})
|
||||||
|
string(REPLACE "." "_" classname ${classname})
|
||||||
|
string(TOLOWER ${classname} filename)
|
||||||
|
|
||||||
|
execute_process(COMMAND qdbusxml2cpp-fix -c ${classname} -p ${outdir}/${filename} ${XMLFILE}
|
||||||
|
WORKING_DIRECTORY ${outdir})
|
||||||
|
endforeach()
|
||||||
|
endfunction(generation_dbus_interface)
|
||||||
|
|
||||||
file(GLOB INTERFACES "interfaces/*.h")
|
file(GLOB INTERFACES "interfaces/*.h")
|
||||||
|
|
||||||
add_compile_definitions(USE_AM)
|
add_compile_definitions(USE_AM)
|
||||||
|
2
debian/control
vendored
2
debian/control
vendored
@ -20,7 +20,6 @@ Build-Depends: debhelper (>= 8.0.0),
|
|||||||
libdtkcore-dev (>=5.4.14),
|
libdtkcore-dev (>=5.4.14),
|
||||||
libdtkcore5-bin (>=5.4.14),
|
libdtkcore5-bin (>=5.4.14),
|
||||||
libdtkgui-dev (>=5.4.13),
|
libdtkgui-dev (>=5.4.13),
|
||||||
libdframeworkdbus-dev (>=5.4.6),
|
|
||||||
libgsettings-qt-dev,
|
libgsettings-qt-dev,
|
||||||
libdbusmenu-qt5-dev,
|
libdbusmenu-qt5-dev,
|
||||||
libgtest-dev,
|
libgtest-dev,
|
||||||
@ -29,6 +28,7 @@ Build-Depends: debhelper (>= 8.0.0),
|
|||||||
libxcursor-dev,
|
libxcursor-dev,
|
||||||
libqt5waylandclient5-dev,
|
libqt5waylandclient5-dev,
|
||||||
qtwayland5-private-dev,
|
qtwayland5-private-dev,
|
||||||
|
libxdamage-dev,
|
||||||
libdwayland-dev
|
libdwayland-dev
|
||||||
Standards-Version: 3.9.8
|
Standards-Version: 3.9.8
|
||||||
Homepage: http://www.deepin.org/
|
Homepage: http://www.deepin.org/
|
||||||
|
@ -9,8 +9,19 @@ if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
|||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -fsanitize=address -O0")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -fsanitize=address -O0")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
generation_dbus_interface(${CMAKE_CURRENT_SOURCE_DIR}/dbusinterface/xml ${CMAKE_CURRENT_SOURCE_DIR}/dbusinterface/generation_dbus_interface)
|
||||||
|
|
||||||
# Sources files
|
# Sources files
|
||||||
file(GLOB_RECURSE SRCS "*.h" "*.cpp" "../widgets/*.h" "../widgets/*.cpp")
|
file(GLOB_RECURSE SRCS "*.h"
|
||||||
|
"*.cpp"
|
||||||
|
"../widgets/*.h"
|
||||||
|
"../widgets/*.cpp"
|
||||||
|
"./dbusinterface/generation_dbus_interface/*.h"
|
||||||
|
"./dbusinterface/generation_dbus_interface/*.cpp"
|
||||||
|
"./qtdbusextended/*.h"
|
||||||
|
"./qtdbusextended/*.cpp"
|
||||||
|
"./dbusinterface/types/*.h"
|
||||||
|
"./dbusinterface/types/*.cpp")
|
||||||
|
|
||||||
# Find the library
|
# Find the library
|
||||||
find_package(PkgConfig REQUIRED)
|
find_package(PkgConfig REQUIRED)
|
||||||
@ -26,7 +37,6 @@ find_package(DtkCMake REQUIRED)
|
|||||||
find_package(dbusmenu-qt5 REQUIRED)
|
find_package(dbusmenu-qt5 REQUIRED)
|
||||||
|
|
||||||
pkg_check_modules(XCB_EWMH REQUIRED xcb-image xcb-ewmh xcb-composite xtst x11 dbusmenu-qt5 xext xcursor)
|
pkg_check_modules(XCB_EWMH REQUIRED xcb-image xcb-ewmh xcb-composite xtst x11 dbusmenu-qt5 xext xcursor)
|
||||||
pkg_check_modules(DFrameworkDBus REQUIRED dframeworkdbus)
|
|
||||||
pkg_check_modules(QGSettings REQUIRED gsettings-qt)
|
pkg_check_modules(QGSettings REQUIRED gsettings-qt)
|
||||||
pkg_check_modules(DtkGUI REQUIRED dtkgui)
|
pkg_check_modules(DtkGUI REQUIRED dtkgui)
|
||||||
|
|
||||||
@ -43,7 +53,6 @@ add_executable(${BIN_NAME}
|
|||||||
target_include_directories(${BIN_NAME} PUBLIC
|
target_include_directories(${BIN_NAME} PUBLIC
|
||||||
${DtkWidget_INCLUDE_DIRS}
|
${DtkWidget_INCLUDE_DIRS}
|
||||||
${XCB_EWMH_INCLUDE_DIRS}
|
${XCB_EWMH_INCLUDE_DIRS}
|
||||||
${DFrameworkDBus_INCLUDE_DIRS}
|
|
||||||
${Qt5Gui_PRIVATE_INCLUDE_DIRS}
|
${Qt5Gui_PRIVATE_INCLUDE_DIRS}
|
||||||
${PROJECT_BINARY_DIR}
|
${PROJECT_BINARY_DIR}
|
||||||
${QGSettings_INCLUDE_DIRS}
|
${QGSettings_INCLUDE_DIRS}
|
||||||
@ -56,6 +65,9 @@ target_include_directories(${BIN_NAME} PUBLIC
|
|||||||
${Qt5XkbCommonSupport_PRIVATE_INCLUDE_DIRS}
|
${Qt5XkbCommonSupport_PRIVATE_INCLUDE_DIRS}
|
||||||
../interfaces
|
../interfaces
|
||||||
../widgets
|
../widgets
|
||||||
|
./dbusinterface/generation_dbus_interface
|
||||||
|
./qtdbusextended/
|
||||||
|
./dbusinterface
|
||||||
accessible
|
accessible
|
||||||
controller
|
controller
|
||||||
dbus
|
dbus
|
||||||
@ -82,7 +94,6 @@ target_include_directories(${BIN_NAME} PUBLIC
|
|||||||
|
|
||||||
target_link_libraries(${BIN_NAME} PRIVATE
|
target_link_libraries(${BIN_NAME} PRIVATE
|
||||||
${XCB_EWMH_LIBRARIES}
|
${XCB_EWMH_LIBRARIES}
|
||||||
${DFrameworkDBus_LIBRARIES}
|
|
||||||
${DtkWidget_LIBRARIES}
|
${DtkWidget_LIBRARIES}
|
||||||
${Qt5Widgets_LIBRARIES}
|
${Qt5Widgets_LIBRARIES}
|
||||||
${Qt5Gui_LIBRARIES}
|
${Qt5Gui_LIBRARIES}
|
||||||
|
@ -21,59 +21,13 @@
|
|||||||
|
|
||||||
#include "dockinterface.h"
|
#include "dockinterface.h"
|
||||||
|
|
||||||
|
#include "com_deepin_dde_daemon_dock.h"
|
||||||
|
|
||||||
#ifdef USE_AM
|
#ifdef USE_AM
|
||||||
// 因为 types/dockrect.h 文件中定义了DockRect类,而在此处也定义了DockRect,
|
// 因为 types/dockrect.h 文件中定义了DockRect类,而在此处也定义了DockRect,
|
||||||
// 所以在此处先加上DOCKRECT_H宏(types/dockrect.h文件中定义的宏)来禁止包含types/dockrect.h头文件
|
// 所以在此处先加上DOCKRECT_H宏(types/dockrect.h文件中定义的宏)来禁止包含types/dockrect.h头文件
|
||||||
// 否则会出现重复定义的错误
|
// 否则会出现重复定义的错误
|
||||||
#define DOCKRECT_H
|
#define DOCKRECT_H
|
||||||
#include <com_deepin_dde_daemon_dock.h>
|
|
||||||
|
|
||||||
DockRect::DockRect()
|
|
||||||
: x(0)
|
|
||||||
, y(0)
|
|
||||||
, w(0)
|
|
||||||
, h(0)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
QDebug operator<<(QDebug debug, const DockRect &rect)
|
|
||||||
{
|
|
||||||
debug << QString("DockRect(%1, %2, %3, %4)").arg(rect.x)
|
|
||||||
.arg(rect.y)
|
|
||||||
.arg(rect.w)
|
|
||||||
.arg(rect.h);
|
|
||||||
|
|
||||||
return debug;
|
|
||||||
}
|
|
||||||
|
|
||||||
DockRect::operator QRect() const
|
|
||||||
{
|
|
||||||
return QRect(x, y, w, h);
|
|
||||||
}
|
|
||||||
|
|
||||||
QDBusArgument &operator<<(QDBusArgument &arg, const DockRect &rect)
|
|
||||||
{
|
|
||||||
arg.beginStructure();
|
|
||||||
arg << rect.x << rect.y << rect.w << rect.h;
|
|
||||||
arg.endStructure();
|
|
||||||
|
|
||||||
return arg;
|
|
||||||
}
|
|
||||||
|
|
||||||
const QDBusArgument &operator>>(const QDBusArgument &arg, DockRect &rect)
|
|
||||||
{
|
|
||||||
arg.beginStructure();
|
|
||||||
arg >> rect.x >> rect.y >> rect.w >> rect.h;
|
|
||||||
arg.endStructure();
|
|
||||||
|
|
||||||
return arg;
|
|
||||||
}
|
|
||||||
|
|
||||||
void registerDockRectMetaType()
|
|
||||||
{
|
|
||||||
qRegisterMetaType<DockRect>("DockRect");
|
|
||||||
qDBusRegisterMetaType<DockRect>();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Implementation of interface class __Dock
|
* Implementation of interface class __Dock
|
||||||
|
@ -24,6 +24,8 @@
|
|||||||
|
|
||||||
#ifdef USE_AM
|
#ifdef USE_AM
|
||||||
|
|
||||||
|
#include "types/dockrect.h"
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QByteArray>
|
#include <QByteArray>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
@ -39,25 +41,6 @@
|
|||||||
class DockPrivate;
|
class DockPrivate;
|
||||||
class WM;
|
class WM;
|
||||||
|
|
||||||
struct DockRect
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
DockRect();
|
|
||||||
operator QRect() const;
|
|
||||||
|
|
||||||
friend QDebug operator<<(QDebug debug, const DockRect &rect);
|
|
||||||
friend const QDBusArgument &operator>>(const QDBusArgument &arg, DockRect &rect);
|
|
||||||
friend QDBusArgument &operator<<(QDBusArgument &arg, const DockRect &rect);
|
|
||||||
|
|
||||||
private:
|
|
||||||
int x;
|
|
||||||
int y;
|
|
||||||
uint w;
|
|
||||||
uint h;
|
|
||||||
};
|
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(DockRect)
|
|
||||||
|
|
||||||
void registerDockRectMetaType();
|
void registerDockRectMetaType();
|
||||||
|
|
||||||
class Dde_Dock : public QDBusAbstractInterface
|
class Dde_Dock : public QDBusAbstractInterface
|
||||||
|
59
frame/dbusinterface/types/arealist.cpp
Normal file
59
frame/dbusinterface/types/arealist.cpp
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd.
|
||||||
|
*
|
||||||
|
* Author: sbw <sbw@sbw.so>
|
||||||
|
* kirigaya <kirigaya@mkacg.com>
|
||||||
|
* Hualet <mr.asianwang@gmail.com>
|
||||||
|
*
|
||||||
|
* Maintainer: sbw <sbw@sbw.so>
|
||||||
|
* kirigaya <kirigaya@mkacg.com>
|
||||||
|
* Hualet <mr.asianwang@gmail.com>
|
||||||
|
* zhaolong <zhaolong@uniontech.com>
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* 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 "arealist.h"
|
||||||
|
|
||||||
|
bool MonitRect::operator ==(const MonitRect &rect)
|
||||||
|
{
|
||||||
|
return x1 == rect.x1 && y1 == rect.y1 && x2 == rect.x2 && y2 == rect.y2;
|
||||||
|
}
|
||||||
|
|
||||||
|
QDBusArgument &operator<<(QDBusArgument &arg, const MonitRect &rect)
|
||||||
|
{
|
||||||
|
arg.beginStructure();
|
||||||
|
arg << rect.x1 << rect.y1 << rect.x2 << rect.y2;
|
||||||
|
arg.endStructure();
|
||||||
|
|
||||||
|
return arg;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QDBusArgument &operator>>(const QDBusArgument &arg, MonitRect &rect)
|
||||||
|
{
|
||||||
|
arg.beginStructure();
|
||||||
|
arg >> rect.x1 >> rect.y1 >> rect.x2 >> rect.y2;
|
||||||
|
arg.endStructure();
|
||||||
|
|
||||||
|
return arg;
|
||||||
|
}
|
||||||
|
|
||||||
|
void registerAreaListMetaType()
|
||||||
|
{
|
||||||
|
qRegisterMetaType<MonitRect>("MonitRect");
|
||||||
|
qDBusRegisterMetaType<MonitRect>();
|
||||||
|
|
||||||
|
qRegisterMetaType<AreaList>("AreaList");
|
||||||
|
qDBusRegisterMetaType<AreaList>();
|
||||||
|
}
|
53
frame/dbusinterface/types/arealist.h
Normal file
53
frame/dbusinterface/types/arealist.h
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd.
|
||||||
|
*
|
||||||
|
* Author: sbw <sbw@sbw.so>
|
||||||
|
* kirigaya <kirigaya@mkacg.com>
|
||||||
|
* Hualet <mr.asianwang@gmail.com>
|
||||||
|
*
|
||||||
|
* Maintainer: sbw <sbw@sbw.so>
|
||||||
|
* kirigaya <kirigaya@mkacg.com>
|
||||||
|
* Hualet <mr.asianwang@gmail.com>
|
||||||
|
* zhaolong <zhaolong@uniontech.com>
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* 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 AREALIST_H
|
||||||
|
#define AREALIST_H
|
||||||
|
|
||||||
|
#include <QDBusMetaType>
|
||||||
|
#include <QRect>
|
||||||
|
#include <QList>
|
||||||
|
|
||||||
|
struct MonitRect {
|
||||||
|
int x1;
|
||||||
|
int y1;
|
||||||
|
int x2;
|
||||||
|
int y2;
|
||||||
|
|
||||||
|
bool operator ==(const MonitRect& rect);
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef QList<MonitRect> AreaList;
|
||||||
|
|
||||||
|
Q_DECLARE_METATYPE(MonitRect)
|
||||||
|
Q_DECLARE_METATYPE(AreaList)
|
||||||
|
|
||||||
|
QDBusArgument &operator<<(QDBusArgument &arg, const MonitRect &rect);
|
||||||
|
const QDBusArgument &operator>>(const QDBusArgument &arg, MonitRect &rect);
|
||||||
|
|
||||||
|
void registerAreaListMetaType();
|
||||||
|
|
||||||
|
#endif // AREALIST_H
|
34
frame/dbusinterface/types/audioport.cpp
Normal file
34
frame/dbusinterface/types/audioport.cpp
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd.
|
||||||
|
*
|
||||||
|
* Author: sbw <sbw@sbw.so>
|
||||||
|
* kirigaya <kirigaya@mkacg.com>
|
||||||
|
* Hualet <mr.asianwang@gmail.com>
|
||||||
|
*
|
||||||
|
* Maintainer: sbw <sbw@sbw.so>
|
||||||
|
* kirigaya <kirigaya@mkacg.com>
|
||||||
|
* Hualet <mr.asianwang@gmail.com>
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* 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 <QDBusMetaType>
|
||||||
|
|
||||||
|
#include "audioport.h"
|
||||||
|
|
||||||
|
void registerAudioPortMetaType()
|
||||||
|
{
|
||||||
|
qRegisterMetaType<AudioPort>("AudioPort");
|
||||||
|
qDBusRegisterMetaType<AudioPort>();
|
||||||
|
}
|
76
frame/dbusinterface/types/audioport.h
Normal file
76
frame/dbusinterface/types/audioport.h
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2016 ~ 2017 Deepin Technology Co., Ltd.
|
||||||
|
*
|
||||||
|
* Author: sbw <sbw@sbw.so>
|
||||||
|
* kirigaya <kirigaya@mkacg.com>
|
||||||
|
* Hualet <mr.asianwang@gmail.com>
|
||||||
|
*
|
||||||
|
* Maintainer: sbw <sbw@sbw.so>
|
||||||
|
* kirigaya <kirigaya@mkacg.com>
|
||||||
|
* Hualet <mr.asianwang@gmail.com>
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* 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 AUDIOPORT_H
|
||||||
|
#define AUDIOPORT_H
|
||||||
|
|
||||||
|
#include <QDBusMetaType>
|
||||||
|
#include <QString>
|
||||||
|
#include <QDBusArgument>
|
||||||
|
#include <QDebug>
|
||||||
|
|
||||||
|
class AudioPort
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
QString name;
|
||||||
|
QString description;
|
||||||
|
uchar availability; // 0 for Unknown, 1 for Not Available, 2 for Available.
|
||||||
|
|
||||||
|
friend QDebug operator<<(QDebug argument, const AudioPort &port) {
|
||||||
|
argument << port.description;
|
||||||
|
|
||||||
|
return argument;
|
||||||
|
}
|
||||||
|
|
||||||
|
friend QDBusArgument &operator<<(QDBusArgument &argument, const AudioPort &port) {
|
||||||
|
argument.beginStructure();
|
||||||
|
argument << port.name << port.description << port.availability;
|
||||||
|
argument.endStructure();
|
||||||
|
|
||||||
|
return argument;
|
||||||
|
}
|
||||||
|
|
||||||
|
friend const QDBusArgument &operator>>(const QDBusArgument &argument, AudioPort &port) {
|
||||||
|
argument.beginStructure();
|
||||||
|
argument >> port.name >> port.description >> port.availability;
|
||||||
|
argument.endStructure();
|
||||||
|
|
||||||
|
return argument;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator==(const AudioPort what) const {
|
||||||
|
return what.name == name && what.description == description && what.availability == availability;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator!=(const AudioPort what) const {
|
||||||
|
return what.name != name || what.description != description || what.availability != availability;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Q_DECLARE_METATYPE(AudioPort)
|
||||||
|
|
||||||
|
void registerAudioPortMetaType();
|
||||||
|
|
||||||
|
#endif // AUDIOPORT_H
|
32
frame/dbusinterface/types/audioportlist.cpp
Normal file
32
frame/dbusinterface/types/audioportlist.cpp
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd.
|
||||||
|
*
|
||||||
|
* Author: sbw <sbw@sbw.so>
|
||||||
|
* kirigaya <kirigaya@mkacg.com>
|
||||||
|
* Hualet <mr.asianwang@gmail.com>
|
||||||
|
*
|
||||||
|
* Maintainer: sbw <sbw@sbw.so>
|
||||||
|
* kirigaya <kirigaya@mkacg.com>
|
||||||
|
* Hualet <mr.asianwang@gmail.com>
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* 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 "audioportlist.h"
|
||||||
|
|
||||||
|
void registerAudioPortListMetaType()
|
||||||
|
{
|
||||||
|
qRegisterMetaType<AudioPortList>("AudioPortList");
|
||||||
|
qDBusRegisterMetaType<AudioPortList>();
|
||||||
|
}
|
40
frame/dbusinterface/types/audioportlist.h
Normal file
40
frame/dbusinterface/types/audioportlist.h
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2016 ~ 2017 Deepin Technology Co., Ltd.
|
||||||
|
*
|
||||||
|
* Author: sbw <sbw@sbw.so>
|
||||||
|
* kirigaya <kirigaya@mkacg.com>
|
||||||
|
* Hualet <mr.asianwang@gmail.com>
|
||||||
|
*
|
||||||
|
* Maintainer: sbw <sbw@sbw.so>
|
||||||
|
* kirigaya <kirigaya@mkacg.com>
|
||||||
|
* Hualet <mr.asianwang@gmail.com>
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* 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 AUDIOPORTLIST_H
|
||||||
|
#define AUDIOPORTLIST_H
|
||||||
|
|
||||||
|
#include <QDBusMetaType>
|
||||||
|
#include <QList>
|
||||||
|
|
||||||
|
#include "audioport.h"
|
||||||
|
|
||||||
|
typedef QList<AudioPort> AudioPortList;
|
||||||
|
|
||||||
|
Q_DECLARE_METATYPE(AudioPortList)
|
||||||
|
|
||||||
|
void registerAudioPortListMetaType();
|
||||||
|
|
||||||
|
#endif // AUDIOPORTLIST_H
|
32
frame/dbusinterface/types/brightnessmap.cpp
Normal file
32
frame/dbusinterface/types/brightnessmap.cpp
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd.
|
||||||
|
*
|
||||||
|
* Author: sbw <sbw@sbw.so>
|
||||||
|
* kirigaya <kirigaya@mkacg.com>
|
||||||
|
* Hualet <mr.asianwang@gmail.com>
|
||||||
|
*
|
||||||
|
* Maintainer: sbw <sbw@sbw.so>
|
||||||
|
* kirigaya <kirigaya@mkacg.com>
|
||||||
|
* Hualet <mr.asianwang@gmail.com>
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* 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 "brightnessmap.h"
|
||||||
|
|
||||||
|
void registerBrightnessMapMetaType()
|
||||||
|
{
|
||||||
|
qRegisterMetaType<BrightnessMap>("BrightnessMap");
|
||||||
|
qDBusRegisterMetaType<BrightnessMap>();
|
||||||
|
}
|
36
frame/dbusinterface/types/brightnessmap.h
Normal file
36
frame/dbusinterface/types/brightnessmap.h
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd.
|
||||||
|
*
|
||||||
|
* Author: sbw <sbw@sbw.so>
|
||||||
|
* kirigaya <kirigaya@mkacg.com>
|
||||||
|
* Hualet <mr.asianwang@gmail.com>
|
||||||
|
*
|
||||||
|
* Maintainer: sbw <sbw@sbw.so>
|
||||||
|
* kirigaya <kirigaya@mkacg.com>
|
||||||
|
* Hualet <mr.asianwang@gmail.com>
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* 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 BRIGHTNESSMAP_H
|
||||||
|
#define BRIGHTNESSMAP_H
|
||||||
|
|
||||||
|
#include <QMap>
|
||||||
|
#include <QDBusMetaType>
|
||||||
|
|
||||||
|
typedef QMap<QString, double> BrightnessMap;
|
||||||
|
|
||||||
|
void registerBrightnessMapMetaType();
|
||||||
|
|
||||||
|
#endif // BRIGHTNESSMAP_H
|
59
frame/dbusinterface/types/dbusimagelist.cpp
Normal file
59
frame/dbusinterface/types/dbusimagelist.cpp
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd.
|
||||||
|
*
|
||||||
|
* Author: listenerri <listenerri@gmail.com>
|
||||||
|
*
|
||||||
|
* Maintainer: listenerri <listenerri@gmail.com>
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* 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 "dbusimagelist.h"
|
||||||
|
|
||||||
|
QDBusArgument &operator<<(QDBusArgument &argument, const DBusImage &image)
|
||||||
|
{
|
||||||
|
argument.beginStructure();
|
||||||
|
argument << image.width << image.height << image.pixels;
|
||||||
|
argument.endStructure();
|
||||||
|
return argument;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QDBusArgument &operator>>(const QDBusArgument &argument, DBusImage &image)
|
||||||
|
{
|
||||||
|
argument.beginStructure();
|
||||||
|
argument >> image.width >> image.height >> image.pixels;
|
||||||
|
argument.endStructure();
|
||||||
|
return argument;
|
||||||
|
}
|
||||||
|
|
||||||
|
void registerDBusImageListMetaType()
|
||||||
|
{
|
||||||
|
qRegisterMetaType<DBusImage>("DBusImage");
|
||||||
|
qDBusRegisterMetaType<DBusImage>();
|
||||||
|
|
||||||
|
qRegisterMetaType<DBusImageList>("DBusImageList");
|
||||||
|
qDBusRegisterMetaType<DBusImageList>();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator ==(const DBusImage &a, const DBusImage &b)
|
||||||
|
{
|
||||||
|
return a.width == b.width
|
||||||
|
&& a.height == b.height
|
||||||
|
&& a.pixels == b.pixels;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator !=(const DBusImage &a, const DBusImage &b)
|
||||||
|
{
|
||||||
|
return !(a == b);
|
||||||
|
}
|
48
frame/dbusinterface/types/dbusimagelist.h
Normal file
48
frame/dbusinterface/types/dbusimagelist.h
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd.
|
||||||
|
*
|
||||||
|
* Author: listenerri <listenerri@gmail.com>
|
||||||
|
*
|
||||||
|
* Maintainer: listenerri <listenerri@gmail.com>
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* 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 DBUSIMAGELIST_H
|
||||||
|
#define DBUSIMAGELIST_H
|
||||||
|
|
||||||
|
#include <QDBusMetaType>
|
||||||
|
#include <QRect>
|
||||||
|
#include <QList>
|
||||||
|
|
||||||
|
struct DBusImage
|
||||||
|
{
|
||||||
|
int width;
|
||||||
|
int height;
|
||||||
|
QByteArray pixels;
|
||||||
|
};
|
||||||
|
Q_DECLARE_METATYPE(DBusImage)
|
||||||
|
|
||||||
|
typedef QList<DBusImage> DBusImageList;
|
||||||
|
Q_DECLARE_METATYPE(DBusImageList)
|
||||||
|
|
||||||
|
QDBusArgument &operator<<(QDBusArgument&, const DBusImage&);
|
||||||
|
const QDBusArgument &operator>>(const QDBusArgument&, DBusImage&);
|
||||||
|
|
||||||
|
bool operator ==(const DBusImage&, const DBusImage&);
|
||||||
|
bool operator !=(const DBusImage&, const DBusImage&);
|
||||||
|
|
||||||
|
void registerDBusImageListMetaType();
|
||||||
|
|
||||||
|
#endif // DBUSIMAGELIST_H
|
57
frame/dbusinterface/types/dbustooltip.cpp
Normal file
57
frame/dbusinterface/types/dbustooltip.cpp
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd.
|
||||||
|
*
|
||||||
|
* Author: listenerri <listenerri@gmail.com>
|
||||||
|
*
|
||||||
|
* Maintainer: listenerri <listenerri@gmail.com>
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* 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 "dbustooltip.h"
|
||||||
|
|
||||||
|
QDBusArgument &operator<<(QDBusArgument &argument, const DBusToolTip &tip)
|
||||||
|
{
|
||||||
|
argument.beginStructure();
|
||||||
|
argument << tip.iconName << tip.iconPixmap << tip.title << tip.description;
|
||||||
|
argument.endStructure();
|
||||||
|
return argument;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QDBusArgument &operator>>(const QDBusArgument &argument, DBusToolTip &tip)
|
||||||
|
{
|
||||||
|
argument.beginStructure();
|
||||||
|
argument >> tip.iconName >> tip.iconPixmap >> tip.title >> tip.description;
|
||||||
|
argument.endStructure();
|
||||||
|
return argument;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator ==(const DBusToolTip &a, const DBusToolTip &b)
|
||||||
|
{
|
||||||
|
return a.iconName == b.iconName
|
||||||
|
&& a.iconPixmap == b.iconPixmap
|
||||||
|
&& a.title == b.title
|
||||||
|
&& a.description == b.description;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator !=(const DBusToolTip &a, const DBusToolTip &b)
|
||||||
|
{
|
||||||
|
return !(a == b);
|
||||||
|
}
|
||||||
|
|
||||||
|
void registerDBusToolTipMetaType()
|
||||||
|
{
|
||||||
|
qRegisterMetaType<DBusToolTip>("DBusToolTip");
|
||||||
|
qDBusRegisterMetaType<DBusToolTip>();
|
||||||
|
}
|
48
frame/dbusinterface/types/dbustooltip.h
Normal file
48
frame/dbusinterface/types/dbustooltip.h
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd.
|
||||||
|
*
|
||||||
|
* Author: listenerri <listenerri@gmail.com>
|
||||||
|
*
|
||||||
|
* Maintainer: listenerri <listenerri@gmail.com>
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* 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 DBUSTOOLTIP_H
|
||||||
|
#define DBUSTOOLTIP_H
|
||||||
|
|
||||||
|
#include "dbusimagelist.h"
|
||||||
|
|
||||||
|
#include <QDBusMetaType>
|
||||||
|
#include <QRect>
|
||||||
|
#include <QList>
|
||||||
|
|
||||||
|
struct DBusToolTip
|
||||||
|
{
|
||||||
|
QString iconName;
|
||||||
|
DBusImageList iconPixmap;
|
||||||
|
QString title;
|
||||||
|
QString description;
|
||||||
|
};
|
||||||
|
Q_DECLARE_METATYPE(DBusToolTip)
|
||||||
|
|
||||||
|
QDBusArgument &operator<<(QDBusArgument&, const DBusToolTip&);
|
||||||
|
const QDBusArgument &operator>>(const QDBusArgument&, DBusToolTip&);
|
||||||
|
|
||||||
|
bool operator ==(const DBusToolTip&, const DBusToolTip&);
|
||||||
|
bool operator !=(const DBusToolTip&, const DBusToolTip&);
|
||||||
|
|
||||||
|
void registerDBusToolTipMetaType();
|
||||||
|
|
||||||
|
#endif // DBUSTOOLTIP_H
|
50
frame/dbusinterface/types/dockrect.cpp
Normal file
50
frame/dbusinterface/types/dockrect.cpp
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
#include "dockrect.h"
|
||||||
|
#include <QDebug>
|
||||||
|
|
||||||
|
DockRect::DockRect()
|
||||||
|
: x(0)
|
||||||
|
, y(0)
|
||||||
|
, w(0)
|
||||||
|
, h(0)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
QDebug operator<<(QDebug debug, const DockRect &rect)
|
||||||
|
{
|
||||||
|
debug << QString("DockRect(%1, %2, %3, %4)").arg(rect.x)
|
||||||
|
.arg(rect.y)
|
||||||
|
.arg(rect.w)
|
||||||
|
.arg(rect.h);
|
||||||
|
|
||||||
|
return debug;
|
||||||
|
}
|
||||||
|
|
||||||
|
DockRect::operator QRect() const
|
||||||
|
{
|
||||||
|
return QRect(x, y, w, h);
|
||||||
|
}
|
||||||
|
|
||||||
|
QDBusArgument &operator<<(QDBusArgument &arg, const DockRect &rect)
|
||||||
|
{
|
||||||
|
arg.beginStructure();
|
||||||
|
arg << rect.x << rect.y << rect.w << rect.h;
|
||||||
|
arg.endStructure();
|
||||||
|
|
||||||
|
return arg;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QDBusArgument &operator>>(const QDBusArgument &arg, DockRect &rect)
|
||||||
|
{
|
||||||
|
arg.beginStructure();
|
||||||
|
arg >> rect.x >> rect.y >> rect.w >> rect.h;
|
||||||
|
arg.endStructure();
|
||||||
|
|
||||||
|
return arg;
|
||||||
|
}
|
||||||
|
|
||||||
|
void registerDockRectMetaType()
|
||||||
|
{
|
||||||
|
qRegisterMetaType<DockRect>("DockRect");
|
||||||
|
qDBusRegisterMetaType<DockRect>();
|
||||||
|
}
|
28
frame/dbusinterface/types/dockrect.h
Normal file
28
frame/dbusinterface/types/dockrect.h
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
#ifndef DOCKRECT_H
|
||||||
|
#define DOCKRECT_H
|
||||||
|
|
||||||
|
#include <QRect>
|
||||||
|
#include <QDBusMetaType>
|
||||||
|
|
||||||
|
struct DockRect
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
DockRect();
|
||||||
|
operator QRect() const;
|
||||||
|
|
||||||
|
friend QDebug operator<<(QDebug debug, const DockRect &rect);
|
||||||
|
friend const QDBusArgument &operator>>(const QDBusArgument &arg, DockRect &rect);
|
||||||
|
friend QDBusArgument &operator<<(QDBusArgument &arg, const DockRect &rect);
|
||||||
|
|
||||||
|
private:
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
uint w;
|
||||||
|
uint h;
|
||||||
|
};
|
||||||
|
|
||||||
|
Q_DECLARE_METATYPE(DockRect)
|
||||||
|
|
||||||
|
void registerDockRectMetaType();
|
||||||
|
|
||||||
|
#endif // DOCKRECT_H
|
32
frame/dbusinterface/types/keyboardlayoutlist.cpp
Normal file
32
frame/dbusinterface/types/keyboardlayoutlist.cpp
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd.
|
||||||
|
*
|
||||||
|
* Author: sbw <sbw@sbw.so>
|
||||||
|
* kirigaya <kirigaya@mkacg.com>
|
||||||
|
* Hualet <mr.asianwang@gmail.com>
|
||||||
|
*
|
||||||
|
* Maintainer: sbw <sbw@sbw.so>
|
||||||
|
* kirigaya <kirigaya@mkacg.com>
|
||||||
|
* Hualet <mr.asianwang@gmail.com>
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* 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 "keyboardlayoutlist.h"
|
||||||
|
|
||||||
|
void registerKeyboardLayoutListMetaType()
|
||||||
|
{
|
||||||
|
qRegisterMetaType<KeyboardLayoutList>("KeyboardLayoutList");
|
||||||
|
qDBusRegisterMetaType<KeyboardLayoutList>();
|
||||||
|
}
|
38
frame/dbusinterface/types/keyboardlayoutlist.h
Normal file
38
frame/dbusinterface/types/keyboardlayoutlist.h
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd.
|
||||||
|
*
|
||||||
|
* Author: sbw <sbw@sbw.so>
|
||||||
|
* kirigaya <kirigaya@mkacg.com>
|
||||||
|
* Hualet <mr.asianwang@gmail.com>
|
||||||
|
*
|
||||||
|
* Maintainer: sbw <sbw@sbw.so>
|
||||||
|
* kirigaya <kirigaya@mkacg.com>
|
||||||
|
* Hualet <mr.asianwang@gmail.com>
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* 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 KEYBOARDLAYOUTLIST_H
|
||||||
|
#define KEYBOARDLAYOUTLIST_H
|
||||||
|
|
||||||
|
#include <QMap>
|
||||||
|
#include <QString>
|
||||||
|
#include <QObject>
|
||||||
|
#include <QDBusMetaType>
|
||||||
|
|
||||||
|
typedef QMap<QString, QString> KeyboardLayoutList;
|
||||||
|
|
||||||
|
void registerKeyboardLayoutListMetaType();
|
||||||
|
|
||||||
|
#endif // KEYBOARDLAYOUTLIST_H
|
76
frame/dbusinterface/types/resolution.cpp
Normal file
76
frame/dbusinterface/types/resolution.cpp
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd.
|
||||||
|
*
|
||||||
|
* Author: sbw <sbw@sbw.so>
|
||||||
|
* kirigaya <kirigaya@mkacg.com>
|
||||||
|
* Hualet <mr.asianwang@gmail.com>
|
||||||
|
*
|
||||||
|
* Maintainer: sbw <sbw@sbw.so>
|
||||||
|
* kirigaya <kirigaya@mkacg.com>
|
||||||
|
* Hualet <mr.asianwang@gmail.com>
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* 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 "resolution.h"
|
||||||
|
|
||||||
|
#include <QDebug>
|
||||||
|
|
||||||
|
void registerResolutionMetaType()
|
||||||
|
{
|
||||||
|
qRegisterMetaType<Resolution>("Resolution");
|
||||||
|
qDBusRegisterMetaType<Resolution>();
|
||||||
|
}
|
||||||
|
|
||||||
|
Resolution::Resolution()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Resolution::operator!=(const Resolution &other) const
|
||||||
|
{
|
||||||
|
return m_width != other.m_width || m_height != other.m_height || m_rate != other.m_rate;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Resolution::operator==(const Resolution &other) const
|
||||||
|
{
|
||||||
|
return !(other != *this);
|
||||||
|
}
|
||||||
|
|
||||||
|
QDBusArgument &operator<<(QDBusArgument &arg, const Resolution &value)
|
||||||
|
{
|
||||||
|
arg.beginStructure();
|
||||||
|
arg << quint32(value.id()) << quint16(value.width()) << quint16(value.height()) << value.rate();
|
||||||
|
arg.endStructure();
|
||||||
|
|
||||||
|
return arg;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QDBusArgument &operator>>(const QDBusArgument &arg, Resolution &value)
|
||||||
|
{
|
||||||
|
quint32 id;
|
||||||
|
quint16 w, h;
|
||||||
|
double rate;
|
||||||
|
|
||||||
|
arg.beginStructure();
|
||||||
|
arg >> id >> w >> h >> rate;
|
||||||
|
arg.endStructure();
|
||||||
|
|
||||||
|
value.setId(id);
|
||||||
|
value.setWidth(w);
|
||||||
|
value.setHeight(h);
|
||||||
|
value.setRate(rate);
|
||||||
|
|
||||||
|
return arg;
|
||||||
|
}
|
65
frame/dbusinterface/types/resolution.h
Normal file
65
frame/dbusinterface/types/resolution.h
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd.
|
||||||
|
*
|
||||||
|
* Author: sbw <sbw@sbw.so>
|
||||||
|
* kirigaya <kirigaya@mkacg.com>
|
||||||
|
* Hualet <mr.asianwang@gmail.com>
|
||||||
|
*
|
||||||
|
* Maintainer: sbw <sbw@sbw.so>
|
||||||
|
* kirigaya <kirigaya@mkacg.com>
|
||||||
|
* Hualet <mr.asianwang@gmail.com>
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* 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 RESOLUTION_H
|
||||||
|
#define RESOLUTION_H
|
||||||
|
|
||||||
|
#include <QDBusMetaType>
|
||||||
|
|
||||||
|
class Resolution
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
friend QDBusArgument &operator<<(QDBusArgument &arg, const Resolution &value);
|
||||||
|
friend const QDBusArgument &operator>>(const QDBusArgument &arg, Resolution &value);
|
||||||
|
|
||||||
|
explicit Resolution();
|
||||||
|
|
||||||
|
bool operator!=(const Resolution &other) const;
|
||||||
|
bool operator==(const Resolution &other) const;
|
||||||
|
|
||||||
|
int id() const { return m_id; }
|
||||||
|
int width() const { return m_width; }
|
||||||
|
int height() const { return m_height; }
|
||||||
|
double rate() const { return m_rate; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
void setId(const int id) { m_id = id; }
|
||||||
|
void setWidth(const int w) { m_width = w; }
|
||||||
|
void setHeight(const int h) { m_height = h; }
|
||||||
|
void setRate(const double rate) { m_rate = rate; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
int m_id;
|
||||||
|
int m_width;
|
||||||
|
int m_height;
|
||||||
|
double m_rate;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Q_DECLARE_METATYPE(Resolution)
|
||||||
|
|
||||||
|
void registerResolutionMetaType();
|
||||||
|
|
||||||
|
#endif // RESOLUTION_H
|
34
frame/dbusinterface/types/resolutionlist.cpp
Normal file
34
frame/dbusinterface/types/resolutionlist.cpp
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd.
|
||||||
|
*
|
||||||
|
* Author: sbw <sbw@sbw.so>
|
||||||
|
* kirigaya <kirigaya@mkacg.com>
|
||||||
|
* Hualet <mr.asianwang@gmail.com>
|
||||||
|
*
|
||||||
|
* Maintainer: sbw <sbw@sbw.so>
|
||||||
|
* kirigaya <kirigaya@mkacg.com>
|
||||||
|
* Hualet <mr.asianwang@gmail.com>
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* 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 "resolutionlist.h"
|
||||||
|
|
||||||
|
void registerResolutionListMetaType()
|
||||||
|
{
|
||||||
|
registerResolutionMetaType();
|
||||||
|
|
||||||
|
qRegisterMetaType<ResolutionList>("ResolutionList");
|
||||||
|
qDBusRegisterMetaType<ResolutionList>();
|
||||||
|
}
|
37
frame/dbusinterface/types/resolutionlist.h
Normal file
37
frame/dbusinterface/types/resolutionlist.h
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd.
|
||||||
|
*
|
||||||
|
* Author: sbw <sbw@sbw.so>
|
||||||
|
* kirigaya <kirigaya@mkacg.com>
|
||||||
|
* Hualet <mr.asianwang@gmail.com>
|
||||||
|
*
|
||||||
|
* Maintainer: sbw <sbw@sbw.so>
|
||||||
|
* kirigaya <kirigaya@mkacg.com>
|
||||||
|
* Hualet <mr.asianwang@gmail.com>
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* 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 RESOLUTIONLIST_H
|
||||||
|
#define RESOLUTIONLIST_H
|
||||||
|
|
||||||
|
#include "resolution.h"
|
||||||
|
|
||||||
|
#include <QList>
|
||||||
|
|
||||||
|
typedef QList<Resolution> ResolutionList;
|
||||||
|
|
||||||
|
void registerResolutionListMetaType();
|
||||||
|
|
||||||
|
#endif // RESOLUTIONLIST_H
|
74
frame/dbusinterface/types/screenrect.cpp
Normal file
74
frame/dbusinterface/types/screenrect.cpp
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd.
|
||||||
|
*
|
||||||
|
* Author: sbw <sbw@sbw.so>
|
||||||
|
* kirigaya <kirigaya@mkacg.com>
|
||||||
|
* Hualet <mr.asianwang@gmail.com>
|
||||||
|
*
|
||||||
|
* Maintainer: sbw <sbw@sbw.so>
|
||||||
|
* kirigaya <kirigaya@mkacg.com>
|
||||||
|
* Hualet <mr.asianwang@gmail.com>
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* 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 "screenrect.h"
|
||||||
|
|
||||||
|
ScreenRect::ScreenRect()
|
||||||
|
: x(0),
|
||||||
|
y(0),
|
||||||
|
w(0),
|
||||||
|
h(0)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
QDebug operator<<(QDebug debug, const ScreenRect &rect)
|
||||||
|
{
|
||||||
|
debug << QString("ScreenRect(%1, %2, %3, %4)").arg(rect.x)
|
||||||
|
.arg(rect.y)
|
||||||
|
.arg(rect.w)
|
||||||
|
.arg(rect.h);
|
||||||
|
|
||||||
|
return debug;
|
||||||
|
}
|
||||||
|
|
||||||
|
ScreenRect::operator QRect() const
|
||||||
|
{
|
||||||
|
return QRect(x, y, w, h);
|
||||||
|
}
|
||||||
|
|
||||||
|
QDBusArgument &operator<<(QDBusArgument &arg, const ScreenRect &rect)
|
||||||
|
{
|
||||||
|
arg.beginStructure();
|
||||||
|
arg << rect.x << rect.y << rect.w << rect.h;
|
||||||
|
arg.endStructure();
|
||||||
|
|
||||||
|
return arg;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QDBusArgument &operator>>(const QDBusArgument &arg, ScreenRect &rect)
|
||||||
|
{
|
||||||
|
arg.beginStructure();
|
||||||
|
arg >> rect.x >> rect.y >> rect.w >> rect.h;
|
||||||
|
arg.endStructure();
|
||||||
|
|
||||||
|
return arg;
|
||||||
|
}
|
||||||
|
|
||||||
|
void registerScreenRectMetaType()
|
||||||
|
{
|
||||||
|
qRegisterMetaType<ScreenRect>("ScreenRect");
|
||||||
|
qDBusRegisterMetaType<ScreenRect>();
|
||||||
|
}
|
55
frame/dbusinterface/types/screenrect.h
Normal file
55
frame/dbusinterface/types/screenrect.h
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd.
|
||||||
|
*
|
||||||
|
* Author: sbw <sbw@sbw.so>
|
||||||
|
* kirigaya <kirigaya@mkacg.com>
|
||||||
|
* Hualet <mr.asianwang@gmail.com>
|
||||||
|
*
|
||||||
|
* Maintainer: sbw <sbw@sbw.so>
|
||||||
|
* kirigaya <kirigaya@mkacg.com>
|
||||||
|
* Hualet <mr.asianwang@gmail.com>
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* 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 SCREENRECT_H
|
||||||
|
#define SCREENRECT_H
|
||||||
|
|
||||||
|
#include <QRect>
|
||||||
|
#include <QDBusArgument>
|
||||||
|
#include <QDebug>
|
||||||
|
#include <QDBusMetaType>
|
||||||
|
|
||||||
|
struct ScreenRect
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ScreenRect();
|
||||||
|
operator QRect() const;
|
||||||
|
|
||||||
|
friend QDebug operator<<(QDebug debug, const ScreenRect &rect);
|
||||||
|
friend const QDBusArgument &operator>>(const QDBusArgument &arg, ScreenRect &rect);
|
||||||
|
friend QDBusArgument &operator<<(QDBusArgument &arg, const ScreenRect &rect);
|
||||||
|
|
||||||
|
private:
|
||||||
|
qint16 x;
|
||||||
|
qint16 y;
|
||||||
|
quint16 w;
|
||||||
|
quint16 h;
|
||||||
|
};
|
||||||
|
|
||||||
|
Q_DECLARE_METATYPE(ScreenRect)
|
||||||
|
|
||||||
|
void registerScreenRectMetaType();
|
||||||
|
|
||||||
|
#endif // SCREENRECT_H
|
59
frame/dbusinterface/types/touchscreeninfolist.cpp
Normal file
59
frame/dbusinterface/types/touchscreeninfolist.cpp
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd.
|
||||||
|
*
|
||||||
|
* Author: quezhiyong <quezhiyong@uniontech.com>
|
||||||
|
*
|
||||||
|
* Maintainer: quezhiyong <quezhiyong@uniontech.com>
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* 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 "touchscreeninfolist.h"
|
||||||
|
|
||||||
|
QDBusArgument &operator<<(QDBusArgument &arg, const TouchscreenInfo &info)
|
||||||
|
{
|
||||||
|
arg.beginStructure();
|
||||||
|
arg << info.id << info.name << info.deviceNode << info.serialNumber;
|
||||||
|
arg.endStructure();
|
||||||
|
|
||||||
|
return arg;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QDBusArgument &operator>>(const QDBusArgument &arg, TouchscreenInfo &info)
|
||||||
|
{
|
||||||
|
arg.beginStructure();
|
||||||
|
arg >> info.id >> info.name >> info.deviceNode >> info.serialNumber;
|
||||||
|
arg.endStructure();
|
||||||
|
|
||||||
|
return arg;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TouchscreenInfo::operator==(const TouchscreenInfo &info)
|
||||||
|
{
|
||||||
|
return id == info.id && name == info.name && deviceNode == info.deviceNode && serialNumber == info.serialNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
void registerTouchscreenInfoMetaType()
|
||||||
|
{
|
||||||
|
qRegisterMetaType<TouchscreenInfo>("TouchscreenInfo");
|
||||||
|
qDBusRegisterMetaType<TouchscreenInfo>();
|
||||||
|
}
|
||||||
|
|
||||||
|
void registerTouchscreenInfoListMetaType()
|
||||||
|
{
|
||||||
|
registerTouchscreenInfoMetaType();
|
||||||
|
|
||||||
|
qRegisterMetaType<TouchscreenInfoList>("TouchscreenInfoList");
|
||||||
|
qDBusRegisterMetaType<TouchscreenInfoList>();
|
||||||
|
}
|
48
frame/dbusinterface/types/touchscreeninfolist.h
Normal file
48
frame/dbusinterface/types/touchscreeninfolist.h
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd.
|
||||||
|
*
|
||||||
|
* Author: quezhiyong <quezhiyong@uniontech.com>
|
||||||
|
*
|
||||||
|
* Maintainer: quezhiyong <quezhiyong@uniontech.com>
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* 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 TOUCHSCREENINFOLIST_H
|
||||||
|
#define TOUCHSCREENINFOLIST_H
|
||||||
|
|
||||||
|
#include <QString>
|
||||||
|
#include <QList>
|
||||||
|
#include <QDBusMetaType>
|
||||||
|
|
||||||
|
struct TouchscreenInfo {
|
||||||
|
qint32 id;
|
||||||
|
QString name;
|
||||||
|
QString deviceNode;
|
||||||
|
QString serialNumber;
|
||||||
|
|
||||||
|
bool operator ==(const TouchscreenInfo& info);
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef QList<TouchscreenInfo> TouchscreenInfoList;
|
||||||
|
|
||||||
|
Q_DECLARE_METATYPE(TouchscreenInfo)
|
||||||
|
Q_DECLARE_METATYPE(TouchscreenInfoList)
|
||||||
|
|
||||||
|
QDBusArgument &operator<<(QDBusArgument &arg, const TouchscreenInfo &info);
|
||||||
|
const QDBusArgument &operator>>(const QDBusArgument &arg, TouchscreenInfo &info);
|
||||||
|
|
||||||
|
void registerTouchscreenInfoListMetaType();
|
||||||
|
|
||||||
|
#endif // !TOUCHSCREENINFOLIST_H
|
59
frame/dbusinterface/types/touchscreeninfolist_v2.cpp
Normal file
59
frame/dbusinterface/types/touchscreeninfolist_v2.cpp
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd.
|
||||||
|
*
|
||||||
|
* Author: quezhiyong <quezhiyong@uniontech.com>
|
||||||
|
*
|
||||||
|
* Maintainer: quezhiyong <quezhiyong@uniontech.com>
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* 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 "touchscreeninfolist_v2.h"
|
||||||
|
|
||||||
|
QDBusArgument &operator<<(QDBusArgument &arg, const TouchscreenInfo_V2 &info)
|
||||||
|
{
|
||||||
|
arg.beginStructure();
|
||||||
|
arg << info.id << info.name << info.deviceNode << info.serialNumber << info.UUID;
|
||||||
|
arg.endStructure();
|
||||||
|
|
||||||
|
return arg;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QDBusArgument &operator>>(const QDBusArgument &arg, TouchscreenInfo_V2 &info)
|
||||||
|
{
|
||||||
|
arg.beginStructure();
|
||||||
|
arg >> info.id >> info.name >> info.deviceNode >> info.serialNumber >> info.UUID;
|
||||||
|
arg.endStructure();
|
||||||
|
|
||||||
|
return arg;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TouchscreenInfo_V2::operator==(const TouchscreenInfo_V2 &info)
|
||||||
|
{
|
||||||
|
return id == info.id && name == info.name && deviceNode == info.deviceNode && serialNumber == info.serialNumber && UUID == info.UUID;
|
||||||
|
}
|
||||||
|
|
||||||
|
void registerTouchscreenInfoV2MetaType()
|
||||||
|
{
|
||||||
|
qRegisterMetaType<TouchscreenInfo_V2>("TouchscreenInfo_V2");
|
||||||
|
qDBusRegisterMetaType<TouchscreenInfo_V2>();
|
||||||
|
}
|
||||||
|
|
||||||
|
void registerTouchscreenInfoList_V2MetaType()
|
||||||
|
{
|
||||||
|
registerTouchscreenInfoV2MetaType();
|
||||||
|
|
||||||
|
qRegisterMetaType<TouchscreenInfoList_V2>("TouchscreenInfoList_V2");
|
||||||
|
qDBusRegisterMetaType<TouchscreenInfoList_V2>();
|
||||||
|
}
|
49
frame/dbusinterface/types/touchscreeninfolist_v2.h
Normal file
49
frame/dbusinterface/types/touchscreeninfolist_v2.h
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd.
|
||||||
|
*
|
||||||
|
* Author: quezhiyong <quezhiyong@uniontech.com>
|
||||||
|
*
|
||||||
|
* Maintainer: quezhiyong <quezhiyong@uniontech.com>
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* 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 TOUCHSCREENINFOLISTV2_H
|
||||||
|
#define TOUCHSCREENINFOLISTV2_H
|
||||||
|
|
||||||
|
#include <QString>
|
||||||
|
#include <QList>
|
||||||
|
#include <QDBusMetaType>
|
||||||
|
|
||||||
|
struct TouchscreenInfo_V2 {
|
||||||
|
qint32 id;
|
||||||
|
QString name;
|
||||||
|
QString deviceNode;
|
||||||
|
QString serialNumber;
|
||||||
|
QString UUID;
|
||||||
|
|
||||||
|
bool operator ==(const TouchscreenInfo_V2& info);
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef QList<TouchscreenInfo_V2> TouchscreenInfoList_V2;
|
||||||
|
|
||||||
|
Q_DECLARE_METATYPE(TouchscreenInfo_V2)
|
||||||
|
Q_DECLARE_METATYPE(TouchscreenInfoList_V2)
|
||||||
|
|
||||||
|
QDBusArgument &operator<<(QDBusArgument &arg, const TouchscreenInfo_V2 &info);
|
||||||
|
const QDBusArgument &operator>>(const QDBusArgument &arg, TouchscreenInfo_V2 &info);
|
||||||
|
|
||||||
|
void registerTouchscreenInfoList_V2MetaType();
|
||||||
|
|
||||||
|
#endif // !TOUCHSCREENINFOLISTV2_H
|
28
frame/dbusinterface/types/touchscreenmap.cpp
Normal file
28
frame/dbusinterface/types/touchscreenmap.cpp
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd.
|
||||||
|
*
|
||||||
|
* Author: quezhiyong <quezhiyong@uniontech.com>
|
||||||
|
*
|
||||||
|
* Maintainer: quezhiyong <quezhiyong@uniontech.com>
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* 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 "touchscreenmap.h"
|
||||||
|
|
||||||
|
void registerTouchscreenMapMetaType()
|
||||||
|
{
|
||||||
|
qRegisterMetaType<TouchscreenMap>("TouchscreenMap");
|
||||||
|
qDBusRegisterMetaType<TouchscreenMap>();
|
||||||
|
}
|
32
frame/dbusinterface/types/touchscreenmap.h
Normal file
32
frame/dbusinterface/types/touchscreenmap.h
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd.
|
||||||
|
*
|
||||||
|
* Author: quezhiyong <quezhiyong@uniontech.com>
|
||||||
|
*
|
||||||
|
* Maintainer: quezhiyong <quezhiyong@uniontech.com>
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* 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 TOUCHSCREENMAP_H
|
||||||
|
#define TOUCHSCREENMAP_H
|
||||||
|
|
||||||
|
#include <QMap>
|
||||||
|
#include <QDBusMetaType>
|
||||||
|
|
||||||
|
typedef QMap<QString, QString> TouchscreenMap;
|
||||||
|
|
||||||
|
void registerTouchscreenMapMetaType();
|
||||||
|
|
||||||
|
#endif // TOUCHSCREENMAP_H
|
92
frame/dbusinterface/types/zoneinfo.cpp
Normal file
92
frame/dbusinterface/types/zoneinfo.cpp
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd.
|
||||||
|
*
|
||||||
|
* Author: sbw <sbw@sbw.so>
|
||||||
|
* kirigaya <kirigaya@mkacg.com>
|
||||||
|
* Hualet <mr.asianwang@gmail.com>
|
||||||
|
*
|
||||||
|
* Maintainer: sbw <sbw@sbw.so>
|
||||||
|
* kirigaya <kirigaya@mkacg.com>
|
||||||
|
* Hualet <mr.asianwang@gmail.com>
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* 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 "zoneinfo.h"
|
||||||
|
|
||||||
|
ZoneInfo::ZoneInfo()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ZoneInfo::operator ==(const ZoneInfo &what) const
|
||||||
|
{
|
||||||
|
// TODO: 这里只判断这两个成员应该就可以了
|
||||||
|
return m_zoneName == what.m_zoneName &&
|
||||||
|
m_utcOffset == what.m_utcOffset;
|
||||||
|
}
|
||||||
|
|
||||||
|
QDebug operator<<(QDebug argument, const ZoneInfo & info)
|
||||||
|
{
|
||||||
|
argument << info.m_zoneName << ',' << info.m_zoneCity << ',' << info.m_utcOffset << ',';
|
||||||
|
argument << info.i2 << ',' << info.i3 << ',' << info.i4 << endl;
|
||||||
|
|
||||||
|
return argument;
|
||||||
|
}
|
||||||
|
|
||||||
|
QDBusArgument &operator<<(QDBusArgument & argument, const ZoneInfo & info)
|
||||||
|
{
|
||||||
|
argument.beginStructure();
|
||||||
|
argument << info.m_zoneName << info.m_zoneCity << info.m_utcOffset;
|
||||||
|
argument.beginStructure();
|
||||||
|
argument << info.i2 << info.i3 << info.i4;
|
||||||
|
argument.endStructure();
|
||||||
|
argument.endStructure();
|
||||||
|
|
||||||
|
return argument;
|
||||||
|
}
|
||||||
|
|
||||||
|
QDataStream &operator<<(QDataStream & argument, const ZoneInfo & info)
|
||||||
|
{
|
||||||
|
argument << info.m_zoneName << info.m_zoneCity << info.m_utcOffset;
|
||||||
|
argument << info.i2 << info.i3 << info.i4;
|
||||||
|
|
||||||
|
return argument;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QDBusArgument &operator>>(const QDBusArgument & argument, ZoneInfo & info)
|
||||||
|
{
|
||||||
|
argument.beginStructure();
|
||||||
|
argument >> info.m_zoneName >> info.m_zoneCity >> info.m_utcOffset;
|
||||||
|
argument.beginStructure();
|
||||||
|
argument >> info.i2 >> info.i3 >> info.i4;
|
||||||
|
argument.endStructure();
|
||||||
|
argument.endStructure();
|
||||||
|
|
||||||
|
return argument;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QDataStream &operator>>(QDataStream & argument, ZoneInfo & info)
|
||||||
|
{
|
||||||
|
argument >> info.m_zoneName >> info.m_zoneCity >> info.m_utcOffset;
|
||||||
|
argument >> info.i2 >> info.i3 >> info.i4;
|
||||||
|
|
||||||
|
return argument;
|
||||||
|
}
|
||||||
|
|
||||||
|
void registerZoneInfoMetaType()
|
||||||
|
{
|
||||||
|
qRegisterMetaType<ZoneInfo>("ZoneInfo");
|
||||||
|
qDBusRegisterMetaType<ZoneInfo>();
|
||||||
|
}
|
66
frame/dbusinterface/types/zoneinfo.h
Normal file
66
frame/dbusinterface/types/zoneinfo.h
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd.
|
||||||
|
*
|
||||||
|
* Author: sbw <sbw@sbw.so>
|
||||||
|
* kirigaya <kirigaya@mkacg.com>
|
||||||
|
* Hualet <mr.asianwang@gmail.com>
|
||||||
|
*
|
||||||
|
* Maintainer: sbw <sbw@sbw.so>
|
||||||
|
* kirigaya <kirigaya@mkacg.com>
|
||||||
|
* Hualet <mr.asianwang@gmail.com>
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* 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 ZONEINFO_H
|
||||||
|
#define ZONEINFO_H
|
||||||
|
|
||||||
|
#include <QDebug>
|
||||||
|
#include <QDataStream>
|
||||||
|
#include <QString>
|
||||||
|
#include <QDBusArgument>
|
||||||
|
#include <QDBusMetaType>
|
||||||
|
|
||||||
|
class ZoneInfo
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ZoneInfo();
|
||||||
|
|
||||||
|
friend QDebug operator<<(QDebug argument, const ZoneInfo &info);
|
||||||
|
friend QDBusArgument &operator<<(QDBusArgument &argument, const ZoneInfo &info);
|
||||||
|
friend QDataStream &operator<<(QDataStream &argument, const ZoneInfo &info);
|
||||||
|
friend const QDBusArgument &operator>>(const QDBusArgument &argument, ZoneInfo &info);
|
||||||
|
friend const QDataStream &operator>>(QDataStream &argument, ZoneInfo &info);
|
||||||
|
|
||||||
|
bool operator==(const ZoneInfo &what) const;
|
||||||
|
|
||||||
|
public:
|
||||||
|
inline QString getZoneName() const {return m_zoneName;}
|
||||||
|
inline QString getZoneCity() const {return m_zoneCity;}
|
||||||
|
inline int getUTCOffset() const {return m_utcOffset;}
|
||||||
|
|
||||||
|
private:
|
||||||
|
QString m_zoneName;
|
||||||
|
QString m_zoneCity;
|
||||||
|
int m_utcOffset;
|
||||||
|
qint64 i2;
|
||||||
|
qint64 i3;
|
||||||
|
int i4;
|
||||||
|
};
|
||||||
|
|
||||||
|
Q_DECLARE_METATYPE(ZoneInfo)
|
||||||
|
|
||||||
|
void registerZoneInfoMetaType();
|
||||||
|
|
||||||
|
#endif // ZONEINFO_H
|
100
frame/dbusinterface/xml/com.deepin.dde.daemon.Dock.xml
Normal file
100
frame/dbusinterface/xml/com.deepin.dde.daemon.Dock.xml
Normal file
@ -0,0 +1,100 @@
|
|||||||
|
<interface name="com.deepin.dde.daemon.Dock">
|
||||||
|
<method name="ActivateWindow">
|
||||||
|
<arg type="u" direction="in"/>
|
||||||
|
</method>
|
||||||
|
<method name="CancelPreviewWindow"/>
|
||||||
|
<method name="CloseWindow">
|
||||||
|
<arg type="u" direction="in"/>
|
||||||
|
</method>
|
||||||
|
<method name="GetDockedAppsDesktopFiles">
|
||||||
|
<arg type="as" direction="out"/>
|
||||||
|
</method>
|
||||||
|
<method name="GetEntryIDs">
|
||||||
|
<arg type="as" direction="out"/>
|
||||||
|
</method>
|
||||||
|
<method name="GetPluginSettings">
|
||||||
|
<arg type="s" direction="out"/>
|
||||||
|
</method>
|
||||||
|
<method name="IsDocked">
|
||||||
|
<arg type="s" direction="in"/>
|
||||||
|
<arg type="b" direction="out"/>
|
||||||
|
</method>
|
||||||
|
<method name="IsOnDock">
|
||||||
|
<arg type="s" direction="in"/>
|
||||||
|
<arg type="b" direction="out"/>
|
||||||
|
</method>
|
||||||
|
<method name="MakeWindowAbove">
|
||||||
|
<arg type="u" direction="in"/>
|
||||||
|
</method>
|
||||||
|
<method name="MaximizeWindow">
|
||||||
|
<arg type="u" direction="in"/>
|
||||||
|
</method>
|
||||||
|
<method name="MinimizeWindow">
|
||||||
|
<arg type="u" direction="in"/>
|
||||||
|
</method>
|
||||||
|
<method name="MoveEntry">
|
||||||
|
<arg type="i" direction="in"/>
|
||||||
|
<arg type="i" direction="in"/>
|
||||||
|
</method>
|
||||||
|
<method name="MoveWindow">
|
||||||
|
<arg type="u" direction="in"/>
|
||||||
|
</method>
|
||||||
|
<method name="PreviewWindow">
|
||||||
|
<arg type="u" direction="in"/>
|
||||||
|
</method>
|
||||||
|
<method name="QueryWindowIdentifyMethod">
|
||||||
|
<arg type="u" direction="in"/>
|
||||||
|
<arg type="s" direction="out"/>
|
||||||
|
</method>
|
||||||
|
<method name="RemovePluginSettings">
|
||||||
|
<arg type="s" direction="in"/>
|
||||||
|
<arg type="as" direction="in"/>
|
||||||
|
</method>
|
||||||
|
<method name="RequestDock">
|
||||||
|
<arg type="s" direction="in"/>
|
||||||
|
<arg type="i" direction="in"/>
|
||||||
|
<arg type="b" direction="out"/>
|
||||||
|
</method>
|
||||||
|
<method name="RequestUndock">
|
||||||
|
<arg type="s" direction="in"/>
|
||||||
|
<arg type="b" direction="out"/>
|
||||||
|
</method>
|
||||||
|
<method name="SetFrontendWindowRect">
|
||||||
|
<arg type="i" direction="in"/>
|
||||||
|
<arg type="i" direction="in"/>
|
||||||
|
<arg type="u" direction="in"/>
|
||||||
|
<arg type="u" direction="in"/>
|
||||||
|
</method>
|
||||||
|
<method name="SetPluginSettings">
|
||||||
|
<arg type="s" direction="in"/>
|
||||||
|
</method>
|
||||||
|
<method name="MergePluginSettings">
|
||||||
|
<arg type="s" direction="in"/>
|
||||||
|
</method>
|
||||||
|
<signal name="ServiceRestarted"/>
|
||||||
|
<signal name="EntryAdded">
|
||||||
|
<arg type="o"/>
|
||||||
|
<arg type="i"/>
|
||||||
|
</signal>
|
||||||
|
<signal name="EntryRemoved">
|
||||||
|
<arg type="s"/>
|
||||||
|
</signal>
|
||||||
|
<signal name="PluginSettingsSynced"/>
|
||||||
|
<signal name="DockAppSettingsSynced"/>
|
||||||
|
<property name="Entries" type="ao" access="read"/>
|
||||||
|
<property name="HideMode" type="i" access="readwrite"/>
|
||||||
|
<property name="DisplayMode" type="i" access="readwrite"/>
|
||||||
|
<property name="Position" type="i" access="readwrite"/>
|
||||||
|
<property name="IconSize" type="u" access="readwrite"/>
|
||||||
|
<property name="WindowSize" type="u" access="readwrite"/>
|
||||||
|
<property name="WindowSizeEfficient" type="u" access="readwrite"/>
|
||||||
|
<property name="WindowSizeFashion" type="u" access="readwrite"/>
|
||||||
|
<property name="ShowTimeout" type="u" access="readwrite"/>
|
||||||
|
<property name="HideTimeout" type="u" access="readwrite"/>
|
||||||
|
<property name="DockedApps" type="as" access="read"/>
|
||||||
|
<property name="HideState" type="i" access="read"/>
|
||||||
|
<property name="FrontendWindowRect" type="(iiuu)" access="read">
|
||||||
|
<annotation name="org.qtproject.QtDBus.QtTypeName" value="DockRect"/>
|
||||||
|
</property>
|
||||||
|
<property name="Opacity" type="d" access="readwrite"/>
|
||||||
|
</interface>
|
63
frame/dbusinterface/xml/org.deepin.api.XEventMonitor.xml
Normal file
63
frame/dbusinterface/xml/org.deepin.api.XEventMonitor.xml
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
<interface name="org.deepin.api.XEventMonitor1">
|
||||||
|
<method name="RegisterArea">
|
||||||
|
<arg type="i" direction="in"/>
|
||||||
|
<arg type="i" direction="in"/>
|
||||||
|
<arg type="i" direction="in"/>
|
||||||
|
<arg type="i" direction="in"/>
|
||||||
|
<arg type="i" direction="in"/>
|
||||||
|
<arg type="s" direction="out"/>
|
||||||
|
</method>
|
||||||
|
<method name="RegisterAreas">
|
||||||
|
<arg type="a(iiii)" direction="in"/>
|
||||||
|
<arg type="i" direction="in"/>
|
||||||
|
<arg type="s" direction="out"/>
|
||||||
|
<annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="AreaList"/>
|
||||||
|
</method>
|
||||||
|
<method name="RegisterFullScreen">
|
||||||
|
<arg type="s" direction="out"/>
|
||||||
|
</method>
|
||||||
|
<method name="UnregisterArea">
|
||||||
|
<arg type="s" direction="in"/>
|
||||||
|
<arg type="b" direction="out"/>
|
||||||
|
</method>
|
||||||
|
<signal name="CursorInto">
|
||||||
|
<arg type="i"/>
|
||||||
|
<arg type="i"/>
|
||||||
|
<arg type="s"/>
|
||||||
|
</signal>
|
||||||
|
<signal name="CursorOut">
|
||||||
|
<arg type="i"/>
|
||||||
|
<arg type="i"/>
|
||||||
|
<arg type="s"/>
|
||||||
|
</signal>
|
||||||
|
<signal name="CursorMove">
|
||||||
|
<arg type="i"/>
|
||||||
|
<arg type="i"/>
|
||||||
|
<arg type="s"/>
|
||||||
|
</signal>
|
||||||
|
<signal name="ButtonPress">
|
||||||
|
<arg type="i"/>
|
||||||
|
<arg type="i"/>
|
||||||
|
<arg type="i"/>
|
||||||
|
<arg type="s"/>
|
||||||
|
</signal>
|
||||||
|
<signal name="ButtonRelease">
|
||||||
|
<arg type="i"/>
|
||||||
|
<arg type="i"/>
|
||||||
|
<arg type="i"/>
|
||||||
|
<arg type="s"/>
|
||||||
|
</signal>
|
||||||
|
<signal name="KeyPress">
|
||||||
|
<arg type="s"/>
|
||||||
|
<arg type="i"/>
|
||||||
|
<arg type="i"/>
|
||||||
|
<arg type="s"/>
|
||||||
|
</signal>
|
||||||
|
<signal name="KeyRelease">
|
||||||
|
<arg type="s"/>
|
||||||
|
<arg type="i"/>
|
||||||
|
<arg type="i"/>
|
||||||
|
<arg type="s"/>
|
||||||
|
</signal>
|
||||||
|
<signal name="CancelAllArea"/>
|
||||||
|
</interface>
|
38
frame/dbusinterface/xml/org.deepin.daemon.Audio.Sink.xml
Normal file
38
frame/dbusinterface/xml/org.deepin.daemon.Audio.Sink.xml
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
<interface name="org.deepin.daemon.Audio1.Sink">
|
||||||
|
<method name="GetMeter">
|
||||||
|
<arg type="o" direction="out"/>
|
||||||
|
</method>
|
||||||
|
<method name="SetBalance">
|
||||||
|
<arg type="d" direction="in"/>
|
||||||
|
<arg type="b" direction="in"/>
|
||||||
|
</method>
|
||||||
|
<method name="SetFade">
|
||||||
|
<arg type="d" direction="in"/>
|
||||||
|
</method>
|
||||||
|
<method name="SetMute">
|
||||||
|
<arg type="b" direction="in"/>
|
||||||
|
</method>
|
||||||
|
<method name="SetPort">
|
||||||
|
<arg type="s" direction="in"/>
|
||||||
|
</method>
|
||||||
|
<method name="SetVolume">
|
||||||
|
<arg type="d" direction="in"/>
|
||||||
|
<arg type="b" direction="in"/>
|
||||||
|
</method>
|
||||||
|
<property name="Name" type="s" access="read"/>\n
|
||||||
|
<property name="Description" type="s" access="read"/>
|
||||||
|
<property name="BaseVolume" type="d" access="read"/>
|
||||||
|
<property name="Mute" type="b" access="read"/>
|
||||||
|
<property name="Volume" type="d" access="read"/>
|
||||||
|
<property name="Balance" type="d" access="read"/>
|
||||||
|
<property name="SupportBalance" type="b" access="read"/>
|
||||||
|
<property name="Fade" type="d" access="read"/>
|
||||||
|
<property name="SupportFade" type="b" access="read"/>
|
||||||
|
<property name="Ports" type="a(ssy)" access="read">
|
||||||
|
<annotation name="org.qtproject.QtDBus.QtTypeName" value="AudioPortList"/>
|
||||||
|
</property>
|
||||||
|
<property name="ActivePort" type="(ssy)" access="read">
|
||||||
|
<annotation name="org.qtproject.QtDBus.QtTypeName" value="AudioPort"/>
|
||||||
|
</property>
|
||||||
|
<property name="Card" type="u" access="read"/>
|
||||||
|
</interface>
|
46
frame/dbusinterface/xml/org.deepin.daemon.Audio.xml
Normal file
46
frame/dbusinterface/xml/org.deepin.daemon.Audio.xml
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
<interface name="org.deepin.daemon.Audio1">
|
||||||
|
<method name="Reset"/>
|
||||||
|
<method name="SetDefaultSink">
|
||||||
|
<arg type="s" direction="in"/>
|
||||||
|
</method>
|
||||||
|
<method name="SetDefaultSource">
|
||||||
|
<arg type="s" direction="in"/>
|
||||||
|
</method>
|
||||||
|
<method name="SetBluetoothAudioMode">
|
||||||
|
<arg type="s" direction="in"/>
|
||||||
|
</method>
|
||||||
|
<method name="SetPort">
|
||||||
|
<arg type="u" direction="in"/>
|
||||||
|
<arg type="s" direction="in"/>
|
||||||
|
<arg type="i" direction="in"/>
|
||||||
|
</method>
|
||||||
|
<method name="SetPortEnabled">
|
||||||
|
<arg type="u" direction="in"/>
|
||||||
|
<arg type="s" direction="in"/>
|
||||||
|
<arg type="b" direction="in"/>
|
||||||
|
</method>
|
||||||
|
<method name="IsPortEnabled">
|
||||||
|
<arg type="u" direction="in"/>
|
||||||
|
<arg type="s" direction="in"/>
|
||||||
|
<arg type="b" direction="out"/>
|
||||||
|
</method>
|
||||||
|
<signal name="PortEnabledChanged">
|
||||||
|
<arg type="u"></arg>
|
||||||
|
<arg type="s"></arg>
|
||||||
|
<arg type="b"></arg>
|
||||||
|
</signal>
|
||||||
|
<property name="SinkInputs" type="ao" access="read"/>
|
||||||
|
<property name="Sinks" type="ao" access="read"/>
|
||||||
|
<property name="Sources" type="ao" access="read"/>
|
||||||
|
<property name="BluetoothAudioModeOpts" type="as" access="read">
|
||||||
|
<annotation name="org.qtproject.QtDBus.QtTypeName" value="QStringList"/>
|
||||||
|
</property>
|
||||||
|
<property name="BluetoothAudioMode" type="s" access="read"/>
|
||||||
|
<property name="Cards" type="s" access="read"/>
|
||||||
|
<property name="CardsWithoutUnavailable" type="s" access="read"/>
|
||||||
|
<property name="DefaultSink" type="o" access="read"/>
|
||||||
|
<property name="DefaultSource" type="o" access="read"/>
|
||||||
|
<property name="MaxUIVolume" type="d" access="read"/>
|
||||||
|
<property name="IncreaseVolume" type="b" access="readwrite"/>
|
||||||
|
<property name="ReduceNoise" type="b" access="readwrite"/>
|
||||||
|
</interface>
|
83
frame/dbusinterface/xml/org.deepin.daemon.Display.xml
Normal file
83
frame/dbusinterface/xml/org.deepin.daemon.Display.xml
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
<interface name="com.deepin.daemon.Display">
|
||||||
|
<method name="ApplyChanges"></method>
|
||||||
|
<method name="AssociateTouch">
|
||||||
|
<arg type="s" direction="in"></arg>
|
||||||
|
<arg type="s" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="AssociateTouchByUUID">
|
||||||
|
<arg type="s" direction="in"></arg>
|
||||||
|
<arg type="s" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="ChangeBrightness">
|
||||||
|
<arg type="b" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="DeleteCustomMode">
|
||||||
|
<arg type="s" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="GetRealDisplayMode">
|
||||||
|
<arg type="y" direction="out"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="ListOutputNames">
|
||||||
|
<arg type="as" direction="out"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="ListOutputsCommonModes">
|
||||||
|
<arg type="a(uqqd)" direction="out"></arg>
|
||||||
|
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="ResolutionList"/>
|
||||||
|
</method>
|
||||||
|
<method name="ModifyConfigName">
|
||||||
|
<arg type="s" direction="in"></arg>
|
||||||
|
<arg type="s" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="RefreshBrightness"></method>
|
||||||
|
<method name="Reset"></method>
|
||||||
|
<method name="ResetChanges"></method>
|
||||||
|
<method name="Save"></method>
|
||||||
|
<method name="SetAndSaveBrightness">
|
||||||
|
<arg type="s" direction="in"></arg>
|
||||||
|
<arg type="d" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="SetBrightness">
|
||||||
|
<arg type="s" direction="in"></arg>
|
||||||
|
<arg type="d" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="SetPrimary">
|
||||||
|
<arg type="s" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="SwitchMode">
|
||||||
|
<arg type="y" direction="in"></arg>
|
||||||
|
<arg type="s" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="SetMethodAdjustCCT">
|
||||||
|
<arg type="i" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="SetColorTemperature">
|
||||||
|
<arg type="i" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
<property name="HasChanged" type="b" access="read"></property>
|
||||||
|
<property name="DisplayMode" type="y" access="read"></property>
|
||||||
|
<property name="ScreenWidth" type="q" access="read"></property>
|
||||||
|
<property name="ScreenHeight" type="q" access="read"></property>
|
||||||
|
<property name="Primary" type="s" access="read"></property>
|
||||||
|
<property name="CurrentCustomId" type="s" access="read"></property>
|
||||||
|
<property name="CustomIdList" type="as" access="read"></property>
|
||||||
|
<property name="MaxBacklightBrightness" type="u" access="read"></property>
|
||||||
|
<property name="PrimaryRect" type="(nnqq)" access="read">
|
||||||
|
<annotation name="org.qtproject.QtDBus.QtTypeName" value="ScreenRect"/>
|
||||||
|
</property>
|
||||||
|
<property name="Monitors" type="ao" access="read"></property>
|
||||||
|
<property name="Brightness" type="a{sd}" access="read">
|
||||||
|
<annotation name="org.qtproject.QtDBus.QtTypeName" value="BrightnessMap"/>
|
||||||
|
</property>
|
||||||
|
<property name="Touchscreens" type="a(isss)" access="read">
|
||||||
|
<annotation name="org.qtproject.QtDBus.QtTypeName" value="TouchscreenInfoList"/>
|
||||||
|
</property>
|
||||||
|
<property name="TouchscreensV2" type="a(issss)" access="read">
|
||||||
|
<annotation name="org.qtproject.QtDBus.QtTypeName" value="TouchscreenInfoList_V2"/>
|
||||||
|
</property>
|
||||||
|
<property name="TouchMap" type="a{ss}" access="read">
|
||||||
|
<annotation name="org.qtproject.QtDBus.QtTypeName" value="TouchscreenMap"/>
|
||||||
|
</property>
|
||||||
|
<property name="ColorTemperatureMode" type="i" access="read"></property>
|
||||||
|
<property name="ColorTemperatureManual" type="i" access="read"></property>
|
||||||
|
</interface>
|
||||||
|
|
27
frame/dbusinterface/xml/org.deepin.daemon.Gesture.xml
Normal file
27
frame/dbusinterface/xml/org.deepin.daemon.Gesture.xml
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<interface name="com.deepin.daemon.Gesture1">
|
||||||
|
<signal name="TouchSinglePressTimeout">
|
||||||
|
<arg name="time" type="i"></arg>
|
||||||
|
<arg name="scalex" type="d"></arg>
|
||||||
|
<arg name="scaley" type="d"></arg>
|
||||||
|
</signal>
|
||||||
|
<signal name="TouchUpOrCancel">
|
||||||
|
<arg name="scalex" type="d"></arg>
|
||||||
|
<arg name="scaley" type="d"></arg>
|
||||||
|
</signal>
|
||||||
|
<signal name="TouchMoving">
|
||||||
|
<arg name="scalex" type="d"></arg>
|
||||||
|
<arg name="scaley" type="d"></arg>
|
||||||
|
</signal>
|
||||||
|
<signal name="TouchPressTimeout">
|
||||||
|
<arg name="fingers" type="i"></arg>
|
||||||
|
<arg name="time" type="i"></arg>
|
||||||
|
<arg name="scalex" type="d"></arg>
|
||||||
|
<arg name="scaley" type="d"></arg>
|
||||||
|
</signal>
|
||||||
|
<signal name="TouchEdgeEvent">
|
||||||
|
<arg name="direction" type="s"></arg>
|
||||||
|
<arg name="scalex" type="d"></arg>
|
||||||
|
<arg name="scaley" type="d"></arg>
|
||||||
|
</signal>
|
||||||
|
</interface>
|
||||||
|
|
62
frame/dbusinterface/xml/org.deepin.daemon.Timedate.xml
Normal file
62
frame/dbusinterface/xml/org.deepin.daemon.Timedate.xml
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
<interface name="org.deepin.daemon.Timedate1">
|
||||||
|
<signal name="TimeUpdate">
|
||||||
|
</signal>
|
||||||
|
<method name="AddUserTimezone">
|
||||||
|
<arg type="s" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="DeleteUserTimezone">
|
||||||
|
<arg type="s" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="GetZoneInfo">
|
||||||
|
<arg type="s" direction="in"></arg>
|
||||||
|
<arg type="(ssi(xxi))" direction="out"></arg>
|
||||||
|
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value ="ZoneInfo"/>
|
||||||
|
</method>
|
||||||
|
<method name="GetZoneList">
|
||||||
|
<arg type="as" direction="out"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="GetSampleNTPServers">
|
||||||
|
<arg type="as" direction="out"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="SetDate">
|
||||||
|
<arg type="i" direction="in"></arg>
|
||||||
|
<arg type="i" direction="in"></arg>
|
||||||
|
<arg type="i" direction="in"></arg>
|
||||||
|
<arg type="i" direction="in"></arg>
|
||||||
|
<arg type="i" direction="in"></arg>
|
||||||
|
<arg type="i" direction="in"></arg>
|
||||||
|
<arg type="i" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="SetLocalRTC">
|
||||||
|
<arg type="b" direction="in"></arg>
|
||||||
|
<arg type="b" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="SetNTP">
|
||||||
|
<arg type="b" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="SetNTPServer">
|
||||||
|
<arg type="s" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="SetTime">
|
||||||
|
<arg type="x" direction="in"></arg>
|
||||||
|
<arg type="b" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="SetTimezone">
|
||||||
|
<arg type="s" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
<property name="CanNTP" type="b" access="read"></property>
|
||||||
|
<property name="NTP" type="b" access="read"></property>
|
||||||
|
<property name="LocalRTC" type="b" access="read"></property>
|
||||||
|
<property name="Timezone" type="s" access="read"></property>
|
||||||
|
<property name="Use24HourFormat" type="b" access="readwrite"></property>
|
||||||
|
<property name="DSTOffset" type="i" access="readwrite"></property>
|
||||||
|
<property name="UserTimezones" type="as" access="read"></property>
|
||||||
|
<property name="NTPServer" type="s" access="read"></property>
|
||||||
|
<property name="WeekdayFormat" type="i" access="readwrite"></property>
|
||||||
|
<property name="ShortDateFormat" type="i" access="readwrite"></property>
|
||||||
|
<property name="LongDateFormat" type="i" access="readwrite"></property>
|
||||||
|
<property name="ShortTimeFormat" type="i" access="readwrite"></property>
|
||||||
|
<property name="LongTimeFormat" type="i" access="readwrite"></property>
|
||||||
|
<property name="WeekBegins" type="i" access="readwrite"></property>
|
||||||
|
</interface>
|
||||||
|
|
21
frame/dbusinterface/xml/org.deepin.dde.Launcher.xml
Normal file
21
frame/dbusinterface/xml/org.deepin.dde.Launcher.xml
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
<interface name="org.deepin.dde.Launcher1">
|
||||||
|
<property name="Visible" type="b" access="read"/>
|
||||||
|
<signal name="Closed"></signal>
|
||||||
|
<signal name="Shown"></signal>
|
||||||
|
<signal name="VisibleChanged">
|
||||||
|
<arg name="visible" type="b" direction="out"/>
|
||||||
|
</signal>
|
||||||
|
<method name="Exit"></method>
|
||||||
|
<method name="Hide"></method>
|
||||||
|
<method name="Show"></method>
|
||||||
|
<method name="ShowByMode">
|
||||||
|
<arg name="in0" type="x" direction="in"/>
|
||||||
|
</method>
|
||||||
|
<method name="UninstallApp">
|
||||||
|
<arg name="appKey" type="s" direction="in"/>
|
||||||
|
</method>
|
||||||
|
<method name="Toggle"></method>
|
||||||
|
<method name="IsVisible">
|
||||||
|
<arg type="b" direction="out"/>
|
||||||
|
</method>
|
||||||
|
</interface>
|
17
frame/dbusinterface/xml/org.freedesktop.FileManager.xml
Normal file
17
frame/dbusinterface/xml/org.freedesktop.FileManager.xml
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<interface name='org.freedesktop.FileManager1'>
|
||||||
|
<method name='ShowFolders'>
|
||||||
|
<arg type='as' name='URIs' direction='in'/>
|
||||||
|
<arg type='s' name='StartupId' direction='in'/>
|
||||||
|
</method>
|
||||||
|
<method name='ShowItems'>
|
||||||
|
<arg type='as' name='URIs' direction='in'/>
|
||||||
|
<arg type='s' name='StartupId' direction='in'/>
|
||||||
|
</method>
|
||||||
|
<method name='ShowItemProperties'>
|
||||||
|
<arg type='as' name='URIs' direction='in'/>
|
||||||
|
<arg type='s' name='StartupId' direction='in'/>
|
||||||
|
</method>
|
||||||
|
<method name='Trash'>
|
||||||
|
<arg type='as' name='URIs' direction='in'/>
|
||||||
|
</method>
|
||||||
|
</interface>
|
61
frame/dbusinterface/xml/org.kde.StatusNotifierItem.xml
Normal file
61
frame/dbusinterface/xml/org.kde.StatusNotifierItem.xml
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
<interface name="org.kde.StatusNotifierItem">
|
||||||
|
<property access="read" type="s" name="Category"/>
|
||||||
|
<property access="read" type="s" name="Id"/>
|
||||||
|
<property access="read" type="s" name="Title"/>
|
||||||
|
<property access="read" type="s" name="Status"/>
|
||||||
|
<property access="read" type="i" name="WindowId"/>
|
||||||
|
<!-- An additional path to add to the theme search path to find the icons specified above. -->
|
||||||
|
<property access="read" type="s" name="IconThemePath"/>
|
||||||
|
<property access="read" type="o" name="Menu"/>
|
||||||
|
<property access="read" type="b" name="ItemIsMenu"/>
|
||||||
|
<!-- main icon -->
|
||||||
|
<!-- names are preferred over pixmaps -->
|
||||||
|
<property access="read" type="s" name="IconName"/>
|
||||||
|
<!--struct containing width, height and image data-->
|
||||||
|
<property access="read" type="a(iiay)" name="IconPixmap">
|
||||||
|
<annotation value="DBusImageList" name="org.qtproject.QtDBus.QtTypeName"/>
|
||||||
|
</property>
|
||||||
|
<property access="read" type="s" name="OverlayIconName"/>
|
||||||
|
<property access="read" type="a(iiay)" name="OverlayIconPixmap">
|
||||||
|
<annotation value="DBusImageList" name="org.qtproject.QtDBus.QtTypeName"/>
|
||||||
|
</property>
|
||||||
|
<!-- Requesting attention icon -->
|
||||||
|
<property access="read" type="s" name="AttentionIconName"/>
|
||||||
|
<!--same definition as image-->
|
||||||
|
<property access="read" type="a(iiay)" name="AttentionIconPixmap">
|
||||||
|
<annotation value="DBusImageList" name="org.qtproject.QtDBus.QtTypeName"/>
|
||||||
|
</property>
|
||||||
|
<property access="read" type="s" name="AttentionMovieName"/>
|
||||||
|
<!-- tooltip data -->
|
||||||
|
<!--(iiay) is an image-->
|
||||||
|
<property access="read" type="(sa(iiay)ss)" name="ToolTip">
|
||||||
|
<annotation value="DBusToolTip" name="org.qtproject.QtDBus.QtTypeName"/>
|
||||||
|
</property>
|
||||||
|
<!-- interaction: the systemtray wants the application to do something -->
|
||||||
|
<method name="ContextMenu">
|
||||||
|
<!-- we're passing the coordinates of the icon, so the app knows where to put the popup window -->
|
||||||
|
<arg direction="in" type="i" name="x"/>
|
||||||
|
<arg direction="in" type="i" name="y"/>
|
||||||
|
</method>
|
||||||
|
<method name="Activate">
|
||||||
|
<arg direction="in" type="i" name="x"/>
|
||||||
|
<arg direction="in" type="i" name="y"/>
|
||||||
|
</method>
|
||||||
|
<method name="SecondaryActivate">
|
||||||
|
<arg direction="in" type="i" name="x"/>
|
||||||
|
<arg direction="in" type="i" name="y"/>
|
||||||
|
</method>
|
||||||
|
<method name="Scroll">
|
||||||
|
<arg direction="in" type="i" name="delta"/>
|
||||||
|
<arg direction="in" type="s" name="orientation"/>
|
||||||
|
</method>
|
||||||
|
<!-- Signals: the client wants to change something in the status-->
|
||||||
|
<signal name="NewTitle"/>
|
||||||
|
<signal name="NewIcon"/>
|
||||||
|
<signal name="NewAttentionIcon"/>
|
||||||
|
<signal name="NewOverlayIcon"/>
|
||||||
|
<signal name="NewToolTip"/>
|
||||||
|
<signal name="NewStatus">
|
||||||
|
<arg type="s" name="status"/>
|
||||||
|
</signal>
|
||||||
|
</interface>
|
@ -26,8 +26,7 @@
|
|||||||
|
|
||||||
#include "singleton.h"
|
#include "singleton.h"
|
||||||
#include "constants.h"
|
#include "constants.h"
|
||||||
|
#include "org_deepin_daemon_display.h"
|
||||||
#include <com_deepin_daemon_display.h>
|
|
||||||
|
|
||||||
using DisplayInter = com::deepin::daemon::Display;
|
using DisplayInter = com::deepin::daemon::Display;
|
||||||
using namespace Dock;
|
using namespace Dock;
|
||||||
|
@ -24,13 +24,13 @@
|
|||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "displaymanager.h"
|
#include "displaymanager.h"
|
||||||
|
|
||||||
#include <com_deepin_api_xeventmonitor.h>
|
#include "org_deepin_api_xeventmonitor.h"
|
||||||
|
|
||||||
#define SPLIT_NONE 0
|
#define SPLIT_NONE 0
|
||||||
#define SPLIT_LEFT 1
|
#define SPLIT_LEFT 1
|
||||||
#define SPLIT_RIGHT 2
|
#define SPLIT_RIGHT 2
|
||||||
|
|
||||||
using XEventMonitor = ::com::deepin::api::XEventMonitor;
|
using XEventMonitor = ::org::deepin::api::XEventMonitor1;
|
||||||
|
|
||||||
AppDragWidget::AppDragWidget(QWidget *parent)
|
AppDragWidget::AppDragWidget(QWidget *parent)
|
||||||
: QGraphicsView(parent)
|
: QGraphicsView(parent)
|
||||||
|
@ -11,8 +11,8 @@
|
|||||||
* @param parent
|
* @param parent
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static const QString serviceName = QString("com.deepin.daemon.Audio");
|
static const QString serviceName = QString("org.deepin.daemon.Audio1");
|
||||||
static const QString servicePath = QString("/com/deepin/daemon/Audio");
|
static const QString servicePath = QString("/org/deepin/daemon/Audio1");
|
||||||
|
|
||||||
VolumeModel::VolumeModel(QObject *parent)
|
VolumeModel::VolumeModel(QObject *parent)
|
||||||
: QObject(parent)
|
: QObject(parent)
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
#ifndef VOLUMNMODEL_H
|
#ifndef VOLUMNMODEL_H
|
||||||
#define VOLUMNMODEL_H
|
#define VOLUMNMODEL_H
|
||||||
|
|
||||||
|
#include "org_deepin_daemon_audio.h"
|
||||||
|
#include "org_deepin_daemon_audio_sink.h"
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
#include <com_deepin_daemon_audio.h>
|
using DBusAudio = org::deepin::daemon::Audio1;
|
||||||
#include <com_deepin_daemon_audio_sink.h>
|
using DBusSink = org::deepin::daemon::audio1::Sink;
|
||||||
|
|
||||||
using DBusAudio = com::deepin::daemon::Audio;
|
|
||||||
using DBusSink = com::deepin::daemon::audio::Sink;
|
|
||||||
|
|
||||||
class QDBusMessage;
|
class QDBusMessage;
|
||||||
class AudioSink;
|
class AudioSink;
|
||||||
|
1
frame/qtdbusextended/DBusExtended
Normal file
1
frame/qtdbusextended/DBusExtended
Normal file
@ -0,0 +1 @@
|
|||||||
|
#include "dbusextended.h"
|
1
frame/qtdbusextended/DBusExtendedAbstractInterface
Normal file
1
frame/qtdbusextended/DBusExtendedAbstractInterface
Normal file
@ -0,0 +1 @@
|
|||||||
|
#include "dbusextendedabstractinterface.h"
|
35
frame/qtdbusextended/dbusextended.h
Normal file
35
frame/qtdbusextended/dbusextended.h
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
// -*- c++ -*-
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*
|
||||||
|
* Copyright (C) 2015 Jolla Ltd.
|
||||||
|
*
|
||||||
|
* Contact: Valerio Valerio <valerio.valerio@jolla.com>
|
||||||
|
* Author: Andres Gomez <andres.gomez@jolla.com>
|
||||||
|
*
|
||||||
|
* This 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 library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef QT_DBUS_EXTENDED_H
|
||||||
|
#define QT_DBUS_EXTENDED_H
|
||||||
|
|
||||||
|
#if defined(QT_DBUS_EXTENDED_LIBRARY)
|
||||||
|
# define QT_DBUS_EXTENDED_EXPORT Q_DECL_EXPORT
|
||||||
|
#else
|
||||||
|
# define QT_DBUS_EXTENDED_EXPORT Q_DECL_IMPORT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* QT_DBUS_EXTENDED_H */
|
525
frame/qtdbusextended/dbusextendedabstractinterface.cpp
Normal file
525
frame/qtdbusextended/dbusextendedabstractinterface.cpp
Normal file
@ -0,0 +1,525 @@
|
|||||||
|
// -*- c++ -*-
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*
|
||||||
|
* Copyright (C) 2015 Jolla Ltd.
|
||||||
|
*
|
||||||
|
* Contact: Valerio Valerio <valerio.valerio@jolla.com>
|
||||||
|
* Author: Andres Gomez <andres.gomez@jolla.com>
|
||||||
|
*
|
||||||
|
* This 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 library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "dbusextendedpendingcallwatcher_p.h"
|
||||||
|
|
||||||
|
#include <DBusExtendedAbstractInterface>
|
||||||
|
|
||||||
|
#include <QtDBus/QDBusMetaType>
|
||||||
|
#include <QtDBus/QDBusMessage>
|
||||||
|
#include <QtDBus/QDBusPendingCall>
|
||||||
|
#include <QtDBus/QDBusPendingCallWatcher>
|
||||||
|
#include <QtDBus/QDBusPendingReply>
|
||||||
|
|
||||||
|
#include <QtCore/QDebug>
|
||||||
|
#include <QtCore/QMetaProperty>
|
||||||
|
|
||||||
|
|
||||||
|
Q_GLOBAL_STATIC_WITH_ARGS(QByteArray, dBusInterface, ("org.freedesktop.DBus"))
|
||||||
|
Q_GLOBAL_STATIC_WITH_ARGS(QByteArray, dBusPropertiesInterface, ("org.freedesktop.DBus.Properties"))
|
||||||
|
Q_GLOBAL_STATIC_WITH_ARGS(QByteArray, dBusPropertiesChangedSignal, ("PropertiesChanged"))
|
||||||
|
Q_GLOBAL_STATIC_WITH_ARGS(QByteArray, propertyChangedSignature, ("propertyChanged(QString,QVariant)"))
|
||||||
|
Q_GLOBAL_STATIC_WITH_ARGS(QByteArray, propertyInvalidatedSignature, ("propertyInvalidated(QString)"))
|
||||||
|
|
||||||
|
|
||||||
|
DBusExtendedAbstractInterface::DBusExtendedAbstractInterface(const QString &service, const QString &path, const char *interface, const QDBusConnection &connection, QObject *parent)
|
||||||
|
: QDBusAbstractInterface(service, path, interface, connection, parent)
|
||||||
|
, m_sync(true)
|
||||||
|
, m_useCache(false)
|
||||||
|
, m_getAllPendingCallWatcher(0)
|
||||||
|
, m_propertiesChangedConnected(false)
|
||||||
|
{
|
||||||
|
const_cast<QDBusConnection&>(connection).connect(QString("org.freedesktop.DBus"), QString("/org/freedesktop/DBus"), QString("org.freedesktop.DBus"), QString("NameOwnerChanged"), this, SLOT(onDBusNameOwnerChanged(QString,QString,QString)));
|
||||||
|
}
|
||||||
|
|
||||||
|
DBusExtendedAbstractInterface::~DBusExtendedAbstractInterface()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void DBusExtendedAbstractInterface::setSync(bool sync) { setSync(sync, true); }
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Note: After sync is set to false, it will always return a empty value
|
||||||
|
* if you call the property's get function directly. So you can only get it
|
||||||
|
* through the changed signal when you get an property, and it's also a good idea
|
||||||
|
* to save a cache yourself.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 注意: 如果设置 sync 为 false 那么在调用属性的 get 函数获取一个属性时会一直返回空值,
|
||||||
|
* 解决方法是监听属性的 changed 信号并自行保存一份缓存, 让 changed 信号修改这个缓存
|
||||||
|
*/
|
||||||
|
void DBusExtendedAbstractInterface::setSync(bool sync, bool autoStart)
|
||||||
|
{
|
||||||
|
m_sync = sync;
|
||||||
|
|
||||||
|
// init all properties
|
||||||
|
if (autoStart && !m_sync && !isValid())
|
||||||
|
startServiceProcess();
|
||||||
|
}
|
||||||
|
|
||||||
|
void DBusExtendedAbstractInterface::getAllProperties()
|
||||||
|
{
|
||||||
|
m_lastExtendedError = QDBusError();
|
||||||
|
|
||||||
|
if (!isValid()) {
|
||||||
|
QString errorMessage = QStringLiteral("This Extended DBus interface is not valid yet.");
|
||||||
|
m_lastExtendedError = QDBusMessage::createError(QDBusError::Failed, errorMessage);
|
||||||
|
qDebug() << Q_FUNC_INFO << errorMessage;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!m_sync && m_getAllPendingCallWatcher) {
|
||||||
|
// Call already in place, not repeating ...
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
QDBusMessage msg = QDBusMessage::createMethodCall(service(), path(), *dBusPropertiesInterface(), QStringLiteral("GetAll"));
|
||||||
|
msg << interface();
|
||||||
|
|
||||||
|
if (m_sync) {
|
||||||
|
QDBusMessage reply = connection().call(msg);
|
||||||
|
|
||||||
|
if (reply.type() != QDBusMessage::ReplyMessage) {
|
||||||
|
m_lastExtendedError = QDBusError(reply);
|
||||||
|
qWarning() << Q_FUNC_INFO << m_lastExtendedError.message();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (reply.signature() != QLatin1String("a{sv}")) {
|
||||||
|
QString errorMessage = QStringLiteral("Invalid signature \"%1\" in return from call to %2")
|
||||||
|
.arg(reply.signature(),
|
||||||
|
QString(*dBusPropertiesInterface()));
|
||||||
|
qWarning() << Q_FUNC_INFO << errorMessage;
|
||||||
|
m_lastExtendedError = QDBusError(QDBusError::InvalidSignature, errorMessage);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
QVariantMap value = reply.arguments().at(0).toMap();
|
||||||
|
onPropertiesChanged(interface(), value, QStringList());
|
||||||
|
} else {
|
||||||
|
QDBusPendingReply<QVariantMap> async = connection().asyncCall(msg);
|
||||||
|
m_getAllPendingCallWatcher = new QDBusPendingCallWatcher(async, this);
|
||||||
|
|
||||||
|
connect(m_getAllPendingCallWatcher, SIGNAL(finished(QDBusPendingCallWatcher*)), this, SLOT(onAsyncGetAllPropertiesFinished(QDBusPendingCallWatcher*)));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void DBusExtendedAbstractInterface::connectNotify(const QMetaMethod &signal)
|
||||||
|
{
|
||||||
|
if (signal.methodType() == QMetaMethod::Signal
|
||||||
|
&& (signal.methodSignature() == *propertyChangedSignature()
|
||||||
|
|| signal.methodSignature() == *propertyInvalidatedSignature())) {
|
||||||
|
if (!m_propertiesChangedConnected) {
|
||||||
|
QStringList argumentMatch;
|
||||||
|
argumentMatch << interface();
|
||||||
|
connection().connect(service(), path(), *dBusPropertiesInterface(), *dBusPropertiesChangedSignal(),
|
||||||
|
argumentMatch, QString(),
|
||||||
|
this, SLOT(onPropertiesChanged(QString, QVariantMap, QStringList)));
|
||||||
|
|
||||||
|
m_propertiesChangedConnected = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
QDBusAbstractInterface::connectNotify(signal);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void DBusExtendedAbstractInterface::disconnectNotify(const QMetaMethod &signal)
|
||||||
|
{
|
||||||
|
if (signal.methodType() == QMetaMethod::Signal
|
||||||
|
&& (signal.methodSignature() == *propertyChangedSignature()
|
||||||
|
|| signal.methodSignature() == *propertyInvalidatedSignature())) {
|
||||||
|
if (m_propertiesChangedConnected
|
||||||
|
&& 0 == receivers(propertyChangedSignature()->constData())
|
||||||
|
&& 0 == receivers(propertyInvalidatedSignature()->constData())) {
|
||||||
|
QStringList argumentMatch;
|
||||||
|
argumentMatch << interface();
|
||||||
|
connection().disconnect(service(), path(), *dBusPropertiesInterface(), *dBusPropertiesChangedSignal(),
|
||||||
|
argumentMatch, QString(),
|
||||||
|
this, SLOT(onPropertiesChanged(QString, QVariantMap, QStringList)));
|
||||||
|
|
||||||
|
m_propertiesChangedConnected = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
QDBusAbstractInterface::disconnectNotify(signal);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QVariant DBusExtendedAbstractInterface::internalPropGet(const char *propname, void *propertyPtr)
|
||||||
|
{
|
||||||
|
m_lastExtendedError = QDBusError();
|
||||||
|
|
||||||
|
if (m_useCache) {
|
||||||
|
int propertyIndex = metaObject()->indexOfProperty(propname);
|
||||||
|
QMetaProperty metaProperty = metaObject()->property(propertyIndex);
|
||||||
|
return QVariant(metaProperty.userType(), propertyPtr);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_sync) {
|
||||||
|
QVariant ret = property(propname);
|
||||||
|
|
||||||
|
QMetaType::construct(ret.userType(), propertyPtr, ret.constData());
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
} else {
|
||||||
|
if (!isValid()) {
|
||||||
|
QString errorMessage = QStringLiteral("This Extended DBus interface is not valid yet.");
|
||||||
|
m_lastExtendedError = QDBusMessage::createError(QDBusError::Failed, errorMessage);
|
||||||
|
qDebug() << Q_FUNC_INFO << errorMessage;
|
||||||
|
return QVariant();
|
||||||
|
}
|
||||||
|
|
||||||
|
int propertyIndex = metaObject()->indexOfProperty(propname);
|
||||||
|
|
||||||
|
if (-1 == propertyIndex) {
|
||||||
|
QString errorMessage = QStringLiteral("Got unknown property \"%1\" to read")
|
||||||
|
.arg(QString::fromLatin1(propname));
|
||||||
|
m_lastExtendedError = QDBusMessage::createError(QDBusError::Failed, errorMessage);
|
||||||
|
qWarning() << Q_FUNC_INFO << errorMessage;
|
||||||
|
return QVariant();
|
||||||
|
}
|
||||||
|
|
||||||
|
QMetaProperty metaProperty = metaObject()->property(propertyIndex);
|
||||||
|
|
||||||
|
if (!metaProperty.isReadable()) {
|
||||||
|
QString errorMessage = QStringLiteral("Property \"%1\" is NOT readable")
|
||||||
|
.arg(QString::fromLatin1(propname));
|
||||||
|
m_lastExtendedError = QDBusMessage::createError(QDBusError::Failed, errorMessage);
|
||||||
|
qWarning() << Q_FUNC_INFO << errorMessage;
|
||||||
|
return QVariant();
|
||||||
|
}
|
||||||
|
|
||||||
|
// is this metatype registered?
|
||||||
|
const char *expectedSignature = "";
|
||||||
|
if (int(metaProperty.type()) != QMetaType::QVariant) {
|
||||||
|
expectedSignature = QDBusMetaType::typeToSignature(metaProperty.userType());
|
||||||
|
if (0 == expectedSignature) {
|
||||||
|
QString errorMessage =
|
||||||
|
QStringLiteral("Type %1 must be registered with Qt D-Bus "
|
||||||
|
"before it can be used to read property "
|
||||||
|
"%2.%3")
|
||||||
|
.arg(metaProperty.typeName(),
|
||||||
|
interface(),
|
||||||
|
propname);
|
||||||
|
m_lastExtendedError = QDBusMessage::createError(QDBusError::Failed, errorMessage);
|
||||||
|
qWarning() << Q_FUNC_INFO << errorMessage;
|
||||||
|
return QVariant();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
asyncProperty(propname);
|
||||||
|
return QVariant(metaProperty.userType(), propertyPtr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void DBusExtendedAbstractInterface::internalPropSet(const char *propname, const QVariant &value, void *propertyPtr)
|
||||||
|
{
|
||||||
|
m_lastExtendedError = QDBusError();
|
||||||
|
|
||||||
|
if (m_sync) {
|
||||||
|
setProperty(propname, value);
|
||||||
|
} else {
|
||||||
|
if (!isValid()) {
|
||||||
|
QString errorMessage = QStringLiteral("This interface is not yet valid");
|
||||||
|
m_lastExtendedError = QDBusMessage::createError(QDBusError::Failed, errorMessage);
|
||||||
|
qDebug() << Q_FUNC_INFO << errorMessage;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
int propertyIndex = metaObject()->indexOfProperty(propname);
|
||||||
|
|
||||||
|
if (-1 == propertyIndex) {
|
||||||
|
QString errorMessage = QStringLiteral("Got unknown property \"%1\" to write")
|
||||||
|
.arg(QString::fromLatin1(propname));
|
||||||
|
m_lastExtendedError = QDBusMessage::createError(QDBusError::Failed, errorMessage);
|
||||||
|
qWarning() << Q_FUNC_INFO << errorMessage;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
QMetaProperty metaProperty = metaObject()->property(propertyIndex);
|
||||||
|
|
||||||
|
if (!metaProperty.isWritable()) {
|
||||||
|
QString errorMessage = QStringLiteral("Property \"%1\" is NOT writable")
|
||||||
|
.arg(QString::fromLatin1(propname));
|
||||||
|
m_lastExtendedError = QDBusMessage::createError(QDBusError::Failed, errorMessage);
|
||||||
|
qWarning() << Q_FUNC_INFO << errorMessage;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
QVariant variant = QVariant(metaProperty.type(), propertyPtr);
|
||||||
|
variant = value;
|
||||||
|
|
||||||
|
asyncSetProperty(propname, variant);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QVariant DBusExtendedAbstractInterface::asyncProperty(const QString &propertyName)
|
||||||
|
{
|
||||||
|
QDBusMessage msg = QDBusMessage::createMethodCall(service(), path(), *dBusPropertiesInterface(), QStringLiteral("Get"));
|
||||||
|
msg << interface() << propertyName;
|
||||||
|
QDBusPendingReply<QVariant> async = connection().asyncCall(msg);
|
||||||
|
DBusExtendedPendingCallWatcher *watcher = new DBusExtendedPendingCallWatcher(async, propertyName, QVariant(), this);
|
||||||
|
|
||||||
|
connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), this, SLOT(onAsyncPropertyFinished(QDBusPendingCallWatcher*)));
|
||||||
|
|
||||||
|
return QVariant();
|
||||||
|
}
|
||||||
|
|
||||||
|
void DBusExtendedAbstractInterface::asyncSetProperty(const QString &propertyName, const QVariant &value)
|
||||||
|
{
|
||||||
|
QDBusMessage msg = QDBusMessage::createMethodCall(service(), path(), *dBusPropertiesInterface(), QStringLiteral("Set"));
|
||||||
|
|
||||||
|
msg << interface() << propertyName << QVariant::fromValue(QDBusVariant(value));
|
||||||
|
QDBusPendingReply<> async = connection().asyncCall(msg);
|
||||||
|
DBusExtendedPendingCallWatcher *watcher = new DBusExtendedPendingCallWatcher(async, propertyName, value, this);
|
||||||
|
|
||||||
|
connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), this, SLOT(onAsyncSetPropertyFinished(QDBusPendingCallWatcher*)));
|
||||||
|
}
|
||||||
|
|
||||||
|
void DBusExtendedAbstractInterface::startServiceProcess()
|
||||||
|
{
|
||||||
|
const QString &servName = service();
|
||||||
|
|
||||||
|
if (isValid())
|
||||||
|
{
|
||||||
|
qWarning() << "Service" << servName << "is already started.";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
QDBusMessage msg = QDBusMessage::createMethodCall("org.freedesktop.DBus", "/", *dBusInterface(), QStringLiteral("StartServiceByName"));
|
||||||
|
msg << servName << quint32(0);
|
||||||
|
QDBusPendingReply<quint32> async = connection().asyncCall(msg);
|
||||||
|
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(async, this);
|
||||||
|
|
||||||
|
connect(watcher, &QDBusPendingCallWatcher::finished, this, &DBusExtendedAbstractInterface::onStartServiceProcessFinished);
|
||||||
|
}
|
||||||
|
|
||||||
|
void DBusExtendedAbstractInterface::onStartServiceProcessFinished(QDBusPendingCallWatcher *w)
|
||||||
|
{
|
||||||
|
if (w->isError())
|
||||||
|
{
|
||||||
|
m_lastExtendedError = w->error();
|
||||||
|
} else {
|
||||||
|
m_lastExtendedError = QDBusError();
|
||||||
|
}
|
||||||
|
|
||||||
|
QDBusPendingReply<quint32> reply = *w;
|
||||||
|
|
||||||
|
Q_EMIT serviceStartFinished(reply.value());
|
||||||
|
|
||||||
|
w->deleteLater();
|
||||||
|
}
|
||||||
|
|
||||||
|
void DBusExtendedAbstractInterface::onAsyncPropertyFinished(QDBusPendingCallWatcher *w)
|
||||||
|
{
|
||||||
|
DBusExtendedPendingCallWatcher *watcher = qobject_cast<DBusExtendedPendingCallWatcher *>(w);
|
||||||
|
Q_ASSERT(watcher);
|
||||||
|
|
||||||
|
QDBusPendingReply<QVariant> reply = *watcher;
|
||||||
|
|
||||||
|
if (reply.isError()) {
|
||||||
|
m_lastExtendedError = reply.error();
|
||||||
|
} else {
|
||||||
|
int propertyIndex = metaObject()->indexOfProperty(watcher->asyncProperty().toLatin1().constData());
|
||||||
|
QVariant value = demarshall(interface(),
|
||||||
|
metaObject()->property(propertyIndex),
|
||||||
|
reply.value(),
|
||||||
|
&m_lastExtendedError);
|
||||||
|
|
||||||
|
if (m_lastExtendedError.isValid()) {
|
||||||
|
Q_EMIT propertyInvalidated(watcher->asyncProperty());
|
||||||
|
} else {
|
||||||
|
Q_EMIT propertyChanged(watcher->asyncProperty(), value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Q_EMIT asyncPropertyFinished(watcher->asyncProperty());
|
||||||
|
watcher->deleteLater();
|
||||||
|
}
|
||||||
|
|
||||||
|
void DBusExtendedAbstractInterface::onAsyncSetPropertyFinished(QDBusPendingCallWatcher *w)
|
||||||
|
{
|
||||||
|
DBusExtendedPendingCallWatcher *watcher = qobject_cast<DBusExtendedPendingCallWatcher *>(w);
|
||||||
|
Q_ASSERT(watcher);
|
||||||
|
|
||||||
|
QDBusPendingReply<> reply = *watcher;
|
||||||
|
|
||||||
|
if (reply.isError()) {
|
||||||
|
m_lastExtendedError = reply.error();
|
||||||
|
} else {
|
||||||
|
m_lastExtendedError = QDBusError();
|
||||||
|
}
|
||||||
|
|
||||||
|
Q_EMIT asyncSetPropertyFinished(watcher->asyncProperty());
|
||||||
|
|
||||||
|
// Resetting the property to its previous value after sending the
|
||||||
|
// finished signal
|
||||||
|
if (reply.isError()) {
|
||||||
|
m_lastExtendedError = QDBusError();
|
||||||
|
Q_EMIT propertyChanged(watcher->asyncProperty(), watcher->previousValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
watcher->deleteLater();
|
||||||
|
}
|
||||||
|
|
||||||
|
void DBusExtendedAbstractInterface::onAsyncGetAllPropertiesFinished(QDBusPendingCallWatcher *watcher)
|
||||||
|
{
|
||||||
|
m_getAllPendingCallWatcher = 0;
|
||||||
|
|
||||||
|
QDBusPendingReply<QVariantMap> reply = *watcher;
|
||||||
|
|
||||||
|
if (reply.isError()) {
|
||||||
|
m_lastExtendedError = reply.error();
|
||||||
|
} else {
|
||||||
|
m_lastExtendedError = QDBusError();
|
||||||
|
}
|
||||||
|
|
||||||
|
Q_EMIT asyncGetAllPropertiesFinished();
|
||||||
|
|
||||||
|
if (!reply.isError()) {
|
||||||
|
onPropertiesChanged(interface(), reply.value(), QStringList());
|
||||||
|
}
|
||||||
|
|
||||||
|
watcher->deleteLater();
|
||||||
|
}
|
||||||
|
|
||||||
|
void DBusExtendedAbstractInterface::onPropertiesChanged(const QString& interfaceName,
|
||||||
|
const QVariantMap& changedProperties,
|
||||||
|
const QStringList& invalidatedProperties)
|
||||||
|
{
|
||||||
|
if (interfaceName == interface()) {
|
||||||
|
QVariantMap::const_iterator i = changedProperties.constBegin();
|
||||||
|
while (i != changedProperties.constEnd()) {
|
||||||
|
int propertyIndex = metaObject()->indexOfProperty(i.key().toLatin1().constData());
|
||||||
|
|
||||||
|
if (-1 == propertyIndex) {
|
||||||
|
qDebug() << Q_FUNC_INFO << "Got unknown changed property" << i.key();
|
||||||
|
} else {
|
||||||
|
QVariant value = demarshall(interface(), metaObject()->property(propertyIndex), i.value(), &m_lastExtendedError);
|
||||||
|
|
||||||
|
if (m_lastExtendedError.isValid()) {
|
||||||
|
Q_EMIT propertyInvalidated(i.key());
|
||||||
|
} else {
|
||||||
|
Q_EMIT propertyChanged(i.key(), value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
++i;
|
||||||
|
}
|
||||||
|
|
||||||
|
QStringList::const_iterator j = invalidatedProperties.constBegin();
|
||||||
|
while (j != invalidatedProperties.constEnd()) {
|
||||||
|
if (-1 == metaObject()->indexOfProperty(j->toLatin1().constData())) {
|
||||||
|
qDebug() << Q_FUNC_INFO << "Got unknown invalidated property" << *j;
|
||||||
|
} else {
|
||||||
|
m_lastExtendedError = QDBusError();
|
||||||
|
Q_EMIT propertyInvalidated(*j);
|
||||||
|
}
|
||||||
|
|
||||||
|
++j;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void DBusExtendedAbstractInterface::onDBusNameOwnerChanged(const QString &name, const QString &oldOwner, const QString &newOwner)
|
||||||
|
{
|
||||||
|
if (name == service() && oldOwner.isEmpty())
|
||||||
|
{
|
||||||
|
m_dbusOwner = newOwner;
|
||||||
|
Q_EMIT serviceValidChanged(true);
|
||||||
|
}
|
||||||
|
else if (name == m_dbusOwner && newOwner.isEmpty())
|
||||||
|
{
|
||||||
|
m_dbusOwner.clear();
|
||||||
|
Q_EMIT serviceValidChanged(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QVariant DBusExtendedAbstractInterface::demarshall(const QString &interface, const QMetaProperty &metaProperty, const QVariant &value, QDBusError *error)
|
||||||
|
{
|
||||||
|
Q_ASSERT(metaProperty.isValid());
|
||||||
|
Q_ASSERT(error != 0);
|
||||||
|
|
||||||
|
if (value.userType() == metaProperty.userType()) {
|
||||||
|
// No need demarshalling. Passing back straight away ...
|
||||||
|
*error = QDBusError();
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
QVariant result = QVariant(metaProperty.userType(), (void*)0);
|
||||||
|
QString errorMessage;
|
||||||
|
const char *expectedSignature = QDBusMetaType::typeToSignature(metaProperty.userType());
|
||||||
|
|
||||||
|
if (value.userType() == qMetaTypeId<QDBusArgument>()) {
|
||||||
|
// demarshalling a DBus argument ...
|
||||||
|
QDBusArgument dbusArg = value.value<QDBusArgument>();
|
||||||
|
|
||||||
|
if (expectedSignature == dbusArg.currentSignature().toLatin1()) {
|
||||||
|
QDBusMetaType::demarshall(dbusArg, metaProperty.userType(), result.data());
|
||||||
|
if (!result.isValid()) {
|
||||||
|
errorMessage = QStringLiteral("Unexpected failure demarshalling "
|
||||||
|
"upon PropertiesChanged signal arrival "
|
||||||
|
"for property `%3.%4' (expected type `%5' (%6))")
|
||||||
|
.arg(interface,
|
||||||
|
QString::fromLatin1(metaProperty.name()),
|
||||||
|
QString::fromLatin1(metaProperty.typeName()),
|
||||||
|
expectedSignature);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
errorMessage = QStringLiteral("Unexpected `user type' (%2) "
|
||||||
|
"upon PropertiesChanged signal arrival "
|
||||||
|
"for property `%3.%4' (expected type `%5' (%6))")
|
||||||
|
.arg(dbusArg.currentSignature(),
|
||||||
|
interface,
|
||||||
|
QString::fromLatin1(metaProperty.name()),
|
||||||
|
QString::fromLatin1(metaProperty.typeName()),
|
||||||
|
QString::fromLatin1(expectedSignature));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const char *actualSignature = QDBusMetaType::typeToSignature(value.userType());
|
||||||
|
|
||||||
|
errorMessage = QStringLiteral("Unexpected `%1' (%2) "
|
||||||
|
"upon PropertiesChanged signal arrival "
|
||||||
|
"for property `%3.%4' (expected type `%5' (%6))")
|
||||||
|
.arg(QString::fromLatin1(value.typeName()),
|
||||||
|
QString::fromLatin1(actualSignature),
|
||||||
|
interface,
|
||||||
|
QString::fromLatin1(metaProperty.name()),
|
||||||
|
QString::fromLatin1(metaProperty.typeName()),
|
||||||
|
QString::fromLatin1(expectedSignature));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (errorMessage.isEmpty()) {
|
||||||
|
*error = QDBusError();
|
||||||
|
} else {
|
||||||
|
*error = QDBusMessage::createError(QDBusError::InvalidSignature, errorMessage);
|
||||||
|
qDebug() << Q_FUNC_INFO << errorMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
103
frame/qtdbusextended/dbusextendedabstractinterface.h
Normal file
103
frame/qtdbusextended/dbusextendedabstractinterface.h
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
// -*- c++ -*-
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*
|
||||||
|
* Copyright (C) 2015 Jolla Ltd.
|
||||||
|
*
|
||||||
|
* Contact: Valerio Valerio <valerio.valerio@jolla.com>
|
||||||
|
* Author: Andres Gomez <andres.gomez@jolla.com>
|
||||||
|
*
|
||||||
|
* This 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 library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef DBUSEXTENDEDABSTRACTINTERFACE_H
|
||||||
|
#define DBUSEXTENDEDABSTRACTINTERFACE_H
|
||||||
|
|
||||||
|
#include <DBusExtended>
|
||||||
|
|
||||||
|
#include <QDBusAbstractInterface>
|
||||||
|
#include <QDBusError>
|
||||||
|
|
||||||
|
class QDBusPendingCallWatcher;
|
||||||
|
class DBusExtendedPendingCallWatcher;
|
||||||
|
|
||||||
|
class QT_DBUS_EXTENDED_EXPORT DBusExtendedAbstractInterface: public QDBusAbstractInterface
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
virtual ~DBusExtendedAbstractInterface();
|
||||||
|
|
||||||
|
Q_PROPERTY(bool sync READ sync WRITE setSync)
|
||||||
|
inline bool sync() const { return m_sync; }
|
||||||
|
void setSync(bool sync);
|
||||||
|
void setSync(bool sync, bool autoStart);
|
||||||
|
|
||||||
|
Q_PROPERTY(bool useCache READ useCache WRITE setUseCache)
|
||||||
|
inline bool useCache() const { return m_useCache; }
|
||||||
|
inline void setUseCache(bool useCache) { m_useCache = useCache; }
|
||||||
|
|
||||||
|
void getAllProperties();
|
||||||
|
inline QDBusError lastExtendedError() const { return m_lastExtendedError; }
|
||||||
|
|
||||||
|
public Q_SLOTS:
|
||||||
|
void startServiceProcess();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
DBusExtendedAbstractInterface(const QString &service,
|
||||||
|
const QString &path,
|
||||||
|
const char *interface,
|
||||||
|
const QDBusConnection &connection,
|
||||||
|
QObject *parent);
|
||||||
|
|
||||||
|
void connectNotify(const QMetaMethod &signal);
|
||||||
|
void disconnectNotify(const QMetaMethod &signal);
|
||||||
|
QVariant internalPropGet(const char *propname, void *propertyPtr);
|
||||||
|
void internalPropSet(const char *propname, const QVariant &value, void *propertyPtr);
|
||||||
|
|
||||||
|
Q_SIGNALS:
|
||||||
|
void serviceValidChanged(const bool valid) const;
|
||||||
|
void serviceStartFinished(const quint32 ret) const;
|
||||||
|
void propertyChanged(const QString &propertyName, const QVariant &value);
|
||||||
|
void propertyInvalidated(const QString &propertyName);
|
||||||
|
void asyncPropertyFinished(const QString &propertyName);
|
||||||
|
void asyncSetPropertyFinished(const QString &propertyName);
|
||||||
|
void asyncGetAllPropertiesFinished();
|
||||||
|
|
||||||
|
private Q_SLOTS:
|
||||||
|
void onPropertiesChanged(const QString& interfaceName,
|
||||||
|
const QVariantMap& changedProperties,
|
||||||
|
const QStringList& invalidatedProperties);
|
||||||
|
void onDBusNameOwnerChanged(const QString &name, const QString &oldOwner, const QString &newOwner);
|
||||||
|
void onAsyncPropertyFinished(QDBusPendingCallWatcher *w);
|
||||||
|
void onAsyncSetPropertyFinished(QDBusPendingCallWatcher *w);
|
||||||
|
void onAsyncGetAllPropertiesFinished(QDBusPendingCallWatcher *watcher);
|
||||||
|
void onStartServiceProcessFinished(QDBusPendingCallWatcher *w);
|
||||||
|
|
||||||
|
private:
|
||||||
|
QVariant asyncProperty(const QString &propertyName);
|
||||||
|
void asyncSetProperty(const QString &propertyName, const QVariant &value);
|
||||||
|
static QVariant demarshall(const QString &interface, const QMetaProperty &metaProperty, const QVariant &value, QDBusError *error);
|
||||||
|
|
||||||
|
bool m_sync;
|
||||||
|
bool m_useCache;
|
||||||
|
QDBusPendingCallWatcher *m_getAllPendingCallWatcher;
|
||||||
|
QDBusError m_lastExtendedError;
|
||||||
|
QString m_dbusOwner;
|
||||||
|
bool m_propertiesChangedConnected;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* DBUSEXTENDEDABSTRACTINTERFACE_H */
|
38
frame/qtdbusextended/dbusextendedpendingcallwatcher.cpp
Normal file
38
frame/qtdbusextended/dbusextendedpendingcallwatcher.cpp
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
// -*- c++ -*-
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*
|
||||||
|
* Copyright (C) 2015 Jolla Ltd.
|
||||||
|
*
|
||||||
|
* Contact: Valerio Valerio <valerio.valerio@jolla.com>
|
||||||
|
* Author: Andres Gomez <andres.gomez@jolla.com>
|
||||||
|
*
|
||||||
|
* This 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 library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "dbusextendedpendingcallwatcher_p.h"
|
||||||
|
|
||||||
|
|
||||||
|
DBusExtendedPendingCallWatcher::DBusExtendedPendingCallWatcher(const QDBusPendingCall &call, const QString &asyncProperty, const QVariant &previousValue, QObject *parent)
|
||||||
|
: QDBusPendingCallWatcher(call, parent)
|
||||||
|
, m_asyncProperty(asyncProperty)
|
||||||
|
, m_previousValue(previousValue)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
DBusExtendedPendingCallWatcher::~DBusExtendedPendingCallWatcher()
|
||||||
|
{
|
||||||
|
}
|
67
frame/qtdbusextended/dbusextendedpendingcallwatcher_p.h
Normal file
67
frame/qtdbusextended/dbusextendedpendingcallwatcher_p.h
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
// -*- c++ -*-
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*
|
||||||
|
* Copyright (C) 2015 Jolla Ltd.
|
||||||
|
*
|
||||||
|
* Contact: Valerio Valerio <valerio.valerio@jolla.com>
|
||||||
|
* Author: Andres Gomez <andres.gomez@jolla.com>
|
||||||
|
*
|
||||||
|
* This 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 library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// W A R N I N G
|
||||||
|
// -------------
|
||||||
|
//
|
||||||
|
// This file is not part of the public API. This header file may
|
||||||
|
// change from version to version without notice, or even be
|
||||||
|
// removed.
|
||||||
|
//
|
||||||
|
// We mean it.
|
||||||
|
//
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef DBUSEXTENDEDPENDINGCALLWATCHER_P_H
|
||||||
|
#define DBUSEXTENDEDPENDINGCALLWATCHER_P_H
|
||||||
|
|
||||||
|
#include <QDBusPendingCallWatcher>
|
||||||
|
#include <QDBusError>
|
||||||
|
|
||||||
|
class DBusExtendedPendingCallWatcher: public QDBusPendingCallWatcher
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit DBusExtendedPendingCallWatcher(const QDBusPendingCall &call,
|
||||||
|
const QString &asyncProperty,
|
||||||
|
const QVariant &previousValue,
|
||||||
|
QObject *parent = 0);
|
||||||
|
~DBusExtendedPendingCallWatcher();
|
||||||
|
|
||||||
|
Q_PROPERTY(QString AsyncProperty READ asyncProperty)
|
||||||
|
inline QString asyncProperty() const { return m_asyncProperty; }
|
||||||
|
|
||||||
|
Q_PROPERTY(QVariant PreviousValue READ previousValue)
|
||||||
|
inline QVariant previousValue() const { return m_previousValue; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
QString m_asyncProperty;
|
||||||
|
QVariant m_previousValue;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* DBUSEXTENDEDPENDINGCALLWATCHER_P_H */
|
@ -44,13 +44,13 @@ const QString controllCenterService = "org.deepin.dde.ControlCenter1";
|
|||||||
const QString controllCenterPath = "/org/deepin/dde/ControlCenter1";
|
const QString controllCenterPath = "/org/deepin/dde/ControlCenter1";
|
||||||
const QString controllCenterInterface = "org.deepin.dde.ControlCenter1";
|
const QString controllCenterInterface = "org.deepin.dde.ControlCenter1";
|
||||||
|
|
||||||
const QString notificationService = "org.deepin.dde.Notification1";
|
const QString notificationService = "com.deepin.dde.Notification";
|
||||||
const QString notificationPath = "/org/deepin/dde/Notification1";
|
const QString notificationPath = "/com/deepin/dde/Notification";
|
||||||
const QString notificationInterface = "org.deepin.dde.Notification1";
|
const QString notificationInterface = "com.deepin.dde.Notification";
|
||||||
|
|
||||||
const QString sessionManagerService = "org.deepin.SessionManager1";
|
const QString sessionManagerService = "com.deepin.SessionManager";
|
||||||
const QString sessionManagerPath = "/org/deepin/SessionManager1";
|
const QString sessionManagerPath = "/com/deepin/SessionManager";
|
||||||
const QString sessionManagerInterface = "org.deepin.SessionManager1";
|
const QString sessionManagerInterface = "com.deepin.SessionManager";
|
||||||
#else
|
#else
|
||||||
using DockInter = com::deepin::dde::daemon::Dock;
|
using DockInter = com::deepin::dde::daemon::Dock;
|
||||||
using DockEntryInter = com::deepin::dde::daemon::dock::Entry;
|
using DockEntryInter = com::deepin::dde::daemon::dock::Entry;
|
||||||
|
@ -28,8 +28,8 @@
|
|||||||
#include "xcb_misc.h"
|
#include "xcb_misc.h"
|
||||||
#include "dbusutil.h"
|
#include "dbusutil.h"
|
||||||
|
|
||||||
#include <com_deepin_api_xeventmonitor.h>
|
#include "org_deepin_api_xeventmonitor.h"
|
||||||
#include <com_deepin_dde_launcher.h>
|
#include "org_deepin_dde_launcher.h"
|
||||||
|
|
||||||
#include <DWindowManagerHelper>
|
#include <DWindowManagerHelper>
|
||||||
|
|
||||||
@ -53,8 +53,8 @@ DGUI_USE_NAMESPACE
|
|||||||
#define DRAG_AREA_SIZE (5)
|
#define DRAG_AREA_SIZE (5)
|
||||||
#define DOCKSPACE (WINDOWMARGIN * 2)
|
#define DOCKSPACE (WINDOWMARGIN * 2)
|
||||||
|
|
||||||
using XEventMonitor = ::com::deepin::api::XEventMonitor;
|
using XEventMonitor = ::org::deepin::api::XEventMonitor1;
|
||||||
using DBusLuncher = ::com::deepin::dde::Launcher;
|
using DBusLuncher = ::org::deepin::dde::Launcher1;
|
||||||
|
|
||||||
using namespace Dock;
|
using namespace Dock;
|
||||||
class QVariantAnimation;
|
class QVariantAnimation;
|
||||||
|
@ -22,11 +22,11 @@
|
|||||||
#ifndef TOUCHSIGNALMANAGER_H
|
#ifndef TOUCHSIGNALMANAGER_H
|
||||||
#define TOUCHSIGNALMANAGER_H
|
#define TOUCHSIGNALMANAGER_H
|
||||||
|
|
||||||
|
#include "org_deepin_daemon_gesture.h"
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
#include <com_deepin_daemon_gesture.h>
|
using Gesture = com::deepin::daemon::Gesture1;
|
||||||
|
|
||||||
using Gesture = com::deepin::daemon::Gesture;
|
|
||||||
|
|
||||||
class TouchSignalManager : public QObject
|
class TouchSignalManager : public QObject
|
||||||
{
|
{
|
||||||
|
@ -44,7 +44,7 @@ static QMap<int, QString> timeFormat{{0, "h:mm"}, {1, "hh:mm"}};
|
|||||||
|
|
||||||
DateTimeDisplayer::DateTimeDisplayer(QWidget *parent)
|
DateTimeDisplayer::DateTimeDisplayer(QWidget *parent)
|
||||||
: QWidget (parent)
|
: QWidget (parent)
|
||||||
, m_timedateInter(new Timedate("com.deepin.daemon.Timedate", "/com/deepin/daemon/Timedate", QDBusConnection::sessionBus(), this))
|
, m_timedateInter(new Timedate("org.deepin.daemon.Timedate1", "/org/deepin/daemon/Timedate1", QDBusConnection::sessionBus(), this))
|
||||||
, m_position(Dock::Position::Bottom)
|
, m_position(Dock::Position::Bottom)
|
||||||
, m_dateFont(DFontSizeManager::instance()->t10())
|
, m_dateFont(DFontSizeManager::instance()->t10())
|
||||||
, m_tipsWidget(new Dock::TipsWidget(this))
|
, m_tipsWidget(new Dock::TipsWidget(this))
|
||||||
|
@ -23,17 +23,17 @@
|
|||||||
|
|
||||||
#include "constants.h"
|
#include "constants.h"
|
||||||
|
|
||||||
|
#include "org_deepin_daemon_timedate.h"
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <QFont>
|
#include <QFont>
|
||||||
|
|
||||||
#include <com_deepin_daemon_timedate.h>
|
|
||||||
|
|
||||||
namespace Dock { class TipsWidget; }
|
namespace Dock { class TipsWidget; }
|
||||||
|
|
||||||
class DockPopupWindow;
|
class DockPopupWindow;
|
||||||
class QMenu;
|
class QMenu;
|
||||||
|
|
||||||
using Timedate = com::deepin::daemon::Timedate;
|
using Timedate = org::deepin::daemon::Timedate1;
|
||||||
|
|
||||||
class DateTimeDisplayer : public QWidget
|
class DateTimeDisplayer : public QWidget
|
||||||
{
|
{
|
||||||
|
@ -27,8 +27,6 @@
|
|||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
#include <com_deepin_daemon_gesture.h>
|
|
||||||
|
|
||||||
using namespace Dock;
|
using namespace Dock;
|
||||||
|
|
||||||
class QBoxLayout;
|
class QBoxLayout;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* This file was generated by qdbusxml2cpp version 0.8
|
* This file was generated by qdbusxml2cpp version 0.8
|
||||||
* Command line was: qdbusxml2cpp -c DBusTrayManager -p dbustraymanager com.deepin.dde.TrayManager.xml
|
* Command line was: qdbusxml2cpp -c DBusTrayManager -p dbustraymanager org.deepin.dde.TrayManager.xml
|
||||||
*
|
*
|
||||||
* qdbusxml2cpp is Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies).
|
* qdbusxml2cpp is Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies).
|
||||||
*
|
*
|
||||||
@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
DBusTrayManager::DBusTrayManager(QObject *parent)
|
DBusTrayManager::DBusTrayManager(QObject *parent)
|
||||||
: QDBusAbstractInterface("com.deepin.dde.TrayManager", "/com/deepin/dde/TrayManager", staticInterfaceName(), QDBusConnection::sessionBus(), parent)
|
: QDBusAbstractInterface("org.deepin.dde.TrayManager1", "/org/deepin/dde/TrayManager1", staticInterfaceName(), QDBusConnection::sessionBus(), parent)
|
||||||
{
|
{
|
||||||
qRegisterMetaType<TrayList>("TrayList");
|
qRegisterMetaType<TrayList>("TrayList");
|
||||||
qDBusRegisterMetaType<TrayList>();
|
qDBusRegisterMetaType<TrayList>();
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* This file was generated by qdbusxml2cpp version 0.8
|
* This file was generated by qdbusxml2cpp version 0.8
|
||||||
* Command line was: qdbusxml2cpp -c DBusTrayManager -p dbustraymanager com.deepin.dde.TrayManager.xml
|
* Command line was: qdbusxml2cpp -c DBusTrayManager -p dbustraymanager org.deepin.dde.TrayManager.xml
|
||||||
*
|
*
|
||||||
* qdbusxml2cpp is Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies).
|
* qdbusxml2cpp is Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies).
|
||||||
*
|
*
|
||||||
@ -23,7 +23,7 @@
|
|||||||
typedef QList<quint32> TrayList;
|
typedef QList<quint32> TrayList;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Proxy class for interface com.deepin.dde.TrayManager
|
* Proxy class for interface org.deepin.dde.TrayManager1
|
||||||
*/
|
*/
|
||||||
class DBusTrayManager: public QDBusAbstractInterface
|
class DBusTrayManager: public QDBusAbstractInterface
|
||||||
{
|
{
|
||||||
@ -35,7 +35,7 @@ class DBusTrayManager: public QDBusAbstractInterface
|
|||||||
if (3 != arguments.count())
|
if (3 != arguments.count())
|
||||||
return;
|
return;
|
||||||
QString interfaceName = msg.arguments().at(0).toString();
|
QString interfaceName = msg.arguments().at(0).toString();
|
||||||
if (interfaceName !="com.deepin.dde.TrayManager")
|
if (interfaceName !="org.deepin.dde.TrayManager1")
|
||||||
return;
|
return;
|
||||||
QVariantMap changedProps = qdbus_cast<QVariantMap>(arguments.at(1).value<QDBusArgument>());
|
QVariantMap changedProps = qdbus_cast<QVariantMap>(arguments.at(1).value<QDBusArgument>());
|
||||||
foreach(const QString &prop, changedProps.keys()) {
|
foreach(const QString &prop, changedProps.keys()) {
|
||||||
@ -50,7 +50,7 @@ class DBusTrayManager: public QDBusAbstractInterface
|
|||||||
}
|
}
|
||||||
public:
|
public:
|
||||||
static inline const char *staticInterfaceName()
|
static inline const char *staticInterfaceName()
|
||||||
{ return "com.deepin.dde.TrayManager"; }
|
{ return "org.deepin.dde.TrayManager1"; }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit DBusTrayManager(QObject *parent = 0);
|
explicit DBusTrayManager(QObject *parent = 0);
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
#include "basetraywidget.h"
|
#include "basetraywidget.h"
|
||||||
#include "dockpopupwindow.h"
|
#include "dockpopupwindow.h"
|
||||||
|
|
||||||
#include <org_kde_statusnotifieritem.h>
|
#include "org_kde_statusnotifieritem.h"
|
||||||
|
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QDBusObjectPath>
|
#include <QDBusObjectPath>
|
||||||
|
@ -24,16 +24,16 @@
|
|||||||
#include "constants.h"
|
#include "constants.h"
|
||||||
#include "dbusutil.h"
|
#include "dbusutil.h"
|
||||||
|
|
||||||
#include <QWidget>
|
#include "org_deepin_daemon_timedate.h"
|
||||||
|
|
||||||
#include <com_deepin_daemon_timedate.h>
|
#include <QWidget>
|
||||||
|
|
||||||
namespace Dtk { namespace Gui { class DRegionMonitor; };
|
namespace Dtk { namespace Gui { class DRegionMonitor; };
|
||||||
namespace Widget { class DBlurEffectWidget; } }
|
namespace Widget { class DBlurEffectWidget; } }
|
||||||
|
|
||||||
using namespace Dtk::Widget;
|
using namespace Dtk::Widget;
|
||||||
|
|
||||||
using Timedate = com::deepin::daemon::Timedate;
|
using Timedate = org::deepin::daemon::Timedate1;
|
||||||
|
|
||||||
class QuickPluginWindow;
|
class QuickPluginWindow;
|
||||||
class QBoxLayout;
|
class QBoxLayout;
|
||||||
|
@ -11,5 +11,4 @@ add_subdirectory("overlay-warning")
|
|||||||
add_subdirectory("show-desktop")
|
add_subdirectory("show-desktop")
|
||||||
add_subdirectory("multitasking")
|
add_subdirectory("multitasking")
|
||||||
add_subdirectory("bluetooth")
|
add_subdirectory("bluetooth")
|
||||||
#add_subdirectory("dcc-dock-plugin")
|
|
||||||
add_subdirectory("airplane-mode")
|
add_subdirectory("airplane-mode")
|
||||||
|
@ -3,8 +3,19 @@ set(PLUGIN_NAME "airplane-mode")
|
|||||||
|
|
||||||
project(${PLUGIN_NAME})
|
project(${PLUGIN_NAME})
|
||||||
|
|
||||||
|
generation_dbus_interface(${CMAKE_CURRENT_SOURCE_DIR}/dbusinterface/xml ${CMAKE_CURRENT_SOURCE_DIR}/dbusinterface/generation_dbus_interface)
|
||||||
|
|
||||||
# Sources files
|
# Sources files
|
||||||
file(GLOB_RECURSE SRCS "*.h" "*.cpp" "../../widgets/*.h" "../../widgets/*.cpp" "../../frame/util/imageutil.h" "../../frame/util/imageutil.cpp")
|
file(GLOB_RECURSE SRCS "*.h"
|
||||||
|
"*.cpp"
|
||||||
|
"../../widgets/*.h"
|
||||||
|
"../../widgets/*.cpp"
|
||||||
|
"../../frame/util/imageutil.h"
|
||||||
|
"../../frame/util/imageutil.cpp"
|
||||||
|
"./dbusinterface/generation_dbus_interface/*.h"
|
||||||
|
"./dbusinterface/generation_dbus_interface/*.cpp"
|
||||||
|
"../../frame/qtdbusextended/*.h"
|
||||||
|
"../../frame/qtdbusextended/*.cpp")
|
||||||
|
|
||||||
find_package(PkgConfig REQUIRED)
|
find_package(PkgConfig REQUIRED)
|
||||||
find_package(Qt5Widgets REQUIRED)
|
find_package(Qt5Widgets REQUIRED)
|
||||||
@ -13,28 +24,27 @@ find_package(Qt5DBus REQUIRED)
|
|||||||
find_package(DtkWidget REQUIRED)
|
find_package(DtkWidget REQUIRED)
|
||||||
|
|
||||||
pkg_check_modules(XCB_EWMH REQUIRED xcb-ewmh x11 xcursor)
|
pkg_check_modules(XCB_EWMH REQUIRED xcb-ewmh x11 xcursor)
|
||||||
pkg_check_modules(DFrameworkDBus REQUIRED dframeworkdbus)
|
|
||||||
pkg_check_modules(QGSettings REQUIRED gsettings-qt)
|
pkg_check_modules(QGSettings REQUIRED gsettings-qt)
|
||||||
|
|
||||||
add_definitions("${QT_DEFINITIONS} -DQT_PLUGIN")
|
add_definitions("${QT_DEFINITIONS} -DQT_PLUGIN")
|
||||||
add_library(${PLUGIN_NAME} SHARED ${SRCS} resources/airplane_mode.qrc)
|
add_library(${PLUGIN_NAME} SHARED ${SRCS} resources/airplane_mode.qrc)
|
||||||
set_target_properties(${PLUGIN_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ../system-trays)
|
set_target_properties(${PLUGIN_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ../system-trays)
|
||||||
|
|
||||||
target_include_directories(${PLUGIN_NAME} PUBLIC ${DtkWidget_INCLUDE_DIRS}
|
target_include_directories(${PLUGIN_NAME} PUBLIC ${DtkWidget_INCLUDE_DIRS}
|
||||||
${DFrameworkDBus_INCLUDE_DIRS}
|
|
||||||
${QGSettings_INCLUDE_DIRS}
|
${QGSettings_INCLUDE_DIRS}
|
||||||
../../interfaces
|
../../interfaces
|
||||||
../../widgets
|
../../widgets
|
||||||
../../frame
|
../../frame
|
||||||
../../frame/util
|
../../frame/util
|
||||||
)
|
../../frame/qtdbusextended
|
||||||
|
./dbusinterface/generation_dbus_interface)
|
||||||
|
|
||||||
target_link_libraries(${PLUGIN_NAME} PRIVATE
|
target_link_libraries(${PLUGIN_NAME} PRIVATE
|
||||||
${XCB_EWMH_LIBRARIES}
|
${XCB_EWMH_LIBRARIES}
|
||||||
${DtkWidget_LIBRARIES}
|
${DtkWidget_LIBRARIES}
|
||||||
${DFrameworkDBus_LIBRARIES}
|
|
||||||
${QGSettings_LIBRARIES}
|
${QGSettings_LIBRARIES}
|
||||||
${Qt5DBus_LIBRARIES}
|
${Qt5DBus_LIBRARIES}
|
||||||
${Qt5Widgets_LIBRARIES}
|
${Qt5Widgets_LIBRARIES}
|
||||||
${Qt5Svg_LIBRARIES}
|
${Qt5Svg_LIBRARIES})
|
||||||
)
|
|
||||||
|
|
||||||
install(TARGETS ${PLUGIN_NAME} LIBRARY DESTINATION lib/dde-dock/plugins/system-trays)
|
install(TARGETS ${PLUGIN_NAME} LIBRARY DESTINATION lib/dde-dock/plugins/system-trays)
|
||||||
|
@ -43,8 +43,8 @@ AirplaneModeItem::AirplaneModeItem(QWidget *parent)
|
|||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
, m_tipsLabel(new Dock::TipsWidget(this))
|
, m_tipsLabel(new Dock::TipsWidget(this))
|
||||||
, m_applet(new AirplaneModeApplet(this))
|
, m_applet(new AirplaneModeApplet(this))
|
||||||
, m_airplaneModeInter(new DBusAirplaneMode("com.deepin.daemon.AirplaneMode",
|
, m_airplaneModeInter(new DBusAirplaneMode("org.deepin.daemon.AirplaneMode1",
|
||||||
"/com/deepin/daemon/AirplaneMode",
|
"/org/deepin/daemon/AirplaneMode1",
|
||||||
QDBusConnection::systemBus(),
|
QDBusConnection::systemBus(),
|
||||||
this))
|
this))
|
||||||
{
|
{
|
||||||
|
@ -23,11 +23,11 @@
|
|||||||
#ifndef AIRPLANEMODEITEM_H
|
#ifndef AIRPLANEMODEITEM_H
|
||||||
#define AIRPLANEMODEITEM_H
|
#define AIRPLANEMODEITEM_H
|
||||||
|
|
||||||
#include <com_deepin_daemon_airplanemode.h>
|
#include "org_deepin_daemon_airplanemode.h"
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
using DBusAirplaneMode = com::deepin::daemon::AirplaneMode;
|
using DBusAirplaneMode = org::deepin::daemon::AirplaneMode1;
|
||||||
|
|
||||||
namespace Dock {
|
namespace Dock {
|
||||||
class TipsWidget;
|
class TipsWidget;
|
||||||
|
@ -0,0 +1,16 @@
|
|||||||
|
<interface name="org.deepin.daemon.AirplaneMode1">
|
||||||
|
<method name="DumpState" />
|
||||||
|
<method name="Enable">
|
||||||
|
<arg name="enabled" type="b" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="EnableBluetooth">
|
||||||
|
<arg name="enabled" type="b" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="EnableWifi">
|
||||||
|
<arg name="enabled" type="b" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
|
||||||
|
<property name="BluetoothEnabled" type="b" access="read"></property>
|
||||||
|
<property name="Enabled" type="b" access="read"></property>
|
||||||
|
<property name="WifiEnabled" type="b" access="read"></property>
|
||||||
|
</interface>
|
@ -3,11 +3,23 @@ set(PLUGIN_NAME "bluetooth")
|
|||||||
|
|
||||||
project(${PLUGIN_NAME})
|
project(${PLUGIN_NAME})
|
||||||
|
|
||||||
|
generation_dbus_interface(${CMAKE_CURRENT_SOURCE_DIR}/dbusinterface/xml ${CMAKE_CURRENT_SOURCE_DIR}/dbusinterface/generation_dbus_interface)
|
||||||
|
|
||||||
# Sources files
|
# Sources files
|
||||||
file(GLOB_RECURSE SRCS "*.h" "*.cpp" "../../widgets/*.h" "../../widgets/*.cpp"
|
file(GLOB_RECURSE SRCS "*.h"
|
||||||
"../../frame/util/imageutil.h" "../../frame/util/imageutil.cpp"
|
"*.cpp"
|
||||||
"../../frame/util/statebutton.h" "../../frame/util/statebutton.cpp"
|
"../../widgets/*.h"
|
||||||
"../../frame/util/horizontalseperator.h" "../../frame/util/horizontalseperator.cpp")
|
"../../widgets/*.cpp"
|
||||||
|
"../../frame/util/imageutil.h"
|
||||||
|
"../../frame/util/imageutil.cpp"
|
||||||
|
"../../frame/util/statebutton.h"
|
||||||
|
"../../frame/util/statebutton.cpp"
|
||||||
|
"../../frame/util/horizontalseperator.h"
|
||||||
|
"../../frame/util/horizontalseperator.cpp"
|
||||||
|
"./dbusinterface/generation_dbus_interface/*.h"
|
||||||
|
"./dbusinterface/generation_dbus_interface/*.cpp"
|
||||||
|
"../../frame/qtdbusextended/*.h"
|
||||||
|
"../../frame/qtdbusextended/*.cpp")
|
||||||
|
|
||||||
find_package(PkgConfig REQUIRED)
|
find_package(PkgConfig REQUIRED)
|
||||||
find_package(Qt5Widgets REQUIRED)
|
find_package(Qt5Widgets REQUIRED)
|
||||||
@ -16,23 +28,22 @@ find_package(Qt5DBus REQUIRED)
|
|||||||
find_package(DtkWidget REQUIRED)
|
find_package(DtkWidget REQUIRED)
|
||||||
|
|
||||||
pkg_check_modules(XCB_EWMH REQUIRED xcb-ewmh x11 xcursor)
|
pkg_check_modules(XCB_EWMH REQUIRED xcb-ewmh x11 xcursor)
|
||||||
pkg_check_modules(DFrameworkDBus REQUIRED dframeworkdbus)
|
|
||||||
pkg_check_modules(QGSettings REQUIRED gsettings-qt)
|
pkg_check_modules(QGSettings REQUIRED gsettings-qt)
|
||||||
|
|
||||||
add_definitions("${QT_DEFINITIONS} -DQT_PLUGIN")
|
add_definitions("${QT_DEFINITIONS} -DQT_PLUGIN")
|
||||||
add_library(${PLUGIN_NAME} SHARED ${SRCS} resources/bluetooth.qrc)
|
add_library(${PLUGIN_NAME} SHARED ${SRCS} resources/bluetooth.qrc)
|
||||||
set_target_properties(${PLUGIN_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ../system-trays)
|
set_target_properties(${PLUGIN_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ../system-trays)
|
||||||
target_include_directories(${PLUGIN_NAME} PUBLIC ${DtkWidget_INCLUDE_DIRS}
|
target_include_directories(${PLUGIN_NAME} PUBLIC ${DtkWidget_INCLUDE_DIRS}
|
||||||
${DFrameworkDBus_INCLUDE_DIRS}
|
|
||||||
${QGSettings_INCLUDE_DIRS}
|
${QGSettings_INCLUDE_DIRS}
|
||||||
../../interfaces
|
../../interfaces
|
||||||
../../frame
|
../../frame
|
||||||
|
../../frame/qtdbusextended
|
||||||
|
./dbusinterface/generation_dbus_interface
|
||||||
componments)
|
componments)
|
||||||
|
|
||||||
target_link_libraries(${PLUGIN_NAME} PRIVATE
|
target_link_libraries(${PLUGIN_NAME} PRIVATE
|
||||||
${XCB_EWMH_LIBRARIES}
|
${XCB_EWMH_LIBRARIES}
|
||||||
${DtkWidget_LIBRARIES}
|
${DtkWidget_LIBRARIES}
|
||||||
${DFrameworkDBus_LIBRARIES}
|
|
||||||
${QGSettings_LIBRARIES}
|
${QGSettings_LIBRARIES}
|
||||||
${Qt5DBus_LIBRARIES}
|
${Qt5DBus_LIBRARIES}
|
||||||
${Qt5Widgets_LIBRARIES}
|
${Qt5Widgets_LIBRARIES}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"api": "2.0.0",
|
"api": "2.0.0",
|
||||||
"depends-daemon-dbus-service": "com.deepin.daemon.Bluetooth"
|
"depends-daemon-dbus-service": "org.deepin.daemon.Bluetooth1"
|
||||||
}
|
}
|
||||||
|
@ -31,8 +31,8 @@
|
|||||||
|
|
||||||
AdaptersManager::AdaptersManager(QObject *parent)
|
AdaptersManager::AdaptersManager(QObject *parent)
|
||||||
: QObject(parent)
|
: QObject(parent)
|
||||||
, m_bluetoothInter(new DBusBluetooth("com.deepin.daemon.Bluetooth",
|
, m_bluetoothInter(new DBusBluetooth("org.deepin.daemon.Bluetooth1",
|
||||||
"/com/deepin/daemon/Bluetooth",
|
"/org/deepin/daemon/Bluetooth1",
|
||||||
QDBusConnection::sessionBus(),
|
QDBusConnection::sessionBus(),
|
||||||
this))
|
this))
|
||||||
{
|
{
|
||||||
@ -65,9 +65,9 @@ AdaptersManager::AdaptersManager(QObject *parent)
|
|||||||
});
|
});
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QDBusInterface inter("com.deepin.daemon.Bluetooth",
|
QDBusInterface inter("org.deepin.daemon.Bluetooth1",
|
||||||
"/com/deepin/daemon/Bluetooth",
|
"/org/deepin/daemon/Bluetooth1",
|
||||||
"com.deepin.daemon.Bluetooth",
|
"org.deepin.daemon.Bluetooth1",
|
||||||
QDBusConnection::sessionBus());
|
QDBusConnection::sessionBus());
|
||||||
QDBusReply<QString> reply = inter.call(QDBus::Block, "GetAdapters");
|
QDBusReply<QString> reply = inter.call(QDBus::Block, "GetAdapters");
|
||||||
const QString replyStr = reply.value();
|
const QString replyStr = reply.value();
|
||||||
|
@ -23,8 +23,8 @@
|
|||||||
#ifndef ADAPTERSMANAGER_H
|
#ifndef ADAPTERSMANAGER_H
|
||||||
#define ADAPTERSMANAGER_H
|
#define ADAPTERSMANAGER_H
|
||||||
|
|
||||||
#include <com_deepin_daemon_bluetooth.h>
|
#include "org_deepin_daemon_bluetooth.h"
|
||||||
using DBusBluetooth = com::deepin::daemon::Bluetooth;
|
using DBusBluetooth = org::deepin::daemon::Bluetooth1;
|
||||||
|
|
||||||
class Adapter;
|
class Adapter;
|
||||||
class Device;
|
class Device;
|
||||||
|
@ -150,7 +150,7 @@ BluetoothAdapterItem::BluetoothAdapterItem(Adapter *adapter, QWidget *parent)
|
|||||||
, m_itemDelegate(new DStyledItemDelegate(m_deviceListview))
|
, m_itemDelegate(new DStyledItemDelegate(m_deviceListview))
|
||||||
, m_deviceModel(new QStandardItemModel(m_deviceListview))
|
, m_deviceModel(new QStandardItemModel(m_deviceListview))
|
||||||
, m_refreshBtn(new RefreshButton(this))
|
, m_refreshBtn(new RefreshButton(this))
|
||||||
, m_bluetoothInter(new DBusBluetooth("com.deepin.daemon.Bluetooth", "/com/deepin/daemon/Bluetooth", QDBusConnection::sessionBus(), this))
|
, m_bluetoothInter(new DBusBluetooth("org.deepin.daemon.Bluetooth1", "/org/deepin/daemon/Bluetooth1", QDBusConnection::sessionBus(), this))
|
||||||
, m_showUnnamedDevices(false)
|
, m_showUnnamedDevices(false)
|
||||||
, m_seperator(new HorizontalSeperator(this))
|
, m_seperator(new HorizontalSeperator(this))
|
||||||
{
|
{
|
||||||
|
@ -32,9 +32,9 @@
|
|||||||
#include <DStyleHelper>
|
#include <DStyleHelper>
|
||||||
#include <DApplicationHelper>
|
#include <DApplicationHelper>
|
||||||
|
|
||||||
#include <com_deepin_daemon_bluetooth.h>
|
#include "org_deepin_daemon_bluetooth.h"
|
||||||
|
|
||||||
using DBusBluetooth = com::deepin::daemon::Bluetooth;
|
using DBusBluetooth = org::deepin::daemon::Bluetooth1;
|
||||||
|
|
||||||
DWIDGET_USE_NAMESPACE
|
DWIDGET_USE_NAMESPACE
|
||||||
|
|
||||||
|
@ -121,13 +121,12 @@ BluetoothApplet::BluetoothApplet(QWidget *parent)
|
|||||||
, m_mainLayout(new QVBoxLayout(this))
|
, m_mainLayout(new QVBoxLayout(this))
|
||||||
, m_contentLayout(new QVBoxLayout(m_contentWidget))
|
, m_contentLayout(new QVBoxLayout(m_contentWidget))
|
||||||
, m_seperator(new HorizontalSeperator(this))
|
, m_seperator(new HorizontalSeperator(this))
|
||||||
, m_airPlaneModeInter(new DBusAirplaneMode("com.deepin.daemon.AirplaneMode", "/com/deepin/daemon/AirplaneMode", QDBusConnection::systemBus(), this))
|
, m_airPlaneModeInter(new DBusAirplaneMode("org.deepin.daemon.AirplaneMode1", "/org/deepin/daemon/AirplaneMode1", QDBusConnection::systemBus(), this))
|
||||||
, m_airplaneModeEnable(false)
|
, m_airplaneModeEnable(false)
|
||||||
{
|
{
|
||||||
initUi();
|
initUi();
|
||||||
initConnect();
|
initConnect();
|
||||||
|
|
||||||
|
|
||||||
QScroller::grabGesture(m_scroarea, QScroller::LeftMouseButtonGesture);
|
QScroller::grabGesture(m_scroarea, QScroller::LeftMouseButtonGesture);
|
||||||
QScrollerProperties propertiesOne = QScroller::scroller(m_scroarea)->scrollerProperties();
|
QScrollerProperties propertiesOne = QScroller::scroller(m_scroarea)->scrollerProperties();
|
||||||
QVariant overshootPolicyOne = QVariant::fromValue<QScrollerProperties::OvershootPolicy>(QScrollerProperties::OvershootAlwaysOff);
|
QVariant overshootPolicyOne = QVariant::fromValue<QScrollerProperties::OvershootPolicy>(QScrollerProperties::OvershootAlwaysOff);
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
#include <dtkwidget_global.h>
|
#include <dtkwidget_global.h>
|
||||||
|
|
||||||
#include <com_deepin_daemon_airplanemode.h>
|
#include "org_deepin_daemon_airplanemode.h"
|
||||||
|
|
||||||
class QVBoxLayout;
|
class QVBoxLayout;
|
||||||
class QHBoxLayout;
|
class QHBoxLayout;
|
||||||
@ -48,7 +48,7 @@ DWIDGET_END_NAMESPACE
|
|||||||
|
|
||||||
DWIDGET_USE_NAMESPACE
|
DWIDGET_USE_NAMESPACE
|
||||||
|
|
||||||
using DBusAirplaneMode = com::deepin::daemon::AirplaneMode;
|
using DBusAirplaneMode = org::deepin::daemon::AirplaneMode1;
|
||||||
|
|
||||||
class SettingLabel : public QWidget
|
class SettingLabel : public QWidget
|
||||||
{
|
{
|
||||||
|
@ -0,0 +1,16 @@
|
|||||||
|
<interface name="org.deepin.daemon.AirplaneMode1">
|
||||||
|
<method name="DumpState" />
|
||||||
|
<method name="Enable">
|
||||||
|
<arg name="enabled" type="b" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="EnableBluetooth">
|
||||||
|
<arg name="enabled" type="b" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="EnableWifi">
|
||||||
|
<arg name="enabled" type="b" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
|
||||||
|
<property name="BluetoothEnabled" type="b" access="read"></property>
|
||||||
|
<property name="Enabled" type="b" access="read"></property>
|
||||||
|
<property name="WifiEnabled" type="b" access="read"></property>
|
||||||
|
</interface>
|
@ -0,0 +1,155 @@
|
|||||||
|
<interface name="org.deepin.daemon.Bluetooth1">
|
||||||
|
<method name="CancelTransferSession">
|
||||||
|
<arg name="sessionPath" type="o" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="ClearUnpairedDevice"></method>
|
||||||
|
<method name="Confirm">
|
||||||
|
<arg name="device" type="o" direction="in"></arg>
|
||||||
|
<arg name="accept" type="b" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="ConnectDevice">
|
||||||
|
<arg name="device" type="o" direction="in"></arg>
|
||||||
|
<arg name="adapter" type="o" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="DebugInfo">
|
||||||
|
<arg name="info" type="s" direction="out"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="DisconnectDevice">
|
||||||
|
<arg name="device" type="o" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="FeedPasskey">
|
||||||
|
<arg name="device" type="o" direction="in"></arg>
|
||||||
|
<arg name="accept" type="b" direction="in"></arg>
|
||||||
|
<arg name="passkey" type="u" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="FeedPinCode">
|
||||||
|
<arg name="device" type="o" direction="in"></arg>
|
||||||
|
<arg name="accept" type="b" direction="in"></arg>
|
||||||
|
<arg name="pinCode" type="s" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="GetAdapters">
|
||||||
|
<arg name="adaptersJSON" type="s" direction="out"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="GetDevices">
|
||||||
|
<arg name="adapter" type="o" direction="in"></arg>
|
||||||
|
<arg name="devicesJSON" type="s" direction="out"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="RemoveDevice">
|
||||||
|
<arg name="adapter" type="o" direction="in"></arg>
|
||||||
|
<arg name="device" type="o" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="RequestDiscovery">
|
||||||
|
<arg name="adapter" type="o" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="SendFiles">
|
||||||
|
<arg name="device" type="s" direction="in"></arg>
|
||||||
|
<arg name="files" type="as" direction="in"></arg>
|
||||||
|
<arg name="sessionPath" type="o" direction="out"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="SetAdapterAlias">
|
||||||
|
<arg name="adapter" type="o" direction="in"></arg>
|
||||||
|
<arg name="alias" type="s" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="SetAdapterDiscoverable">
|
||||||
|
<arg name="adapter" type="o" direction="in"></arg>
|
||||||
|
<arg name="discoverable" type="b" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="SetAdapterDiscoverableTimeout">
|
||||||
|
<arg name="adapter" type="o" direction="in"></arg>
|
||||||
|
<arg name="timeout" type="u" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="SetAdapterDiscovering">
|
||||||
|
<arg name="adapter" type="o" direction="in"></arg>
|
||||||
|
<arg name="discovering" type="b" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="SetAdapterPowered">
|
||||||
|
<arg name="adapter" type="o" direction="in"></arg>
|
||||||
|
<arg name="powered" type="b" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="SetDeviceAlias">
|
||||||
|
<arg name="device" type="o" direction="in"></arg>
|
||||||
|
<arg name="alias" type="s" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="SetDeviceTrusted">
|
||||||
|
<arg name="device" type="o" direction="in"></arg>
|
||||||
|
<arg name="trusted" type="b" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
<signal name="AdapterAdded">
|
||||||
|
<arg name="adapterJSON" type="s"></arg>
|
||||||
|
</signal>
|
||||||
|
<signal name="AdapterRemoved">
|
||||||
|
<arg name="adapterJSON" type="s"></arg>
|
||||||
|
</signal>
|
||||||
|
<signal name="AdapterPropertiesChanged">
|
||||||
|
<arg name="adapterJSON" type="s"></arg>
|
||||||
|
</signal>
|
||||||
|
<signal name="DeviceAdded">
|
||||||
|
<arg name="devJSON" type="s"></arg>
|
||||||
|
</signal>
|
||||||
|
<signal name="DeviceRemoved">
|
||||||
|
<arg name="devJSON" type="s"></arg>
|
||||||
|
</signal>
|
||||||
|
<signal name="DevicePropertiesChanged">
|
||||||
|
<arg name="devJSON" type="s"></arg>
|
||||||
|
</signal>
|
||||||
|
<signal name="DisplayPinCode">
|
||||||
|
<arg name="device" type="o"></arg>
|
||||||
|
<arg name="pinCode" type="s"></arg>
|
||||||
|
</signal>
|
||||||
|
<signal name="DisplayPasskey">
|
||||||
|
<arg name="device" type="o"></arg>
|
||||||
|
<arg name="passkey" type="u"></arg>
|
||||||
|
<arg name="entered" type="u"></arg>
|
||||||
|
</signal>
|
||||||
|
<signal name="RequestConfirmation">
|
||||||
|
<arg name="device" type="o"></arg>
|
||||||
|
<arg name="passkey" type="s"></arg>
|
||||||
|
</signal>
|
||||||
|
<signal name="RequestAuthorization">
|
||||||
|
<arg name="device" type="o"></arg>
|
||||||
|
</signal>
|
||||||
|
<signal name="RequestPinCode">
|
||||||
|
<arg name="device" type="o"></arg>
|
||||||
|
</signal>
|
||||||
|
<signal name="RequestPasskey">
|
||||||
|
<arg name="device" type="o"></arg>
|
||||||
|
</signal>
|
||||||
|
<signal name="Cancelled">
|
||||||
|
<arg name="device" type="o"></arg>
|
||||||
|
</signal>
|
||||||
|
<signal name="ObexSessionCreated">
|
||||||
|
<arg name="sessionPath" type="o"></arg>
|
||||||
|
</signal>
|
||||||
|
<signal name="ObexSessionRemoved">
|
||||||
|
<arg name="sessionPath" type="o"></arg>
|
||||||
|
</signal>
|
||||||
|
<signal name="ObexSessionProgress">
|
||||||
|
<arg name="sessionPath" type="o"></arg>
|
||||||
|
<arg name="totalSize" type="t"></arg>
|
||||||
|
<arg name="transferred" type="t"></arg>
|
||||||
|
<arg name="currentIdx" type="i"></arg>
|
||||||
|
</signal>
|
||||||
|
<signal name="TransferCreated">
|
||||||
|
<arg name="file" type="s"></arg>
|
||||||
|
<arg name="transferPath" type="o"></arg>
|
||||||
|
<arg name="sessionPath" type="o"></arg>
|
||||||
|
</signal>
|
||||||
|
<signal name="TransferRemoved">
|
||||||
|
<arg name="file" type="s"></arg>
|
||||||
|
<arg name="transferPath" type="o"></arg>
|
||||||
|
<arg name="sessionPath" type="o"></arg>
|
||||||
|
<arg name="done" type="b"></arg>
|
||||||
|
</signal>
|
||||||
|
<signal name="TransferFailed">
|
||||||
|
<arg name="file" type="s"></arg>
|
||||||
|
<arg name="sessionPath" type="o"></arg>
|
||||||
|
<arg name="errInfo" type="s"></arg>
|
||||||
|
</signal>
|
||||||
|
<signal name="ConnectFailed">
|
||||||
|
<arg name="device" type="o"></arg>
|
||||||
|
</signal>
|
||||||
|
<property name="State" type="u" access="read"></property>
|
||||||
|
<property name="DisplaySwitch" type="b" access="readwrite"></property>
|
||||||
|
<property name="Transportable" type="b" access="read"></property>
|
||||||
|
<property name="CanSendFile" type="b" access="read"></property>
|
||||||
|
</interface>
|
@ -3,17 +3,24 @@ set(PLUGIN_NAME "datetime")
|
|||||||
|
|
||||||
project(${PLUGIN_NAME})
|
project(${PLUGIN_NAME})
|
||||||
|
|
||||||
|
generation_dbus_interface(${CMAKE_CURRENT_SOURCE_DIR}/dbusinterface/xml ${CMAKE_CURRENT_SOURCE_DIR}/dbusinterface/generation_dbus_interface)
|
||||||
|
|
||||||
# Sources files
|
# Sources files
|
||||||
file(GLOB SRCS "*.h" "*.cpp" "../../widgets/*.h" "../../widgets/*.cpp")
|
file(GLOB_RECURSE SRCS "*.h"
|
||||||
|
"*.cpp"
|
||||||
|
"../../widgets/*.h"
|
||||||
|
"../../widgets/*.cpp"
|
||||||
|
"./dbusinterface/*.h"
|
||||||
|
"./dbusinterface/*.cpp"
|
||||||
|
"../../frame/qtdbusextended/*.h"
|
||||||
|
"../../frame/qtdbusextended/*.cpp" "")
|
||||||
|
|
||||||
find_package(PkgConfig REQUIRED)
|
find_package(PkgConfig REQUIRED)
|
||||||
find_package(Qt5Widgets REQUIRED)
|
find_package(Qt5Widgets REQUIRED)
|
||||||
find_package(Qt5Svg REQUIRED)
|
find_package(Qt5Svg REQUIRED)
|
||||||
find_package(Qt5DBus REQUIRED)
|
find_package(Qt5DBus REQUIRED)
|
||||||
find_package(DtkWidget REQUIRED)
|
find_package(DtkWidget REQUIRED)
|
||||||
pkg_check_modules(DFrameworkDBus REQUIRED dframeworkdbus)
|
|
||||||
|
|
||||||
pkg_check_modules(DFrameworkDBus REQUIRED dframeworkdbus)
|
|
||||||
pkg_check_modules(QGSettings REQUIRED gsettings-qt)
|
pkg_check_modules(QGSettings REQUIRED gsettings-qt)
|
||||||
|
|
||||||
add_definitions("${QT_DEFINITIONS} -DQT_PLUGIN")
|
add_definitions("${QT_DEFINITIONS} -DQT_PLUGIN")
|
||||||
@ -21,15 +28,17 @@ add_library(${PLUGIN_NAME} SHARED ${SRCS} datetime.qrc)
|
|||||||
set_target_properties(${PLUGIN_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ../)
|
set_target_properties(${PLUGIN_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ../)
|
||||||
target_include_directories(${PLUGIN_NAME} PUBLIC
|
target_include_directories(${PLUGIN_NAME} PUBLIC
|
||||||
${DtkWidget_INCLUDE_DIRS}
|
${DtkWidget_INCLUDE_DIRS}
|
||||||
${DFrameworkDBus_INCLUDE_DIRS}
|
|
||||||
${QGSettings_INCLUDE_DIRS}
|
${QGSettings_INCLUDE_DIRS}
|
||||||
../../interfaces)
|
../../interfaces
|
||||||
|
../../frame/qtdbusextended
|
||||||
|
./dbusinterface/
|
||||||
|
./dbusinterface/generation_dbus_interface)
|
||||||
|
|
||||||
target_link_libraries(${PLUGIN_NAME} PRIVATE
|
target_link_libraries(${PLUGIN_NAME} PRIVATE
|
||||||
${Qt5DBus_LIBRARIES}
|
${Qt5DBus_LIBRARIES}
|
||||||
${DtkWidget_LIBRARIES}
|
${DtkWidget_LIBRARIES}
|
||||||
${Qt5Widgets_LIBRARIES}
|
${Qt5Widgets_LIBRARIES}
|
||||||
${Qt5Svg_LIBRARIES}
|
${Qt5Svg_LIBRARIES}
|
||||||
${DFrameworkDBus_LIBRARIES}
|
|
||||||
${QGSettings_LIBRARIES}
|
${QGSettings_LIBRARIES}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"api": "2.0.0",
|
"api": "2.0.0",
|
||||||
"depends-daemon-dbus-service": "com.deepin.daemon.Timedate"
|
"depends-daemon-dbus-service": "org.deepin.daemon.Timedate1"
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ DatetimePlugin::DatetimePlugin(QObject *parent)
|
|||||||
, m_pluginLoaded(false)
|
, m_pluginLoaded(false)
|
||||||
{
|
{
|
||||||
QDBusConnection sessionBus = QDBusConnection::sessionBus();
|
QDBusConnection sessionBus = QDBusConnection::sessionBus();
|
||||||
sessionBus.connect("com.deepin.daemon.Timedate", "/com/deepin/daemon/Timedate", "org.freedesktop.DBus.Properties", "PropertiesChanged", this, SLOT(propertiesChanged()));
|
sessionBus.connect("org.deepin.daemon.Timedate1", "/org/deepin/daemon/Timedate1", "org.freedesktop.DBus.Properties", "PropertiesChanged", this, SLOT(propertiesChanged()));
|
||||||
}
|
}
|
||||||
|
|
||||||
PluginsItemInterface::PluginSizePolicy DatetimePlugin::pluginSizePolicy() const
|
PluginsItemInterface::PluginSizePolicy DatetimePlugin::pluginSizePolicy() const
|
||||||
@ -268,11 +268,11 @@ void DatetimePlugin::propertiesChanged()
|
|||||||
QDBusInterface* DatetimePlugin::timedateInterface()
|
QDBusInterface* DatetimePlugin::timedateInterface()
|
||||||
{
|
{
|
||||||
if (!m_interface) {
|
if (!m_interface) {
|
||||||
if (QDBusConnection::sessionBus().interface()->isServiceRegistered("com.deepin.daemon.Timedate")) {
|
if (QDBusConnection::sessionBus().interface()->isServiceRegistered("org.deepin.daemon.Timedate1")) {
|
||||||
m_interface = new QDBusInterface("com.deepin.daemon.Timedate", "/com/deepin/daemon/Timedate", "com.deepin.daemon.Timedate", QDBusConnection::sessionBus(), this);
|
m_interface = new QDBusInterface("org.deepin.daemon.Timedate1", "/org/deepin/daemon/Timedate1", "org.deepin.daemon.Timedate1", QDBusConnection::sessionBus(), this);
|
||||||
} else {
|
} else {
|
||||||
const QString path = QString("/com/deepin/daemon/Accounts/User%1").arg(QString::number(getuid()));
|
const QString path = QString("/org/deepin/daemon/Accounts/User%1").arg(QString::number(getuid()));
|
||||||
QDBusInterface * systemInterface = new QDBusInterface("com.deepin.daemon.Accounts", path, "com.deepin.daemon.Accounts.User",
|
QDBusInterface * systemInterface = new QDBusInterface("org.deepin.daemon.Accounts1", path, "org.deepin.daemon.Accounts.User",
|
||||||
QDBusConnection::systemBus(), this);
|
QDBusConnection::systemBus(), this);
|
||||||
return systemInterface;
|
return systemInterface;
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,7 @@ DatetimeWidget::DatetimeWidget(QWidget *parent)
|
|||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
, m_24HourFormat(false)
|
, m_24HourFormat(false)
|
||||||
, m_timeOffset(false)
|
, m_timeOffset(false)
|
||||||
, m_timedateInter(new Timedate("com.deepin.daemon.Timedate", "/com/deepin/daemon/Timedate", QDBusConnection::sessionBus(), this))
|
, m_timedateInter(new Timedate("org.deepin.daemon.Timedate1", "/org/deepin/daemon/Timedate1", QDBusConnection::sessionBus(), this))
|
||||||
, m_shortDateFormat("yyyy-MM-dd")
|
, m_shortDateFormat("yyyy-MM-dd")
|
||||||
, m_shortTimeFormat("hh:mm")
|
, m_shortTimeFormat("hh:mm")
|
||||||
{
|
{
|
||||||
|
@ -22,11 +22,11 @@
|
|||||||
#ifndef DATETIMEWIDGET_H
|
#ifndef DATETIMEWIDGET_H
|
||||||
#define DATETIMEWIDGET_H
|
#define DATETIMEWIDGET_H
|
||||||
|
|
||||||
#include <com_deepin_daemon_timedate.h>
|
#include "org_deepin_daemon_timedate.h"
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
using Timedate = com::deepin::daemon::Timedate;
|
using Timedate = org::deepin::daemon::Timedate1;
|
||||||
|
|
||||||
class DatetimeWidget : public QWidget
|
class DatetimeWidget : public QWidget
|
||||||
{
|
{
|
||||||
|
92
plugins/datetime/dbusinterface/types/zoneinfo.cpp
Normal file
92
plugins/datetime/dbusinterface/types/zoneinfo.cpp
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd.
|
||||||
|
*
|
||||||
|
* Author: sbw <sbw@sbw.so>
|
||||||
|
* kirigaya <kirigaya@mkacg.com>
|
||||||
|
* Hualet <mr.asianwang@gmail.com>
|
||||||
|
*
|
||||||
|
* Maintainer: sbw <sbw@sbw.so>
|
||||||
|
* kirigaya <kirigaya@mkacg.com>
|
||||||
|
* Hualet <mr.asianwang@gmail.com>
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* 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 "zoneinfo.h"
|
||||||
|
|
||||||
|
ZoneInfo::ZoneInfo()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ZoneInfo::operator ==(const ZoneInfo &what) const
|
||||||
|
{
|
||||||
|
// TODO: 这里只判断这两个成员应该就可以了
|
||||||
|
return m_zoneName == what.m_zoneName &&
|
||||||
|
m_utcOffset == what.m_utcOffset;
|
||||||
|
}
|
||||||
|
|
||||||
|
QDebug operator<<(QDebug argument, const ZoneInfo & info)
|
||||||
|
{
|
||||||
|
argument << info.m_zoneName << ',' << info.m_zoneCity << ',' << info.m_utcOffset << ',';
|
||||||
|
argument << info.i2 << ',' << info.i3 << ',' << info.i4 << endl;
|
||||||
|
|
||||||
|
return argument;
|
||||||
|
}
|
||||||
|
|
||||||
|
QDBusArgument &operator<<(QDBusArgument & argument, const ZoneInfo & info)
|
||||||
|
{
|
||||||
|
argument.beginStructure();
|
||||||
|
argument << info.m_zoneName << info.m_zoneCity << info.m_utcOffset;
|
||||||
|
argument.beginStructure();
|
||||||
|
argument << info.i2 << info.i3 << info.i4;
|
||||||
|
argument.endStructure();
|
||||||
|
argument.endStructure();
|
||||||
|
|
||||||
|
return argument;
|
||||||
|
}
|
||||||
|
|
||||||
|
QDataStream &operator<<(QDataStream & argument, const ZoneInfo & info)
|
||||||
|
{
|
||||||
|
argument << info.m_zoneName << info.m_zoneCity << info.m_utcOffset;
|
||||||
|
argument << info.i2 << info.i3 << info.i4;
|
||||||
|
|
||||||
|
return argument;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QDBusArgument &operator>>(const QDBusArgument & argument, ZoneInfo & info)
|
||||||
|
{
|
||||||
|
argument.beginStructure();
|
||||||
|
argument >> info.m_zoneName >> info.m_zoneCity >> info.m_utcOffset;
|
||||||
|
argument.beginStructure();
|
||||||
|
argument >> info.i2 >> info.i3 >> info.i4;
|
||||||
|
argument.endStructure();
|
||||||
|
argument.endStructure();
|
||||||
|
|
||||||
|
return argument;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QDataStream &operator>>(QDataStream & argument, ZoneInfo & info)
|
||||||
|
{
|
||||||
|
argument >> info.m_zoneName >> info.m_zoneCity >> info.m_utcOffset;
|
||||||
|
argument >> info.i2 >> info.i3 >> info.i4;
|
||||||
|
|
||||||
|
return argument;
|
||||||
|
}
|
||||||
|
|
||||||
|
void registerZoneInfoMetaType()
|
||||||
|
{
|
||||||
|
qRegisterMetaType<ZoneInfo>("ZoneInfo");
|
||||||
|
qDBusRegisterMetaType<ZoneInfo>();
|
||||||
|
}
|
66
plugins/datetime/dbusinterface/types/zoneinfo.h
Normal file
66
plugins/datetime/dbusinterface/types/zoneinfo.h
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd.
|
||||||
|
*
|
||||||
|
* Author: sbw <sbw@sbw.so>
|
||||||
|
* kirigaya <kirigaya@mkacg.com>
|
||||||
|
* Hualet <mr.asianwang@gmail.com>
|
||||||
|
*
|
||||||
|
* Maintainer: sbw <sbw@sbw.so>
|
||||||
|
* kirigaya <kirigaya@mkacg.com>
|
||||||
|
* Hualet <mr.asianwang@gmail.com>
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* 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 ZONEINFO_H
|
||||||
|
#define ZONEINFO_H
|
||||||
|
|
||||||
|
#include <QDebug>
|
||||||
|
#include <QDataStream>
|
||||||
|
#include <QString>
|
||||||
|
#include <QDBusArgument>
|
||||||
|
#include <QDBusMetaType>
|
||||||
|
|
||||||
|
class ZoneInfo
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ZoneInfo();
|
||||||
|
|
||||||
|
friend QDebug operator<<(QDebug argument, const ZoneInfo &info);
|
||||||
|
friend QDBusArgument &operator<<(QDBusArgument &argument, const ZoneInfo &info);
|
||||||
|
friend QDataStream &operator<<(QDataStream &argument, const ZoneInfo &info);
|
||||||
|
friend const QDBusArgument &operator>>(const QDBusArgument &argument, ZoneInfo &info);
|
||||||
|
friend const QDataStream &operator>>(QDataStream &argument, ZoneInfo &info);
|
||||||
|
|
||||||
|
bool operator==(const ZoneInfo &what) const;
|
||||||
|
|
||||||
|
public:
|
||||||
|
inline QString getZoneName() const {return m_zoneName;}
|
||||||
|
inline QString getZoneCity() const {return m_zoneCity;}
|
||||||
|
inline int getUTCOffset() const {return m_utcOffset;}
|
||||||
|
|
||||||
|
private:
|
||||||
|
QString m_zoneName;
|
||||||
|
QString m_zoneCity;
|
||||||
|
int m_utcOffset;
|
||||||
|
qint64 i2;
|
||||||
|
qint64 i3;
|
||||||
|
int i4;
|
||||||
|
};
|
||||||
|
|
||||||
|
Q_DECLARE_METATYPE(ZoneInfo)
|
||||||
|
|
||||||
|
void registerZoneInfoMetaType();
|
||||||
|
|
||||||
|
#endif // ZONEINFO_H
|
@ -0,0 +1,62 @@
|
|||||||
|
<interface name="org.deepin.daemon.Timedate1">
|
||||||
|
<signal name="TimeUpdate">
|
||||||
|
</signal>
|
||||||
|
<method name="AddUserTimezone">
|
||||||
|
<arg type="s" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="DeleteUserTimezone">
|
||||||
|
<arg type="s" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="GetZoneInfo">
|
||||||
|
<arg type="s" direction="in"></arg>
|
||||||
|
<arg type="(ssi(xxi))" direction="out"></arg>
|
||||||
|
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value ="ZoneInfo"/>
|
||||||
|
</method>
|
||||||
|
<method name="GetZoneList">
|
||||||
|
<arg type="as" direction="out"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="GetSampleNTPServers">
|
||||||
|
<arg type="as" direction="out"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="SetDate">
|
||||||
|
<arg type="i" direction="in"></arg>
|
||||||
|
<arg type="i" direction="in"></arg>
|
||||||
|
<arg type="i" direction="in"></arg>
|
||||||
|
<arg type="i" direction="in"></arg>
|
||||||
|
<arg type="i" direction="in"></arg>
|
||||||
|
<arg type="i" direction="in"></arg>
|
||||||
|
<arg type="i" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="SetLocalRTC">
|
||||||
|
<arg type="b" direction="in"></arg>
|
||||||
|
<arg type="b" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="SetNTP">
|
||||||
|
<arg type="b" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="SetNTPServer">
|
||||||
|
<arg type="s" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="SetTime">
|
||||||
|
<arg type="x" direction="in"></arg>
|
||||||
|
<arg type="b" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="SetTimezone">
|
||||||
|
<arg type="s" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
<property name="CanNTP" type="b" access="read"></property>
|
||||||
|
<property name="NTP" type="b" access="read"></property>
|
||||||
|
<property name="LocalRTC" type="b" access="read"></property>
|
||||||
|
<property name="Timezone" type="s" access="read"></property>
|
||||||
|
<property name="Use24HourFormat" type="b" access="readwrite"></property>
|
||||||
|
<property name="DSTOffset" type="i" access="readwrite"></property>
|
||||||
|
<property name="UserTimezones" type="as" access="read"></property>
|
||||||
|
<property name="NTPServer" type="s" access="read"></property>
|
||||||
|
<property name="WeekdayFormat" type="i" access="readwrite"></property>
|
||||||
|
<property name="ShortDateFormat" type="i" access="readwrite"></property>
|
||||||
|
<property name="LongDateFormat" type="i" access="readwrite"></property>
|
||||||
|
<property name="ShortTimeFormat" type="i" access="readwrite"></property>
|
||||||
|
<property name="LongTimeFormat" type="i" access="readwrite"></property>
|
||||||
|
<property name="WeekBegins" type="i" access="readwrite"></property>
|
||||||
|
</interface>
|
||||||
|
|
@ -3,29 +3,38 @@ set(PLUGIN_NAME "keyboard-layout")
|
|||||||
|
|
||||||
project(${PLUGIN_NAME})
|
project(${PLUGIN_NAME})
|
||||||
|
|
||||||
|
generation_dbus_interface(${CMAKE_CURRENT_SOURCE_DIR}/dbusinterface/xml ${CMAKE_CURRENT_SOURCE_DIR}/dbusinterface/generation_dbus_interface)
|
||||||
|
|
||||||
# Sources files
|
# Sources files
|
||||||
file(GLOB_RECURSE SRCS "*.h" "*.cpp")
|
file(GLOB_RECURSE SRCS "*.h"
|
||||||
|
"*.cpp"
|
||||||
|
"./dbusinterface/generation_dbus_interface/*.h"
|
||||||
|
"./dbusinterface/generation_dbus_interface/*.cpp"
|
||||||
|
"../../frame/qtdbusextended/*.h"
|
||||||
|
"../../frame/qtdbusextended/*.cpp"
|
||||||
|
"./dbusinterface/types/*.h"
|
||||||
|
"./dbusinterface/types/*.cpp")
|
||||||
|
|
||||||
find_package(PkgConfig REQUIRED)
|
find_package(PkgConfig REQUIRED)
|
||||||
find_package(Qt5Widgets REQUIRED)
|
find_package(Qt5Widgets REQUIRED)
|
||||||
find_package(Qt5Svg REQUIRED)
|
find_package(Qt5Svg REQUIRED)
|
||||||
find_package(DtkWidget REQUIRED)
|
find_package(DtkWidget REQUIRED)
|
||||||
find_package(Qt5DBus REQUIRED)
|
find_package(Qt5DBus REQUIRED)
|
||||||
find_package(DFrameworkdbus REQUIRED)
|
|
||||||
|
|
||||||
pkg_check_modules(DFrameworkDBus REQUIRED dframeworkdbus)
|
|
||||||
pkg_check_modules(QGSettings REQUIRED gsettings-qt)
|
pkg_check_modules(QGSettings REQUIRED gsettings-qt)
|
||||||
|
|
||||||
add_definitions("${QT_DEFINITIONS} -DQT_PLUGIN")
|
add_definitions("${QT_DEFINITIONS} -DQT_PLUGIN")
|
||||||
add_library(${PLUGIN_NAME} SHARED ${SRCS})
|
add_library(${PLUGIN_NAME} SHARED ${SRCS})
|
||||||
set_target_properties(${PLUGIN_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ../)
|
set_target_properties(${PLUGIN_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ../)
|
||||||
target_include_directories(${PLUGIN_NAME} PUBLIC ${DtkWidget_INCLUDE_DIRS}
|
target_include_directories(${PLUGIN_NAME} PUBLIC ${DtkWidget_INCLUDE_DIRS}
|
||||||
${DFrameworkDBus_INCLUDE_DIRS}
|
|
||||||
${QGSettings_INCLUDE_DIRS}
|
${QGSettings_INCLUDE_DIRS}
|
||||||
../../interfaces)
|
../../interfaces
|
||||||
|
./dbusinterface
|
||||||
|
./dbusinterface/generation_dbus_interface
|
||||||
|
../../frame/qtdbusextended)
|
||||||
|
|
||||||
target_link_libraries(${PLUGIN_NAME} PRIVATE
|
target_link_libraries(${PLUGIN_NAME} PRIVATE
|
||||||
${DtkWidget_LIBRARIES}
|
${DtkWidget_LIBRARIES}
|
||||||
${DFrameworkDBus_LIBRARIES}
|
|
||||||
${QGSettings_LIBRARIES}
|
${QGSettings_LIBRARIES}
|
||||||
${Qt5Widgets_LIBRARIES}
|
${Qt5Widgets_LIBRARIES}
|
||||||
${Qt5Svg_LIBRARIES}
|
${Qt5Svg_LIBRARIES}
|
||||||
|
@ -22,9 +22,9 @@
|
|||||||
|
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QtDBus/QtDBus>
|
#include <QtDBus/QtDBus>
|
||||||
#include <com_deepin_daemon_inputdevice_keyboard.h>
|
#include "org_deepin_daemon_inputdevice_keyboard.h"
|
||||||
|
|
||||||
using Keyboard = com::deepin::daemon::inputdevice::Keyboard;
|
using Keyboard = org::deepin::daemon::inputdevice::Keyboard1;
|
||||||
class QGSettings;
|
class QGSettings;
|
||||||
|
|
||||||
class DBusAdaptors : public QDBusAbstractAdaptor
|
class DBusAdaptors : public QDBusAbstractAdaptor
|
||||||
|
@ -0,0 +1,32 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd.
|
||||||
|
*
|
||||||
|
* Author: sbw <sbw@sbw.so>
|
||||||
|
* kirigaya <kirigaya@mkacg.com>
|
||||||
|
* Hualet <mr.asianwang@gmail.com>
|
||||||
|
*
|
||||||
|
* Maintainer: sbw <sbw@sbw.so>
|
||||||
|
* kirigaya <kirigaya@mkacg.com>
|
||||||
|
* Hualet <mr.asianwang@gmail.com>
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* 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 "keyboardlayoutlist.h"
|
||||||
|
|
||||||
|
void registerKeyboardLayoutListMetaType()
|
||||||
|
{
|
||||||
|
qRegisterMetaType<KeyboardLayoutList>("KeyboardLayoutList");
|
||||||
|
qDBusRegisterMetaType<KeyboardLayoutList>();
|
||||||
|
}
|
@ -0,0 +1,38 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd.
|
||||||
|
*
|
||||||
|
* Author: sbw <sbw@sbw.so>
|
||||||
|
* kirigaya <kirigaya@mkacg.com>
|
||||||
|
* Hualet <mr.asianwang@gmail.com>
|
||||||
|
*
|
||||||
|
* Maintainer: sbw <sbw@sbw.so>
|
||||||
|
* kirigaya <kirigaya@mkacg.com>
|
||||||
|
* Hualet <mr.asianwang@gmail.com>
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* 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 KEYBOARDLAYOUTLIST_H
|
||||||
|
#define KEYBOARDLAYOUTLIST_H
|
||||||
|
|
||||||
|
#include <QMap>
|
||||||
|
#include <QString>
|
||||||
|
#include <QObject>
|
||||||
|
#include <QDBusMetaType>
|
||||||
|
|
||||||
|
typedef QMap<QString, QString> KeyboardLayoutList;
|
||||||
|
|
||||||
|
void registerKeyboardLayoutListMetaType();
|
||||||
|
|
||||||
|
#endif // KEYBOARDLAYOUTLIST_H
|
@ -0,0 +1,35 @@
|
|||||||
|
<node>
|
||||||
|
<interface name="org.deepin.daemon.InputDevice.Keyboard1">
|
||||||
|
<method name="AddLayoutOption">
|
||||||
|
<arg type="s" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="AddUserLayout">
|
||||||
|
<arg type="s" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="ClearLayoutOption"></method>
|
||||||
|
<method name="DeleteLayoutOption">
|
||||||
|
<arg type="s" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="DeleteUserLayout">
|
||||||
|
<arg type="s" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="GetLayoutDesc">
|
||||||
|
<arg type="s" direction="in"></arg>
|
||||||
|
<arg type="s" direction="out"></arg>
|
||||||
|
</method>
|
||||||
|
<method name="LayoutList">
|
||||||
|
<arg type="a{ss}" direction="out"></arg>
|
||||||
|
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="KeyboardLayoutList"/>
|
||||||
|
</method>
|
||||||
|
<method name="Reset"></method>
|
||||||
|
<property name="RepeatEnabled" type="b" access="readwrite"></property>
|
||||||
|
<property name="CapslockToggle" type="b" access="readwrite"></property>
|
||||||
|
<property name="CursorBlink" type="i" access="readwrite"></property>
|
||||||
|
<property name="RepeatInterval" type="u" access="readwrite"></property>
|
||||||
|
<property name="RepeatDelay" type="u" access="readwrite"></property>
|
||||||
|
<property name="LayoutScope" type="i" access="readwrite"></property>
|
||||||
|
<property name="CurrentLayout" type="s" access="readwrite"></property>
|
||||||
|
<property name="UserLayoutList" type="as" access="read"></property>
|
||||||
|
<property name="UserOptionList" type="as" access="read"></property>
|
||||||
|
</interface>
|
||||||
|
</node>
|
@ -3,8 +3,17 @@ set(PLUGIN_NAME "onboard")
|
|||||||
|
|
||||||
project(${PLUGIN_NAME})
|
project(${PLUGIN_NAME})
|
||||||
|
|
||||||
|
generation_dbus_interface(${CMAKE_CURRENT_SOURCE_DIR}/dbusinterface/xml ${CMAKE_CURRENT_SOURCE_DIR}/dbusinterface/generation_dbus_interface)
|
||||||
|
|
||||||
# Sources files
|
# Sources files
|
||||||
file(GLOB_RECURSE SRCS "*.h" "*.cpp" "../../widgets/*.h" "../../widgets/*.cpp")
|
file(GLOB_RECURSE SRCS "*.h"
|
||||||
|
"*.cpp"
|
||||||
|
"../../widgets/*.h"
|
||||||
|
"../../widgets/*.cpp"
|
||||||
|
"./dbusinterface/generation_dbus_interface/*.h"
|
||||||
|
"./dbusinterface/generation_dbus_interface/*.cpp"
|
||||||
|
"../../frame/qtdbusextended/*.h"
|
||||||
|
"../../frame/qtdbusextended/*.cpp")
|
||||||
|
|
||||||
find_package(PkgConfig REQUIRED)
|
find_package(PkgConfig REQUIRED)
|
||||||
find_package(Qt5Widgets REQUIRED)
|
find_package(Qt5Widgets REQUIRED)
|
||||||
@ -15,15 +24,17 @@ find_package(DtkWidget REQUIRED)
|
|||||||
add_definitions("${QT_DEFINITIONS} -DQT_PLUGIN")
|
add_definitions("${QT_DEFINITIONS} -DQT_PLUGIN")
|
||||||
add_library(${PLUGIN_NAME} SHARED ${SRCS} onboard.qrc)
|
add_library(${PLUGIN_NAME} SHARED ${SRCS} onboard.qrc)
|
||||||
set_target_properties(${PLUGIN_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ../)
|
set_target_properties(${PLUGIN_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ../)
|
||||||
|
|
||||||
target_include_directories(${PLUGIN_NAME} PUBLIC ${Qt5DBus_INCLUDE_DIRS}
|
target_include_directories(${PLUGIN_NAME} PUBLIC ${Qt5DBus_INCLUDE_DIRS}
|
||||||
${DFrameworkDBus_INCLUDE_DIRS}
|
../../interfaces
|
||||||
../../interfaces)
|
../../frame/qtdbusextended
|
||||||
|
./dbusinterface/generation_dbus_interface)
|
||||||
|
|
||||||
target_link_libraries(${PLUGIN_NAME} PRIVATE
|
target_link_libraries(${PLUGIN_NAME} PRIVATE
|
||||||
${Qt5Widgets_LIBRARIES}
|
${Qt5Widgets_LIBRARIES}
|
||||||
${Qt5DBus_LIBRARIES}
|
${Qt5DBus_LIBRARIES}
|
||||||
${DtkGui_LIBRARIES}
|
${DtkGui_LIBRARIES}
|
||||||
${DtkWidget_LIBRARIES}
|
${DtkWidget_LIBRARIES}
|
||||||
${DFrameworkDBus_LIBRARIES}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
install(TARGETS ${PLUGIN_NAME} LIBRARY DESTINATION lib/dde-dock/plugins)
|
install(TARGETS ${PLUGIN_NAME} LIBRARY DESTINATION lib/dde-dock/plugins)
|
||||||
|
59
plugins/onboard/dbusinterface/types/arealist.cpp
Normal file
59
plugins/onboard/dbusinterface/types/arealist.cpp
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd.
|
||||||
|
*
|
||||||
|
* Author: sbw <sbw@sbw.so>
|
||||||
|
* kirigaya <kirigaya@mkacg.com>
|
||||||
|
* Hualet <mr.asianwang@gmail.com>
|
||||||
|
*
|
||||||
|
* Maintainer: sbw <sbw@sbw.so>
|
||||||
|
* kirigaya <kirigaya@mkacg.com>
|
||||||
|
* Hualet <mr.asianwang@gmail.com>
|
||||||
|
* zhaolong <zhaolong@uniontech.com>
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* 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 "arealist.h"
|
||||||
|
|
||||||
|
bool MonitRect::operator ==(const MonitRect &rect)
|
||||||
|
{
|
||||||
|
return x1 == rect.x1 && y1 == rect.y1 && x2 == rect.x2 && y2 == rect.y2;
|
||||||
|
}
|
||||||
|
|
||||||
|
QDBusArgument &operator<<(QDBusArgument &arg, const MonitRect &rect)
|
||||||
|
{
|
||||||
|
arg.beginStructure();
|
||||||
|
arg << rect.x1 << rect.y1 << rect.x2 << rect.y2;
|
||||||
|
arg.endStructure();
|
||||||
|
|
||||||
|
return arg;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QDBusArgument &operator>>(const QDBusArgument &arg, MonitRect &rect)
|
||||||
|
{
|
||||||
|
arg.beginStructure();
|
||||||
|
arg >> rect.x1 >> rect.y1 >> rect.x2 >> rect.y2;
|
||||||
|
arg.endStructure();
|
||||||
|
|
||||||
|
return arg;
|
||||||
|
}
|
||||||
|
|
||||||
|
void registerAreaListMetaType()
|
||||||
|
{
|
||||||
|
qRegisterMetaType<MonitRect>("MonitRect");
|
||||||
|
qDBusRegisterMetaType<MonitRect>();
|
||||||
|
|
||||||
|
qRegisterMetaType<AreaList>("AreaList");
|
||||||
|
qDBusRegisterMetaType<AreaList>();
|
||||||
|
}
|
53
plugins/onboard/dbusinterface/types/arealist.h
Normal file
53
plugins/onboard/dbusinterface/types/arealist.h
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd.
|
||||||
|
*
|
||||||
|
* Author: sbw <sbw@sbw.so>
|
||||||
|
* kirigaya <kirigaya@mkacg.com>
|
||||||
|
* Hualet <mr.asianwang@gmail.com>
|
||||||
|
*
|
||||||
|
* Maintainer: sbw <sbw@sbw.so>
|
||||||
|
* kirigaya <kirigaya@mkacg.com>
|
||||||
|
* Hualet <mr.asianwang@gmail.com>
|
||||||
|
* zhaolong <zhaolong@uniontech.com>
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* 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 AREALIST_H
|
||||||
|
#define AREALIST_H
|
||||||
|
|
||||||
|
#include <QDBusMetaType>
|
||||||
|
#include <QRect>
|
||||||
|
#include <QList>
|
||||||
|
|
||||||
|
struct MonitRect {
|
||||||
|
int x1;
|
||||||
|
int y1;
|
||||||
|
int x2;
|
||||||
|
int y2;
|
||||||
|
|
||||||
|
bool operator ==(const MonitRect& rect);
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef QList<MonitRect> AreaList;
|
||||||
|
|
||||||
|
Q_DECLARE_METATYPE(MonitRect)
|
||||||
|
Q_DECLARE_METATYPE(AreaList)
|
||||||
|
|
||||||
|
QDBusArgument &operator<<(QDBusArgument &arg, const MonitRect &rect);
|
||||||
|
const QDBusArgument &operator>>(const QDBusArgument &arg, MonitRect &rect);
|
||||||
|
|
||||||
|
void registerAreaListMetaType();
|
||||||
|
|
||||||
|
#endif // AREALIST_H
|
@ -0,0 +1,8 @@
|
|||||||
|
<interface name="org.deepin.dde.daemon.Dock1.Entry">
|
||||||
|
<method name="Activate">
|
||||||
|
<arg type="u" direction="in"></arg>
|
||||||
|
</method>
|
||||||
|
<property name="Id" type="s" access="read"></property>
|
||||||
|
<property name="IsActive" type="b" access="read"></property>
|
||||||
|
<property name="Name" type="s" access="read"></property>
|
||||||
|
</interface>
|
@ -0,0 +1,3 @@
|
|||||||
|
<interface name="org.deepin.dde.daemon.Dock1">
|
||||||
|
<property name="Entries" type="ao" access="read"/>
|
||||||
|
</interface>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user