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_DISPLAY_H_ | 5 #ifndef UI_GFX_DISPLAY_H_ |
6 #define UI_GFX_DISPLAY_H_ | 6 #define UI_GFX_DISPLAY_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "ui/base/ui_export.h" | 10 #include "ui/base/ui_export.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 void SetSize(const gfx::Size& size_in_pixel); | 82 void SetSize(const gfx::Size& size_in_pixel); |
83 | 83 |
84 // Computes and updates the display's work are using | 84 // Computes and updates the display's work are using |
85 // |work_area_insets| and the bounds. | 85 // |work_area_insets| and the bounds. |
86 void UpdateWorkAreaFromInsets(const gfx::Insets& work_area_insets); | 86 void UpdateWorkAreaFromInsets(const gfx::Insets& work_area_insets); |
87 | 87 |
88 // Returns the display's size in pixel coordinates. | 88 // Returns the display's size in pixel coordinates. |
89 gfx::Size GetSizeInPixel() const; | 89 gfx::Size GetSizeInPixel() const; |
90 | 90 |
91 #if defined(USE_AURA) | 91 #if defined(USE_AURA) |
92 // TODO(oshima|skuhne): Eliminate the use of bounds_in_pixel in events_x.cc | 92 // TODO(oshima|skuhne): bounds_in_pixel is no longer used in events_x.cc, |
93 // and remove bounds_in_pixel from gfx::Display. | 93 // bounds_in_pixel can now be removed from gfx::Display. |
| 94 // (Some care needs to be taken in SetSize and SetScaleAndBounds). |
94 // Returns the display's bounds in pixel coordinates. | 95 // Returns the display's bounds in pixel coordinates. |
95 const Rect& bounds_in_pixel() const { return bounds_in_pixel_; } | 96 const Rect& bounds_in_pixel() const { return bounds_in_pixel_; } |
96 #endif | 97 #endif |
97 | 98 |
98 // Returns a string representation of the display; | 99 // Returns a string representation of the display; |
99 std::string ToString() const; | 100 std::string ToString() const; |
100 | 101 |
101 // True if the display contains valid display id. | 102 // True if the display contains valid display id. |
102 bool is_valid() const { return id_ != kInvalidDisplayID; } | 103 bool is_valid() const { return id_ != kInvalidDisplayID; } |
103 | 104 |
104 static const int64 kInvalidDisplayID; | 105 static const int64 kInvalidDisplayID; |
105 | 106 |
106 private: | 107 private: |
107 int64 id_; | 108 int64 id_; |
108 Rect bounds_; | 109 Rect bounds_; |
109 Rect work_area_; | 110 Rect work_area_; |
110 #if defined(USE_AURA) | 111 #if defined(USE_AURA) |
111 Rect bounds_in_pixel_; | 112 Rect bounds_in_pixel_; |
112 #endif | 113 #endif |
113 float device_scale_factor_; | 114 float device_scale_factor_; |
114 }; | 115 }; |
115 | 116 |
116 } // namespace gfx | 117 } // namespace gfx |
117 | 118 |
118 #endif // UI_GFX_DISPLAY_H_ | 119 #endif // UI_GFX_DISPLAY_H_ |
OLD | NEW |