Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
KWin
Commits
a7f7a5fb
Commit
a7f7a5fb
authored
Nov 03, 2020
by
Vlad Zahorodnii
Browse files
Port relative-pointer-v1 interface to the new design
parent
9bf4b6b6
Changes
13
Hide whitespace changes
Inline
Side-by-side
src/wayland/CMakeLists.txt
View file @
a7f7a5fb
...
...
@@ -46,8 +46,7 @@ set(SERVER_LIB_SRCS
primaryselectionoffer_v1_interface.cpp
primaryselectionsource_v1_interface.cpp
region_interface.cpp
relativepointer_interface.cpp
relativepointer_interface_v1.cpp
relativepointer_v1_interface.cpp
resource.cpp
screencast_v1_interface.cpp
seat_interface.cpp
...
...
@@ -142,9 +141,9 @@ ecm_add_qtwayland_server_protocol(SERVER_LIB_SRCS
BASENAME contrast
)
ecm_add_wayland_server_protocol
(
SERVER_LIB_SRCS
ecm_add_
qt
wayland_server_protocol
(
SERVER_LIB_SRCS
PROTOCOL
${
WaylandProtocols_DATADIR
}
/unstable/relative-pointer/relative-pointer-unstable-v1.xml
BASENAME relativepointer-unstable-v1
BASENAME relative
-
pointer-unstable-v1
)
ecm_add_wayland_server_protocol
(
SERVER_LIB_SRCS
...
...
@@ -415,7 +414,7 @@ set(SERVER_LIB_HEADERS
pointergestures_interface.h
primaryselectiondevicemanager_v1_interface.h
region_interface.h
relativepointer_interface.h
relativepointer_
v1_
interface.h
resource.h
screencast_v1_interface.h
seat_interface.h
...
...
src/wayland/autotests/client/test_wayland_seat.cpp
View file @
a7f7a5fb
...
...
@@ -31,7 +31,7 @@
#include
"../../src/server/keyboard_interface.h"
#include
"../../src/server/pointer_interface.h"
#include
"../../src/server/pointergestures_interface.h"
#include
"../../src/server/relativepointer_interface.h"
#include
"../../src/server/relativepointer_
v1_
interface.h"
#include
"../../src/server/seat_interface.h"
#include
"../../src/server/subcompositor_interface.h"
#include
"../../src/server/surface_interface.h"
...
...
@@ -83,7 +83,7 @@ private:
KWaylandServer
::
CompositorInterface
*
m_compositorInterface
;
KWaylandServer
::
SeatInterface
*
m_seatInterface
;
KWaylandServer
::
SubCompositorInterface
*
m_subCompositorInterface
;
KWaylandServer
::
RelativePointerManagerInterface
*
m_relativePointerManagerInterface
;
KWaylandServer
::
RelativePointerManager
V1
Interface
*
m_relativePointerManager
V1
Interface
;
KWaylandServer
::
PointerGesturesInterface
*
m_pointerGesturesInterface
;
KWayland
::
Client
::
ConnectionThread
*
m_connection
;
KWayland
::
Client
::
Compositor
*
m_compositor
;
...
...
@@ -104,7 +104,7 @@ TestWaylandSeat::TestWaylandSeat(QObject *parent)
,
m_compositorInterface
(
nullptr
)
,
m_seatInterface
(
nullptr
)
,
m_subCompositorInterface
(
nullptr
)
,
m_relativePointerManagerInterface
(
nullptr
)
,
m_relativePointerManager
V1
Interface
(
nullptr
)
,
m_pointerGesturesInterface
(
nullptr
)
,
m_connection
(
nullptr
)
,
m_compositor
(
nullptr
)
...
...
@@ -132,11 +132,7 @@ void TestWaylandSeat::init()
m_subCompositorInterface
=
m_display
->
createSubCompositor
(
m_display
);
QVERIFY
(
m_subCompositorInterface
);
m_relativePointerManagerInterface
=
m_display
->
createRelativePointerManager
(
RelativePointerInterfaceVersion
::
UnstableV1
,
m_display
);
QVERIFY
(
m_relativePointerManagerInterface
);
m_relativePointerManagerInterface
->
create
();
QVERIFY
(
m_relativePointerManagerInterface
->
isValid
());
m_relativePointerManagerV1Interface
=
m_display
->
createRelativePointerManagerV1
(
m_display
);
m_pointerGesturesInterface
=
m_display
->
createPointerGestures
(
PointerGesturesInterfaceVersion
::
UnstableV1
,
m_display
);
QVERIFY
(
m_pointerGesturesInterface
);
m_pointerGesturesInterface
->
create
();
...
...
@@ -252,8 +248,8 @@ void TestWaylandSeat::cleanup()
delete
m_subCompositorInterface
;
m_subCompositorInterface
=
nullptr
;
delete
m_relativePointerManagerInterface
;
m_relativePointerManagerInterface
=
nullptr
;
delete
m_relativePointerManager
V1
Interface
;
m_relativePointerManager
V1
Interface
=
nullptr
;
delete
m_pointerGesturesInterface
;
m_pointerGesturesInterface
=
nullptr
;
...
...
@@ -1740,7 +1736,7 @@ void TestWaylandSeat::testDestroy()
m_compositorInterface
=
nullptr
;
m_seatInterface
=
nullptr
;
m_subCompositorInterface
=
nullptr
;
m_relativePointerManagerInterface
=
nullptr
;
m_relativePointerManager
V1
Interface
=
nullptr
;
m_pointerGesturesInterface
=
nullptr
;
QVERIFY
(
connectionDiedSpy
.
wait
());
...
...
src/wayland/display.cpp
View file @
a7f7a5fb
...
...
@@ -31,7 +31,7 @@
#include
"pointerconstraints_interface_p.h"
#include
"pointergestures_interface_p.h"
#include
"primaryselectiondevicemanager_v1_interface.h"
#include
"relativepointer_interface
_p
.h"
#include
"relativepointer_
v1_
interface.h"
#include
"seat_interface.h"
#include
"screencast_v1_interface.h"
#include
"server_decoration_interface.h"
...
...
@@ -366,14 +366,9 @@ XdgShellInterface *Display::createXdgShell(QObject *parent)
return
shell
;
}
RelativePointerManagerInterface
*
Display
::
createRelativePointerManager
(
const
RelativePointerInterfaceVersion
&
version
,
QObject
*
parent
)
RelativePointerManager
V1
Interface
*
Display
::
createRelativePointerManager
V1
(
QObject
*
parent
)
{
RelativePointerManagerInterface
*
r
=
nullptr
;
switch
(
version
)
{
case
RelativePointerInterfaceVersion
::
UnstableV1
:
r
=
new
RelativePointerManagerUnstableV1Interface
(
this
,
parent
);
break
;
}
RelativePointerManagerV1Interface
*
r
=
new
RelativePointerManagerV1Interface
(
this
,
parent
);
connect
(
this
,
&
Display
::
aboutToTerminate
,
r
,
[
r
]
{
delete
r
;
});
return
r
;
}
...
...
src/wayland/display.h
View file @
a7f7a5fb
...
...
@@ -57,8 +57,7 @@ class SubCompositorInterface;
class
TextInputManagerV2Interface
;
class
TextInputManagerV3Interface
;
class
XdgShellInterface
;
enum
class
RelativePointerInterfaceVersion
;
class
RelativePointerManagerInterface
;
class
RelativePointerManagerV1Interface
;
enum
class
PointerGesturesInterfaceVersion
;
class
PointerGesturesInterface
;
enum
class
PointerConstraintsInterfaceVersion
;
...
...
@@ -214,12 +213,12 @@ public:
XdgShellInterface
*
createXdgShell
(
QObject
*
parent
=
nullptr
);
/**
* Creates the RelativePointerManagerInterface
in interface @p version
* Creates the RelativePointerManager
V1
Interface
*
* @returns The created manager object
* @since 5.28
**/
RelativePointerManagerInterface
*
createRelativePointerManager
(
const
RelativePointerInterfaceVersion
&
version
,
QObject
*
parent
=
nullptr
);
RelativePointerManager
V1
Interface
*
createRelativePointerManager
V1
(
QObject
*
parent
=
nullptr
);
/**
* Creates the PointerGesturesInterface in interface @p version
...
...
src/wayland/pointer_interface.cpp
View file @
a7f7a5fb
...
...
@@ -8,7 +8,7 @@
#include
"pointerconstraints_interface.h"
#include
"pointergestures_interface_p.h"
#include
"resource_p.h"
#include
"relativepointer_interface_p.h"
#include
"relativepointer_
v1_
interface_p.h"
#include
"seat_interface.h"
#include
"display.h"
#include
"subcompositor_interface.h"
...
...
@@ -64,16 +64,17 @@ void PointerInterface::Private::sendLeave(SurfaceInterface *surface, quint32 ser
}
}
void
PointerInterface
::
Private
::
registerRelativePointer
(
RelativePointerInterface
*
relativePointer
)
void
PointerInterface
::
Private
::
registerRelativePointer
V1
(
RelativePointer
V1
Interface
*
relativePointer
)
{
relativePointers
<<
relativePointer
;
QObject
::
connect
(
relativePointer
,
&
QObject
::
destroyed
,
q
,
[
this
,
relativePointer
]
{
relativePointers
.
removeOne
(
relativePointer
);
}
);
Q_ASSERT
(
!
relativePointersV1
.
contains
(
relativePointer
));
relativePointersV1
.
append
(
relativePointer
);
}
void
PointerInterface
::
Private
::
unregisterRelativePointerV1
(
RelativePointerV1Interface
*
relativePointer
)
{
Q_ASSERT
(
relativePointersV1
.
contains
(
relativePointer
));
relativePointersV1
.
removeOne
(
relativePointer
);
}
void
PointerInterface
::
Private
::
registerSwipeGesture
(
PointerSwipeGestureInterface
*
gesture
)
{
...
...
@@ -383,11 +384,15 @@ Cursor *PointerInterface::cursor() const
void
PointerInterface
::
relativeMotion
(
const
QSizeF
&
delta
,
const
QSizeF
&
deltaNonAccelerated
,
quint64
microseconds
)
{
Q_D
();
if
(
d
->
relativePointers
.
isEmpty
())
{
if
(
d
->
relativePointers
V1
.
isEmpty
())
{
return
;
}
for
(
auto
it
=
d
->
relativePointers
.
constBegin
(),
end
=
d
->
relativePointers
.
constEnd
();
it
!=
end
;
it
++
)
{
(
*
it
)
->
relativeMotion
(
delta
,
deltaNonAccelerated
,
microseconds
);
for
(
RelativePointerV1Interface
*
relativePointer
:
qAsConst
(
d
->
relativePointersV1
))
{
relativePointer
->
send_relative_motion
(
microseconds
>>
32
,
microseconds
&
0xffffffff
,
wl_fixed_from_double
(
delta
.
width
()),
wl_fixed_from_double
(
delta
.
height
()),
wl_fixed_from_double
(
deltaNonAccelerated
.
width
()),
wl_fixed_from_double
(
deltaNonAccelerated
.
height
()));
}
d
->
sendFrame
();
}
...
...
src/wayland/pointer_interface.h
View file @
a7f7a5fb
...
...
@@ -15,7 +15,6 @@ namespace KWaylandServer
class
Cursor
;
class
PointerGesturesUnstableV1Interface
;
class
RelativePointerManagerUnstableV1Interface
;
class
SeatInterface
;
class
SurfaceInterface
;
...
...
@@ -63,7 +62,7 @@ private:
void
axis
(
Qt
::
Orientation
orientation
,
quint32
delta
);
void
relativeMotion
(
const
QSizeF
&
delta
,
const
QSizeF
&
deltaNonAccelerated
,
quint64
microseconds
);
friend
class
SeatInterface
;
friend
class
RelativePointer
ManagerUnstable
V1Interface
;
friend
class
RelativePointerV1Interface
;
friend
class
PointerGesturesUnstableV1Interface
;
explicit
PointerInterface
(
SeatInterface
*
parent
,
wl_resource
*
parentResource
);
class
Private
;
...
...
src/wayland/pointer_interface_p.h
View file @
a7f7a5fb
...
...
@@ -15,7 +15,7 @@ namespace KWaylandServer
{
class
PointerPinchGestureInterface
;
class
PointerSwipeGestureInterface
;
class
RelativePointerInterface
;
class
RelativePointer
V1
Interface
;
class
PointerInterface
::
Private
:
public
Resource
::
Private
{
...
...
@@ -27,7 +27,7 @@ public:
QPointer
<
SurfaceInterface
>
focusedChildSurface
;
QMetaObject
::
Connection
destroyConnection
;
Cursor
*
cursor
=
nullptr
;
QVector
<
RelativePointerInterface
*>
relativePointers
;
QVector
<
RelativePointer
V1
Interface
*>
relativePointers
V1
;
QVector
<
PointerSwipeGestureInterface
*>
swipeGestures
;
QVector
<
PointerPinchGestureInterface
*>
pinchGestures
;
...
...
@@ -35,10 +35,12 @@ public:
void
sendEnter
(
SurfaceInterface
*
surface
,
const
QPointF
&
parentSurfacePosition
,
quint32
serial
);
void
sendFrame
();
void
registerRelativePointer
(
RelativePointerInterface
*
relativePointer
);
void
registerRelativePointer
V1
(
RelativePointer
V1
Interface
*
relativePointer
);
void
registerSwipeGesture
(
PointerSwipeGestureInterface
*
gesture
);
void
registerPinchGesture
(
PointerPinchGestureInterface
*
gesture
);
void
unregisterRelativePointerV1
(
RelativePointerV1Interface
*
relativePointer
);
void
startSwipeGesture
(
quint32
serial
,
quint32
fingerCount
);
void
updateSwipeGesture
(
const
QSizeF
&
delta
);
void
endSwipeGesture
(
quint32
serial
);
...
...
src/wayland/relativepointer_v1_interface.cpp
0 → 100644
View file @
a7f7a5fb
/*
SPDX-FileCopyrightText: 2016 Martin Gräßlin <mgraesslin@kde.org>
SPDX-FileCopyrightText: 2020 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#include
"relativepointer_v1_interface.h"
#include
"display.h"
#include
"pointer_interface_p.h"
#include
"relativepointer_v1_interface_p.h"
namespace
KWaylandServer
{
static
const
int
s_version
=
1
;
RelativePointerManagerV1InterfacePrivate
::
RelativePointerManagerV1InterfacePrivate
(
Display
*
display
)
:
QtWaylandServer
::
zwp_relative_pointer_manager_v1
(
*
display
,
s_version
)
{
}
void
RelativePointerManagerV1InterfacePrivate
::
zwp_relative_pointer_manager_v1_destroy
(
Resource
*
resource
)
{
wl_resource_destroy
(
resource
->
handle
);
}
void
RelativePointerManagerV1InterfacePrivate
::
zwp_relative_pointer_manager_v1_get_relative_pointer
(
Resource
*
resource
,
uint32_t
id
,
struct
::
wl_resource
*
pointer_resource
)
{
PointerInterface
*
pointer
=
PointerInterface
::
get
(
pointer_resource
);
if
(
!
pointer
)
{
wl_resource_post_error
(
resource
->
handle
,
WL_DISPLAY_ERROR_INVALID_OBJECT
,
"invalid pointer"
);
return
;
}
wl_resource
*
relativePointerResource
=
wl_resource_create
(
resource
->
client
(),
&
zwp_relative_pointer_v1_interface
,
resource
->
version
(),
id
);
if
(
!
relativePointerResource
)
{
wl_resource_post_no_memory
(
resource
->
handle
);
return
;
}
new
RelativePointerV1Interface
(
pointer
,
relativePointerResource
);
}
RelativePointerManagerV1Interface
::
RelativePointerManagerV1Interface
(
Display
*
display
,
QObject
*
parent
)
:
QObject
(
parent
)
,
d
(
new
RelativePointerManagerV1InterfacePrivate
(
display
))
{
}
RelativePointerManagerV1Interface
::~
RelativePointerManagerV1Interface
()
{
}
RelativePointerV1Interface
::
RelativePointerV1Interface
(
PointerInterface
*
pointer
,
::
wl_resource
*
resource
)
:
QtWaylandServer
::
zwp_relative_pointer_v1
(
resource
)
,
pointer
(
pointer
)
{
pointer
->
d_func
()
->
registerRelativePointerV1
(
this
);
}
RelativePointerV1Interface
::~
RelativePointerV1Interface
()
{
if
(
pointer
)
{
pointer
->
d_func
()
->
unregisterRelativePointerV1
(
this
);
}
}
void
RelativePointerV1Interface
::
zwp_relative_pointer_v1_destroy_resource
(
Resource
*
resource
)
{
Q_UNUSED
(
resource
)
delete
this
;
}
void
RelativePointerV1Interface
::
zwp_relative_pointer_v1_destroy
(
Resource
*
resource
)
{
wl_resource_destroy
(
resource
->
handle
);
}
}
// namespace KWaylandServer
src/wayland/
server/
relativepointer_interface.h
→
src/wayland/relativepointer_
v1_
interface.h
View file @
a7f7a5fb
/*
SPDX-FileCopyrightText: 2016 Martin Gräßlin <mgraesslin@kde.org>
SPDX-FileCopyrightText: 2020 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#ifndef KWAYLAND_SERVER_RELATIVE_POINTER_INTERFACE_H
#define KWAYLAND_SERVER_RELATIVE_POINTER_INTERFACE_H
#
include
"global.h"
#
pragma once
#include
<KWaylandServer/kwaylandserver_export.h>
#include
<QObject>
namespace
KWaylandServer
{
class
Display
;
enum
class
RelativePointerInterfaceVersion
{
/**
* zwp_relative_pointer_manager_v1 and zwp_relative_pointer_v1
**/
UnstableV1
};
class
RelativePointerManagerV1InterfacePrivate
;
/**
* Manager object to create relative pointer interfaces.
...
...
@@ -28,29 +23,17 @@ enum class RelativePointerInterfaceVersion {
* Once created the interaction happens through the SeatInterface class
* which automatically delegates relative motion events to the created relative pointer
* interfaces.
*
* @see SeatInterface::relativePointerMotion
* @since 5.28
**/
class
KWAYLANDSERVER_EXPORT
RelativePointerManagerInterface
:
public
Global
*/
class
KWAYLANDSERVER_EXPORT
RelativePointerManagerV1Interface
:
public
QObject
{
Q_OBJECT
public:
virtual
~
RelativePointerManagerInterface
();
/**
* @returns The interface version used by this RelativePointerManagerInterface
**/
RelativePointerInterfaceVersion
interfaceVersion
()
const
;
p
rotected
:
class
Private
;
explicit
RelativePointerManagerInterface
(
Private
*
d
,
QObject
*
parent
=
nullptr
)
;
p
ublic
:
explicit
RelativePointerManagerV1Interface
(
Display
*
display
,
QObject
*
parent
=
nullptr
)
;
~
RelativePointerManager
V1
Interface
(
)
override
;
private:
Private
*
d_func
()
const
;
QScopedPointer
<
RelativePointerManagerV1InterfacePrivate
>
d
;
};
}
#endif
}
// namespace KWaylandServer
src/wayland/relativepointer_v1_interface_p.h
0 → 100644
View file @
a7f7a5fb
/*
SPDX-FileCopyrightText: 2016 Martin Gräßlin <mgraesslin@kde.org>
SPDX-FileCopyrightText: 2020 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#pragma once
#include
"qwayland-server-relative-pointer-unstable-v1.h"
#include
<QPointer>
namespace
KWaylandServer
{
class
Display
;
class
PointerInterface
;
class
RelativePointerManagerV1InterfacePrivate
:
public
QtWaylandServer
::
zwp_relative_pointer_manager_v1
{
public:
explicit
RelativePointerManagerV1InterfacePrivate
(
Display
*
display
);
protected:
void
zwp_relative_pointer_manager_v1_destroy
(
Resource
*
resource
)
override
;
void
zwp_relative_pointer_manager_v1_get_relative_pointer
(
Resource
*
resource
,
uint32_t
id
,
struct
::
wl_resource
*
pointer_resource
)
override
;
};
class
RelativePointerV1Interface
:
public
QtWaylandServer
::
zwp_relative_pointer_v1
{
public:
RelativePointerV1Interface
(
PointerInterface
*
pointer
,
::
wl_resource
*
resource
);
~
RelativePointerV1Interface
()
override
;
QPointer
<
PointerInterface
>
pointer
;
protected:
void
zwp_relative_pointer_v1_destroy_resource
(
Resource
*
resource
)
override
;
void
zwp_relative_pointer_v1_destroy
(
Resource
*
resource
)
override
;
};
}
// namespace KWaylandServer
src/wayland/server/relativepointer_interface.cpp
deleted
100644 → 0
View file @
9bf4b6b6
/*
SPDX-FileCopyrightText: 2016 Martin Gräßlin <mgraesslin@kde.org>
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#include
"relativepointer_interface_p.h"
namespace
KWaylandServer
{
RelativePointerManagerInterface
::
Private
::
Private
(
RelativePointerInterfaceVersion
interfaceVersion
,
RelativePointerManagerInterface
*
q
,
Display
*
d
,
const
wl_interface
*
interface
,
quint32
version
)
:
Global
::
Private
(
d
,
interface
,
version
)
,
interfaceVersion
(
interfaceVersion
)
,
q
(
q
)
{
}
RelativePointerManagerInterface
::
RelativePointerManagerInterface
(
Private
*
d
,
QObject
*
parent
)
:
Global
(
d
,
parent
)
{
}
RelativePointerManagerInterface
::~
RelativePointerManagerInterface
()
=
default
;
RelativePointerInterfaceVersion
RelativePointerManagerInterface
::
interfaceVersion
()
const
{
Q_D
();
return
d
->
interfaceVersion
;
}
RelativePointerManagerInterface
::
Private
*
RelativePointerManagerInterface
::
d_func
()
const
{
return
reinterpret_cast
<
Private
*>
(
d
.
data
());
}
RelativePointerInterface
::
Private
::
Private
(
RelativePointerInterface
*
q
,
Global
*
c
,
wl_resource
*
parentResource
,
const
wl_interface
*
interface
,
const
void
*
implementation
)
:
Resource
::
Private
(
q
,
c
,
parentResource
,
interface
,
implementation
)
{
}
RelativePointerInterface
::
Private
::~
Private
()
{
if
(
resource
)
{
wl_resource_destroy
(
resource
);
resource
=
nullptr
;
}
}
RelativePointerInterface
::
RelativePointerInterface
(
Private
*
p
,
QObject
*
parent
)
:
Resource
(
p
,
parent
)
{
}
RelativePointerInterface
::~
RelativePointerInterface
()
=
default
;
void
RelativePointerInterface
::
relativeMotion
(
const
QSizeF
&
delta
,
const
QSizeF
&
deltaNonAccelerated
,
quint64
microseconds
)
{
Q_D
();
d
->
relativeMotion
(
delta
,
deltaNonAccelerated
,
microseconds
);
}
RelativePointerInterface
::
Private
*
RelativePointerInterface
::
d_func
()
const
{
return
reinterpret_cast
<
Private
*>
(
d
.
data
());
}
}
src/wayland/server/relativepointer_interface_p.h
deleted
100644 → 0
View file @
9bf4b6b6
/*
SPDX-FileCopyrightText: 2016 Martin Gräßlin <mgraesslin@kde.org>
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#ifndef KWAYLAND_SERVER_RELATIVEPOINTER_INTERFACE_P_H
#define KWAYLAND_SERVER_RELATIVEPOINTER_INTERFACE_P_H
#include
"relativepointer_interface.h"
#include
"resource_p.h"
#include
"global_p.h"
namespace
KWaylandServer
{
class
RelativePointerManagerInterface
::
Private
:
public
Global
::
Private
{
public:
RelativePointerInterfaceVersion
interfaceVersion
;
protected:
Private
(
RelativePointerInterfaceVersion
interfaceVersion
,
RelativePointerManagerInterface
*
q
,
Display
*
d
,
const
wl_interface
*
interface
,
quint32
version
);
RelativePointerManagerInterface
*
q
;
};
class
RelativePointerManagerUnstableV1Interface
:
public
RelativePointerManagerInterface
{
Q_OBJECT
public:
explicit
RelativePointerManagerUnstableV1Interface
(
Display
*
display
,
QObject
*
parent
=
nullptr
);
virtual
~
RelativePointerManagerUnstableV1Interface
();
private:
class
Private
;
};
class
RelativePointerInterface
:
public
Resource
{
Q_OBJECT
public:
virtual
~
RelativePointerInterface
();
void
relativeMotion
(
const
QSizeF
&
delta
,
const
QSizeF
&
deltaNonAccelerated
,
quint64
microseconds
);
protected:
class
Private
;
explicit
RelativePointerInterface
(
Private
*
p
,
QObject
*
parent
=
nullptr
);
private:
Private
*
d_func
()
const
;
};
class
RelativePointerInterface
::
Private
:
public
Resource
::
Private
{
public:
~
Private
();
virtual
void
relativeMotion
(
const
QSizeF
&
delta
,
const
QSizeF
&
deltaNonAccelerated
,
quint64
microseconds
)
=
0
;
protected:
Private
(
RelativePointerInterface
*
q
,
Global
*
c
,
wl_resource
*
parentResource
,
const
wl_interface
*
interface
,
const
void
*
implementation
);
private:
RelativePointerInterface
*
q_func
()
{
return
reinterpret_cast
<
RelativePointerInterface
*>
(
q
);
}
};
class
RelativePointerUnstableV1Interface
:
public
RelativePointerInterface
{
Q_OBJECT
public:
virtual
~
RelativePointerUnstableV1Interface
();
private:
explicit
RelativePointerUnstableV1Interface
(
RelativePointerManagerUnstableV1Interface
*
parent
,
wl_resource
*
parentResource
);
friend
class
RelativePointerManagerUnstableV1Interface
;
class
Private
;
Private
*
d_func
()
const
;
};
}
#endif
src/wayland/server/relativepointer_interface_v1.cpp
deleted
100644 → 0
View file @
9bf4b6b6
/*
SPDX-FileCopyrightText: 2016 Martin Gräßlin <mgraesslin@kde.org>
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#include
"relativepointer_interface_p.h"
#include
"display.h"
#include
"pointer_interface_p.h"
#include
<wayland-relativepointer-unstable-v1-server-protocol.h>
#include
<QSizeF>
namespace
KWaylandServer
{
class
RelativePointerManagerUnstableV1Interface
::
Private
:
public
RelativePointerManagerInterface
::
Private
{