OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #ifndef WEBRTC_MODULES_DESKTOP_CAPTURE_MAC_DESKTOP_CONFIGURATION_H_ | 11 #ifndef WEBRTC_MODULES_DESKTOP_CAPTURE_MAC_DESKTOP_CONFIGURATION_H_ |
12 #define WEBRTC_MODULES_DESKTOP_CAPTURE_MAC_DESKTOP_CONFIGURATION_H_ | 12 #define WEBRTC_MODULES_DESKTOP_CAPTURE_MAC_DESKTOP_CONFIGURATION_H_ |
13 | 13 |
14 #include <ApplicationServices/ApplicationServices.h> | 14 #include <ApplicationServices/ApplicationServices.h> |
15 #include <vector> | 15 #include <vector> |
16 | 16 |
17 #include "webrtc/typedefs.h" | 17 #include "webrtc/typedefs.h" |
18 #include "webrtc/modules/desktop_capture/desktop_geometry.h" | 18 #include "webrtc/modules/desktop_capture/desktop_geometry.h" |
19 | 19 |
20 namespace webrtc { | 20 namespace webrtc { |
21 | 21 |
22 // Describes the configuration of a specific display. | 22 // Describes the configuration of a specific display. |
23 struct MacDisplayConfiguration { | 23 struct MacDisplayConfiguration { |
24 MacDisplayConfiguration(); | 24 MacDisplayConfiguration(); |
| 25 MacDisplayConfiguration(const MacDisplayConfiguration& other); |
| 26 MacDisplayConfiguration(MacDisplayConfiguration&& other); |
| 27 ~MacDisplayConfiguration(); |
| 28 |
| 29 MacDisplayConfiguration& operator=(const MacDisplayConfiguration& other); |
| 30 MacDisplayConfiguration& operator=(MacDisplayConfiguration&& other); |
25 | 31 |
26 // Cocoa identifier for this display. | 32 // Cocoa identifier for this display. |
27 CGDirectDisplayID id; | 33 CGDirectDisplayID id = 0; |
28 | 34 |
29 // Bounds of this display in Density-Independent Pixels (DIPs). | 35 // Bounds of this display in Density-Independent Pixels (DIPs). |
30 DesktopRect bounds; | 36 DesktopRect bounds; |
31 | 37 |
32 // Bounds of this display in physical pixels. | 38 // Bounds of this display in physical pixels. |
33 DesktopRect pixel_bounds; | 39 DesktopRect pixel_bounds; |
34 | 40 |
35 // Scale factor from DIPs to physical pixels. | 41 // Scale factor from DIPs to physical pixels. |
36 float dip_to_pixel_scale; | 42 float dip_to_pixel_scale = 1.0f; |
37 }; | 43 }; |
38 | 44 |
39 typedef std::vector<MacDisplayConfiguration> MacDisplayConfigurations; | 45 typedef std::vector<MacDisplayConfiguration> MacDisplayConfigurations; |
40 | 46 |
41 // Describes the configuration of the whole desktop. | 47 // Describes the configuration of the whole desktop. |
42 struct MacDesktopConfiguration { | 48 struct MacDesktopConfiguration { |
43 // Used to request bottom-up or top-down coordinates. | 49 // Used to request bottom-up or top-down coordinates. |
44 enum Origin { BottomLeftOrigin, TopLeftOrigin }; | 50 enum Origin { BottomLeftOrigin, TopLeftOrigin }; |
45 | 51 |
46 MacDesktopConfiguration(); | 52 MacDesktopConfiguration(); |
| 53 MacDesktopConfiguration(const MacDesktopConfiguration& other); |
| 54 MacDesktopConfiguration(MacDesktopConfiguration&& other); |
47 ~MacDesktopConfiguration(); | 55 ~MacDesktopConfiguration(); |
48 | 56 |
| 57 MacDesktopConfiguration& operator=(const MacDesktopConfiguration& other); |
| 58 MacDesktopConfiguration& operator=(MacDesktopConfiguration&& other); |
| 59 |
49 // Returns the desktop & display configurations in Cocoa-style "bottom-up" | 60 // Returns the desktop & display configurations in Cocoa-style "bottom-up" |
50 // (the origin is the bottom-left of the primary monitor, and coordinates | 61 // (the origin is the bottom-left of the primary monitor, and coordinates |
51 // increase as you move up the screen). | 62 // increase as you move up the screen). |
52 static MacDesktopConfiguration GetCurrent(Origin origin); | 63 static MacDesktopConfiguration GetCurrent(Origin origin); |
53 | 64 |
54 // Returns true if the given desktop configuration equals this one. | 65 // Returns true if the given desktop configuration equals this one. |
55 bool Equals(const MacDesktopConfiguration& other); | 66 bool Equals(const MacDesktopConfiguration& other); |
56 | 67 |
57 // Returns the pointer to the display configuration with the specified id. | 68 // Returns the pointer to the display configuration with the specified id. |
58 const MacDisplayConfiguration* FindDisplayConfigurationById( | 69 const MacDisplayConfiguration* FindDisplayConfigurationById( |
59 CGDirectDisplayID id); | 70 CGDirectDisplayID id); |
60 | 71 |
61 // Bounds of the desktop excluding monitors with DPI settings different from | 72 // Bounds of the desktop excluding monitors with DPI settings different from |
62 // the main monitor. In Density-Independent Pixels (DIPs). | 73 // the main monitor. In Density-Independent Pixels (DIPs). |
63 DesktopRect bounds; | 74 DesktopRect bounds; |
64 | 75 |
65 // Same as bounds, but expressed in physical pixels. | 76 // Same as bounds, but expressed in physical pixels. |
66 DesktopRect pixel_bounds; | 77 DesktopRect pixel_bounds; |
67 | 78 |
68 // Scale factor from DIPs to physical pixels. | 79 // Scale factor from DIPs to physical pixels. |
69 float dip_to_pixel_scale; | 80 float dip_to_pixel_scale = 1.0f; |
70 | 81 |
71 // Configurations of the displays making up the desktop area. | 82 // Configurations of the displays making up the desktop area. |
72 MacDisplayConfigurations displays; | 83 MacDisplayConfigurations displays; |
73 }; | 84 }; |
74 | 85 |
75 } // namespace webrtc | 86 } // namespace webrtc |
76 | 87 |
77 #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_MAC_DESKTOP_CONFIGURATION_H_ | 88 #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_MAC_DESKTOP_CONFIGURATION_H_ |
OLD | NEW |