#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()
{
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
namespace display_server
{
-
-class DSZone
+class DSWaylandCompositor;
+class DSWaylandSurface;
+class DSZone : public DSObject
{
public:
explicit DSZone(std::shared_ptr<DSPolicyArea> policyArea);
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;
};
}