DSWaylandBuffer: add skeleton code 37/241637/1
authorChangyeon Lee <cyeon.lee@samsung.com>
Wed, 15 Jul 2020 10:47:36 +0000 (19:47 +0900)
committerSung-Jin Park <sj76.park@samsung.com>
Thu, 20 Aug 2020 09:54:06 +0000 (18:54 +0900)
Change-Id: Ia18aafd694434ee33ab06dbb0af07d52c1952852

src/DSWaylandServer/DSWaylandBuffer.cpp [new file with mode: 0644]
src/DSWaylandServer/DSWaylandBuffer.h [new file with mode: 0644]
src/DSWaylandServer/DSWaylandBufferPrivate.h [new file with mode: 0644]
src/meson.build
tests/DSWaylandBuffer-test.cpp [new file with mode: 0644]
tests/meson.build

diff --git a/src/DSWaylandServer/DSWaylandBuffer.cpp b/src/DSWaylandServer/DSWaylandBuffer.cpp
new file mode 100644 (file)
index 0000000..83a3e29
--- /dev/null
@@ -0,0 +1,41 @@
+#include "DSWaylandBuffer.h"
+#include "DSWaylandBufferPrivate.h"
+
+namespace display_server
+{
+
+DSWaylandBufferPrivate::DSWaylandBufferPrivate(DSWaylandBuffer *p_ptr)
+    : DSObjectPrivate(p_ptr),
+      __p_ptr(p_ptr)
+{
+}
+
+DSWaylandBufferPrivate::~DSWaylandBufferPrivate()
+{
+}
+
+void DSWaylandBufferPrivate::buffer_bind_resource(Resource *resource)
+{
+}
+
+void DSWaylandBufferPrivate::buffer_destroy_resource(Resource *resource)
+{
+}
+
+DSWaylandBuffer::DSWaylandBuffer()
+    : DSObject(std::make_unique<DSWaylandBufferPrivate>(this))
+{
+}
+
+DSWaylandBuffer::~DSWaylandBuffer()
+{
+}
+
+void DSWaylandBuffer::sendRelease()
+{
+    DS_GET_PRIV(DSWaylandBuffer);
+
+    priv->send_release();
+}
+
+} /* namespace display_server */
diff --git a/src/DSWaylandServer/DSWaylandBuffer.h b/src/DSWaylandServer/DSWaylandBuffer.h
new file mode 100644 (file)
index 0000000..fe1679c
--- /dev/null
@@ -0,0 +1,24 @@
+#ifndef _DS_WAYLAND_BUFFER_H_
+#define _DS_WAYLAND_BUFFER_H_
+
+#include <DSObject.h>
+#include <DSCore.h>
+
+namespace display_server
+{
+
+class DSWaylandBufferPrivate;
+
+class DSWaylandBuffer : public DSObject
+{
+DS_PIMPL_USE_PRIVATE(DSWaylandBuffer);
+public:
+    DSWaylandBuffer();
+    virtual ~DSWaylandBuffer();
+
+    void sendRelease();
+};
+
+} /* namespace display_server */
+
+#endif /* _DS_WAYLAND_BUFFER_H_ */
diff --git a/src/DSWaylandServer/DSWaylandBufferPrivate.h b/src/DSWaylandServer/DSWaylandBufferPrivate.h
new file mode 100644 (file)
index 0000000..f309e01
--- /dev/null
@@ -0,0 +1,28 @@
+#ifndef _DS_WAYLAND_BUFFER_PRIVATE_H_
+#define _DS_WAYLAND_BUFFER_PRIVATE_H_
+
+#include "dswayland-server-wayland.h"
+#include "DSWaylandBuffer.h"
+
+namespace display_server
+{
+
+class DSWaylandBufferPrivate : public DSObjectPrivate, public DSWaylandServer::wl_buffer
+{
+    DS_PIMPL_USE_PUBLIC(DSWaylandBuffer);
+public:
+    DSWaylandBufferPrivate() = delete;
+    DSWaylandBufferPrivate(DSWaylandBuffer *p_ptr);
+    ~DSWaylandBufferPrivate() override;
+
+protected:
+    void buffer_bind_resource(Resource *resource) override;
+    void buffer_destroy_resource(Resource *resource) override;
+
+private:
+
+};
+
+} /* namespace display_server */
+
+#endif /* _DS_WAYLAND_BUFFER_PRIVATE_H_ */
index f9e9c09..c6fd729 100644 (file)
@@ -105,6 +105,9 @@ libds_wayland_srcs = [
        'DSWaylandServer/DSWaylandTouchPrivate.h',
        'DSWaylandServer/DSWaylandTouch.h',
        'DSWaylandServer/DSWaylandTouch.cpp',
+       'DSWaylandServer/DSWaylandBufferPrivate.h',
+       'DSWaylandServer/DSWaylandBuffer.h',
+       'DSWaylandServer/DSWaylandBuffer.cpp',
        ]
 
 libds_srcs += libds_wayland_srcs
diff --git a/tests/DSWaylandBuffer-test.cpp b/tests/DSWaylandBuffer-test.cpp
new file mode 100644 (file)
index 0000000..01e243f
--- /dev/null
@@ -0,0 +1,20 @@
+#include "libds-tests.h"
+#include "DSWaylandBuffer.h"
+
+using namespace display_server;
+
+class DSWaylandBufferTest : public ::testing::Test
+{
+public:
+       void SetUp(void) override
+       {}
+       void TearDown(void) override
+       {}
+};
+
+TEST_F(DSWaylandBufferTest, NewDSWaylandBuffer)
+{
+       DSWaylandBuffer *buffer = new DSWaylandBuffer;
+       delete buffer;
+       EXPECT_TRUE(true);
+}
index 951d065..48ab900 100644 (file)
@@ -24,6 +24,7 @@ libds_tests_srcs = [
        'DSWaylandTizenPolicy-test.cpp',
        'DSWaylandTizenSurface-test.cpp',
        'DSWaylandZxdgShellV6-test.cpp',
+       'DSWaylandBuffer-test.cpp',
        'DSObject-test.cpp',
        'DSEventLoop-test.cpp',
        'DSWaylandCompositor-test.cpp',