Revert "[Tizen] Add GetFrameworkContext to OffscreenApplication"
authorseungho baek <sbsh.baek@samsung.com>
Tue, 18 Jul 2023 09:00:58 +0000 (18:00 +0900)
committerseungho baek <sbsh.baek@samsung.com>
Tue, 18 Jul 2023 09:00:58 +0000 (18:00 +0900)
This reverts commit 61a515f95c98c8dd69571b21ec16db1130558301.

dali/devel-api/adaptor-framework/offscreen-application.cpp
dali/devel-api/adaptor-framework/offscreen-application.h
dali/internal/adaptor/common/framework.cpp
dali/internal/adaptor/common/framework.h
dali/internal/adaptor/glib/framework-glib.cpp
dali/internal/adaptor/glib/framework-glib.h
dali/internal/offscreen/common/offscreen-application-impl.cpp
dali/internal/offscreen/common/offscreen-application-impl.h

index e6b4aae..0ad6713 100644 (file)
@@ -70,11 +70,6 @@ void OffscreenApplication::RenderOnce()
   Internal::GetImplementation(*this).RenderOnce();
 }
 
-Any OffscreenApplication::GetFrameworkContext() const
-{
-  return Internal::GetImplementation(*this).GetFrameworkContext();
-}
-
 OffscreenApplication::OffscreenApplicationSignalType& OffscreenApplication::InitSignal()
 {
   return Internal::GetImplementation(*this).InitSignal();
index f31cd2d..d7b6249 100644 (file)
@@ -124,12 +124,6 @@ public:
    */
   void RenderOnce();
 
-  /**
-   * @brief Gets the context of the framwork
-   * @return Platform dependent context handle
-   */
-  Any GetFrameworkContext() const;
-
 public: // Signals
         /**
    * @brief Signal to notify the client when the application is ready to be initialized
index e9837f9..b53319d 100644 (file)
@@ -53,11 +53,6 @@ std::string Framework::GetRegion() const
   return NOT_SUPPORTED;
 }
 
-Any Framework::GetMainLoopContext() const
-{
-  return nullptr;
-}
-
 bool Framework::IsMainLoopRunning()
 {
   return mRunning;
index ad89efe..0f64fc5 100644 (file)
@@ -300,12 +300,6 @@ public:
   virtual std::string GetRegion() const;
 
   /**
-   * Gets the context of the main loop
-   * @return Platform dependent context handle
-   */
-  virtual Any GetMainLoopContext() const;
-
-  /**
    * Checks whether the main loop of the framework is running.
    * @return true, if the main loop is running, false otherwise.
    */
index dbcbbfc..5123131 100644 (file)
@@ -28,11 +28,15 @@ namespace Internal
 {
 namespace Adaptor
 {
-thread_local GMainContext* gContext{nullptr};
+thread_local GMainLoop* gMainLoop{nullptr};
 
 GMainContext* GetMainLoopContext()
 {
-  return gContext;
+  if(gMainLoop != nullptr)
+  {
+    return g_main_loop_get_context(gMainLoop);
+  }
+  return nullptr;
 }
 
 /**
@@ -43,16 +47,14 @@ struct FrameworkGlib::Impl
   // Constructor
   Impl(void* data)
   {
-    gContext = mContext = g_main_context_new();
-    mMainLoop           = g_main_loop_new(mContext, false);
+    GMainContext* context = g_main_context_new();
+    gMainLoop = mMainLoop = g_main_loop_new(context, false);
   }
 
   ~Impl()
   {
     g_main_loop_unref(mMainLoop);
-    g_main_context_unref(mContext);
-
-    gContext = nullptr;
+    gMainLoop = nullptr;
   }
 
   void Run()
@@ -106,11 +108,6 @@ void FrameworkGlib::Quit()
   mImpl->Quit();
 }
 
-Any FrameworkGlib::GetMainLoopContext() const
-{
-  return mImpl->mContext;
-}
-
 } // namespace Adaptor
 
 } // namespace Internal
index b3e51d8..da44e6c 100644 (file)
@@ -53,11 +53,6 @@ public:
    */
   void Quit() override;
 
-  /**
-   * @copydoc Dali::Internal::Adaptor::Framework::GetMainLoopContext()
-   */
-  Any GetMainLoopContext() const override;
-
 private:
   // Undefined
   FrameworkGlib(const FrameworkGlib&) = delete;
index 3676131..394b637 100644 (file)
@@ -89,11 +89,6 @@ void OffscreenApplication::RenderOnce()
   mAdaptor->RenderOnce();
 }
 
-Any OffscreenApplication::GetFrameworkContext() const
-{
-  return mFramework->GetMainLoopContext();
-}
-
 void OffscreenApplication::OnInit()
 {
   // Start the adaptor
index b049c13..48dc0e3 100644 (file)
@@ -79,11 +79,6 @@ public:
    */
   void RenderOnce();
 
-  /**
-   * @copydoc Dali::OffscreenApplication::GetFrameworkContext()
-   */
-  Any GetFrameworkContext() const;
-
 public: // Signals
   /**
    * @copydoc Dali::OffscreenApplication::InitSignal()