Changeset View
Changeset View
Standalone View
Standalone View
src/server/xdgshell_interface_p.h
Show All 18 Lines | |||||
19 | ****************************************************************************/ | 19 | ****************************************************************************/ | ||
20 | #ifndef KWAYLAND_SERVER_XDGSHELL_INTERFACE_P_H | 20 | #ifndef KWAYLAND_SERVER_XDGSHELL_INTERFACE_P_H | ||
21 | #define KWAYLAND_SERVER_XDGSHELL_INTERFACE_P_H | 21 | #define KWAYLAND_SERVER_XDGSHELL_INTERFACE_P_H | ||
22 | #include "xdgshell_interface.h" | 22 | #include "xdgshell_interface.h" | ||
23 | #include "global_p.h" | 23 | #include "global_p.h" | ||
24 | #include "generic_shell_surface_p.h" | 24 | #include "generic_shell_surface_p.h" | ||
25 | #include "resource_p.h" | 25 | #include "resource_p.h" | ||
26 | 26 | | |||
27 | #include <QTimer> | ||||
28 | | ||||
27 | namespace KWayland | 29 | namespace KWayland | ||
28 | { | 30 | { | ||
29 | namespace Server | 31 | namespace Server | ||
30 | { | 32 | { | ||
31 | 33 | | |||
32 | class XdgShellInterface::Private : public Global::Private | 34 | class XdgShellInterface::Private : public Global::Private | ||
33 | { | 35 | { | ||
34 | public: | 36 | public: | ||
35 | XdgShellInterfaceVersion interfaceVersion; | 37 | XdgShellInterfaceVersion interfaceVersion; | ||
36 | 38 | | |||
39 | virtual quint32 ping() = 0; | ||||
40 | void setupTimer(quint32 serial); | ||||
41 | //pingserial/timer correspondence | ||||
davidedmundson: I don't understand this timer, all it's used for is for making us not emit a pong if it comes… | |||||
send ping, if a pong doesn't arrive after a timeout, consider it dead.. I copied it as-is from wl_shell iirc, so assumed this would be the expected behavior. mart: send ping, if a pong doesn't arrive after a timeout, consider it dead.. I copied it as-is from… | |||||
42 | QHash <quint32, QTimer *> pingTimers; | ||||
43 | | ||||
37 | protected: | 44 | protected: | ||
38 | Private(XdgShellInterfaceVersion interfaceVersion, XdgShellInterface *q, Display *d, const wl_interface *interface, quint32 version); | 45 | Private(XdgShellInterfaceVersion interfaceVersion, XdgShellInterface *q, Display *d, const wl_interface *interface, quint32 version); | ||
39 | XdgShellInterface *q; | 46 | XdgShellInterface *q; | ||
40 | }; | 47 | }; | ||
41 | 48 | | |||
42 | class XdgShellSurfaceInterface::Private : public Resource::Private, public GenericShellSurface<XdgShellSurfaceInterface> | 49 | class XdgShellSurfaceInterface::Private : public Resource::Private, public GenericShellSurface<XdgShellSurfaceInterface> | ||
43 | { | 50 | { | ||
44 | public: | 51 | public: | ||
45 | virtual ~Private(); | 52 | virtual ~Private(); | ||
46 | 53 | | |||
47 | virtual void close() = 0; | 54 | virtual void close() = 0; | ||
48 | virtual quint32 configure(States states, const QSize &size) = 0; | 55 | virtual quint32 configure(States states, const QSize &size) = 0; | ||
49 | 56 | | |||
50 | XdgShellSurfaceInterface *q_func() { | 57 | XdgShellSurfaceInterface *q_func() { | ||
51 | return reinterpret_cast<XdgShellSurfaceInterface *>(q); | 58 | return reinterpret_cast<XdgShellSurfaceInterface *>(q); | ||
52 | } | 59 | } | ||
53 | 60 | | |||
54 | QVector<quint32> configureSerials; | 61 | QVector<quint32> configureSerials; | ||
55 | QPointer<XdgShellSurfaceInterface> parent; | 62 | QPointer<XdgShellSurfaceInterface> parent; | ||
56 | XdgShellInterfaceVersion interfaceVersion; | 63 | XdgShellInterfaceVersion interfaceVersion; | ||
57 | 64 | | |||
58 | protected: | 65 | protected: | ||
59 | Private(XdgShellInterfaceVersion interfaceVersion, XdgShellSurfaceInterface *q, XdgShellInterface *c, SurfaceInterface *surface, wl_resource *parentResource, const wl_interface *interface, const void *implementation); | 66 | Private(XdgShellInterfaceVersion interfaceVersion, XdgShellSurfaceInterface *q, Global *c, SurfaceInterface *surface, wl_resource *parentResource, const wl_interface *interface, const void *implementation); | ||
60 | | ||||
61 | }; | 67 | }; | ||
62 | 68 | | |||
63 | class XdgShellPopupInterface::Private : public Resource::Private, public GenericShellSurface<XdgShellPopupInterface> | 69 | class XdgShellPopupInterface::Private : public Resource::Private, public GenericShellSurface<XdgShellPopupInterface> | ||
64 | { | 70 | { | ||
65 | public: | 71 | public: | ||
66 | virtual ~Private(); | 72 | virtual ~Private(); | ||
67 | virtual void popupDone() = 0; | 73 | virtual void popupDone() = 0; | ||
68 | 74 | | |||
69 | XdgShellPopupInterface *q_func() { | 75 | XdgShellPopupInterface *q_func() { | ||
70 | return reinterpret_cast<XdgShellPopupInterface *>(q); | 76 | return reinterpret_cast<XdgShellPopupInterface *>(q); | ||
71 | } | 77 | } | ||
72 | 78 | | |||
79 | virtual quint32 configure(const QRect &rect) { | ||||
80 | Q_UNUSED(rect) | ||||
81 | return 0; | ||||
82 | }; | ||||
83 | | ||||
84 | QVector<quint32> configureSerials; | ||||
73 | QPointer<SurfaceInterface> parent; | 85 | QPointer<SurfaceInterface> parent; | ||
74 | QPoint transientOffset; | 86 | QSize initialSize; | ||
87 | | ||||
88 | /* | ||||
89 | * | ||||
90 | */ | ||||
91 | QRect anchorRect; | ||||
92 | Qt::Edges anchorEdge; | ||||
93 | Qt::Edges gravity; | ||||
94 | PositionerConstraints constraintAdjustments; | ||||
95 | QPoint anchorOffset; | ||||
96 | | ||||
75 | XdgShellInterfaceVersion interfaceVersion; | 97 | XdgShellInterfaceVersion interfaceVersion; | ||
76 | 98 | | |||
77 | protected: | 99 | protected: | ||
78 | Private(XdgShellInterfaceVersion interfaceVersion, XdgShellPopupInterface *q, XdgShellInterface *c, SurfaceInterface *surface, wl_resource *parentResource, const wl_interface *interface, const void *implementation); | 100 | Private(XdgShellInterfaceVersion interfaceVersion, XdgShellPopupInterface *q, XdgShellInterface *c, SurfaceInterface *surface, wl_resource *parentResource, const wl_interface *interface, const void *implementation); | ||
79 | 101 | | |||
80 | }; | 102 | }; | ||
81 | 103 | | |||
82 | } | 104 | } | ||
83 | } | 105 | } | ||
84 | 106 | | |||
85 | #endif | 107 | #endif |
I don't understand this timer, all it's used for is for making us not emit a pong if it comes in after a timeout?