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 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "ui/gfx/display.h" | 11 #include "ui/gfx/display.h" |
12 #include "ui/gfx/gfx_export.h" | 12 #include "ui/gfx/gfx_export.h" |
13 #include "ui/gfx/native_widget_types.h" | 13 #include "ui/gfx/native_widget_types.h" |
14 #include "ui/gfx/point.h" | 14 #include "ui/gfx/point.h" |
15 #include "ui/gfx/screen_type_delegate.h" | 15 #include "ui/gfx/screen_type_delegate.h" |
16 | 16 |
17 namespace gfx { | 17 namespace gfx { |
18 class DisplayObserver; | 18 class DisplayObserver; |
19 class Rect; | 19 class Rect; |
20 | 20 |
21 // A utility class for getting various info about screen size, displays, | 21 // A utility class for getting various info about screen size, displays, |
22 // cursor position, etc. | 22 // cursor position, etc. |
23 // | 23 // |
24 // Note that this class does not represent an individual display connected to a | 24 // Note that this class does not represent an individual display connected to a |
25 // computer -- see the Display class for that. A single Screen object exists on | 25 // computer -- see the Display class for that. A single Screen object exists on |
26 // most operating systems regardless of the number of connected displays. On | 26 // most operating systems regardless of the number of connected displays. On |
27 // Windows 8, two Screens exist: one for Metro UI and another for the desktop. | 27 // Windows 8, two Screens exist: one for Metro UI and another for the desktop. |
28 class UI_EXPORT Screen { | 28 class GFX_EXPORT Screen { |
29 public: | 29 public: |
30 // Retrieves the Screen that the specified NativeView belongs to. A value of | 30 // Retrieves the Screen that the specified NativeView belongs to. A value of |
31 // NULL is treated as |SCREEN_TYPE_NATIVE|. | 31 // NULL is treated as |SCREEN_TYPE_NATIVE|. |
32 static Screen* GetScreenFor(NativeView view); | 32 static Screen* GetScreenFor(NativeView view); |
33 | 33 |
34 // Returns the SCREEN_TYPE_NATIVE Screen. This should be used with caution, | 34 // Returns the SCREEN_TYPE_NATIVE Screen. This should be used with caution, |
35 // as it is likely to be incorrect for code that runs on Windows. | 35 // as it is likely to be incorrect for code that runs on Windows. |
36 static Screen* GetNativeScreen(); | 36 static Screen* GetNativeScreen(); |
37 | 37 |
38 // Sets the global screen for a particular screen type. Only the _NATIVE | 38 // Sets the global screen for a particular screen type. Only the _NATIVE |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 | 90 |
91 private: | 91 private: |
92 DISALLOW_COPY_AND_ASSIGN(Screen); | 92 DISALLOW_COPY_AND_ASSIGN(Screen); |
93 }; | 93 }; |
94 | 94 |
95 Screen* CreateNativeScreen(); | 95 Screen* CreateNativeScreen(); |
96 | 96 |
97 } // namespace gfx | 97 } // namespace gfx |
98 | 98 |
99 #endif // UI_GFX_SCREEN_H_ | 99 #endif // UI_GFX_SCREEN_H_ |
OLD | NEW |