OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef REMOTING_CAPTURER_MAC_DESKTOP_CONFIGURATION_H_ | |
6 #define REMOTING_CAPTURER_MAC_DESKTOP_CONFIGURATION_H_ | |
7 | |
8 #include <ApplicationServices/ApplicationServices.h> | |
9 #include <Carbon/Carbon.h> | |
10 #include <vector> | |
11 | |
12 #include "base/basictypes.h" | |
13 #include "third_party/skia/include/core/SkPoint.h" | |
14 #include "third_party/skia/include/core/SkRect.h" | |
15 | |
16 namespace remoting { | |
17 | |
18 // Describes the configuration of a specific display. | |
19 struct MacDisplayConfiguration { | |
20 MacDisplayConfiguration(); | |
21 | |
22 // Returns the current configuration of the specified display. | |
23 static MacDisplayConfiguration ForDisplay(CGDirectDisplayID display_id); | |
24 | |
25 // Cocoa identifier for this display. | |
26 CGDirectDisplayID id; | |
27 | |
28 // 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.
| |
29 SkIRect logical_bounds; | |
30 | |
31 // Bounds of the desktop in device resolution (i.e. physical) pixels. | |
32 SkIRect pixel_bounds; | |
33 | |
34 // Resolution of the desktop in Dots-Per-Inch. | |
35 SkIPoint dpi; | |
36 | |
37 // Scale factor from logical to pixel units. | |
38 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
| |
39 }; | |
40 | |
41 typedef std::vector<MacDisplayConfiguration> MacDisplayConfigurations; | |
42 | |
43 // Describes the configuration of the whole desktop. | |
44 struct MacDesktopConfiguration { | |
45 MacDesktopConfiguration(); | |
46 ~MacDesktopConfiguration(); | |
47 | |
48 // Returns the current configuration of the desktop. | |
49 static MacDesktopConfiguration GetCurrent(); | |
50 | |
51 // Bounds of the desktop in logical (72dpi) coordinates. | |
52 SkIRect logical_bounds; | |
53 | |
54 // Bounds of the desktop in device resolution (i.e. physical) pixels. | |
55 SkIRect pixel_bounds; | |
56 | |
57 // Resolution of the desktop in Dots-Per-Inch. | |
58 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!
| |
59 | |
60 // Scale factor from logical to pixel units. | |
61 float logical_to_pixel_scale; | |
62 | |
63 // Configurations of the displays making up the desktop area. | |
64 MacDisplayConfigurations displays; | |
65 }; | |
66 | |
67 } // namespace remoting | |
68 | |
69 #endif // REMOTING_CAPTURER_MAC_DESKTOP_CONFIGURATION_H_ | |
OLD | NEW |