From: taeyoon Date: Tue, 13 Dec 2016 11:50:51 +0000 (+0900) Subject: Change default permanent delete flag and add CloseRemoteSurface X-Git-Tag: accepted/tizen/4.0/unified/20170920.081503~1^2~32 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fwidget-viewer-dali.git;a=commitdiff_plain;h=e8d741b0c9fa00b763818c0bb71225b5a6444c92 Change default permanent delete flag and add CloseRemoteSurface Change-Id: I152abc4c15c3cb30dc6c6da63eba95f04c0144ce --- diff --git a/internal/widget_view/widget_view_impl.cpp b/internal/widget_view/widget_view_impl.cpp index d08218f..a98d16b 100644 --- a/internal/widget_view/widget_view_impl.cpp +++ b/internal/widget_view/widget_view_impl.cpp @@ -89,7 +89,7 @@ DALI_ACTION_REGISTRATION( Dali::WidgetView, WidgetView, "activateFaultedWidget", DALI_TYPE_REGISTRATION_END() -static void OnSurfaceUpdate( struct tizen_remote_surface* surface, wl_buffer* buffer, uint32_t time, void* data ) +static void OnBufferUpdate( struct tizen_remote_surface* surface, wl_buffer* buffer, uint32_t time, void* data ) { Dali::WidgetView::Internal::WidgetView* widgetView = static_cast< Dali::WidgetView::Internal::WidgetView* >( data ); @@ -111,12 +111,17 @@ static void OnSurfaceUpdate( struct tizen_remote_surface* surface, wl_buffer* bu static void OnSurfaceMissing( struct tizen_remote_surface* surface, void* data ) { - //ToDo: WidgetDeletedSignal + Dali::WidgetView::Internal::WidgetView* widgetView = static_cast< Dali::WidgetView::Internal::WidgetView* >( data ); + + if( widgetView ) + { + widgetView->CloseRemoteSurface(); + } } static struct aul_rsm_handler_s remoteSurfaceHandler = { - OnSurfaceUpdate, + OnBufferUpdate, OnSurfaceMissing, }; @@ -143,14 +148,13 @@ WidgetView::WidgetView() mInstanceId(), mContentInfo(), mTitle(), - mBundle( NULL ), mWidth( 0 ), mHeight( 0 ), mPid( 0 ), mUpdatePeriod( 0.0 ), mPreviewVisible( true ), mStateTextVisible( true ), - mPermanentDelete( true ), + mPermanentDelete( false ), mRemoteSurface( NULL ) { } @@ -161,14 +165,13 @@ WidgetView::WidgetView( const std::string& widgetId, const std::string& contentI mInstanceId(), mContentInfo( contentInfo ), mTitle(), - mBundle( NULL ), mWidth( width ), mHeight( height ), mPid( 0 ), mUpdatePeriod( updatePeriod ), mPreviewVisible( true ), mStateTextVisible( true ), - mPermanentDelete( true ), + mPermanentDelete( false ), mRemoteSurface( NULL ) { } @@ -184,11 +187,6 @@ WidgetView::~WidgetView() widget_instance_destroy( mInstanceId.c_str() ); } } - - if( mBundle ) - { - bundle_free( mBundle ); - } } bool WidgetView::PauseWidget() @@ -772,7 +770,7 @@ void WidgetView::UpdateImageSource( tbm_surface_h source ) void WidgetView::ConnectSignal( tizen_remote_surface* surface ) { - if( mWidgetImageView ) + if( mWidgetImageView && surface ) { mRemoteSurface = surface; @@ -786,7 +784,7 @@ bool WidgetView::OnTouch( Dali::Actor actor, const Dali::TouchData& event ) { tizen_remote_surface_event_type type = TIZEN_REMOTE_SURFACE_EVENT_TYPE_NONE; - if( event.GetPointCount() == 0 ) + if( event.GetPointCount() == 0 || mRemoteSurface == NULL ) { return false; } @@ -843,6 +841,10 @@ bool WidgetView::OnTouch( Dali::Actor actor, const Dali::TouchData& event ) bool WidgetView::OnWheelEvent( Dali::Actor actor, const Dali::WheelEvent& event ) { + if( mRemoteSurface == NULL ) + { + return false; + } //ToDo: We should check TIZEN_INPUT_DEVICE_CLAS_MOUSE tizen_remote_surface_transfer_mouse_wheel( mRemoteSurface, event.direction, @@ -896,6 +898,12 @@ float WidgetView::GetWidthForHeight( float height ) } } +void WidgetView::CloseRemoteSurface() +{ + aul_rsm_viewer_unset_surface_handler( mInstanceId.c_str() ); + mRemoteSurface = NULL; +} + } // namespace Internal } // namespace WidgetView diff --git a/internal/widget_view/widget_view_impl.h b/internal/widget_view/widget_view_impl.h index 651e6b4..94669d2 100644 --- a/internal/widget_view/widget_view_impl.h +++ b/internal/widget_view/widget_view_impl.h @@ -28,7 +28,6 @@ #include #include #include -#include namespace Dali { @@ -141,6 +140,8 @@ public: // Internal API bool OnWheelEvent( Dali::Actor actor, const Dali::WheelEvent& event ); + void CloseRemoteSurface(); + public: //Signals /** @@ -247,8 +248,6 @@ private: std::string mContentInfo; std::string mTitle; - bundle* mBundle; - int mWidth; int mHeight; int mPid;