Add SetCommandLineOptions() for pre-initialzed application 53/195653/13
authorhuiyu.eun <huiyu.eun@samsung.com>
Mon, 17 Dec 2018 05:21:47 +0000 (14:21 +0900)
committerhuiyu eun <huiyu.eun@samsung.com>
Mon, 24 Jun 2019 01:39:13 +0000 (01:39 +0000)
Add SetCommandLineOptions() for pre-initialzed application

Change-Id: I822f95927d0543104c924c452742372d1c52f0aa
Signed-off-by: huiyu.eun <huiyu.eun@samsung.com>
dali/internal/adaptor/common/application-impl.cpp
dali/internal/adaptor/common/application-impl.h
dali/internal/adaptor/common/framework.h
dali/public-api/adaptor-framework/application.cpp

index 2a7fc31..a446635 100755 (executable)
@@ -442,6 +442,15 @@ void Application::SetStyleSheet( const std::string& stylesheet )
   mStylesheet = stylesheet;
 }
 
+void Application::SetCommandLineOptions( int* argc, char **argv[] )
+{
+  delete mCommandLineOptions;
+
+  mCommandLineOptions = new CommandLineOptions( argc, argv );
+
+  mFramework->SetCommandLineOptions( argc, argv );
+}
+
 ApplicationPtr Application::GetPreInitializedApplication()
 {
   return gPreInitializedApplication;
index b56814d..63bd089 100755 (executable)
@@ -248,6 +248,14 @@ public:
    */
   void SetStyleSheet( const std::string& stylesheet );
 
+  /**
+   * Sets a command line options.
+   * This is used in case of the preinitialized application.
+   * @param[in] argc A pointer to the number of arguments
+   * @param[in] argv A pointer to the argument list
+   */
+  void SetCommandLineOptions( int* argc, char **argv[] );
+
 public:  // Signals
 
   /**
index 0a53f75..9ac3303 100644 (file)
@@ -186,6 +186,19 @@ public:
   std::string GetBundleId() const;
 
   /**
+   * Sets a command line options.
+   * This is used in case of the preinitialized application.
+   * @param[in] argc A pointer to the number of arguments
+   * @param[in] argv A pointer to the argument list
+   */
+  void SetCommandLineOptions( int* argc, char **argv[] )
+  {
+    mArgc = argc;
+    mArgv = argv;
+  }
+
+
+  /**
    *  Gets the path at which application resources are stored.
    */
   static std::string GetResourcePath();
index 676d658..8aa2318 100644 (file)
@@ -37,6 +37,8 @@ Application Application::New( int* argc, char **argv[] )
   Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::GetPreInitializedApplication();
   if( internal )
   {
+    // pre-initialized application
+    internal->SetCommandLineOptions( argc, argv );
     if( argc && ( *argc > 0 ) )
     {
       internal->GetWindow().SetClass( (*argv)[0], "" );
@@ -57,6 +59,8 @@ Application Application::New( int* argc, char **argv[], const std::string& style
   Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::GetPreInitializedApplication();
   if( internal )
   {
+    // pre-initialized application
+    internal->SetCommandLineOptions( argc, argv );
     if( argc && ( *argc > 0 ) )
     {
       internal->GetWindow().SetClass( (*argv)[0], "" );
@@ -78,6 +82,8 @@ Application Application::New( int* argc, char **argv[], const std::string& style
   Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::GetPreInitializedApplication();
   if( internal )
   {
+    // pre-initialized application
+    internal->SetCommandLineOptions( argc, argv );
     if( argc && ( *argc > 0 ) )
     {
       internal->GetWindow().SetClass( (*argv)[0], "" );
@@ -101,6 +107,8 @@ Application Application::New( int* argc, char **argv[], const std::string& style
   Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::GetPreInitializedApplication();
   if( internal )
   {
+    // pre-initialized application
+    internal->SetCommandLineOptions( argc, argv );
     if( argc && ( *argc > 0 ) )
     {
       internal->GetWindow().SetClass( (*argv)[0], "" );