| 1 |
/* |
| 2 |
* Copyright (C) 2017-2018 Team Kodi |
| 3 |
* This file is part of Kodi - https://kodi.tv |
| 4 |
* |
| 5 |
* SPDX-License-Identifier: GPL-2.0-or-later |
| 6 |
* See LICENSES/README.md for more information. |
| 7 |
*/ |
| 8 |
|
| 9 |
#include "ShellSurface.h" |
| 10 |
|
| 11 |
#include "utils/StringUtils.h" |
| 12 |
|
| 13 |
using namespace KODI::WINDOWING::WAYLAND; |
| 14 |
|
| 15 |
std::string IShellSurface::StateToString(StateBitset state) |
| 16 |
{ |
| 17 |
std::vector<std::string> parts; |
| 18 |
if (state.test(STATE_ACTIVATED)) |
| 19 |
{ |
| 20 |
parts.emplace_back("activated"); |
| 21 |
} |
| 22 |
if (state.test(STATE_FULLSCREEN)) |
| 23 |
{ |
| 24 |
parts.emplace_back("fullscreen"); |
| 25 |
} |
| 26 |
if (state.test(STATE_MAXIMIZED)) |
| 27 |
{ |
| 28 |
parts.emplace_back("maximized"); |
| 29 |
} |
| 30 |
if (state.test(STATE_RESIZING)) |
| 31 |
{ |
| 32 |
parts.emplace_back("resizing"); |
| 33 |
} |
| 34 |
return parts.empty() ? "none" : StringUtils::Join(parts, ","); |
| 35 |
} |