Upstream version 9.38.204.0
[platform/framework/web/crosswalk.git] / src / ozone / wayland / shell / shell_surface.h
1 // Copyright 2013 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_SURFACE_H_
6 #define OZONE_WAYLAND_SHELL_SHELL_SURFACE_H_
7
8 #include <wayland-client.h>
9
10 #include "base/basictypes.h"
11 #include "ozone/wayland/window.h"
12
13 namespace ozonewayland {
14
15 class WaylandWindow;
16
17 class WaylandShellSurface {
18  public:
19   WaylandShellSurface();
20   virtual ~WaylandShellSurface();
21
22   struct wl_surface* GetWLSurface() const;
23
24   // The implementation should initialize the shell and set up all
25   // necessary callbacks.
26   virtual void InitializeShellSurface(WaylandWindow* window) = 0;
27   virtual void UpdateShellSurface(WaylandWindow::ShellType type,
28                                   WaylandShellSurface* shell_parent,
29                                   unsigned x,
30                                   unsigned y) = 0;
31   virtual void SetWindowTitle(const base::string16& title) = 0;
32   virtual void Maximize() = 0;
33   virtual void Minimize() = 0;
34   virtual void Unminimize() = 0;
35   virtual bool IsMinimized() const = 0;
36
37   // static functions.
38   static void PopupDone();
39   static void WindowResized(void *data, unsigned width, unsigned height);
40   static void WindowActivated(void *data);
41
42  protected:
43   void FlushDisplay() const;
44
45  private:
46   struct wl_surface* surface_;
47   DISALLOW_COPY_AND_ASSIGN(WaylandShellSurface);
48 };
49
50 }  // namespace ozonewayland
51
52 #endif  // OZONE_WAYLAND_SHELL_SHELL_SURFACE_H_