41ff3ac27e424febb24bf34563e5049dfa372496
[platform/framework/web/crosswalk.git] / src / ozone / wayland / shell / shell.h
1 // Copyright 2014 Intel Corporation. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef OZONE_WAYLAND_SHELL_SHELL_H_
6 #define OZONE_WAYLAND_SHELL_SHELL_H_
7
8 #include <wayland-client.h>
9
10 #include "base/basictypes.h"
11 #include "ozone/wayland/window.h"
12
13 struct xdg_shell;
14 namespace ozonewayland {
15
16 class WaylandShellSurface;
17 class WaylandWindow;
18
19 class WaylandShell {
20  public:
21   WaylandShell();
22   ~WaylandShell();
23   // Creates shell surface for a given WaylandWindow. This can be either
24   // wl_shell, xdg_shell or any shell which supports wayland protocol.
25   // Ownership is passed to the caller.
26   WaylandShellSurface* CreateShellSurface(WaylandWindow* parent,
27                                           WaylandWindow::ShellType type);
28   void Initialize(struct wl_registry *registry,
29                   uint32_t name,
30                   const char *interface,
31                   uint32_t version);
32
33   wl_shell* GetWLShell() const { return shell_; }
34   xdg_shell* GetXDGShell() const { return xdg_shell_; }
35
36  private:
37 #if defined(ENABLE_XDG_SHELL)
38   static void XDGHandlePing(void* data,
39                             struct xdg_shell* xdg_shell,
40                             uint32_t serial);
41 #endif
42   wl_shell* shell_;
43   xdg_shell* xdg_shell_;
44   DISALLOW_COPY_AND_ASSIGN(WaylandShell);
45 };
46
47 }  // namespace ozonewayland
48
49 #endif  // OZONE_WAYLAND_SHELL_H_