OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_H_ | 5 #ifndef UI_GFX_SCREEN_H_ |
6 #define UI_GFX_SCREEN_H_ | 6 #define UI_GFX_SCREEN_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "ui/base/ui_export.h" | 9 #include "ui/base/ui_export.h" |
10 #include "ui/gfx/display.h" | |
10 #include "ui/gfx/native_widget_types.h" | 11 #include "ui/gfx/native_widget_types.h" |
11 #include "ui/gfx/monitor.h" | |
12 #include "ui/gfx/point.h" | 12 #include "ui/gfx/point.h" |
13 | 13 |
14 namespace gfx { | 14 namespace gfx { |
15 class Rect; | 15 class Rect; |
16 class ScreenImpl; | 16 class ScreenImpl; |
17 | 17 |
18 // A utility class for getting various info about screen size, monitors, | 18 // A utility class for getting various info about screen size, monitors, |
19 // cursor position, etc. | 19 // cursor position, etc. |
20 class UI_EXPORT Screen { | 20 class UI_EXPORT Screen { |
21 public: | 21 public: |
(...skipping 11 matching lines...) Expand all Loading... | |
33 | 33 |
34 // Returns the current absolute position of the mouse pointer. | 34 // Returns the current absolute position of the mouse pointer. |
35 static gfx::Point GetCursorScreenPoint(); | 35 static gfx::Point GetCursorScreenPoint(); |
36 | 36 |
37 // Returns the window under the cursor. | 37 // Returns the window under the cursor. |
38 static gfx::NativeWindow GetWindowAtCursorScreenPoint(); | 38 static gfx::NativeWindow GetWindowAtCursorScreenPoint(); |
39 | 39 |
40 // Returns the number of monitors. | 40 // Returns the number of monitors. |
41 // Mirrored displays are excluded; this method is intended to return the | 41 // Mirrored displays are excluded; this method is intended to return the |
42 // number of distinct, usable displays. | 42 // number of distinct, usable displays. |
43 static int GetNumMonitors(); | 43 static int GetNumMonitors(); |
oshima
2012/06/12 00:48:01
GetNumDisplays
| |
44 | 44 |
45 // Returns the monitor nearest the specified window. | 45 // Returns the display nearest the specified window. |
46 static gfx::Monitor GetMonitorNearestWindow(gfx::NativeView view); | 46 static gfx::Display GetMonitorNearestWindow(gfx::NativeView view); |
oshima
2012/06/12 00:48:01
GetDisplayNearestWindow
same for others
| |
47 | 47 |
48 // Returns the the monitor nearest the specified point. | 48 // Returns the the display nearest the specified point. |
49 static gfx::Monitor GetMonitorNearestPoint(const gfx::Point& point); | 49 static gfx::Display GetMonitorNearestPoint(const gfx::Point& point); |
50 | 50 |
51 // Returns the bounds of the work area of the primary monitor. | 51 // Returns the bounds of the work area of the primary monitor. |
52 static gfx::Monitor GetPrimaryMonitor(); | 52 static gfx::Display GetPrimaryMonitor(); |
53 | 53 |
54 // Returns the monitor that most closely intersects the provided bounds. | 54 // Returns the display that most closely intersects the provided bounds. |
55 static gfx::Monitor GetMonitorMatching(const gfx::Rect& match_rect); | 55 static gfx::Display GetMonitorMatching(const gfx::Rect& match_rect); |
56 }; | 56 }; |
57 | 57 |
58 } // namespace gfx | 58 } // namespace gfx |
59 | 59 |
60 #endif // VIEWS_SCREEN_H_ | 60 #endif // VIEWS_SCREEN_H_ |
OLD | NEW |