From 75705d9146c8854226401a9771e660f711046a8e Mon Sep 17 00:00:00 2001 From: Doyoun Kang Date: Mon, 24 Aug 2020 20:00:19 +0900 Subject: [PATCH] DSZone: add APIs for handling window's aux hint Change-Id: Idc4e1173fe05b767a487e3d0600b196ce5d63027 --- src/DSZone/DSZone.cpp | 37 +++++++++++++++++++++++++++++++++++++ src/DSZone/DSZone.h | 8 ++++++++ 2 files changed, 45 insertions(+) diff --git a/src/DSZone/DSZone.cpp b/src/DSZone/DSZone.cpp index bf2700f..ebbdae4 100644 --- a/src/DSZone/DSZone.cpp +++ b/src/DSZone/DSZone.cpp @@ -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 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; diff --git a/src/DSZone/DSZone.h b/src/DSZone/DSZone.h index acb3a61..96068bc 100644 --- a/src/DSZone/DSZone.h +++ b/src/DSZone/DSZone.h @@ -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 getWindowSupportedAuxHints(DSWaylandSurface *dswlSurface); + void activateWindow(DSWaylandSurface *dswlSurface); void raiseWindow(DSWaylandSurface* dswlSurface); void lowerWindow(DSWaylandSurface* dswlSurface); @@ -103,6 +108,8 @@ private: std::shared_ptr __findWindow(DSWaylandSurface *dswlSurface); DSWindowShell* __findWindowShell(DSWaylandSurface *dswlSurface); + void __setSupportAuxHints(void); + stPosition __position; stSize __size; std::list> __windowList; @@ -114,6 +121,7 @@ private: bool __stackChanged; std::map __windowShellMap; + std::list __supportedAuxHints; // signals DSSignal> __windowCreatedSignal; -- 2.7.4