DtkGui 5.5.23
DTK Gui module
Public 类型 | 信号 | Public 成员函数 | 静态 Public 成员函数 | Protected 成员函数 | 属性 | 所有成员列表
Dtk::Gui::DWindowManagerHelper类 参考

提供与窗口管理器交互的接口,同 DPlatformWindowHandle 依赖 dxcb 插件. 更多...

类 Dtk::Gui::DWindowManagerHelper 继承关系图:
Inheritance graph
[图例]
Dtk::Gui::DWindowManagerHelper 的协作图:
Collaboration graph
[图例]

Public 类型

enum  MotifFunction {
  FUNC_RESIZE = (1L << 1) , FUNC_MOVE = (1L << 2) , FUNC_MINIMIZE = (1L << 3) , FUNC_MAXIMIZE = (1L << 4) ,
  FUNC_CLOSE = (1L << 5) , FUNC_ALL = FUNC_RESIZE | FUNC_MOVE | FUNC_MINIMIZE | FUNC_MAXIMIZE | FUNC_CLOSE
}
 
enum  MotifDecoration {
  DECOR_BORDER = (1L << 1) , DECOR_RESIZEH = (1L << 2) , DECOR_TITLE = (1L << 3) , DECOR_MENU = (1L << 4) ,
  DECOR_MINIMIZE = (1L << 5) , DECOR_MAXIMIZE = (1L << 6) , DECOR_ALL = DECOR_BORDER | DECOR_RESIZEH | DECOR_TITLE | DECOR_MENU | DECOR_MINIMIZE | DECOR_MAXIMIZE
}
 
enum  WMName { OtherWM , DeepinWM , KWinWM }
 
enum  WmWindowType {
  UnknowWindowType = 0x000000 , NormalType = 0x000001 , DesktopType = 0x000002 , DockType = 0x000004 ,
  ToolbarType = 0x000008 , MenuType = 0x000010 , UtilityType = 0x000020 , SplashType = 0x000040 ,
  DialogType = 0x000080 , DropDownMenuType = 0x000100 , PopupMenuType = 0x000200 , TooltipType = 0x000400 ,
  NotificationType = 0x000800 , ComboType = 0x001000 , DndType = 0x002000 , KdeOverrideType = 0x004000
}
 

信号

void windowManagerChanged ()
 信号会在当前环境窗口管理器变化时被发送.
 
void hasBlurWindowChanged ()
 信号会在 hasBlurWindow 属性的值改变时被发送.
 
void hasCompositeChanged ()
 信号会在 hasComposite 属性的值改变时被发送.
 
void hasNoTitlebarChanged ()
 信号会在 hasNoTitlebar 属性的值改变时被发送.
 
void hasWallpaperEffectChanged ()
 信号会在 hasWallpaperEffect 属性的值改变时被发送.
 
void windowListChanged ()
 信号会在当前环境本地窗口列表变化时被发送。包含打开新窗口、关闭窗口、改变窗口的 层叠顺序.
 
void windowMotifWMHintsChanged (quint32 winId)
 信号会在窗口功能或修饰标志改变时被发送. 更多...
 

Public 成员函数

bool hasBlurWindow () const
 DWindowManagerHelper::hasBlurWindow 更多...
 
bool hasComposite () const
 DWindowManagerHelper::hasComposite 更多...
 
bool hasNoTitlebar () const
 DWindowManagerHelper::hasNoTitlebar 更多...
 
bool hasWallpaperEffect () const
 DWindowManagerHelper::hasWallpaperEffect 更多...
 
QString windowManagerNameString () const
 DWindowManagerHelper::windowManagerNameString 更多...
 
WMName windowManagerName () const
 DWindowManagerHelper::windowManagerName 更多...
 
QVector< quint32 > allWindowIdList () const
 DWindowManagerHelper::allWindowIdList 更多...
 
QVector< quint32 > currentWorkspaceWindowIdList () const
 DWindowManagerHelper::currentWorkspaceWindowIdList 更多...
 
