| OLD | NEW | 
|    1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |    1 // Copyright (c) 2013 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_MANAGER_MANAGED_DISPLAY_INFO_H_ |    5 #ifndef UI_DISPLAY_MANAGER_MANAGED_DISPLAY_INFO_H_ | 
|    6 #define UI_DISPLAY_MANAGER_MANAGED_DISPLAY_INFO_H_ |    6 #define UI_DISPLAY_MANAGER_MANAGED_DISPLAY_INFO_H_ | 
|    7  |    7  | 
|    8 #include <stdint.h> |    8 #include <stdint.h> | 
|    9  |    9  | 
|   10 #include <array> |   10 #include <array> | 
|   11 #include <map> |   11 #include <map> | 
|   12 #include <string> |   12 #include <string> | 
|   13 #include <vector> |   13 #include <vector> | 
|   14  |   14  | 
|   15 #include "base/files/file_path.h" |   15 #include "base/files/file_path.h" | 
|   16 #include "base/memory/ref_counted.h" |   16 #include "base/memory/ref_counted.h" | 
|   17 #include "ui/display/display.h" |   17 #include "ui/display/display.h" | 
|   18 #include "ui/display/display_export.h" |   18 #include "ui/display/manager/display_manager_export.h" | 
|   19 #include "ui/display/types/display_constants.h" |   19 #include "ui/display/types/display_constants.h" | 
|   20 #include "ui/gfx/geometry/insets.h" |   20 #include "ui/gfx/geometry/insets.h" | 
|   21 #include "ui/gfx/geometry/rect.h" |   21 #include "ui/gfx/geometry/rect.h" | 
|   22  |   22  | 
|   23 namespace display { |   23 namespace display { | 
|   24  |   24  | 
|   25 // A struct that represents all the data required for touch calibration for the |   25 // A struct that represents all the data required for touch calibration for the | 
|   26 // display. |   26 // display. | 
|   27 struct DISPLAY_EXPORT TouchCalibrationData { |   27 struct DISPLAY_MANAGER_EXPORT TouchCalibrationData { | 
|   28   // CalibrationPointPair.first -> display point |   28   // CalibrationPointPair.first -> display point | 
|   29   // CalibrationPointPair.second -> touch point |   29   // CalibrationPointPair.second -> touch point | 
|   30   using CalibrationPointPair = std::pair<gfx::Point, gfx::Point>; |   30   using CalibrationPointPair = std::pair<gfx::Point, gfx::Point>; | 
|   31   using CalibrationPointPairQuad = std::array<CalibrationPointPair, 4>; |   31   using CalibrationPointPairQuad = std::array<CalibrationPointPair, 4>; | 
|   32   TouchCalibrationData(); |   32   TouchCalibrationData(); | 
|   33   TouchCalibrationData(const CalibrationPointPairQuad& point_pairs, |   33   TouchCalibrationData(const CalibrationPointPairQuad& point_pairs, | 
|   34                        const gfx::Size& bounds); |   34                        const gfx::Size& bounds); | 
|   35   TouchCalibrationData(const TouchCalibrationData& calibration_data); |   35   TouchCalibrationData(const TouchCalibrationData& calibration_data); | 
|   36  |   36  | 
|   37   // Calibration point pairs used during calibration. Each point pair contains a |   37   // Calibration point pairs used during calibration. Each point pair contains a | 
|   38   // display point and the corresponding touch point. |   38   // display point and the corresponding touch point. | 
|   39   CalibrationPointPairQuad point_pairs; |   39   CalibrationPointPairQuad point_pairs; | 
|   40  |   40  | 
|   41   // Bounds of the touch display when the calibration was performed. |   41   // Bounds of the touch display when the calibration was performed. | 
|   42   gfx::Size bounds; |   42   gfx::Size bounds; | 
|   43 }; |   43 }; | 
|   44  |   44  | 
|   45 // A class that represents the display's mode info. |   45 // A class that represents the display's mode info. | 
|   46 class DISPLAY_EXPORT ManagedDisplayMode |   46 class DISPLAY_MANAGER_EXPORT ManagedDisplayMode | 
|   47     : public base::RefCounted<ManagedDisplayMode> { |   47     : public base::RefCounted<ManagedDisplayMode> { | 
|   48  public: |   48  public: | 
|   49   ManagedDisplayMode(); |   49   ManagedDisplayMode(); | 
|   50  |   50  | 
|   51   explicit ManagedDisplayMode(const gfx::Size& size); |   51   explicit ManagedDisplayMode(const gfx::Size& size); | 
|   52  |   52  | 
|   53   ManagedDisplayMode(const gfx::Size& size, |   53   ManagedDisplayMode(const gfx::Size& size, | 
|   54                      float refresh_rate, |   54                      float refresh_rate, | 
|   55                      bool is_interlaced, |   55                      bool is_interlaced, | 
|   56                      bool native); |   56                      bool native); | 
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   91   bool is_default_ = false;    // True if mode is one with default UI scale. |   91   bool is_default_ = false;    // True if mode is one with default UI scale. | 
|   92   float ui_scale_;             // The UI scale factor of the mode. |   92   float ui_scale_;             // The UI scale factor of the mode. | 
|   93   float device_scale_factor_;  // The device scale factor of the mode. |   93   float device_scale_factor_;  // The device scale factor of the mode. | 
|   94  |   94  | 
|   95   DISALLOW_COPY_AND_ASSIGN(ManagedDisplayMode); |   95   DISALLOW_COPY_AND_ASSIGN(ManagedDisplayMode); | 
|   96 }; |   96 }; | 
|   97  |   97  | 
|   98 // ManagedDisplayInfo contains metadata for each display. This is used to create |   98 // ManagedDisplayInfo contains metadata for each display. This is used to create | 
|   99 // |Display| as well as to maintain extra infomation to manage displays in ash |   99 // |Display| as well as to maintain extra infomation to manage displays in ash | 
|  100 // environment. This class is intentionally made copiable. |  100 // environment. This class is intentionally made copiable. | 
|  101 class DISPLAY_EXPORT ManagedDisplayInfo { |  101 class DISPLAY_MANAGER_EXPORT ManagedDisplayInfo { | 
|  102  public: |  102  public: | 
|  103   using ManagedDisplayModeList = std::vector<scoped_refptr<ManagedDisplayMode>>; |  103   using ManagedDisplayModeList = std::vector<scoped_refptr<ManagedDisplayMode>>; | 
|  104  |  104  | 
|  105   // Creates a ManagedDisplayInfo from string spec. 100+200-1440x800 creates |  105   // Creates a ManagedDisplayInfo from string spec. 100+200-1440x800 creates | 
|  106   // display |  106   // display | 
|  107   // whose size is 1440x800 at the location (100, 200) in host coordinates. |  107   // whose size is 1440x800 at the location (100, 200) in host coordinates. | 
|  108   // The format is |  108   // The format is | 
|  109   // |  109   // | 
|  110   // [origin-]widthxheight[*device_scale_factor][#resolutions list] |  110   // [origin-]widthxheight[*device_scale_factor][#resolutions list] | 
|  111   //     [/<properties>][@ui-scale] |  111   //     [/<properties>][@ui-scale] | 
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  386   gfx::Size maximum_cursor_size_; |  386   gfx::Size maximum_cursor_size_; | 
|  387  |  387  | 
|  388   // Information associated to touch calibration for the display. |  388   // Information associated to touch calibration for the display. | 
|  389   TouchCalibrationData touch_calibration_data_; |  389   TouchCalibrationData touch_calibration_data_; | 
|  390  |  390  | 
|  391   // If you add a new member, you need to update Copy(). |  391   // If you add a new member, you need to update Copy(). | 
|  392 }; |  392 }; | 
|  393  |  393  | 
|  394 // Resets the synthesized display id for testing. This |  394 // Resets the synthesized display id for testing. This | 
|  395 // is necessary to avoid overflowing the output index. |  395 // is necessary to avoid overflowing the output index. | 
|  396 void DISPLAY_EXPORT ResetDisplayIdForTest(); |  396 void DISPLAY_MANAGER_EXPORT ResetDisplayIdForTest(); | 
|  397  |  397  | 
|  398 }  // namespace display |  398 }  // namespace display | 
|  399  |  399  | 
|  400 #endif  //  UI_DISPLAY_MANAGER_MANAGED_DISPLAY_INFO_H_ |  400 #endif  //  UI_DISPLAY_MANAGER_MANAGED_DISPLAY_INFO_H_ | 
| OLD | NEW |