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_DISPLAY_SCREEN_H_ | 5 #ifndef UI_DISPLAY_SCREEN_H_ |
6 #define UI_DISPLAY_SCREEN_H_ | 6 #define UI_DISPLAY_SCREEN_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 Screen(); | 31 Screen(); |
32 virtual ~Screen(); | 32 virtual ~Screen(); |
33 | 33 |
34 // Retrieves the single Screen object. | 34 // Retrieves the single Screen object. |
35 static Screen* GetScreen(); | 35 static Screen* GetScreen(); |
36 | 36 |
37 // Sets the global screen. NOTE: this does not take ownership of |screen|. | 37 // Sets the global screen. NOTE: this does not take ownership of |screen|. |
38 // Tests must be sure to reset any state they install. | 38 // Tests must be sure to reset any state they install. |
39 static void SetScreenInstance(Screen* instance); | 39 static void SetScreenInstance(Screen* instance); |
40 | 40 |
| 41 // If the given |screen_rect| isn't fully on any display, return a rect that |
| 42 // is fully within the bounds of the work area for the nearest display. If |
| 43 // the rect is already fully on a display, no changes are made. |
| 44 static gfx::Rect MoveScreenRectToNearestDisplay( |
| 45 const gfx::Rect& screen_rect); |
| 46 |
41 // Returns the current absolute position of the mouse pointer. | 47 // Returns the current absolute position of the mouse pointer. |
42 virtual gfx::Point GetCursorScreenPoint() = 0; | 48 virtual gfx::Point GetCursorScreenPoint() = 0; |
43 | 49 |
44 // Returns true if the cursor is directly over |window|. | 50 // Returns true if the cursor is directly over |window|. |
45 virtual bool IsWindowUnderCursor(gfx::NativeWindow window) = 0; | 51 virtual bool IsWindowUnderCursor(gfx::NativeWindow window) = 0; |
46 | 52 |
47 // Returns the window at the given screen coordinate |point|. | 53 // Returns the window at the given screen coordinate |point|. |
48 virtual gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) = 0; | 54 virtual gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) = 0; |
49 | 55 |
50 // Returns the number of displays. | 56 // Returns the number of displays. |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 | 102 |
97 private: | 103 private: |
98 DISALLOW_COPY_AND_ASSIGN(Screen); | 104 DISALLOW_COPY_AND_ASSIGN(Screen); |
99 }; | 105 }; |
100 | 106 |
101 Screen* CreateNativeScreen(); | 107 Screen* CreateNativeScreen(); |
102 | 108 |
103 } // namespace display | 109 } // namespace display |
104 | 110 |
105 #endif // UI_DISPLAY_SCREEN_H_ | 111 #endif // UI_DISPLAY_SCREEN_H_ |
OLD | NEW |