2013-10-16 02:42:38 +00:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
|
|
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#ifndef MODULES_DESKTOP_CAPTURE_MOUSE_CURSOR_H_
|
|
|
|
|
#define MODULES_DESKTOP_CAPTURE_MOUSE_CURSOR_H_
|
2013-10-16 02:42:38 +00:00
|
|
|
|
2016-03-16 15:58:08 -07:00
|
|
|
#include <memory>
|
|
|
|
|
|
2018-11-28 16:47:49 +01:00
|
|
|
#include "modules/desktop_capture/desktop_frame.h"
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "modules/desktop_capture/desktop_geometry.h"
|
2019-04-02 11:33:59 +02:00
|
|
|
#include "rtc_base/system/rtc_export.h"
|
2013-10-16 02:42:38 +00:00
|
|
|
|
|
|
|
|
namespace webrtc {
|
|
|
|
|
|
2019-04-02 11:33:59 +02:00
|
|
|
class RTC_EXPORT MouseCursor {
|
2013-10-16 02:42:38 +00:00
|
|
|
public:
|
2013-12-18 02:18:01 +00:00
|
|
|
MouseCursor();
|
|
|
|
|
|
2021-07-28 23:35:39 +02:00
|
|
|
// Takes ownership of `image`. `hotspot` must be within `image` boundaries.
|
2013-10-16 02:42:38 +00:00
|
|
|
MouseCursor(DesktopFrame* image, const DesktopVector& hotspot);
|
2013-12-18 02:18:01 +00:00
|
|
|
|
2013-10-16 02:42:38 +00:00
|
|
|
~MouseCursor();
|
|
|
|
|
|
2022-01-21 09:49:39 +09:00
|
|
|
MouseCursor(const MouseCursor&) = delete;
|
|
|
|
|
MouseCursor& operator=(const MouseCursor&) = delete;
|
|
|
|
|
|
2013-10-17 19:47:18 +00:00
|
|
|
static MouseCursor* CopyOf(const MouseCursor& cursor);
|
|
|
|
|
|
2013-12-18 02:18:01 +00:00
|
|
|
void set_image(DesktopFrame* image) { image_.reset(image); }
|
|
|
|
|
const DesktopFrame* image() const { return image_.get(); }
|
|
|
|
|
|
|
|
|
|
void set_hotspot(const DesktopVector& hotspot) { hotspot_ = hotspot; }
|
2013-10-17 19:47:18 +00:00
|
|
|
const DesktopVector& hotspot() const { return hotspot_; }
|
2013-10-16 02:42:38 +00:00
|
|
|
|
|
|
|
|
private:
|
2016-03-16 15:58:08 -07:00
|
|
|
std::unique_ptr<DesktopFrame> image_;
|
2013-10-16 02:42:38 +00:00
|
|
|
DesktopVector hotspot_;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace webrtc
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#endif // MODULES_DESKTOP_CAPTURE_MOUSE_CURSOR_H_
|