actor.SetSize( 200.f, 200.f );
DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION );
- DALI_TEST_EQUALS( DevelControl::IsResourceReady( actor ), false, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.IsResourceReady(), false, TEST_LOCATION );
Stage::GetCurrent().Add( actor );
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION );
- DALI_TEST_EQUALS( DevelControl::IsResourceReady( actor ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.IsResourceReady(), true, TEST_LOCATION );
Visual::Base largeVisual = factory.CreateVisual( propertyMapLarge );
largeVisual.SetName("largeVisual");
application.Render();
DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION );
- DALI_TEST_EQUALS( DevelControl::IsResourceReady( actor ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.IsResourceReady(), true, TEST_LOCATION );
END_TEST;
}
imageView.SetBackgroundImage( image );
- DALI_TEST_EQUALS( Toolkit::DevelControl::IsResourceReady( imageView ), false, TEST_LOCATION );
+ DALI_TEST_EQUALS( imageView.IsResourceReady(), false, TEST_LOCATION );
- Toolkit::DevelControl::ResourceReadySignal( imageView ).Connect( &ResourceReadySignal);
+ imageView.ResourceReadySignal().Connect( &ResourceReadySignal);
Stage::GetCurrent().Add( imageView );
application.Render(16);
- DALI_TEST_EQUALS( Toolkit::DevelControl::IsResourceReady( imageView ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS( imageView.IsResourceReady(), true, TEST_LOCATION );
DALI_TEST_EQUALS( gResourceReadySignalFired, true, TEST_LOCATION );
// Check ImageView with background and main image, to ensure both visuals are marked as loaded
ImageView imageView = ImageView::New( TEST_IMAGE_1 );
- DALI_TEST_EQUALS( Toolkit::DevelControl::IsResourceReady( imageView ), false, TEST_LOCATION );
+ DALI_TEST_EQUALS( imageView.IsResourceReady(), false, TEST_LOCATION );
- Toolkit::DevelControl::ResourceReadySignal( imageView ).Connect( &ResourceReadySignal);
+ imageView.ResourceReadySignal().Connect( &ResourceReadySignal);
Stage::GetCurrent().Add( imageView );
DALI_TEST_EQUALS( imageView.GetRendererCount(), 1u, TEST_LOCATION );
- DALI_TEST_EQUALS( Toolkit::DevelControl::IsResourceReady( imageView ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS( imageView.IsResourceReady(), true, TEST_LOCATION );
DALI_TEST_EQUALS( gResourceReadySignalFired, true, TEST_LOCATION );
actor.SetSize( 200.f, 200.f );
DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION );
- DALI_TEST_EQUALS( DevelControl::IsResourceReady( actor ), false, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.IsResourceReady(), false, TEST_LOCATION );
Stage::GetCurrent().Add( actor );
application.SendNotification();
DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION );
DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
- DALI_TEST_EQUALS( DevelControl::IsResourceReady( actor ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.IsResourceReady(), true, TEST_LOCATION );
END_TEST;
}
DummyControl actor = DummyControl::New();
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual );
- DALI_TEST_EQUALS( DevelControl::IsResourceReady( actor ), false, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.IsResourceReady(), false, TEST_LOCATION );
actor.SetSize( 200.f, 200.f );
DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION );
DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
- DALI_TEST_EQUALS( DevelControl::IsResourceReady( actor ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.IsResourceReady(), true, TEST_LOCATION );
END_TEST;
}
actor.SetSize( 200.f, 200.f );
DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION );
- DALI_TEST_EQUALS( DevelControl::IsResourceReady( actor ), false, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.IsResourceReady(), false, TEST_LOCATION );
Stage::GetCurrent().Add( actor );
application.SendNotification();
DALI_TEST_EQUALS( size, Vector2( 100.0f, 100.0f ), 0.001f, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION );
DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
- DALI_TEST_EQUALS( DevelControl::IsResourceReady( actor ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.IsResourceReady(), true, TEST_LOCATION );
END_TEST;
}
namespace DevelControl
{
-ResourceReadySignalType& ResourceReadySignal( Control& control )
-{
- Internal::Control& internalControl = Toolkit::Internal::GetImplementation(control);
- Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get( internalControl );
-
- return controlImpl.mResourceReadySignal;
-}
-
-bool IsResourceReady( const Control& control )
-{
- const Internal::Control& internalControl = Toolkit::Internal::GetImplementation(control);
- const Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( internalControl );
-
- return controlDataImpl.IsResourceReady();
-}
-
void RegisterVisual( Internal::Control& control, Dali::Property::Index index, Toolkit::Visual::Base& visual )
{
Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( control );
} // namespace Property
-/// @brief ResourceReady signal type;
-typedef Signal<void ( Control ) > ResourceReadySignalType;
-
-/**
- * @brief This signal is emitted after all resources required
- * by a control are loaded and ready.
- * Most resources are only loaded when the control is placed on stage.
- *
- * @note A RelayoutRequest is queued by Control before this signal is emitted
- *
- * A callback of the following type may be connected:
- * @code
- * void YourCallbackName( Control control );
- * @endcode
- */
-DALI_IMPORT_API ResourceReadySignalType& ResourceReadySignal( Control& control );
-
-/**
- * @brief Query if all resources required by a control are loaded and ready.
- * Most resources are only loaded when the control is placed on stage.
- * @return true if the resources are loaded and ready, false otherwise
- *
- */
-DALI_IMPORT_API bool IsResourceReady( const Control& control );
-
/**
* @brief Register a visual by Property Index.
*
Toolkit::Control::KeyEventSignalType mKeyEventSignal;
Toolkit::Control::KeyInputFocusSignalType mKeyInputFocusGainedSignal;
Toolkit::Control::KeyInputFocusSignalType mKeyInputFocusLostSignal;
-
- Toolkit::DevelControl::ResourceReadySignalType mResourceReadySignal;
+ Toolkit::Control::ResourceReadySignalType mResourceReadySignal;
// Gesture Detection
PinchGestureDetector mPinchGestureDetector;
{
// ImageView can relayout in the OnImageReady, alternative to a signal would be to have a upcall from the Control to ImageView
Dali::Toolkit::Control handle( GetOwner() );
- Toolkit::DevelControl::ResourceReadySignal( handle ).Connect( this, &ImageView::OnResourceReady );
+ handle.ResourceReadySignal().Connect( this, &ImageView::OnResourceReady );
}
void ImageView::SetImage( Image image )
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control-impl.h>
+#include <dali-toolkit/internal/controls/control/control-data-impl.h>
namespace Dali
{
Internal::GetImplementation(*this).ClearBackground();
}
+bool Control::IsResourceReady() const
+{
+ const Internal::Control& internalControl = Toolkit::Internal::GetImplementation( *this );
+ const Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( internalControl );
+
+ return controlDataImpl.IsResourceReady();
+}
+
Control::KeyEventSignalType& Control::KeyEventSignal()
{
return Internal::GetImplementation(*this).KeyEventSignal();
return Internal::GetImplementation(*this).KeyInputFocusLostSignal();
}
+Control::ResourceReadySignalType& Control::ResourceReadySignal()
+{
+ Internal::Control& internalControl = Toolkit::Internal::GetImplementation( *this );
+ Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get( internalControl );
+
+ return controlImpl.mResourceReadySignal;
+}
+
Control::Control(Internal::Control& implementation)
: CustomActor(implementation)
{
#define __DALI_TOOLKIT_CONTROL_H__
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
* | keyEvent | @ref KeyEventSignal() |
* | keyInputFocusGained | @ref KeyInputFocusGainedSignal() |
* | keyInputFocusLost | @ref KeyInputFocusLostSignal() |
+ * | resourceReady | @ref ResourceReadySignal() |
* | tapped | @ref GetTapGestureDetector().DetectedSignal() |
* | panned | @ref GetPanGestureDetector().DetectedSignal() |
* | pinched | @ref GetPinchGestureDetector().DetectedSignal() |
// Typedefs
- /// @brief Key Event signal type;
+ /// @brief Key Event signal type. @SINCE_1_0.0
typedef Signal<bool ( Control, const KeyEvent& ) > KeyEventSignalType;
- /// @brief Key InputFocusType signal type;
+ /// @brief Key InputFocusType signal type. @SINCE_1_0.0
typedef Signal<void ( Control ) > KeyInputFocusSignalType;
+ /// @brief ResourceReady signal type. @SINCE_1_2.60
+ typedef Signal<void ( Control ) > ResourceReadySignalType;
+
public: // Creation & Destruction
/**
*/
void ClearBackground();
+ // Resources
+
+ /**
+ * @brief Query if all resources required by a control are loaded and ready.
+ *
+ * Most resources are only loaded when the control is placed on stage.
+ * @SINCE_1_2.60
+ * @return true if the resources are loaded and ready, false otherwise
+ */
+ bool IsResourceReady() const;
+
// Signals
/**
KeyInputFocusSignalType& KeyInputFocusGainedSignal();
/**
- * @brief This signal is emitted when the control loses Key Input Focus
- * which could be due to it being gained by another Control or Actor or just cleared from
+ * @brief This signal is emitted when the control loses Key Input Focus.
+ *
+ * This could be due to it being gained by another Control or Actor or just cleared from
* this control as no longer required.
*
* A callback of the following type may be connected:
*/
KeyInputFocusSignalType& KeyInputFocusLostSignal();
+ /**
+ * @brief This signal is emitted after all resources required by a control are loaded and ready.
+ *
+ * Most resources are only loaded when the control is placed on stage.
+ *
+ * A callback of the following type may be connected:
+ * @code
+ * void YourCallbackName( Control control );
+ * @endcode
+ *
+ * @SINCE_1_2.60
+ * @note A RelayoutRequest is queued by Control before this signal is emitted
+ */
+ ResourceReadySignalType& ResourceReadySignal();
+
public: // Intended for control developers
/**