Changeset View
Changeset View
Standalone View
Standalone View
xembed-sni-proxy/sniproxy.h
1 | /* | 1 | /* | ||
---|---|---|---|---|---|
2 | * Holds one embedded window, registers as DBus entry | 2 | * Holds one embedded window, registers as DBus entry | ||
3 | * Copyright (C) 2015 <davidedmundson@kde.org> David Edmundson | 3 | * Copyright (C) 2015 <davidedmundson@kde.org> David Edmundson | ||
4 | * Copyright (C) 2019 <materka@gmail.com> Konrad Materka | ||||
4 | * | 5 | * | ||
5 | * This library is free software; you can redistribute it and/or | 6 | * This library is free software; you can redistribute it and/or | ||
6 | * modify it under the terms of the GNU Lesser General Public | 7 | * modify it under the terms of the GNU Lesser General Public | ||
7 | * License as published by the Free Software Foundation; either | 8 | * License as published by the Free Software Foundation; either | ||
8 | * version 2.1 of the License, or (at your option) any later version. | 9 | * version 2.1 of the License, or (at your option) any later version. | ||
9 | * | 10 | * | ||
10 | * This library is distributed in the hope that it will be useful, | 11 | * This library is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
Show All 32 Lines | 38 | { | |||
44 | Q_PROPERTY(bool ItemIsMenu READ ItemIsMenu) | 45 | Q_PROPERTY(bool ItemIsMenu READ ItemIsMenu) | ||
45 | Q_PROPERTY(KDbusImageVector IconPixmap READ IconPixmap) | 46 | Q_PROPERTY(KDbusImageVector IconPixmap READ IconPixmap) | ||
46 | 47 | | |||
47 | public: | 48 | public: | ||
48 | explicit SNIProxy(xcb_window_t wid, QObject *parent = nullptr); | 49 | explicit SNIProxy(xcb_window_t wid, QObject *parent = nullptr); | ||
49 | ~SNIProxy() override; | 50 | ~SNIProxy() override; | ||
50 | 51 | | |||
51 | void update(); | 52 | void update(); | ||
52 | void stackContainerWindow(const uint32_t stackMode) const; | | |||
53 | void resizeWindow(const uint16_t width, const uint16_t height) const; | 53 | void resizeWindow(const uint16_t width, const uint16_t height) const; | ||
54 | void hideContainerWindow(xcb_window_t windowId) const; | ||||
54 | 55 | | |||
55 | /** | 56 | /** | ||
56 | * @return the category of the application associated to this item | 57 | * @return the category of the application associated to this item | ||
57 | * @see Category | 58 | * @see Category | ||
58 | */ | 59 | */ | ||
59 | QString Category() const; | 60 | QString Category() const; | ||
60 | 61 | | |||
61 | /** | 62 | /** | ||
▲ Show 20 Lines • Show All 87 Lines • ▼ Show 20 Line(s) | 146 | private: | |||
149 | }; | 150 | }; | ||
150 | 151 | | |||
151 | QSize calculateClientWindowSize() const; | 152 | QSize calculateClientWindowSize() const; | ||
152 | void sendClick(uint8_t mouseButton, int x, int y); | 153 | void sendClick(uint8_t mouseButton, int x, int y); | ||
153 | QImage getImageNonComposite() const; | 154 | QImage getImageNonComposite() const; | ||
154 | bool isTransparentImage(const QImage &image) const; | 155 | bool isTransparentImage(const QImage &image) const; | ||
155 | QImage convertFromNative(xcb_image_t *xcbImage) const; | 156 | QImage convertFromNative(xcb_image_t *xcbImage) const; | ||
156 | QPoint calculateClickPoint() const; | 157 | QPoint calculateClickPoint() const; | ||
158 | void stackContainerWindow(const uint32_t stackMode) const; | ||||
157 | 159 | | |||
158 | QDBusConnection m_dbus; | 160 | QDBusConnection m_dbus; | ||
159 | xcb_window_t m_windowId; | 161 | xcb_window_t m_windowId; | ||
160 | xcb_window_t m_containerWid; | 162 | xcb_window_t m_containerWid; | ||
161 | static int s_serviceCount; | 163 | static int s_serviceCount; | ||
162 | QPixmap m_pixmap; | 164 | QPixmap m_pixmap; | ||
163 | 165 | bool sendingClickEvent; | |||
164 | InjectMode m_injectMode; | 166 | InjectMode m_injectMode; | ||
165 | }; | 167 | }; | ||
166 | 168 | | |||
167 | #endif // SNIPROXY_H | 169 | #endif // SNIPROXY_H |