OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_GFX_SCREEN_WIN_H_ | 5 #ifndef MOJO_EXAMPLES_AURA_DEMO_DEMO_SCREEN_H_ |
6 #define UI_GFX_SCREEN_WIN_H_ | 6 #define MOJO_EXAMPLES_AURA_DEMO_DEMO_SCREEN_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "ui/gfx/gfx_export.h" | 9 #include "ui/gfx/display.h" |
10 #include "ui/gfx/screen.h" | 10 #include "ui/gfx/screen.h" |
11 | 11 |
12 namespace gfx { | 12 namespace gfx { |
| 13 class Rect; |
| 14 class Transform; |
| 15 } |
13 | 16 |
14 class GFX_EXPORT ScreenWin : public gfx::Screen { | 17 namespace mojo { |
| 18 namespace examples { |
| 19 |
| 20 // A minimal, testing Aura implementation of gfx::Screen. |
| 21 class DemoScreen : public gfx::Screen { |
15 public: | 22 public: |
16 ScreenWin(); | 23 static DemoScreen* Create(); |
17 virtual ~ScreenWin(); | 24 virtual ~DemoScreen(); |
18 | 25 |
19 protected: | 26 protected: |
20 // Overridden from gfx::Screen: | 27 // gfx::Screen overrides: |
21 virtual bool IsDIPEnabled() OVERRIDE; | 28 virtual bool IsDIPEnabled() OVERRIDE; |
22 virtual gfx::Point GetCursorScreenPoint() OVERRIDE; | 29 virtual gfx::Point GetCursorScreenPoint() OVERRIDE; |
23 virtual gfx::NativeWindow GetWindowUnderCursor() OVERRIDE; | 30 virtual gfx::NativeWindow GetWindowUnderCursor() OVERRIDE; |
24 virtual gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) | 31 virtual gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) |
25 OVERRIDE; | 32 OVERRIDE; |
26 virtual int GetNumDisplays() const OVERRIDE; | 33 virtual int GetNumDisplays() const OVERRIDE; |
27 virtual std::vector<gfx::Display> GetAllDisplays() const OVERRIDE; | 34 virtual std::vector<gfx::Display> GetAllDisplays() const OVERRIDE; |
28 virtual gfx::Display GetDisplayNearestWindow( | 35 virtual gfx::Display GetDisplayNearestWindow( |
29 gfx::NativeView window) const OVERRIDE; | 36 gfx::NativeView view) const OVERRIDE; |
30 virtual gfx::Display GetDisplayNearestPoint( | 37 virtual gfx::Display GetDisplayNearestPoint( |
31 const gfx::Point& point) const OVERRIDE; | 38 const gfx::Point& point) const OVERRIDE; |
32 virtual gfx::Display GetDisplayMatching( | 39 virtual gfx::Display GetDisplayMatching( |
33 const gfx::Rect& match_rect) const OVERRIDE; | 40 const gfx::Rect& match_rect) const OVERRIDE; |
34 virtual gfx::Display GetPrimaryDisplay() const OVERRIDE; | 41 virtual gfx::Display GetPrimaryDisplay() const OVERRIDE; |
35 virtual void AddObserver(DisplayObserver* observer) OVERRIDE; | 42 virtual void AddObserver(gfx::DisplayObserver* observer) OVERRIDE; |
36 virtual void RemoveObserver(DisplayObserver* observer) OVERRIDE; | 43 virtual void RemoveObserver(gfx::DisplayObserver* observer) OVERRIDE; |
37 | |
38 // Returns the HWND associated with the NativeView. | |
39 virtual HWND GetHWNDFromNativeView(NativeView window) const; | |
40 | |
41 // Returns the NativeView associated with the HWND. | |
42 virtual NativeWindow GetNativeWindowFromHWND(HWND hwnd) const; | |
43 | 44 |
44 private: | 45 private: |
45 DISALLOW_COPY_AND_ASSIGN(ScreenWin); | 46 explicit DemoScreen(const gfx::Rect& screen_bounds); |
| 47 |
| 48 gfx::Display display_; |
| 49 |
| 50 DISALLOW_COPY_AND_ASSIGN(DemoScreen); |
46 }; | 51 }; |
47 | 52 |
48 } // namespace gfx | 53 } // namespace examples |
| 54 } // namespace mojo |
49 | 55 |
50 #endif // UI_GFX_SCREEN_WIN_H_ | 56 #endif // MOJO_EXAMPLES_AURA_DEMO_DEMO_SCREEN_H_ |
OLD | NEW |