Index: remoting/capturer/mac/desktop_configuration.h |
diff --git a/remoting/capturer/mac/desktop_configuration.h b/remoting/capturer/mac/desktop_configuration.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2e76f8d399e9e5e362b5fb3a446fe7e80d924042 |
--- /dev/null |
+++ b/remoting/capturer/mac/desktop_configuration.h |
@@ -0,0 +1,69 @@ |
+// 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 REMOTING_CAPTURER_MAC_DESKTOP_CONFIGURATION_H_ |
+#define REMOTING_CAPTURER_MAC_DESKTOP_CONFIGURATION_H_ |
+ |
+#include <ApplicationServices/ApplicationServices.h> |
+#include <Carbon/Carbon.h> |
+#include <vector> |
+ |
+#include "base/basictypes.h" |
+#include "third_party/skia/include/core/SkPoint.h" |
+#include "third_party/skia/include/core/SkRect.h" |
+ |
+namespace remoting { |
+ |
+// Describes the configuration of a specific display. |
+struct MacDisplayConfiguration { |
+ MacDisplayConfiguration(); |
+ |
+ // Returns the current configuration of the specified display. |
+ static MacDisplayConfiguration ForDisplay(CGDirectDisplayID display_id); |
+ |
+ // Cocoa identifier for this display. |
+ CGDirectDisplayID id; |
+ |
+ // Bounds of this display in logical (72dpi) coordinates. |
Nico
2013/01/24 00:26:58
We call "logical coordinates" "dips" or "device-in
Wez
2013/01/24 00:57:30
Yes, I was going to describe these as DIPs but wan
Wez
2013/01/25 00:32:49
Done.
|
+ SkIRect logical_bounds; |
+ |
+ // Bounds of the desktop in device resolution (i.e. physical) pixels. |
+ SkIRect pixel_bounds; |
+ |
+ // Resolution of the desktop in Dots-Per-Inch. |
+ SkIPoint dpi; |
+ |
+ // Scale factor from logical to pixel units. |
+ float logical_to_pixel_scale; |
Nico
2013/01/24 00:26:58
For what it's worth, we call this "device_scale" i
Wez
2013/01/24 00:57:30
Yes; I'm not keen on that name because we then end
|
+}; |
+ |
+typedef std::vector<MacDisplayConfiguration> MacDisplayConfigurations; |
+ |
+// Describes the configuration of the whole desktop. |
+struct MacDesktopConfiguration { |
+ MacDesktopConfiguration(); |
+ ~MacDesktopConfiguration(); |
+ |
+ // Returns the current configuration of the desktop. |
+ static MacDesktopConfiguration GetCurrent(); |
+ |
+ // Bounds of the desktop in logical (72dpi) coordinates. |
+ SkIRect logical_bounds; |
+ |
+ // Bounds of the desktop in device resolution (i.e. physical) pixels. |
+ SkIRect pixel_bounds; |
+ |
+ // Resolution of the desktop in Dots-Per-Inch. |
+ SkIPoint dpi; |
Nico
2013/01/24 00:26:58
I'm not sure if dpi is a useful metric on OS X, is
Wez
2013/01/24 00:57:30
We use DPI on-the-wire in Chromoting, but you're r
Wez
2013/01/25 00:32:49
Done. Thanks for the suggestion!
|
+ |
+ // Scale factor from logical to pixel units. |
+ float logical_to_pixel_scale; |
+ |
+ // Configurations of the displays making up the desktop area. |
+ MacDisplayConfigurations displays; |
+}; |
+ |
+} // namespace remoting |
+ |
+#endif // REMOTING_CAPTURER_MAC_DESKTOP_CONFIGURATION_H_ |