const int DEFAULT_FONT_PIXEL_SIZE = 30; // Referred platform widget viewer evas
+const int RELAUNCH_COUNT_MAX = 3;
+const int RELAUNCH_TIME = 500;
+
#define GET_LOCALE_TEXT(string) dgettext(PKGNAME, string)
#if defined(DEBUG_ENABLED)
mPreviewEnable( true ),
mIsReadyToRender(false),
mCornerRadius(Vector4::ZERO),
- mCornerRadiusPolicy(1.0f)
+ mCornerRadiusPolicy(1.0f),
+ mRelaunchTryCount(0)
{
}
mPreviewEnable( true ),
mIsReadyToRender(false),
mCornerRadius(Vector4::ZERO),
- mCornerRadiusPolicy(1.0f)
+ mCornerRadiusPolicy(1.0f),
+ mRelaunchTryCount(0)
{
}
mWatcherHandle = NULL;
mRemoteSurface = NULL;
mPid = -1;
+
+ mRelaunchTryCount = 0;
+ if(mRelaunchTimer)
+ {
+ mRelaunchTimer.Stop();
+ mRelaunchTimer.Reset();
+ }
}
}
mPid = widget_instance_launch( mInstanceId.c_str(), (char *)mContentInfo.c_str(), mWidth, mHeight );
if( mPid < 0)
{
+ if(!mRelaunchTimer)
+ {
+ // Delete WidgetVisual for relaunch widget
+ mResizeRequired = true;
+ RemoveWidgetRenderer();
+ CloseRemoteSurface();
+
+ mRelaunchTimer = Timer::New(RELAUNCH_TIME);
+ mRelaunchTimer.TickSignal().Connect(this, &WidgetView::OnRelaunch);
+ mRelaunchTimer.Start();
+ }
+
ShowLoadingState( false );
ShowRetryState( true );
widget_instance_resize(mInstanceId.c_str(), targetSize.x, targetSize.y);
}
+bool WidgetView::OnRelaunch()
+{
+ DALI_LOG_RELEASE_INFO("OnRelaunch: Try WidgetView Relaunch [%s] [%p]\n", mWidgetId.c_str(), this );
+
+ mPid = widget_instance_launch( mInstanceId.c_str(), (char *)mContentInfo.c_str(), mWidth, mHeight );
+ if(mPid < 0 && mRelaunchTryCount <= RELAUNCH_COUNT_MAX )
+ {
+ DALI_LOG_RELEASE_INFO("OnRelaunch: widget_instance_launch is failed. try again(%d/%d) [%s] [%p]\n", mRelaunchTryCount, RELAUNCH_COUNT_MAX, mWidgetId.c_str(), this );
+ mRelaunchTryCount ++;
+ return true;
+ }
+
+ if(mPid >= 0)
+ {
+
+ DALI_LOG_RELEASE_INFO("OnRelaunch: widget_instance_launch is succesed. [%s] [%p]\n", mWidgetId.c_str(), this );
+ }
+
+ // Reset Relaunch Data
+ mRelaunchTryCount = 0;
+ mRelaunchTimer.Stop();
+ mRelaunchTimer.Reset();
+ return false;
+}
+
WidgetView::WidgetViewAccessible::WidgetViewAccessible(Dali::Actor self)
: ControlAccessible(self)
{
#include <dali/devel-api/adaptor-framework/native-image-source-devel.h>
#include <dali/devel-api/adaptor-framework/proxy-accessible.h>
#include <dali/devel-api/adaptor-framework/window-devel.h>
+#include <dali/public-api/adaptor-framework/timer.h>
#include <dali/public-api/object/property-notification.h>
+
namespace Dali
{
*/
void OnUpdateArea( Dali::PropertyNotification& source );
+ /**
+ * @brief Callback when widgetview need to relaunch
+ */
+ bool OnRelaunch();
+
// Undefined
WidgetView( const WidgetView& );
Vector4 mCornerRadius; /// < Corner radius
float mCornerRadiusPolicy; /// < Corner radius policy
+ // For re-launch widgetviewer
+ Dali::Timer mRelaunchTimer;
+ int mRelaunchTryCount;
+
// Notification for property change confirmation
Dali::PropertyNotification mPositionUpdateNotification;
Dali::PropertyNotification mSizeUpdateNotification;