DSZone : register SurfaceCreated Callback 61/241661/1
authorSooChan Lim <sc1.lim@samsung.com>
Fri, 24 Jul 2020 01:32:19 +0000 (10:32 +0900)
committerSung-Jin Park <sj76.park@samsung.com>
Thu, 20 Aug 2020 09:54:31 +0000 (18:54 +0900)
Change-Id: I1ffaa2f93c1e7f0f003f255f9c1f408d8f27028f

src/DSZone/DSZone.cpp
src/DSZone/DSZone.h

index 1d6388a..044b003 100644 (file)
@@ -1,15 +1,23 @@
 #include "DSZone.h"
 #include "DSPolicyAreaPrivate.h"
+#include "DSWaylandCompositor.h"
+#include "DSWaylandSurface.h"
 
 namespace display_server
 {
 
 DSZone::DSZone(std::shared_ptr<DSPolicyArea> policyArea)
-       : __policyArea(policyArea)
-{}
+       : __policyArea(policyArea),
+         __waylandCompositor(nullptr)
+{
+       __waylandCompositor = DSWaylandCompositor::getInstance();
+       __waylandCompositor->registerCallbackSurfaceCreated(this, std::bind(&DSZone::onSurfaceCreated, this, std::placeholders::_1));
+}
 
 DSZone::~DSZone()
-{}
+{
+       DSWaylandCompositor::releaseInstance();
+}
 
 int DSZone::getX()
 {
@@ -39,18 +47,10 @@ int DSZone::getHeight()
        return policyAreaPriv->getHeight();
 }
 
-bool DSZone::addWindow(std::shared_ptr<DSWindow> window)
+void DSZone::onSurfaceCreated(std::shared_ptr<DSWaylandSurface> waylandSurface)
 {
-       __windowList.push_back(window);
-
-       return true;
-}
-
-bool DSZone::removeWindow(std::shared_ptr<DSWindow> window)
-{
-       __windowList.remove(window);
-
-       return true;
+       //TODO: create DSWindow
+       //TODO: create DSRenderView
 }
 
 } //  namespace display_server
\ No newline at end of file
index 1babd66..8fa834f 100644 (file)
@@ -7,8 +7,9 @@
 
 namespace display_server
 {
-
-class DSZone
+class DSWaylandCompositor;
+class DSWaylandSurface;
+class DSZone : public DSObject
 {
 public:
        explicit DSZone(std::shared_ptr<DSPolicyArea> policyArea);
@@ -18,12 +19,13 @@ public:
        int getY();
        int getWidth();
        int getHeight();
-       bool addWindow(std::shared_ptr<DSWindow> window);
-       bool removeWindow(std::shared_ptr<DSWindow> window);
 
 private:
+       void onSurfaceCreated(std::shared_ptr<DSWaylandSurface> waylandSurface);
+
        std::shared_ptr<DSPolicyArea> __policyArea;
        std::list<std::shared_ptr<DSWindow>> __windowList;
+       DSWaylandCompositor *__waylandCompositor;
 };
 
 }