Seperate trigger event factory for macos + change file name 42/325042/7
authorEunki Hong <eunkiki.hong@samsung.com>
Sat, 31 May 2025 07:41:17 +0000 (16:41 +0900)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Wed, 4 Jun 2025 19:10:53 +0000 (19:10 +0000)
Change-Id: Ibd674d46fe59c205780704b826bb7e6215712ebd
Signed-off-by: Eunki Hong <eunkiki.hong@samsung.com>
12 files changed:
dali/internal/system/file.list
dali/internal/system/macos/trigger-event-factory-mac.cpp [new file with mode: 0644]
dali/internal/system/macos/trigger-event-mac.h [new file with mode: 0644]
dali/internal/system/macos/trigger-event-mac.mm [new file with mode: 0644]
dali/internal/system/macos/trigger-event.h [deleted file]
dali/internal/system/macos/trigger-event.mm [deleted file]
dali/internal/system/windows/trigger-event-factory-win.cpp [new file with mode: 0644]
dali/internal/system/windows/trigger-event-factory.cpp [deleted file]
dali/internal/system/windows/trigger-event-win.cpp [new file with mode: 0644]
dali/internal/system/windows/trigger-event-win.h [new file with mode: 0644]
dali/internal/system/windows/trigger-event.cpp [deleted file]
dali/internal/system/windows/trigger-event.h [deleted file]

index e0bb026565de44020aa8b74408fd385cb7051402..c6f4c5e8f3b75c2842a851e5ce61b649d95d4b32 100644 (file)
@@ -140,8 +140,8 @@ SET( adaptor_system_windows_src_files
     ${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
@@ -151,14 +151,14 @@ SET( adaptor_system_windows_src_files
 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
diff --git a/dali/internal/system/macos/trigger-event-factory-mac.cpp b/dali/internal/system/macos/trigger-event-factory-mac.cpp
new file mode 100644 (file)
index 0000000..d51a75e
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * 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
diff --git a/dali/internal/system/macos/trigger-event-mac.h b/dali/internal/system/macos/trigger-event-mac.h
new file mode 100644 (file)
index 0000000..c4abcc1
--- /dev/null
@@ -0,0 +1,70 @@
+#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
diff --git a/dali/internal/system/macos/trigger-event-mac.mm b/dali/internal/system/macos/trigger-event-mac.mm
new file mode 100644 (file)
index 0000000..e183ae9
--- /dev/null
@@ -0,0 +1,138 @@
+/*
+ * 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
diff --git a/dali/internal/system/macos/trigger-event.h b/dali/internal/system/macos/trigger-event.h
deleted file mode 100644 (file)
index a41e0bd..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-#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
diff --git a/dali/internal/system/macos/trigger-event.mm b/dali/internal/system/macos/trigger-event.mm
deleted file mode 100644 (file)
index 89b31d1..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * 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
diff --git a/dali/internal/system/windows/trigger-event-factory-win.cpp b/dali/internal/system/windows/trigger-event-factory-win.cpp
new file mode 100644 (file)
index 0000000..4da90fc
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * 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
diff --git a/dali/internal/system/windows/trigger-event-factory.cpp b/dali/internal/system/windows/trigger-event-factory.cpp
deleted file mode 100644 (file)
index ffda950..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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
diff --git a/dali/internal/system/windows/trigger-event-win.cpp b/dali/internal/system/windows/trigger-event-win.cpp
new file mode 100644 (file)
index 0000000..929f152
--- /dev/null
@@ -0,0 +1,94 @@
+/*\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
diff --git a/dali/internal/system/windows/trigger-event-win.h b/dali/internal/system/windows/trigger-event-win.h
new file mode 100644 (file)
index 0000000..57ab556
--- /dev/null
@@ -0,0 +1,81 @@
+#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
diff --git a/dali/internal/system/windows/trigger-event.cpp b/dali/internal/system/windows/trigger-event.cpp
deleted file mode 100644 (file)
index f1c9efa..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-/*\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
diff --git a/dali/internal/system/windows/trigger-event.h b/dali/internal/system/windows/trigger-event.h
deleted file mode 100644 (file)
index 292f0ad..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-#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