From f5bf567dc1924be33400726e895f08ec82d027bd Mon Sep 17 00:00:00 2001 From: "taeyoon0.lee" Date: Mon, 20 Feb 2017 16:06:43 +0900 Subject: [PATCH] Added internal property for custom shader - Supports an effect by custom shader For example, grayscale conversion Change-Id: I6dbc570ff71e2ea0fbea6c9f001db24121615068 --- .../internal/widget_view/widget_view_impl.cpp | 26 ++++++++++++++++++++++ .../internal/widget_view/widget_view_impl.h | 5 +++++ 2 files changed, 31 insertions(+) diff --git a/widget_viewer_dali/internal/widget_view/widget_view_impl.cpp b/widget_viewer_dali/internal/widget_view/widget_view_impl.cpp index cf85465..1833f1a 100644 --- a/widget_viewer_dali/internal/widget_view/widget_view_impl.cpp +++ b/widget_viewer_dali/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/widget_viewer_dali/internal/widget_view/widget_view_impl.h b/widget_viewer_dali/internal/widget_view/widget_view_impl.h index aaaffbc..8783aa2 100644 --- a/widget_viewer_dali/internal/widget_view/widget_view_impl.h +++ b/widget_viewer_dali/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; -- 2.7.4