QList< DForeignWindow * > currentWorkspaceWindows () const
 DWindowManagerHelper::currentWorkspaceWindowIdList 更多...
 
quint32 windowFromPoint (const QPoint &p)
 DWindowManagerHelper::windowFromPoint 更多...
 
- Public 成员函数 继承自 QObject
virtual const QMetaObjectmetaObject () const const
 
 QObject (QObject *parent)
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
QString objectName () const const
 
void setObjectName (const QString &name)
 
bool isWidgetType () const const
 
bool isWindowType () const const
 
bool signalsBlocked () const const
 
bool blockSignals (bool block)
 
QThreadthread () const const
 
void moveToThread (QThread *targetThread)
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds time, Qt::TimerType timerType)
 
void killTimer (int id)
 
findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegExp &regExp, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
const QObjectListchildren () const const
 
void setParent (QObject *parent)
 
void installEventFilter (QObject *filterObj)
 
void removeEventFilter (QObject *obj)
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
 
bool disconnect (const QObject *receiver, const char *method) const const
 
void dumpObjectTree ()
 
void dumpObjectInfo ()
 
void dumpObjectTree () const const
 
void dumpObjectInfo () const const
 
bool setProperty (const char *name, const QVariant &value)
 
QVariant property (const char *name) const const
 
QList< QByteArraydynamicPropertyNames () const const
 
void destroyed (QObject *obj)
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const const
 
bool inherits (const char *className) const const
 
void deleteLater ()
 
 Q_DISABLE_COPY (Class)
 
 Q_DISABLE_MOVE (Class)
 
 Q_DISABLE_COPY_MOVE (Class)
 
qobject_cast (QObject *object)
 
qobject_cast (const QObject *object)
 
qFindChild (const QObject *obj, const QString &name)
 
QList< T > qFindChildren (const QObject *obj, const QString &name)
 
QList< T > qFindChildren (const QObject *obj, const QRegExp &regExp)
 
 Q_CLASSINFO (Name, Value)
 
 Q_INTERFACES (...)
 
 Q_PROPERTY (...)
 
 Q_ENUMS (...)
 
 Q_FLAGS (...)
 
 Q_ENUM (...)
 
 Q_FLAG (...)
 
 Q_ENUM_NS (...)
 
 Q_FLAG_NS (...)
 
 Q_OBJECT Q_OBJECT
 
 Q_GADGET Q_GADGET
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_NAMESPACE_EXPORT (EXPORT_MACRO)
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SLOTS Q_SLOTS
 
 Q_SLOT Q_SLOT
 
 Q_EMIT Q_EMIT
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 

静态 Public 成员函数

static DWindowManagerHelperinstance ()
 DWindowManagerHelper::instance DWindowManagerHelper 的单例对象,使用 Q_GLOBAL_STATIC 定义,在第一次调用时实例化。 更多...
 
static void setMotifFunctions (const QWindow *window, MotifFunctions hints)
 DWindowManagerHelper::setMotifFunctions 设置窗口的功能性标志,会覆盖之前的设置 window hints
 
static MotifFunctions setMotifFunctions (const QWindow *window, MotifFunctions hints, bool on)
 DWindowManagerHelper::setMotifFunctions 设置窗口某些标志位的开启状态,不影响其它标志位 window hints 要设置的标志位 on 如果值为 true 则开启标志,否则关闭 更多...
 
static MotifFunctions getMotifFunctions (const QWindow *window)
 DWindowManagerHelper::getMotifFunctions window 更多...
 
static void setMotifDecorations (const QWindow *window, MotifDecorations hints)
 DWindowManagerHelper::setMotifDecorations 设置窗口的修饰性标志,会覆盖之前的设置 window hints
 
static MotifDecorations setMotifDecorations (const QWindow *window, MotifDecorations hints, bool on)
 DWindowManagerHelper::setMotifFunctions 设置窗口某些标志位的开启状态,不影响其它标志位 window hints 要设置的标志位 on 如果值为 true 则开启标志,否则关闭 更多...
 
