File: xcbinterface.h

package info (click to toggle)
ukui-panel 4.0.0.6-1.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,148 kB
  • sloc: cpp: 28,423; xml: 476; sh: 51; makefile: 18
file content (82 lines) | stat: -rw-r--r-- 2,612 bytes parent folder | download
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
/*
 * libkysdk-waylandhelper's Library
 *
 * Copyright (C) 2023, KylinSoft Co., Ltd.
 *
 * 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 3 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 General Public License
 * along with this library.  If not, see <https://www.gnu.org/licenses/>.
 *
 * Authors: Zhen Sun <sunzhen1@kylinos.cn>
 *
 */

#ifndef XCBINTERFACE_H
#define XCBINTERFACE_H

#include "abstractinterface.h"

#include <KWindowInfo>
#include <KWindowEffects>

using namespace kdk;
class XcbInterface:public AbstractInterface
{
public:
    XcbInterface(QObject* parent=nullptr);
    ~XcbInterface();
    WindowInfo requestInfo(WindowId wid) override;

    void requestActivate(WindowId wid)  override;
    void requestClose(WindowId wid) ;
    void requestToggleKeepAbove(WindowId wid)  override;
    void requestToggleMinimized(WindowId wid)  override;
    void requestToggleMaximized(WindowId wid)  override;

    QIcon iconFor(WindowId wid) override;
    QString titleFor(WindowId wid) override;
    QString windowGroupFor(WindowId wid) override;

    void showCurrentDesktop() override;
    void hideCurrentDesktop() override;

    quint32 pid(WindowId wid) override;

    WindowId activeWindow() override;

    bool windowCanBeDragged(WindowId wid) override;
    bool windowCanBeMaximized(WindowId wid) override;

    void setGeometry(QWindow *window, const QRect &rect) override;
    void setSkipTaskBar(QWindow* window,bool skip) override;
    void setSkipSwitcher(QWindow* window,bool skip) override;

    bool skipTaskBar(const WindowId &wid) override;
    bool skipSwitcher(const WindowId &wid) override;

    bool isShowingDesktop();
    void setOnAllDesktops(const WindowId &wid);

    NET::WindowType windowType(WindowId wid) override;
    void setPanelTakefocus(QWindow *window, bool flag) override;
    void demandAttention(const WindowId &wid, bool set = true) override;

private:
    bool isValidWindow(WindowId wid) ;
    bool isValidWindow(const KWindowInfo &winfo) ;
    void windowChangedProxy(WId wid, NET::Properties prop1, NET::Properties2 prop2);

private:
    WindowId m_desktopId{-1};
};

#endif // XCBINTERFACE_H