mouse_cursor.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  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. #ifndef MODULES_DESKTOP_CAPTURE_MOUSE_CURSOR_H_
  11. #define MODULES_DESKTOP_CAPTURE_MOUSE_CURSOR_H_
  12. #include <memory>
  13. #include "modules/desktop_capture/desktop_frame.h"
  14. #include "modules/desktop_capture/desktop_geometry.h"
  15. #include "rtc_base/constructor_magic.h"
  16. #include "rtc_base/system/rtc_export.h"
  17. namespace webrtc {
  18. class RTC_EXPORT MouseCursor {
  19. public:
  20. MouseCursor();
  21. // Takes ownership of |image|. |hotspot| must be within |image| boundaries.
  22. MouseCursor(DesktopFrame* image, const DesktopVector& hotspot);
  23. ~MouseCursor();
  24. static MouseCursor* CopyOf(const MouseCursor& cursor);
  25. void set_image(DesktopFrame* image) { image_.reset(image); }
  26. const DesktopFrame* image() const { return image_.get(); }
  27. void set_hotspot(const DesktopVector& hotspot) { hotspot_ = hotspot; }
  28. const DesktopVector& hotspot() const { return hotspot_; }
  29. private:
  30. std::unique_ptr<DesktopFrame> image_;
  31. DesktopVector hotspot_;
  32. RTC_DISALLOW_COPY_AND_ASSIGN(MouseCursor);
  33. };
  34. } // namespace webrtc
  35. #endif // MODULES_DESKTOP_CAPTURE_MOUSE_CURSOR_H_