// This will trigger OnTerminate(), below, after the main loop has completed.
}
-void Application::OnInit()
+void Application::DoInit()
{
- mFramework->AddAbortCallback( MakeCallback( this, &Application::QuitFromMainLoop ) );
-
CreateWindow();
CreateAdaptor();
// Run the adaptor
mAdaptor->Start();
- // Check if user requires no vsyncing and set on X11 Adaptor
+ // Check if user requires no vsyncing and set Adaptor
if (mCommandLineOptions->noVSyncOnRender)
{
mAdaptor->SetUseHardwareVSync(false);
Dali::StyleMonitor::Get().SetTheme( mStylesheet );
}
+ mAdaptor->NotifySceneCreated();
+}
+
+void Application::DoTerminate()
+{
+ if( mAdaptor )
+ {
+ // Ensure that the render-thread is not using the surface(window) after we delete it
+ mAdaptor->Stop();
+ }
+
+ mWindow.Reset();
+}
+
+void Application::DoPause()
+{
+ mAdaptor->Pause();
+}
+
+void Application::DoResume()
+{
+ mAdaptor->Resume();
+}
+
+void Application::DoLanguageChange()
+{
+ mAdaptor->NotifyLanguageChanged();
+}
+
+void Application::OnInit()
+{
+ mFramework->AddAbortCallback( MakeCallback( this, &Application::QuitFromMainLoop ) );
+
+ DoInit();
+
// Wire up the LifecycleController
Dali::LifecycleController lifecycleController = Dali::LifecycleController::Get();
Dali::Application application(this);
mInitSignal.Emit( application );
-
- mAdaptor->NotifySceneCreated();
}
void Application::OnTerminate()
Dali::Application application(this);
mTerminateSignal.Emit( application );
- if( mAdaptor )
- {
- // Ensure that the render-thread is not using the surface(window) after we delete it
- mAdaptor->Stop();
- }
-
- mWindow.Reset();
+ DoTerminate();
}
void Application::OnPause()
{
- mAdaptor->Pause();
+ DoPause();
Dali::Application application(this);
mPauseSignal.Emit( application );
}
// This ensures we do not just redraw the last frame before pausing if that's not required
Dali::Application application(this);
mResumeSignal.Emit( application );
- mAdaptor->Resume();
+ DoResume();
}
void Application::OnReset()
void Application::OnLanguageChanged()
{
- mAdaptor->NotifyLanguageChanged();
+ DoLanguageChange();
Dali::Application application(this);
mLanguageChangedSignal.Emit( application );
}
*/
float GetStereoBase() const;
+public: // Lifecycle functionality
+
+ /**
+ * Called when OnInit is called or the framework is initialised.
+ */
+ void DoInit();
+
+ /**
+ * Called when OnTerminate is called or the framework is terminated.
+ */
+ void DoTerminate();
+
+ /**
+ * Called when OnPause is called or the framework is paused.
+ */
+ void DoPause();
+
+ /**
+ * Called when OnResume is called or the framework resumes from a paused state.
+ */
+ void DoResume();
+
+ /**
+ * Called when OnLanguageChanged is called or the framework informs the application that the language of the device has changed.
+ */
+ void DoLanguageChange();
+
public: // From Framework::Observer
/**
--- /dev/null
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include "application-extensions.h"
+
+// EXTERNAL INCLUDES
+#include <dali/integration-api/debug.h>
+
+// INTERNAL INCLUDES
+#include <application-impl.h>
+#include <application.h>
+
+namespace Dali
+{
+
+ApplicationExtensions::ApplicationExtensions()
+{
+}
+
+ApplicationExtensions::ApplicationExtensions(Dali::Application* application)
+: mApplication( application )
+{
+}
+
+ApplicationExtensions::~ApplicationExtensions()
+{
+}
+
+void ApplicationExtensions::Init()
+{
+ Internal::Adaptor::GetImplementation(*mApplication).DoInit();
+}
+
+void ApplicationExtensions::Terminate()
+{
+ Internal::Adaptor::GetImplementation(*mApplication).DoTerminate();
+}
+
+void ApplicationExtensions::Pause()
+{
+ Internal::Adaptor::GetImplementation(*mApplication).DoPause();
+}
+
+void ApplicationExtensions::Resume()
+{
+ Internal::Adaptor::GetImplementation(*mApplication).DoResume();
+}
+
+void ApplicationExtensions::LanguageChange()
+{
+ Internal::Adaptor::GetImplementation(*mApplication).DoLanguageChange();
+}
+} // namespace Dali
--- /dev/null
+#ifndef __DALI_APPLICATION_EXTENSIONS_H__
+#define __DALI_APPLICATION_EXTENSIONS_H__
+
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/common/dali-common.h>
+
+namespace Dali
+{
+class Application;
+
+/**
+ * @brief An Application extension class object should be created by DaliApplication.
+ *
+ * It provides some extension methods to DaliApplication.
+ *
+ */
+class DALI_IMPORT_API ApplicationExtensions
+{
+public:
+
+ /**
+ * @brief The default constructor.
+ *
+ */
+ ApplicationExtensions();
+
+ /**
+ * @brief The constructor accept an instance of Dali::Application.
+ *
+ * This can be initialized by new keyword.
+ */
+ ApplicationExtensions(Dali::Application* application);
+
+ /**
+ * @brief Destructor
+ *
+ */
+ ~ApplicationExtensions();
+
+
+ /**
+ * @brief Called wwhen the framework is initialised.
+ * @SINCE_1_2.7
+ */
+ void Init();
+
+ /**
+ * @brief Called when the framework is terminated.
+ * @SINCE_1_2.7
+ */
+ void Terminate();
+
+ /**
+ * @brief Called when the framework is paused.
+ * @SINCE_1_2.7
+ */
+ void Pause();
+
+ /**
+ * @brief Called when the framework resumes from a paused state.
+ * @SINCE_1_2.7
+ */
+ void Resume();
+
+ /**
+ * @brief Called when the framework informs the application that the language of the device has changed.
+ * @SINCE_1_2.7
+ */
+ void LanguageChange();
+
+private:
+ Dali::Application* mApplication;
+};
+
+} // namespace Dali
+
+#endif // ___DALI_APPLICATION_EXTENSIONS_H__
devel_api_src_files = \
$(adaptor_devel_api_dir)/adaptor-framework/accessibility-adaptor.cpp \
+ $(adaptor_devel_api_dir)/adaptor-framework/application-extensions.cpp \
$(adaptor_devel_api_dir)/adaptor-framework/bitmap-loader.cpp \
$(adaptor_devel_api_dir)/adaptor-framework/bitmap-saver.cpp \
$(adaptor_devel_api_dir)/adaptor-framework/clipboard.cpp \
$(adaptor_devel_api_dir)/adaptor-framework/accessibility-adaptor.h \
$(adaptor_devel_api_dir)/adaptor-framework/accessibility-action-handler.h \
$(adaptor_devel_api_dir)/adaptor-framework/accessibility-gesture-handler.h \
+ $(adaptor_devel_api_dir)/adaptor-framework/application-extensions.h \
$(adaptor_devel_api_dir)/adaptor-framework/bitmap-loader.h \
$(adaptor_devel_api_dir)/adaptor-framework/bitmap-saver.h \
$(adaptor_devel_api_dir)/adaptor-framework/clipboard-event-notifier.h \