GXDE Bernese
Loading...
Searching...
No Matches
window_utils.h
1/*
2 * Copyright (C) 2026 CharOfString <root@charofstring.cc>
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the Free
6 * Software Foundation, either version 3 of the License, or (at your option)
7 * any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program. If not, see <https://www.gnu.org/licenses/>.
16 * ----------------------------------------------------------------------------
17 * Copyright (C) 2016 ~ 2018 Deepin Technology Co., Ltd.
18 * 2016 ~ 2018 dragondjf
19 * 2026 CharOfString
20 *
21 * Author: dragondjf <dingjiangfeng@deepin.com>
22 * CharOfString <root@charofstring.cc>
23 *
24 * Maintainer: CharOfString <root@charofstring.cc>
25 * dragondjf<dingjiangfeng@deepin.com>
26 * zccrs<zhangjide@deepin.com>
27 * Tangtong<tangtong@deepin.com>
28 * ----------------------------------------------------------------------------
29 * This class was adapted & modified from Deepin DDE.
30 */
31
32#ifndef WINDOW_UTILS_WINDOW_UTILS_H_
33#define WINDOW_UTILS_WINDOW_UTILS_H_
34
35#include "QMouseEvent"
36#include "QRect"
37#include "QWidget"
38
39#include "bernese/export.h"
40
41namespace bernese {
42namespace window_utils {
43
58BERNESE_EXPORT Qt::Edges EdgesAt(QWidget* widget, int x, int y, int border);
59
67BERNESE_EXPORT void MoveWindow(
68 QWidget* widget, QMouseEvent* event, const QRect& draggable_rect);
69
80BERNESE_EXPORT void ResizeWindow(
81 QWidget* widget, QMouseEvent* event, int border_inner_size = 6);
82
88BERNESE_EXPORT void ShowMaximizedWindow(QWidget* widget);
89
95BERNESE_EXPORT void ShowMinimizedWindow(QWidget* widget);
96
102BERNESE_EXPORT void ShowNormalWindow(QWidget* widget);
103
109BERNESE_EXPORT void ToggleMaximizedWindow(QWidget* widget);
110
117BERNESE_EXPORT bool SetNormalCursor(QWidget* widget);
118
125BERNESE_EXPORT bool SetHandleCursor(QWidget* widget);
126
136BERNESE_EXPORT bool SetCursorByCursorType(QWidget* widget,
137 unsigned int cursor_type);
138
149BERNESE_EXPORT bool UpdateCursorShape(QWidget* widget, int x, int y,
150 int border_inner_size = 6);
151
152} // namespace window_utils
153} // namespace bernese
154
155#endif // WINDOW_UTILS_WINDOW_UTILS_H_