CHECK_MODULE_AND_SET( CAPI_SYSTEM_SENSOR capi-system-sensor capi_system_sensor_support )
CHECK_MODULE_AND_SET( CAPI_SYSTEM_SYSTEM_SETTINGS capi-system-system-settings [] )
CHECK_MODULE_AND_SET( CAPI_APPFW_APPLICATION capi-appfw-application [] )
+CHECK_MODULE_AND_SET( COMPONENT_BASED_CORE_BASE component-based-core-base [] )
CHECK_MODULE_AND_SET( ELEMENTARY elementary [] )
CHECK_MODULE_AND_SET( BUNDLE bundle [] )
SET( cachePath /home/owner )
ENDIF()
+IF( enable_appfw )
+ ADD_DEFINITIONS( -DUSE_APPFW -DCOMPONENT_APPLICATION_SUPPORT)
+ENDIF()
+
#######################################################
ADD_DEFINITIONS( -DDALI_PROFILE_${enable_profile})
${CAPI_APPFW_WIDGET_BASE_CFLAGS}
${ECORE_IMF_CFLAGS}
${FRIBIDI_CFLAGS}
+ ${COMPONENT_BASED_CORE_BASE_CFLAGS}
)
SET( DALI_LDFLAGS ${DALI_LDFLAGS}
${CAPI_APPFW_WIDGET_BASE_LDFLAGS}
${ECORE_IMF_LDFLAGS}
${FRIBIDI_LDFLAGS}
+ ${COMPONENT_BASED_CORE_BASE_LDFLAGS}
)
ELSE()
SET( DALI_CFLAGS ${DALI_CFLAGS}
${adaptor_trace_tizen_src_files}
)
ENDIF()
+
+IF( COMPONENT_APPLICATION_SUPPORT )
+ SET( SOURCES ${SOURCES}
+ ${adaptor_adaptor_component_application_src_files}
+ )
+ENDIF()
+
${adaptor_trace_tizen_src_files}
)
ENDIF()
+
+IF( COMPONENT_APPLICATION_SUPPORT )
+ SET( SOURCES ${SOURCES}
+ ${adaptor_adaptor_component_application_src_files}
+ )
+ENDIF()
+
)
ENDIF()
+IF( COMPONENT_APPLICATION_SUPPORT )
+ SET( SOURCES ${SOURCES}
+ ${adaptor_adaptor_component_application_src_files}
+ )
+ENDIF()
+
${adaptor_trace_tizen_src_files}
)
ENDIF()
+
+IF( COMPONENT_APPLICATION_SUPPORT )
+ SET( SOURCES ${SOURCES}
+ ${adaptor_adaptor_component_application_src_files}
+ )
+ENDIF()
+
${adaptor_trace_tizen_src_files}
)
ENDIF()
+
+IF( COMPONENT_APPLICATION_SUPPORT )
+ SET( SOURCES ${SOURCES}
+ ${adaptor_adaptor_component_application_src_files}
+ )
+ENDIF()
+
--- /dev/null
+#ifndef DALI_COMPONENT_APPLICATION_H\r
+#define DALI_COMPONENT_APPLICATION_H\r
+\r
+/*\r
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ *\r
+ */\r
+\r
+// INTERNAL INCLUDES\r
+#include <dali/public-api/adaptor-framework/application.h>\r
+\r
+namespace Dali\r
+{\r
+namespace Internal DALI_INTERNAL\r
+{\r
+\r
+namespace Adaptor\r
+{\r
+class ComponentApplication;\r
+}\r
+\r
+}\r
+\r
+/**\r
+ * @brief An ComponentApplication class object should be created by every component-based application\r
+ * that wishes to use Dali.\r
+ *\r
+ * Component application draw multiple UI applications based on frame components.\r
+ * component application can draw multiple UIs in one process.\r
+ *\r
+ * It provides a means for initializing the\r
+ * resources required by the Dali::Core.\r
+ *\r
+ * The ComponentApplication class emits several signals which the user can\r
+ * connect to. The user should not create any Dali objects in the main\r
+ * function and instead should connect to the Init signal of the\r
+ * ComponentApplication and create the Dali Widget object in the connected callback.\r
+ *\r
+ */\r
+class DALI_ADAPTOR_API ComponentApplication : public Application\r
+{\r
+public:\r
+ typedef Signal< Any () > CreateSignalType;\r
+\r
+public:\r
+ /**
+ * @brief This is the constructor for component applications without an argument list.\r
+ * @return A handle to the ComponentApplication\r
+ */\r
+ static ComponentApplication New( );\r
+
+ /**
+ * @brief This is the constructor for component applications.\r
+ *\r
+ * @param[in,out] argc A pointer to the number of arguments
+ * @param[in,out] argv A pointer to the argument list\r
+ * @return A handle to the ComponentApplication\r
+ */\r
+ static ComponentApplication New( int* argc, char **argv[] );\r
+
+ /**
+ * @brief This is the constructor for component applications with a stylesheet\r
+ *\r
+ * @param[in,out] argc A pointer to the number of arguments
+ * @param[in,out] argv A pointer to the argument list\r
+ * @param[in] stylesheet The path to user defined theme file
+ * @return A handle to the ComponentApplication\r
+ */\r
+ static ComponentApplication New( int* argc, char **argv[], const std::string& stylesheet );\r
+\r
+ /**\r
+ * @brief The default constructor.\r
+ */\r
+ ComponentApplication() = default;\r
+\r
+ /**\r
+ * @brief Copy Constructor.\r
+ *\r
+ * @param[in] componentApplication Handle to an object\r
+ */\r
+ ComponentApplication( const ComponentApplication& componentApplication ) = default;\r
+\r
+ /**\r
+ * @brief Assignment operator.\r
+ *\r
+ * @param[in] componentApplication Handle to an object\r
+ * @return A reference to this\r
+ */\r
+ ComponentApplication& operator=( const ComponentApplication& componentApplication ) = default;\r
+\r
+ /**\r
+ * @brief Destructor\r
+ */\r
+ ~ComponentApplication() = default;\r
+\r
+ /**\r
+ * @brief The user should connect to this signal to determine when they should initialize\r
+ * their application.\r
+ * The callback function is called before the main loop of the application starts.\r
+ * @return The signal to connect to\r
+ */\r
+ CreateSignalType& CreateSignal();\r
+\r
+public:\r
+ /// @cond internal\r
+ /**\r
+ * @brief Internal constructor.\r
+ */\r
+ explicit DALI_INTERNAL ComponentApplication(Internal::Adaptor::ComponentApplication* componentApplication);\r
+ /// @endcond\r
+};\r
+} // namespace Dali\r
+\r
+#endif // DALI_COMPONENT_APPLICATION_H\r
+\r
${adaptor_devel_api_dir}/adaptor-framework/key-devel.h
${adaptor_devel_api_dir}/adaptor-framework/thread-settings.h
${adaptor_devel_api_dir}/adaptor-framework/window-devel.h
+ ${adaptor_devel_api_dir}/adaptor-framework/component-application.h
)
${adaptor_devel_api_dir}/text-abstraction/text-renderer.h
${adaptor_devel_api_dir}/text-abstraction/text-renderer-layout-helper.h
)
-
// INTERNAL INCLUDES
#include <dali/internal/system/common/abort-handler.h>
#include <dali/public-api/adaptor-framework/device-status.h>
+#ifdef COMPONENT_APPLICATION_SUPPORT
+#include <dali/devel-api/adaptor-framework/component-application.h>
+#endif
namespace Dali
{
{
NORMAL, ///< normal appFramework
WATCH, ///< watch appFramework
- WIDGET ///< widget appFramework
+ WIDGET, ///< widget appFramework
+ COMPONENT ///< component appFramework
};
/**
* Invoked when the platform surface is destroyed.
*/
virtual void OnSurfaceDestroyed( Any newSurface ) {}
+
+#ifdef COMPONENT_APPLICATION_SUPPORT
+ /**
+ * Invoked when the component application is created.
+ */
+ virtual Any OnCreate() { return nullptr; }
+#endif
};
public:
${adaptor_adaptor_dir}/windows/framework-win.cpp
)
-
+SET( adaptor_adaptor_component_application_src_files
+ ${adaptor_adaptor_dir}/tizen-wayland/component-application.cpp
+ ${adaptor_adaptor_dir}/tizen-wayland/component-application-impl.cpp
+)
--- /dev/null
+/*
+ * Copyright (c) 2020 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 <dali/internal/adaptor/tizen-wayland/component-application-impl.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+ComponentApplicationPtr ComponentApplication::New(
+ int* argc,
+ char **argv[],
+ const std::string& stylesheet,
+ Dali::Application::WINDOW_MODE windowMode)
+{
+ ComponentApplicationPtr application ( new ComponentApplication (argc, argv, stylesheet, windowMode ) );
+ return application;
+}
+
+ComponentApplication::ComponentApplication( int* argc, char** argv[], const std::string& stylesheet, Dali::Application::WINDOW_MODE windowMode )
+: Application(argc, argv, stylesheet, windowMode, PositionSize(), Framework::COMPONENT)
+{
+}
+
+Any ComponentApplication::OnCreate()
+{
+ return mCreateSignal.Emit();
+}
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
--- /dev/null
+#ifndef DALI_INTERNAL_COMPONENT_APPLICATION_H
+#define DALI_INTERNAL_COMPONENT_APPLICATION_H
+
+/*
+ * Copyright (c) 2020 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.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/component-application.h>
+#include <dali/internal/adaptor/common/application-impl.h>
+
+namespace Dali
+{
+class Adaptor;
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+class ComponentApplication;
+typedef IntrusivePtr<ComponentApplication> ComponentApplicationPtr;
+
+/**
+ * Implementation of the ComponentApplication class.
+ */
+class ComponentApplication : public Application
+{
+public:
+ typedef Dali::ComponentApplication::CreateSignalType CreateSignal;
+
+public:
+ /**
+ * Create a new component application
+ * @param[in] argc A pointer to the number of arguments
+ * @param[in] argv A pointer to the argument list
+ * @param[in] stylesheet The path to user defined theme file
+ * @param[in] windowMode A member of WINDOW_MODE
+ * @return A handle to the ComponentApplication
+ */
+ static ComponentApplicationPtr New( int* argc, char **argv[], const std::string& stylesheet, WINDOW_MODE windowMode );
+
+ /**
+ * @brief The default constructor.
+ */
+ ComponentApplication( int* argc, char **argv[], const std::string& stylesheet, WINDOW_MODE windowMode );
+
+ /**
+ * @brief Undefined copy constructor.
+ */
+ ComponentApplication( const ComponentApplication& ) = default;
+
+ /**
+ * @brief Destructor
+ */
+ virtual ~ComponentApplication() = default;
+
+ /**
+ *@brief Undefined assignment operator.
+ */
+ ComponentApplication& operator=( const ComponentApplication& ) = delete;
+
+public: // From Framework::Observer
+ /**
+ * Called when the framework is Component Application Created.
+ */
+ virtual Any OnCreate();
+
+public:
+ CreateSignal mCreateSignal;
+};
+
+inline ComponentApplication& GetImplementation(Dali::ComponentApplication& application)
+{
+ DALI_ASSERT_ALWAYS(application && "application handle is empty");
+
+ BaseObject& handle = application.GetBaseObject();
+
+ return static_cast<Internal::Adaptor::ComponentApplication&>(handle);
+}
+
+inline const ComponentApplication& GetImplementation(const Dali::ComponentApplication& application)
+{
+ DALI_ASSERT_ALWAYS(application && "application handle is empty");
+
+ const BaseObject& handle = application.GetBaseObject();
+
+ return static_cast<const Internal::Adaptor::ComponentApplication&>(handle);
+}
+
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
+#endif
--- /dev/null
+/*
+ * Copyright (c) 2020 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 <dali/devel-api/adaptor-framework/component-application.h>
+
+// INTERNAL INCLUDES
+#include <dali/internal/adaptor/tizen-wayland/component-application-impl.h>
+
+namespace Dali
+{
+
+ComponentApplication ComponentApplication::New()
+{
+ return New( NULL, NULL );
+}
+
+ComponentApplication ComponentApplication::New( int* argc, char **argv[] )
+{
+ return New( argc, argv, "" );
+}
+
+ComponentApplication ComponentApplication::New( int* argc, char **argv[], const std::string& stylesheet )
+{
+ Internal::Adaptor::ComponentApplicationPtr internal = Internal::Adaptor::ComponentApplication::New( argc, argv, stylesheet, TRANSPARENT );
+ return ComponentApplication(internal.Get());
+}
+
+ComponentApplication::CreateSignalType& ComponentApplication::CreateSignal()
+{
+ return Internal::Adaptor::GetImplementation(*this).mCreateSignal;
+}
+
+ComponentApplication::ComponentApplication(Internal::Adaptor::ComponentApplication* implementation)
+: Application(implementation)
+{
+}
+
+} // namespace Dali
#include <tzplatform_config.h>
#endif // TIZEN_PLATFORM_CONFIG_SUPPORTED
+#ifdef COMPONENT_APPLICATION_SUPPORT
+#include <component_based_app_base.h>
+#endif
+
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
int AppMain()
{
int ret;
-
- if (mApplicationType == NORMAL)
- {
- ret = AppNormalMain();
- }
- else if(mApplicationType == WIDGET)
+ switch ( mApplicationType )
{
- ret = AppWidgetMain();
- }
- else
- {
- ret = AppWatchMain();
+ case NORMAL:
+ {
+ ret = AppNormalMain();
+ break;
+ }
+ case WIDGET:
+ {
+ ret = AppWidgetMain();
+ break;
+ }
+ case WATCH:
+ {
+ ret = AppWatchMain();
+ break;
+ }
+#ifdef COMPONENT_APPLICATION_SUPPORT
+ case COMPONENT:
+ {
+ ret = AppComponentMain();
+ break;
+ }
+#endif
}
return ret;
}
void AppExit()
{
- if (mApplicationType == NORMAL)
- {
- AppNormalExit();
- }
- else if(mApplicationType == WIDGET)
+ switch ( mApplicationType )
{
- AppWidgetExit();
- }
- else
- {
- AppWatchExit();
+ case NORMAL:
+ {
+ AppNormalExit();
+ break;
+ }
+ case WIDGET:
+ {
+ AppWidgetExit();
+ break;
+ }
+ case WATCH:
+ {
+ AppWatchExit();
+ break;
+ }
+#ifdef COMPONENT_APPLICATION_SUPPORT
+ case COMPONENT:
+ {
+ AppComponentExit();
+ break;
+ }
+#endif
}
}
#endif
}
+#ifdef COMPONENT_APPLICATION_SUPPORT
+ int AppComponentMain()
+ {
+ int ret;
+
+ /*Crate component_based_app_base_lifecycle_callback*/
+ component_based_app_base_lifecycle_callback_s callback;
+ callback.init = AppInit;
+ callback.run = AppRun;
+ callback.exit = AppExit;
+ callback.create = ComponentAppCreate;
+ callback.terminate = ComponentAppTerminate;
+ callback.fini = ComponentAppFinish;
+
+ return component_based_app_base_main(*mFramework->mArgc, *mFramework->mArgv, &callback, mFramework);;
+ }
+
+ static void* ComponentAppCreate( void *data )
+ {
+ Framework* framework = static_cast<Framework*>(data);
+ Observer *observer = &framework->mObserver;
+ observer->OnInit();
+
+ return Dali::AnyCast<void*>( observer->OnCreate() );
+ }
+
+ static void ComponentAppTerminate( void *data )
+ {
+ Observer *observer = &static_cast<Framework*>(data)->mObserver;
+ observer->OnTerminate();
+ }
+
+ static void ComponentAppFinish( void *data )
+ {
+ ecore_shutdown();
+
+ if(getenv("AUL_LOADER_INIT"))
+ {
+ setenv("AUL_LOADER_INIT", "0", 1);
+ ecore_shutdown();
+ }
+ }
+
+ void AppComponentExit()
+ {
+ component_based_app_base_exit();
+ }
+
+#endif
+
private:
// Undefined
Impl( const Impl& impl );
SET( public_dali_watch_header_files
${adaptor_public_api_dir}/watch/watch-application.h
${adaptor_public_api_dir}/watch/watch-time.h
-)
\ No newline at end of file
+)
# for feedback plugin
BuildRequires: pkgconfig(mm-sound)
BuildRequires: pkgconfig(feedback)
+BuildRequires: pkgconfig(component-based-core-base)
# for multiprofile
Requires: %{name}-compat = %{version}-%{release}
cmake_flags+=" -DENABLE_TRACE=ON"
%endif
-%if 0%{?enable_appfw}
-cmake_flags+=" -DUSE_APPFW"
-%endif
-
libtoolize --force
cd %{_builddir}/%{name}-%{version}/build/tizen
cmake_flags+=" -DENABLE_TIZEN_MAJOR_VERSION=%{tizen_version_major}"
cmake_flags+=" -DENABLE_FEEDBACK=YES"
cmake_flags+=" -DENABLE_APPFW=YES"
+cmake_flags+=" -DCOMPONENT_APPLICATION_SUPPORT=YES"
# Set up the build via Cmake
#######################################################################