namespace Extension
{
-EvasPlugin EvasPlugin::New( Evas_Object* parentEvasObject, int width, int height, bool isTranslucent )
+EvasPlugin EvasPlugin::New( Evas_Object* parentEvasObject, uint16_t width, uint16_t height, bool isTranslucent )
{
IntrusivePtr< Internal::EvasPlugin > impl = Internal::EvasPlugin::New( parentEvasObject, width, height, isTranslucent );
* namespace
* {
* const char* const APPLICATION_TITLE = "EvasPluginExample";
- * const int EVAS_PLUGIN_WIDTH = 360;
- * const int EVAS_PLUGIN_HEIGHT = 360;
+ * const uint16_t EVAS_PLUGIN_WIDTH = 360;
+ * const uint16_t EVAS_PLUGIN_HEIGHT = 360;
* }
*
* class EvasPluginExample : public ConnectionTracker
* @param[in] height The initial height of the default scene
* @param[in] isTranslucent Whether the Evas object is translucent or not
*/
- static EvasPlugin New( Evas_Object* parentEvasObject, int width, int height, bool isTranslucent );
+ static EvasPlugin New( Evas_Object* parentEvasObject, uint16_t width, uint16_t height, bool isTranslucent );
/**
* @brief Constructs an empty handle
namespace Extension
{
-Scene Scene::New( EvasPlugin evasPlugin, Evas_Object* parentEvasObject, int width, int height, bool isTranslucent )
+Scene Scene::New( EvasPlugin evasPlugin, Evas_Object* parentEvasObject, uint16_t width, uint16_t height, bool isTranslucent )
{
IntrusivePtr< Internal::Scene > impl = Internal::Scene::New( parentEvasObject, width, height, isTranslucent );
return Internal::GetImplementation( *this ).GetLayer( depth );
}
-Size Scene::GetSize() const
+Scene::SceneSize Scene::GetSize() const
{
return Internal::GetImplementation( *this ).GetSize();
}
#include <Evas.h>
#include <dali/public-api/actors/actor.h>
+#include <dali/public-api/math/uint-16-pair.h>
#include <dali/public-api/signals/dali-signal.h>
// INTERNAL INCLUDES
{
public:
+ typedef Uint16Pair SceneSize;
+
typedef Signal<void (Scene, bool)> VisibilityChangedSignalType;
typedef Signal<void (Scene, bool)> FocusChangedSignalType;
- typedef Signal<void (Scene, int width, int height)> ResizedSignalType;
+ typedef Signal<void (Scene, uint16_t, uint16_t)> ResizedSignalType;
public:
* @param[in] height The initial height of the scene
* @param[in] isTranslucent Whether the Evas object is translucent or not
*/
- static Scene New( EvasPlugin evasPlugin, Evas_Object* parentEvasObject, int width, int height, bool isTranslucent );
+ static Scene New( EvasPlugin evasPlugin, Evas_Object* parentEvasObject, uint16_t width, uint16_t height, bool isTranslucent );
/**
* @brief Constructs an empty handle
*
* @return The size of the Scene as a Vector
*/
- Size GetSize() const;
+ SceneSize GetSize() const;
/**
* @brief This returns the Evas_Object* for accessibility which is created internally
namespace Internal
{
-IntrusivePtr< EvasPlugin > EvasPlugin::New( Evas_Object* parentEvasObject, int width, int height, bool isTranslucent )
+IntrusivePtr< EvasPlugin > EvasPlugin::New( Evas_Object* parentEvasObject, uint16_t width, uint16_t height, bool isTranslucent )
{
IntrusivePtr< EvasPlugin > evasPlugin = new EvasPlugin( parentEvasObject, width, height, isTranslucent );
return evasPlugin;
}
-EvasPlugin::EvasPlugin( Evas_Object* parentEvasObject, int width, int height, bool isTranslucent )
+EvasPlugin::EvasPlugin( Evas_Object* parentEvasObject, uint16_t width, uint16_t height, bool isTranslucent )
: mSingletonService( SingletonService::New() ),
mState( READY )
{
return mDefaultScene.GetDaliEvasObject();
}
-void EvasPlugin::OnDefaultSceneResized( Extension::Scene defaultScene, int width, int height )
+void EvasPlugin::OnDefaultSceneResized( Extension::Scene defaultScene, uint16_t width, uint16_t height )
{
mResizeSignal.Emit();
}
* @param[in] height The height of Dali view port
* @param[in] isTranslucent Whether the evas object is translucent or not
*/
- static IntrusivePtr<EvasPlugin> New( Evas_Object* parentEvasObject, int width, int height, bool isTranslucent );
+ static IntrusivePtr<EvasPlugin> New( Evas_Object* parentEvasObject, uint16_t width, uint16_t height, bool isTranslucent );
public:
* @param[in] height The height of Dali view port
* @param[in] isTranslucent Whether the evas object is translucent or not
*/
- EvasPlugin( Evas_Object* parentEvasObject, int width, int height, bool isTranslucent );
+ EvasPlugin( Evas_Object* parentEvasObject, uint16_t width, uint16_t height, bool isTranslucent );
/**
* Destructor
/**
* This callback is for supporting legacy API EvasPlugin::ResizeSignal
*/
- void OnDefaultSceneResized( Extension::Scene defaultScene, int width, int height );
+ void OnDefaultSceneResized( Extension::Scene defaultScene, uint16_t width, uint16_t height );
/**
* This callback is for supporting legacy API EvasPlugin::FocusedSignal, EvasPlugin::UnFocusedSignal
} // unnamed namespace
-EvasWrapper::EvasWrapper( Evas_Object* pluginParent, int width, int height, bool transparent )
+EvasWrapper::EvasWrapper( Evas_Object* pluginParent, uint16_t width, uint16_t height, bool transparent )
: mEcoreEvas( nullptr ),
mImageEvasObject( nullptr ),
mAccessibilityEvasObject( nullptr ),
mFocusEvasObject( nullptr )
{
+ int intWidth = static_cast<int>( width );
+ int intHeight = static_cast<int>( height );
+
Evas* evas = evas_object_evas_get( pluginParent );
mEcoreEvas = ecore_evas_ecore_evas_get( evas );
// Create the image evas object
mImageEvasObject = evas_object_image_filled_add( evas );
evas_object_name_set( mImageEvasObject, IMAGE_EVAS_OBJECT_NAME );
- evas_object_image_content_hint_set( mImageEvasObject, EVAS_IMAGE_CONTENT_HINT_DYNAMIC );
evas_object_image_alpha_set( mImageEvasObject, transparent ? EINA_TRUE : EINA_FALSE );
- evas_object_image_size_set( mImageEvasObject, width, height );
+ evas_object_image_size_set( mImageEvasObject, intWidth, intHeight );
evas_object_size_hint_weight_set( mImageEvasObject, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND );
evas_object_size_hint_align_set( mImageEvasObject, EVAS_HINT_FILL, EVAS_HINT_FILL );
evas_object_size_hint_align_set( mFocusEvasObject, EVAS_HINT_FILL, EVAS_HINT_FILL );
evas_object_move( mFocusEvasObject, 0, 0 );
- evas_object_resize( mFocusEvasObject, width, height );
+ evas_object_resize( mFocusEvasObject, intWidth, intHeight );
evas_object_show( mFocusEvasObject );
}
* @param[in] height The initial height of the Dali view port
* @param[in] transparent Whether the Evas object is transparent or not
*/
- EvasWrapper( Evas_Object* pluginParent, int width, int height, bool transparent );
+ EvasWrapper( Evas_Object* pluginParent, uint16_t width, uint16_t height, bool transparent );
/**
* @brief Destructor
namespace Internal
{
-IntrusivePtr< Scene > Scene::New( Evas_Object* parentEvasObject, int width, int height, bool isTranslucent )
+IntrusivePtr< Scene > Scene::New( Evas_Object* parentEvasObject, uint16_t width, uint16_t height, bool isTranslucent )
{
IntrusivePtr< Scene > scene = new Scene( parentEvasObject, width, height, isTranslucent );
return scene;
}
-Scene::Scene( Evas_Object* parentEvasObject, int width, int height, bool isTranslucent )
+Scene::Scene( Evas_Object* parentEvasObject, uint16_t width, uint16_t height, bool isTranslucent )
: mAdaptor( nullptr ),
mEvasWrapper( new EvasWrapper( parentEvasObject, width, height, isTranslucent ) ),
mEvasEventHandler(),
DALI_ASSERT_ALWAYS( parentEvasObject && "No parent object for the scene" );
// Create surface
- mSurface = std::unique_ptr< RenderSurfaceInterface >( CreateNativeSurface( PositionSize( 0, 0, width, height ), isTranslucent ) );
+ mSurface = std::unique_ptr< RenderSurfaceInterface >( CreateNativeSurface( PositionSize( 0, 0, static_cast<int>( width ), static_cast<int>( height ) ), isTranslucent ) );
}
void Scene::Initialize( EvasPlugin* evasPlugin, bool isDefaultScene )
return mScene.GetLayer( depth );
}
-Size Scene::GetSize() const
+Scene::SceneSize Scene::GetSize() const
{
- return mScene.GetSize();
+ Size size = mScene.GetSize();
+
+ return Scene::SceneSize( static_cast<uint16_t>( size.width ), static_cast<uint16_t>( size.height ) );
}
Dali::Any Scene::GetNativeHandle() const
return mEvasWrapper->GetFocusTarget();
}
-void Scene::ResizeSurface( int width, int height )
+void Scene::ResizeSurface( uint16_t width, uint16_t height )
{
if( !mSurface || !mAdaptor || width <= 1 || height <= 1 )
{
return;
}
+ int intWidth = static_cast<int>( width );
+ int intHeight = static_cast<int>( height );
+
PositionSize currentSize = mSurface->GetPositionSize();
- if( currentSize.width == width && currentSize.height == height )
+ if( currentSize.width == intWidth && currentSize.height == intHeight )
{
return;
}
- mSurface->MoveResize( PositionSize( 0, 0, width, height ) );
+ mSurface->MoveResize( PositionSize( 0, 0, intWidth, intHeight ) );
SurfaceResized( true );
void Scene::OnEvasObjectResize( const Rect<int>& geometry )
{
- ResizeSurface( geometry.width, geometry.height );
+ ResizeSurface( static_cast<uint16_t>( geometry.width ), static_cast<uint16_t>( geometry.height ) );
}
void Scene::OnEvasObjectVisiblityChanged( bool visible )
public Extension::Internal::EvasEventInterface
{
public:
+ typedef Dali::Extension::Scene::SceneSize SceneSize;
typedef Dali::Extension::Scene::VisibilityChangedSignalType VisibilityChangedSignalType;
* @param[in] height The initial height of the scene
* @param[in] isTranslucent Whether the Evas object is translucent or not
*/
- static IntrusivePtr<Scene> New( Evas_Object* parentEvasObject, int width, int height, bool isTranslucent );
+ static IntrusivePtr<Scene> New( Evas_Object* parentEvasObject, uint16_t width, uint16_t height, bool isTranslucent );
public:
/**
* @copydoc Dali::Extension::Scene::GetSize
*/
- Size GetSize() const;
+ SceneSize GetSize() const;
/**
* @brief Gets the native handle.
* @param[in] width The width value
* @param[in] height The height value
*/
- void ResizeSurface( int width, int height );
+ void ResizeSurface( uint16_t width, uint16_t height );
/**
* This function is called after drawing by dali.
* @param[in] height The initial height of the scene
* @param[in] isTranslucent Whether the Evas object is translucent or not
*/
- Scene( Evas_Object* parentEvasObject, int width, int height, bool isTranslucent );
+ Scene( Evas_Object* parentEvasObject, uint16_t width, uint16_t height, bool isTranslucent );
/**
* Destructor