Debian Codegraph @

xbmc/windowing/gbm/GBMDPMSSupport.cpp

raw
1 /*
2 * Copyright (C) 2009-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 "GBMDPMSSupport.h"
10
11 #include "ServiceBroker.h"
12 #include "windowing/gbm/WinSystemGbm.h"
13
14 using namespace KODI::WINDOWING::GBM;
15
16 CGBMDPMSSupport::CGBMDPMSSupport()
17 {
18 m_supportedModes.push_back(OFF);
19 }
20
21 bool CGBMDPMSSupport::EnablePowerSaving(PowerSavingMode mode)
22 {
23 auto winSystem = dynamic_cast<CWinSystemGbm*>(CServiceBroker::GetWinSystem());
24 if (!winSystem)
25 return false;
26
27 switch (mode)
28 {
29 case OFF:
30 return winSystem->Hide();
31 default:
32 return false;
33 }
34 }
35
36 bool CGBMDPMSSupport::DisablePowerSaving()
37 {
38 auto winSystem = dynamic_cast<CWinSystemGbm*>(CServiceBroker::GetWinSystem());
39 if (!winSystem)
40 return false;
41
42 return winSystem->Show();
43 }