#define DALI_INTEGRATION_INTERNAL_SCENEHOLDER_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
return mScene.WheelEventSignal();
}
+ /**
+ * @copydoc Dali::Integration::SceneHolder::WheelEventGeneratedSignal()
+ */
+ Dali::Integration::SceneHolder::WheelEventGeneratedSignalType& WheelEventGeneratedSignal()
+ {
+ return mScene.WheelEventGeneratedSignal();
+ }
+
public: // The following methods can be overridden if required
/**
* @brief Returns whether the Scene is visible or not.
#define DALI_INTEGRATION_SCENEHOLDER_H
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
typedef Signal<void(const Dali::WheelEvent&)> WheelEventSignalType; ///< Touched signal type
+ typedef Signal<bool(const Dali::WheelEvent&)> WheelEventGeneratedSignalType; ///< Wheel event generated signal type
+
/**
* @brief Create an uninitialized SceneHolder handle.
*/
*/
WheelEventSignalType& WheelEventSignal();
+ /**
+ * @brief This signal is emitted to KeyboardFocusManager when a custom wheel type event is received.
+ * When a custom wheel event occurs, it need to process the focused actor first.
+ *
+ * Therefore, KeyboardFocusManager first checks whether WheelEvent is generated as WheelEventGeneratedSignal.
+ * This is only valid for custom wheel events.
+ *
+ * A callback of the following type may be connected:
+ * @code
+ * bool YourCallbackName(const WheelEvent& event);
+ * @endcode
+ * @return The signal to connect to
+ */
+ WheelEventGeneratedSignalType& WheelEventGeneratedSignal();
+
public: // Not intended for application developers
/**
* @brief This constructor is used internally to create additional SceneHolder handles.
/////////////////////////////////////////////////////////////////////////////////////////////////
// Window Auxiliary Message Callbacks
/////////////////////////////////////////////////////////////////////////////////////////////////
-static Eina_Bool EcoreEventWindowAuxiliaryMessage(void *data, int type, void *event)
+static Eina_Bool EcoreEventWindowAuxiliaryMessage(void* data, int type, void* event)
{
- WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
+ WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
if(windowBase)
{
windowBase->OnEcoreEventWindowAuxiliaryMessage(event);
DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Concise, "WindowBaseEcoreWl2::OnDetentRotation\n");
- int direction = (detentEvent->direction == ECORE_DETENT_DIRECTION_CLOCKWISE) ? 1 : -1;
- int timeStamp = detentEvent->timestamp;
+ int32_t clockwise = (detentEvent->direction == ECORE_DETENT_DIRECTION_CLOCKWISE) ? 1 : -1;
- Integration::WheelEvent wheelEvent(Integration::WheelEvent::CUSTOM_WHEEL, direction, 0, Vector2(0.0f, 0.0f), 0, timeStamp);
+ Integration::WheelEvent wheelEvent(Integration::WheelEvent::CUSTOM_WHEEL, detentEvent->direction, 0, Vector2(0.0f, 0.0f), clockwise, detentEvent->timestamp);
mWheelEventSignal.Emit(wheelEvent);
}
void WindowBaseEcoreWl2::OnEcoreEventWindowAuxiliaryMessage(void* event)
{
- Ecore_Wl2_Event_Aux_Message *message = static_cast<Ecore_Wl2_Event_Aux_Message*>(event);
- if(message)
- {
- DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::OnEcoreEventWindowAuxiliaryMessage, key:%s, value:%s \n",message->key, message->val);
- std::string key(message->key);
- std::string value(message->val);
- Dali::Property::Array options;
-
- if(message->options)
- {
- Eina_List *l;
- void* data;
- EINA_LIST_FOREACH(message->options, l, data)
- {
- DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::OnEcoreEventWindowAuxiliaryMessage, option: %s\n",(char*)data);
- std::string option(static_cast<char*>(data));
- options.Add(option);
- }
- }
-
- mAuxiliaryMessageSignal.Emit(key, value, options);
- }
-}
+ Ecore_Wl2_Event_Aux_Message* message = static_cast<Ecore_Wl2_Event_Aux_Message*>(event);
+ if(message)
+ {
+ DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::OnEcoreEventWindowAuxiliaryMessage, key:%s, value:%s \n", message->key, message->val);
+ std::string key(message->key);
+ std::string value(message->val);
+ Dali::Property::Array options;
+
+ if(message->options)
+ {
+ Eina_List* l;
+ void* data;
+ EINA_LIST_FOREACH(message->options, l, data)
+ {
+ DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::OnEcoreEventWindowAuxiliaryMessage, option: %s\n", (char*)data);
+ std::string option(static_cast<char*>(data));
+ options.Add(option);
+ }
+ }
+ mAuxiliaryMessageSignal.Emit(key, value, options);
+ }
+}
void WindowBaseEcoreWl2::KeymapChanged(void* data, int type, void* event)
{