--- /dev/null
+#include "DSWaylandKeyboard.h"
+#include "DSWaylandKeyboardPrivate.h"
+
+namespace display_server
+{
+
+/* Begin Private Class Implementation */
+DSWaylandKeyboardPrivate::DSWaylandKeyboardPrivate(DSWaylandSeat *seat, DSWaylandKeyboard *keyboard)
+ : DSObjectPrivate(keyboard),
+ __p_ptr(keyboard),
+ __seat(seat),
+ __repeatRate(0),
+ __repeatDelay(0)
+{
+
+}
+
+DSWaylandKeyboardPrivate::~DSWaylandKeyboardPrivate()
+{
+}
+
+void DSWaylandKeyboardPrivate::keyboard_bind_resource(Resource *resource)
+{
+}
+
+void DSWaylandKeyboardPrivate::keyboard_destroy_resource(Resource *resource)
+{
+}
+
+void DSWaylandKeyboardPrivate::keyboard_release(Resource *resource)
+{
+}
+
+/* Begin Public Class Implementation */
+DSWaylandKeyboard::DSWaylandKeyboard(DSWaylandSeat *seat)
+ : DSObject(), _d_ptr(std::make_unique<DSWaylandKeyboardPrivate>(seat, this))
+{
+
+}
+
+DSWaylandKeyboard::~DSWaylandKeyboard()
+{
+}
+
+DSWaylandSeat *DSWaylandKeyboard::seat()
+{
+ DS_GET_PRIV(DSWaylandKeyboard);
+
+ return priv->__seat;
+}
+
+void DSWaylandKeyboard::setRepeatRate(uint32_t rate)
+{
+ DS_GET_PRIV(DSWaylandKeyboard);
+
+ priv->__repeatRate = rate;
+}
+
+void DSWaylandKeyboard::setRepeatDelay(uint32_t delay)
+{
+ DS_GET_PRIV(DSWaylandKeyboard);
+
+ priv->__repeatDelay = delay;
+}
+
+uint32_t DSWaylandKeyboard::repeatRate(void)
+{
+ DS_GET_PRIV(DSWaylandKeyboard);
+
+ return priv->__repeatRate;
+}
+
+uint32_t DSWaylandKeyboard::repeatDelay(void)
+{
+ DS_GET_PRIV(DSWaylandKeyboard);
+
+ return priv->__repeatDelay;
+}
+
+}
--- /dev/null
+#ifndef __DS_WAYLAND_KEYBOARD_H__
+#define __DS_WAYLAND_KEYBOARD_H__
+
+#include "DSCore.h"
+#include "DSObject.h"
+
+namespace display_server
+{
+
+class DSWaylandSeat;
+class DSWaylandKeyboardPrivate;
+class DS_DECL_EXPORT DSWaylandKeyboard : public DSObject
+{
+ DS_PIMPL_USE_PRIVATE(DSWaylandKeyboard);
+public:
+ DSWaylandKeyboard(DSWaylandSeat *seat);
+ ~DSWaylandKeyboard() override;
+
+ DSWaylandSeat *seat();
+
+ void setRepeatRate(uint32_t rate);
+ void setRepeatDelay(uint32_t delay);
+ uint32_t repeatRate(void);
+ uint32_t repeatDelay(void);
+
+ //TODO
+
+protected:
+
+private:
+
+};
+
+}
+
+#endif //__DS_WAYLAND_KEYBOARD_H__
--- /dev/null
+#ifndef __DS_WAYLAND_KEYBOARD_PRIVATE_H__
+#define __DS_WAYLAND_KEYBOARD_PRIVATE_H__
+
+#include "dswayland-server-wayland.h"
+
+#include "DSCore.h"
+#include "DSObjectPrivate.h"
+
+namespace display_server
+{
+
+class DSWaylandSeat;
+class DS_DECL_EXPORT DSWaylandKeyboardPrivate : public DSObjectPrivate, public DSWaylandServer::wl_keyboard
+{
+ DS_PIMPL_USE_PUBLIC(DSWaylandKeyboard);
+public:
+ DSWaylandKeyboardPrivate(DSWaylandSeat *seat, DSWaylandKeyboard *keyboard);
+ ~DSWaylandKeyboardPrivate() override;
+
+ //TO DO
+
+protected:
+ //virtual Resource *keyboard_allocate();
+ virtual void keyboard_bind_resource(Resource *resource);
+ virtual void keyboard_destroy_resource(Resource *resource);
+ virtual void keyboard_release(Resource *resource);
+
+private:
+ DSWaylandSeat *__seat;
+
+ uint32_t __repeatRate;
+ uint32_t __repeatDelay;
+};
+
+}
+
+#endif //__DS_WAYLAND_KEYBOARD_PRIVATE_H__
--- /dev/null
+#include "DSWaylandPointer.h"
+#include "DSWaylandPointerPrivate.h"
+
+namespace display_server
+{
+
+/* Begin Private Class Implementation */
+DSWaylandPointerPrivate::DSWaylandPointerPrivate(DSWaylandSeat *seat, DSWaylandPointer *pointer)
+ : DSObjectPrivate(pointer),
+ __p_ptr(pointer),
+ __seat(seat)
+{
+}
+
+DSWaylandPointerPrivate::~DSWaylandPointerPrivate()
+{
+}
+
+void DSWaylandPointerPrivate::pointer_bind_resource(Resource *resource)
+{
+}
+
+void DSWaylandPointerPrivate::pointer_destroy_resource(Resource *resource)
+{
+}
+
+void DSWaylandPointerPrivate::pointer_set_cursor(Resource *resource, uint32_t serial, struct ::wl_resource *surface, int32_t hotspot_x, int32_t hotspot_y)
+{
+}
+
+void DSWaylandPointerPrivate::pointer_release(Resource *resource)
+{
+}
+
+/* Begin Public Class Implementation */
+DSWaylandPointer::DSWaylandPointer(DSWaylandSeat *seat)
+ : DSObject(), _d_ptr(std::make_unique<DSWaylandPointerPrivate>(seat, this))
+{
+}
+
+DSWaylandPointer::~DSWaylandPointer()
+{
+}
+
+DSWaylandSeat *DSWaylandPointer::seat()
+{
+ DS_GET_PRIV(DSWaylandPointer);
+
+ return priv->__seat;
+}
+
+}
\ No newline at end of file
--- /dev/null
+#ifndef __DS_WAYLAND_POINTER_H__
+#define __DS_WAYLAND_POINTER_H__
+
+#include "DSCore.h"
+#include "DSObject.h"
+
+namespace display_server
+{
+
+class DSWaylandSeat;
+class DSWaylandPointerPrivate;
+class DS_DECL_EXPORT DSWaylandPointer : public DSObject
+{
+ DS_PIMPL_USE_PRIVATE(DSWaylandPointer);
+public:
+ DSWaylandPointer(DSWaylandSeat *seat);
+ ~DSWaylandPointer() override;
+
+ DSWaylandSeat *seat();
+
+ //TODO
+
+protected:
+
+private:
+
+};
+
+}
+
+#endif //__DS_WAYLAND_POINTER_H__
--- /dev/null
+#ifndef __DS_WAYLAND_POINTER_PRIVATE_H__
+#define __DS_WAYLAND_POINTER_PRIVATE_H__
+
+#include "dswayland-server-wayland.h"
+
+#include "DSCore.h"
+#include "DSObjectPrivate.h"
+
+namespace display_server
+{
+
+class DSWaylandSeat;
+class DS_DECL_EXPORT DSWaylandPointerPrivate : public DSObjectPrivate, public DSWaylandServer::wl_pointer
+{
+ DS_PIMPL_USE_PUBLIC(DSWaylandPointer);
+public:
+ DSWaylandPointerPrivate(DSWaylandSeat *seat, DSWaylandPointer *pointer);
+ ~DSWaylandPointerPrivate() override;
+
+ //TODO
+
+protected:
+ //virtual Resource *pointer_allocate();
+ void pointer_bind_resource(Resource *resource) override;
+ void pointer_destroy_resource(Resource *resource) override;
+ void pointer_set_cursor(Resource *resource, uint32_t serial, struct ::wl_resource *surface, int32_t hotspot_x, int32_t hotspot_y) override;
+ void pointer_release(Resource *resource) override;
+
+private:
+ DSWaylandSeat *__seat;
+};
+
+}
+
+#endif //__DS_WAYLAND_POINTER_PRIVATE_H__
--- /dev/null
+#include "DSWaylandTouch.h"
+#include "DSWaylandTouchPrivate.h"
+
+namespace display_server {
+
+/* Begin Private Class Implementation */
+DSWaylandTouchPrivate::DSWaylandTouchPrivate(DSWaylandSeat *seat, DSWaylandTouch *touch)
+ : DSObjectPrivate(touch),
+ __p_ptr(touch),
+ __seat(seat)
+{
+}
+
+DSWaylandTouchPrivate::~DSWaylandTouchPrivate()
+{
+}
+
+void DSWaylandTouchPrivate::touch_bind_resource(Resource *resource)
+{
+}
+
+void DSWaylandTouchPrivate::touch_destroy_resource(Resource *resource)
+{
+}
+
+void DSWaylandTouchPrivate::touch_release(Resource *resource)
+{
+}
+
+/* Begin Public Class Implementation */
+DSWaylandTouch::DSWaylandTouch(DSWaylandSeat *seat)
+ : DSObject(), _d_ptr(std::make_unique<DSWaylandTouchPrivate>(seat, this))
+{
+}
+
+DSWaylandTouch::~DSWaylandTouch()
+{
+}
+
+DSWaylandSeat *DSWaylandTouch::seat()
+{
+ DS_GET_PRIV(DSWaylandTouch);
+
+ return priv->__seat;
+}
+
+}
\ No newline at end of file
--- /dev/null
+#ifndef __DS_WAYLAND_TOUCH_H__
+#define __DS_WAYLAND_TOUCH_H__
+
+#include "DSCore.h"
+#include "DSObject.h"
+
+namespace display_server
+{
+
+class DSWaylandSeat;
+class DSWaylandTouchPrivate;
+class DS_DECL_EXPORT DSWaylandTouch : public DSObject
+{
+ DS_PIMPL_USE_PRIVATE(DSWaylandTouch);
+public:
+ DSWaylandTouch(DSWaylandSeat *seat);
+ ~DSWaylandTouch() override;
+
+ DSWaylandSeat *seat();
+
+ //TODO
+
+protected:
+
+private:
+
+};
+
+}
+
+#endif //__DS_WAYLAND_TOUCH_H__
--- /dev/null
+#ifndef __DS_WAYLAND_TOUCH_PRIVATE_H__
+#define __DS_WAYLAND_TOUCH_PRIVATE_H__
+
+#include "dswayland-server-wayland.h"
+
+#include "DSCore.h"
+#include "DSObjectPrivate.h"
+
+namespace display_server
+{
+
+class DSWaylandSeat;
+class DS_DECL_EXPORT DSWaylandTouchPrivate : public DSObjectPrivate, public DSWaylandServer::wl_touch
+{
+ DS_PIMPL_USE_PUBLIC(DSWaylandTouch);
+public:
+ DSWaylandTouchPrivate(DSWaylandSeat *seat, DSWaylandTouch *touch);
+ ~DSWaylandTouchPrivate() override;
+
+ //TODO
+
+protected:
+ //virtual Resource *touch_allocate();
+ virtual void touch_bind_resource(Resource *resource);
+ virtual void touch_destroy_resource(Resource *resource);
+ virtual void touch_release(Resource *resource);
+
+private:
+ DSWaylandSeat *__seat;
+};
+
+}
+
+#endif //__DS_WAYLAND_TOUCH_PRIVATE_H__
'DSWaylandServer/DSWaylandSeatPrivate.h',
'DSWaylandServer/DSWaylandSeat.h',
'DSWaylandServer/DSWaylandSeat.cpp',
+ 'DSWaylandServer/DSWaylandPointerPrivate.h',
+ 'DSWaylandServer/DSWaylandPointer.h',
+ 'DSWaylandServer/DSWaylandPointer.cpp',
+ 'DSWaylandServer/DSWaylandKeyboardPrivate.h',
+ 'DSWaylandServer/DSWaylandKeyboard.h',
+ 'DSWaylandServer/DSWaylandKeyboard.cpp',
+ 'DSWaylandServer/DSWaylandTouchPrivate.h',
+ 'DSWaylandServer/DSWaylandTouch.h',
+ 'DSWaylandServer/DSWaylandTouch.cpp',
]
libds_srcs += libds_wayland_srcs
--- /dev/null
+#include "libds-tests.h"
+#include "DSWaylandKeyboard.h"
+#include "DSWaylandSeat.h"
+
+using namespace display_server;
+
+class DSWaylandKeyboardTest : public ::testing::Test
+{
+public:
+ void SetUp(void) override
+ {
+ }
+ void TearDown(void) override
+ {
+ }
+};
+
+/* Test cases */
+TEST_F(DSWaylandKeyboardTest, NewDSWaylandKeyboard)
+{
+ DSWaylandKeyboard *keyboard = new DSWaylandKeyboard(nullptr);
+ EXPECT_TRUE(keyboard != nullptr);
+
+ if (keyboard)
+ delete keyboard;
+}
+
+TEST_F(DSWaylandKeyboardTest, GetSeat)
+{
+ DSWaylandSeat *seat = new DSWaylandSeat(nullptr, DSWaylandSeat::capDefault);
+ EXPECT_TRUE(seat != nullptr);
+
+ if (seat)
+ {
+ DSWaylandKeyboard *keyboard = new DSWaylandKeyboard(seat);
+ EXPECT_TRUE(keyboard != nullptr);
+
+ if (keyboard)
+ {
+ EXPECT_TRUE(keyboard->seat() == seat);
+
+ delete keyboard;
+ }
+
+ delete seat;
+ }
+}
+
+TEST_F(DSWaylandKeyboardTest, SetGetRepeatRateDelay)
+{
+ DSWaylandKeyboard *keyboard = new DSWaylandKeyboard(nullptr);
+ EXPECT_TRUE(keyboard != nullptr);
+
+ if (keyboard)
+ {
+ uint32_t uRepeatRate = 25;
+ uint32_t uRepeatDelay = 400;
+
+ keyboard->setRepeatRate(uRepeatRate);
+ EXPECT_TRUE(keyboard->repeatRate() == uRepeatRate);
+
+ keyboard->setRepeatDelay(uRepeatDelay);
+ EXPECT_TRUE(keyboard->repeatDelay() == uRepeatDelay);
+
+ delete keyboard;
+ }
+}
--- /dev/null
+#include "libds-tests.h"
+#include "DSWaylandPointer.h"
+#include "DSWaylandSeat.h"
+
+using namespace display_server;
+
+class DSWaylandPointerTest : public ::testing::Test
+{
+public:
+ void SetUp(void) override
+ {
+ }
+ void TearDown(void) override
+ {
+ }
+};
+
+/* Test cases */
+TEST_F(DSWaylandPointerTest, NewDSWaylandPointer)
+{
+ DSWaylandPointer *pointer = new DSWaylandPointer(nullptr);
+ EXPECT_TRUE(pointer != nullptr);
+
+ if (pointer)
+ delete pointer;
+}
+
+TEST_F(DSWaylandPointerTest, GetSeat)
+{
+ DSWaylandSeat *seat = new DSWaylandSeat(nullptr, DSWaylandSeat::capDefault);
+ EXPECT_TRUE(seat != nullptr);
+
+ if (seat)
+ {
+ DSWaylandPointer *pointer = new DSWaylandPointer(seat);
+ EXPECT_TRUE(pointer != nullptr);
+
+ if (pointer)
+ {
+ EXPECT_TRUE(pointer->seat() == seat);
+
+ delete pointer;
+ }
+
+ delete seat;
+ }
+}
--- /dev/null
+#include "libds-tests.h"
+#include "DSWaylandTouch.h"
+#include "DSWaylandSeat.h"
+
+using namespace display_server;
+
+class DSWaylandTouchTest : public ::testing::Test
+{
+public:
+ void SetUp(void) override
+ {
+ }
+ void TearDown(void) override
+ {
+ }
+};
+
+/* Test cases */
+TEST_F(DSWaylandTouchTest, NewDSWaylandTouch)
+{
+ DSWaylandTouch *touch = new DSWaylandTouch(nullptr);
+ EXPECT_TRUE(touch != nullptr);
+
+ if (touch)
+ delete touch;
+}
+
+TEST_F(DSWaylandTouchTest, GetSeat)
+{
+ DSWaylandSeat *seat = new DSWaylandSeat(nullptr, DSWaylandSeat::capDefault);
+ EXPECT_TRUE(seat != nullptr);
+
+ if (seat)
+ {
+ DSWaylandTouch *touch = new DSWaylandTouch(seat);
+ EXPECT_TRUE(touch != nullptr);
+
+ if (touch)
+ {
+ EXPECT_TRUE(touch->seat() == seat);
+
+ delete touch;
+ }
+
+ delete seat;
+ }
+}
'DSWaylandCompositor-test.cpp',
'DSWaylandSeat-test.cpp',
'DSWaylandClient-test.cpp',
+ 'DSWaylandPointer-test.cpp',
+ 'DSWaylandKeyboard-test.cpp',
+ 'DSWaylandTouch-test.cpp',
]
gmock_dep = dependency('gmock', method : 'pkg-config')