*
* @param[in] object The accessible object
*/
- virtual void RegisterDefaultLabel(Accessible* object) = 0;
+ virtual void RegisterDefaultLabel(std::shared_ptr<Accessible> object) = 0;
/**
* @brief Removes object from the stack of "default label" sourcing objects.
*
* @param[in] object The accessible object
*/
- virtual void UnregisterDefaultLabel(Accessible* object) = 0;
+ virtual void UnregisterDefaultLabel(std::shared_ptr<Accessible> object) = 0;
/**
* @brief Gets the top-most object from the stack of "default label" sourcing objects.
* Following strings are valid values for "default_label" attribute: "enabled", "disabled".
* Any other value will be interpreted as "enabled".
*/
- virtual Accessible* GetDefaultLabel(Accessible* root) const = 0;
+ virtual Accessible* GetDefaultLabel(Accessible* root) = 0;
/**
* @brief Sets name of current application which will be visible on accessibility bus.
*
* @param obj Accessible Object
*/
- virtual void EmitScrollStarted(Accessible *obj) = 0;
+ virtual void EmitScrollStarted(Accessible* obj) = 0;
- /**
+ /**
* @brief Emits ScrollFinished event on at-spi bus.
*
* @param obj Accessible Object
*/
- virtual void EmitScrollFinished(Accessible *obj) = 0;
+ virtual void EmitScrollFinished(Accessible* obj) = 0;
/**
* @brief Emits state-changed event on at-spi bus.
* The actual number of events emitted during a given time interval may be smaller
* than the number of calls to this method, but at least one is guaranteed.
*/
- virtual void EmitPostRender(Accessible *obj) = 0;
+ virtual void EmitPostRender(Accessible* obj) = 0;
/**
* @brief Emits key event on at-spi bus.
#include <dali/devel-api/atspi-interfaces/hypertext.h>
#include <dali/devel-api/atspi-interfaces/selection.h>
#include <dali/devel-api/atspi-interfaces/socket.h>
-#include <dali/devel-api/atspi-interfaces/table.h>
#include <dali/devel-api/atspi-interfaces/table-cell.h>
+#include <dali/devel-api/atspi-interfaces/table.h>
#include <dali/devel-api/atspi-interfaces/text.h>
#include <dali/devel-api/atspi-interfaces/value.h>
#include <dali/internal/adaptor/common/adaptor-impl.h>
state[State::VISIBLE] = true;
state[State::ACTIVE] = visible;
}
- else if (GetParent())
+ else if(GetParent())
{
auto parentState = GetParent()->GetStates();
state[State::SHOWING] = parentState[State::SHOWING];
void SetListenPostRender(bool enabled) override
{
- if (!mRoot)
+ if(!mRoot)
{
return;
}
- auto window = Dali::DevelWindow::Get(Self());
+ auto window = Dali::DevelWindow::Get(Self());
Dali::Internal::Adaptor::Window& windowImpl = Dali::GetImplementation(window);
if(!mRenderNotification)
{
mRenderNotification = std::unique_ptr<TriggerEventInterface>(
- TriggerEventFactory::CreateTriggerEvent(MakeCallback(this, &AdaptorAccessible::OnPostRender),
- TriggerEventInterface::KEEP_ALIVE_AFTER_TRIGGER));
+ TriggerEventFactory::CreateTriggerEvent(MakeCallback(this, &AdaptorAccessible::OnPostRender),
+ TriggerEventInterface::KEEP_ALIVE_AFTER_TRIGGER));
}
- if (enabled)
+ if(enabled)
{
windowImpl.SetRenderNotification(mRenderNotification.get());
}
}
}; // AdaptorAccessible
-using AdaptorAccessiblesType = std::unordered_map<const Dali::RefObject*, std::unique_ptr<AdaptorAccessible> >;
+using AdaptorAccessiblesType = std::unordered_map<const Dali::RefObject*, std::shared_ptr<AdaptorAccessible>>;
// Save RefObject from an Actor in Accessible::Get()
AdaptorAccessiblesType& GetAdaptorAccessibles()
return gAdaptorAccessibles;
}
-std::function<Accessible*(Dali::Actor)> convertingFunctor = [](Dali::Actor) -> Accessible* {
+std::function<std::shared_ptr<Accessible>(Dali::Actor)> convertingFunctor = [](Dali::Actor) -> std::shared_ptr<Accessible> {
return nullptr;
};
});
}
-void Accessible::RegisterExternalAccessibleGetter(std::function<Accessible*(Dali::Actor)> functor)
+void Accessible::RegisterExternalAccessibleGetter(std::function<std::shared_ptr<Accessible>(Dali::Actor)> functor)
{
convertingFunctor = functor;
}
-Accessible* Accessible::Get(Dali::Actor actor)
+std::shared_ptr<Accessible> Accessible::GetOwningPtr(Dali::Actor actor)
{
if(!actor)
{
}
pair.first->second.reset(new AdaptorAccessible(actor, isRoot));
}
- accessible = pair.first->second.get();
+ accessible = pair.first->second;
}
return accessible;
}
+
+Accessible* Accessible::Get(Dali::Actor actor)
+{
+ auto accessible = Accessible::GetOwningPtr(actor);
+ return accessible ? accessible.get() : nullptr;
+}
\ No newline at end of file
#define DALI_ADAPTOR_ATSPI_ACCESSIBLE_H
/*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
* @brief The method registers functor resposible for converting Actor into Accessible.
* @param functor The returning Accessible handle from Actor object
*/
- static void RegisterExternalAccessibleGetter(std::function<Accessible*(Dali::Actor)> functor);
+ static void RegisterExternalAccessibleGetter(std::function<std::shared_ptr<Accessible>(Dali::Actor)> functor);
/**
* @brief Acquires Accessible object from Actor object.
*
* @param[in] actor Actor object
*
- * @return The handle to Accessible object
+ * @return The raw pointer to Accessible object
*/
static Accessible* Get(Dali::Actor actor);
/**
+ * @brief Acquires Accessible object from Actor object.
+ *
+ * @param[in] actor Actor object
+ *
+ * @return The owning pointer to Accessible object
+ */
+ static std::shared_ptr<Accessible> GetOwningPtr(Dali::Actor actor);
+
+ /**
* @brief Obtains the DBus interface name for the specified AT-SPI interface.
*
* @param interface AT-SPI interface identifier (e.g. AtspiInterface::ACCESSIBLE)
/*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
#if defined(DEBUG_ENABLED)
Debug::Filter* gSceneHolderLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_SCENE_HOLDER");
#endif
+
+const uint32_t MAX_PRESSED_POINT_COUNT = 2;
} // unnamed namespace
uint32_t SceneHolder::mSceneHolderCounter = 0;
mAdaptor(nullptr),
mDpi(),
mAdaptorStarted(false),
- mVisible(true)
+ mVisible(true),
+ mHandledMultiTouch(false),
+ mPreviousTouchEvent(),
+ mPreviousHoverEvent(),
+ mPreviousType(Integration::TouchEventCombiner::DISPATCH_NONE)
{
}
{
timeStamp = TimeService::GetMilliSeconds();
}
-
Vector2 convertedPosition = RecalculatePosition(point.GetScreenPosition());
point.SetScreenPosition(convertedPosition);
Integration::TouchEvent touchEvent;
Integration::HoverEvent hoverEvent;
- Integration::TouchEventCombiner::EventDispatchType type = mCombiner.GetNextTouchEvent(point, timeStamp, touchEvent, hoverEvent);
+ Integration::TouchEventCombiner::EventDispatchType type = mCombiner.GetNextTouchEvent(point, timeStamp, touchEvent, hoverEvent, mHandledMultiTouch);
if(type != Integration::TouchEventCombiner::DISPATCH_NONE)
{
DALI_LOG_INFO(gSceneHolderLogFilter, Debug::Verbose, "%d: Device %d: Button state %d (%.2f, %.2f)\n", timeStamp, point.GetDeviceId(), point.GetState(), point.GetScreenPosition().x, point.GetScreenPosition().y);
// Keep the handle alive until the core events are processed.
Dali::BaseHandle sceneHolder(this);
- // First the touch and/or hover event & related gesture events are queued
+ uint32_t pointCount = touchEvent.GetPointCount();
+ if(pointCount > MAX_PRESSED_POINT_COUNT)
+ {
+ mPreviousTouchEvent = touchEvent;
+ mPreviousHoverEvent = hoverEvent;
+ if(mPreviousType == Integration::TouchEventCombiner::DISPATCH_NONE)
+ {
+ mPreviousType = type;
+ }
+ else if(mPreviousType != type)
+ {
+ mPreviousType = Integration::TouchEventCombiner::DISPATCH_BOTH;
+ }
+ mHandledMultiTouch = true;
+ }
+
if(type == Integration::TouchEventCombiner::DISPATCH_TOUCH || type == Integration::TouchEventCombiner::DISPATCH_BOTH)
{
mLastTouchEvent = Dali::Integration::NewTouchEvent(timeStamp, point);
- mScene.QueueEvent(touchEvent);
}
if(type == Integration::TouchEventCombiner::DISPATCH_HOVER || type == Integration::TouchEventCombiner::DISPATCH_BOTH)
{
mLastHoverEvent = Dali::Integration::NewHoverEvent(timeStamp, point);
- mScene.QueueEvent(hoverEvent);
}
// Next the events are processed with a single call into Core
+ if(pointCount <= MAX_PRESSED_POINT_COUNT || (point.GetState() != PointState::MOTION))
+ {
+ mHandledMultiTouch = false;
+ mPreviousType = Integration::TouchEventCombiner::DISPATCH_NONE;
+
+ // First the touch and/or hover event & related gesture events are queued
+ if(type == Integration::TouchEventCombiner::DISPATCH_TOUCH || type == Integration::TouchEventCombiner::DISPATCH_BOTH)
+ {
+ mScene.QueueEvent(touchEvent);
+ }
+
+ if(type == Integration::TouchEventCombiner::DISPATCH_HOVER || type == Integration::TouchEventCombiner::DISPATCH_BOTH)
+ {
+ mScene.QueueEvent(hoverEvent);
+ }
+ mAdaptor->ProcessCoreEvents();
+ }
+ }
+}
+
+void SceneHolder::FeedMouseFrameEvent()
+{
+ if(DALI_UNLIKELY(!mAdaptorStarted))
+ {
+ DALI_LOG_ERROR("Adaptor is stopped, or not be started yet. Ignore this feed.\n");
+ return;
+ }
+
+ if(mPreviousType == Integration::TouchEventCombiner::DISPATCH_TOUCH || mPreviousType == Integration::TouchEventCombiner::DISPATCH_BOTH)
+ {
+ mScene.QueueEvent(mPreviousTouchEvent);
+ }
+
+ if(mPreviousType == Integration::TouchEventCombiner::DISPATCH_HOVER || mPreviousType == Integration::TouchEventCombiner::DISPATCH_BOTH)
+ {
+ mScene.QueueEvent(mPreviousHoverEvent);
+ }
+
+ if(mPreviousType != Integration::TouchEventCombiner::DISPATCH_NONE)
+ {
mAdaptor->ProcessCoreEvents();
}
+
+ mHandledMultiTouch = false;
+ mPreviousType = Integration::TouchEventCombiner::DISPATCH_NONE;
}
const Dali::TouchEvent& SceneHolder::GetLastTouchEvent() const
mScene.QueueEvent(event);
// Next the events are processed with a single call into Core
+ mHandledMultiTouch = false;
+ mPreviousType = Integration::TouchEventCombiner::DISPATCH_NONE;
mAdaptor->ProcessCoreEvents();
}
#define DALI_INTEGRATION_INTERNAL_SCENEHOLDER_H
/*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
#include <dali/integration-api/events/key-event-integ.h>
#include <dali/integration-api/events/point.h>
#include <dali/integration-api/events/touch-event-combiner.h>
+#include <dali/integration-api/events/touch-event-integ.h>
#include <dali/integration-api/scene.h>
#include <dali/public-api/common/intrusive-ptr.h>
#include <dali/public-api/events/hover-event.h>
void FeedTouchPoint(Dali::Integration::Point& point, int timeStamp);
/**
+ * @copydoc Dali::Integration::SceneHolder::FeedMouseFrameEvent
+ */
+ void FeedMouseFrameEvent();
+
+ /**
* @brief Get the Last Touch Event
*
* @return Dali::TouchEvent
Uint16Pair mDpi; ///< The DPI for this SceneHolder.
- bool mAdaptorStarted; ///< Whether the adaptor has started or not
- bool mVisible : 1; ///< Whether the scene is visible or not
+ bool mAdaptorStarted; ///< Whether the adaptor has started or not
+ bool mVisible : 1; ///< Whether the scene is visible or not
+ bool mHandledMultiTouch : 1;
+ Integration::TouchEvent mPreviousTouchEvent;
+ Integration::HoverEvent mPreviousHoverEvent;
+ Integration::TouchEventCombiner::EventDispatchType mPreviousType;
};
} // namespace Adaptor
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
if(functor)
{
functor();
- functor = {};
+ functor = {};
countdown = countdownBase;
}
else
{
// Remove entries for objects which no longer exist
mDefaultLabels.remove_if([](const DefaultLabelType& label) {
- return !label.first.GetBaseHandle(); // Check window's weak handle
- // TODO: Once Accessible becomes a handle type, check its weak handle here as well
+ // Check 1) window's weak handle; 2) accessible's ref object
+ return !label.first.GetBaseHandle() || label.second.expired();
});
}
-void BridgeBase::RegisterDefaultLabel(Accessible* object)
+void BridgeBase::RegisterDefaultLabel(std::shared_ptr<Accessible> object)
{
CompressDefaultLabels();
- Dali::WeakHandle<Dali::Window> window = GetWindow(object);
+ Dali::WeakHandle<Dali::Window> window = GetWindow(object.get());
if(!window.GetBaseHandle()) // true also if `object` is null
{
DALI_LOG_ERROR("Cannot register default label: object does not belong to any window");
return;
}
- auto it = std::find_if(mDefaultLabels.begin(), mDefaultLabels.end(), [object](const DefaultLabelType& label) {
- return object == label.second;
+ auto it = std::find_if(mDefaultLabels.begin(), mDefaultLabels.end(), [&object](const DefaultLabelType& label) {
+ auto labelPtr = label.second.lock();
+ return labelPtr && object == labelPtr;
});
if(it == mDefaultLabels.end())
}
}
-void BridgeBase::UnregisterDefaultLabel(Accessible* object)
+void BridgeBase::UnregisterDefaultLabel(std::shared_ptr<Accessible> object)
{
CompressDefaultLabels();
- mDefaultLabels.remove_if([object](const DefaultLabelType& label) {
- return object == label.second;
+ mDefaultLabels.remove_if([&object](const DefaultLabelType& label) {
+ auto labelPtr = label.second.lock();
+ return labelPtr && object == labelPtr;
});
}
-Accessible* BridgeBase::GetDefaultLabel(Accessible* root) const
+Accessible* BridgeBase::GetDefaultLabel(Accessible* root)
{
+ CompressDefaultLabels();
+
Dali::WeakHandle<Dali::Window> window = GetWindow(root);
if(!window.GetBaseHandle())
{
return window == label.first;
});
- return (it == mDefaultLabels.rend()) ? root : it->second;
+ Accessible* rawPtr = root;
+ if(it != mDefaultLabels.rend())
+ {
+ if(auto labelPtr = it->second.lock())
+ {
+ rawPtr = labelPtr.get();
+ }
+ }
+
+ return rawPtr;
}
std::string BridgeBase::StripPrefix(const std::string& path)
#define DALI_INTERNAL_ACCESSIBILITY_BRIDGE_BASE_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
*/
enum class CoalescableMessages
{
- BOUNDS_CHANGED, ///< Bounds changed
- SET_OFFSET, ///< Set offset
- POST_RENDER, ///< Post render
- STATE_CHANGED_BEGIN = 500, ///< State changed (begin of reserved range)
- STATE_CHANGED_END = STATE_CHANGED_BEGIN + 99, ///< State changed (end of reserved range)
- PROPERTY_CHANGED_BEGIN, ///< Property changed (begin of reserved range)
+ BOUNDS_CHANGED, ///< Bounds changed
+ SET_OFFSET, ///< Set offset
+ POST_RENDER, ///< Post render
+ STATE_CHANGED_BEGIN = 500, ///< State changed (begin of reserved range)
+ STATE_CHANGED_END = STATE_CHANGED_BEGIN + 99, ///< State changed (end of reserved range)
+ PROPERTY_CHANGED_BEGIN, ///< Property changed (begin of reserved range)
PROPERTY_CHANGED_END = PROPERTY_CHANGED_BEGIN + 99, ///< Property changed (end of reserved range)
};
/**
* @copydoc Dali::Accessibility::Bridge::RegisterDefaultLabel()
*/
- void RegisterDefaultLabel(Dali::Accessibility::Accessible* object) override;
+ void RegisterDefaultLabel(std::shared_ptr<Dali::Accessibility::Accessible> object) override;
/**
* @copydoc Dali::Accessibility::Bridge::UnregisterDefaultLabel()
*/
- void UnregisterDefaultLabel(Dali::Accessibility::Accessible* object) override;
+ void UnregisterDefaultLabel(std::shared_ptr<Dali::Accessibility::Accessible> object) override;
/**
* @copydoc Dali::Accessibility::Bridge::GetDefaultLabel()
*/
- Dali::Accessibility::Accessible* GetDefaultLabel(Dali::Accessibility::Accessible* root) const override;
+ Dali::Accessibility::Accessible* GetDefaultLabel(Dali::Accessibility::Accessible* root) override;
/**
* @copydoc Dali::Accessibility::Bridge::GetApplication()
protected:
// We use a weak handle in order not to keep a window alive forever if someone forgets to UnregisterDefaultLabel()
- using DefaultLabelType = std::pair<Dali::WeakHandle<Dali::Window>, Dali::Accessibility::Accessible*>;
+ using DefaultLabelType = std::pair<Dali::WeakHandle<Dali::Window>, std::weak_ptr<Dali::Accessibility::Accessible>>;
using DefaultLabelsType = std::list<DefaultLabelType>;
mutable ApplicationAccessible mApplication;
*
*/
-#include <dali/devel-api/adaptor-framework/accessibility.h>
#include <dali/devel-api/adaptor-framework/accessibility-bridge.h>
+#include <dali/devel-api/adaptor-framework/accessibility.h>
namespace Dali::Accessibility
{
{
}
- void RegisterDefaultLabel(Accessibility::Accessible* object) override
+ void RegisterDefaultLabel(std::shared_ptr<Accessibility::Accessible> object) override
{
}
- void UnregisterDefaultLabel(Accessibility::Accessible* object) override
+ void UnregisterDefaultLabel(std::shared_ptr<Accessibility::Accessible> object) override
{
}
- Dali::Accessibility::Accessible* GetDefaultLabel(Dali::Accessibility::Accessible* root) const override
+ Dali::Accessibility::Accessible* GetDefaultLabel(Dali::Accessibility::Accessible* root) override
{
return nullptr;
}
{
}
- void EmitPostRender(Accessibility::Accessible *obj) override
+ void EmitPostRender(Accessibility::Accessible* obj) override
{
}
TizenPlatformAbstraction::TizenPlatformAbstraction()
: mDataStoragePath(""),
mTimerPairsWaiting(),
- mTimerPairsSpent()
-
+ mTimerPairsSpent(),
+ mCleanupIdleCallback(nullptr)
{
}
TizenPlatformAbstraction::~TizenPlatformAbstraction()
{
+ if(mCleanupIdleCallback && Dali::Adaptor::IsAvailable())
+ {
+ Dali::Adaptor::Get().RemoveIdle(mCleanupIdleCallback);
+ mCleanupIdleCallback = nullptr;
+ }
}
ImageDimensions TizenPlatformAbstraction::GetClosestImageSize(const std::string& filename,
void TizenPlatformAbstraction::CancelTimer(uint32_t timerId)
{
- auto iter = std::remove_if(
- mTimerPairsWaiting.begin(), mTimerPairsWaiting.end(), [&timerId](std::unique_ptr<TimerCallback>& timerCallbackPtr) {
- if(timerCallbackPtr->mIdNumber == timerId)
- {
- timerCallbackPtr->mTimer.Stop();
- return true;
- }
- else
- {
- return false;
- }
- });
-
- mTimerPairsWaiting.erase(iter, mTimerPairsWaiting.end());
+ std::vector<std::unique_ptr<TimerCallback> >::iterator timerIter = std::find_if(mTimerPairsWaiting.begin(), mTimerPairsWaiting.end(), [&timerId](std::unique_ptr<TimerCallback>& timerCallbackPtr) {
+ if(timerCallbackPtr->mIdNumber == timerId)
+ {
+ timerCallbackPtr->mTimer.Stop();
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ });
+
+ if(timerIter == std::end(mTimerPairsWaiting))
+ {
+ DALI_LOG_DEBUG_INFO("TimerId %u Cancelled duplicated.\n", timerId);
+ return;
+ }
+
+ // Move the canceled item to the spent list.
+ std::move(timerIter, timerIter + 1, std::back_inserter(mTimerPairsSpent));
+
+ mTimerPairsWaiting.erase(timerIter, timerIter + 1);
+
+ RequestCleanupTimers();
}
void TizenPlatformAbstraction::RunTimerFunction(TimerCallback& timerPtr)
if(timerIter == std::end(mTimerPairsWaiting))
{
- DALI_ASSERT_DEBUG(false);
+ // It might be cancel during callback execute.
+ DALI_LOG_DEBUG_INFO("Timer might be cancelled during execute.\n");
+ return;
}
- // ...and move it
+ // Move the executed item to the spent list.
std::move(timerIter, timerIter + 1, std::back_inserter(mTimerPairsSpent));
mTimerPairsWaiting.erase(timerIter, timerIter + 1);
- if(DALI_UNLIKELY(!Dali::Adaptor::IsAvailable() || !Dali::Adaptor::Get().AddIdle(MakeCallback(this, &TizenPlatformAbstraction::CleanupTimers), false)))
- {
- DALI_LOG_ERROR("Fail to add idle callback for timer function. Call it synchronously.\n");
- CleanupTimers();
- }
+ RequestCleanupTimers();
}
void TizenPlatformAbstraction::CleanupTimers()
{
+ // Idler callback called. Remove it.
+ mCleanupIdleCallback = nullptr;
+
mTimerPairsSpent.clear();
}
+void TizenPlatformAbstraction::RequestCleanupTimers()
+{
+ if(!mCleanupIdleCallback)
+ {
+ mCleanupIdleCallback = MakeCallback(this, &TizenPlatformAbstraction::CleanupTimers);
+ if(DALI_UNLIKELY(!Dali::Adaptor::IsAvailable() || !Dali::Adaptor::Get().AddIdle(mCleanupIdleCallback, false)))
+ {
+ DALI_LOG_ERROR("Fail to add idle callback for timer function. Call it synchronously.\n");
+ CleanupTimers();
+ }
+ }
+}
+
TizenPlatformAbstraction* CreatePlatformAbstraction()
{
return new TizenPlatformAbstraction();
#define DALI_TIZEN_PLATFORM_ABSTRACTION_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
*/
void RunTimerFunction(TimerCallback& timerPtr);
+ /**
+ * @brief Requests cleanup of timers into idler.
+ */
+ void RequestCleanupTimers();
+
TizenPlatformAbstraction(const TizenPlatformAbstraction&); ///< Undefined
TizenPlatformAbstraction& operator=(const TizenPlatformAbstraction&); ///< Undefined
std::vector<std::unique_ptr<TimerCallback> > mTimerPairsWaiting;
std::vector<std::unique_ptr<TimerCallback> > mTimerPairsSpent;
+
+ Dali::CallbackBase* mCleanupIdleCallback;
};
/**
/*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
windowBase->FocusChangedSignal().Connect(this, &EventHandler::OnFocusChanged);
windowBase->RotationSignal().Connect(this, &EventHandler::OnRotation);
windowBase->TouchEventSignal().Connect(this, &EventHandler::OnTouchEvent);
+ windowBase->MouseFrameEventSignal().Connect(this, &EventHandler::OnMouseFrameEvent);
windowBase->WheelEventSignal().Connect(this, &EventHandler::OnWheelEvent);
windowBase->KeyEventSignal().Connect(this, &EventHandler::OnKeyEvent);
windowBase->SelectionDataSendSignal().Connect(this, &EventHandler::OnSelectionDataSend);
}
}
+void EventHandler::OnMouseFrameEvent()
+{
+ for(ObserverContainer::iterator iter = mObservers.begin(), endIter = mObservers.end(); iter != endIter; ++iter)
+ {
+ (*iter)->OnMouseFrameEvent();
+ }
+}
+
void EventHandler::OnWheelEvent(Integration::WheelEvent& wheelEvent)
{
for(ObserverContainer::iterator iter = mObservers.begin(), endIter = mObservers.end(); iter != endIter; ++iter)
#define DALI_INTERNAL_EVENT_HANDLER_H
/*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
virtual void OnTouchPoint(Dali::Integration::Point& point, int timeStamp) = 0;
/**
+ * @brief Deriving classes should override this to be notified when we receive a mouse frame event.
+ */
+ virtual void OnMouseFrameEvent() = 0;
+
+ /**
* Deriving classes should override this to be notified when we receive a wheel event.
* @param[in] wheelEvent The wheel event
*/
void OnTouchEvent(Integration::Point& point, uint32_t timeStamp);
/**
+ * Called when a mouse frame event is received.
+ */
+ void OnMouseFrameEvent();
+
+ /**
* Called when a mouse wheel is received.
*/
void OnWheelEvent(Integration::WheelEvent& wheelEvent);
/*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
mTouchedSignal.Emit(touchEvent);
}
+void GlWindow::OnMouseFrameEvent()
+{
+}
+
void GlWindow::OnWheelEvent(Dali::Integration::WheelEvent& wheelEvent)
{
// TODO:
#define DALI_INTERNAL_WINDOWSYSTEM_COMMON_GL_WINDOW_IMPL_H
/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
void OnTouchPoint(Dali::Integration::Point& point, int timeStamp) override;
/**
+ * @copydoc Dali::Internal::Adaptor::EventHandler::Observer::OnMouseFrameEvent
+ */
+ void OnMouseFrameEvent() override;
+
+ /**
* @copydoc Dali::Internal::Adaptor::EventHandler::Observer::OnWheelEvent
*/
void OnWheelEvent(Dali::Integration::WheelEvent& wheelEvent) override;
/*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
mWindowDamagedSignal(),
mRotationSignal(),
mTouchEventSignal(),
+ mMouseFrameEventSignal(),
mWheelEventSignal(),
mKeyEventSignal(),
mSelectionDataSendSignal(),
return mTouchEventSignal;
}
+WindowBase::MouseFrameEventSignalType& WindowBase::MouseFrameEventSignal()
+{
+ return mMouseFrameEventSignal;
+}
+
WindowBase::WheelEventSignalType& WindowBase::WheelEventSignal()
{
return mWheelEventSignal;
#define DALI_INTERNAL_WINDOWSYSTEM_COMMON_WINDOW_BASE_H
/*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
// Input events
typedef Signal<void(Integration::Point&, uint32_t)> TouchEventSignalType;
+ typedef Signal<void()> MouseFrameEventSignalType;
typedef Signal<void(Integration::WheelEvent&)> WheelEventSignalType;
typedef Signal<void(Integration::KeyEvent&)> KeyEventSignalType;
*/
virtual void SetFrontBufferRendering(bool enable) = 0;
- /**
+ /**
* @brief Enables or disables front buffer rendering.
* @return Returns whether front buffer rendering has been enabled or not.
*/
TouchEventSignalType& TouchEventSignal();
/**
+ * @brief This signal is emitted when a mouse frame event is received.
+ */
+ MouseFrameEventSignalType& MouseFrameEventSignal();
+
+ /**
* @brief This signal is emitted when a mouse wheel is received.
*/
WheelEventSignalType& WheelEventSignal();
DamageSignalType mWindowDamagedSignal;
RotationSignalType mRotationSignal;
TouchEventSignalType mTouchEventSignal;
+ MouseFrameEventSignalType mMouseFrameEventSignal;
WheelEventSignalType mWheelEventSignal;
KeyEventSignalType mKeyEventSignal;
SelectionSignalType mSelectionDataSendSignal;
FeedTouchPoint(point, timeStamp);
}
+void Window::OnMouseFrameEvent()
+{
+ FeedMouseFrameEvent();
+}
+
void Window::OnWheelEvent(Dali::Integration::WheelEvent& wheelEvent)
{
FeedWheelEvent(wheelEvent);
#define DALI_INTERNAL_WINDOWSYSTEM_COMMON_WINDOW_IMPL_H
/*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
void OnTouchPoint(Dali::Integration::Point& point, int timeStamp) override;
/**
+ * @copydoc Dali::Internal::Adaptor::EventHandler::Observer::OnMouseFrameEvent
+ */
+ void OnMouseFrameEvent() override;
+
+ /**
* @copydoc Dali::Internal::Adaptor::EventHandler::Observer::OnWheelEvent
*/
void OnWheelEvent(Dali::Integration::WheelEvent& wheelEvent) override;
bool mOpaqueState : 1;
bool mWindowRotationAcknowledgement : 1;
bool mFocused : 1;
- bool mIsWindowRotating : 1; ///< The window rotating flag.
- bool mIsEnabledUserGeometry : 1; ///< The user geometry enable flag.
+ bool mIsWindowRotating : 1; ///< The window rotating flag.
+ bool mIsEnabledUserGeometry : 1; ///< The user geometry enable flag.
bool mIsEmittedWindowCreatedEvent : 1; ///< The Window Created Event emit flag for accessibility.
bool mIsFrontBufferRendering : 1; ///< The Front Buffer Rendering state.
};
/*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
// timestamp is given in seconds, the signal expects it in milliseconds
mThis->mTouchEventSignal.Emit(point, event.timestamp * 1000);
+
+ mThis->mMouseFrameEventSignal.Emit();
}
}
point.SetDeviceSubclass(deviceSubclass);
mTouchEventSignal.Emit(point, touchEvent->timestamp);
+
+ mMouseFrameEventSignal.Emit();
}
}
point.SetDeviceSubclass(deviceSubclass);
mTouchEventSignal.Emit(point, touchEvent->timestamp);
+
+ mMouseFrameEventSignal.Emit();
}
}
point.SetDeviceSubclass(deviceSubclass);
mTouchEventSignal.Emit(point, touchEvent->timestamp);
+
+ mMouseFrameEventSignal.Emit();
}
}
mTouchEventSignal.Emit(point, touchEvent->timestamp);
DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl::OnMouseButtonCancel\n");
+
+ mMouseFrameEventSignal.Emit();
}
}
/**
* Called when a touch motion is received.
*/
+static Eina_Bool EcoreEventMouseFrame(void* data, int type, void* event)
+{
+ WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
+ if(windowBase)
+ {
+ windowBase->OnMouseFrame(data, type, event);
+ }
+ return ECORE_CALLBACK_PASS_ON;
+}
+
+/**
+ * Called when a touch motion is received.
+ */
static Eina_Bool EcoreEventMouseButtonRelativeMove(void* data, int type, void* event)
{
WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
// Register pointer lock/unlock event
mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_WL2_EVENT_POINTER_CONSTRAINTS, EcoreEventPointerConstraints, this));
+
+ // Register mouse frame events
+ mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_EVENT_MOUSE_FRAME, EcoreEventMouseFrame, this));
#endif
// Register Mouse wheel events
point.SetMouseButton(static_cast<MouseButton::Type>(touchEvent->buttons));
mTouchEventSignal.Emit(point, touchEvent->timestamp);
+
+#ifndef OVER_TIZEN_VERSION_8
+ mMouseFrameEventSignal.Emit();
+#endif
}
}
point.SetMouseButton(static_cast<MouseButton::Type>(touchEvent->buttons));
mTouchEventSignal.Emit(point, touchEvent->timestamp);
+
+#ifndef OVER_TIZEN_VERSION_8
+ mMouseFrameEventSignal.Emit();
+#endif
}
}
point.SetDeviceSubclass(deviceSubclass);
mTouchEventSignal.Emit(point, touchEvent->timestamp);
+
+#ifndef OVER_TIZEN_VERSION_8
+ mMouseFrameEventSignal.Emit();
+#endif
}
}
#ifdef OVER_TIZEN_VERSION_8
+void WindowBaseEcoreWl2::OnMouseFrame(void* data, int type, void* event)
+{
+ Ecore_Event_Mouse_Frame* MouseFrameEvent = static_cast<Ecore_Event_Mouse_Frame*>(event);
+
+ if(MouseFrameEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)) && Dali::Adaptor::IsAvailable())
+ {
+ DALI_TRACE_SCOPE(gTraceFilter, "DALI_ON_MOUSE_FRAME");
+ mMouseFrameEventSignal.Emit();
+ }
+}
+
void WindowBaseEcoreWl2::OnMouseButtonRelativeMove(void* data, int type, void* event)
{
Ecore_Event_Mouse_Relative_Move* relativeMoveEvent = static_cast<Ecore_Event_Mouse_Relative_Move*>(event);
mTouchEventSignal.Emit(point, touchEvent->timestamp);
+#ifndef OVER_TIZEN_VERSION_8
+ mMouseFrameEventSignal.Emit();
+#endif
+
DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::OnMouseButtonCancel\n");
}
}
#define DALI_INTERNAL_WINDOWSYSTEM_TIZENWAYLAND_WINDOW_BASE_ECORE_WL2_H
/*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
void OnMouseButtonMove(void* data, int type, void* event);
/**
+ * @brief Called when a mouse frame is received.
+ */
+ void OnMouseFrame(void* data, int type, void* event);
+
+ /**
* @brief Called when a touch motion is received.
*/
void OnMouseButtonRelativeMove(void* data, int type, void* event);
/*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
}
mTouchEventSignal.Emit(point, touchEvent->timestamp);
+
+ mMouseFrameEventSignal.Emit();
}
}
}
mTouchEventSignal.Emit(point, touchEvent->timestamp);
+
+ mMouseFrameEventSignal.Emit();
}
}
point.SetAngle(Degree(static_cast<float>(touchEvent->multi.angle)));
mTouchEventSignal.Emit(point, touchEvent->timestamp);
+
+ mMouseFrameEventSignal.Emit();
}
}
/*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
point.SetAngle(Degree(touchEvent.multi.angle));
mTouchEventSignal.Emit(point, touchEvent.timestamp);
+
+ mMouseFrameEventSignal.Emit();
}
}
point.SetAngle(Degree(touchEvent.multi.angle));
mTouchEventSignal.Emit(point, touchEvent.timestamp);
+
+ mMouseFrameEventSignal.Emit();
}
}
point.SetAngle(Degree(touchEvent.multi.angle));
mTouchEventSignal.Emit(point, touchEvent.timestamp);
+
+ mMouseFrameEventSignal.Emit();
}
}
/*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
}
mTouchEventSignal.Emit(point, touchEvent->timestamp);
+
+ mMouseFrameEventSignal.Emit();
}
}
}
mTouchEventSignal.Emit(point, touchEvent->timestamp);
+
+ mMouseFrameEventSignal.Emit();
}
}
point.SetAngle(Degree(static_cast<float>(touchEvent->multi.angle)));
mTouchEventSignal.Emit(point, touchEvent->timestamp);
+
+ mMouseFrameEventSignal.Emit();
}
}
{
const unsigned int ADAPTOR_MAJOR_VERSION = 2;
const unsigned int ADAPTOR_MINOR_VERSION = 3;
-const unsigned int ADAPTOR_MICRO_VERSION = 28;
+const unsigned int ADAPTOR_MICRO_VERSION = 29;
const char* const ADAPTOR_BUILD_DATE = __DATE__ " " __TIME__;
#ifdef DEBUG_ENABLED
Name: dali2-adaptor
Summary: The DALi Tizen Adaptor
-Version: 2.3.28
+Version: 2.3.29
Release: 1
Group: System/Libraries
License: Apache-2.0 and BSD-3-Clause and MIT