DSWaylandPointer: initialize wl_pointer, create wl_resource when a client binds it 44/241644/1
authorSung-Jin Park <sj76.park@samsung.com>
Mon, 20 Jul 2020 11:28:43 +0000 (20:28 +0900)
committerSung-Jin Park <sj76.park@samsung.com>
Thu, 20 Aug 2020 09:54:13 +0000 (18:54 +0900)
Change-Id: Icf3d75df431626328f7b273d03321bc71f44ed49
Signed-off-by: Sung-Jin Park <sj76.park@samsung.com>
src/DSWaylandServer/DSWaylandPointer.cpp
src/DSWaylandServer/DSWaylandPointer.h
src/DSWaylandServer/DSWaylandPointerPrivate.h

index b2422e5..0261306 100644 (file)
@@ -1,5 +1,6 @@
 #include "DSWaylandPointer.h"
 #include "DSWaylandPointerPrivate.h"
+#include "DSWaylandClient.h"
 
 namespace display_server
 {
@@ -10,6 +11,7 @@ DSWaylandPointerPrivate::DSWaylandPointerPrivate(DSWaylandSeat *seat, DSWaylandP
          __p_ptr(pointer),
          __seat(seat)
 {
+       wl_pointer();
 }
 
 DSWaylandPointerPrivate::~DSWaylandPointerPrivate()
@@ -18,28 +20,35 @@ DSWaylandPointerPrivate::~DSWaylandPointerPrivate()
 
 void DSWaylandPointerPrivate::pointer_bind_resource(Resource *resource)
 {
+       DSLOG_INF("DSWaylandPointerPrivate","");
 }
 
 void DSWaylandPointerPrivate::pointer_destroy_resource(Resource *resource)
 {
+       DSLOG_INF("DSWaylandPointerPrivate","");
 }
 
 void DSWaylandPointerPrivate::pointer_set_cursor(Resource *resource, uint32_t serial, struct ::wl_resource *surface, int32_t hotspot_x, int32_t hotspot_y)
 {
+       DSLOG_INF("DSWaylandPointerPrivate","");
 }
 
 void DSWaylandPointerPrivate::pointer_release(Resource *resource)
 {
+       DSLOG_INF("DSWaylandPointerPrivate","");
+       wl_resource_destroy(resource->handle);
 }
 
 /* Begin Public Class Implementation */
 DSWaylandPointer::DSWaylandPointer(DSWaylandSeat *seat)
        : DSObject(), _d_ptr(std::make_unique<DSWaylandPointerPrivate>(seat, this))
 {
+       //TODO : emit signal
 }
 
 DSWaylandPointer::~DSWaylandPointer()
 {
+       //TODO : emit signal
 }
 
 DSWaylandSeat *DSWaylandPointer::seat()
@@ -49,4 +58,13 @@ DSWaylandSeat *DSWaylandPointer::seat()
        return priv->__seat;
 }
 
+void DSWaylandPointer::addClient(DSWaylandClient *client, uint32_t id, int version)
+{
+       DS_GET_PRIV(DSWaylandPointer);
+
+       DSLOG_INF("DSWaylandPointer", "addClient(dswlClient=%p, id=%u, version=%d", client, id, version);
+
+       priv->add(client->wlClient(), id, version);
+}
+
 }
\ No newline at end of file
index 0a00f84..d788796 100644 (file)
@@ -9,6 +9,8 @@ namespace display_server
 
 class DSWaylandSeat;
 class DSWaylandPointerPrivate;
+class DSWaylandClient;
+
 class DS_DECL_EXPORT DSWaylandPointer : public DSObject
 {
        DS_PIMPL_USE_PRIVATE(DSWaylandPointer);
@@ -18,7 +20,7 @@ public:
 
        DSWaylandSeat *seat();
 
-       //TODO
+       void addClient(DSWaylandClient *client, uint32_t id, int version);
 
 protected:
 
index deaa902..6c4b530 100644 (file)
@@ -17,8 +17,6 @@ public:
        DSWaylandPointerPrivate(DSWaylandSeat *seat, DSWaylandPointer *pointer);
        ~DSWaylandPointerPrivate() override;
 
-       //TODO
-
 protected:
     //virtual Resource *pointer_allocate();
     void pointer_bind_resource(Resource *resource) override;