Chromium Code Reviews| Index: ui/gfx/screen_wayland.cc |
| diff --git a/ui/gfx/screen_wayland.cc b/ui/gfx/screen_wayland.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..48a43044e399383e6a63cae9eb61a1fb3cc33e8c |
| --- /dev/null |
| +++ b/ui/gfx/screen_wayland.cc |
| @@ -0,0 +1,62 @@ |
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "ui/gfx/screen.h" |
| + |
| +#include "base/logging.h" |
| +#include "ui/gfx/gl/gl_surface_egl.h" |
| +#include "ui/wayland/wayland_display.h" |
| +#include "ui/wayland/wayland_screen.h" |
| + |
| +namespace gfx { |
| + |
| +// static |
| +gfx::Point Screen::GetCursorScreenPoint() { |
| + NOTIMPLEMENTED(); |
| + return gfx::Point(); |
| +} |
| + |
| +gfx::Rect static GetPrimaryMonitorBounds() { |
| + ui::WaylandDisplay* display = ui::WaylandDisplay::GetDisplay( |
| + gfx::GLSurfaceEGL::GetNativeDisplay()); |
| + std::list<ui::WaylandScreen*> screens = display->GetScreenList(); |
| + |
|
sky
2011/07/27 15:51:05
That's a lot of empty space. Also, how about just:
|
| + if (screens.empty()) { |
| + return gfx::Rect(); |
| + } |
| + |
| + return screens.front()->GetAllocation(); |
| +} |
| + |
| +// static |
| +gfx::Rect Screen::GetMonitorWorkAreaNearestWindow(gfx::NativeView view) { |
| + // TODO(beng): use |view|. |
|
sky
2011/07/27 15:51:05
Remove beng here.
|
| + return GetPrimaryMonitorBounds(); |
| +} |
| + |
| +// static |
| +gfx::Rect Screen::GetMonitorAreaNearestWindow(gfx::NativeView view) { |
| + NOTIMPLEMENTED(); |
| + return gfx::Rect(); |
| +} |
| + |
| +// static |
| +gfx::Rect Screen::GetMonitorWorkAreaNearestPoint(const gfx::Point& point) { |
| + // TODO(jamiewalch): Restrict this to the work area of the monitor. |
| + return GetMonitorAreaNearestPoint(point); |
| +} |
| + |
| +// static |
| +gfx::Rect Screen::GetMonitorAreaNearestPoint(const gfx::Point& point) { |
| + NOTIMPLEMENTED(); |
| + return gfx::Rect(); |
| +} |
| + |
| +gfx::NativeWindow Screen::GetWindowAtCursorScreenPoint() { |
| + NOTIMPLEMENTED(); |
| + return NULL; |
| +} |
| + |
| +} // namespace gfx |
| + |