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 <Carbon/Carbon.h> |
15 #include <vector> | 16 #include <vector> |
16 | 17 |
17 #include "webrtc/typedefs.h" | 18 #include "webrtc/typedefs.h" |
18 #include "webrtc/modules/desktop_capture/desktop_geometry.h" | 19 #include "webrtc/modules/desktop_capture/desktop_geometry.h" |
19 | 20 |
20 namespace webrtc { | 21 namespace webrtc { |
21 | 22 |
22 // Describes the configuration of a specific display. | 23 // Describes the configuration of a specific display. |
23 struct MacDisplayConfiguration { | 24 struct MacDisplayConfiguration { |
24 MacDisplayConfiguration(); | 25 MacDisplayConfiguration(); |
(...skipping 16 matching lines...) Expand all Loading... |
41 // Describes the configuration of the whole desktop. | 42 // Describes the configuration of the whole desktop. |
42 struct MacDesktopConfiguration { | 43 struct MacDesktopConfiguration { |
43 // Used to request bottom-up or top-down coordinates. | 44 // Used to request bottom-up or top-down coordinates. |
44 enum Origin { BottomLeftOrigin, TopLeftOrigin }; | 45 enum Origin { BottomLeftOrigin, TopLeftOrigin }; |
45 | 46 |
46 MacDesktopConfiguration(); | 47 MacDesktopConfiguration(); |
47 ~MacDesktopConfiguration(); | 48 ~MacDesktopConfiguration(); |
48 | 49 |
49 // Returns the desktop & display configurations in Cocoa-style "bottom-up" | 50 // Returns the desktop & display configurations in Cocoa-style "bottom-up" |
50 // (the origin is the bottom-left of the primary monitor, and coordinates | 51 // (the origin is the bottom-left of the primary monitor, and coordinates |
51 // increase as you move up the screen). | 52 // increase as you move up the screen) or Carbon-style "top-down" coordinates. |
52 static MacDesktopConfiguration GetCurrent(Origin origin); | 53 static MacDesktopConfiguration GetCurrent(Origin origin); |
53 | 54 |
54 // Returns true if the given desktop configuration equals this one. | 55 // Returns true if the given desktop configuration equals this one. |
55 bool Equals(const MacDesktopConfiguration& other); | 56 bool Equals(const MacDesktopConfiguration& other); |
56 | 57 |
57 // Returns the pointer to the display configuration with the specified id. | 58 // Returns the pointer to the display configuration with the specified id. |
58 const MacDisplayConfiguration* FindDisplayConfigurationById( | 59 const MacDisplayConfiguration* FindDisplayConfigurationById( |
59 CGDirectDisplayID id); | 60 CGDirectDisplayID id); |
60 | 61 |
61 // Bounds of the desktop excluding monitors with DPI settings different from | 62 // Bounds of the desktop excluding monitors with DPI settings different from |
62 // the main monitor. In Density-Independent Pixels (DIPs). | 63 // the main monitor. In Density-Independent Pixels (DIPs). |
63 DesktopRect bounds; | 64 DesktopRect bounds; |
64 | 65 |
65 // Same as bounds, but expressed in physical pixels. | 66 // Same as bounds, but expressed in physical pixels. |
66 DesktopRect pixel_bounds; | 67 DesktopRect pixel_bounds; |
67 | 68 |
68 // Scale factor from DIPs to physical pixels. | 69 // Scale factor from DIPs to physical pixels. |
69 float dip_to_pixel_scale; | 70 float dip_to_pixel_scale; |
70 | 71 |
71 // Configurations of the displays making up the desktop area. | 72 // Configurations of the displays making up the desktop area. |
72 MacDisplayConfigurations displays; | 73 MacDisplayConfigurations displays; |
73 }; | 74 }; |
74 | 75 |
75 } // namespace webrtc | 76 } // namespace webrtc |
76 | 77 |
77 #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_MAC_DESKTOP_CONFIGURATION_H_ | 78 #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_MAC_DESKTOP_CONFIGURATION_H_ |
OLD | NEW |