Added initial support for displaying on Wayland compositors.
[vuplus_xbmc] / xbmc / windowing / egl / wayland / ShellSurface.h
1 #pragma once
2
3 /*
4  *      Copyright (C) 2011-2013 Team XBMC
5  *      http://www.xbmc.org
6  *
7  *  This Program is free software; you can redistribute it and/or modify
8  *  it under the terms of the GNU General Public License as published by
9  *  the Free Software Foundation; either version 2, or (at your option)
10  *  any later version.
11  *
12  *  This Program is distributed in the hope that it will be useful,
13  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  *  GNU General Public License for more details.
16  *
17  *  You should have received a copy of the GNU General Public License
18  *  along with XBMC; see the file COPYING.  If not, see
19  *  <http://www.gnu.org/licenses/>.
20  *
21  */
22 #include <wayland-client.h>
23
24 #include <boost/noncopyable.hpp>
25
26 class IDllWaylandClient;
27
28 namespace xbmc
29 {
30 namespace wayland
31 {
32 class ShellSurface :
33   boost::noncopyable
34 {
35 public:
36
37   ShellSurface(IDllWaylandClient &clientLibrary,
38                struct wl_shell_surface *shellSurface);
39   ~ShellSurface();
40
41   struct wl_shell_surface * GetWlShellSurface();
42   void SetFullscreen(enum wl_shell_surface_fullscreen_method method,
43                      uint32_t framerate,
44                      struct wl_output *output);
45
46   static const wl_shell_surface_listener m_listener;
47
48   static void HandlePingCallback(void *,
49                                  struct wl_shell_surface *,
50                                  uint32_t);
51   static void HandleConfigureCallback(void *,
52                                       struct wl_shell_surface *,
53                                       uint32_t,
54                                       int32_t,
55                                       int32_t);
56   static void HandlePopupDoneCallback(void *,
57                                       struct wl_shell_surface *);
58
59 private:
60
61   void HandlePing(uint32_t serial);
62   void HandleConfigure(uint32_t edges,
63                        int32_t width,
64                        int32_t height);
65   void HandlePopupDone();
66
67   IDllWaylandClient &m_clientLibrary;
68   struct wl_shell_surface *m_shellSurface;
69 };
70 }
71 }