Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / ozone / wayland / shell / ivi_shell_surface.cc
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 #include "ozone/wayland/shell/ivi_shell_surface.h"
6
7 #include "base/logging.h"
8 #include "base/strings/utf_string_conversions.h"
9
10 #include "ozone/wayland/display.h"
11 #include "ozone/wayland/input_device.h"
12 #include "ozone/wayland/shell/shell.h"
13 #include "ozone/wayland/shell/ivi-application-client-protocol.h"
14 #define IVI_SURFACE_ID 7000
15
16 namespace ozonewayland {
17
18 int IVIShellSurface::last_ivi_surface_id_ = IVI_SURFACE_ID;
19
20 IVIShellSurface::IVIShellSurface()
21     : WaylandShellSurface(),
22       ivi_surface_(NULL),
23       ivi_surface_id_(IVI_SURFACE_ID) {
24 }
25
26 IVIShellSurface::~IVIShellSurface() {
27   ivi_surface_destroy(ivi_surface_);
28 }
29
30 void IVIShellSurface::InitializeShellSurface(WaylandWindow* window,
31                                              WaylandWindow::ShellType type) {
32   DCHECK(!ivi_surface_);
33   WaylandDisplay* display = WaylandDisplay::GetInstance();
34   DCHECK(display);
35   WaylandShell* shell = WaylandDisplay::GetInstance()->GetShell();
36   DCHECK(shell && shell->GetIVIShell());
37   char *env;
38   if ((env = getenv("OZONE_WAYLAND_IVI_SURFACE_ID")))
39     ivi_surface_id_ = atoi(env);
40   else
41     ivi_surface_id_ = last_ivi_surface_id_ + 1;
42   ivi_surface_ = ivi_application_surface_create(shell->GetIVIShell(),
43                                                 ivi_surface_id_, GetWLSurface());
44   last_ivi_surface_id_ = ivi_surface_id_;
45
46   DCHECK(ivi_surface_);
47 }
48
49 void IVIShellSurface::UpdateShellSurface(WaylandWindow::ShellType type,
50                                          WaylandShellSurface* shell_parent,
51                                          unsigned x,
52                                          unsigned y) {
53   WaylandShellSurface::FlushDisplay();
54 }
55
56 void IVIShellSurface::SetWindowTitle(const base::string16& title) {
57 }
58
59 void IVIShellSurface::Maximize() {
60 }
61
62 void IVIShellSurface::Minimize() {
63 }
64
65 void IVIShellSurface::Unminimize() {
66 }
67
68 bool IVIShellSurface::IsMinimized() const {
69   return false;
70 }
71
72
73 }  // namespace ozonewayland