namespace Adaptor
{
+ApplicationPtr Application::gPreInitializedApplication( NULL );
+
ApplicationPtr Application::New(
int* argc,
char **argv[],
return application;
}
+void Application::PreInitialize( int* argc, char** argv[] )
+{
+ if( !gPreInitializedApplication )
+ {
+ gPreInitializedApplication = new Application ( argc, argv, "", Dali::Application::OPAQUE, PositionSize(), Framework::NORMAL );
+
+ gPreInitializedApplication->CreateWindow(); // Only create window
+
+ gPreInitializedApplication->mLaunchpadState = Launchpad::PRE_INITIALIZED;
+ }
+}
+
Application::Application( int* argc, char** argv[], const std::string& stylesheet,
Dali::Application::WINDOW_MODE windowMode, const PositionSize& positionSize, Framework::Type applicationType )
: mInitSignal(),
mStylesheet( stylesheet ),
mEnvironmentOptions(),
mWindowPositionSize( positionSize ),
+ mLaunchpadState( Launchpad::NONE ),
mSlotDelegate( this )
{
// Get mName from environment options
void Application::DoInit()
{
- CreateWindow();
+ // If an application was pre-initialized, a window was made in advance
+ if( mLaunchpadState == Launchpad::NONE )
+ {
+ CreateWindow();
+ }
+
CreateAdaptor();
// Run the adaptor
Dali::RenderSurface* renderSurface = windowImpl.GetSurface();
Any nativeWindow = newWindow.GetNativeHandle();
- Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).SurfaceSizeChanged( Dali::Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).ReplaceSurface(nativeWindow, *renderSurface);
mWindow = newWindow;
mWindowPositionSize = positionSize;
return Internal::Adaptor::Framework::GetResourcePath();
}
+void Application::SetStyleSheet( const std::string& stylesheet )
+{
+ mStylesheet = stylesheet;
+}
+
+
+ApplicationPtr Application::GetPreInitializedApplication()
+{
+ return gPreInitializedApplication;
+}
+
} // namespace Adaptor
} // namespace Internal