--- /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 "DSWaylandProtocolTrace.h"
+#include "DSWaylandProtocolTracePrivate.h"
+
+namespace display_server
+{
+
+int DSWaylandProtocolTrace::__refCount { 0 };
+std::mutex DSWaylandProtocolTrace::__mutex;
+DSWaylandProtocolTrace* DSWaylandProtocolTrace::__protocolTrace { nullptr };
+
+DSWaylandProtocolTrace::DSWaylandProtocolTrace(DSObject *parent)
+ : DS_INIT_PRIVATE_PTR(DSWaylandProtocolTrace)
+{
+ //init();
+}
+
+DSWaylandProtocolTrace::~DSWaylandProtocolTrace()
+{
+
+}
+
+DSWaylandProtocolTrace *DSWaylandProtocolTrace::getInstance()
+{
+ std::lock_guard<std::mutex> tLock(__mutex);
+
+ if(!__protocolTrace && (__refCount == 0))
+ {
+ __protocolTrace = new DSWaylandProtocolTrace(new DSObject);
+ DSLOG_INF("DSWaylandProtocolTrace", "DSWaylandProtocolTrace instance has been created !");
+ }
+
+ ++__refCount;
+ return __protocolTrace;
+}
+
+void DSWaylandProtocolTrace::releaseInstance()
+{
+ std::lock_guard<std::mutex> tLock(__mutex);
+
+ --__refCount;
+ if(__refCount < 0)
+ __refCount = 0;
+
+ if((0==__refCount) && __protocolTrace)
+ {
+ delete __protocolTrace;
+ __protocolTrace = nullptr;
+ DSLOG_INF("DSWaylandProtocolTrace", "DSWaylandProtocolTrace instance has been removed !");
+ }
+}
+
+bool DSWaylandProtocolTrace::init(void)
+{
+ return false;
+}
+
+int DSWaylandProtocolTrace::enableProtocolTrace(bool state)
+{
+ //following state : enable, disable trace
+ return -1;
+}
+
+DSWaylandProtocolTracePrivate::DSWaylandProtocolTracePrivate(DSWaylandProtocolTrace *p_ptr)
+ : DSObjectPrivate(p_ptr), __p_ptr(p_ptr)
+{
+
+}
+
+DSWaylandProtocolTracePrivate::~DSWaylandProtocolTracePrivate()
+{
+
+}
+
+void DSWaylandProtocolTracePrivate::protocol_rule_init(char *rule_path)
+{
+}
+
+void DSWaylandProtocolTracePrivate::protocol_trace_init(char *trace_path)
+{
+}
+
+void DSWaylandProtocolTracePrivate::protocol_rule_set(void)
+{
+}
+
+void DSWaylandProtocolTracePrivate::protocol_rule_file_set(void)
+{
+}
+
+} // namespace display_server
\ No newline at end of file
--- /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_PROTOCOL_TRACE_H__
+#define __DS_WAYLAND_PROTOCOL_TRACE_H__
+
+#include <DSObject.h>
+#include <DSCore.h>
+
+namespace display_server
+{
+
+class DSWaylandProtocolTracePrivate;
+
+class DSWaylandProtocolTrace : public DSObject
+{
+DS_PIMPL_USE_PRIVATE(DSWaylandProtocolTrace);
+
+public:
+ DSWaylandProtocolTrace(DSObject *parent);
+ virtual ~DSWaylandProtocolTrace();
+ static DSWaylandProtocolTrace *getInstance();
+ static void releaseInstance();
+
+ bool init(void);
+ int enableProtocolTrace(bool state);
+ //int registerProtocolRule(void);
+
+private:
+ static std::mutex __mutex;
+ static DSWaylandProtocolTrace *__protocolTrace;
+ static int __refCount;
+
+};
+
+}
+
+#endif // __DS_WAYLAND_PROTOCOL_TRACE_H__
\ No newline at end of file
--- /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_PROTOCOL_TRACE_PRIVATE_H__
+#define __DS_WAYLAND_PROTOCOL_TRACE_PRIVATE_H__
+
+#include "DSWaylandProtocolTrace.h"
+
+namespace display_server
+{
+
+class DSWaylandProtocolTracePrivate : public DSObjectPrivate
+{
+DS_PIMPL_USE_PUBLIC(DSWaylandProtocolTrace);
+
+public:
+ DSWaylandProtocolTracePrivate() = delete;
+ DSWaylandProtocolTracePrivate(DSWaylandProtocolTrace *p_ptr);
+ ~DSWaylandProtocolTracePrivate();
+
+
+protected:
+ void protocol_rule_init(char *rule_path);
+ void protocol_trace_init(char *trace_path);
+
+ void protocol_rule_set(void);
+ void protocol_rule_file_set(void);
+};
+
+}
+
+
+
+#endif // __DS_WAYLAND_PROTOCOL_TRACE_PRIVATE_H__
\ No newline at end of file
'DSWaylandServer/DSWaylandTizenAppinfoPrivate.h',
'DSWaylandServer/DSWaylandTizenAppinfo.h',
'DSWaylandServer/DSWaylandTizenAppinfo.cpp',
+ 'DSWaylandServer/DSWaylandProtocolTracePrivate.h',
+ 'DSWaylandServer/DSWaylandProtocolTrace.h',
+ 'DSWaylandServer/DSWaylandProtocolTrace.cpp',
]
libds_srcs += libds_wayland_srcs
--- /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 "libds-tests.h"
+#include "DSWaylandProtocolTrace.h"
+
+using namespace display_server;
+
+class DSWaylandProtocolTraceTest : public ::testing::Test
+{
+public:
+ void SetUp(void) override
+ {}
+ void TearDown(void) override
+ {}
+
+};
+
+TEST_F(DSWaylandProtocolTraceTest, NewDSWaylandProtocolTrace)
+{
+ DSWaylandProtocolTrace *pTrace = DSWaylandProtocolTrace::getInstance();
+ EXPECT_TRUE(pTrace != nullptr);
+
+ if(pTrace)
+ DSWaylandProtocolTrace::releaseInstance();
+}
+
+TEST_F(DSWaylandProtocolTraceTest, BasicMethods)
+{
+ DSWaylandProtocolTrace *pTrace = DSWaylandProtocolTrace::getInstance();
+ bool trace_state = false; //disable
+
+ if(pTrace)
+ {
+ EXPECT_TRUE(pTrace->init() == true);
+ EXPECT_TRUE(pTrace->enableProtocolTrace(trace_state) == 0);
+ DSWaylandProtocolTrace::releaseInstance();
+ }
+}
\ No newline at end of file
'DSKeyboard-test.cpp',
'DSTouch-test.cpp',
'DSTizenAppinfo-test.cpp',
+ 'DSWaylandProtocolTrace-test.cpp',
]
gmock_dep = dependency('gmock', method : 'pkg-config')