From: Richard Underhill Date: Wed, 19 Mar 2014 12:46:48 +0000 (+0000) Subject: Boost::any replacement in Dali Adaptor X-Git-Tag: dali-2014-wk16-release~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F57%2F18257%2F3;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git Boost::any replacement in Dali Adaptor [Issue#] N/A [Problem] [Cause] [Solution] Change-Id: Icb1fad43cea08bed1af43168adecc23167c1d508 Signed-off-by: Richard Underhill Signed-off-by: Andrew Cox --- diff --git a/adaptors/tizen/internal/common/clipboard-impl.cpp b/adaptors/tizen/internal/common/clipboard-impl.cpp index a336bb2..9326095 100644 --- a/adaptors/tizen/internal/common/clipboard-impl.cpp +++ b/adaptors/tizen/internal/common/clipboard-impl.cpp @@ -24,6 +24,7 @@ // INTERNAL INCLUDES #include +#include #include #include @@ -68,7 +69,7 @@ BaseHandle Create() 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. diff --git a/adaptors/tizen/internal/common/ecore-x/ecore-x-render-surface-factory.cpp b/adaptors/tizen/internal/common/ecore-x/ecore-x-render-surface-factory.cpp index daa898b..ed0e17f 100644 --- a/adaptors/tizen/internal/common/ecore-x/ecore-x-render-surface-factory.cpp +++ b/adaptors/tizen/internal/common/ecore-x/ecore-x-render-surface-factory.cpp @@ -29,8 +29,8 @@ namespace ECoreX DALI_EXPORT_API RenderSurface* CreatePixmapSurface( PositionSize positionSize, - boost::any surface, - boost::any display, + Any surface, + Any display, const std::string& name, bool isTransparent ) { @@ -42,8 +42,8 @@ DALI_EXPORT_API RenderSurface* CreateNativeBufferSurface( 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 ) { diff --git a/adaptors/tizen/internal/common/ecore-x/ecore-x-render-surface-factory.h b/adaptors/tizen/internal/common/ecore-x/ecore-x-render-surface-factory.h index 93fbd6f..e885341 100644 --- a/adaptors/tizen/internal/common/ecore-x/ecore-x-render-surface-factory.h +++ b/adaptors/tizen/internal/common/ecore-x/ecore-x-render-surface-factory.h @@ -49,8 +49,8 @@ class RenderSurface; */ DALI_IMPORT_API RenderSurface* CreatePixmapSurface( PositionSize positionSize, - boost::any surface, - boost::any display, + Any surface, + Any display, const std::string& name, bool isTransparent ); @@ -72,8 +72,8 @@ DALI_IMPORT_API RenderSurface* CreateNativeBufferSurface( 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 ); diff --git a/adaptors/tizen/internal/common/ecore-x/ecore-x-render-surface.cpp b/adaptors/tizen/internal/common/ecore-x/ecore-x-render-surface.cpp index c78e1d0..cbc587e 100644 --- a/adaptors/tizen/internal/common/ecore-x/ecore-x-render-surface.cpp +++ b/adaptors/tizen/internal/common/ecore-x/ecore-x-render-surface.cpp @@ -60,8 +60,8 @@ const unsigned int MILLISECONDS_PER_SECOND = 1000; 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), @@ -76,13 +76,13 @@ RenderSurface::RenderSurface( SurfaceType type, 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. @@ -151,10 +151,10 @@ Ecore_X_Drawable RenderSurface::GetDrawable() 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 @@ -250,29 +250,29 @@ void RenderSurface::StopRender() 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 @@ -284,24 +284,24 @@ void RenderSurface::SetDisplay( boost::any display ) } } -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( surface ); + surfaceId = AnyCast( surface ); } else { - surfaceId = boost::any_cast( surface ); + surfaceId = AnyCast( surface ); } } return surfaceId; diff --git a/adaptors/tizen/internal/common/ecore-x/ecore-x-render-surface.h b/adaptors/tizen/internal/common/ecore-x/ecore-x-render-surface.h index 49fd189..9abe556 100644 --- a/adaptors/tizen/internal/common/ecore-x/ecore-x-render-surface.h +++ b/adaptors/tizen/internal/common/ecore-x/ecore-x-render-surface.h @@ -60,8 +60,8 @@ public: */ RenderSurface( SurfaceType type, Dali::PositionSize positionSize, - boost::any surface, - boost::any display, + Any surface, + Any display, const std::string& name, bool isTransparent = false); @@ -77,7 +77,7 @@ protected: * Second stage construction * Creates the surface (window, pixmap or native buffer) */ - void Init( boost::any surface ); + void Init( Any surface ); public: // API @@ -112,12 +112,12 @@ public: // from Dali::RenderSurface /** * @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() @@ -207,14 +207,14 @@ private: * 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: diff --git a/adaptors/tizen/internal/common/ecore-x/native-buffer-render-surface.cpp b/adaptors/tizen/internal/common/ecore-x/native-buffer-render-surface.cpp index 5e8c9cb..9e67e06 100644 --- a/adaptors/tizen/internal/common/ecore-x/native-buffer-render-surface.cpp +++ b/adaptors/tizen/internal/common/ecore-x/native-buffer-render-surface.cpp @@ -46,8 +46,8 @@ NativeBufferRenderSurface::NativeBufferRenderSurface( native_buffer_provider* pr 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 ), @@ -84,10 +84,10 @@ Dali::RenderSurface::SurfaceType NativeBufferRenderSurface::GetType() 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 ) diff --git a/adaptors/tizen/internal/common/ecore-x/native-buffer-render-surface.h b/adaptors/tizen/internal/common/ecore-x/native-buffer-render-surface.h index b12387b..2851737 100644 --- a/adaptors/tizen/internal/common/ecore-x/native-buffer-render-surface.h +++ b/adaptors/tizen/internal/common/ecore-x/native-buffer-render-surface.h @@ -52,8 +52,8 @@ public: 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 ); @@ -79,7 +79,7 @@ public: // from Dali::RenderSurface /** * @copydoc Dali::RenderSurface::GetSurface() */ - virtual boost::any GetSurface(); + virtual Any GetSurface(); public: // from Internal::Adaptor::RenderSurface diff --git a/adaptors/tizen/internal/common/ecore-x/pixmap-render-surface.cpp b/adaptors/tizen/internal/common/ecore-x/pixmap-render-surface.cpp index a51365e..d0a5767 100644 --- a/adaptors/tizen/internal/common/ecore-x/pixmap-render-surface.cpp +++ b/adaptors/tizen/internal/common/ecore-x/pixmap-render-surface.cpp @@ -49,8 +49,8 @@ namespace ECoreX { 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 ) @@ -79,9 +79,9 @@ Dali::RenderSurface::SurfaceType PixmapRenderSurface::GetType() return Dali::RenderSurface::PIXMAP; } -boost::any PixmapRenderSurface::GetSurface() +Any PixmapRenderSurface::GetSurface() { - return boost::any( mX11Pixmap ); + return Any( mX11Pixmap ); } void PixmapRenderSurface::InitializeEgl( EglInterface& eglIf ) diff --git a/adaptors/tizen/internal/common/ecore-x/pixmap-render-surface.h b/adaptors/tizen/internal/common/ecore-x/pixmap-render-surface.h index c3742cb..545151d 100644 --- a/adaptors/tizen/internal/common/ecore-x/pixmap-render-surface.h +++ b/adaptors/tizen/internal/common/ecore-x/pixmap-render-surface.h @@ -49,8 +49,8 @@ public: * @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); @@ -76,7 +76,7 @@ public: // from Dali::RenderSurface /** * @copydoc Dali::RenderSurface::GetSurface() */ - virtual boost::any GetSurface(); + virtual Any GetSurface(); public: // from Internal::Adaptor::RenderSurface diff --git a/adaptors/tizen/internal/common/ecore-x/window-render-surface.cpp b/adaptors/tizen/internal/common/ecore-x/window-render-surface.cpp index cadb610..6b28931 100644 --- a/adaptors/tizen/internal/common/ecore-x/window-render-surface.cpp +++ b/adaptors/tizen/internal/common/ecore-x/window-render-surface.cpp @@ -56,8 +56,8 @@ const int MINIMUM_DIMENSION_CHANGE( 1 ); ///< Minimum change for window to be co } // 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 ), @@ -86,10 +86,10 @@ Dali::RenderSurface::SurfaceType WindowRenderSurface::GetType() 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() diff --git a/adaptors/tizen/internal/common/ecore-x/window-render-surface.h b/adaptors/tizen/internal/common/ecore-x/window-render-surface.h index 373bf2a..b544987 100644 --- a/adaptors/tizen/internal/common/ecore-x/window-render-surface.h +++ b/adaptors/tizen/internal/common/ecore-x/window-render-surface.h @@ -49,8 +49,8 @@ public: * @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 ); @@ -82,7 +82,7 @@ public: // from Dali::RenderSurface /** * @copydoc Dali::RenderSurface::GetSurface() */ - virtual boost::any GetSurface(); + virtual Any GetSurface(); /** * @copydoc Dali::RenderSurface::GetDrawable() diff --git a/adaptors/tizen/internal/common/imf-manager-impl.cpp b/adaptors/tizen/internal/common/imf-manager-impl.cpp index 7f338c8..6677209 100644 --- a/adaptors/tizen/internal/common/imf-manager-impl.cpp +++ b/adaptors/tizen/internal/common/imf-manager-impl.cpp @@ -129,7 +129,7 @@ BaseHandle Create() 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. diff --git a/adaptors/tizen/internal/common/pixmap-image-impl.cpp b/adaptors/tizen/internal/common/pixmap-image-impl.cpp index 381418e..4fbdb39 100644 --- a/adaptors/tizen/internal/common/pixmap-image-impl.cpp +++ b/adaptors/tizen/internal/common/pixmap-image-impl.cpp @@ -162,7 +162,7 @@ namespace } } -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." ); @@ -176,7 +176,7 @@ PixmapImage* PixmapImage::New(unsigned int width, unsigned int height, Dali::Pix 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), @@ -188,7 +188,7 @@ PixmapImage::PixmapImage(unsigned int width, unsigned int height, Dali::PixmapIm mEglImageKHR(NULL) { // assign the pixmap - mPixmap = GetPixmapFromBoostAny(pixmap); + mPixmap = GetPixmapFromAny(pixmap); } void PixmapImage::Initialize() @@ -199,10 +199,10 @@ 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(display); + mDisplay = AnyCast(display); // if pixmap has been created outside of X11 Image we can return if (mPixmap) @@ -222,11 +222,11 @@ void PixmapImage::Initialize() 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(); @@ -249,26 +249,26 @@ PixmapImage::~PixmapImage() } } -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(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& pixbuf, unsigned& width, unsigned& height, Pixel::Format& pixelFormat) const @@ -490,25 +490,25 @@ void PixmapImage::SetPixelFormat(int depth) } } -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 xpixmap = AnyCast(pixmap); // cast it to a ecore pixmap type return static_cast(xpixmap); } else { - return boost::any_cast(pixmap); + return AnyCast(pixmap); } } diff --git a/adaptors/tizen/internal/common/pixmap-image-impl.h b/adaptors/tizen/internal/common/pixmap-image-impl.h index f546ec6..682399c 100644 --- a/adaptors/tizen/internal/common/pixmap-image-impl.h +++ b/adaptors/tizen/internal/common/pixmap-image-impl.h @@ -55,17 +55,17 @@ public: 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() @@ -135,7 +135,7 @@ private: unsigned int height, Dali::PixmapImage::ColorDepth depth, Dali::Adaptor &adaptor, - boost::any pixmap); + Any pixmap); /** * 2nd phase construction. @@ -156,11 +156,11 @@ private: 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 diff --git a/adaptors/tizen/internal/common/window-impl.cpp b/adaptors/tizen/internal/common/window-impl.cpp index 637564d..f2c7607 100644 --- a/adaptors/tizen/internal/common/window-impl.cpp +++ b/adaptors/tizen/internal/common/window-impl.cpp @@ -322,8 +322,8 @@ Window::~Window() 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); diff --git a/adaptors/tizen/internal/evas-plugin-impl.cpp b/adaptors/tizen/internal/evas-plugin-impl.cpp index 1363b38..ca5378e 100644 --- a/adaptors/tizen/internal/evas-plugin-impl.cpp +++ b/adaptors/tizen/internal/evas-plugin-impl.cpp @@ -765,7 +765,7 @@ EvasPlugin::EvasPlugin(Dali::EvasPlugin& evasPlugin, Evas_Object* parent, bool i mEvasDirtyIdler(NULL) { DALI_ASSERT_ALWAYS( parent && "No parent object for plugin" ); - mEvas = boost::any_cast(evas_object_evas_get(parent)); + mEvas = AnyCast(evas_object_evas_get(parent)); /* create evas object image */ CreateEvasImageObject(mEvas, initialWidth, initialHeight, isTransparent); @@ -985,9 +985,9 @@ void EvasPlugin::CreateAdaptor(unsigned int initialWidth, unsigned int initialHe 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(surface); + Ecore_X_Pixmap pixmap = AnyCast(surface); /* set native pixmap surface */ Evas_Native_Surface ns; @@ -1002,8 +1002,8 @@ void EvasPlugin::CreateAdaptor(unsigned int initialWidth, unsigned int initialHe 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 ) { @@ -1029,8 +1029,8 @@ void EvasPlugin::ResizeSurface() // update the pixmap for evas { - boost::any surface = mSurface->GetSurface(); - Ecore_X_Pixmap pixmap = boost::any_cast( surface ); + Any surface = mSurface->GetSurface(); + Ecore_X_Pixmap pixmap = AnyCast( surface ); Evas_Native_Surface ns; ns.type = EVAS_NATIVE_SURFACE_X11; diff --git a/adaptors/tizen/internal/livebox-plugin-impl.cpp b/adaptors/tizen/internal/livebox-plugin-impl.cpp index 5096bbb..4acbe83 100644 --- a/adaptors/tizen/internal/livebox-plugin-impl.cpp +++ b/adaptors/tizen/internal/livebox-plugin-impl.cpp @@ -247,9 +247,9 @@ static Eina_Bool LiveboxDamageCallback(void *data, int type, void *event) 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(surface); + Ecore_X_Pixmap pixmap = AnyCast(surface); if (!ev || !liveboxPlugin->mDamage) { @@ -356,7 +356,7 @@ void LiveboxPlugin::OnInit() void LiveboxPlugin::CreateSurface(Ecore_X_Pixmap pixmap) { - boost::any display; + Any display; if(mSurface) { diff --git a/adaptors/tizen/internal/native-buffer-plugin-impl.cpp b/adaptors/tizen/internal/native-buffer-plugin-impl.cpp index 080d912..38fc28c 100644 --- a/adaptors/tizen/internal/native-buffer-plugin-impl.cpp +++ b/adaptors/tizen/internal/native-buffer-plugin-impl.cpp @@ -120,8 +120,8 @@ ECoreX::RenderSurface* NativeBufferPlugin::CreateSurface( int width, int height, 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 ) diff --git a/adaptors/tizen/public-api/adaptor-framework/common/pixmap-image.cpp b/adaptors/tizen/public-api/adaptor-framework/common/pixmap-image.cpp index f80f2de..5dfc689 100644 --- a/adaptors/tizen/public-api/adaptor-framework/common/pixmap-image.cpp +++ b/adaptors/tizen/public-api/adaptor-framework/common/pixmap-image.cpp @@ -20,28 +20,31 @@ // INTERNAL INCLUDES #include +// EXTERNAL INCLUDES +#include + 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(); } @@ -91,7 +94,7 @@ Pixel::Format PixmapImage::GetPixelFormat() const 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); } diff --git a/adaptors/tizen/public-api/adaptor-framework/common/render-surface.cpp b/adaptors/tizen/public-api/adaptor-framework/common/render-surface.cpp index 58c0412..7594b94 100644 --- a/adaptors/tizen/public-api/adaptor-framework/common/render-surface.cpp +++ b/adaptors/tizen/public-api/adaptor-framework/common/render-surface.cpp @@ -36,8 +36,8 @@ RenderSurface::~RenderSurface() 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 ) diff --git a/build/tizen/dali-native-buffer/linker-test.cpp b/build/tizen/dali-native-buffer/linker-test.cpp index 3fe06d7..aab42c3 100644 --- a/build/tizen/dali-native-buffer/linker-test.cpp +++ b/build/tizen/dali-native-buffer/linker-test.cpp @@ -48,7 +48,7 @@ public: int main(int argc, char **argv) { - boost::any nullPtr; + Any nullPtr; NativeBufferPlugin* plugin = new NativeBufferPlugin(400, 400, false, 2, RenderSurface::RENDER_30FPS); diff --git a/capi/dali/public-api/adaptor-framework/common/pixmap-image.h b/capi/dali/public-api/adaptor-framework/common/pixmap-image.h index fa8830a..73a23ef 100644 --- a/capi/dali/public-api/adaptor-framework/common/pixmap-image.h +++ b/capi/dali/public-api/adaptor-framework/common/pixmap-image.h @@ -24,8 +24,8 @@ // EXTERNAL INCLUDES #include -#include #include +#include namespace Dali DALI_IMPORT_API { @@ -96,24 +96,24 @@ public: * @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. @@ -186,7 +186,7 @@ private: * @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(). @@ -199,6 +199,7 @@ private: * @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); diff --git a/capi/dali/public-api/adaptor-framework/common/render-surface.h b/capi/dali/public-api/adaptor-framework/common/render-surface.h index 04d90ab..6f9144e 100644 --- a/capi/dali/public-api/adaptor-framework/common/render-surface.h +++ b/capi/dali/public-api/adaptor-framework/common/render-surface.h @@ -23,9 +23,9 @@ */ // EXTERNAL INCLUDES -#include #include #include +#include namespace Dali DALI_IMPORT_API { @@ -42,6 +42,8 @@ typedef Dali::Rect PositionSize; * 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 */ @@ -97,13 +99,13 @@ public: * @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. diff --git a/capi/dali/public-api/adaptor-framework/evas-plugin.h b/capi/dali/public-api/adaptor-framework/evas-plugin.h index 4bbef8a..d15e244 100644 --- a/capi/dali/public-api/adaptor-framework/evas-plugin.h +++ b/capi/dali/public-api/adaptor-framework/evas-plugin.h @@ -23,7 +23,6 @@ */ // EXTERNAL INCLUDES -#include #include #include