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 MEDIA_VIDEO_CAPTURE_SCREEN_MAC_DESKTOP_CONFIGURATION_H_ | |
6 #define MEDIA_VIDEO_CAPTURE_SCREEN_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 "media/base/media_export.h" | |
14 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" | |
15 | |
16 namespace media { | |
17 | |
18 // Describes the configuration of a specific display. | |
19 struct MEDIA_EXPORT MacDisplayConfiguration { | |
20 MacDisplayConfiguration(); | |
21 | |
22 // Cocoa identifier for this display. | |
23 CGDirectDisplayID id; | |
24 | |
25 // Bounds of this display in Density-Independent Pixels (DIPs). | |
26 webrtc::DesktopRect bounds; | |
27 | |
28 // Bounds of this display in physical pixels. | |
29 webrtc::DesktopRect pixel_bounds; | |
30 | |
31 // Scale factor from DIPs to physical pixels. | |
32 float dip_to_pixel_scale; | |
33 }; | |
34 | |
35 typedef std::vector<MacDisplayConfiguration> MacDisplayConfigurations; | |
36 | |
37 // Describes the configuration of the whole desktop. | |
38 struct MEDIA_EXPORT MacDesktopConfiguration { | |
39 // Used to request bottom-up or top-down coordinates. | |
40 enum Origin { BottomLeftOrigin, TopLeftOrigin }; | |
41 | |
42 MacDesktopConfiguration(); | |
43 ~MacDesktopConfiguration(); | |
44 | |
45 // Returns the desktop & display configurations in Cocoa-style "bottom-up" | |
46 // (the origin is the bottom-left of the primary monitor, and coordinates | |
47 // increase as you move up the screen) or Carbon-style "top-down" coordinates. | |
48 MEDIA_EXPORT static MacDesktopConfiguration GetCurrent(Origin origin); | |
49 | |
50 // Bounds of the desktop in Density-Independent Pixels (DIPs). | |
51 webrtc::DesktopRect bounds; | |
52 | |
53 // Bounds of the desktop in physical pixels. | |
54 webrtc::DesktopRect pixel_bounds; | |
55 | |
56 // Scale factor from DIPs to physical pixels. | |
57 float dip_to_pixel_scale; | |
58 | |
59 // Configurations of the displays making up the desktop area. | |
60 MacDisplayConfigurations displays; | |
61 }; | |
62 | |
63 } // namespace media | |
64 | |
65 #endif // MEDIA_VIDEO_CAPTURE_SCREEN_MAC_DESKTOP_CONFIGURATION_H_ | |
OLD | NEW |