IDSWaylandShell: add Interface class for Shell and ShellSurface 71/241771/1
authorDoyoun Kang <doyoun.kang@samsung.com>
Mon, 10 Aug 2020 08:34:29 +0000 (17:34 +0900)
committerSung-Jin Park <sj76.park@samsung.com>
Thu, 20 Aug 2020 10:10:28 +0000 (19:10 +0900)
- IDSWaylandShell
: implemented by zxdg_shell_v6, zxdg_shell_v5, etc.
- IDSWaylandShellSurface
: implemented by zxdg_surface, zxdg_shell_v5, etc.

Change-Id: Ia6f14a34b06a879dfb966f6fb92ba28ce389b69d

src/DSWaylandExtension/DSWaylandExtension.cpp
src/DSWaylandExtension/DSWaylandExtensionPrivate.h
src/DSWaylandServer/DSWaylandZxdgShellV6.cpp
src/DSWaylandServer/DSWaylandZxdgShellV6.h
src/DSWaylandServer/IDSWaylandShell.h [new file with mode: 0644]

index 3a38a3a..5431bac 100644 (file)
@@ -31,7 +31,7 @@ bool DSWaylandExtensionPrivate::init(DSWaylandCompositor *compositor)
 
        try
        {
-               __initZxdgShellV6();
+               __initShell();
                __initTizenPolicy();
                __initTizenAppinfoMgr();
        }
@@ -48,7 +48,7 @@ bool DSWaylandExtensionPrivate::init(DSWaylandCompositor *compositor)
        return true;
 }
 
-bool DSWaylandExtensionPrivate::__initZxdgShellV6(void)
+bool DSWaylandExtensionPrivate::__initShell(void)
 {
        __zxdgShell = std::make_shared<DSWaylandZxdgShellV6>(__compositor);
        if (__zxdgShell == nullptr)
index c7b8ab0..9309c69 100644 (file)
@@ -20,7 +20,7 @@ public:
        bool init(DSWaylandCompositor *compositor);
 
 private:
-       bool __initZxdgShellV6(void);
+       bool __initShell(void);
        bool __initTizenPolicy(void);
        bool __initTizenAppinfoMgr(void);
 
@@ -34,4 +34,4 @@ private:
 
 } // namespace display_server
 
-#endif // __DS_WAYLAND_EXTENSION_PRIVATE_H__
\ No newline at end of file
+#endif // __DS_WAYLAND_EXTENSION_PRIVATE_H__
index 2d1b918..6ee322a 100644 (file)
@@ -16,12 +16,12 @@ namespace display_server
  *****************************************/
 
 DSWaylandZxdgShellV6::DSWaylandZxdgShellV6()
-       : DSObject(), DS_INIT_PRIVATE_PTR(DSWaylandZxdgShellV6)
+       : IDSWaylandShell(), DS_INIT_PRIVATE_PTR(DSWaylandZxdgShellV6)
 {
 }
 
 DSWaylandZxdgShellV6::DSWaylandZxdgShellV6(DSWaylandCompositor *wlCompositor)
-       : DSObject(), DS_INIT_PRIVATE_PTR(DSWaylandZxdgShellV6)
+       : IDSWaylandShell(), DS_INIT_PRIVATE_PTR(DSWaylandZxdgShellV6)
 {
        this->init(wlCompositor->display(), ZXDG_SHELL_V6_VERSION);
 }
@@ -58,7 +58,7 @@ std::list<DSWaylandZxdgSurfaceV6 *> DSWaylandZxdgShellV6::getSurfaceList()
        return priv->getSurfaceList();
 }
 
-void DSWaylandZxdgShellV6::registerCallbackShellSurfaceCreated(DSObject *slot, std::function<void(DSWaylandZxdgSurfaceV6*)> func)
+void DSWaylandZxdgShellV6::registerCallbackShellSurfaceCreated(DSObject *slot, std::function<void(IDSWaylandShellSurface*)> func)
 {
        __zxdgSurfaceCreatedSignal.connect(slot, func);
 }
