DSZone: add APIs for handling window's aux hint 16/242316/1
authorDoyoun Kang <doyoun.kang@samsung.com>
Mon, 24 Aug 2020 11:00:19 +0000 (20:00 +0900)
committerSung-Jin Park <sj76.park@samsung.com>
Tue, 25 Aug 2020 12:37:05 +0000 (21:37 +0900)
Change-Id: Idc4e1173fe05b767a487e3d0600b196ce5d63027

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

index bf2700f..ebbdae4 100644 (file)
@@ -59,6 +59,8 @@ DSZone::DSZone()
                if (__waylandShell)
                        __waylandShell->registerCallbackShellSurfaceCreated(this, std::bind(&DSZone::__onShellSurfaceCreated, this, std::placeholders::_1));
        }
+
+       __setSupportAuxHints();
 }
 
 DSZone::~DSZone()
@@ -73,6 +75,11 @@ DSZone::~DSZone()
                DSWaylandCompositor::releaseInstance();
 }
 
+void DSZone::__setSupportAuxHints(void)
+{
+       __supportedAuxHints.push_back("wm.policy.win.user.geometry");
+}
+
 void DSZone::setPosition(stPosition &position)
 {
        __position.x = position.x;
@@ -413,6 +420,36 @@ bool DSZone::setWindowPosition(DSWaylandSurface *dswSurface, int x, int y)
 */
 }
 
+void DSZone::addWindowAuxHint(DSWaylandSurface *dswlSurface, int32_t id, const std::string &name, const std::string &value)
+{
+       DSWindowShell *wShell = __findWindowShell(dswlSurface);
+       if (!wShell) return;
+
+       wShell->addAuxHint(id, name, value);
+}
+
+void DSZone::changeWindowAuxHint(DSWaylandSurface *dswlSurface, int32_t id, const std::string &value)
+{
+       DSWindowShell *wShell = __findWindowShell(dswlSurface);
+       if (!wShell) return;
+
+       wShell->changeAuxHint(id, value);
+}
+
+void DSZone::removeWindowAuxHint(DSWaylandSurface *dswlSurface, int32_t id)
+{
+       DSWindowShell *wShell = __findWindowShell(dswlSurface);
+       if (!wShell) return;
+
+       wShell->removeAuxHint(id);
+}
+
+std::list<std::string> DSZone::getWindowSupportedAuxHints(DSWaylandSurface *dswlSurface)
+{
+       // TODO: we have to change code to use DSPolicy instead of DSZone
+       return __supportedAuxHints;
+}
+
 void DSZone::activateWindow(DSWaylandSurface *dswlSurface)
 {
        if (!dswlSurface) return;
index acb3a61..96068bc 100644 (file)
@@ -70,6 +70,11 @@ public:
        bool setWindowGeometry(DSWaylandSurface *dswSurface, int x, int y, unsigned int w, unsigned h);
        bool setWindowPosition(DSWaylandSurface *dswSurface, int x, int y);
 
+       void addWindowAuxHint(DSWaylandSurface *dswlSurface, int32_t id, const std::string &name, const std::string &value);
+       void changeWindowAuxHint(DSWaylandSurface *dswlSurface, int32_t id, const std::string &value);
+       void removeWindowAuxHint(DSWaylandSurface *dswlSurface, int32_t id);
+       std::list<std::string> getWindowSupportedAuxHints(DSWaylandSurface *dswlSurface);
+
        void activateWindow(DSWaylandSurface *dswlSurface);
        void raiseWindow(DSWaylandSurface* dswlSurface);
        void lowerWindow(DSWaylandSurface* dswlSurface);
@@ -103,6 +108,8 @@ private:
        std::shared_ptr<DSWindow> __findWindow(DSWaylandSurface *dswlSurface);
        DSWindowShell* __findWindowShell(DSWaylandSurface *dswlSurface);
 
+       void __setSupportAuxHints(void);
+
        stPosition __position;
        stSize __size;
        std::list<std::shared_ptr<DSWindow>> __windowList;
@@ -114,6 +121,7 @@ private:
        bool __stackChanged;
 
        std::map<DSWaylandSurface*, DSWindowShell*> __windowShellMap;
+       std::list<std::string> __supportedAuxHints;
 
        // signals
        DSSignal<std::shared_ptr<DSWindow>> __windowCreatedSignal;