DSZone: add DSZone class 24/241624/1
authorSooChan Lim <sc1.lim@samsung.com>
Tue, 14 Jul 2020 04:50:46 +0000 (13:50 +0900)
committerSung-Jin Park <sj76.park@samsung.com>
Thu, 20 Aug 2020 09:53:54 +0000 (18:53 +0900)
Change-Id: I6bed4b0faa3dab72740447c73cda4beece6588cd

src/DSZone/DSZone.cpp [new file with mode: 0644]
src/DSZone/DSZone.h [new file with mode: 0644]
src/meson.build

diff --git a/src/DSZone/DSZone.cpp b/src/DSZone/DSZone.cpp
new file mode 100644 (file)
index 0000000..1d6388a
--- /dev/null
@@ -0,0 +1,56 @@
+#include "DSZone.h"
+#include "DSPolicyAreaPrivate.h"
+
+namespace display_server
+{
+
+DSZone::DSZone(std::shared_ptr<DSPolicyArea> policyArea)
+       : __policyArea(policyArea)
+{}
+
+DSZone::~DSZone()
+{}
+
+int DSZone::getX()
+{
+       DSPolicyAreaPrivate *policyAreaPriv = DSPolicyAreaPrivate::getPrivate(__policyArea.get());
+
+       return policyAreaPriv->getX();
+}
+
+int DSZone::getY()
+{
+       DSPolicyAreaPrivate *policyAreaPriv = DSPolicyAreaPrivate::getPrivate(__policyArea.get());
+
+       return policyAreaPriv->getY();
+}
+
+int DSZone::getWidth()
+{
+       DSPolicyAreaPrivate *policyAreaPriv = DSPolicyAreaPrivate::getPrivate(__policyArea.get());
+
+       return policyAreaPriv->getWidth();
+}
+
+int DSZone::getHeight()
+{
+       DSPolicyAreaPrivate *policyAreaPriv = DSPolicyAreaPrivate::getPrivate(__policyArea.get());
+
+       return policyAreaPriv->getHeight();
+}
+
+bool DSZone::addWindow(std::shared_ptr<DSWindow> window)
+{
+       __windowList.push_back(window);
+
+       return true;
+}
+
+bool DSZone::removeWindow(std::shared_ptr<DSWindow> window)
+{
+       __windowList.remove(window);
+
+       return true;
+}
+
+} //  namespace display_server
\ No newline at end of file
diff --git a/src/DSZone/DSZone.h b/src/DSZone/DSZone.h
new file mode 100644 (file)
index 0000000..1babd66
--- /dev/null
@@ -0,0 +1,31 @@
+#ifndef __DS_ZONE_H__
+#define __DS_ZONE_H__
+
+#include <DSCore.h>
+#include "DSWindow.h"
+#include "DSPolicyArea.h"
+
+namespace display_server
+{
+
+class DSZone
+{
+public:
+       explicit DSZone(std::shared_ptr<DSPolicyArea> policyArea);
+       virtual ~DSZone();
+
+       int getX();
+       int getY();
+       int getWidth();
+       int getHeight();
+       bool addWindow(std::shared_ptr<DSWindow> window);
+       bool removeWindow(std::shared_ptr<DSWindow> window);
+
+private:
+       std::shared_ptr<DSPolicyArea> __policyArea;
+       std::list<std::shared_ptr<DSWindow>> __windowList;
+};
+
+}
+
+#endif
index ce199a7..f9a3fdb 100644 (file)
@@ -47,6 +47,7 @@ libds_srcs = [
        'DSCore/DSCore.h',
        'DSWindow/DSWindow.cpp',
        'DSWindow/DSWindowPrivate.cpp',
+       'DSZone/DSZone.cpp',
        ]
 
 libds_wayland_srcs = [
@@ -170,6 +171,7 @@ libds_include_dirs = include_directories(
        './DSCore',
        './DSWaylandServer',
        './DSWindow',
+       './DSZone',
        )
 
 libds_lib = shared_library(