Handling image move event 45/237345/2
authorhyunho <hhstark.kang@samsung.com>
Mon, 29 Jun 2020 09:24:49 +0000 (18:24 +0900)
committerHyunho Kang <hhstark.kang@samsung.com>
Tue, 30 Jun 2020 02:30:16 +0000 (02:30 +0000)
Change-Id: If341282fb303f209d2ec8e5e377654748cf63a6e
Signed-off-by: hyunho <hhstark.kang@samsung.com>
screen_connector_remote_surface_evas/remote_surface_evas.cc
screen_connector_remote_surface_evas/remote_surface_evas_implementation.h

index b72710be90f2b281bbcbb9fdca62b934cdd98c58..32e1880e807dde5344e92562e5ef5f4c2065a0f5 100644 (file)
@@ -65,6 +65,44 @@ RemoteSurfaceEvas::Impl::Impl(RemoteSurfaceEvas* parent,
       win_ctx_(mock ? nullptr : new WindowContext()) {
 }
 
+void RemoteSurfaceEvas::Impl::OnMove(const EvasObject& obj, void* eventInfo) {
+  if (!is_init_) {
+    is_init_ = true;
+    return;
+  }
+
+  if (!auto_visibility_)
+    return;
+
+  Ecore_Wl2_Window *window = NULL;
+  Ecore_Evas *ee;
+  ee = ecore_evas_ecore_evas_get(
+    evas_object_evas_get(viewer_win_->GetRaw()));
+  window = ecore_evas_wayland2_window_get(ee);
+
+  unsigned int win_id = ecore_wl2_window_id_get(window);
+  if (parent_->IsVisibleArea() && !parent_->impl_->win_ctx_->IsFullyObscured(win_id)) {
+    parent_->SendVisibility(true);
+    visibility_ = RemoteSurfaceEvas::UNOBSCURED;
+  } else {
+    parent_->SendVisibility(false);
+    visibility_ = RemoteSurfaceEvas::FULLY_OBSCURED;
+  }
+}
+
+void RemoteSurfaceEvas::Impl::OnShow(const EvasObject& obj, void* eventInfo) {
+  LOGD("show");
+  OnMove(obj, eventInfo);
+}
+
+void RemoteSurfaceEvas::Impl::OnHide(const EvasObject& obj, void* eventInfo) {
+  LOGD("hide");
+}
+
+void RemoteSurfaceEvas::Impl::OnResize(const EvasObject& obj, void* eventInfo) {
+  LOGD("resize");
+  OnMove(obj, eventInfo);
+}
 
 bool RemoteSurfaceEvas::IsVisibleArea() const {
   int x, y, w, h;
index 096fcac0148aaa432384f4341a7a904f4ff909bc..064f71572171cb6673a5582866e634fc0f7957f1 100644 (file)
@@ -36,7 +36,10 @@ class RemoteSurfaceEvas::Impl : public ImageEventListener {
  private:
   Impl(RemoteSurfaceEvas* parent,
       std::shared_ptr<EvasObject> viewerWin, bool mock);
-
+  void OnMove(const EvasObject& obj, void* eventInfo) override;
+  void OnShow(const EvasObject& obj, void* eventInfo) override;
+  void OnHide(const EvasObject& obj, void* eventInfo) override;
+  void OnResize(const EvasObject& obj, void* eventInfo) override;
 
  private:
   friend class RemoteSurfaceEvas;