blob: 433040a04eed57b91e50057627f5e76bcad3fde0 [file] [log] [blame]
sergeyu@chromium.org3d34f662013-06-04 18:51:23 +00001/*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 *
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11#ifndef WEBRTC_MODULES_DESKTOP_CAPTURE_MAC_DESKTOP_CONFIGURATION_H_
12#define WEBRTC_MODULES_DESKTOP_CAPTURE_MAC_DESKTOP_CONFIGURATION_H_
13
14#include <ApplicationServices/ApplicationServices.h>
15#include <Carbon/Carbon.h>
16#include <vector>
17
18#include "webrtc/typedefs.h"
19#include "webrtc/modules/desktop_capture/desktop_geometry.h"
20
21namespace webrtc {
22
23// Describes the configuration of a specific display.
24struct MacDisplayConfiguration {
25 MacDisplayConfiguration();
26
27 // Cocoa identifier for this display.
28 CGDirectDisplayID id;
29
30 // Bounds of this display in Density-Independent Pixels (DIPs).
31 DesktopRect bounds;
32
33 // Bounds of this display in physical pixels.
34 DesktopRect pixel_bounds;
35
36 // Scale factor from DIPs to physical pixels.
37 float dip_to_pixel_scale;
38};
39
40typedef std::vector<MacDisplayConfiguration> MacDisplayConfigurations;
41
42// Describes the configuration of the whole desktop.
43struct MacDesktopConfiguration {
44 // Used to request bottom-up or top-down coordinates.
45 enum Origin { BottomLeftOrigin, TopLeftOrigin };
46
47 MacDesktopConfiguration();
48 ~MacDesktopConfiguration();
49
50 // Returns the desktop & display configurations in Cocoa-style "bottom-up"
51 // (the origin is the bottom-left of the primary monitor, and coordinates
52 // increase as you move up the screen) or Carbon-style "top-down" coordinates.
53 static MacDesktopConfiguration GetCurrent(Origin origin);
54
55 // Bounds of the desktop in Density-Independent Pixels (DIPs).
56 DesktopRect bounds;
57
58 // Bounds of the desktop in physical pixels.
59 DesktopRect pixel_bounds;
60
61 // Scale factor from DIPs to physical pixels.
62 float dip_to_pixel_scale;
63
64 // Configurations of the displays making up the desktop area.
65 MacDisplayConfigurations displays;
66};
67
68} // namespace webrtc
69
70#endif // WEBRTC_MODULES_DESKTOP_CAPTURE_MAC_DESKTOP_CONFIGURATION_H_