From: taeyoon0.lee Date: Mon, 20 Feb 2017 07:06:43 +0000 (+0900) Subject: Added internal property for custom shader X-Git-Tag: accepted/tizen/4.0/unified/20170920.081503~1^2~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=73d2f1af22fa935bbfbb97518d5f3cbc09b1e546;p=platform%2Fcore%2Fuifw%2Fwidget-viewer-dali.git Added internal property for custom shader - Supports an effect by custom shader For example, grayscale conversion Change-Id: I6dbc570ff71e2ea0fbea6c9f001db24121615068 --- diff --git a/internal/widget_view/widget_view_impl.cpp b/internal/widget_view/widget_view_impl.cpp index cf85465..1833f1a 100644 --- a/internal/widget_view/widget_view_impl.cpp +++ b/internal/widget_view/widget_view_impl.cpp @@ -80,9 +80,11 @@ DALI_PROPERTY_REGISTRATION( Dali::WidgetView, WidgetView, "permanentDelete", BOO // ToDo it should be changed public property. const int TERMINATE_WIDGET = Dali::WidgetView::WidgetView::Property::PERMANENT_DELETE+1; const int RETRY_TEXT = TERMINATE_WIDGET+1; +const int WIDGET_IMAGE = RETRY_TEXT+1; Dali::PropertyRegistration internalProperty1( typeRegistration, "terminateWidget", TERMINATE_WIDGET, Property::BOOLEAN, Dali::WidgetView::Internal::WidgetView::SetProperty, Dali::WidgetView::Internal::WidgetView::GetProperty ); Dali::PropertyRegistration internalProperty2( typeRegistration, "retryText", RETRY_TEXT, Property::MAP, Dali::WidgetView::Internal::WidgetView::SetProperty, Dali::WidgetView::Internal::WidgetView::GetProperty ); +Dali::PropertyRegistration internalProperty3( typeRegistration, "widgetImage", WIDGET_IMAGE, Property::MAP, Dali::WidgetView::Internal::WidgetView::SetProperty, Dali::WidgetView::Internal::WidgetView::GetProperty ); // Signals DALI_SIGNAL_REGISTRATION( Dali::WidgetView, WidgetView, "widgetAdded", SIGNAL_WIDGET_ADDED ) @@ -434,6 +436,11 @@ void WidgetView::CreateWidgetImageView() mWidgetImageView.SetAnchorPoint( AnchorPoint::CENTER ); mWidgetImageView.SetSize( mWidth, mHeight ); + if( !mWidgetImagePropertyMap.Empty() ) + { + mWidgetImageView.SetProperty( Toolkit::ImageView::Property::IMAGE, mWidgetImagePropertyMap ); + } + Self().Add( mWidgetImageView ); //EFL app should be pre multiplied image. @@ -648,6 +655,7 @@ void WidgetView::SetProperty( BaseObject* object, Property::Index index, const P { impl.TerminateWidget(); } + break; } case RETRY_TEXT: { @@ -659,6 +667,15 @@ void WidgetView::SetProperty( BaseObject* object, Property::Index index, const P } break; } + case WIDGET_IMAGE: + { + Property::Map map; + if( value.Get( map ) ) + { + impl.SetWidgetImagePropertyMap( map ); + } + break; + } } } } @@ -1165,6 +1182,15 @@ void WidgetView::SetRetryTextPropertyMap( Property::Map map ) } } +void WidgetView::SetWidgetImagePropertyMap( Property::Map map ) +{ + mWidgetImagePropertyMap = map; + if( mWidgetImageView ) + { + mWidgetImageView.SetProperty( Toolkit::ImageView::Property::IMAGE, map ); + } +} + float WidgetView::TextPixelToPointSize( int pixelSize ) { Dali::Vector2 dpi = Dali::Stage::GetCurrent().GetDpi(); diff --git a/internal/widget_view/widget_view_impl.h b/internal/widget_view/widget_view_impl.h index aaaffbc..8783aa2 100644 --- a/internal/widget_view/widget_view_impl.h +++ b/internal/widget_view/widget_view_impl.h @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -150,6 +151,8 @@ public: // Internal API void SetRetryTextPropertyMap( Dali::Property::Map map ); + void SetWidgetImagePropertyMap( Dali::Property::Map map ); + void ShowLoadingState( bool show ); void ShowRetryState( bool show ); @@ -287,6 +290,8 @@ private: screen_connector_toolkit_h mWatcherHandle; tizen_remote_surface* mRemoteSurface; + Dali::Property::Map mWidgetImagePropertyMap; + // Signals Dali::WidgetView::WidgetView::WidgetViewSignalType mWidgetAddedSignal; Dali::WidgetView::WidgetView::WidgetViewSignalType mWidgetDeletedSignal;