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 #pragma once
10 
11 #include "Connection.h"
12 #include "ShellSurface.h"
13 
14 namespace KODI
15 {
16 namespace WINDOWING
17 {
18 namespace WAYLAND
19 {
20 
21 class CShellSurfaceWlShell : public IShellSurface
22 {
23 public:
24   /**
25    * Construct wl_shell_surface for given surface
26    *
27    * \parma handler shell surface handler
28    * \param connection connection global
29    * \param surface surface to make shell surface for
30    * \param title title of the surfae
31    * \param class_ class of the surface, which should match the name of the
32    *               .desktop file of the application
33    */
34   CShellSurfaceWlShell(IShellSurfaceHandler& handler,
35                        CConnection& connection,
36                        wayland::surface_t const& surface,
37                        const std::string& title,
38                        const std::string& class_);
39 
40   void Initialize() override;
41 
42   void SetFullScreen(wayland::output_t const& output, float refreshRate) override;
43   void SetWindowed() override;
44   void SetMaximized() override;
45   void UnsetMaximized() override;
46   void SetMinimized() override;
47   void SetWindowGeometry(CRectInt geometry) override;
48   void AckConfigure(std::uint32_t serial) override;
49 
50   void StartMove(const wayland::seat_t& seat, std::uint32_t serial) override;
51   void StartResize(const wayland::seat_t& seat, std::uint32_t serial, wayland::shell_surface_resize edge) override;
52   void ShowShellContextMenu(const wayland::seat_t& seat, std::uint32_t serial, CPointInt position) override;
53 
54 private:
55   IShellSurfaceHandler& m_handler;
56   wayland::shell_t m_shell;
57   wayland::shell_surface_t m_shellSurface;
58   StateBitset m_surfaceState;
59 };
60 
61 }
62 }
63 }
64