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 "surface_interface.h"
8 #include "surface_interface_p.h"
9 #include "surfacerole_p.h"
10 
11 namespace KWayland
12 {
13 namespace Server
14 {
15 SurfaceRole::SurfaceRole(SurfaceInterface *surface)
16  : m_surface(surface)
17 {
18  m_surface->d_func()->role = this;
19 }
20 
21 SurfaceRole::~SurfaceRole()
22 {
23  // Lifetime of the surface role is not bounded to the associated surface.
24  if (m_surface) {
25  m_surface->d_func()->role = nullptr;
26  }
27 }
28 
29 }
30 }
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Feb 7 2023 03:56:22 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.