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 CHROMEOS_DISPLAY_OUTPUT_UTIL_H_ | 5 #ifndef CHROMEOS_DISPLAY_OUTPUT_UTIL_H_ |
6 #define CHROMEOS_DISPLAY_OUTPUT_UTIL_H_ | 6 #define CHROMEOS_DISPLAY_OUTPUT_UTIL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "chromeos/chromeos_export.h" | 11 #include "chromeos/chromeos_export.h" |
12 | 12 |
13 // Forward declarations for Xlib and Xrandr. | 13 // Forward declarations for Xlib and Xrandr. |
14 // This is so unused X definitions don't pollute the namespace. | 14 // This is so unused X definitions don't pollute the namespace. |
15 typedef unsigned long XID; | 15 typedef unsigned long XID; |
16 | 16 |
17 namespace chromeos { | 17 namespace chromeos { |
18 | 18 |
19 // Generates the display id for the pair of |output| and |index| and store | 19 // Gets the EDID data from |output| and generates the display id through |
20 // in |display_id_out|. Returns true if the display id is successfully | 20 // |GetDisplayIdFromEDID|. |
21 // generated, or false otherwise. | |
22 CHROMEOS_EXPORT bool GetDisplayId(XID output, size_t index, | 21 CHROMEOS_EXPORT bool GetDisplayId(XID output, size_t index, |
23 int64* display_id_out); | 22 int64* display_id_out); |
24 | 23 |
| 24 // Generates the display id for the pair of |prop| with |nitems| length and |
| 25 // |index|, and store in |display_id_out|. Returns true if the display id is |
| 26 // successfully generated, or false otherwise. |
| 27 CHROMEOS_EXPORT bool GetDisplayIdFromEDID(const unsigned char* prop, |
| 28 unsigned long nitems, |
| 29 size_t index, |
| 30 int64* display_id_out); |
| 31 |
25 // Generates the human readable string from EDID obtained for |output|. | 32 // Generates the human readable string from EDID obtained for |output|. |
26 CHROMEOS_EXPORT std::string GetDisplayName(XID output); | 33 CHROMEOS_EXPORT std::string GetDisplayName(XID output); |
27 | 34 |
28 // Gets the overscan flag from |output| and stores to |flag|. Returns true if | 35 // Gets the overscan flag from |output| and stores to |flag|. Returns true if |
29 // the flag is found. Otherwise returns false and doesn't touch |flag|. The | 36 // the flag is found. Otherwise returns false and doesn't touch |flag|. The |
30 // output will produce overscan if |flag| is set to true, but the output may | 37 // output will produce overscan if |flag| is set to true, but the output may |
31 // still produce overscan even though it returns true and |flag| is set to | 38 // still produce overscan even though it returns true and |flag| is set to |
32 // false. | 39 // false. |
33 CHROMEOS_EXPORT bool GetOutputOverscanFlag(XID output, bool* flag); | 40 CHROMEOS_EXPORT bool GetOutputOverscanFlag(XID output, bool* flag); |
34 | 41 |
(...skipping 12 matching lines...) Expand all Loading... |
47 CHROMEOS_EXPORT bool ParseOutputOverscanFlag(const unsigned char* prop, | 54 CHROMEOS_EXPORT bool ParseOutputOverscanFlag(const unsigned char* prop, |
48 unsigned long nitems, | 55 unsigned long nitems, |
49 bool* flag); | 56 bool* flag); |
50 | 57 |
51 // Returns true if an output named |name| is an internal display. | 58 // Returns true if an output named |name| is an internal display. |
52 CHROMEOS_EXPORT bool IsInternalOutputName(const std::string& name); | 59 CHROMEOS_EXPORT bool IsInternalOutputName(const std::string& name); |
53 | 60 |
54 } // namespace chromeos | 61 } // namespace chromeos |
55 | 62 |
56 #endif // CHROMEOS_DISPLAY_OUTPUT_UTIL_H_ | 63 #endif // CHROMEOS_DISPLAY_OUTPUT_UTIL_H_ |
OLD | NEW |