@@ -191,12 +191,12 @@ void DSWaylandZxdgPositionerV6Private::zxdg_positioner_v6_set_offset(zxdg_positi
  *****************************************/
 
 DSWaylandZxdgSurfaceV6::DSWaylandZxdgSurfaceV6()
-       : DSObject(), DS_INIT_PRIVATE_PTR(DSWaylandZxdgSurfaceV6)
+       : IDSWaylandShellSurface(), DS_INIT_PRIVATE_PTR(DSWaylandZxdgSurfaceV6)
 {
 }
 
 DSWaylandZxdgSurfaceV6::DSWaylandZxdgSurfaceV6(struct ::wl_client *client, int id, int ver)
-       : DSObject(), DS_INIT_PRIVATE_PTR(DSWaylandZxdgSurfaceV6)
+       : IDSWaylandShellSurface(), DS_INIT_PRIVATE_PTR(DSWaylandZxdgSurfaceV6)
 {
        this->init(client, id, ver);
 }
index 5c507b6..2883fd9 100644 (file)
@@ -4,6 +4,7 @@
 #include <DSCore.h>
 #include <DSSignal.h>
 #include <DSObject.h>
+#include "IDSWaylandShell.h"
 
 #include <wayland-server-core.h>
 
@@ -22,7 +23,7 @@ class DSWaylandZxdgSurfaceV6Private;
 class DSWaylandZxdgToplevelV6Private;
 class DSWaylandZxdgPopupV6Private;
 
-class DSWaylandZxdgShellV6 : public DSObject
+class DSWaylandZxdgShellV6 : public IDSWaylandShell
 {
 DS_PIMPL_USE_PRIVATE(DSWaylandZxdgShellV6);
 
@@ -36,7 +37,7 @@ public:
        void delSurface(DSWaylandZxdgSurfaceV6 *zxdgSurf);
        std::list<DSWaylandZxdgSurfaceV6 *> getSurfaceList();
 
-       void registerCallbackShellSurfaceCreated(DSObject *slot, std::function<void(DSWaylandZxdgSurfaceV6*)> func);
+       void registerCallbackShellSurfaceCreated(DSObject *slot, std::function<void(IDSWaylandShellSurface*)> func);
 
 public:
        DSSignal<DSWaylandZxdgSurfaceV6*> __zxdgSurfaceCreatedSignal;
@@ -55,7 +56,7 @@ public:
 
 };
 
-class DSWaylandZxdgSurfaceV6 : public DSObject
+class DSWaylandZxdgSurfaceV6 : public IDSWaylandShellSurface
 {
 DS_PIMPL_USE_PRIVATE(DSWaylandZxdgSurfaceV6);
 
diff --git a/src/DSWaylandServer/IDSWaylandShell.h b/src/DSWaylandServer/IDSWaylandShell.h
new file mode 100644 (file)
index 0000000..a541ea4
--- /dev/null
@@ -0,0 +1,38 @@
+#ifndef __I_DS_WAYLAND_SHELL_H__
+#define __I_DS_WAYLAND_SHELL_H__
+
+#include <DSCore.h>
+#include <DSSignal.h>
+#include <DSObject.h>
+
+#include <wayland-server-core.h>
+
+namespace display_server
+{
+
+class IDSWaylandShellSurface;
+
+class IDSWaylandShell : public DSObject
+{
+public:
+       virtual ~IDSWaylandShell() = default;
+
+       virtual void registerCallbackShellSurfaceCreated(DSObject *slot, std::function<void(IDSWaylandShellSurface*)> func) = 0;
+};
+
+
+class IDSWaylandShellSurface : public DSObject
+{
+public:
+       virtual ~IDSWaylandShellSurface() = default;
+
+       // TODO: we need change ::wl_resource to DSWaylandSurface
+       virtual void setWlSurface(struct ::wl_resource *surface) = 0;
+       virtual struct ::wl_resource *getWlSurface(void) = 0;
+};
+
+
+}
+
+#endif // __I_DS_WAYLAND_SHELL_H__
+