From: Sung-Jin Park Date: Mon, 20 Jul 2020 11:28:43 +0000 (+0900) Subject: DSWaylandPointer: initialize wl_pointer, create wl_resource when a client binds it X-Git-Tag: accepted/tizen/unified/20200820.213435~231 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F44%2F241644%2F1;p=platform%2Fcore%2Fuifw%2Flibds.git DSWaylandPointer: initialize wl_pointer, create wl_resource when a client binds it Change-Id: Icf3d75df431626328f7b273d03321bc71f44ed49 Signed-off-by: Sung-Jin Park --- diff --git a/src/DSWaylandServer/DSWaylandPointer.cpp b/src/DSWaylandServer/DSWaylandPointer.cpp index b2422e5..0261306 100644 --- a/src/DSWaylandServer/DSWaylandPointer.cpp +++ b/src/DSWaylandServer/DSWaylandPointer.cpp @@ -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(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 diff --git a/src/DSWaylandServer/DSWaylandPointer.h b/src/DSWaylandServer/DSWaylandPointer.h index 0a00f84..d788796 100644 --- a/src/DSWaylandServer/DSWaylandPointer.h +++ b/src/DSWaylandServer/DSWaylandPointer.h @@ -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: diff --git a/src/DSWaylandServer/DSWaylandPointerPrivate.h b/src/DSWaylandServer/DSWaylandPointerPrivate.h index deaa902..6c4b530 100644 --- a/src/DSWaylandServer/DSWaylandPointerPrivate.h +++ b/src/DSWaylandServer/DSWaylandPointerPrivate.h @@ -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;