static MotifDecorations getMotifDecorations (const QWindow *window)
 DWindowManagerHelper::getMotifFunctions window 更多...
 
static void setWmWindowTypes (QWindow *window, WmWindowTypes types)
 DWindowManagerHelper::setWmWindowTypes 直接设置窗口管理器层级提供的窗口类型,如DesktopType和DockType类型也被 桌面环境需要,但是Qt自身并没有提供对应的设置接口 window types
 
static void setWmClassName (const QByteArray &name)
 DWindowManagerHelper::setWmClassName 设置x11环境上默认使用的wm class name,主要是在窗口创建时用于设置WM_CLASS窗口属性 name 更多...
 
static void popupSystemWindowMenu (const QWindow *window)
 DWindowManagerHelper::popupSystemWindowMenu 显示窗口管理器对窗口的菜单,和有边框的窗口在标题栏上点击鼠标右键弹出的菜单内容一致。 在 DMainWindow 的标题栏上点击鼠标右键会调用此函数打开系统菜单: 更多...
 
- 静态 Public 成员函数 继承自 QObject
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 

Protected 成员函数

 DWindowManagerHelper (QObject *parent=0)
 DWindowManagerHelper::DWindowManagerHelper 不允许直接实例化此对象 parent 更多...
 
- Protected 成员函数 继承自 QObject
QObjectsender () const const
 
int senderSignalIndex () const const
 
int receivers (const char *signal) const const
 
bool isSignalConnected (const QMetaMethod &signal) const const
 
virtual void timerEvent (QTimerEvent *event)
 
virtual void childEvent (QChildEvent *event)
 
