From 1e1572a6bde7d7c7f2dd01a3aa59d04d65b7a189 Mon Sep 17 00:00:00 2001 From: Doyoun Kang Date: Thu, 13 Aug 2020 12:58:01 +0900 Subject: [PATCH] DSWindowShell: add APIs to set/get IDSWaylandShellSurface Change-Id: Ib74dceb66e5c34f5ee79e6f0a12fb5e15c841cb8 --- src/DSWindowShell/DSWindowShell.cpp | 12 ++++++++++++ src/DSWindowShell/DSWindowShell.h | 4 ++++ src/DSWindowShell/DSWindowShellPrivate.cpp | 11 +++++++++++ src/DSWindowShell/DSWindowShellPrivate.h | 4 ++++ src/DSZone/DSZone.cpp | 3 ++- 5 files changed, 33 insertions(+), 1 deletion(-) diff --git a/src/DSWindowShell/DSWindowShell.cpp b/src/DSWindowShell/DSWindowShell.cpp index 8431fb8..2f80857 100644 --- a/src/DSWindowShell/DSWindowShell.cpp +++ b/src/DSWindowShell/DSWindowShell.cpp @@ -55,6 +55,18 @@ void DSWindowShell::destroy(void) } +void DSWindowShell::setShellSurface(IDSWaylandShellSurface *shellSurface) +{ + DS_GET_PRIV(DSWindowShell); + priv->setShellSurface(shellSurface); +} + +IDSWaylandShellSurface *DSWindowShell::getShellSurface(void) +{ + DS_GET_PRIV(DSWindowShell); + return priv->getShellSurface(); +} + bool DSWindowShell::setPosition(int x, int y) { DS_GET_PRIV(DSWindowShell); diff --git a/src/DSWindowShell/DSWindowShell.h b/src/DSWindowShell/DSWindowShell.h index 4522c2c..ee4aa1e 100644 --- a/src/DSWindowShell/DSWindowShell.h +++ b/src/DSWindowShell/DSWindowShell.h @@ -26,6 +26,7 @@ #include "DSStruct.h" #include "DSCore.h" +#include "IDSWaylandShell.h" namespace display_server { @@ -46,6 +47,9 @@ public: void destroy(void); + void setShellSurface(IDSWaylandShellSurface *zxdgSurface); + IDSWaylandShellSurface *getShellSurface(void); + bool setPosition(int x, int y); stPosition getPosition(void); diff --git a/src/DSWindowShell/DSWindowShellPrivate.cpp b/src/DSWindowShell/DSWindowShellPrivate.cpp index 1673c5f..07746d4 100644 --- a/src/DSWindowShell/DSWindowShellPrivate.cpp +++ b/src/DSWindowShell/DSWindowShellPrivate.cpp @@ -34,6 +34,7 @@ struct DTWindowShell DSWindowShellPrivate::DSWindowShellPrivate(DSWindowShell *p_ptr, DSWindow *window) : __p_ptr(p_ptr), __window(window), + __shellSurface(nullptr), __x(0), __y(0), __w(1), __h(1) { @@ -70,6 +71,16 @@ void DSWindowShellPrivate::destroy(void) } +void DSWindowShellPrivate::setShellSurface(IDSWaylandShellSurface *shellSurface) +{ + __shellSurface = shellSurface; +} + +IDSWaylandShellSurface *DSWindowShellPrivate::getShellSurface(void) +{ + return __shellSurface; +} + bool DSWindowShellPrivate::setPosition(int x, int y) { __x = x; diff --git a/src/DSWindowShell/DSWindowShellPrivate.h b/src/DSWindowShell/DSWindowShellPrivate.h index 4915c53..9a2e7ba 100644 --- a/src/DSWindowShell/DSWindowShellPrivate.h +++ b/src/DSWindowShell/DSWindowShellPrivate.h @@ -43,6 +43,9 @@ public: void destroy(void); + void setShellSurface(IDSWaylandShellSurface *shellSurface); + IDSWaylandShellSurface *getShellSurface(void); + bool setPosition(int x, int y); stPosition getPosition(void); @@ -90,6 +93,7 @@ private: private: DSWindow *__window; + IDSWaylandShellSurface *__shellSurface; int __x, __y; unsigned int __w, __h; }; diff --git a/src/DSZone/DSZone.cpp b/src/DSZone/DSZone.cpp index 9cce347..10545dc 100644 --- a/src/DSZone/DSZone.cpp +++ b/src/DSZone/DSZone.cpp @@ -126,7 +126,8 @@ void DSZone::__onShellSurfaceCreated(IDSWaylandShellSurface *waylandShellSurface DSWindowShell *dsWinShell = __findWindowShell(dsSurface); if (dsWinShell) { - DSLOG_DBG("DSZONE", "Find DSWindowShell (%p)... setWlShellSurface!", dsWinShell); + DSLOG_DBG("DSZONE", "Find DSWindowShell (%p)... setShellSurface!", dsWinShell); + dsWinShell->setShellSurface(waylandShellSurface); } } } -- 2.7.4