RemoteSurface::RemoteSurface(int rid, const std::string& id,
Type type, std::shared_ptr<WlSurface> wl_surface, bool mock)
: impl_(new Impl(this, rid, id, type, std::move(wl_surface), mock)) {
+ if (mock)
+ return;
impl_->Redirect();
}
RemoteSurface::Type type,
std::shared_ptr<EvasObject> viewerWin,
bool mock)
- : RemoteSurface(id, type, util::GetWlSurface(*viewerWin.get()), mock),
+ : RemoteSurface(id, type, util::GetWlSurface(*viewerWin.get(), mock), mock),
impl_(new Impl(this, viewerWin, mock)) {
}
RemoteSurface::Type type,
std::shared_ptr<EvasObject> viewerWin,
bool mock)
- : RemoteSurface(rid, id, type, util::GetWlSurface(*viewerWin.get()), mock),
+ : RemoteSurface(rid, id, type, util::GetWlSurface(*viewerWin.get(), mock), mock),
impl_(new Impl(this, viewerWin, mock)) {
}
RemoteSurfaceEvas::Impl::Impl(RemoteSurfaceEvas* parent,
std::shared_ptr<EvasObject> viewerWin, bool mock)
- : viewer_win_(viewerWin), parent_(parent), mock_(mock), win_ctx_(new WindowContext()) {
+ : viewer_win_(viewerWin), parent_(parent), mock_(mock),
+ win_ctx_(mock ? nullptr : new WindowContext()) {
}
void RemoteSurfaceEvas::Impl::OnMouseIn(const EvasObject& obj,
RemoteSurfaceWatcher::Impl::Impl(RemoteSurfaceWatcher* parent,
RemoteSurface::Type type,
std::shared_ptr<EvasObject> viewer_win,
- bool focused_only)
+ bool focused_only, bool mock)
: viewer_win_(viewer_win),
- aul_handle_(new AulHandle(this, (aul_screen_type_e)type)),
+ aul_handle_(mock ? new test::AulHandleMock(this,
+ (aul_screen_type_e)type) : new AulHandle(this,
+ (aul_screen_type_e)type)),
parent_(parent),
focused_only_(focused_only), block_update_(false) {
+ if (mock)
+ return;
if (focused_only_) {
int ret = aul_screen_connector_trigger_focused_force();
if (ret < 0) {
}
RemoteSurfaceWatcher::RemoteSurfaceWatcher(RemoteSurface::Type type,
- std::shared_ptr<EvasObject> viewerWin, bool watchFocusedOnly)
- : impl_(new Impl(this, type, viewerWin, watchFocusedOnly)) {
+ std::shared_ptr<EvasObject> viewerWin, bool watchFocusedOnly, bool mock)
+ : impl_(new Impl(this, type, viewerWin, watchFocusedOnly, mock)) {
}
RemoteSurfaceWatcher::~RemoteSurfaceWatcher() = default;
std::shared_ptr<EvasObject> viewerWin);
RemoteSurfaceWatcher(RemoteSurface::Type type,
std::shared_ptr<EvasObject> viewerWin,
- bool watchFocusedOnly);
+ bool watchFocusedOnly, bool mock = false);
RemoteSurfaceWatcher(RemoteSurfaceWatcher&&) noexcept;
RemoteSurfaceWatcher& operator=(RemoteSurfaceWatcher&&) noexcept;
virtual ~RemoteSurfaceWatcher();
#include "screen_connector_remote_surface_evas/remote_surface_mixed_internal.h"
#include "screen_connector_remote_surface_evas/watcher_image_internal.h"
#include "screen_connector_remote_surface/aul_handle_internal.h"
+#include "screen_connector_remote_surface/aul_handle_mock_internal.h"
namespace screen_connector {
private:
Impl(RemoteSurfaceWatcher* parent, RemoteSurface::Type type,
std::shared_ptr<EvasObject> viewer_win,
- bool focused_only);
+ bool focused_only, bool mock = false);
void UpdateFocusedSurface();
private:
namespace screen_connector {
namespace util {
- std::shared_ptr<WlSurface> GetWlSurface(const EvasObject& win) {
+ std::shared_ptr<WlSurface> GetWlSurface(const EvasObject& win, bool mock) {
+ if (mock)
+ return nullptr;
struct wl_surface* surface;
Ecore_Wl2_Window* wl_win;
Ecore_Evas *ee = ecore_evas_ecore_evas_get(
namespace screen_connector {
namespace util {
- EXPORT_API std::shared_ptr<WlSurface> GetWlSurface(const EvasObject& win);
+ EXPORT_API std::shared_ptr<WlSurface> GetWlSurface(const EvasObject& win,
+ bool mock = false);
} // namespace util
} // namespace screen_connector