#include "DSWaylandClient.h"
#include "DSWaylandSeat.h"
#include "DSWaylandSurface.h"
+#include "DSWaylandRegion.h"
#include "DSDebugLog.h"
namespace display_server
void DSWaylandCompositorPrivate::compositor_create_region(wl_compositor::Resource *resource, uint32_t id)
{
- //TODO
+ DS_GET_PUB(DSWaylandCompositor);
+
+ DSWaylandClient *waylandClient = DSWaylandClient::fromWlClient(resource->client());
+ auto waylandRegion = std::make_shared<DSWaylandRegion>(waylandClient, id);
+
+ pub->__regionList.push_front(waylandRegion);
}
/* Begin Public Class Implementation */
}
}
+void DSWaylandCompositor::regionDestroy(DSWaylandRegion *dswRegion)
+{
+ for (auto s : __regionList)
+ {
+ if (s.get() == dswRegion)
+ {
+ __regionList.remove(s);
+ break;
+ }
+ }
+}
+
void DSWaylandCompositor::registerCallbackSurfaceCreated(DSObject *slot, std::function<void(std::shared_ptr<DSWaylandSurface>)> func)
{
this->__surfaceCreatedSignal.connect(slot, func);
class DSWaylandSeat;
class DSWaylandSurface;
class IDSWaylandShell;
+class DSWaylandRegion;
class DSWaylandCompositorPrivate;
IDSWaylandShell *getShell(void);
void sendSurfaceDestroy(DSWaylandSurface *dswSurface);
+ void regionDestroy(DSWaylandRegion *dswRegion);
// Callback methods
void registerCallbackSurfaceCreated(DSObject *slot, std::function<void(std::shared_ptr<DSWaylandSurface>)> func);
DSWaylandCompositor& operator=(const DSWaylandCompositor&) = delete;
std::list<std::shared_ptr<DSWaylandSurface>> __surfaceList;
+ std::list<std::shared_ptr<DSWaylandRegion>> __regionList;
// signals
DSSignal<std::shared_ptr<DSWaylandSurface>> __surfaceCreatedSignal;
--- /dev/null
+/*
+* Copyright © 2020 Samsung Electronics co., Ltd. All Rights Reserved.
+*
+* Permission is hereby granted, free of charge, to any person obtaining a
+* copy of this software and associated documentation files (the "Software"),
+* to deal in the Software without restriction, including without limitation
+* the rights to use, copy, modify, merge, publish, distribute, sublicense,
+* and/or sell copies of the Software, and to permit persons to whom the
+* Software is furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice (including the next
+* paragraph) shall be included in all copies or substantial portions of the
+* Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+* DEALINGS IN THE SOFTWARE.
+*/
+
+#include "DSWaylandRegion.h"
+#include "DSWaylandRegionPrivate.h"
+#include "DSWaylandCompositor.h"
+
+namespace display_server
+{
+
+/* DSWaylandRegionPrivate */
+DSWaylandRegionPrivate::DSWaylandRegionPrivate(DSWaylandRegion *p_ptr)
+ : DSObjectPrivate(p_ptr),
+ __p_ptr(p_ptr)
+{}
+
+DSWaylandRegionPrivate::DSWaylandRegionPrivate(DSWaylandRegion *p_ptr, DSWaylandClient *waylandClient, uint32_t id)
+ : DSObjectPrivate(p_ptr),
+ __p_ptr(p_ptr)
+{
+ if (id > 0)
+ {
+ init(waylandClient->wlClient(), (int)id, 1);
+ }
+}
+
+DSWaylandRegionPrivate::~DSWaylandRegionPrivate()
+{}
+
+void DSWaylandRegionPrivate::region_bind_resource(Resource *resource)
+{
+}
+
+void DSWaylandRegionPrivate::region_destroy_resource(Resource *resource)
+{
+ DS_GET_PUB(DSWaylandRegion);
+
+ DSWaylandCompositor *dswCompositor = DSWaylandCompositor::getInstance();
+ if (dswCompositor)
+ {
+ dswCompositor->regionDestroy(pub);
+ }
+ DSWaylandCompositor::releaseInstance();
+}
+
+void DSWaylandRegionPrivate::region_destroy(Resource *resource)
+{
+}
+
+void DSWaylandRegionPrivate::region_add(Resource *resource, int32_t x, int32_t y, int32_t width, int32_t height)
+{
+}
+
+void DSWaylandRegionPrivate::region_subtract(Resource *resource, int32_t x, int32_t y, int32_t width, int32_t height)
+{
+}
+
+DS_WAYLAND_IMPL_FROM_RESOURCE(DSWaylandRegion);
+
+
+DSWaylandRegion::DSWaylandRegion()
+ : DS_INIT_PRIVATE_PTR(DSWaylandRegion)
+{}
+
+DSWaylandRegion::DSWaylandRegion(DSWaylandClient *waylandClient, uint32_t id)
+ : _d_ptr(std::make_unique<DSWaylandRegionPrivate>(this, waylandClient, id))
+{}
+
+DSWaylandRegion::~DSWaylandRegion()
+{}
+
+struct ::wl_resource *DSWaylandRegion::getWlResource()
+{
+ DS_GET_PRIV(DSWaylandRegion);
+
+ return priv->resource()->handle;
+}
+
+bool DSWaylandRegion::hasResource()
+{
+ DS_GET_PRIV(DSWaylandRegion);
+
+ if (priv->resource())
+ return true;
+ return false;
+}
+
+} /* namespace display_server */
--- /dev/null
+/*
+* Copyright © 2020 Samsung Electronics co., Ltd. All Rights Reserved.
+*
+* Permission is hereby granted, free of charge, to any person obtaining a
+* copy of this software and associated documentation files (the "Software"),
+* to deal in the Software without restriction, including without limitation
+* the rights to use, copy, modify, merge, publish, distribute, sublicense,
+* and/or sell copies of the Software, and to permit persons to whom the
+* Software is furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice (including the next
+* paragraph) shall be included in all copies or substantial portions of the
+* Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+* DEALINGS IN THE SOFTWARE.
+*/
+
+#ifndef __DS_WAYLAND_REGION_H__
+#define __DS_WAYLAND_REGION_H__
+
+#include "DSCore.h"
+#include "DSObject.h"
+#include "DSStruct.h"
+#include "DSWaylandClient.h"
+
+struct wl_resource;
+
+namespace display_server
+{
+
+class DSWaylandRegionPrivate;
+
+class DSWaylandRegion : public DSObject
+{
+ DS_PIMPL_USE_PRIVATE(DSWaylandRegion);
+ DS_WAYLAND_DEFINE_FROM_RESOURCE(DSWaylandRegion);
+public:
+ DSWaylandRegion();
+ DSWaylandRegion(DSWaylandClient *waylandClient, uint32_t id);
+ virtual ~DSWaylandRegion();
+
+ struct ::wl_resource *getWlResource();
+ bool hasResource();
+
+private:
+
+};
+
+} /* namespace display_server */
+
+#endif /* _DS_WAYLAND_REGION_H_ */
--- /dev/null
+/*
+* Copyright © 2020 Samsung Electronics co., Ltd. All Rights Reserved.
+*
+* Permission is hereby granted, free of charge, to any person obtaining a
+* copy of this software and associated documentation files (the "Software"),
+* to deal in the Software without restriction, including without limitation
+* the rights to use, copy, modify, merge, publish, distribute, sublicense,
+* and/or sell copies of the Software, and to permit persons to whom the
+* Software is furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice (including the next
+* paragraph) shall be included in all copies or substantial portions of the
+* Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+* DEALINGS IN THE SOFTWARE.
+*/
+
+#ifndef __DS_WAYLAND_REGION_PRIVATE_H__
+#define __DS_WAYLAND_REGION_PRIVATE_H__
+
+#include "dswayland-server-wayland.h"
+#include "DSWaylandRegion.h"
+
+namespace display_server
+{
+
+class DSWaylandRegion;
+
+class DSWaylandRegionPrivate : public DSObjectPrivate, public DSWaylandServer::wl_region
+{
+DS_PIMPL_USE_PUBLIC(DSWaylandRegion);
+public:
+ DSWaylandRegionPrivate() = delete;
+ DSWaylandRegionPrivate(DSWaylandRegion *p_ptr);
+ DSWaylandRegionPrivate(DSWaylandRegion *p_ptr, DSWaylandClient *waylandClient, uint32_t id);
+ ~DSWaylandRegionPrivate() override;
+
+protected:
+ void region_bind_resource(Resource *resource);
+ void region_destroy_resource(Resource *resource);
+
+ void region_destroy(Resource *resource);
+ void region_add(Resource *resource, int32_t x, int32_t y, int32_t width, int32_t height);
+ void region_subtract(Resource *resource, int32_t x, int32_t y, int32_t width, int32_t height);
+
+private:
+};
+
+} /*namespace display_server */
+
+#endif /* _DS_WAYLAND_REGION_PRIVATE_H_ */
'DSWaylandServer/DSWaylandSurface.cpp',
'DSWaylandServer/DSWaylandSurface.h',
'DSWaylandServer/DSWaylandSurfacePrivate.h',
+ 'DSWaylandServer/DSWaylandRegion.cpp',
+ 'DSWaylandServer/DSWaylandRegion.h',
+ 'DSWaylandServer/DSWaylandRegionPrivate.h',
'DSWaylandServer/DSWaylandTizenInputDevice.h',
'DSWaylandServer/DSWaylandTizenInputDevicePrivate.h',
'DSWaylandServer/DSWaylandTizenInputDeviceManager.cpp',