virtual void customEvent (QEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 

属性

bool hasBlurWindow
 窗口管理器是否支持窗口背景模糊特效 更多...
 
bool hasComposite
 窗口管理器是否支持混成效果。如果不支持混成,则表示所有窗口的背景都不能透明, 随之而来也不会有窗口阴影等效果,不规则窗口的边缘也会存在锯齿。 更多...
 
bool hasNoTitlebar
 窗口管理器是否支持隐藏窗口标题栏。如果支持,则 DPlatformWindowHandle::enableDXcbForWindow 会优先使用此方法支持自定义窗口标题栏。 更多...
 
bool hasWallpaperEffect
 窗口管理器是否支持窗口背景特效绘制。如果支持,则 绘制背景到透明窗口 会使用此方法开启特效窗口壁纸背景绘制。 更多...
 
- 属性 继承自 QObject
 objectName
 

额外继承的成员函数

- Public 属性 继承自 QObject
typedef QObjectList
 

详细描述

提供与窗口管理器交互的接口,同 DPlatformWindowHandle 依赖 dxcb 插件.

\inmodule dtkgui

dxcb 插件抽象出所有需要和X11平台交互的接口以供上层调用,DTK 使用插件中提供的接口再 次封装提供给应用程序使用,从设计角度讲,DTK库中不应该直接使用任何跟平台相关的接口 (如:X11、Wayland、Windows),在这样的结构支撑下,在一个新的平台上,只需要提供和 dxcb 同样的接口,DTK应用即可无缝迁移。

参见
{https://github.com/linuxdeepin/qt5dxcb-plugin/}{dxcb插件}
Dtk::Widget::DApplication::loadDXcbPlugin
Dtk::Widget::DApplication::isDXcbPlatform
Dtk::Widget::DPlatformWindowHandle

构造及析构函数说明

◆ DWindowManagerHelper()

Dtk::Gui::DWindowManagerHelper::DWindowManagerHelper ( QObject parent = 0)
explicitprotected

DWindowManagerHelper::DWindowManagerHelper 不允许直接实例化此对象 parent

参见
DWindowManagerHelper::instance

成员函数说明

◆ allWindowIdList()

QVector< quint32 > Dtk::Gui::DWindowManagerHelper::allWindowIdList ( ) const

DWindowManagerHelper::allWindowIdList

返回
返回当前环境所有本地窗口的窗口id列表
注解
顺序和窗口层叠顺序相关,显示越靠下层的窗口在列表中顺序越靠前
参见
DWindowManagerHelper::currentWorkspaceWindowIdList

◆ currentWorkspaceWindowIdList()

QVector< quint32 > Dtk::Gui::DWindowManagerHelper::currentWorkspaceWindowIdList ( ) const

DWindowManagerHelper::currentWorkspaceWindowIdList

返回
返回当前工作区所有本地窗口的窗口id列表
注解
顺序和窗口层叠顺序相关,显示越靠下层的窗口在列表中顺序越靠前
参见
DWindowManagerHelper::allWindowIdList

◆ currentWorkspaceWindows()

QList< DForeignWindow * > Dtk::Gui::DWindowManagerHelper::currentWorkspaceWindows ( ) const

DWindowManagerHelper::currentWorkspaceWindowIdList

返回
返回当前工作区所有本地窗口对象列表。和 currentWorkspaceWindowIdList 类似,只不过自动通过窗口id创建了 DForeignWindow 对象
注解
顺序和窗口层叠顺序相关,显示越靠下层的窗口在列表中顺序越靠前
列表中对象的生命周期由 DForeignWindow 负责
警告
此列表中不包含由当前应用创建的窗口
参见
DWindowManagerHelper::currentWorkspaceWindowIdList
DForeignWindow::fromWinId

◆ getMotifDecorations()

DWindowManagerHelper::MotifDecorations Dtk::Gui::DWindowManagerHelper::getMotifDecorations ( const QWindow *  window)
static

DWindowManagerHelper::getMotifFunctions window

返回
返回窗口当前的修饰标志

◆ getMotifFunctions()

DWindowManagerHelper::MotifFunctions Dtk::Gui::DWindowManagerHelper::getMotifFunctions ( const QWindow *  window)
static

DWindowManagerHelper::getMotifFunctions window

返回
返回窗口当前的功能标志

◆ hasBlurWindow()

bool Dtk::Gui::DWindowManagerHelper::hasBlurWindow ( ) const

DWindowManagerHelper::hasBlurWindow

返回
如果当前窗口管理器支持窗口背景模糊特效则返回 true,否则返回 false

◆ hasComposite()

bool Dtk::Gui::DWindowManagerHelper::hasComposite ( ) const

DWindowManagerHelper::hasComposite

返回
如果当前窗口管理器支持混成则返回 true,否则返回 false

◆ hasNoTitlebar()

bool Dtk::Gui::DWindowManagerHelper::hasNoTitlebar ( ) const

DWindowManagerHelper::hasNoTitlebar

返回
如果窗口管理器当前支持设置隐藏窗口标题栏则返回 true,否则返回 false

◆ hasWallpaperEffect()

bool Dtk::Gui::DWindowManagerHelper::hasWallpaperEffect ( ) const

DWindowManagerHelper::hasWallpaperEffect

返回
如果窗口管理器当前支持背景图片特效绘制返回 true,否则返回 false

◆ instance()

DWindowManagerHelper * Dtk::Gui::DWindowManagerHelper::instance ( )
static

DWindowManagerHelper::instance DWindowManagerHelper 的单例对象,使用 Q_GLOBAL_STATIC 定义,在第一次调用时实例化。

返回

◆ popupSystemWindowMenu()

void Dtk::Gui::DWindowManagerHelper::popupSystemWindowMenu ( const QWindow *  window)
static

DWindowManagerHelper::popupSystemWindowMenu 显示窗口管理器对窗口的菜单,和有边框的窗口在标题栏上点击鼠标右键弹出的菜单内容一致。 在 DMainWindow 的标题栏上点击鼠标右键会调用此函数打开系统菜单:

window

◆ setMotifDecorations()

DWindowManagerHelper::MotifDecorations Dtk::Gui::DWindowManagerHelper::setMotifDecorations ( const QWindow *  window,
MotifDecorations  hints,
bool  on 
)
static

DWindowManagerHelper::setMotifFunctions 设置窗口某些标志位的开启状态,不影响其它标志位 window hints 要设置的标志位 on 如果值为 true 则开启标志,否则关闭

返回
返回设置后的窗口标志

◆ setMotifFunctions()

DWindowManagerHelper::MotifFunctions Dtk::Gui::DWindowManagerHelper::setMotifFunctions ( const QWindow *  window,
MotifFunctions  hints,
bool  on 
)
static

DWindowManagerHelper::setMotifFunctions 设置窗口某些标志位的开启状态,不影响其它标志位 window hints 要设置的标志位 on 如果值为 true 则开启标志,否则关闭

返回
返回设置后的窗口标志

◆ setWmClassName()

void Dtk::Gui::DWindowManagerHelper::setWmClassName ( const QByteArray name)
static

DWindowManagerHelper::setWmClassName 设置x11环境上默认使用的wm class name,主要是在窗口创建时用于设置WM_CLASS窗口属性 name

注解
如果值为空,Qt将在下次使用此值时根据程序名称再次初始化此值
参见
QCoreApplication::applicationName

◆ windowFromPoint()

quint32 Dtk::Gui::DWindowManagerHelper::windowFromPoint ( const QPoint p)

DWindowManagerHelper::windowFromPoint

返回
返回 p 位置的窗口 Id,如果出错返回 0
注解
可以通过 DForeignWindow::fromWinId 创建窗口对象

◆ windowManagerName()

DWindowManagerHelper::WMName Dtk::Gui::DWindowManagerHelper::windowManagerName ( ) const

◆ windowManagerNameString()

QString Dtk::Gui::DWindowManagerHelper::windowManagerNameString ( ) const

DWindowManagerHelper::windowManagerNameString

返回
返回窗口管理器名称。在X11平台上,此值为窗口管理器对应窗口的 _NET_WM_NAME 的值 \l {https://specifications.freedesktop.org/wm-spec/1.3/ar01s03.html}{_NET_SUPPORTING_WM_CHECK} \l {https://specifications.freedesktop.org/wm-spec/1.3/ar01s05.html}{_NET_WM_NAME}

◆ windowMotifWMHintsChanged

void Dtk::Gui::DWindowManagerHelper::windowMotifWMHintsChanged ( quint32  winId)
signal

信号会在窗口功能或修饰标志改变时被发送.

winId 窗口id

注解
只对当前应用程序中的窗口有效

属性说明

◆ hasBlurWindow

Dtk::Gui::DWindowManagerHelper::hasBlurWindow
read

窗口管理器是否支持窗口背景模糊特效

注解
在 dxcb 插件中目前只支持 deepin-wm 和 kwin 这两种窗管的模糊特效
只读

◆ hasComposite

Dtk::Gui::DWindowManagerHelper::hasComposite
read

窗口管理器是否支持混成效果。如果不支持混成,则表示所有窗口的背景都不能透明, 随之而来也不会有窗口阴影等效果,不规则窗口的边缘也会存在锯齿。

注解
只读

◆ hasNoTitlebar

Dtk::Gui::DWindowManagerHelper::hasNoTitlebar
read

窗口管理器是否支持隐藏窗口标题栏。如果支持,则 DPlatformWindowHandle::enableDXcbForWindow 会优先使用此方法支持自定义窗口标题栏。

注解
只读
参见
Dtk::Gui::DPlatformHandle::setEnabledNoTitlebarForWindow

◆ hasWallpaperEffect

Dtk::Gui::DWindowManagerHelper::hasWallpaperEffect
read

窗口管理器是否支持窗口背景特效绘制。如果支持,则 绘制背景到透明窗口 会使用此方法开启特效窗口壁纸背景绘制。

注解
只读
参见
hasWallpaperEffectChanged()

该类的文档由以下文件生成: