From dc79e57a67058fd3f1ee2d69f1bc22a317e0cbf8 Mon Sep 17 00:00:00 2001 From: "minho.sun" Date: Tue, 28 Nov 2017 15:58:46 +0900 Subject: [PATCH] Revert "[4.0] Create Widget Application" This reverts commit 76413a3e89470edbb9680ecd9781f0f4033ab076. Change-Id: Ide998f7ec8fb340528d6705ab78bed205e97a7a1 --- adaptors/common/adaptor-impl.cpp | 13 - adaptors/common/adaptor-impl.h | 12 - adaptors/common/adaptor.cpp | 5 - adaptors/common/file.list | 4 - adaptors/common/framework.h | 5 +- adaptors/common/widget-application-impl.cpp | 244 ------------------- adaptors/common/widget-application-impl.h | 267 --------------------- adaptors/common/widget-impl.cpp | 207 ---------------- adaptors/common/widget-impl.h | 150 ------------ .../adaptor-framework/widget-application.cpp | 118 --------- .../adaptor-framework/widget-application.h | 232 ------------------ adaptors/devel-api/adaptor-framework/widget.cpp | 92 ------- adaptors/devel-api/adaptor-framework/widget.h | 205 ---------------- adaptors/devel-api/file.list | 7 - adaptors/integration-api/adaptor.h | 7 - adaptors/tizen/framework-tizen.cpp | 88 +------ build/tizen/adaptor/Makefile.am | 31 +-- build/tizen/adaptor/configure.ac | 3 - packaging/dali-adaptor.spec | 2 - 19 files changed, 8 insertions(+), 1684 deletions(-) delete mode 100644 adaptors/common/widget-application-impl.cpp delete mode 100644 adaptors/common/widget-application-impl.h delete mode 100644 adaptors/common/widget-impl.cpp delete mode 100644 adaptors/common/widget-impl.h delete mode 100644 adaptors/devel-api/adaptor-framework/widget-application.cpp delete mode 100644 adaptors/devel-api/adaptor-framework/widget-application.h delete mode 100644 adaptors/devel-api/adaptor-framework/widget.cpp delete mode 100644 adaptors/devel-api/adaptor-framework/widget.h diff --git a/adaptors/common/adaptor-impl.cpp b/adaptors/common/adaptor-impl.cpp index a3d7ea4..ff2479b 100644 --- a/adaptors/common/adaptor-impl.cpp +++ b/adaptors/common/adaptor-impl.cpp @@ -93,8 +93,6 @@ Dali::Adaptor* Adaptor::New( Dali::Window window, Dali::Configuration::ContextLo Window& windowImpl = Dali::GetImplementation(window); Dali::Adaptor* adaptor = New( winId, windowImpl.GetSurface(), configuration, environmentOptions ); - - Internal::Adaptor::Adaptor::GetImplementation( *adaptor ).SetWindow( window ); windowImpl.SetAdaptor(*adaptor); return adaptor; } @@ -866,7 +864,6 @@ Adaptor::Adaptor(Any nativeWindow, Dali::Adaptor& adaptor, RenderSurface* surfac mTriggerEventFactory(), mObjectProfiler( NULL ), mSocketFactory(), - mWindow(), mEnvironmentOptionsOwned( environmentOptions ? false : true /* If not provided then we own the object */ ), mUseRemoteSurface( false ) { @@ -905,16 +902,6 @@ void Adaptor::SetRootLayoutDirection( std::string locale ) static_cast< LayoutDirection::Type >( Internal::Adaptor::Locale::GetDirection( std::string( locale ) ) ) ); } -void Adaptor::SetWindow( Dali::Window window ) -{ - mWindow = window; -} - -Dali::Window Adaptor::GetWindow() -{ - return mWindow; -} - } // namespace Adaptor } // namespace Internal diff --git a/adaptors/common/adaptor-impl.h b/adaptors/common/adaptor-impl.h index c343cc5..31c577b 100644 --- a/adaptors/common/adaptor-impl.h +++ b/adaptors/common/adaptor-impl.h @@ -27,7 +27,6 @@ #include // INTERNAL INCLUDES -#include #include #include #include @@ -439,16 +438,6 @@ public: // Stereoscopy */ float GetStereoBase() const; - /** - * Set Window handle. - */ - void SetWindow( Dali::Window window ); - - /** - * Return Window handle. - */ - Dali::Window GetWindow(); - public: // Signals /** @@ -607,7 +596,6 @@ private: // Data TriggerEventFactory mTriggerEventFactory; ///< Trigger event factory ObjectProfiler* mObjectProfiler; ///< Tracks object lifetime for profiling SocketFactory mSocketFactory; ///< Socket factory - Dali::Window mWindow; ///< Window handle const bool mEnvironmentOptionsOwned:1; ///< Whether we own the EnvironmentOptions (and thus, need to delete it) bool mUseRemoteSurface; ///< whether the remoteSurface is used or not public: diff --git a/adaptors/common/adaptor.cpp b/adaptors/common/adaptor.cpp index 165d039..c6cc3fa 100644 --- a/adaptors/common/adaptor.cpp +++ b/adaptors/common/adaptor.cpp @@ -114,11 +114,6 @@ Any Adaptor::GetNativeWindowHandle() return mImpl->GetNativeWindowHandle(); } -Window Adaptor::GetWindow() -{ - return mImpl->GetWindow(); -} - void Adaptor::ReleaseSurfaceLock() { mImpl->ReleaseSurfaceLock(); diff --git a/adaptors/common/file.list b/adaptors/common/file.list index 944b7db..37faef3 100644 --- a/adaptors/common/file.list +++ b/adaptors/common/file.list @@ -59,7 +59,3 @@ adaptor_common_internal_default_profile_src_files = \ adaptor_common_internal_egl_extension_src_files = \ $(adaptor_common_dir)/gl/egl-image-extensions.cpp - -adaptor_internal_widget_src_files = \ - $(adaptor_common_dir)/widget-impl.cpp \ - $(adaptor_common_dir)/widget-application-impl.cpp diff --git a/adaptors/common/framework.h b/adaptors/common/framework.h index a8b01f2..6b5965a 100644 --- a/adaptors/common/framework.h +++ b/adaptors/common/framework.h @@ -52,9 +52,8 @@ public: enum Type { - NORMAL, ///< normal appFramework - WATCH, ///< watch appFramework - WIDGET, ///< widget appFramework + NORMAL, ///< normal appFramework + WATCH ///< watch appFramework }; /** diff --git a/adaptors/common/widget-application-impl.cpp b/adaptors/common/widget-application-impl.cpp deleted file mode 100644 index 86fa034..0000000 --- a/adaptors/common/widget-application-impl.cpp +++ /dev/null @@ -1,244 +0,0 @@ -/* - * Copyright (c) 2017 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 "widget-application-impl.h" - -// EXTERNAL INCLUDES -#include - -// INTERNAL INCLUDES -#include -#include -#include -#include -#include -#include - -namespace Dali -{ - -namespace TizenPlatform -{ -class TizenPlatformAbstraction; -} - -namespace Integration -{ -class Core; -} - -namespace Internal -{ - -namespace Adaptor -{ - -WidgetApplicationPtr WidgetApplication::New( - int* argc, - char **argv[], - const std::string& stylesheet) -{ - WidgetApplicationPtr widgetApplication( new WidgetApplication (argc, argv, stylesheet ) ); - return widgetApplication; -} - -WidgetApplication::WidgetApplication( int* argc, char** argv[], const std::string& stylesheet ) -: mInitSignal(), - mTerminateSignal(), - mLanguageChangedSignal(), - mRegionChangedSignal(), - mLowBatterySignal(), - mLowMemorySignal(), - mFramework( NULL ), - mContextLossConfiguration( Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS ), - mCommandLineOptions( NULL ), - mSingletonService( SingletonService::New() ), - mAdaptor( NULL ), - mName(), - mStylesheet( stylesheet ), - mEnvironmentOptions(), - mSlotDelegate( this ) -{ - // Get mName from environment options - mName = mEnvironmentOptions.GetWindowName(); - if( mName.empty() && argc && ( *argc > 0 ) ) - { - // Set mName from command-line args if environment option not set - mName = (*argv)[0]; - } - - mCommandLineOptions = new CommandLineOptions(argc, argv); - mFramework = new Framework( *this, argc, argv, Framework::WIDGET ); -} - -WidgetApplication::~WidgetApplication() -{ - mSingletonService.UnregisterAll(); - - delete mAdaptor; - delete mCommandLineOptions; - delete mFramework; -} - -void WidgetApplication::CreateAdaptor() -{ - mAdaptor = Dali::Internal::Adaptor::Adaptor::New( mWindow, mContextLossConfiguration, &mEnvironmentOptions ); - - Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).SetUseRemoteSurface( true ); -} - -void WidgetApplication::MainLoop() -{ - // Run the application - mFramework->Run(); -} - -void WidgetApplication::Quit() -{ - // Actually quit the application. - AddIdle( MakeCallback( this, &WidgetApplication::QuitFromMainLoop ) ); -} - -void WidgetApplication::QuitFromMainLoop() -{ - mAdaptor->Stop(); - - mFramework->Quit(); - // This will trigger OnTerminate(), below, after the main loop has completed. -} - -void WidgetApplication::DoInit() -{ - mWindow = Dali::Window::New( PositionSize(), "", mEnvironmentOptions.GetWindowClassName(), 1 ); - // Quit the application when the window is closed - mWindow.ShowIndicator(Dali::Window::IndicatorVisibleMode::INVISIBLE); - GetImplementation( mWindow ).DeleteRequestSignal().Connect( mSlotDelegate, &WidgetApplication::Quit ); - - CreateAdaptor(); - // Run the adaptor - mAdaptor->Start(); - - // Check if user requires no vsyncing and set Adaptor - if (mCommandLineOptions->noVSyncOnRender) - { - mAdaptor->SetUseHardwareVSync(false); - } - - Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).SetStereoBase( mCommandLineOptions->stereoBase ); - - if( ! mStylesheet.empty() ) - { - Dali::StyleMonitor::Get().SetTheme( mStylesheet ); - } -} - -void WidgetApplication::DoStart() -{ - mAdaptor->NotifySceneCreated(); -} - -void WidgetApplication::DoTerminate() -{ - if( mAdaptor ) - { - // Ensure that the render-thread is not using the surface(window) after we delete it - mAdaptor->Stop(); - } - - mWindow.Reset(); -} - -void WidgetApplication::DoLanguageChange() -{ - mAdaptor->NotifyLanguageChanged(); -} - -void WidgetApplication::OnInit() -{ - mFramework->AddAbortCallback( MakeCallback( this, &WidgetApplication::QuitFromMainLoop ) ); - DoInit(); - - Dali::WidgetApplication widgetApplication(this); - mInitSignal.Emit( widgetApplication ); - - DoStart(); -} - -void WidgetApplication::OnTerminate() -{ - Dali::WidgetApplication widgetApplication(this); - mTerminateSignal.Emit( widgetApplication ); - - DoTerminate(); -} - -void WidgetApplication::OnLanguageChanged() -{ - DoLanguageChange(); - Dali::WidgetApplication widgetApplication(this); - mLanguageChangedSignal.Emit( widgetApplication ); -} - -void WidgetApplication::OnRegionChanged() -{ - Dali::WidgetApplication widgetApplication(this); - mRegionChangedSignal.Emit( widgetApplication ); -} - -void WidgetApplication::OnBatteryLow( Dali::DeviceStatus::Battery::Status status ) -{ - Dali::WidgetApplication widgetApplication(this); - mLowBatterySignal.Emit( status ); -} - -void WidgetApplication::OnMemoryLow( Dali::DeviceStatus::Memory::Status status ) -{ - Dali::WidgetApplication widgetApplication(this); - mLowMemorySignal.Emit( status ); -} - -bool WidgetApplication::AddIdle( CallbackBase* callback ) -{ - return mAdaptor->AddIdle( callback ); -} - -Dali::Adaptor& WidgetApplication::GetAdaptor() -{ - return *mAdaptor; -} - -std::string WidgetApplication::GetResourcePath() -{ - return Internal::Adaptor::Framework::GetResourcePath(); -} - -std::string WidgetApplication::GetRegion() -{ - return mFramework->GetRegion(); -} - -std::string WidgetApplication::GetLanguage() -{ - return mFramework->GetLanguage(); -} - -} // namespace Adaptor - -} // namespace Internal - -} // namespace Dali diff --git a/adaptors/common/widget-application-impl.h b/adaptors/common/widget-application-impl.h deleted file mode 100644 index 6f53534..0000000 --- a/adaptors/common/widget-application-impl.h +++ /dev/null @@ -1,267 +0,0 @@ -#ifndef __DALI_INTERNAL_WIDGET_APPLICATION_H__ -#define __DALI_INTERNAL_WIDGET_APPLICATION_H__ - -/* - * Copyright (c) 2017 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 -#include -#include - -// INTERNAL INCLUDES -#include -#include - -#include -#include -#include - -namespace Dali -{ -class Adaptor; - -namespace Internal -{ - -namespace Adaptor -{ -class CommandLineOptions; -class EventLoop; - -class WidgetApplication; -typedef IntrusivePtr WidgetApplicationPtr; - -/** - * Implementation of the WidgetApplication class. - */ -class WidgetApplication : public BaseObject, public Framework::Observer -{ -public: - typedef Dali::WidgetApplication::AppSignalType AppSignalType; - typedef Dali::WidgetApplication::LowBatterySignalType LowBatterySignalType; - typedef Dali::WidgetApplication::LowMemorySignalType LowMemorySignalType; - - /** - * Create a new widget 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 - */ - static WidgetApplicationPtr New( int* argc, char **argv[], const std::string& stylesheet ); - -public: - - /** - * @copydoc Dali::WidgetApplication::MainLoop() - */ - void MainLoop(); - - /** - * @copydoc Dali::WidgetApplication::Quit() - */ - void Quit(); - - /** - * @copydoc Dali::WidgetApplication::GetAdaptor(); - */ - Dali::Adaptor& GetAdaptor(); - - /** - * @copydoc Dali::WidgetApplication::GetResourcePath(); - */ - static std::string GetResourcePath(); - - /** - * @copydoc Dali::WidgetApplication::GetRegion(); - */ - std::string GetRegion(); - - /** - * @copydoc Dali::WidgetApplication::GetLanguage(); - */ - std::string GetLanguage(); - -public: // Lifecycle functionality - - /** - * Called when OnInit is called or the framework is initialised. - */ - void DoInit(); - - /** - * Called after OnInit is called or the framework is started. - */ - void DoStart(); - - /** - * Called when OnTerminate is called or the framework is terminated. - */ - void DoTerminate(); - - /** - * 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 - - /** - * Called when the framework is initialised. - */ - virtual void OnInit(); - - /** - * Called when the framework is terminated. - */ - virtual void OnTerminate(); - - /** - * Called when the framework informs the application that the language of the device has changed. - */ - virtual void OnLanguageChanged(); - - /** - * Called when the framework informs the application that the region of the device has changed. - */ - virtual void OnRegionChanged(); - - /** - * Called when the framework informs the application that the battery level of the device is low. - */ - virtual void OnBatteryLow( Dali::DeviceStatus::Battery::Status status ); - - /** - * Called when the framework informs the application that the memory level of the device is low. - */ - virtual void OnMemoryLow( Dali::DeviceStatus::Memory::Status status ); - -public: // Signals - - /** - * @copydoc Dali::WidgetApplication::InitSignal() - */ - Dali::WidgetApplication::AppSignalType& InitSignal() { return mInitSignal; } - - /** - * @copydoc Dali::WidgetApplication::TerminateSignal() - */ - Dali::WidgetApplication::AppSignalType& TerminateSignal() { return mTerminateSignal; } - - /** - * @copydoc Dali::WidgetApplication::LanguageChangedSignal() - */ - Dali::WidgetApplication::AppSignalType& LanguageChangedSignal() { return mLanguageChangedSignal; } - - /** - * @copydoc Dali::WidgetApplication::RegionChangedSignal() - */ - Dali::WidgetApplication::AppSignalType& RegionChangedSignal() { return mRegionChangedSignal; } - - /** - * @copydoc Dali::WidgetApplication::LowBatterySignal() - */ - Dali::WidgetApplication::LowBatterySignalType& LowBatterySignal() { return mLowBatterySignal; } - - /** - * @copydoc Dali::WidgetApplication::LowMemorySignal() - */ - Dali::WidgetApplication::LowMemorySignalType& LowMemorySignal() { return mLowMemorySignal; } - -protected: - - /** - * Private Constructor - * @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 - */ - WidgetApplication( int* argc, char **argv[], const std::string& stylesheet ); - - /** - * Destructor - */ - virtual ~WidgetApplication(); - - // Undefined - WidgetApplication(const Application&); - WidgetApplication& operator=(Application&); - - /** - * Creates the adaptor - */ - void CreateAdaptor(); - - /** - * Quits from the main loop - */ - void QuitFromMainLoop(); - - /** - * Add idle - */ - bool AddIdle( CallbackBase* callback ); - -private: - - AppSignalType mInitSignal; - AppSignalType mTerminateSignal; - AppSignalType mLanguageChangedSignal; - AppSignalType mRegionChangedSignal; - LowBatterySignalType mLowBatterySignal; - LowMemorySignalType mLowMemorySignal; - - Framework* mFramework; - - Dali::Configuration::ContextLoss mContextLossConfiguration; - CommandLineOptions* mCommandLineOptions; - - Dali::SingletonService mSingletonService; - Dali::Adaptor* mAdaptor; - Dali::Window mWindow; - std::string mName; - std::string mStylesheet; - EnvironmentOptions mEnvironmentOptions; - - SlotDelegate< WidgetApplication > mSlotDelegate; -}; - -inline WidgetApplication& GetImplementation(Dali::WidgetApplication& widgetApplication) -{ - DALI_ASSERT_ALWAYS(widgetApplication && "widget application handle is empty"); - - BaseObject& handle = widgetApplication.GetBaseObject(); - - return static_cast(handle); -} - -inline const WidgetApplication& GetImplementation(const Dali::WidgetApplication& widgetApplication) -{ - DALI_ASSERT_ALWAYS(widgetApplication && "widget application handle is empty"); - - const BaseObject& handle = widgetApplication.GetBaseObject(); - - return static_cast(handle); -} - -} // namespace Adaptor - -} // namespace Internal - -} // namespace Dali - -#endif // __DALI_INTERNAL_WIDGET_APPLICATION_H__ diff --git a/adaptors/common/widget-impl.cpp b/adaptors/common/widget-impl.cpp deleted file mode 100644 index 239c4f1..0000000 --- a/adaptors/common/widget-impl.cpp +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Copyright (c) 2014 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 "widget-impl.h" - -// EXTERNAL INCLUDES -#include -#include - -#include -#include - -// INTERNAL INCLUDES -#include - -namespace Dali -{ -namespace Internal -{ - -namespace Adaptor -{ - -namespace -{ - -static bool IsWidgetFeatureEnabled() -{ - static bool feature = false; - static bool retrieved = false; - int ret; - - if(retrieved == true) - return feature; - - ret = system_info_get_platform_bool("http://tizen.org/feature/shell.appwidget", &feature); - if(ret != SYSTEM_INFO_ERROR_NONE) - { - DALI_LOG_ERROR("failed to get system info\n"); /* LCOV_EXCL_LINE */ - return false; /* LCOV_EXCL_LINE */ - } - - retrieved = true; - - return feature; -} - -} // anonymous namespace - -Dali::Widget Widget::New( const std::string& id ) -{ - if(!IsWidgetFeatureEnabled()) - { - DALI_LOG_ERROR("not supported"); - Dali::Widget handle(NULL); - return handle; - } - - if( id.size() < 1 ) - { - DALI_LOG_ERROR("class id is NULL"); - Dali::Widget handle(NULL); - return handle; - } - - WidgetPtr widget ( new Widget( id ) ); - Dali::Widget handle( widget.Get() ); - return handle; -} - -static int OnInit(widget_base_instance_h instance_h, bundle *content, int w, int h, void *classData) -{ - char *id; - widget_base_context_get_id(instance_h, &id); - widget_base_class_on_create(instance_h, content, w, h); - - Dali::Window window = Dali::Adaptor::Get().GetWindow(); - Any nativeHandle = window.GetNativeHandle(); - Ecore_Wl_Window * wlWindow = AnyCast( nativeHandle ); - widget_base_context_window_bind( instance_h, id, wlWindow); - window.SetSize( Dali::Window::WindowSize( w, h ) ); - - Internal::Adaptor::Widget* widget = static_cast< Internal::Adaptor::Widget* >( classData ); - widget->mCreateSignal.Emit( std::string(id), content, window ); - - return 0; -} - -static int OnDestroy(widget_base_instance_h instance_h, widget_base_destroy_type_e reason, bundle *content, void *classData) -{ - char *id; - widget_base_context_get_id(instance_h, &id); - - Dali::Widget::WidgetTerminateType destroyReason = Dali::Widget::WidgetTerminateType::TEMPORARY; - - if(reason == WIDGET_BASE_DESTROY_TYPE_PERMANENT) - { - destroyReason = Dali::Widget::WidgetTerminateType::PERMANENT; - } - - Internal::Adaptor::Widget* widget = static_cast< Internal::Adaptor::Widget* >( classData ); - widget->mTerminateSignal.Emit(std::string(id), content, destroyReason ); - - widget_base_class_on_destroy(instance_h, reason, content); - - return 0; -} - -static int OnPause(widget_base_instance_h instance_h, void *classData) -{ - char *id; - widget_base_context_get_id(instance_h, &id); - - widget_base_class_on_pause(instance_h); - - Internal::Adaptor::Widget* widget = static_cast< Internal::Adaptor::Widget* >( classData ); - widget->mPauseSignal.Emit(id); - - return 0; -} - -static int OnResume(widget_base_instance_h instance_h, void *classData) -{ - char *id; - widget_base_context_get_id(instance_h, &id); - - widget_base_class_on_resume(instance_h); - - Internal::Adaptor::Widget* widget = static_cast< Internal::Adaptor::Widget* >( classData ); - widget->mResumeSignal.Emit(id); - - return 0; -} - -static int OnResize(widget_base_instance_h instance_h, int w, int h, void *classData) -{ - char *id; - widget_base_context_get_id(instance_h, &id); - - widget_base_class_on_resize(instance_h, w, h); - - Internal::Adaptor::Widget* widget = static_cast< Internal::Adaptor::Widget* >( classData ); - Dali::Window window = Dali::Adaptor::Get().GetWindow(); - window.SetSize( Dali::Window::WindowSize(w, h) ); - widget->mResizeSignal.Emit(id, window); - - return 0; -} - -static int OnUpdate(widget_base_instance_h instance_h, bundle *content, int force, void *classData) -{ - char *id; - widget_base_context_get_id(instance_h, &id); - - widget_base_class_on_update(instance_h, content, force); - - Internal::Adaptor::Widget* widget = static_cast< Internal::Adaptor::Widget* >( classData ); - widget->mUpdateSignal.Emit(id, content, force); - - return 0; -} - -Widget::Widget( const std::string& id ) -: mCreateSignal(), - mTerminateSignal(), - mPauseSignal(), - mResumeSignal(), - mResizeSignal(), - mUpdateSignal(), - mClassId(id), - mSlotDelegate(this) -{ - widget_base_class cls = widget_base_class_get_default(); - cls.ops.create = OnInit; - cls.ops.destroy = OnDestroy; - cls.ops.pause = OnPause; - cls.ops.resume = OnResume; - cls.ops.resize = OnResize; - cls.ops.update = OnUpdate; - - widget_base_class_add(cls, mClassId.c_str(), this); -} - -Widget::~Widget() -{ -} - -} // Adaptor - -} // Internal - -} // Dali diff --git a/adaptors/common/widget-impl.h b/adaptors/common/widget-impl.h deleted file mode 100644 index 05bc782..0000000 --- a/adaptors/common/widget-impl.h +++ /dev/null @@ -1,150 +0,0 @@ -#ifndef __DALI_INTERNAL_WIDGET_H__ -#define __DALI_INTERNAL_WIDGET_H__ - -/* - * Copyright (c) 2017 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 -#include -#include -#include - -// INTERNAL INCLUDES -#include -#include -#include -#include - -namespace Dali -{ - -namespace Internal -{ - -namespace Adaptor -{ -class Widget; -typedef IntrusivePtr WidgetPtr; - -/** - * Implementation of the Application class. - */ -class Widget : public BaseObject -{ -public: - typedef Dali::Widget::WidgetCreateSignalType WidgetCreateSignalType; - typedef Dali::Widget::WidgetTerminateSignalType WidgetTerminateSignalType; - typedef Dali::Widget::WidgetPauseSignalType WidgetPauseSignalType; - typedef Dali::Widget::WidgetResumeSignalType WidgetResumeSignalType; - typedef Dali::Widget::WidgetResizeSignalType WidgetResizeSignalType; - typedef Dali::Widget::WidgetUpdateSignalType WidgetUpdateSignalType; - - /** - * Create a new Widget - * @param[in] application WidgetApplication for managing widget instance - * @param[in] id Id for widget class - */ - static Dali::Widget New( const std::string& id ); - -public: // Signals - - /** - * @copydoc Dali::Widget::InitSignal() - */ - WidgetCreateSignalType& CreateSignal(){ return mCreateSignal; } - - /** - * @copydoc Dali::Widget::TerminateSignal() - */ - WidgetTerminateSignalType& TerminateSignal(){ return mTerminateSignal; } - - /** - * @copydoc Dali::Widget::PauseSignal() - */ - WidgetPauseSignalType& PauseSignal(){ return mPauseSignal; } - - /** - * @copydoc Dali::Widget::ResumeSignal() - */ - WidgetResumeSignalType& ResumeSignal(){ return mResumeSignal; } - - /** - * @copydoc Dali::Widget::ResizeSignal() - */ - WidgetResizeSignalType& ResizeSignal(){ return mResizeSignal; } - - /** - * @copydoc Dali::Widget::UpdateSignal() - */ - WidgetUpdateSignalType& UpdateSignal(){ return mUpdateSignal; } - -protected: - - /** - * Private Constructor - * @param[in] id Id for widget class - */ - Widget( const std::string& id ); - - /** - * Destructor - */ - virtual ~Widget(); - - // Undefined - Widget(const Widget&); - Widget& operator=(Widget&); - -public: - - WidgetCreateSignalType mCreateSignal; - WidgetTerminateSignalType mTerminateSignal; - WidgetPauseSignalType mPauseSignal; - WidgetResumeSignalType mResumeSignal; - WidgetResizeSignalType mResizeSignal; - WidgetUpdateSignalType mUpdateSignal; - const std::string mClassId; - -private: - SlotDelegate< Widget > mSlotDelegate; -}; - -inline Widget& GetImplementation(Dali::Widget& widget) -{ - DALI_ASSERT_ALWAYS(widget && "widget handle is empty"); - - BaseObject& handle = widget.GetBaseObject(); - - return static_cast(handle); -} - -inline const Widget& GetImplementation(const Dali::Widget& widget) -{ - DALI_ASSERT_ALWAYS(widget && "widget handle is empty"); - - const BaseObject& handle = widget.GetBaseObject(); - - return static_cast(handle); -} - -} // namespace Adaptor - -} // namespace Internal - -} // namespace Dali -#endif // __DALI_INTERNAL_WIDGET_H__ diff --git a/adaptors/devel-api/adaptor-framework/widget-application.cpp b/adaptors/devel-api/adaptor-framework/widget-application.cpp deleted file mode 100644 index 68cfced..0000000 --- a/adaptors/devel-api/adaptor-framework/widget-application.cpp +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright (c) 2017 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 "widget-application.h" - -// EXTERNAL INCLUDES -#include - -// INTERNAL INCLUDES -#include - -namespace Dali -{ - -WidgetApplication WidgetApplication::New( int* argc, char **argv[], const std::string& stylesheet ) -{ - Internal::Adaptor::WidgetApplicationPtr internal = Internal::Adaptor::WidgetApplication::New( argc, argv, stylesheet); - return WidgetApplication(internal.Get()); -} - -WidgetApplication::~WidgetApplication() -{ -} - -WidgetApplication::WidgetApplication() -{ -} - -WidgetApplication::WidgetApplication(const WidgetApplication& widgetApplication) -: BaseHandle(widgetApplication) -{ -} - -WidgetApplication& WidgetApplication::operator=(const WidgetApplication& widgetApplication) -{ - if( *this != widgetApplication ) - { - BaseHandle::operator=( widgetApplication ); - } - return *this; -} - -void WidgetApplication::MainLoop() -{ - Internal::Adaptor::GetImplementation(*this).MainLoop(); -} - -void WidgetApplication::Quit() -{ - Internal::Adaptor::GetImplementation(*this).Quit(); -} - -std::string WidgetApplication::GetResourcePath() -{ - return Internal::Adaptor::WidgetApplication::GetResourcePath(); -} - -std::string WidgetApplication::GetRegion() -{ - return Internal::Adaptor::GetImplementation(*this).GetRegion(); -} - -std::string WidgetApplication::GetLanguage() -{ - return Internal::Adaptor::GetImplementation(*this).GetLanguage(); -} - -WidgetApplication::AppSignalType& WidgetApplication::InitSignal() -{ - return Internal::Adaptor::GetImplementation(*this).InitSignal(); -} - -WidgetApplication::AppSignalType& WidgetApplication::TerminateSignal() -{ - return Internal::Adaptor::GetImplementation(*this).TerminateSignal(); -} - -WidgetApplication::AppSignalType& WidgetApplication::LanguageChangedSignal() -{ - return Internal::Adaptor::GetImplementation(*this).LanguageChangedSignal(); -} - -WidgetApplication::AppSignalType& WidgetApplication::RegionChangedSignal() -{ - return Internal::Adaptor::GetImplementation(*this).RegionChangedSignal(); -} - -WidgetApplication::LowBatterySignalType& WidgetApplication::LowBatterySignal() -{ - return Internal::Adaptor::GetImplementation(*this).LowBatterySignal(); -} - -WidgetApplication::LowMemorySignalType& WidgetApplication::LowMemorySignal() -{ - return Internal::Adaptor::GetImplementation(*this).LowMemorySignal(); -} - -WidgetApplication::WidgetApplication(Internal::Adaptor::WidgetApplication* widgetApplication) -: BaseHandle(widgetApplication) -{ -} - -} // namespace Dali diff --git a/adaptors/devel-api/adaptor-framework/widget-application.h b/adaptors/devel-api/adaptor-framework/widget-application.h deleted file mode 100644 index 696deb6..0000000 --- a/adaptors/devel-api/adaptor-framework/widget-application.h +++ /dev/null @@ -1,232 +0,0 @@ -#ifndef __DALI_WIDGET_APPLICATION_H__ -#define __DALI_WIDGET_APPLICATION_H__ - -/* - * Copyright (c) 2017 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 -#include -#include -#include - -// INTERNAL INCLUDES -#ifdef DALI_ADAPTOR_COMPILATION // full path doesn't exist until adaptor is installed so we have to use relative -#include -#else -#include -#endif - -// INTERNAL INCLUDES - -namespace Dali -{ - -namespace Internal DALI_INTERNAL -{ -namespace Adaptor -{ -class WidgetApplication; -} -} - -class Window; - -/** - * @brief An WidgetApplication class object should be created by every widget application - * that wishes to use Dali. - * - * It provides a means for initializing the - * resources required by the Dali::Core. - * - * The WidgetApplication class emits several signals which the user can - * connect to. The user should not create any Dali objects in the main - * function and instead should connect to the Init signal of the - * WidgetApplication and create the Dali Widget object in the connected callback. - * - * WidgetApplications should follow the example below: - * - * @code - * class ExampleController: public ConnectionTracker - * { - * public: - * ExampleController( WidgetApplication& widgetApplication ) - * : mWidgetApplication( widgetApplication ) - * { - * mWidgetApplication.InitSignal().Connect( this, &ExampleController::Create ); - * } - * - * void Create( WidgetApplication& widgetApplication ) - * { - * Widget widget = Widget::New( WIDGET_ID ); - * widget.CreateSignal( this, &ExampleController::WidgetCreate ); - * } - * - * void WidgetCreate( const std::string& id, bundle* content, Window window ) - * { - * // Do Dali components... - * } - * ... - * private: - * WidgetApplication& mWidgetApplication; - * }; - * - * int main (int argc, char **argv) - * { - * WidgetApplication app = WidgetApplication::New(&argc, &argv); - * ExampleController example( app ); - * app.MainLoop(); - * } - * @endcode - * - * If required, you can also connect class member functions to a signal: - * - * @code - * MyWidgetApplication app; - * app.ResumeSignal().Connect(&app, &MyWidgetApplication::Resume); - * @endcode - * - * @SINCE_1_2.62 - */ -class DALI_IMPORT_API WidgetApplication : public BaseHandle -{ -public: - - typedef Signal< void (WidgetApplication&) > AppSignalType; ///< Widget application lifecycle signal and system signal callback type - typedef Signal< void (DeviceStatus::Battery::Status) > LowBatterySignalType; ///< Widget application device signal type - typedef Signal< void (DeviceStatus::Memory::Status) > LowMemorySignalType; ///< Widget application device signal type - -public: - - /** - * @brief This is the constructor for WidgetApplications with a name. - * - * @param[in,out] argc A pointer to the number of arguments - * @param[in,out] argv A pointer to the argument list - * @param[in] stylesheet The path to user defined theme file - * @return A handle to the WidgetApplication - * @note If the stylesheet is not specified, then the library's default stylesheet will not be overridden. - */ - static WidgetApplication New( int* argc, char **argv[], const std::string& stylesheet ); - - /** - * @brief The default constructor. - * - */ - WidgetApplication(); - - /** - * @brief Copy Constructor. - * @param[in] WidgetApplication Handle to an object - */ - WidgetApplication( const WidgetApplication& widgetApplication ); - - /** - * @brief Assignment operator. - * @param[in] WidgetApplication Handle to an object - * @return A reference to this - */ - WidgetApplication& operator=( const WidgetApplication& widgetApplication ); - - /** - * @brief Destructor - * - */ - ~WidgetApplication(); - - /** - * @brief This starts the application. - */ - void MainLoop(); - - /** - * @brief This quits the application. Tizen applications should use Lower to improve re-start performance unless they need to Quit completely. - */ - void Quit(); - - /** - * @brief Get path application resources are stored at - * @return the full path of the resources - */ - static std::string GetResourcePath(); - - /** - * @brief this is used to get region information from device. - * - * @return region information - */ - std::string GetRegion(); - - /** - * @brief this is used to get language information from device. - * - * @return language information - */ - std::string GetLanguage(); - -public: // Signals - - /** - * @brief The user should connect to this signal to determine when they should initialize - * their application. - * @return The signal to connect to - */ - AppSignalType& InitSignal(); - - /** - * @brief The user should connect to this signal to determine when they should terminate - * their application. - * @return The signal to connect to - */ - AppSignalType& TerminateSignal(); - - /** - * @brief This signal is emitted when the language is changed on the device. - * @return The signal to connect to - */ - AppSignalType& LanguageChangedSignal(); - - /** - * @brief This signal is emitted when the region of the device is changed. - * @return The signal to connect to - */ - AppSignalType& RegionChangedSignal(); - - /** - * @brief This signal is emitted when the battery level of the device is low. - * @return The signal to connect to - */ - LowBatterySignalType& LowBatterySignal(); - - /** - * @brief This signal is emitted when the memory level of the device is low. - * @return The signal to connect to - */ - LowMemorySignalType& LowMemorySignal(); - -public: // Not intended for application developers - /// @cond internal - /** - * @brief Internal constructor. - */ - explicit DALI_INTERNAL WidgetApplication(Internal::Adaptor::WidgetApplication* widgetApplication); - /// @endcond -}; - -} // namespace Dali - -#endif // ___DALI_WIDGET_APPLICATION_H__ diff --git a/adaptors/devel-api/adaptor-framework/widget.cpp b/adaptors/devel-api/adaptor-framework/widget.cpp deleted file mode 100644 index 26f07a8..0000000 --- a/adaptors/devel-api/adaptor-framework/widget.cpp +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2017 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 "widget.h" - -// EXTERNAL INCLUDES -#include - -// INTERNAL INCLUDES -#include - -namespace Dali -{ - -Widget Widget::New( const std::string& id) -{ - return Internal::Adaptor::Widget::New( id ); -} - -Widget::~Widget() -{ -} - -Widget::Widget() -{ -} - -Widget::Widget(const Widget& widget) -: BaseHandle(widget) -{ -} - -Widget& Widget::operator=(const Widget& widget) -{ - if( *this != widget ) - { - BaseHandle::operator=( widget ); - } - return *this; -} - -Widget::WidgetCreateSignalType& Widget::CreateSignal() -{ - return Internal::Adaptor::GetImplementation(*this).CreateSignal(); -} - -Widget::WidgetTerminateSignalType& Widget::TerminateSignal() -{ - return Internal::Adaptor::GetImplementation(*this).TerminateSignal(); -} - -Widget::WidgetPauseSignalType& Widget::PauseSignal() -{ - return Internal::Adaptor::GetImplementation(*this).PauseSignal(); -} - -Widget::WidgetResumeSignalType& Widget::ResumeSignal() -{ - return Internal::Adaptor::GetImplementation(*this).ResumeSignal(); -} - -Widget::WidgetResizeSignalType& Widget::ResizeSignal() -{ - return Internal::Adaptor::GetImplementation(*this).ResizeSignal(); -} - -Widget::WidgetUpdateSignalType& Widget::UpdateSignal() -{ - return Internal::Adaptor::GetImplementation(*this).UpdateSignal(); -} - -Widget::Widget(Internal::Adaptor::Widget* widget) -: BaseHandle(widget) -{ -} - -} // namespace Dali diff --git a/adaptors/devel-api/adaptor-framework/widget.h b/adaptors/devel-api/adaptor-framework/widget.h deleted file mode 100644 index be23dc3..0000000 --- a/adaptors/devel-api/adaptor-framework/widget.h +++ /dev/null @@ -1,205 +0,0 @@ -#ifndef __DALI_WIDGET_H__ -#define __DALI_WIDGET_H__ - -/* - * Copyright (c) 2017 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 -#include -#include - -namespace Dali -{ -/** - * @addtogroup dali_adaptor_framework - * @{ - */ - -namespace Internal DALI_INTERNAL -{ - -namespace Adaptor -{ -class Widget; -} - -} - -class Window; - -/** - * @brief Widget object should be created by WidgetApplication. - * - * The WidgetApplication class emits several widget instance lifecycle signals - * which the user can connect to. - * The user should connect to the CreateSignal of the Widget and - * create the Dali Widget object in the connected callback. - * - * Widget should follow the example below: - * - * @code - * class ExampleController: public ConnectionTracker - * { - * public: - * ExampleController( WidgetApplication& widgetApplication ) - * : mWidgetApplication( widgetApplication ) - * { - * mWidgetApplication.InitSignal().Connect( this, &ExampleController::Create ); - * } - * - * void Create( WidgetApplication& widgetApplication ) - * { - * Widget widget = Widget::New( WIDGET_ID ); - * widget.CreateSignal( this, &ExampleController::WidgetCreate ); - * } - * - * void WidgetCreate( const std::string& id, bundle* content, Window window ) - * { - * // Do Dali components... - * } - * ... - * private: - * WidgetApplication& mWidgetApplication; - * }; - * - * int main (int argc, char **argv) - * { - * WidgetApplication app = WidgetApplication::New(&argc, &argv); - * ExampleController example( app ); - * app.MainLoop(); - * } - * - * @SINCE_1_2.62 - */ -class DALI_IMPORT_API Widget : public BaseHandle -{ -public: - - /** - * @brief Enumeration for terminate type of widget instance. - * @SINCE_1_2.62 - */ - typedef enum - { - PERMANENT, //< User deleted this widget from the viewer @SINCE_1_2.62 - TEMPORARY, //< Widget is deleted because of other reasons (e.g. widget process is terminated temporarily by the system) @SINCE_1_2.62 - } WidgetTerminateType; - - typedef Signal< void (const std::string&, bundle*, Window) > WidgetCreateSignalType; ///< Widget lifecycle signal type @SINCE_1_2.62 - typedef Signal< void (const std::string&, bundle*, WidgetTerminateType) > WidgetTerminateSignalType; ///< Widget lifecycle signal type @SINCE_1_2.62 - typedef Signal< void (const std::string&) > WidgetPauseSignalType; ///< Widget lifecycle signal type @SINCE_1_2.62 - typedef Signal< void (const std::string&) > WidgetResumeSignalType; ///< Widget lifecycle signal type @SINCE_1_2.62 - typedef Signal< void (const std::string&, Window) > WidgetResizeSignalType; ///< Widget lifecycle signal type @SINCE_1_2.62 - typedef Signal< void (const std::string&, bundle*, int) > WidgetUpdateSignalType; ///< Widget lifecycle signal type @SINCE_1_2.62 - -public: - - /** - * @brief This is the constructor for Widget. - * @SINCE_1_2.62 - * @param[in] id Id for widget class - * @return A handle to the Widget - */ - static Widget New( const std::string& id ); - - /** - * @brief The default constructor. - * - */ - Widget(); - - /** - * @brief Copy Constructor. - * @SINCE_1_2.62 - * @param[in] Widget Handle to an object - */ - Widget( const Widget& widget ); - - /** - * @brief Assignment operator. - * @SINCE_1_2.62 - * @param[in] Widget Handle to an object - * @return A reference to this - */ - Widget& operator=( const Widget& widget ); - - /** - * @brief Destructor - * @SINCE_1_2.62 - */ - ~Widget(); - -public: // Signals - - /** - * @brief The user should connect to this signal to determine when they create widget. - * @SINCE_1_2.62 - * @return The signal to connect to - */ - WidgetCreateSignalType& CreateSignal(); - - /** - * @brief The user should connect to this signal to determine when they terminate widget. - * @SINCE_1_2.62 - * @return The signal to connect to - */ - WidgetTerminateSignalType& TerminateSignal(); - - /** - * @brief The user should connect to this signal to determine when they pause widget. - * @SINCE_1_2.62 - * @return The signal to connect to - */ - WidgetPauseSignalType& PauseSignal(); - - /** - * @brief The user should connect to this signal to determine when they resume widget. - * @SINCE_1_2.62 - * @return The signal to connect to - */ - WidgetResumeSignalType& ResumeSignal(); - - /** - * @brief The user should connect to this signal to determine when they resize widget. - * @SINCE_1_2.62 - * @return The signal to connect to - */ - WidgetResizeSignalType& ResizeSignal(); - - /** - * @brief The user should connect to this signal to determine when they update widget. - * @SINCE_1_2.62 - * @return The signal to connect to - */ - WidgetUpdateSignalType& UpdateSignal(); - -public: // Not intended for application developers - /// @cond internal - /** - * @brief Internal constructor. - */ - explicit DALI_INTERNAL Widget(Internal::Adaptor::Widget* widget); - /// @endcond -}; - -/** - * @} - */ -} // namespace Dali - -#endif // ___DALI_WIDGET_H__ diff --git a/adaptors/devel-api/file.list b/adaptors/devel-api/file.list index 451e3bf..100bd98 100644 --- a/adaptors/devel-api/file.list +++ b/adaptors/devel-api/file.list @@ -69,10 +69,3 @@ devel_api_adaptor_framework_header_files = \ $(adaptor_devel_api_dir)/adaptor-framework/virtual-keyboard.h \ $(adaptor_devel_api_dir)/adaptor-framework/physical-keyboard.h -adaptor_widget_src_files = \ - $(adaptor_devel_api_dir)/adaptor-framework/widget.cpp \ - $(adaptor_devel_api_dir)/adaptor-framework/widget-application.cpp - -adaptor_widget_header_files = \ - $(adaptor_devel_api_dir)/adaptor-framework/widget.h \ - $(adaptor_devel_api_dir)/adaptor-framework/widget-application.h diff --git a/adaptors/integration-api/adaptor.h b/adaptors/integration-api/adaptor.h index 26d24e4..9e87551 100644 --- a/adaptors/integration-api/adaptor.h +++ b/adaptors/integration-api/adaptor.h @@ -229,13 +229,6 @@ public: Any GetNativeWindowHandle(); /** - * @brief Gets Window handle - * - * @return Window handle - */ - Window GetWindow(); - - /** * @brief Release any locks the surface may hold. * * For example, after compositing an offscreen surface, use this method to allow diff --git a/adaptors/tizen/framework-tizen.cpp b/adaptors/tizen/framework-tizen.cpp index d9c7724..d0e15bc 100644 --- a/adaptors/tizen/framework-tizen.cpp +++ b/adaptors/tizen/framework-tizen.cpp @@ -28,7 +28,7 @@ #include #include #include -#include + // CONDITIONAL INCLUDES #ifdef APPCORE_WATCH_AVAILABLE #include @@ -46,7 +46,6 @@ // INTERNAL INCLUDES #include -#include namespace Dali { @@ -56,33 +55,12 @@ namespace Internal namespace Adaptor { +#if defined(DEBUG_ENABLED) namespace { -#if defined(DEBUG_ENABLED) Integration::Log::Filter* gDBusLogging = Integration::Log::Filter::New( Debug::NoLogging, false, "LOG_ADAPTOR_EVENTS_DBUS" ); -#endif - -bool IsWidgetFeatureEnabled() -{ - static bool feature = false; - static bool retrieved = false; - int ret; - - if(retrieved == true) - return feature; - - ret = system_info_get_platform_bool("http://tizen.org/feature/shell.appwidget", &feature); - if(ret != SYSTEM_INFO_ERROR_NONE) - { - DALI_LOG_ERROR("failed to get system info"); /* LCOV_EXCL_LINE */ - return false; /* LCOV_EXCL_LINE */ - } - - retrieved = true; - return feature; -} - } // anonymous namespace +#endif namespace AppCore { @@ -218,10 +196,6 @@ struct Framework::Impl { ret = AppNormalMain(); } - else if(mApplicationType == WIDGET) - { - ret = AppWidgetMain(); - } else { ret = AppWatchMain(); @@ -235,10 +209,6 @@ struct Framework::Impl { AppNormalExit(); } - else if(mApplicationType == WIDGET) - { - AppWidgetExit(); - } else { AppWatchExit(); @@ -541,58 +511,6 @@ struct Framework::Impl appcore_ui_base_exit(); } - void AppWidgetExit() - { - widget_base_exit(); - } - - static int WidgetAppCreate( void *data ) - { - dlog_print(DLOG_ERROR,"DALI","WidgetAppCreate!\n"); - widget_base_on_create(); - return static_cast( static_cast(data)->Create() ); - } - - static int WidgetAppTerminate( void *data ) - { - Observer *observer = &static_cast(data)->mObserver; - observer->OnTerminate(); - - widget_base_on_terminate(); - return 0; - } - - int AppWidgetMain() - { - if( !IsWidgetFeatureEnabled() ) - { - DALI_LOG_ERROR("widget feature is not supported"); - return 0; - } - - AppCore::AppAddEventHandler(&handlers[AppCore::LOW_BATTERY], AppCore::LOW_BATTERY, AppBatteryLow, mFramework); - AppCore::AppAddEventHandler(&handlers[AppCore::LOW_MEMORY], AppCore::LOW_MEMORY, AppMemoryLow, mFramework); - AppCore::AppAddEventHandler(&handlers[AppCore::DEVICE_ORIENTATION_CHANGED], AppCore::DEVICE_ORIENTATION_CHANGED, AppDeviceRotated, mFramework); - AppCore::AppAddEventHandler(&handlers[AppCore::LANGUAGE_CHANGED], AppCore::LANGUAGE_CHANGED, AppLanguageChanged, mFramework); - AppCore::AppAddEventHandler(&handlers[AppCore::REGION_FORMAT_CHANGED], AppCore::REGION_FORMAT_CHANGED, AppRegionChanged, mFramework); - - widget_base_ops ops = widget_base_get_default_ops(); - - /* override methods */ - ops.create = WidgetAppCreate; - ops.terminate = WidgetAppTerminate; - ops.init = AppInit; - ops.finish = AppFinish; - ops.run = AppRun; - ops.exit = AppExit; - - int result = widget_base_init(ops, *mFramework->mArgc, *mFramework->mArgv, mFramework); - - widget_base_fini(); - - return result; - } - #ifdef APPCORE_WATCH_AVAILABLE static bool WatchAppCreate(int width, int height, void *data) { diff --git a/build/tizen/adaptor/Makefile.am b/build/tizen/adaptor/Makefile.am index eaeb652..8add73d 100644 --- a/build/tizen/adaptor/Makefile.am +++ b/build/tizen/adaptor/Makefile.am @@ -90,6 +90,7 @@ include ../../../adaptors/public-api/file.list adaptor_devel_api_dir = ../../../adaptors/devel-api include ../../../adaptors/devel-api/file.list + # Static libraries static_libraries_libunibreak_src_dir = ../../../text/dali/internal/libunibreak include ../../../text/dali/internal/libunibreak/file.list @@ -254,13 +255,6 @@ endif # WAYLAND endif # IVI_PROFILE -if USE_APPFW -if USE_APPFW_EFL_BASE -else -adaptor_internal_src_files += $(adaptor_internal_widget_src_files) -endif -endif - main_loop_integration_src_files = $(adaptor_common_internal_ecore_src_files) input_event_handler_src_files = $(adaptor_ecore_x_event_handler_internal_src_files) @@ -294,14 +288,6 @@ LIBDALI_ADAPTOR_LA_SOURCES += \ $(base_adaptor_networking_src_files) endif -if USE_APPFW -if USE_APPFW_EFL_BASE -else # over Tizen 3.0 -LIBDALI_ADAPTOR_LA_SOURCES += \ - $(adaptor_widget_src_files) -endif -endif - libdali_adaptor_la_DEPENDENCIES = # List include directories with more platform-specific (tizen) before portable root: @@ -450,17 +436,13 @@ LIBDALI_ADAPTOR_LA_CXXFLAGS += $(ELEMENTARY_CFLAGS) LIBDALI_ADAPTOR_LA_LIBADD += $(ELEMENTARY_LIBS) else -LIBDALI_ADAPTOR_LA_CXXFLAGS += $(BUNDLE_CFLAGS) \ - $(CAPI_APPFW_COMMON_CFLAGS) \ +LIBDALI_ADAPTOR_LA_CXXFLAGS += $(CAPI_APPFW_COMMON_CFLAGS) \ $(CAPI_APPFW_CONTROL_CFLAGS) \ - $(CAPI_APPFW_WIDGET_BASE_CFLAGS) \ $(ECORE_IMF_CFLAGS) \ $(FRIBIDI_CFLAGS) -LIBDALI_ADAPTOR_LA_LIBADD += $(BUNDLE_LIBS) \ - $(CAPI_APPFW_COMMON_LIBS) \ +LIBDALI_ADAPTOR_LA_LIBADD += $(CAPI_APPFW_COMMON_LIBS) \ $(CAPI_APPFW_CONTROL_LIBS) \ - $(CAPI_APPFW_WIDGET_BASE_LIBS) \ $(ECORE_IMF_LIBS) \ $(FRIBIDI_LIBS) endif @@ -585,13 +567,6 @@ tizenadaptorpublicapi_HEADERS += $(adaptor_dali_wearable_header_file) tizenwatchpublicapidir = $(tizenadaptorpublicapidir)/watch tizenwatchpublicapi_HEADERS = $(public_dali_watch_header_files) -if USE_APPFW -if USE_APPFW_EFL_BASE -else -tizenadaptorframeworkdevelapi_HEADERS += $(adaptor_widget_header_files) -endif -endif - install-data-local: $(MKDIR_P) ${DESTDIR}/${daliUserFontCacheDir} ${DESTDIR}/${daliShaderbinCacheDir} diff --git a/build/tizen/adaptor/configure.ac b/build/tizen/adaptor/configure.ac index 4a7f614..2bd1a7c 100644 --- a/build/tizen/adaptor/configure.ac +++ b/build/tizen/adaptor/configure.ac @@ -277,10 +277,7 @@ if test "x$enable_tizen_major_version" = "x3"; then PKG_CHECK_MODULES(CAPI_APPFW_APPLICATION, capi-appfw-application) PKG_CHECK_MODULES(ELEMENTARY, elementary) else -DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DWIDGET_AVAILABLE" -PKG_CHECK_MODULES(BUNDLE, bundle) PKG_CHECK_MODULES(CAPI_APPFW_APPLICATION, appcore-ui) -PKG_CHECK_MODULES(CAPI_APPFW_WIDGET_BASE, appcore-widget-base) PKG_CHECK_MODULES(CAPI_APPFW_COMMON, capi-appfw-app-common) PKG_CHECK_MODULES(CAPI_APPFW_CONTROL, capi-appfw-app-control) fi diff --git a/packaging/dali-adaptor.spec b/packaging/dali-adaptor.spec index c1bee87..11eedce 100755 --- a/packaging/dali-adaptor.spec +++ b/packaging/dali-adaptor.spec @@ -120,9 +120,7 @@ BuildRequires: pkgconfig(utilX) BuildRequires: pkgconfig(capi-appfw-application) BuildRequires: pkgconfig(elementary) %else -BuildRequires: pkgconfig(bundle) BuildRequires: pkgconfig(appcore-ui) -BuildRequires: pkgconfig(appcore-widget-base) BuildRequires: pkgconfig(capi-appfw-app-common) BuildRequires: pkgconfig(capi-appfw-app-control) BuildRequires: pkgconfig(ecore-imf) -- 2.7.4