enum Type
{
- NORMAL, ///< normal appFramework
- WATCH, ///< watch appFramework
- WIDGET ///< widget appFramework
+ NORMAL, ///< normal appFramework
+ WATCH ///< watch appFramework
};
/**
+++ /dev/null
-/*
- * 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"
-
-// INTERNAL INCLUDES
-#include <widget-application-impl.h>
-
-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)
-: Application(widgetApplication)
-{
-}
-
-WidgetApplication& WidgetApplication::operator=(const WidgetApplication& widgetApplication)
-{
- if( *this != widgetApplication )
- {
- BaseHandle::operator=( widgetApplication );
- }
- return *this;
-}
-
-void WidgetApplication::RegisterWidgetCreatingFunction( const std::string& widgetName, CreateWidgetFunction createFunction )
-{
- Internal::Adaptor::GetImplementation(*this).RegisterWidgetCreatingFunction( widgetName, createFunction );
-}
-
-WidgetApplication::WidgetApplication(Internal::Adaptor::WidgetApplication* widgetApplication)
-: Application(widgetApplication)
-{
-}
-
-} // namespace Dali
+++ /dev/null
-#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.
- *
- */
-
-// INTERNAL INCLUDES
-#include <public-api/adaptor-framework/application.h>
-
-namespace Dali
-{
-
-namespace Internal DALI_INTERNAL
-{
-
-namespace Adaptor
-{
-class WidgetApplication;
-}
-
-}
-
-class Widget;
-
-/**
- * @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
- *
- * //Widget header which
- * #include <my-widget.h>
- *
- * class ExampleController: public ConnectionTracker
- * {
- * public:
- * ExampleController( Application& application )
- * : mWidgetApplication( application )
- * {
- * mApplication.InitSignal().Connect( this, &ExampleController::Create );
- * }
- *
- * static Widget CreateWidgetFunction(const std::string& widgetName)
- * {
- * MyWidget widget = MyWidget::New();
- * return widget;
- * }
- *
- * void Create( Application& application )
- * {
- * mApplication.RegisterWidgetCreatingFunction( "myWidget", &ExampleController::CreateWidgetFunction );
- * }
- *
- * 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_3_5
- */
-class DALI_IMPORT_API WidgetApplication : public Application
-{
-public:
-
- /**
- * @brief This is the typedef for Widget creator.
- * @SINCE_1_3_5
- */
- typedef Widget(*CreateWidgetFunction)(const std::string&);
-
-public:
-
- /**
- * @brief This is the constructor for WidgetApplications with a name.
- *
- * @SINCE_1_3_5
- * @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.
- * @SINCE_1_3_5
- */
- WidgetApplication();
-
- /**
- * @brief Copy Constructor.
- *
- * @SINCE_1_3_5
- * @param[in] WidgetApplication Handle to an object
- */
- WidgetApplication( const WidgetApplication& widgetApplication );
-
- /**
- * @brief Assignment operator.
- *
- * @SINCE_1_3_5
- * @param[in] WidgetApplication Handle to an object
- * @return A reference to this
- */
- WidgetApplication& operator=( const WidgetApplication& widgetApplication );
-
- /**
- * @brief Destructor
- * @SINCE_1_3_5
- */
- ~WidgetApplication();
-
- /**
- * @brief Register create function for widget.
- *
- * @SINCE_1_3_5
- * @param[in] widgetName Name of widget
- * @param[in] createFunction Function pointer for widget creation.
- */
- void RegisterWidgetCreatingFunction( const std::string& widgetName, CreateWidgetFunction createFunction );
-
-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
+++ /dev/null
-/*
- * 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-impl.h"
-
-// INTERNAL INCLUDES
-#include <window.h>
-#include <widget-controller.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-WidgetPtr Widget::New()
-{
- return new Widget();
-}
-
-Widget::Widget()
-: mImpl( nullptr )
-{
-}
-
-Widget::~Widget()
-{
- if( mImpl != nullptr )
- {
- delete mImpl;
- }
-}
-
-void Widget::OnCreate( const std::string& contentInfo, Dali::Window window )
-{
-}
-
-void Widget::OnTerminate( const std::string& contentInfo, Dali::Widget::Termination type )
-{
-}
-
-void Widget::OnPause()
-{
-}
-
-void Widget::OnResume()
-{
-}
-
-void Widget::OnResize( Dali::Window window )
-{
-}
-
-void Widget::OnUpdate( const std::string& contentInfo, int force )
-{
-}
-
-void Widget::SignalConnected( SlotObserver* slotObserver, CallbackBase* callback )
-{
- mImpl->SignalConnected( slotObserver, callback );
-}
-
-void Widget::SignalDisconnected( SlotObserver* slotObserver, CallbackBase* callback )
-{
- mImpl->SignalDisconnected( slotObserver, callback );
-}
-
-void Widget::SetContentInfo( const std::string& contentInfo )
-{
- if( mImpl != nullptr )
- {
- mImpl->SetContentInfo( contentInfo );
- }
-}
-
-void Widget::SetImpl( Impl* impl )
-{
- mImpl = impl;
-}
-
-Internal::Adaptor::Widget& GetImplementation(Dali::Widget& widget)
-{
- DALI_ASSERT_ALWAYS(widget && "widget handle is empty");
-
- BaseObject& handle = widget.GetBaseObject();
-
- return static_cast<Internal::Adaptor::Widget&>(handle);
-}
-
-const Internal::Adaptor::Widget& GetImplementation(const Dali::Widget& widget)
-{
- const BaseObject& handle = widget.GetBaseObject();
-
- return static_cast<const Internal::Adaptor::Widget&>(handle);
-}
-
-} // Adaptor
-
-} // Internal
-
-} // Dali
+++ /dev/null
-#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 <dali/public-api/object/base-object.h>
-#include <dali/public-api/signals/connection-tracker-interface.h>
-
-// INTERNAL INCLUDES
-#include "widget.h"
-
-namespace Dali
-{
-class Window;
-
-/**
- * @addtogroup dali_adaptor_framework
- * @{
- */
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-class Widget;
-typedef IntrusivePtr<Widget> WidgetPtr;
-
-/**
- * @brief This is the internal base class of custom widget.
- *
- * It will provides several widget instance lifecycle virtual functions
- * which the user can override.
- *
- * User should override OnCreate function and create scene for custom widget.
- *
- * Plus, Implements ConnectionTrackerInterface so that signals (typically connected to member functions) will
- * be disconnected automatically when the control is destroyed.
- *
- * @SINCE_1_3_5
- */
-class DALI_IMPORT_API Widget : public BaseObject, public ConnectionTrackerInterface
-{
-public:
-
- /**
- * @brief Creates a new WidgetImpl instance.
- *
- * @SINCE_1_3_5
- * @return A handle to the WidgetImpl instance
- */
- static WidgetPtr New();
-
- /**
- * @brief The user should override this function to determine when they create widget.
- *
- * @SINCE_1_3_5
- * @param[in] contentInfo Information from WidgetView for creating. It contains previous status of widget which is sent by SetContentInfo before.
- * @param[in] window Window handle for widget
- */
- virtual void OnCreate( const std::string& contentInfo, Dali::Window window );
-
- /**
- * @brief The user should override this function to determine when they terminate widget.
- *
- * @SINCE_1_3_5
- * @param[in] contentInfo Data from WidgetView for deleting
- * @param[in] type Termination type. When user delete widget view, termination type is PERMANENT.
- */
- virtual void OnTerminate( const std::string& contentInfo, Dali::Widget::Termination type );
-
- /**
- * @brief The user should override this function to determine when they pause widget.
- * @SINCE_1_3_5
- */
- virtual void OnPause();
-
- /**
- * @brief The user should override this function to determine when they resume widget.
- * @SINCE_1_3_5
- */
- virtual void OnResume();
-
- /**
- * @brief The user should override this function to determine when they resize widget.
- *
- * @SINCE_1_3_5
- * @param[in] window Window handle for widget
- */
- virtual void OnResize( Dali::Window window );
-
- /**
- * @brief The user should override this function to determine when they update widget.
- *
- * @SINCE_1_3_5
- * @param[in] contentInfo Data from WidgetView for updating
- * @param[in] force Although the widget is paused, if it is true, the widget can be updated
- */
- virtual void OnUpdate( const std::string& contentInfo, int force );
-
- // From ConnectionTrackerInterface
-
- /**
- * @copydoc ConnectionTrackerInterface::SignalConnected
- */
- virtual void SignalConnected( SlotObserver* slotObserver, CallbackBase* callback );
-
- /**
- * @copydoc ConnectionTrackerInterface::SignalDisconnected
- */
- virtual void SignalDisconnected( SlotObserver* slotObserver, CallbackBase* callback );
-
- /**
- * @brief Set content info to WidgetView.
- *
- * @SINCE_1_3_5
- * @param[in] contentInfo Content info is kind of context information which contains current status of widget.
- */
- void SetContentInfo( const std::string& contentInfo );
-
-protected:
-
- /**
- * @brief WidgetImpl constructor
- */
- Widget();
-
- /**
- * @brief Virtual destructor
- */
- virtual ~Widget();
-
- /// @cond internal
-public:
- class Impl; // Class declaration is public so we can internally add devel API's to the WidgetImpl
-
- /*
- * Set pointer of WidgetImpl Internal.
- * @SINCE_1_3_5
- */
- void SetImpl( Widget::Impl* impl );
-
-private:
- Impl* mImpl;
-
- // Undefined
- DALI_INTERNAL Widget(const Widget&);
- DALI_INTERNAL Widget& operator=(Widget&);
- /// @endcond
-
-};
-
-/**
- * @brief Gets implementation from the handle.
- *
- * @SINCE_1_3_5
- * @param handle
- * @return Implementation
- * @pre handle is initialized and points to a widget
- */
-DALI_IMPORT_API Internal::Adaptor::Widget& GetImplementation( Dali::Widget& widget );
-
-/**
- * @brief Gets implementation from the handle.
- *
- * @SINCE_1_3_5
- * @param handle
- * @return Implementation
- * @pre Handle is initialized and points to a widget.
- */
-DALI_IMPORT_API const Internal::Adaptor::Widget& GetImplementation( const Dali::Widget& widget );
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-/**
- * @}
- */
-
-} // namespace Dali
-#endif // DALI_INTERNAL_WIDGET_H
+++ /dev/null
-/*
- * 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"
-
-// INTERNAL INCLUDES
-#include <widget-impl.h>
-
-namespace Dali
-{
-
-Widget Widget::New()
-{
- Internal::Adaptor::WidgetPtr internal = Internal::Adaptor::Widget::New();
- return Widget(internal.Get());
-}
-
-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::Widget(Internal::Adaptor::Widget* widget)
-: BaseHandle(widget)
-{
-}
-
-} // namespace Dali
+++ /dev/null
-#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 <dali/public-api/object/base-handle.h>
-
-namespace Dali
-{
-
- /**
- * @addtogroup dali_adaptor_framework
- * @{
- */
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-class Widget;
-}
-
-}
-
-class Window;
-
-/**
- * @brief Widget class is the base class for custom widget.
- *
- * To make own Widget, user should inherit this class and its impl class.
- *
- * @SINCE_1_3_5
- */
-class DALI_IMPORT_API Widget : public BaseHandle
-{
-public:
-
- /**
- * @brief Enumeration class for termination type of widget instance.
- * @SINCE_1_3_5
- */
- enum class Termination
- {
- PERMANENT, //< User deleted this widget from the viewer @SINCE_1_3_5
- TEMPORARY, //< Widget is deleted because of other reasons (e.g. widget process is terminated temporarily by the system) @SINCE_1_3_5
- };
-
-public:
-
- /**
- * @brief This is the constructor for Widget.
- * @SINCE_1_3_5
- * @return A handle to the Widget
- */
- static Widget New();
-
- /**
- * @brief The default constructor.
- */
- Widget();
-
- /**
- * @brief Copy Constructor.
- * @SINCE_1_3_5
- * @param[in] Widget Handle to an object
- */
- Widget( const Widget& widget );
-
- /**
- * @brief Assignment operator.
- * @SINCE_1_3_5
- * @param[in] Widget Handle to an object
- * @return A reference to this
- */
- Widget& operator=( const Widget& widget );
-
- /**
- * @brief Destructor
- * @SINCE_1_3_5
- */
- ~Widget();
-
-public: // Not intended for application developers
- explicit Widget(Internal::Adaptor::Widget* widget);
-};
-
-/**
- * @}
- */
-} // namespace Dali
-
-#endif // DALI_WIDGET_H
$(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-impl.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-impl.h \
- $(adaptor_devel_api_dir)/adaptor-framework/widget-application.h
-
$(adaptor_tizen_dir)/native-render-surface-factory-tizen.cpp \
$(adaptor_tizen_dir)/native-image-source-impl-tizen.cpp
-adaptor_tizen_internal_widget_src_files = \
- $(adaptor_tizen_dir)/widget-application-impl.cpp \
- $(adaptor_tizen_dir)/widget-controller.cpp
-
public_api_adaptor_tizen_header_files = \
$(adaptor_tizen_dir)/key-grab.h
#include <system_info.h>
#include <system_settings.h>
#include <bundle_internal.h>
-#include <widget_base.h>
+
// CONDITIONAL INCLUDES
#ifdef APPCORE_WATCH_AVAILABLE
#include <appcore-watch/watch_app.h>
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");
- return false;
- }
-
- retrieved = true;
- return feature;
-}
-
} // anonymous namespace
+#endif
namespace AppCore
{
{
ret = AppNormalMain();
}
- else if(mApplicationType == WIDGET)
- {
- ret = AppWidgetMain();
- }
else
{
ret = AppWatchMain();
{
AppNormalExit();
}
- else if(mApplicationType == WIDGET)
- {
- AppWidgetExit();
- }
else
{
AppWatchExit();
appcore_ui_base_exit();
}
- void AppWidgetExit()
- {
- widget_base_exit();
- }
-
- static int WidgetAppCreate( void *data )
- {
- widget_base_on_create();
- return static_cast<int>( static_cast<Framework*>(data)->Create() );
- }
-
- static int WidgetAppTerminate( void *data )
- {
- Observer *observer = &static_cast<Framework*>(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)
{
+++ /dev/null
-/*
- * 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"
-
-// INTERNAL INCLUDE
-#include <widget.h>
-#include <widget-impl.h>
-#include <widget-controller.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace
-{
-
-int OnInstanceInit(widget_base_instance_h instanceHandle, bundle *content, int w, int h, void *classData)
-{
- char *id;
- widget_base_context_get_id(instanceHandle, &id);
-
- widget_base_class_on_create(instanceHandle, content, w, h);
-
- Dali::Internal::Adaptor::WidgetApplication* application = static_cast<Dali::Internal::Adaptor::WidgetApplication*>(classData);
-
- // After DALi can support multi window, this part should be changed.
- Dali::Window window = application->GetWindow();
- window.ShowIndicator(Dali::Window::INVISIBLE);
- Any nativeHandle = window.GetNativeHandle();
- Ecore_Wl_Window * wlWindow = AnyCast<Ecore_Wl_Window*>( nativeHandle );
- widget_base_context_window_bind( instanceHandle, id, wlWindow );
- window.SetSize( Dali::Window::WindowSize( w, h ) );
-
- Dali::Internal::Adaptor::WidgetApplication::CreateWidgetFunctionPair pair = application->GetWidgetCreatingFunctionPair(std::string(id));
- Dali::WidgetApplication::CreateWidgetFunction createFunction = pair.second;
-
- Dali::Widget widgetInstance = createFunction( pair.first );
- application->AddWidget( instanceHandle, widgetInstance );
-
- Dali::Internal::Adaptor::Widget::Impl *widgetImpl = new Dali::Internal::Adaptor::Widget::Impl(instanceHandle);
- Internal::Adaptor::GetImplementation(widgetInstance).SetImpl( widgetImpl );
-
- std::string encodedContentString = "";
-
- if( bundle_get_count( content ) )
- {
- bundle_raw *bundleRaw;
- int len;
- bundle_encode(content, &bundleRaw, &len);
- char* encodedContent = reinterpret_cast< char* >( bundleRaw );
- encodedContentString = std::string( encodedContent );
- free(bundleRaw);
- }
-
- Internal::Adaptor::GetImplementation(widgetInstance).OnCreate( encodedContentString, window );
-
- return 0;
-}
-
-int OnInstanceDestroy(widget_base_instance_h instanceHandle, widget_base_destroy_type_e reason, bundle *content, void *classData)
-{
- Dali::Internal::Adaptor::WidgetApplication* application = static_cast<Dali::Internal::Adaptor::WidgetApplication*>(classData);
-
- // Get Dali::Widget instance.
- Dali::Widget widgetInstance = application->GetWidget( instanceHandle );
-
- Dali::Widget::Termination destroyReason = Dali::Widget::Termination::TEMPORARY;
-
- if(reason == WIDGET_BASE_DESTROY_TYPE_PERMANENT)
- {
- destroyReason = Dali::Widget::Termination::PERMANENT;
- }
-
- std::string encodedContentString = "";
-
- if( bundle_get_count( content ) )
- {
- bundle_raw *bundleRaw;
- int len;
- bundle_encode(content, &bundleRaw, &len);
- char* encodedContent = reinterpret_cast< char* >( bundleRaw );
- encodedContentString = std::string(encodedContent);
- free(bundleRaw);
- }
-
- Internal::Adaptor::GetImplementation(widgetInstance).OnTerminate( encodedContentString, destroyReason );
-
- widget_base_class_on_destroy(instanceHandle, reason, content);
-
- application->DeleteWidget( instanceHandle );
-
- return 0;
-}
-
-int OnInstancePause(widget_base_instance_h instanceHandle, void *classData)
-{
- widget_base_class_on_pause(instanceHandle);
-
- Dali::Internal::Adaptor::WidgetApplication* application = static_cast<Dali::Internal::Adaptor::WidgetApplication*>(classData);
-
- // Get Dali::Widget instance.
- Dali::Widget widgetInstance = application->GetWidget( instanceHandle );
-
- Internal::Adaptor::GetImplementation(widgetInstance).OnPause();
-
- return 0;
-}
-
-int OnInstanceResume(widget_base_instance_h instanceHandle, void *classData)
-{
- widget_base_class_on_resume(instanceHandle);
-
- Dali::Internal::Adaptor::WidgetApplication* application = static_cast<Dali::Internal::Adaptor::WidgetApplication*>(classData);
-
- // Get Dali::Widget instance.
- Dali::Widget widgetInstance = application->GetWidget( instanceHandle );
-
- Internal::Adaptor::GetImplementation(widgetInstance).OnResume();
-
- return 0;
-}
-
-int OnInstanceResize(widget_base_instance_h instanceHandle, int w, int h, void *classData)
-{
- widget_base_class_on_resize(instanceHandle, w, h);
-
- Dali::Internal::Adaptor::WidgetApplication* application = static_cast<Dali::Internal::Adaptor::WidgetApplication*>(classData);
-
- // Get Dali::Widget instance.
- Dali::Widget widgetInstance = application->GetWidget( instanceHandle );
-
- Dali::Window window = application->GetWindow();
- window.SetSize( Dali::Window::WindowSize(w, h) );
- Internal::Adaptor::GetImplementation(widgetInstance).OnResize(window);
-
- return 0;
-}
-
-int OnInstanceUpdate(widget_base_instance_h instanceHandle, bundle *content, int force, void *classData)
-{
- widget_base_class_on_update(instanceHandle, content, force);
-
- Dali::Internal::Adaptor::WidgetApplication* application = static_cast<Dali::Internal::Adaptor::WidgetApplication*>(classData);
-
- // Get Dali::Widget instance.
- Dali::Widget widgetInstance = application->GetWidget( instanceHandle );
-
- std::string encodedContentString = "";
-
- if( bundle_get_count( content ) )
- {
- bundle_raw *bundleRaw;
- int len;
- bundle_encode(content, &bundleRaw, &len);
- char* encodedContent = reinterpret_cast< char* >( bundleRaw );
- encodedContentString = std::string(encodedContent);
- free(bundleRaw);
- }
-
- Internal::Adaptor::GetImplementation(widgetInstance).OnUpdate( encodedContentString, force );
-
- return 0;
-}
-
-} // anonymous namespace
-
-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 )
-:Application(argc, argv, stylesheet, Dali::WidgetApplication::OPAQUE, PositionSize(), Framework::WIDGET)
-{
-}
-
-WidgetApplication::~WidgetApplication()
-{
-}
-
-
-void WidgetApplication::RegisterWidgetCreatingFunction( const std::string& widgetName, Dali::WidgetApplication::CreateWidgetFunction createFunction )
-{
- AddWidgetCreatingFunctionPair( CreateWidgetFunctionPair(widgetName, createFunction) );
-
- // Register widget class to widget framework
- widget_base_class cls = widget_base_class_get_default();
- cls.ops.create = OnInstanceInit;
- cls.ops.destroy = OnInstanceDestroy;
- cls.ops.pause = OnInstancePause;
- cls.ops.resume = OnInstanceResume;
- cls.ops.resize = OnInstanceResize;
- cls.ops.update = OnInstanceUpdate;
-
- widget_base_class_add(cls, widgetName.c_str(), this);
-}
-
-void WidgetApplication::AddWidgetCreatingFunctionPair( CreateWidgetFunctionPair pair )
-{
- mCreateWidgetFunctionContainer.push_back( pair );
-}
-
-WidgetApplication::CreateWidgetFunctionPair WidgetApplication::GetWidgetCreatingFunctionPair( const std::string& widgetName )
-{
- for( CreateWidgetFunctionContainer::const_iterator iter = mCreateWidgetFunctionContainer.begin(); iter != mCreateWidgetFunctionContainer.end(); ++iter )
- {
- if( widgetName.find((*iter).first) != std::string::npos )
- {
- return *iter;
- }
- }
-
- return CreateWidgetFunctionPair( "", NULL );
-}
-
-void WidgetApplication::AddWidget( widget_base_instance_h widgetBaseInstance, Dali::Widget widget )
-{
- mWidgetInstanceContainer.push_back( WidgetInstancePair(widgetBaseInstance, widget) );
-}
-
-Dali::Widget WidgetApplication::GetWidget( widget_base_instance_h widgetBaseInstance )
-{
- for( WidgetInstanceContainer::const_iterator iter = mWidgetInstanceContainer.begin(); iter != mWidgetInstanceContainer.end(); ++iter )
- {
- if( (*iter).first == widgetBaseInstance )
- {
- return (*iter).second;
- }
- }
- return Dali::Widget();
-}
-
-void WidgetApplication::DeleteWidget( widget_base_instance_h widgetBaseInstance )
-{
- for( WidgetInstanceContainer::const_iterator iter = mWidgetInstanceContainer.begin(); iter != mWidgetInstanceContainer.end(); ++iter )
- {
- if( (*iter).first == widgetBaseInstance )
- {
- mWidgetInstanceContainer.erase(iter);
- break;
- }
- }
-}
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
+++ /dev/null
-#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 <widget_base.h>
-
-// INTERNAL INCLUDES
-#include <application-impl.h>
-#include <widget-application.h>
-
-namespace Dali
-{
-class Widget;
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-class WidgetApplication;
-typedef IntrusivePtr<WidgetApplication> WidgetApplicationPtr;
-
-/**
- * Implementation of the WidgetApplication class.
- */
-class WidgetApplication : public Application
-{
-public:
-
- typedef std::pair<const std::string, Dali::WidgetApplication::CreateWidgetFunction > CreateWidgetFunctionPair;
- typedef std::vector< CreateWidgetFunctionPair > CreateWidgetFunctionContainer;
-
- /**
- * 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::RegisterWidgetCreator()
- */
- void RegisterWidgetCreatingFunction( const std::string& widgetName, Dali::WidgetApplication::CreateWidgetFunction createFunction );
-
- /**
- * Add widget name - CreateWidgetFunction pair to container.
- */
- void AddWidgetCreatingFunctionPair( CreateWidgetFunctionPair pair );
-
- /**
- * Find and get CreateWidgetFunctionPair in container by widget name.
- */
- CreateWidgetFunctionPair GetWidgetCreatingFunctionPair( const std::string& widgetName );
-
- /**
- * Add widget_base_instance_h - Widget instance pair to container.
- */
- void AddWidget( widget_base_instance_h widgetBaseInstance, Dali::Widget widget );
-
- /**
- * Find and get Widget instance in container by widget_base_instance_h.
- */
- Dali::Widget GetWidget( widget_base_instance_h widgetBaseInstance );
-
- /**
- * Delete widget_base_instance_h - Widget instance pair in container.
- */
- void DeleteWidget( widget_base_instance_h widgetBaseInstance );
-
-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&);
-
-private:
-
- typedef std::pair< widget_base_instance_h, Dali::Widget > WidgetInstancePair;
- typedef std::vector< WidgetInstancePair > WidgetInstanceContainer;
-
- CreateWidgetFunctionContainer mCreateWidgetFunctionContainer;
- WidgetInstanceContainer mWidgetInstanceContainer;
-
-};
-
-inline WidgetApplication& GetImplementation(Dali::WidgetApplication& widgetApplication)
-{
- DALI_ASSERT_ALWAYS(widgetApplication && "widget application handle is empty");
-
- BaseObject& handle = widgetApplication.GetBaseObject();
-
- return static_cast<Internal::Adaptor::WidgetApplication&>(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<const Internal::Adaptor::WidgetApplication&>(handle);
-}
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
-
-#endif // DALI_INTERNAL_WIDGET_APPLICATION_H
+++ /dev/null
-/*
- * 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-controller.h"
-
-// EXTERNAL INCLUDES
-#include <bundle.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-Widget::Impl::Impl( widget_base_instance_h instanceHandle )
-: mInstanceHandle( instanceHandle )
-{
-}
-
-Widget::Impl::~Impl()
-{
-}
-
-void Widget::Impl::SetContentInfo( const std::string& contentInfo )
-{
- bundle *contentBundle;
- bundle_raw *contentBundleRaw = reinterpret_cast< bundle_raw* >( const_cast<char*>(contentInfo.c_str()) );
- int len = contentInfo.length();
- contentBundle = bundle_decode(contentBundleRaw, len);
-
- widget_base_context_set_content_info( mInstanceHandle, contentBundle );
-
- bundle_free( contentBundle );
-}
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
+++ /dev/null
-#ifndef DALI_WIDGET_CONTROLLER_H
-#define DALI_WIDGET_CONTROLLER_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 <dali/public-api/signals/connection-tracker.h>
-
-// INTERNAL INCLUDES
-#include <widget_base.h>
-#include <widget-impl.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-/**
- * @brief Holds the Implementation for the internal WidgetImpl class
- */
-class Widget::Impl : public ConnectionTracker
-{
-public:
-
- /**
- * Constructor
- */
- Impl( widget_base_instance_h instanceHandle );
-
- /**
- * Destructor
- */
- ~Impl();
-
-public:
-
- /**
- * Set content information to widget framework
- */
- void SetContentInfo( const std::string& contentInfo );
-
-private:
-
- widget_base_instance_h mInstanceHandle;
-};
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
-
-#endif // DALI_WIDGET_CONTROLLER_H
endif # IVI_PROFILE
-if USE_APPFW
-if USE_APPFW_EFL_BASE
-else
-adaptor_internal_src_files += $(adaptor_tizen_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)
$(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:
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
tizencapturepublicapidir = $(tizenadaptorpublicapidir)/capture
tizencapturepublicapi_HEADERS = $(public_dali_capture_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}
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
BuildRequires: pkgconfig(elementary)
%else
BuildRequires: pkgconfig(appcore-ui)
-BuildRequires: pkgconfig(appcore-widget-base)
-BuildRequires: pkgconfig(bundle)
BuildRequires: pkgconfig(capi-appfw-app-common)
BuildRequires: pkgconfig(capi-appfw-app-control)
BuildRequires: pkgconfig(ecore-imf)