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
KWayland Server
Commits
5121e2e7
Commit
5121e2e7
authored
Nov 04, 2020
by
Vlad Zahorodnii
Browse files
Get rid of private nested classes in tablet interfaces
With the new design, no private nested classes should be used.
parent
8eedb6d0
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/server/tablet_v2_interface.cpp
View file @
5121e2e7
...
...
@@ -12,14 +12,15 @@
#include
"qwayland-server-tablet-unstable-v2.h"
#include
<QHash>
using
namespace
KWaylandServer
;
namespace
KWaylandServer
{
static
int
s_version
=
1
;
class
TabletV2Interface
::
Private
:
public
QtWaylandServer
::
zwp_tablet_v2
class
TabletV2InterfacePrivate
:
public
QtWaylandServer
::
zwp_tablet_v2
{
public:
Private
(
TabletV2Interface
*
q
,
uint32_t
vendorId
,
uint32_t
productId
,
const
QString
name
,
const
QStringList
&
paths
)
TabletV2Interface
Private
(
TabletV2Interface
*
q
,
uint32_t
vendorId
,
uint32_t
productId
,
const
QString
name
,
const
QStringList
&
paths
)
:
zwp_tablet_v2
()
,
q
(
q
)
,
m_vendorId
(
vendorId
)
...
...
@@ -56,7 +57,7 @@ TabletV2Interface::TabletV2Interface(uint32_t vendorId, uint32_t productId,
const
QString
&
name
,
const
QStringList
&
paths
,
QObject
*
parent
)
:
QObject
(
parent
)
,
d
(
new
Private
(
this
,
vendorId
,
productId
,
name
,
paths
))
,
d
(
new
TabletV2Interface
Private
(
this
,
vendorId
,
productId
,
name
,
paths
))
{
}
...
...
@@ -75,10 +76,10 @@ void TabletV2Interface::sendRemoved()
}
}
class
TabletCursorV2
::
Private
class
TabletCursorV2Private
{
public:
Private
(
TabletCursorV2
*
q
)
:
q
(
q
)
{}
TabletCursorV2
Private
(
TabletCursorV2
*
q
)
:
q
(
q
)
{}
void
update
(
quint32
serial
,
SurfaceInterface
*
surface
,
const
QPoint
&
hotspot
)
{
...
...
@@ -99,7 +100,7 @@ public:
TabletCursorV2
::
TabletCursorV2
()
:
QObject
()
,
d
(
new
Private
(
this
))
,
d
(
new
TabletCursorV2
Private
(
this
))
{
}
...
...
@@ -120,11 +121,13 @@ SurfaceInterface *TabletCursorV2::surface() const
return
d
->
m_surface
;
}
class
TabletToolV2Interface
::
Private
:
public
QtWaylandServer
::
zwp_tablet_tool_v2
class
TabletToolV2InterfacePrivate
:
public
QtWaylandServer
::
zwp_tablet_tool_v2
{
public:
Private
(
TabletToolV2Interface
*
q
,
Display
*
display
,
Type
type
,
uint32_t
hsh
,
uint32_t
hsl
,
uint32_t
hih
,
uint32_t
hil
,
const
QVector
<
Capability
>&
capabilities
)
TabletToolV2InterfacePrivate
(
TabletToolV2Interface
*
q
,
Display
*
display
,
TabletToolV2Interface
::
Type
type
,
uint32_t
hsh
,
uint32_t
hsl
,
uint32_t
hih
,
uint32_t
hil
,
const
QVector
<
TabletToolV2Interface
::
Capability
>&
capabilities
)
:
zwp_tablet_tool_v2
()
,
m_display
(
display
)
,
m_type
(
type
)
...
...
@@ -183,7 +186,7 @@ public:
const
uint32_t
m_type
;
const
uint32_t
m_hardwareSerialHigh
,
m_hardwareSerialLow
;
const
uint32_t
m_hardwareIdHigh
,
m_hardwareIdLow
;
const
QVector
<
Capability
>
m_capabilities
;
const
QVector
<
TabletToolV2Interface
::
Capability
>
m_capabilities
;
QHash
<
wl_resource
*
,
TabletCursorV2
*>
m_cursors
;
TabletToolV2Interface
*
const
q
;
};
...
...
@@ -193,7 +196,7 @@ TabletToolV2Interface::TabletToolV2Interface(Display *display, Type type, uint32
const
QVector
<
Capability
>&
capabilities
,
QObject
*
parent
)
:
QObject
(
parent
)
,
d
(
new
Private
(
this
,
display
,
type
,
hsh
,
hsl
,
hih
,
hil
,
capabilities
))
,
d
(
new
TabletToolV2Interface
Private
(
this
,
display
,
type
,
hsh
,
hsl
,
hih
,
hil
,
capabilities
))
{
}
...
...
@@ -312,10 +315,10 @@ void TabletToolV2Interface::sendRemoved()
}
}
class
TabletSeatV2Interface
::
Private
:
public
QtWaylandServer
::
zwp_tablet_seat_v2
class
TabletSeatV2InterfacePrivate
:
public
QtWaylandServer
::
zwp_tablet_seat_v2
{
public:
Private
(
Display
*
display
,
TabletSeatV2Interface
*
q
)
TabletSeatV2Interface
Private
(
Display
*
display
,
TabletSeatV2Interface
*
q
)
:
zwp_tablet_seat_v2
()
,
q
(
q
)
,
m_display
(
display
)
...
...
@@ -371,7 +374,7 @@ public:
TabletSeatV2Interface
::
TabletSeatV2Interface
(
Display
*
display
,
QObject
*
parent
)
:
QObject
(
parent
)
,
d
(
new
Private
(
display
,
this
))
,
d
(
new
TabletSeatV2Interface
Private
(
display
,
this
))
{
}
...
...
@@ -445,10 +448,10 @@ TabletV2Interface *TabletSeatV2Interface::tabletByName(const QString &name) cons
return
d
->
m_tablets
.
value
(
name
);
}
class
TabletManagerV2Interface
::
Private
:
public
QtWaylandServer
::
zwp_tablet_manager_v2
class
TabletManagerV2InterfacePrivate
:
public
QtWaylandServer
::
zwp_tablet_manager_v2
{
public:
Private
(
Display
*
display
,
TabletManagerV2Interface
*
q
)
TabletManagerV2Interface
Private
(
Display
*
display
,
TabletManagerV2Interface
*
q
)
:
zwp_tablet_manager_v2
(
*
display
,
s_version
)
,
q
(
q
)
,
m_display
(
display
)
...
...
@@ -478,7 +481,7 @@ public:
TabletManagerV2Interface
::
TabletManagerV2Interface
(
Display
*
display
,
QObject
*
parent
)
:
QObject
(
parent
)
,
d
(
new
Private
(
display
,
this
))
,
d
(
new
TabletManagerV2Interface
Private
(
display
,
this
))
{
}
...
...
@@ -488,3 +491,5 @@ TabletSeatV2Interface *TabletManagerV2Interface::seat(SeatInterface *seat) const
}
TabletManagerV2Interface
::~
TabletManagerV2Interface
()
=
default
;
}
// namespace KWaylandServer
src/server/tablet_v2_interface.h
View file @
5121e2e7
...
...
@@ -14,12 +14,17 @@
namespace
KWaylandServer
{
class
TabletSeatV2Interface
;
class
Display
;
class
SeatInterface
;
class
SurfaceInterface
;
class
TabletV2Interface
;
class
TabletCursorV2
;
class
TabletCursorV2Private
;
class
TabletManagerV2InterfacePrivate
;
class
TabletSeatV2Interface
;
class
TabletSeatV2InterfacePrivate
;
class
TabletToolV2InterfacePrivate
;
class
TabletV2Interface
;
class
TabletV2InterfacePrivate
;
/**
* This is an implementation of wayland-protocols/unstable/tablet/tablet-unstable-v2.xml
...
...
@@ -41,8 +46,7 @@ public:
private:
friend
class
Display
;
explicit
TabletManagerV2Interface
(
Display
*
d
,
QObject
*
parent
);
class
Private
;
QScopedPointer
<
Private
>
d
;
QScopedPointer
<
TabletManagerV2InterfacePrivate
>
d
;
};
class
KWAYLANDSERVER_EXPORT
TabletToolV2Interface
:
public
QObject
...
...
@@ -103,10 +107,10 @@ Q_SIGNALS:
void
cursorChanged
(
TabletCursorV2
*
cursor
)
const
;
private:
friend
class
TabletSeatV2InterfacePrivate
;
friend
class
TabletSeatV2Interface
;
explicit
TabletToolV2Interface
(
Display
*
display
,
Type
type
,
quint32
hsh
,
quint32
hsl
,
quint32
hih
,
quint32
hil
,
const
QVector
<
Capability
>
&
capability
,
QObject
*
parent
);
class
Private
;
QScopedPointer
<
Private
>
d
;
QScopedPointer
<
TabletToolV2InterfacePrivate
>
d
;
};
class
KWAYLANDSERVER_EXPORT
TabletCursorV2
:
public
QObject
...
...
@@ -122,10 +126,9 @@ Q_SIGNALS:
void
changed
();
private:
friend
class
TabletToolV2Interface
;
TabletCursorV2
();
c
lass
Private
;
const
QScopedPointer
<
Private
>
d
;
c
onst
QScopedPointer
<
TabletCursorV2
Private
>
d
;
friend
class
TabletToolV2Interface
Private
;
};
class
KWAYLANDSERVER_EXPORT
TabletV2Interface
:
public
QObject
...
...
@@ -143,10 +146,10 @@ public:
private:
friend
class
TabletSeatV2Interface
;
friend
class
TabletSeatV2InterfacePrivate
;
friend
class
TabletToolV2Interface
;
explicit
TabletV2Interface
(
quint32
vendorId
,
quint32
productId
,
const
QString
&
name
,
const
QStringList
&
paths
,
QObject
*
parent
);
class
Private
;
QScopedPointer
<
Private
>
d
;
QScopedPointer
<
TabletV2InterfacePrivate
>
d
;
};
class
KWAYLANDSERVER_EXPORT
TabletSeatV2Interface
:
public
QObject
...
...
@@ -165,10 +168,9 @@ public:
void
removeTablet
(
const
QString
&
sysname
);
private:
friend
class
TabletManagerV2Interface
;
friend
class
TabletManagerV2Interface
Private
;
explicit
TabletSeatV2Interface
(
Display
*
display
,
QObject
*
parent
);
class
Private
;
QScopedPointer
<
Private
>
d
;
QScopedPointer
<
TabletSeatV2InterfacePrivate
>
d
;
};
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment