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.
5 #include "ozone/wayland/shell/ivi_shell_surface.h"
7 #include "base/logging.h"
8 #include "base/strings/utf_string_conversions.h"
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
16 namespace ozonewayland {
18 int IVIShellSurface::last_ivi_surface_id_ = IVI_SURFACE_ID;
20 IVIShellSurface::IVIShellSurface()
21 : WaylandShellSurface(),
23 ivi_surface_id_(IVI_SURFACE_ID) {
26 IVIShellSurface::~IVIShellSurface() {
27 ivi_surface_destroy(ivi_surface_);
30 void IVIShellSurface::InitializeShellSurface(WaylandWindow* window,
31 WaylandWindow::ShellType type) {
32 DCHECK(!ivi_surface_);
33 WaylandDisplay* display = WaylandDisplay::GetInstance();
35 WaylandShell* shell = WaylandDisplay::GetInstance()->GetShell();
36 DCHECK(shell && shell->GetIVIShell());
38 if ((env = getenv("OZONE_WAYLAND_IVI_SURFACE_ID")))
39 ivi_surface_id_ = atoi(env);
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_;
49 void IVIShellSurface::UpdateShellSurface(WaylandWindow::ShellType type,
50 WaylandShellSurface* shell_parent,
53 WaylandShellSurface::FlushDisplay();
56 void IVIShellSurface::SetWindowTitle(const base::string16& title) {
59 void IVIShellSurface::Maximize() {
62 void IVIShellSurface::Minimize() {
65 void IVIShellSurface::Unminimize() {
68 bool IVIShellSurface::IsMinimized() const {
73 } // namespace ozonewayland