Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(199)

Unified Diff: chromeos/display/output_util.h

Issue 15067012: Move chromeos specific utility functions for display to chromeos/display (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added test Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/display/output_configurator_unittest.cc ('k') | chromeos/display/output_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/display/output_util.h
diff --git a/chromeos/display/output_util.h b/chromeos/display/output_util.h
new file mode 100644
index 0000000000000000000000000000000000000000..5ecda9bf055a6d6b6c1bf23c612a637739c37c26
--- /dev/null
+++ b/chromeos/display/output_util.h
@@ -0,0 +1,56 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROMEOS_DISPLAY_OUTPUT_UTIL_H_
+#define CHROMEOS_DISPLAY_OUTPUT_UTIL_H_
+
+#include <string>
+
+#include "base/basictypes.h"
+#include "chromeos/chromeos_export.h"
+
+// Forward declarations for Xlib and Xrandr.
+// This is so unused X definitions don't pollute the namespace.
+typedef unsigned long XID;
+
+namespace chromeos {
+
+// Generates the display id for the pair of |output| and |index| and store
+// in |display_id_out|. Returns true if the display id is successfully
+// generated, or false otherwise.
+CHROMEOS_EXPORT bool GetDisplayId(XID output, size_t index,
+ int64* display_id_out);
+
+// Generates the human readable string from EDID obtained for |output|.
+CHROMEOS_EXPORT std::string GetDisplayName(XID output);
+
+// Gets the overscan flag from |output| and stores to |flag|. Returns true if
+// the flag is found. Otherwise returns false and doesn't touch |flag|. The
+// output will produce overscan if |flag| is set to true, but the output may
+// still produce overscan even though it returns true and |flag| is set to
+// false.
+CHROMEOS_EXPORT bool GetOutputOverscanFlag(XID output, bool* flag);
+
+// Parses |prop| as EDID data and stores extracted data into |manufacturer_id|,
+// |product_code|, and |human_readable_name| and returns true. NULL can be
+// passed for unwanted output parameters. This is exported for
+// x11_util_unittest.cc.
+CHROMEOS_EXPORT bool ParseOutputDeviceData(const unsigned char* prop,
+ unsigned long nitems,
+ uint16* manufacturer_id,
+ uint16* product_code,
+ std::string* human_readable_name);
+
+// Parses |prop| as EDID data and stores the overscan flag to |flag|. Returns
+// true if the flag is found. This is exported for x11_util_unittest.cc.
+CHROMEOS_EXPORT bool ParseOutputOverscanFlag(const unsigned char* prop,
+ unsigned long nitems,
+ bool* flag);
+
+// Returns true if an output named |name| is an internal display.
+CHROMEOS_EXPORT bool IsInternalOutputName(const std::string& name);
+
+} // namespace chromeos
+
+#endif // CHROMEOS_DISPLAY_OUTPUT_UTIL_H_
« no previous file with comments | « chromeos/display/output_configurator_unittest.cc ('k') | chromeos/display/output_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698