From: tscholb Date: Tue, 2 Mar 2021 07:28:24 +0000 (+0900) Subject: Set RetryState When widget creation fails X-Git-Tag: submit/tizen_6.0/20210304.074341^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d356398ba3056c85d03a6b0337cac62974587bb0;p=platform%2Fcore%2Fuifw%2Fwidget-viewer-dali.git Set RetryState When widget creation fails when widget creation fails, the widget should be in a retry state and can be reexcuted through the touch Change-Id: I5a87f1249d8a1727f3143ab86ef60f222ff8c2e3 --- 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 db0031a..755305e 100644 --- a/widget_viewer_dali/internal/widget_view/widget_view_impl.cpp +++ b/widget_viewer_dali/internal/widget_view/widget_view_impl.cpp @@ -717,6 +717,11 @@ void WidgetView::SendWidgetEvent( int event ) } case WIDGET_INSTANCE_EVENT_CREATE_ABORTED: { + // Set RetryState + DALI_LOG_ERROR("widget aborted. please re-run widget."); + ShowLoadingState( false ); + ShowRetryState( true ); + CloseRemoteSurface(); mWidgetCreationAbortedSignal.Emit( handle ); break; } @@ -1111,6 +1116,9 @@ void WidgetView::OnInitialize() ops.added_cb = OnBufferAdded; mWatcherHandle = screen_connector_toolkit_add(&ops, (char *)instanceId, SCREEN_CONNECTOR_SCREEN_TYPE_WIDGET, this); DALI_LOG_INFO( gWidgetViewLogging, Debug::Verbose, "WidgetView::OnInitialize: widget_instance_launch is called. [%s, mPid = %d]\n", mWidgetId.c_str(), mPid ); + + Self().TouchedSignal().Connect( this, &WidgetView::OnTouch ); + Self().WheelEventSignal().Connect( this, &WidgetView::OnWheelEvent ); } void WidgetView::OnSceneConnection( int depth ) @@ -1239,11 +1247,6 @@ bool WidgetView::OnTouch( Dali::Actor actor, const Dali::TouchEvent& event ) return false; } - if( mRemoteSurface == NULL ) - { - return false; - } - Device::Class::Type deviceType = event.GetDeviceClass( 0 ); if( deviceType == Device::Class::MOUSE ) { @@ -1261,6 +1264,7 @@ bool WidgetView::OnWheelEvent( Dali::Actor actor, const Dali::WheelEvent& event { if( mRemoteSurface == NULL ) { + DALI_LOG_ERROR("There is no RemoteSurface so it can not use WheelEvent"); return false; } //ToDo: We should check TIZEN_INPUT_DEVICE_CLAS_MOUSE @@ -1279,6 +1283,7 @@ bool WidgetView::OnKeyEvent( const Dali::KeyEvent& event ) { if( mRemoteSurface == NULL ) { + DALI_LOG_ERROR("There is no RemoteSurface so it can not use KeyEvent"); return false; } @@ -1526,8 +1531,9 @@ float WidgetView::TextPixelToPointSize( int pixelSize ) void WidgetView::MouseIn( const Dali::TouchEvent& event ) { Vector2 localPos = event.GetLocalPosition( 0 ); - - tizen_remote_surface_transfer_mouse_event( mRemoteSurface, + if( mRemoteSurface ) + { + tizen_remote_surface_transfer_mouse_event( mRemoteSurface, TIZEN_REMOTE_SURFACE_EVENT_TYPE_MOUSE_IN, 0, 0, @@ -1542,11 +1548,14 @@ void WidgetView::MouseIn( const Dali::TouchEvent& event ) "", event.GetTime() ); + } } void WidgetView::MouseOut( const Dali::TouchEvent& event ) { - tizen_remote_surface_transfer_mouse_event( mRemoteSurface, + if( mRemoteSurface ) + { + tizen_remote_surface_transfer_mouse_event( mRemoteSurface, TIZEN_REMOTE_SURFACE_EVENT_TYPE_MOUSE_OUT, 0, 0, @@ -1561,6 +1570,7 @@ void WidgetView::MouseOut( const Dali::TouchEvent& event ) "", event.GetTime() ); + } } bool WidgetView::MouseEvent( const Dali::TouchEvent& event ) @@ -1601,6 +1611,12 @@ bool WidgetView::MouseEvent( const Dali::TouchEvent& event ) } } + if( mRemoteSurface == NULL ) + { + DALI_LOG_ERROR("There is no RemoteSurface so it can not use MouseEvent"); + return false; + } + Vector2 localPos = event.GetLocalPosition( 0 ); tizen_remote_surface_transfer_mouse_event( mRemoteSurface, @@ -1670,6 +1686,12 @@ bool WidgetView::TouchEvent( const Dali::TouchEvent& event ) } } + if( mRemoteSurface == NULL ) + { + DALI_LOG_ERROR("There is no RemoteSurface so it can not use TouchEvent"); + return false; + } + Vector2 localPos = event.GetLocalPosition( 0 ); tizen_remote_surface_transfer_touch_event( mRemoteSurface, @@ -1697,7 +1719,6 @@ void WidgetView::UpdateBuffer( struct tizen_remote_surface *surface, struct wl_b tizen_remote_surface_transfer_visibility( surface, TIZEN_REMOTE_SURFACE_VISIBILITY_TYPE_VISIBLE); CreateWidgetRenderer(); - ConnectSignal( surface ); } if( !buffer )