KWayland

surfacerole.cpp
1 /*
2  SPDX-FileCopyrightText: 2019 Vlad Zahorodnii <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5 */
6 
7 #include "surfacerole_p.h"
8 #include "surface_interface_p.h"
9 #include "surface_interface.h"
10 
11 namespace KWayland
12 {
13 namespace Server
14 {
15 
16 SurfaceRole::SurfaceRole(SurfaceInterface *surface)
17  : m_surface(surface)
18 {
19  m_surface->d_func()->role = this;
20 }
21 
22 SurfaceRole::~SurfaceRole()
23 {
24  // Lifetime of the surface role is not bounded to the associated surface.
25  if (m_surface) {
26  m_surface->d_func()->role = nullptr;
27  }
28 }
29 
30 }
31 }
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri Aug 7 2020 22:48:20 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.