• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *  Copyright 2018 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 #include <memory>
12 
13 #include "modules/desktop_capture/desktop_capture_types.h"
14 #include "modules/desktop_capture/mouse_cursor_monitor.h"
15 
16 #if defined(WEBRTC_USE_X11)
17 #include "modules/desktop_capture/linux/mouse_cursor_monitor_x11.h"
18 #endif  // defined(WEBRTC_USE_X11)
19 
20 namespace webrtc {
21 
22 // static
CreateForWindow(const DesktopCaptureOptions & options,WindowId window)23 MouseCursorMonitor* MouseCursorMonitor::CreateForWindow(
24     const DesktopCaptureOptions& options,
25     WindowId window) {
26 #if defined(WEBRTC_USE_X11)
27   return MouseCursorMonitorX11::CreateForWindow(options, window);
28 #else
29   return nullptr;
30 #endif  // defined(WEBRTC_USE_X11)
31 }
32 
33 // static
CreateForScreen(const DesktopCaptureOptions & options,ScreenId screen)34 MouseCursorMonitor* MouseCursorMonitor::CreateForScreen(
35     const DesktopCaptureOptions& options,
36     ScreenId screen) {
37 #if defined(WEBRTC_USE_X11)
38   return MouseCursorMonitorX11::CreateForScreen(options, screen);
39 #else
40   return nullptr;
41 #endif  // defined(WEBRTC_USE_X11)
42 }
43 
44 // static
Create(const DesktopCaptureOptions & options)45 std::unique_ptr<MouseCursorMonitor> MouseCursorMonitor::Create(
46     const DesktopCaptureOptions& options) {
47 #if defined(WEBRTC_USE_X11)
48   return MouseCursorMonitorX11::Create(options);
49 #else
50   return nullptr;
51 #endif  // defined(WEBRTC_USE_X11)
52 }
53 
54 }  // namespace webrtc
55