${adaptor_system_dir}/windows/system-factory-win.cpp
${adaptor_system_dir}/windows/system-settings-win.cpp
${adaptor_system_dir}/windows/timer-impl-win.cpp
- ${adaptor_system_dir}/windows/trigger-event.cpp
- ${adaptor_system_dir}/windows/trigger-event-factory.cpp
+ ${adaptor_system_dir}/windows/trigger-event-win.cpp
+ ${adaptor_system_dir}/windows/trigger-event-factory-win.cpp
${adaptor_system_dir}/windows/logging-win.cpp
${adaptor_system_dir}/windows/widget-application-impl-win.cpp
${adaptor_system_dir}/windows/widget-controller-win.cpp
SET( adaptor_system_macos_src_files
${adaptor_system_dir}/common/shared-file.cpp
${adaptor_system_dir}/common/time-service.cpp
- ${adaptor_system_dir}/common/trigger-event-factory.cpp
${adaptor_system_dir}/generic/shared-file-operations-generic.cpp
${adaptor_system_dir}/generic/system-error-print-generic.cpp
${adaptor_system_dir}/macos/file-descriptor-monitor-macos.cpp
${adaptor_system_dir}/macos/system-factory-mac.cpp
${adaptor_system_dir}/macos/system-settings-mac.cpp
${adaptor_system_dir}/macos/timer-impl-mac.cpp
- ${adaptor_system_dir}/macos/trigger-event.mm
+ ${adaptor_system_dir}/macos/trigger-event-factory-mac.cpp
+ ${adaptor_system_dir}/macos/trigger-event-mac.mm
${adaptor_system_dir}/macos/callback-manager-mac.mm
${adaptor_system_dir}/macos/widget-application-impl-mac.cpp
${adaptor_system_dir}/ubuntu-x11/logging-x.cpp
--- /dev/null
+/*
+ * Copyright (c) 2025 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali/integration-api/adaptor-framework/trigger-event-factory.h>
+
+// INTERNAL INCLUDES
+#include <dali/internal/system/macos/trigger-event-mac.h>
+
+namespace Dali
+{
+TriggerEventInterface* TriggerEventFactory::CreateTriggerEvent(CallbackBase* callback, TriggerEventInterface::Options options)
+{
+ return new Internal::Adaptor::TriggerEvent(callback, options);
+}
+
+void TriggerEventFactory::DestroyTriggerEvent(TriggerEventInterface* triggerEventInterface)
+{
+ Internal::Adaptor::TriggerEvent* triggerEvent(static_cast<Internal::Adaptor::TriggerEvent*>(triggerEventInterface));
+ delete triggerEvent;
+}
+
+} // namespace Dali
--- /dev/null
+#pragma once
+
+/*
+ * Copyright (c) 2025 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/signals/callback.h>
+
+// INTERNAL INCLUDES
+#include <dali/integration-api/adaptor-framework/trigger-event-interface.h>
+#include <dali/public-api/dali-adaptor-common.h>
+
+#include <memory>
+
+namespace Dali::Internal::Adaptor
+{
+class TriggerEvent : public TriggerEventInterface
+{
+public:
+ /**
+ * Constructor
+ * Creates an event file descriptor and starts a GSource which reads from the file
+ * descriptor when there is data.
+ *
+ * @param[in] callback The callback to call
+ * @param[in] options Trigger event options.
+ * @note The ownership of callback is taken by this class.
+ */
+ TriggerEvent(CallbackBase* callback, TriggerEventInterface::Options options);
+
+ /**
+ * Destructor
+ */
+ ~TriggerEvent();
+
+ /**
+ * Triggers the event.
+ *
+ * This can be called from one thread in order to wake up another thread.
+ */
+ void Trigger() override;
+
+ struct Impl;
+
+private:
+ /**
+ * @brief Called when our event file descriptor has been written to.
+ * @param[in] eventBitMask bit mask of events that occured on the file descriptor
+ */
+ void Triggered();
+
+ std::unique_ptr<CallbackBase> mCallback;
+ std::unique_ptr<Impl> mImpl;
+};
+
+} // namespace Dali::Internal::Adaptor
--- /dev/null
+/*
+ * Copyright (c) 2025 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#import <Foundation/Foundation.h>
+
+#include <atomic>
+#include <string>
+#include <sstream>
+#include <type_traits>
+
+#include <dali/internal/system/macos/trigger-event-mac.h>
+
+namespace
+{
+const char *EventName = "Dali::Internal::Adaptor::Triggerevent_";
+}
+
+@interface NotificationObserver : NSObject
+
+-(NotificationObserver *) initTriggerImpl:(Dali::Internal::Adaptor::TriggerEvent::Impl *) impl;
+
+@end
+
+namespace Dali::Internal::Adaptor
+{
+
+struct TriggerEvent::Impl final
+{
+ std::unique_ptr<CallbackBase> mCallback;
+ NotificationObserver *mReceiver;
+ NSString *mName;
+ TriggerEventInterface::Options mOptions;
+
+ Impl(CallbackBase *callback, TriggerEventInterface::Options options)
+ : mCallback(callback), mOptions(options)
+ {
+ const auto myId = mNameId.fetch_add(1, std::memory_order_relaxed);
+
+ std::stringstream ss;
+ ss << EventName << myId;
+ mName = [NSString stringWithUTF8String:ss.str().c_str()];
+
+ mReceiver = [[NotificationObserver alloc] initTriggerImpl:this];
+ }
+
+ Impl(Impl &&) = delete;
+ Impl &operator=(Impl &&) = delete;
+
+ ~Impl()
+ {
+ auto *center = [NSNotificationCenter defaultCenter];
+ [center removeObserver:mReceiver];
+ }
+
+ void Trigged()
+ {
+ CallbackBase::Execute( *mCallback );
+ }
+
+private:
+ // This is incremented each time the class is instatiated to guarantee
+ // an unique notification id
+ static std::atomic_uint64_t mNameId;
+};
+
+std::atomic<uint64_t> TriggerEvent::Impl::mNameId{0};
+
+TriggerEvent::TriggerEvent(CallbackBase *callback, TriggerEventInterface::Options options)
+ : mCallback(callback),
+ mImpl(std::make_unique<Impl>(MakeCallback(this, &TriggerEvent::Triggered), options))
+{
+}
+
+TriggerEvent::~TriggerEvent() = default;
+
+void TriggerEvent::Trigger()
+{
+ auto center = [NSDistributedNotificationCenter defaultCenter];
+
+ // Post a notification to the notification center
+ // The run loop will pop the queue and call the notification center
+ [center postNotificationName:mImpl->mName object:nil];
+}
+
+void TriggerEvent::Triggered()
+{
+ CallbackBase::Execute(*mCallback);
+
+ if (mImpl->mOptions == TriggerEventInterface::DELETE_AFTER_TRIGGER)
+ {
+ delete this;
+ }
+}
+
+}
+
+@implementation NotificationObserver
+{
+ Dali::Internal::Adaptor::TriggerEvent::Impl *mImpl;
+}
+
+-(void) ReceiveNotification: (NSNotification *) aNotification
+{
+ mImpl->Trigged();
+}
+
+-(NotificationObserver *) initTriggerImpl:(Dali::Internal::Adaptor::TriggerEvent::Impl *) impl;
+{
+ self = [super init];
+ if (self)
+ {
+ mImpl = impl;
+ auto center = [NSDistributedNotificationCenter defaultCenter];
+ [center addObserver:self
+ selector:@selector(ReceiveNotification:)
+ name:impl->mName
+ object:nil
+ suspensionBehavior:NSNotificationSuspensionBehaviorDeliverImmediately];
+ }
+
+ return self;
+}
+
+@end
+++ /dev/null
-#pragma once
-
-/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/signals/callback.h>
-
-// INTERNAL INCLUDES
-#include <dali/integration-api/adaptor-framework/trigger-event-interface.h>
-#include <dali/public-api/dali-adaptor-common.h>
-
-#include <memory>
-
-namespace Dali::Internal::Adaptor
-{
-class TriggerEvent : public TriggerEventInterface
-{
-public:
- /**
- * Constructor
- * Creates an event file descriptor and starts a GSource which reads from the file
- * descriptor when there is data.
- *
- * @param[in] callback The callback to call
- * @param[in] options Trigger event options.
- * @note The ownership of callback is taken by this class.
- */
- TriggerEvent(CallbackBase* callback, TriggerEventInterface::Options options);
-
- /**
- * Triggers the event.
- *
- * This can be called from one thread in order to wake up another thread.
- */
- void Trigger() override;
-
- struct Impl;
-
-private:
- /**
- * @brief Called when our event file descriptor has been written to.
- * @param[in] eventBitMask bit mask of events that occured on the file descriptor
- */
- void Triggered();
-
- std::unique_ptr<CallbackBase> mCallback;
- std::unique_ptr<Impl> mImpl;
-};
-
-} // namespace Dali::Internal::Adaptor
+++ /dev/null
-/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#import <Foundation/Foundation.h>
-
-#include <atomic>
-#include <string>
-#include <sstream>
-#include <type_traits>
-#include "trigger-event.h"
-
-namespace
-{
-const char *EventName = "Dali::Internal::Adaptor::Triggerevent_";
-}
-
-@interface NotificationObserver : NSObject
-
--(NotificationObserver *) initTriggerImpl:(Dali::Internal::Adaptor::TriggerEvent::Impl *) impl;
-
-@end
-
-namespace Dali::Internal::Adaptor
-{
-
-struct TriggerEvent::Impl final
-{
- std::unique_ptr<CallbackBase> mCallback;
- NotificationObserver *mReceiver;
- NSString *mName;
- TriggerEventInterface::Options mOptions;
-
- Impl(CallbackBase *callback, TriggerEventInterface::Options options)
- : mCallback(callback), mOptions(options)
- {
- const auto myId = mNameId.fetch_add(1, std::memory_order_relaxed);
-
- std::stringstream ss;
- ss << EventName << myId;
- mName = [NSString stringWithUTF8String:ss.str().c_str()];
-
- mReceiver = [[NotificationObserver alloc] initTriggerImpl:this];
- }
-
- Impl(Impl &&) = delete;
- Impl &operator=(Impl &&) = delete;
-
- ~Impl()
- {
- auto *center = [NSNotificationCenter defaultCenter];
- [center removeObserver:mReceiver];
- }
-
- void Trigged()
- {
- CallbackBase::Execute( *mCallback );
- }
-
-private:
- // This is incremented each time the class is instatiated to guarantee
- // an unique notification id
- static std::atomic_uint64_t mNameId;
-};
-
-std::atomic<uint64_t> TriggerEvent::Impl::mNameId{0};
-
-TriggerEvent::TriggerEvent(CallbackBase *callback, TriggerEventInterface::Options options)
- : mCallback(callback)
- , mImpl(std::make_unique<Impl>(MakeCallback(this, &TriggerEvent::Triggered), options))
-{
-}
-
-void TriggerEvent::Trigger()
-{
- auto center = [NSDistributedNotificationCenter defaultCenter];
-
- // Post a notification to the notification center
- // The run loop will pop the queue and call the notification center
- [center postNotificationName:mImpl->mName object:nil];
-}
-
-void TriggerEvent::Triggered()
-{
- CallbackBase::Execute(*mCallback);
-
- if (mImpl->mOptions == TriggerEventInterface::DELETE_AFTER_TRIGGER)
- {
- delete this;
- }
-}
-
-}
-
-@implementation NotificationObserver
-{
- Dali::Internal::Adaptor::TriggerEvent::Impl *mImpl;
-}
-
--(void) ReceiveNotification: (NSNotification *) aNotification
-{
- mImpl->Trigged();
-}
-
--(NotificationObserver *) initTriggerImpl:(Dali::Internal::Adaptor::TriggerEvent::Impl *) impl;
-{
- self = [super init];
- if (self)
- {
- mImpl = impl;
- auto center = [NSDistributedNotificationCenter defaultCenter];
- [center addObserver:self
- selector:@selector(ReceiveNotification:)
- name:impl->mName
- object:nil
- suspensionBehavior:NSNotificationSuspensionBehaviorDeliverImmediately];
- }
-
- return self;
-}
-
-@end
--- /dev/null
+/*
+ * Copyright (c) 2025 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali/integration-api/adaptor-framework/trigger-event-factory.h>
+
+// EXTERNAL INCLUDES
+#include <dali/internal/system/windows/trigger-event-win.h>
+
+namespace Dali
+{
+TriggerEventInterface* TriggerEventFactory::CreateTriggerEvent(CallbackBase* callback, TriggerEventInterface::Options options)
+{
+ return new Internal::Adaptor::TriggerEvent(callback, options);
+}
+
+void TriggerEventFactory::DestroyTriggerEvent(TriggerEventInterface* triggerEventInterface)
+{
+ Internal::Adaptor::TriggerEvent* triggerEvent(static_cast<Internal::Adaptor::TriggerEvent*>(triggerEventInterface));
+ delete triggerEvent;
+}
+
+} // namespace Dali
+++ /dev/null
-/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// CLASS HEADER
-#include <dali/integration-api/adaptor-framework/trigger-event-factory.h>
-
-// EXTERNAL INCLUDES
-#include <dali/internal/system/windows/trigger-event.h>
-
-namespace Dali
-{
-TriggerEventInterface* TriggerEventFactory::CreateTriggerEvent(CallbackBase* callback, TriggerEventInterface::Options options)
-{
- return new Internal::Adaptor::TriggerEvent(callback, options);
-}
-
-void TriggerEventFactory::DestroyTriggerEvent(TriggerEventInterface* triggerEventInterface)
-{
- Internal::Adaptor::TriggerEvent* triggerEvent(static_cast<Internal::Adaptor::TriggerEvent*>(triggerEventInterface));
- delete triggerEvent;
-}
-
-} // namespace Dali
--- /dev/null
+/*\r
+ * Copyright (c) 2025 Samsung Electronics Co., Ltd.\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ *\r
+ */\r
+\r
+// CLASS HEADER\r
+#include <dali/internal/system/windows/trigger-event-win.h>\r
+\r
+// EXTERNAL INCLUDES\r
+#include <unistd.h>\r
+\r
+#include <dali/integration-api/debug.h>\r
+\r
+// INTERNAL INCLUDES\r
+#include <dali/internal/system/common/file-descriptor-monitor.h>\r
+#include <dali/internal/window-system/windows/platform-implement-win.h>\r
+\r
+namespace Dali\r
+{\r
+namespace Internal\r
+{\r
+namespace Adaptor\r
+{\r
+TriggerEvent::TriggerEvent(CallbackBase* callback, TriggerEventInterface::Options options)\r
+: mCallback(callback),\r
+ mThreadID(-1),\r
+ mOptions(options)\r
+{\r
+ // Create accompanying file descriptor.\r
+ mThreadID = WindowsPlatform::GetCurrentThreadId();\r
+\r
+ if(mThreadID < 0)\r
+ {\r
+ DALI_LOG_ERROR("Unable to create TriggerEvent File descriptor\n");\r
+ }\r
+\r
+ mSelfCallback = MakeCallback(this, &TriggerEvent::Triggered);\r
+}\r
+\r
+TriggerEvent::~TriggerEvent()\r
+{\r
+ delete mCallback;\r
+ delete mSelfCallback;\r
+\r
+ if(mThreadID >= 0)\r
+ {\r
+ mThreadID = 0;\r
+ }\r
+}\r
+\r
+void TriggerEvent::Trigger()\r
+{\r
+ if(mThreadID >= 0)\r
+ {\r
+ // Increment event counter by 1.\r
+ // Writing to the file descriptor triggers the Dispatch() method in the other thread\r
+ // (if in multi-threaded environment).\r
+ WindowsPlatform::PostWinThreadMessage(WIN_CALLBACK_EVENT, reinterpret_cast<uint64_t>(mSelfCallback), 0, mThreadID);\r
+ }\r
+ else\r
+ {\r
+ DALI_LOG_ERROR("Attempting to write to an invalid file descriptor\n");\r
+ }\r
+}\r
+\r
+void TriggerEvent::Triggered()\r
+{\r
+ // Call the connected callback\r
+ CallbackBase::Execute(*mCallback);\r
+\r
+ // check if we should delete ourselves after the trigger\r
+ if(mOptions == TriggerEventInterface::DELETE_AFTER_TRIGGER)\r
+ {\r
+ delete this;\r
+ }\r
+}\r
+\r
+} // namespace Adaptor\r
+\r
+} // namespace Internal\r
+\r
+} // namespace Dali\r
--- /dev/null
+#ifndef DALI_INTERNAL_TRIGGER_EVENT_IMPL_H
+#define DALI_INTERNAL_TRIGGER_EVENT_IMPL_H
+
+/*
+ * Copyright (c) 2025 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/signals/callback.h>
+
+// INTERNAL INCLUDES
+#include <dali/integration-api/adaptor-framework/trigger-event-interface.h>
+#include <dali/public-api/dali-adaptor-common.h>
+
+namespace Dali
+{
+namespace Internal
+{
+namespace Adaptor
+{
+class TriggerEvent : public TriggerEventInterface
+{
+public:
+ /**
+ * Constructor
+ * Creates an event file descriptor and starts a GSource which reads from the file
+ * descriptor when there is data.
+ *
+ * @param[in] callback The callback to call
+ * @param[in] options Trigger event options.
+ * @note The ownership of callback is taken by this class.
+ */
+ TriggerEvent(CallbackBase* callback, TriggerEventInterface::Options options);
+
+ /**
+ * Destructor
+ */
+ ~TriggerEvent();
+
+public:
+ /**
+ * Triggers the event.
+ *
+ * This can be called from one thread in order to wake up another thread.
+ */
+ void Trigger();
+
+private:
+ /**
+ * @brief Called when our event file descriptor has been written to.
+ * @param[in] eventBitMask bit mask of events that occured on the file descriptor
+ */
+ void Triggered();
+
+private:
+ CallbackBase* mCallback;
+ CallbackBase* mSelfCallback;
+ int32_t mThreadID;
+ TriggerEventInterface::Options mOptions;
+};
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
+
+#endif // DALI_INTERNAL_TRIGGER_EVENT_IMPL_H
\ No newline at end of file
+++ /dev/null
-/*\r
- * Copyright (c) 2025 Samsung Electronics Co., Ltd.\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- *\r
- */\r
-\r
-// CLASS HEADER\r
-#include <dali/internal/system/windows/trigger-event.h>\r
-\r
-// EXTERNAL INCLUDES\r
-#include <unistd.h>\r
-\r
-#include <dali/integration-api/debug.h>\r
-\r
-// INTERNAL INCLUDES\r
-#include <dali/internal/system/common/file-descriptor-monitor.h>\r
-#include <dali/internal/window-system/windows/platform-implement-win.h>\r
-\r
-namespace Dali\r
-{\r
-namespace Internal\r
-{\r
-namespace Adaptor\r
-{\r
-TriggerEvent::TriggerEvent(CallbackBase* callback, TriggerEventInterface::Options options)\r
-: mCallback(callback),\r
- mThreadID(-1),\r
- mOptions(options)\r
-{\r
- // Create accompanying file descriptor.\r
- mThreadID = WindowsPlatform::GetCurrentThreadId();\r
-\r
- if(mThreadID < 0)\r
- {\r
- DALI_LOG_ERROR("Unable to create TriggerEvent File descriptor\n");\r
- }\r
-\r
- mSelfCallback = MakeCallback(this, &TriggerEvent::Triggered);\r
-}\r
-\r
-TriggerEvent::~TriggerEvent()\r
-{\r
- delete mCallback;\r
- delete mSelfCallback;\r
-\r
- if(mThreadID >= 0)\r
- {\r
- mThreadID = 0;\r
- }\r
-}\r
-\r
-void TriggerEvent::Trigger()\r
-{\r
- if(mThreadID >= 0)\r
- {\r
- // Increment event counter by 1.\r
- // Writing to the file descriptor triggers the Dispatch() method in the other thread\r
- // (if in multi-threaded environment).\r
- WindowsPlatform::PostWinThreadMessage(WIN_CALLBACK_EVENT, reinterpret_cast<uint64_t>(mSelfCallback), 0, mThreadID);\r
- }\r
- else\r
- {\r
- DALI_LOG_ERROR("Attempting to write to an invalid file descriptor\n");\r
- }\r
-}\r
-\r
-void TriggerEvent::Triggered()\r
-{\r
- // Call the connected callback\r
- CallbackBase::Execute(*mCallback);\r
-\r
- //check if we should delete ourselves after the trigger\r
- if(mOptions == TriggerEventInterface::DELETE_AFTER_TRIGGER)\r
- {\r
- delete this;\r
- }\r
-}\r
-\r
-} // namespace Adaptor\r
-\r
-} // namespace Internal\r
-\r
-} // namespace Dali\r
+++ /dev/null
-#ifndef DALI_INTERNAL_TRIGGER_EVENT_IMPL_H
-#define DALI_INTERNAL_TRIGGER_EVENT_IMPL_H
-
-/*
-* Copyright (c) 2021 Samsung Electronics Co., Ltd.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/signals/callback.h>
-
-// INTERNAL INCLUDES
-#include <dali/integration-api/adaptor-framework/trigger-event-interface.h>
-#include <dali/public-api/dali-adaptor-common.h>
-
-namespace Dali
-{
-namespace Internal
-{
-namespace Adaptor
-{
-class TriggerEvent : public TriggerEventInterface
-{
-public:
- /**
- * Constructor
- * Creates an event file descriptor and starts a GSource which reads from the file
- * descriptor when there is data.
- *
- * @param[in] callback The callback to call
- * @param[in] options Trigger event options.
- * @note The ownership of callback is taken by this class.
- */
- TriggerEvent(CallbackBase* callback, TriggerEventInterface::Options options);
-
- /**
- * Destructor
- */
- ~TriggerEvent();
-
-public:
- /**
- * Triggers the event.
- *
- * This can be called from one thread in order to wake up another thread.
- */
- void Trigger();
-
-private:
- /**
- * @brief Called when our event file descriptor has been written to.
- * @param[in] eventBitMask bit mask of events that occured on the file descriptor
- */
- void Triggered();
-
-private:
- CallbackBase* mCallback;
- CallbackBase* mSelfCallback;
- int32_t mThreadID;
- TriggerEventInterface::Options mOptions;
-};
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
-
-#endif // DALI_INTERNAL_TRIGGER_EVENT_IMPL_H
\ No newline at end of file