kodi
WinSystemWaylandWebOS.h
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 "Registry.h"
12 #include "WinSystemWayland.h"
13 
14 #include <wayland-webos-protocols.hpp>
15 #include <webos-helpers/libhelpers.h>
16 
18 {
19 
21 {
22 
23 public:
24  bool InitWindowSystem() override;
25 
30  std::string GetExportedWindowName();
31 
41  bool SetExportedWindow(CRect orig, CRect src, CRect dest);
42 
43  bool SupportsExportedWindow();
44 
45  IShellSurface* CreateShellSurface(const std::string& name) override;
46  bool CreateNewWindow(const std::string& name, bool fullScreen, RESOLUTION_INFO& res) override;
47  ~CWinSystemWaylandWebOS() noexcept override;
48  bool HasCursor() override;
49  void OnConfigure(std::uint32_t serial, CSizeInt size, IShellSurface::StateBitset state) override;
50 
51 protected:
52  std::unique_ptr<KODI::WINDOWING::IOSScreenSaver> GetOSScreenSaverImpl() override;
53  std::unique_ptr<CSeat> CreateSeat(std::uint32_t name, wayland::seat_t& seat) override;
54 
55 private:
56  static bool OnAppLifecycleEventWrapper(LSHandle* sh, LSMessage* reply, void* ctx);
57  bool OnAppLifecycleEvent(LSHandle* sh, LSMessage* reply);
58 
59  std::unique_ptr<CRegistry> m_webosRegistry;
60 
61  // WebOS foreign surface
62  std::string m_exportedWindowName;
63  wayland::compositor_t m_compositor;
64  wayland::webos_exported_t m_exportedSurface;
65  wayland::webos_foreign_t m_webosForeign;
66 
67  std::unique_ptr<HContext, int (*)(HContext*)> m_requestContext{new HContext(),
68  HUnregisterServiceCallback};
69 
70  bool m_resumePlayback{false};
71 };
72 
73 } // namespace KODI::WINDOWING::WAYLAND
std::string GetExportedWindowName()
Gets the exported window name.
Definition: WinSystemWaylandWebOS.cpp:106
Definition: WinSystemWayland.h:47
bool SetExportedWindow(CRect orig, CRect src, CRect dest)
Sets up the an exported window for display.
Definition: WinSystemWaylandWebOS.cpp:111
Provide info of a resolution.
Definition: Resolution.h:66
Abstraction for shell surfaces to support multiple protocols such as wl_shell (for compatibility) and...
Definition: ShellSurface.h:34
Definition: Connection.h:19
Definition: WinSystemWaylandWebOS.h:20