summaryrefslogtreecommitdiff
path: root/screen_connector_remote_surface_evas
diff options
context:
space:
mode:
authorJunghoon Park <jh9216.park@samsung.com>2020-04-14 20:29:56 +0900
committerJunghoon Park <jh9216.park@samsung.com>2020-04-20 17:59:48 +0900
commita149cc60667a1a4149cfe4717dd5644b5f545814 (patch)
treea266a6e29ffbe13df8a2ed07579888f1c8fa3298 /screen_connector_remote_surface_evas
parent6caeccc191284b0bc0d3bf9ca056a97e29ec65fa (diff)
downloadscreen-connector-a149cc60667a1a4149cfe4717dd5644b5f545814.tar.gz
screen-connector-a149cc60667a1a4149cfe4717dd5644b5f545814.tar.bz2
screen-connector-a149cc60667a1a4149cfe4717dd5644b5f545814.zip
Add flag for mockup
Change-Id: I855b9eb607ae425d650deaa7467b6ab46ed16b73 Signed-off-by: Junghoon Park <jh9216.park@samsung.com>
Diffstat (limited to 'screen_connector_remote_surface_evas')
-rw-r--r--screen_connector_remote_surface_evas/remote_surface_evas.cc7
-rw-r--r--screen_connector_remote_surface_evas/remote_surface_watcher.cc12
-rw-r--r--screen_connector_remote_surface_evas/remote_surface_watcher.h2
-rw-r--r--screen_connector_remote_surface_evas/remote_surface_watcher_implementation.h3
-rw-r--r--screen_connector_remote_surface_evas/util.cc4
-rw-r--r--screen_connector_remote_surface_evas/util.h3
6 files changed, 20 insertions, 11 deletions
diff --git a/screen_connector_remote_surface_evas/remote_surface_evas.cc b/screen_connector_remote_surface_evas/remote_surface_evas.cc
index 008ec9a..07d21f9 100644
--- a/screen_connector_remote_surface_evas/remote_surface_evas.cc
+++ b/screen_connector_remote_surface_evas/remote_surface_evas.cc
@@ -39,7 +39,7 @@ RemoteSurfaceEvas::RemoteSurfaceEvas(const std::string& id,
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)) {
}
@@ -47,7 +47,7 @@ RemoteSurfaceEvas::RemoteSurfaceEvas(int rid, const std::string& id,
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)) {
}
@@ -60,7 +60,8 @@ RemoteSurfaceEvas& RemoteSurfaceEvas::operator=(
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,
diff --git a/screen_connector_remote_surface_evas/remote_surface_watcher.cc b/screen_connector_remote_surface_evas/remote_surface_watcher.cc
index 9639582..5ed7355 100644
--- a/screen_connector_remote_surface_evas/remote_surface_watcher.cc
+++ b/screen_connector_remote_surface_evas/remote_surface_watcher.cc
@@ -35,11 +35,15 @@ namespace screen_connector {
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) {
@@ -114,8 +118,8 @@ RemoteSurfaceWatcher::RemoteSurfaceWatcher(RemoteSurface::Type type,
}
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;
diff --git a/screen_connector_remote_surface_evas/remote_surface_watcher.h b/screen_connector_remote_surface_evas/remote_surface_watcher.h
index 037c734..cf494db 100644
--- a/screen_connector_remote_surface_evas/remote_surface_watcher.h
+++ b/screen_connector_remote_surface_evas/remote_surface_watcher.h
@@ -33,7 +33,7 @@ class EXPORT_API RemoteSurfaceWatcher : public IWatcherEvent {
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();
diff --git a/screen_connector_remote_surface_evas/remote_surface_watcher_implementation.h b/screen_connector_remote_surface_evas/remote_surface_watcher_implementation.h
index 24ac69c..f271f5a 100644
--- a/screen_connector_remote_surface_evas/remote_surface_watcher_implementation.h
+++ b/screen_connector_remote_surface_evas/remote_surface_watcher_implementation.h
@@ -28,6 +28,7 @@
#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 {
@@ -46,7 +47,7 @@ class RemoteSurfaceWatcher::Impl : AulHandle::IEventListener {
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:
diff --git a/screen_connector_remote_surface_evas/util.cc b/screen_connector_remote_surface_evas/util.cc
index 393f49b..957d3bd 100644
--- a/screen_connector_remote_surface_evas/util.cc
+++ b/screen_connector_remote_surface_evas/util.cc
@@ -28,7 +28,9 @@ using namespace std;
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(
diff --git a/screen_connector_remote_surface_evas/util.h b/screen_connector_remote_surface_evas/util.h
index 85faac1..d88445f 100644
--- a/screen_connector_remote_surface_evas/util.h
+++ b/screen_connector_remote_surface_evas/util.h
@@ -24,7 +24,8 @@
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