2 * Copyright (C) 2023 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
12 #include "WinSystemWayland.h"
14 #include <wayland-webos-protocols.hpp>
15 #include <webos-helpers/libhelpers.h>
17 namespace KODI::WINDOWING::WAYLAND
20 class CWinSystemWaylandWebOS
: public CWinSystemWayland
24 bool InitWindowSystem() override
;
27 * Gets the exported window name. May return an empty string on non wayland-webos-foreign devices (pre webOS 5)
28 * @return Exported window name
30 std::string
GetExportedWindowName();
33 * Sets up the an exported window for display. The display engine will merge the exported window with the UI layer.
34 * Therefore any UI element must be transparent for the exported window to punch through. Not available on non
35 * wayland-webos-foreign devices (pre webOS 5)
36 * @param src Original source window rect (video size)
37 * @param src Source window rect crop window
38 * @param dst Destination rect
39 * @return True on success, else false
41 bool SetExportedWindow(CRect orig
, CRect src
, CRect dest
);
43 bool SupportsExportedWindow();
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
;
52 std::unique_ptr
<KODI::WINDOWING::IOSScreenSaver
> GetOSScreenSaverImpl() override
;
53 std::unique_ptr
<CSeat
> CreateSeat(std::uint32_t name
, wayland::seat_t
& seat
) override
;
56 static bool OnAppLifecycleEventWrapper(LSHandle
* sh
, LSMessage
* reply
, void* ctx
);
57 bool OnAppLifecycleEvent(LSHandle
* sh
, LSMessage
* reply
);
59 std::unique_ptr
<CRegistry
> m_webosRegistry
;
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
;
67 std::unique_ptr
<HContext
, int (*)(HContext
*)> m_requestContext
{new HContext(),
68 HUnregisterServiceCallback
};
71 } // namespace KODI::WINDOWING::WAYLAND