return GetImplementation( window ).KeyEventSignal();
}
-KeyEventGeneratedSignalType& KeyEventGeneratedSignal( Window window )
-{
- return GetImplementation( window ).KeyEventGeneratedSignal();
-}
-
TouchSignalType& TouchSignal( Window window )
{
return GetImplementation( window ).TouchSignal();
typedef Signal< void (const KeyEvent&) > KeyEventSignalType; ///< Key event signal type
-typedef Signal< bool (const KeyEvent&) > KeyEventGeneratedSignalType; ///< Key event generated signal type
-
typedef Signal< void (const TouchData&) > TouchSignalType; ///< Touch signal type
typedef Signal< void (const WheelEvent&) > WheelEventSignalType; ///< Touched signal type
*/
DALI_ADAPTOR_API KeyEventSignalType& KeyEventSignal( Window window );
-/**
- * @brief This signal is emitted when key event is received.
- *
- * A callback of the following type may be connected:
- * @code
- * bool YourCallbackName(const KeyEvent& event);
- * @endcode
- * @param[in] window The window instance
- * @return The signal to connect to
- */
-DALI_ADAPTOR_API KeyEventGeneratedSignalType& KeyEventGeneratedSignal( Window window );
-
/**
* @brief This signal is emitted when the screen is touched and when the touch ends
* (i.e. the down & up touch events only).
class SceneHolder;
}
+using SceneHolderList = std::vector<Dali::Integration::SceneHolder>;
+
namespace Internal
{
public:
typedef Signal< void (Adaptor&) > AdaptorSignalType; ///< Generic Type for adaptor signals
- typedef Signal< void (Window&) > WindowCreatedSignalType; ///< Window created signal type
+ typedef Signal< void (Dali::Integration::SceneHolder&) > WindowCreatedSignalType; ///< SceneHolder created signal type
using SurfaceSize = Uint16Pair; ///< Surface size type
*/
Dali::WindowContainer GetWindows() const;
+ /**
+ * @brief Get the list of scene holders.
+ * @return The list of scene holers
+ */
+ SceneHolderList GetSceneHolders() const;
+
/**
* @brief Called when the window becomes fully or partially visible.
*/
AdaptorSignalType& LanguageChangedSignal();
/**
- * @brief This signal is emitted when a new window is created
+ * @brief This signal is emitted when a new window (scene holder) is created
*
* @return The signal to connect to
*/
*/
static Dali::Integration::SceneHolder Get( Dali::Actor actor );
+ /**
+ * @copydoc Dali::Integration::SceneHolder::KeyEventSignal()
+ */
+ Dali::Integration::SceneHolder::KeyEventSignalType& KeyEventSignal() { return mScene.KeyEventSignal(); }
+
+ /**
+ * @copydoc Dali::Integration::SceneHolder::KeyEventGeneratedSignal()
+ */
+ Dali::Integration::SceneHolder::KeyEventGeneratedSignalType& KeyEventGeneratedSignal() { return mScene.KeyEventGeneratedSignal(); }
+
+ /**
+ * @copydoc Dali::Integration::SceneHolder::TouchSignal()
+ */
+ Dali::Integration::SceneHolder::TouchSignalType& TouchSignal() { return mScene.TouchSignal(); }
+
+ /**
+ * @copydoc Dali::Integration::SceneHolder::WheelEventSignal()
+ */
+ Dali::Integration::SceneHolder::WheelEventSignalType& WheelEventSignal() { return mScene.WheelEventSignal(); }
+
public: // The following methods can be overridden if required
/**
return Internal::Adaptor::SceneHolder::Get( actor );
}
+SceneHolder::KeyEventSignalType& SceneHolder::KeyEventSignal()
+{
+ return GetImplementation(*this).KeyEventSignal();
+}
+
+SceneHolder::KeyEventGeneratedSignalType& SceneHolder::KeyEventGeneratedSignal()
+{
+ return GetImplementation(*this).KeyEventGeneratedSignal();
+}
+
+SceneHolder::TouchSignalType& SceneHolder::TouchSignal()
+{
+ return GetImplementation(*this).TouchSignal();
+}
+
+SceneHolder::WheelEventSignalType& SceneHolder::WheelEventSignal()
+{
+ return GetImplementation(*this).WheelEventSignal();
+}
+
}// Integration
} // Dali
#include <dali/public-api/dali-adaptor-common.h>
#include <dali/public-api/object/base-handle.h>
#include <dali/public-api/math/vector4.h>
+#include <dali/public-api/signals/dali-signal.h>
namespace Dali
{
class Actor;
class Layer;
class Any;
+class TouchData;
struct TouchPoint;
struct WheelEvent;
struct KeyEvent;
{
public:
+ typedef Signal< void (const Dali::KeyEvent&) > KeyEventSignalType; ///< Key event signal type
+
+ typedef Signal< bool (const Dali::KeyEvent&) > KeyEventGeneratedSignalType; ///< Key event generated signal type
+
+ typedef Signal< void (const Dali::TouchData&) > TouchSignalType; ///< Touch signal type
+
+ typedef Signal< void (const Dali::WheelEvent&) > WheelEventSignalType; ///< Touched signal type
+
/**
* @brief Create an uninitialized SceneHolder handle.
*/
*/
static SceneHolder Get( Actor actor );
+ /**
+ * @brief This signal is emitted when key event is received.
+ *
+ * A callback of the following type may be connected:
+ * @code
+ * void YourCallbackName(const KeyEvent& event);
+ * @endcode
+ * @return The signal to connect to
+ */
+ KeyEventSignalType& KeyEventSignal();
+
+ /**
+ * @brief This signal is emitted when key event is received.
+ *
+ * A callback of the following type may be connected:
+ * @code
+ * bool YourCallbackName(const KeyEvent& event);
+ * @endcode
+ * @return The signal to connect to
+ */
+ KeyEventGeneratedSignalType& KeyEventGeneratedSignal();
+
+ /**
+ * @brief This signal is emitted when the screen is touched and when the touch ends
+ * (i.e. the down & up touch events only).
+ *
+ * If there are multiple touch points, then this will be emitted when the first touch occurs and
+ * then when the last finger is lifted.
+ * An interrupted event will also be emitted (if it occurs).
+ * A callback of the following type may be connected:
+ * @code
+ * void YourCallbackName( TouchData event );
+ * @endcode
+ * @return The touch signal to connect to
+ * @note Motion events are not emitted.
+ */
+ TouchSignalType& TouchSignal();
+
+ /**
+ * @brief This signal is emitted when wheel event is received.
+ *
+ * A callback of the following type may be connected:
+ * @code
+ * void YourCallbackName(const WheelEvent& event);
+ * @endcode
+ * @return The signal to connect to
+ */
+ WheelEventSignalType& WheelEventSignal();
+
public: // Not intended for application developers
/**
defaultWindow->SetAdaptor( Get() );
- Dali::Window window( dynamic_cast<Dali::Internal::Adaptor::Window*>( defaultWindow ) );
- if ( window )
- {
- mWindowCreatedSignal.Emit( window );
- }
+ Dali::Integration::SceneHolder defaultSceneHolder( defaultWindow );
+
+ mWindowCreatedSignal.Emit( defaultSceneHolder );
const unsigned int timeInterval = mEnvironmentOptions->GetObjectProfilerInterval();
if( 0u < timeInterval )
// Add the new Window to the container - the order is not important
mWindows.push_back( &windowImpl );
- Dali::Window window( dynamic_cast<Dali::Internal::Adaptor::Window*>( &windowImpl ) );
- if ( window )
- {
- mWindowCreatedSignal.Emit( window );
- }
+ mWindowCreatedSignal.Emit( childWindow );
return true;
}
return windows;
}
+Dali::SceneHolderList Adaptor::GetSceneHolders() const
+{
+ Dali::SceneHolderList sceneHolderList;
+
+ for( auto iter = mWindows.begin(); iter != mWindows.end(); ++iter )
+ {
+ sceneHolderList.push_back( Dali::Integration::SceneHolder( *iter ) );
+ }
+
+ return sceneHolderList;
+}
+
Adaptor::Adaptor(Dali::Integration::SceneHolder window, Dali::Adaptor& adaptor, Dali::RenderSurfaceInterface* surface, EnvironmentOptions* environmentOptions)
: mResizedSignal(),
mLanguageChangedSignal(),
*/
Dali::WindowContainer GetWindows() const;
+ /**
+ * @copydoc Dali::Adaptor::GetSceneHolders()
+ */
+ Dali::SceneHolderList GetSceneHolders() const;
+
public:
/**
AdaptorSignalType mResizedSignal; ///< Resized signal.
AdaptorSignalType mLanguageChangedSignal; ///< Language changed signal.
- WindowCreatedSignalType mWindowCreatedSignal; ///< Window created signal.
+ WindowCreatedSignalType mWindowCreatedSignal; ///< Window created signal.
Dali::Adaptor& mAdaptor; ///< Reference to public adaptor instance.
State mState; ///< Current state of the adaptor
return mImpl->GetWindows();
}
+SceneHolderList Adaptor::GetSceneHolders() const
+{
+ return mImpl->GetSceneHolders();
+}
+
void Adaptor::OnWindowShown()
{
mImpl->OnWindowShown();
*/
Dali::DevelWindow::EventProcessingFinishedSignalType& EventProcessingFinishedSignal() { return mScene.EventProcessingFinishedSignal(); }
- /**
- * @copydoc Dali::Window::KeyEventSignal()
- */
- Dali::DevelWindow::KeyEventSignalType& KeyEventSignal() { return mScene.KeyEventSignal(); }
-
- /**
- * @copydoc Dali::Window::KeyEventGeneratedSignal()
- */
- Dali::DevelWindow::KeyEventGeneratedSignalType& KeyEventGeneratedSignal() { return mScene.KeyEventGeneratedSignal(); }
-
- /**
- * @copydoc Dali::Window::TouchSignal()
- */
- Dali::DevelWindow::TouchSignalType& TouchSignal() { return mScene.TouchSignal(); }
-
- /**
- * @copydoc Dali::Window::WheelEventSignal()
- */
- Dali::DevelWindow::WheelEventSignalType& WheelEventSignal() { return mScene.WheelEventSignal(); }
-
private:
WindowRenderSurface* mWindowSurface; ///< The window rendering surface