| Index: ui/gfx/display.h
|
| diff --git a/ui/gfx/monitor.h b/ui/gfx/display.h
|
| similarity index 68%
|
| rename from ui/gfx/monitor.h
|
| rename to ui/gfx/display.h
|
| index 742877164ce57fe94517b5d480d01fe7b6fee2ed..13aaa8f539f19941ca27b3475484985db2b2e044 100644
|
| --- a/ui/gfx/monitor.h
|
| +++ b/ui/gfx/display.h
|
| @@ -2,8 +2,8 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#ifndef UI_GFX_MONITOR_H_
|
| -#define UI_GFX_MONITOR_H_
|
| +#ifndef UI_GFX_DISPLAY_H_
|
| +#define UI_GFX_DISPLAY_H_
|
| #pragma once
|
|
|
| #include "base/basictypes.h"
|
| @@ -13,43 +13,43 @@
|
|
|
| namespace gfx {
|
|
|
| -// Note: The screen and monitor currently uses pixel coordinate
|
| +// Note: The screen and display currently uses pixel coordinate
|
| // system. For platforms that support DIP (density independent pixel),
|
| // |bounds()| and |work_area| will return values in DIP coordinate
|
| // system, not in backing pixels.
|
| -class UI_EXPORT Monitor {
|
| +class UI_EXPORT Display {
|
| public:
|
| // Returns the default value for the device scale factor, which is
|
| // given by "--default-device-scale-factor".
|
| static float GetDefaultDeviceScaleFactor();
|
|
|
| - // Creates a monitor with invalid id(-1) as default.
|
| - Monitor();
|
| - explicit Monitor(int id);
|
| - Monitor(int id, const Rect& bounds);
|
| - ~Monitor();
|
| + // Creates a display with invalid id(-1) as default.
|
| + Display();
|
| + explicit Display(int id);
|
| + Display(int id, const Rect& bounds);
|
| + ~Display();
|
|
|
| - // Sets/Gets unique identifier associated with the monitor.
|
| + // Sets/Gets unique identifier associated with the display.
|
| int id() const { return id_; }
|
| void set_id(int id) { id_ = id; }
|
|
|
| - // Gets/Sets the monitor's bounds in gfx::Screen's coordinates.
|
| - // -1 means invalid monitor and it doesn't not exit.
|
| + // Gets/Sets the display's bounds in gfx::Screen's coordinates.
|
| + // -1 means invalid display and it doesn't not exit.
|
| const Rect& bounds() const { return bounds_; }
|
| void set_bounds(const Rect& bounds) { bounds_ = bounds; }
|
|
|
| - // Gets/Sets the monitor's work area in gfx::Screen's coordinates.
|
| + // Gets/Sets the display's work area in gfx::Screen's coordinates.
|
| const Rect& work_area() const { return work_area_; }
|
| void set_work_area(const Rect& work_area) { work_area_ = work_area; }
|
|
|
| // Output device's pixel scale factor. This specifies how much the
|
| // UI should be scaled when the actual output has more pixels than
|
| - // standard monitors (which is around 100~120dpi.) The potential return
|
| + // standard displays (which is around 100~120dpi.) The potential return
|
| // values depend on each platforms.
|
| float device_scale_factor() const { return device_scale_factor_; }
|
| void set_device_scale_factor(float scale) { device_scale_factor_ = scale; }
|
|
|
| - // Utility functions that just return the size of monitor and
|
| + // Utility functions that just return the size of display and
|
| // work area.
|
| const Size& size() const { return bounds_.size(); }
|
| const Size& work_area_size() const { return work_area_.size(); }
|
| @@ -57,32 +57,32 @@ class UI_EXPORT Monitor {
|
| // Returns the work area insets.
|
| Insets GetWorkAreaInsets() const;
|
|
|
| - // Sets the device scale factor and monitor bounds in pixel. This
|
| + // Sets the device scale factor and display bounds in pixel. This
|
| // updates the work are using the same insets between old bounds and
|
| // work area.
|
| void SetScaleAndBounds(float device_scale_factor,
|
| const gfx::Rect& bounds_in_pixel);
|
|
|
| - // Sets the monitor's size. This updates the work area using the same insets
|
| + // Sets the display's size. This updates the work area using the same insets
|
| // between old bounds and work area.
|
| void SetSize(const gfx::Size& size_in_pixel);
|
|
|
| - // Computes and updates the monitor's work are using
|
| + // Computes and updates the display's work are using
|
| // |work_area_insets| and the bounds.
|
| void UpdateWorkAreaFromInsets(const gfx::Insets& work_area_insets);
|
|
|
| - // Returns the monitor's size in pixel coordinates.
|
| + // Returns the display's size in pixel coordinates.
|
| gfx::Size GetSizeInPixel() const;
|
|
|
| #if defined(USE_AURA)
|
| // TODO(oshima): |bounds()| on ash is not screen's coordinate and
|
| // this is an workaround for this. This will be removed when ash
|
| - // has true multi monitor support. crbug.com/119268.
|
| - // Returns the monitor's bounds in pixel coordinates.
|
| + // has true multi display support. crbug.com/119268.
|
| + // Returns the display's bounds in pixel coordinates.
|
| const Rect& bounds_in_pixel() const { return bounds_in_pixel_; }
|
| #endif
|
|
|
| - // Returns a string representation of the monitor;
|
| + // Returns a string representation of the display;
|
| std::string ToString() const;
|
|
|
| private:
|
| @@ -97,4 +97,4 @@ class UI_EXPORT Monitor {
|
|
|
| } // namespace gfx
|
|
|
| -#endif // UI_GFX_MONITOR_H_
|
| +#endif // UI_GFX_DISPLAY_H_
|
|
|