Debian Codegraph @

xbmc/windowing/wayland/OSScreenSaverWebOS.h

raw
1 /*
2 * Copyright (C) 2023 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 #pragma once
10
11 #include "xbmc/windowing/OSScreenSaver.h"
12
13 #include <webos-helpers/libhelpers.h>
14
15 namespace KODI::WINDOWING::WAYLAND
16 {
17
18 class COSScreenSaverWebOS : public IOSScreenSaver
19 {
20 public:
21 ~COSScreenSaverWebOS() override;
22
23 /**
24 * Screensaver inhibition on webOS works by subscribing to the tvpower service. The service will
25 * respond every few minutes with a timestamp that needs to be confirmed if the screensaver
26 * should still be inhibited. If those responses are not answered the screensaver will be
27 * uninhibited again
28 */
29 void Inhibit() override;
30 void Uninhibit() override;
31
32 private:
33 static bool OnScreenSaverAboutToStart(LSHandle* sh, LSMessage* reply, void* ctx);
34
35 std::unique_ptr<HContext> m_requestContext;
36 };
37
38 } // namespace KODI::WINDOWING::WAYLAND