// INTERNAL INCLUDES
#include <dali/public-api/adaptor-framework/common/adaptor.h>
+#include <dali/public-api/object/any.h>
#include <internal/common/adaptor-impl.h>
#include <internal/common/ecore-x/ecore-x-window-interface.h>
Dali::RenderSurface& surface( adaptorImpl.GetSurface() );
if( surface.GetType() == Dali::RenderSurface::WINDOW )
{
- ecoreXwin = boost::any_cast< Ecore_X_Window >( adaptorImpl.GetSurface().GetSurface() );
+ ecoreXwin = AnyCast< Ecore_X_Window >( adaptorImpl.GetSurface().GetSurface() );
}
// If we fail to get Ecore_X_Window, we can't use the Clipboard correctly.
DALI_EXPORT_API RenderSurface* CreatePixmapSurface(
PositionSize positionSize,
- boost::any surface,
- boost::any display,
+ Any surface,
+ Any display,
const std::string& name,
bool isTransparent )
{
native_buffer_pool* pool,
unsigned int maxBufferCount,
PositionSize positionSize,
- boost::any surface,
- boost::any display,
+ Any surface,
+ Any display,
const std::string& name,
bool isTransparent )
{
*/
DALI_IMPORT_API RenderSurface* CreatePixmapSurface(
PositionSize positionSize,
- boost::any surface,
- boost::any display,
+ Any surface,
+ Any display,
const std::string& name,
bool isTransparent );
native_buffer_pool* pool,
unsigned int maxBufferCount,
PositionSize positionSize,
- boost::any surface,
- boost::any display,
+ Any surface,
+ Any display,
const std::string& name,
bool isTransparent );
RenderSurface::RenderSurface( SurfaceType type,
Dali::PositionSize positionSize,
- boost::any surface,
- boost::any display,
+ Any surface,
+ Any display,
const std::string& name,
bool isTransparent)
: mMainDisplay(NULL),
mOwnDisplay(false),
mIsStopped( false )
{
- // see if there is a display in boost::any display
+ // see if there is a display in Any display
SetDisplay( display );
}
-void RenderSurface::Init( boost::any surface )
+void RenderSurface::Init( Any surface )
{
- // see if there is a surface in boost::any surface
+ // see if there is a surface in Any surface
unsigned int surfaceId = GetSurfaceId( surface );
// if the surface is empty, create a new one.
return 0;
}
-boost::any RenderSurface::GetDisplay()
+Any RenderSurface::GetDisplay()
{
// this getter is used by main thread so we need to return the main thread version of the display
- return boost::any( ecore_x_display_get() );
+ return Any( ecore_x_display_get() );
}
PositionSize RenderSurface::GetPositionSize() const
mIsStopped = true;
}
-void RenderSurface::SetDisplay( boost::any display )
+void RenderSurface::SetDisplay( Any display )
{
// the render surface can be passed either EFL e-core types, or x11 types
// we use boost any to determine at run time which type
- if ( display.empty() == false )
+ if ( display.Empty() == false )
{
// check we have a valid type
- DALI_ASSERT_ALWAYS( ( ( display.type() == typeid (Ecore_X_Display *)) ||
- ( display.type() == typeid (XDisplay *) ) )
+ DALI_ASSERT_ALWAYS( ( ( display.GetType() == typeid (Ecore_X_Display *)) ||
+ ( display.GetType() == typeid (XDisplay *) ) )
&&
"Display type is invalid" );
mOwnDisplay = false;
// display may point to EcoreXDisplay so may need to cast
- if( display.type() == typeid (Ecore_X_Display*) )
+ if( display.GetType() == typeid (Ecore_X_Display*) )
{
- mMainDisplay = static_cast< XDisplay* >( boost::any_cast< Ecore_X_Display* >( display ) );
+ mMainDisplay = static_cast< XDisplay* >( AnyCast< Ecore_X_Display* >( display ) );
}
else
{
- mMainDisplay = boost::any_cast< XDisplay* >( display );
+ mMainDisplay = AnyCast< XDisplay* >( display );
}
}
else
}
}
-unsigned int RenderSurface::GetSurfaceId( boost::any surface ) const
+unsigned int RenderSurface::GetSurfaceId( Any surface ) const
{
unsigned int surfaceId = 0;
- if ( surface.empty() == false )
+ if ( surface.Empty() == false )
{
// check we have a valid type
- DALI_ASSERT_ALWAYS( ( (surface.type() == typeid (XWindow) ) ||
- (surface.type() == typeid (Ecore_X_Window) ) )
+ DALI_ASSERT_ALWAYS( ( (surface.GetType() == typeid (XWindow) ) ||
+ (surface.GetType() == typeid (Ecore_X_Window) ) )
&& "Surface type is invalid" );
- if ( surface.type() == typeid (Ecore_X_Window) )
+ if ( surface.GetType() == typeid (Ecore_X_Window) )
{
- surfaceId = boost::any_cast<Ecore_X_Window>( surface );
+ surfaceId = AnyCast<Ecore_X_Window>( surface );
}
else
{
- surfaceId = boost::any_cast<XWindow>( surface );
+ surfaceId = AnyCast<XWindow>( surface );
}
}
return surfaceId;
*/
RenderSurface( SurfaceType type,
Dali::PositionSize positionSize,
- boost::any surface,
- boost::any display,
+ Any surface,
+ Any display,
const std::string& name,
bool isTransparent = false);
* Second stage construction
* Creates the surface (window, pixmap or native buffer)
*/
- void Init( boost::any surface );
+ void Init( Any surface );
public: // API
/**
* @copydoc Dali::RenderSurface::GetSurface()
*/
- virtual boost::any GetSurface() = 0;
+ virtual Any GetSurface() = 0;
/**
* @copydoc Dali::RenderSurface::GetDisplay()
*/
- virtual boost::any GetDisplay();
+ virtual Any GetDisplay();
/**
* @copydoc Dali::RenderSurface::GetPositionSize()
* Sets the display, if display parameter is empty it opens a new display
* @param display
*/
- void SetDisplay( boost::any display );
+ void SetDisplay( Any display );
/**
* Get the surface id if the surface parameter is not empty
- * @param surface boost::any containing a surface id, or can be empty
+ * @param surface Any containing a surface id, or can be empty
* @return surface id, or zero if surface is empty
*/
- unsigned int GetSurfaceId( boost::any surface ) const;
+ unsigned int GetSurfaceId( Any surface ) const;
protected:
native_buffer_pool* pool,
unsigned int maxBufferCount,
Dali::PositionSize positionSize,
- boost::any surface,
- boost::any display,
+ Any surface,
+ Any display,
const std::string& name,
bool isTransparent )
: RenderSurface( Dali::RenderSurface::NATIVE_BUFFER, positionSize, surface, display, "native_buffer", isTransparent ),
return Dali::RenderSurface::NATIVE_BUFFER;
}
-boost::any NativeBufferRenderSurface::GetSurface()
+Any NativeBufferRenderSurface::GetSurface()
{
DALI_LOG_TRACE_METHOD( gRenderSurfaceLogFilter );
- return boost::any();
+ return Any();
}
void NativeBufferRenderSurface::InitializeEgl( EglInterface& egl )
native_buffer_pool* pool,
unsigned int maxBufferCount,
Dali::PositionSize positionSize,
- boost::any surface,
- boost::any display,
+ Any surface,
+ Any display,
const std::string& name,
bool isTransparent );
/**
* @copydoc Dali::RenderSurface::GetSurface()
*/
- virtual boost::any GetSurface();
+ virtual Any GetSurface();
public: // from Internal::Adaptor::RenderSurface
{
PixmapRenderSurface::PixmapRenderSurface( Dali::PositionSize positionSize,
- boost::any surface,
- boost::any display,
+ Any surface,
+ Any display,
const std::string& name,
bool isTransparent)
: RenderSurface( Dali::RenderSurface::PIXMAP, positionSize, surface, display, name, isTransparent )
return Dali::RenderSurface::PIXMAP;
}
-boost::any PixmapRenderSurface::GetSurface()
+Any PixmapRenderSurface::GetSurface()
{
- return boost::any( mX11Pixmap );
+ return Any( mX11Pixmap );
}
void PixmapRenderSurface::InitializeEgl( EglInterface& eglIf )
* @param [in] isTransparent if it is true, surface has 32 bit color depth, otherwise, 24 bit
*/
PixmapRenderSurface( Dali::PositionSize positionSize,
- boost::any surface,
- boost::any display,
+ Any surface,
+ Any display,
const std::string& name,
bool isTransparent = false);
/**
* @copydoc Dali::RenderSurface::GetSurface()
*/
- virtual boost::any GetSurface();
+ virtual Any GetSurface();
public: // from Internal::Adaptor::RenderSurface
} // unnamed namespace
WindowRenderSurface::WindowRenderSurface( Dali::PositionSize positionSize,
- boost::any surface,
- boost::any display,
+ Any surface,
+ Any display,
const std::string& name,
bool isTransparent)
: RenderSurface( Dali::RenderSurface::WINDOW, positionSize, surface, display, name, isTransparent ),
return Dali::RenderSurface::WINDOW;
}
-boost::any WindowRenderSurface::GetSurface()
+Any WindowRenderSurface::GetSurface()
{
// already an e-core type
- return boost::any( mX11Window );
+ return Any( mX11Window );
}
Ecore_X_Window WindowRenderSurface::GetXWindow()
* @param [in] isTransparent if it is true, surface has 32 bit color depth, otherwise, 24 bit
*/
WindowRenderSurface( Dali::PositionSize positionSize,
- boost::any surface,
- boost::any display,
+ Any surface,
+ Any display,
const std::string& name,
bool isTransparent = false );
/**
* @copydoc Dali::RenderSurface::GetSurface()
*/
- virtual boost::any GetSurface();
+ virtual Any GetSurface();
/**
* @copydoc Dali::RenderSurface::GetDrawable()
Dali::RenderSurface& surface( adaptorImpl.GetSurface() );
if( surface.GetType() == Dali::RenderSurface::WINDOW )
{
- ecoreXwin = boost::any_cast< Ecore_X_Window >( adaptorImpl.GetSurface().GetSurface() );
+ ecoreXwin = AnyCast< Ecore_X_Window >( adaptorImpl.GetSurface().GetSurface() );
}
// If we fail to get Ecore_X_Window, we can't use the ImfManager correctly.
}
}
-PixmapImage* PixmapImage::New(unsigned int width, unsigned int height, Dali::PixmapImage::ColorDepth depth, Dali::Adaptor& adaptor, boost::any pixmap )
+PixmapImage* PixmapImage::New(unsigned int width, unsigned int height, Dali::PixmapImage::ColorDepth depth, Dali::Adaptor& adaptor, Any pixmap )
{
PixmapImage* image = new PixmapImage( width, height, depth, adaptor, pixmap );
DALI_ASSERT_DEBUG( image && "PixmapImage allocation failed." );
return image;
}
-PixmapImage::PixmapImage(unsigned int width, unsigned int height, Dali::PixmapImage::ColorDepth depth, Dali::Adaptor& adaptor, boost::any pixmap)
+PixmapImage::PixmapImage(unsigned int width, unsigned int height, Dali::PixmapImage::ColorDepth depth, Dali::Adaptor& adaptor, Any pixmap)
: mWidth(width),
mHeight(height),
mOwnPixmap(true),
mEglImageKHR(NULL)
{
// assign the pixmap
- mPixmap = GetPixmapFromBoostAny(pixmap);
+ mPixmap = GetPixmapFromAny(pixmap);
}
void PixmapImage::Initialize()
// get the X11 display pointer and store it
// it is used by eglCreateImageKHR, and XFreePixmap
// Any other display (x-connection) will fail in eglCreateImageKHR
- boost::any display = surface.GetDisplay();
+ Any display = surface.GetDisplay();
// the dali display pointer is needed
- mDisplay = boost::any_cast<Ecore_X_Display*>(display);
+ mDisplay = AnyCast<Ecore_X_Display*>(display);
// if pixmap has been created outside of X11 Image we can return
if (mPixmap)
SetPixelFormat(depth);
// Get the X-Renderable for which the pixmap is created on
- boost::any renderableSurface = surface.GetSurface();
+ Any renderableSurface = surface.GetSurface();
// if Dali is using a Pixmap or Window to render to it doesn't matter because they have the same
// underlying type of unsigned long
- Ecore_X_Window daliWindow = boost::any_cast< Ecore_X_Window >(renderableSurface);
+ Ecore_X_Window daliWindow = AnyCast< Ecore_X_Window >(renderableSurface);
mPixmap = ecore_x_pixmap_new(daliWindow, mWidth, mHeight, depth);
ecore_x_sync();
}
}
-boost::any PixmapImage::GetPixmap(Dali::PixmapImage::PixmapAPI api) const
+Any PixmapImage::GetPixmap(Dali::PixmapImage::PixmapAPI api) const
{
if (api == Dali::PixmapImage::ECORE_X11)
{
// return ecore x11 type
- return boost::any(mPixmap);
+ return Any(mPixmap);
}
else
{
// return x11 type after casting it
Pixmap pixmap= static_cast<Pixmap>(mPixmap);
- return boost::any(pixmap);
+ return Any(pixmap);
}
}
-boost::any PixmapImage::GetDisplay() const
+Any PixmapImage::GetDisplay() const
{
// return ecore x11 type
- return boost::any(mDisplay);
+ return Any(mDisplay);
}
bool PixmapImage::GetPixels(std::vector<unsigned char>& pixbuf, unsigned& width, unsigned& height, Pixel::Format& pixelFormat) const
}
}
-Ecore_X_Pixmap PixmapImage::GetPixmapFromBoostAny(boost::any pixmap) const
+Ecore_X_Pixmap PixmapImage::GetPixmapFromAny(Any pixmap) const
{
- if (pixmap.empty())
+ if (pixmap.Empty())
{
return 0;
}
// see if it is of type x11 pixmap
- if (pixmap.type() == typeid (Pixmap))
+ if (pixmap.GetType() == typeid (Pixmap))
{
// get the x pixmap type
- Pixmap xpixmap = boost::any_cast<Pixmap>(pixmap);
+ Pixmap xpixmap = AnyCast<Pixmap>(pixmap);
// cast it to a ecore pixmap type
return static_cast<Ecore_X_Pixmap>(xpixmap);
}
else
{
- return boost::any_cast<Ecore_X_Pixmap>(pixmap);
+ return AnyCast<Ecore_X_Pixmap>(pixmap);
}
}
unsigned int height,
Dali::PixmapImage::ColorDepth depth,
Dali::Adaptor& adaptor,
- boost::any pixmap);
+ Any pixmap);
/**
* @copydoc Dali::PixmapImage::GetPixmap()
*/
- boost::any GetPixmap(Dali::PixmapImage::PixmapAPI api) const;
+ Any GetPixmap(Dali::PixmapImage::PixmapAPI api) const;
/**
* @copydoc Dali::PixmapImage::GetDisplay()
*/
- boost::any GetDisplay() const;
+ Any GetDisplay() const;
/**
* @copydoc Dali::PixmapImage::GetPixels()
unsigned int height,
Dali::PixmapImage::ColorDepth depth,
Dali::Adaptor &adaptor,
- boost::any pixmap);
+ Any pixmap);
/**
* 2nd phase construction.
void SetPixelFormat(int depth);
/**
- * Gets the pixmap from the boost::any parameter
+ * Gets the pixmap from the Any parameter
* @param pixmap contains either: pixmap of type X11 Pixmap , a Ecore_X_Pixmap or is empty
* @return pixmap x11 pixmap
*/
- Ecore_X_Pixmap GetPixmapFromBoostAny(boost::any pixmap) const;
+ Ecore_X_Pixmap GetPixmapFromAny(Any pixmap) const;
/**
* Given an existing pixmap, the function uses X to find out
void Window::Initialize(const PositionSize& windowPosition, const std::string& name)
{
// create an X11 window by default
- boost::any surface;
- boost::any display;
+ Any surface;
+ Any display;
mSurface = new ECoreX::WindowRenderSurface( windowPosition, surface, display, name, mIsTransparent );
mOrientation = Orientation::New(this);
mEvasDirtyIdler(NULL)
{
DALI_ASSERT_ALWAYS( parent && "No parent object for plugin" );
- mEvas = boost::any_cast<Evas*>(evas_object_evas_get(parent));
+ mEvas = AnyCast<Evas*>(evas_object_evas_get(parent));
/* create evas object image */
CreateEvasImageObject(mEvas, initialWidth, initialHeight, isTransparent);
mAdaptor = Internal::Adaptor::Adaptor::New( mSurface, DeviceLayout::DEFAULT_BASE_LAYOUT );
- boost::any surface = mSurface->GetSurface();
+ Any surface = mSurface->GetSurface();
- Ecore_X_Pixmap pixmap = boost::any_cast<Ecore_X_Pixmap>(surface);
+ Ecore_X_Pixmap pixmap = AnyCast<Ecore_X_Pixmap>(surface);
/* set native pixmap surface */
Evas_Native_Surface ns;
ECoreX::RenderSurface* EvasPlugin::CreateSurface( int width, int height )
{
PositionSize pixmapSize( 0, 0, width, height );
- boost::any surface;
- boost::any display;
+ Any surface;
+ Any display;
// if we already have surface, reuse its display
if( mSurface )
{
// update the pixmap for evas
{
- boost::any surface = mSurface->GetSurface();
- Ecore_X_Pixmap pixmap = boost::any_cast<Ecore_X_Pixmap>( surface );
+ Any surface = mSurface->GetSurface();
+ Ecore_X_Pixmap pixmap = AnyCast<Ecore_X_Pixmap>( surface );
Evas_Native_Surface ns;
ns.type = EVAS_NATIVE_SURFACE_X11;
Ecore_X_Event_Damage *ev = (Ecore_X_Event_Damage *)event;
// get the EFL type for the surface
- boost::any surface = liveboxPlugin->mSurface->GetSurface();
+ Any surface = liveboxPlugin->mSurface->GetSurface();
- Ecore_X_Pixmap pixmap = boost::any_cast<Ecore_X_Pixmap>(surface);
+ Ecore_X_Pixmap pixmap = AnyCast<Ecore_X_Pixmap>(surface);
if (!ev || !liveboxPlugin->mDamage)
{
void LiveboxPlugin::CreateSurface(Ecore_X_Pixmap pixmap)
{
- boost::any display;
+ Any display;
if(mSurface)
{
DALI_LOG_TRACE_METHOD( gLogFilter );
PositionSize positionSize( 0, 0, width, height );
- boost::any surface;
- boost::any display;
+ Any surface;
+ Any display;
// if we already have surface, reuse its display
if( mSurface )
// INTERNAL INCLUDES
#include <internal/common/pixmap-image-impl.h>
+// EXTERNAL INCLUDES
+#include <dali/public-api/object/any.h>
+
namespace Dali
{
PixmapImagePtr PixmapImage::New(unsigned int width, unsigned int height, ColorDepth depth, Adaptor& adaptor)
{
- boost::any empty;
+ Any empty;
PixmapImagePtr image = new PixmapImage(width, height, depth, adaptor, empty);
return image;
}
-PixmapImagePtr PixmapImage::New(boost::any pixmap, Adaptor& adaptor)
+PixmapImagePtr PixmapImage::New(Any pixmap, Adaptor& adaptor)
{
PixmapImagePtr image = new PixmapImage(0, 0, COLOR_DEPTH_DEFAULT, adaptor, pixmap);
return image;
}
-boost::any PixmapImage::GetPixmap(PixmapAPI api)
+Any PixmapImage::GetPixmap(PixmapAPI api)
{
return mImpl->GetPixmap(api);
}
-boost::any PixmapImage::GetDisplay()
+Any PixmapImage::GetDisplay()
{
return mImpl->GetDisplay();
}
return mImpl->GetPixelFormat();
}
-PixmapImage::PixmapImage(unsigned int width, unsigned int height, ColorDepth depth, Adaptor& adaptor, boost::any pixmap)
+PixmapImage::PixmapImage(unsigned int width, unsigned int height, ColorDepth depth, Adaptor& adaptor, Any pixmap)
{
mImpl = Internal::Adaptor::PixmapImage::New( width, height, depth, adaptor, pixmap);
}
RenderSurface* CreateDefaultSurface( RenderSurface::SurfaceType type, PositionSize positionSize, const std::string& name )
{
// create a Ecore X11 window by default
- boost::any surface;
- boost::any display;
+ Any surface;
+ Any display;
Internal::Adaptor::ECoreX::RenderSurface* renderSurface(NULL);
if( RenderSurface::WINDOW == type )
int
main(int argc, char **argv)
{
- boost::any nullPtr;
+ Any nullPtr;
NativeBufferPlugin* plugin = new NativeBufferPlugin(400, 400, false, 2, RenderSurface::RENDER_30FPS);
// EXTERNAL INCLUDES
#include <dali/public-api/common/vector-wrapper.h>
-#include <boost/any.hpp>
#include <dali/public-api/images/native-image.h>
+#include <dali/public-api/object/any.h>
namespace Dali DALI_IMPORT_API
{
* @param[in] adaptor reference to dali adaptor
* @return A smart-pointer to a newly allocated image.
*/
- static PixmapImagePtr New( boost::any pixmap, Adaptor& adaptor );
+ static PixmapImagePtr New( Any pixmap, Adaptor& adaptor );
/**
* @brief Retrieve the internal pixmap
*
* @param api whether to return a pixmap that can be used with X11 or EFL
- * @return pixmap boost any object containing a pixmap of the type specified PixmapAPI
+ * @return pixmap any object containing a pixmap of the type specified PixmapAPI
*/
- boost::any GetPixmap( PixmapAPI api );
+ Any GetPixmap( PixmapAPI api );
/**
* @brief Retrieve the display used to create the pixmap.
*
* If the pixmap was created outside of Dali, then this display
* is the one Dali uses internally.
- * @return boost any object containing the display
+ * @return Any object containing the display
*/
- boost::any GetDisplay();
+ Any GetDisplay();
/**
* @brief Get a copy of the pixels used by PixmapImage.
* @param[in] adaptor a reference to Dali adaptor
* @param[in] pixmap contains either: pixmap of type X11 Pixmap , a Ecore_X_Pixmap or is empty
*/
- PixmapImage(unsigned int width, unsigned int height, ColorDepth depth, Adaptor& adaptor, boost::any pixmap);
+ PixmapImage(unsigned int width, unsigned int height, ColorDepth depth, Adaptor& adaptor, Any pixmap);
/**
* @brief A reference counted object may only be deleted by calling Unreference().
* @brief Undefined assignment operator.
*
* This avoids accidental calls to a default assignment operator.
+ * @param[in] rhs A reference to the object to copy.
*/
PixmapImage& operator=(const PixmapImage& rhs);
*/
// EXTERNAL INCLUDES
-#include <boost/any.hpp>
#include <string>
#include <dali/public-api/math/rect.h>
+#include <dali/public-api/object/any.h>
namespace Dali DALI_IMPORT_API
{
* usually a window in the native windowing system, or some other
* mapped pixel buffer.
*
+ * Dali::Application will automatically create a render surface using a window.
+ *
* The implementation of the factory method below should choose an appropriate
* implementation of RenderSurface for the given platform
*/
* @brief Returns the window or pixmap surface.
* @return surface
*/
- virtual boost::any GetSurface() = 0;
+ virtual Any GetSurface() = 0;
/**
* @brief Returns the display.
* @return display
*/
- virtual boost::any GetDisplay() = 0;
+ virtual Any GetDisplay() = 0;
/**
* @brief Return the size and position of the surface.
*/
// EXTERNAL INCLUDES
-#include <boost/any.hpp>
#include <boost/function.hpp>
#include <dali/public-api/signals/dali-signal-v2.h>