/usr/include/libdtk-2.0.7/DWidget/dx11widget.h is in libdtkwidget-dev 2.0.7.2-2build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 | /*
* Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd.
*
* 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 DABSTRACTWIDGET_H
#define DABSTRACTWIDGET_H
#include <QWidget>
#include <dobject.h>
#include <dtkwidget_global.h>
class QMenu;
DWIDGET_BEGIN_NAMESPACE
class DX11WidgetPrivate;
class DTitlebar;
class LIBDTKWIDGETSHARED_EXPORT DX11Widget : public QWidget, public DTK_CORE_NAMESPACE::DObject
{
Q_OBJECT
public:
enum DecorationFlag {
ShowTitlebarSeparator = 0x01
};
Q_DECLARE_FLAGS(DecorationFlags, DecorationFlag)
Q_FLAGS(DecorationFlags)
explicit DX11Widget(QWidget *parent = 0);
Q_PROPERTY(int radius READ radius WRITE setRadius)
Q_PROPERTY(int shadowWidth READ shadowWidth WRITE setShadowWidth)
Q_PROPERTY(int border READ border WRITE setBorder)
Q_PROPERTY(int titlebarHeight READ titlebarHeight WRITE setTitlebarFixedHeight)
Q_PROPERTY(QPixmap backgroundImage READ backgroundImage WRITE setBackgroundImage)
Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor NOTIFY backgroundColorChanged)
Q_PROPERTY(QColor shadowColor READ shadowColor WRITE setShadowColor NOTIFY shadowColorChanged)
Q_PROPERTY(QPoint shadowOffset READ shadowOffset WRITE setShadowOffset NOTIFY shadowOffsetChanged)
DecorationFlags decorationFlags();
void setDecorationFlags(DecorationFlags flags);
Qt::WindowFlags windowFlags();
void setWindowFlags(Qt::WindowFlags type);
void setTitle(const QString &);
void setTitleIcon(const QPixmap &icon);
DTitlebar *titlebar() const;
void setTitlebarMenu(QMenu *);
QMenu *titleBarMenu() const;
void setTitlebarWidget(QWidget *, bool fixCenterPos = false);
void setTitlebarWidget(QWidget *w, Qt::AlignmentFlag wflag, bool fixCenterPos = false);
int titlebarHeight() const;
void setTitlebarFixedHeight(int h);
QLayout *layout() const;
void setLayout(QLayout *);
int radius() const;
void setRadius(int r);
int shadowWidth() const;
void setShadowWidth(int w);
int border() const;
void setBorder(int b);
const QPixmap &backgroundImage() const;
void setBackgroundImage(const QPixmap &srcPixmap);
void setContentsMargins(int left, int top, int right, int bottom);
void setContentsMargins(const QMargins &margins);
void getContentsMargins(int *left, int *top, int *right, int *bottom) const;
QMargins contentsMargins() const;
void setFixedSize(const QSize &);
void setFixedSize(int w, int h);
void setFixedWidth(int w);
// void setFixedHeight(int h);
void resize(int width, int height);
void resize(const QSize &);
void removeLayout();
void adjustSize();
void move(int x, int y);
void move(const QPoint &);
QRect frameGeometry() const;
const QRect &geometry() const;
QRect normalGeometry() const;
int x() const;
int y() const;
QPoint pos() const;
QSize frameSize() const;
QSize size() const;
int width() const;
int height() const;
QRect rect() const;
QRect childrenRect() const;
QRegion childrenRegion() const;
QSize minimumSize() const;
QSize maximumSize() const;
int minimumWidth() const;
int minimumHeight() const;
int maximumWidth() const;
int maximumHeight() const;
void setMinimumSize(const QSize &);
void setMinimumSize(int minw, int minh);
void setMaximumSize(const QSize &);
void setMaximumSize(int maxw, int maxh);
void setMinimumWidth(int minw);
void setMinimumHeight(int minh);
void setMaximumWidth(int maxw);
void setMaximumHeight(int maxh);
QColor backgroundColor() const;
QColor shadowColor() const;
QPoint shadowOffset() const;
protected:
void mouseMoveEvent(QMouseEvent *) Q_DECL_OVERRIDE;
void mousePressEvent(QMouseEvent *) Q_DECL_OVERRIDE;
void mouseReleaseEvent(QMouseEvent *) Q_DECL_OVERRIDE;
void showEvent(QShowEvent *) Q_DECL_OVERRIDE;
void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
void resizeEvent(QResizeEvent *) Q_DECL_OVERRIDE;
void closeEvent(QCloseEvent *) Q_DECL_OVERRIDE;
void enterEvent(QEvent *)Q_DECL_OVERRIDE;
void leaveEvent(QEvent *)Q_DECL_OVERRIDE;
void changeEvent(QEvent *event) Q_DECL_OVERRIDE;
public Q_SLOTS:
void showMinimized();
void showMaximized();
void showFullScreen();
void showNormal();
void moveWindow(Qt::MouseButton botton);
void toggleMaximizedWindow();
void setBackgroundColor(QColor backgroundColor);
void setShadowColor(QColor shadowColor);
void setShadowOffset(QPoint shadowOffset);
protected:
explicit DX11Widget(DX11WidgetPrivate &dd, QWidget *parent = 0);
virtual void drawShadowPixmap();
Q_SIGNALS:
void optionClicked();
void backgroundColorChanged(QColor backgroundColor);
void shadowColorChanged(QColor shadowColor);
void shadowOffsetChanged(QPoint shadowOffset);
private:
D_PRIVATE_SLOT(void _q_onTitleBarMousePressed(Qt::MouseButtons) const)
D_DECLARE_PRIVATE(DX11Widget)
};
class FilterMouseMove : public QObject
{
Q_OBJECT
public:
explicit FilterMouseMove(QObject *object = nullptr);
~FilterMouseMove();
bool eventFilter(QObject *obj, QEvent *event);
//private:
QWidget *m_rootWidget = nullptr;
};
DWIDGET_END_NAMESPACE
#endif // DABSTRACTWIDGET_H
|