$(adaptor_common_dir)/style-monitor-impl.cpp \
$(adaptor_common_dir)/trigger-event.cpp \
$(adaptor_common_dir)/trigger-event-factory.cpp \
- $(adaptor_common_dir)/watch-application-impl.cpp \
- $(adaptor_common_dir)/watch-time.cpp \
$(adaptor_common_dir)/key-impl.cpp \
$(adaptor_common_dir)/video-player-impl.cpp \
$(adaptor_common_dir)/events/gesture-manager.cpp \
// EXTERNAL INCLUDES
#include <string>
#include <dali/public-api/signals/callback.h>
-#include <watch-application.h>
+#ifdef APPCORE_WATCH_AVAILABLE
+#include "wearable/watch/watch-application.h"
+#endif
// INTERNAL INCLUDES
#include <abort-handler.h>
*/
virtual void OnAppControl(void *) {}
+#ifdef APPCORE_WATCH_AVAILABLE
/**
* Invoked at every second
*/
* Invoked when the device enters or exits ambient mode
*/
virtual void OnAmbientChanged(bool ambient) {}
+#endif
/**
* Invoked when the language of the device is changed.
+++ /dev/null
-/*
- * Copyright (c) 2016 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 "watch-application-impl.h"
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-WatchApplicationPtr WatchApplication::New(
- int* argc,
- char **argv[],
- const std::string& stylesheet,
- Dali::WatchApplication::WINDOW_MODE windowMode)
-{
- WatchApplicationPtr watch ( new WatchApplication (argc, argv, stylesheet, windowMode ) );
- return watch;
-}
-
-WatchApplication::WatchApplication( int* argc, char** argv[], const std::string& stylesheet, Dali::Application::WINDOW_MODE windowMode )
-: Application(argc, argv, stylesheet, windowMode, Framework::WATCH)
-{
-}
-
-WatchApplication::~WatchApplication()
-{
-}
-
-void WatchApplication::OnTimeTick(WatchTime& time)
-{
- Dali::WatchApplication watch(this);
- mTickSignal.Emit( watch, time );
-}
-
-void WatchApplication::OnAmbientTick(WatchTime& time)
-{
- Dali::WatchApplication watch(this);
- mAmbientTickSignal.Emit( watch, time );
-}
-
-void WatchApplication::OnAmbientChanged(bool ambient)
-{
- Dali::WatchApplication watch(this);
- mAmbientChangeSignal.Emit( watch, ambient );
-}
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
+++ /dev/null
-#ifndef __DALI_INTERNAL_WATCH_APPLICATION_H__
-#define __DALI_INTERNAL_WATCH_APPLICATION_H__
-
-/*
- * Copyright (c) 2016 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 <watch-application.h>
-#include <application-impl.h>
-
-namespace Dali
-{
-class Adaptor;
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-class WatchApplication;
-typedef IntrusivePtr<WatchApplication> WatchApplicationPtr;
-
-/**
- * Implementation of the WatchApplication class.
- */
-class WatchApplication : public Application
-{
-public:
- typedef Dali::WatchApplication::WatchTimeSignal WatchTimeSignal;
- typedef Dali::WatchApplication::WatchBoolSignal WatchBoolSignal;
-
- /**
- * Create a new watch
- * @param[in] argc A pointer to the number of arguments
- * @param[in] argv A pointer to the argument list
- * @param[in] stylesheet The path to user defined theme file
- * @param[in] windowMode A member of Dali::Watch::WINDOW_MODE
- */
- static WatchApplicationPtr New( int* argc, char **argv[], const std::string& stylesheet, WINDOW_MODE windowMode );
-
- /**
- * 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
- * @param[in] windowMode A member of Dali::Watch::WINDOW_MODE
- */
- WatchApplication( int* argc, char **argv[], const std::string& stylesheet, WINDOW_MODE windowMode );
-
- /**
- * Destructor
- */
- virtual ~WatchApplication();
-
- /**
- * Called every second
- */
- void OnTimeTick(WatchTime& time);
-
- /**
- * Called every second in ambient mode
- */
- void OnAmbientTick(WatchTime& time);
-
- /**
- * Called when the device enters or exits ambient mode
- */
- void OnAmbientChanged(bool ambient);
-
-private:
-
- // @brief Undefined copy constructor.
- WatchApplication( const WatchApplication& );
-
- // @brief Undefined assignment operator.
- WatchApplication& operator=( const WatchApplication& );
-
-public:
-
- // Signals
- WatchTimeSignal mTickSignal;
- WatchTimeSignal mAmbientTickSignal;
- WatchBoolSignal mAmbientChangeSignal;
-};
-
-inline WatchApplication& GetImplementation(Dali::WatchApplication& watch)
-{
- DALI_ASSERT_ALWAYS(watch && "watch handle is empty");
-
- BaseObject& handle = watch.GetBaseObject();
-
- return static_cast<Internal::Adaptor::WatchApplication&>(handle);
-}
-
-inline const WatchApplication& GetImplementation(const Dali::WatchApplication& watch)
-{
- DALI_ASSERT_ALWAYS(watch && "Time handle is empty");
-
- const BaseObject& handle = watch.GetBaseObject();
-
- return static_cast<const Internal::Adaptor::WatchApplication&>(handle);
-}
-
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
-
-#endif // __DALI_INTERNAL_WATCH_APPLICATION_H__
+++ /dev/null
-/*
- * Copyright (c) 2016 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 <watch-time.h>
-
-// EXTERNAL INCLUDES
-#ifdef APPCORE_WATCH_AVAILABLE
-#include <appcore-watch/watch_app.h>
-#endif
-
-namespace Dali
-{
-
-struct WatchTime::Impl
-{
- Impl(void *time_handle)
- : mTimeHandle(time_handle)
- {
- }
-
- void *mTimeHandle;
-};
-
-WatchTime::WatchTime()
- :mImpl(NULL)
-{
-}
-
-WatchTime::WatchTime(void *time_handle)
-{
- mImpl = new Impl(time_handle);
-}
-
-WatchTime::~WatchTime()
-{
- if( mImpl )
- {
- delete mImpl;
- mImpl = NULL;
- }
-}
-
-#ifdef APPCORE_WATCH_AVAILABLE
-
-int WatchTime::GetHour() const
-{
- int hour;
-
- watch_time_get_hour(reinterpret_cast<watch_time_h>(mImpl->mTimeHandle), &hour);
- return hour;
-}
-
-int WatchTime::GetHour24() const
-{
- int hour24;
-
- watch_time_get_hour24(reinterpret_cast<watch_time_h>(mImpl->mTimeHandle), &hour24);
- return hour24;
-}
-
-int WatchTime::GetMinute() const
-{
- int minute;
-
- watch_time_get_minute(reinterpret_cast<watch_time_h>(mImpl->mTimeHandle), &minute);
- return minute;
-}
-
-int WatchTime::GetSecond() const
-{
- int second;
-
- watch_time_get_second(reinterpret_cast<watch_time_h>(mImpl->mTimeHandle), &second);
- return second;
-}
-
-#else
-
-int WatchTime::GetHour() const
-{
- return 0;
-}
-
-int WatchTime::GetHour24() const
-{
- return 0;
-}
-
-int WatchTime::GetMinute() const
-{
- return 0;
-}
-
-int WatchTime::GetSecond() const
-{
- return 0;
-}
-
-#endif
-
-} // namespace Dali
+++ /dev/null
-/*
- * Copyright (c) 2016 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 <watch-application.h>
-
-// EXTERNAL INCLUDES
-#include <dali/integration-api/debug.h>
-
-// INTERNAL INCLUDES
-#include <watch-application-impl.h>
-
-namespace Dali
-{
-
-WatchApplication WatchApplication::New()
-{
- return New( NULL, NULL );
-}
-
-WatchApplication WatchApplication::New( int* argc, char **argv[] )
-{
- Internal::Adaptor::WatchApplicationPtr internal = Internal::Adaptor::WatchApplication::New( argc, argv, "", OPAQUE );
- return WatchApplication(internal.Get());
-}
-
-WatchApplication WatchApplication::New( int* argc, char **argv[], const std::string& stylesheet )
-{
- Internal::Adaptor::WatchApplicationPtr internal = Internal::Adaptor::WatchApplication::New( argc, argv, stylesheet, OPAQUE );
- return WatchApplication(internal.Get());
-}
-
-WatchApplication::~WatchApplication()
-{
-}
-
-WatchApplication::WatchApplication()
-{
-}
-
-WatchApplication::WatchApplication(const WatchApplication& implementation)
-: Application(implementation)
-{
-}
-
-WatchApplication& WatchApplication::operator=(const WatchApplication& application)
-{
- if( *this != application )
- {
- BaseHandle::operator=( application );
- }
- return *this;
-}
-
-WatchApplication::WatchTimeSignal& WatchApplication::TimeTickSignal()
-{
- return Internal::Adaptor::GetImplementation(*this).mTickSignal;
-}
-
-WatchApplication::WatchTimeSignal& WatchApplication::AmbientTickSignal()
-{
- return Internal::Adaptor::GetImplementation(*this).mAmbientTickSignal;
-}
-
-WatchApplication::WatchBoolSignal& WatchApplication::AmbientChangedSignal()
-{
- return Internal::Adaptor::GetImplementation(*this).mAmbientChangeSignal;
-}
-
-WatchApplication::WatchApplication(Internal::Adaptor::WatchApplication* implementation)
-: Application(implementation)
-{
-}
-
-
-} // namespace Dali
+++ /dev/null
-#ifndef __DALI_WATCH_APPLICATION_H__
-#define __DALI_WATCH_APPLICATION_H__
-
-/*
- * Copyright (c) 2016 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 <string>
-#include <dali/public-api/object/base-handle.h>
-#include <dali/public-api/signals/callback.h>
-
-// INTERNAL INCLUDES
-#include "application.h"
-#include "watch-time.h"
-
-namespace Dali
-{
-/**
- * @addtogroup dali_adaptor_framework
- * @{
- */
-namespace Internal DALI_INTERNAL
-{
-namespace Adaptor
-{
-class WatchApplication;
-}
-}
-
-/**
- * @brief A WatchApplication class object should be created by every watch application
- * that wishes to use Dali.
- *
- * It provides a means for initialising the resources required by the Dali::Core.
- * Like Application class, the WatchApplication class manages Tizen watch application life cycle.
- *
- * The WatchApplication class emits additional signals which are availalble only in the watch application
- * (TimeTick, AmbientTick, AmbientChanged)
- *
- * This feature is supported in wearable applications only.
- *
- * WatchApplication should follow the example below:
- *
- * @code
- * class ExampleController: public ConnectionTracker
- * {
- * public:
- * ExampleController( WatchApplication& application )
- * : mApplication( application )
- * {
- * mApplication.InitSignal().Connect( this, &ExampleController::Create );
- * }
- *
- * void Create( Application& application )
- * {
- * // Create Dali components...
- * }
- * ...
- * private:
- * WatchApplication& mApplication;
- * };
- *
- * int DALI_EXPORT_API main (int argc, char **argv)
- * {
- * WatchApplication app = WatchApplication::New(&argc, &argv);
- * ExampleController example( app );
- * app.MainLoop();
- * }
- * @endcode
- *
- * If required, you can also connect class member functions to a signal:
- *
- * @code
- * MyApplication app;
- * app.ResumeSignal().Connect(&app, &MyApplication::Resume);
- * @endcode
- *
- * When the above options are found, they are stripped from argv, and argc is updated appropriately.
- * @SINCE_1_1.37
- */
-
-class DALI_IMPORT_API WatchApplication : public Application
-{
-public:
- typedef Signal< void (Application&, const WatchTime &) > WatchTimeSignal; ///< Watch pointer signal callback type @SINCE_1_1.37
- typedef Signal< void (Application&, bool) > WatchBoolSignal; ///< Watch bool signal callback type @SINCE_1_1.37
-
-public:
-
- /**
- * @brief This is the constructor for applications without an argument list.
- * @SINCE_1_1.37
- */
- static WatchApplication New();
-
- /**
- * @brief This is the constructor for applications.
- *
- * @SINCE_1_1.37
- * @param[in,out] argc A pointer to the number of arguments
- * @param[in,out] argv A pointer the the argument list
- */
- static WatchApplication New( int* argc, char **argv[] );
-
- /**
- * @brief This is the constructor for applications with a name
- *
- * @SINCE_1_1.37
- * @param[in,out] argc A pointer to the number of arguments
- * @param[in,out] argv A pointer the the argument list
- * @param[in] stylesheet The path to user defined theme file
- */
- static WatchApplication New( int* argc, char **argv[], const std::string& stylesheet );
-
- /**
- * @brief Construct an empty handle
- * @SINCE_1_1.37
- */
- WatchApplication();
-
- /**
- * @brief Copy Constructor
- * @SINCE_1_1.37
- */
- WatchApplication( const WatchApplication& implementation );
-
- /**
- * @brief Assignment operator
- * @SINCE_1_1.37
- */
- WatchApplication& operator=( const WatchApplication& applicaton );
-
- /**
- * @brief Destructor
- *
- * This is non-virtual since derived Handle types must not contain data or virtual methods.
- * @SINCE_1_1.37
- */
- ~WatchApplication();
-
-public:
- /**
- * @brief This signal is emitted at every second
- * A callback of the following type may be connected:
- * @code
- * void YourCallbackName(Application& application, WatchTimeSignal &time);
- * @endcode
- * time(watch time handle) will not be available after returning this callback. It will be freed by the framework.
- * @SINCE_1_1.37
- */
- WatchTimeSignal& TimeTickSignal();
-
- /**
- * @brief This signal is emitted at every second in ambient mode
- * A callback of the following type may be connected:
- * @code
- * void YourCallbackName(Application& application, WatchTimeSignal &time);
- * @endcode
- * time(watch time handle) will not be available after returning this callback. It will be freed by the framework.
- * @SINCE_1_1.37
- */
- WatchTimeSignal& AmbientTickSignal();
-
- /**
- * @brief This signal is emitted when the device enters or exits ambient mode
- * A callback of the following type may be connected:
- * @code
- * void YourCallbackName(Application& application, bool ambient);
- * @endcode
- * ambient_mode If true the device enters the ambient mode, otherwise false
- * @SINCE_1_1.37
- */
- WatchBoolSignal& AmbientChangedSignal();
-
-public: // Not intended for application developers
- /**
- * @brief Internal constructor
- * @SINCE_1_1.37
- */
- explicit DALI_INTERNAL WatchApplication(Internal::Adaptor::WatchApplication* implementation);
-};
-
-/**
- * @}
- */
-} // namespace Dali
-
-#endif // __DALI_WATCH_APPLICATION_H__
+++ /dev/null
-#ifndef __DALI_WATCH_TIME_H__
-#define __DALI_WATCH_TIME_H__
-
-/*
- * Copyright (c) 2016 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
-
-// INTERNAL INCLUDES
-#include <dali/public-api/dali-core.h>
-
-namespace Dali
-{
-/**
- * @addtogroup dali_adaptor_framework
- * @{
- */
-
-/**
- * @brief The WatchTime class is used to get time for the WatchApplication.
- *
- * A WatchTime has a time handle from watch application framework.
- * You can get time(hour, minute, second) on receiving timeTick signal
- * @SINCE_1_1.37
- */
-class DALI_IMPORT_API WatchTime
-{
-public:
-
- /**
- * @brief Constructor
- * @SINCE_1_1.37
- */
- WatchTime();
-
- /**
- * @brief Destructor
- * @SINCE_1_1.37
- */
- ~WatchTime();
-
- /**
- * @brief return current hour
- *
- * @SINCE_1_1.37
- * @pre The WatchTime needs to be initialized.
- */
- int GetHour() const;
-
- /**
- * @brief return current hour24
- *
- * @SINCE_1_1.37
- * @pre The WatchTime needs to be initialized.
- */
- int GetHour24() const;
-
- /**
- * @brief return current minute
- *
- * @SINCE_1_1.37
- * @pre The WatchTime needs to be initialized.
- */
- int GetMinute() const;
-
- /**
- * @brief return current second
- *
- * @SINCE_1_1.37
- * @pre The WatchTime needs to be initialized.
- */
- int GetSecond() const;
-
-public: // Not intended for application developers
- DALI_INTERNAL WatchTime(void *time_handle);
-
-private: // Internal Data
-
- struct Impl;
- Impl* mImpl;
-};
-
-/**
- * @}
- */
-} // namespace Dali
-
-#endif // __DALI_WATCH_TIME_H__
$(adaptor_public_api_dir)/adaptor-framework/timer.cpp \
$(adaptor_public_api_dir)/adaptor-framework/tts-player.cpp \
$(adaptor_public_api_dir)/adaptor-framework/native-image-source.cpp \
- $(adaptor_public_api_dir)/adaptor-framework/watch-application.cpp \
$(adaptor_public_api_dir)/dali-adaptor-version.cpp
$(adaptor_public_api_dir)/adaptor-framework/timer.h \
$(adaptor_public_api_dir)/adaptor-framework/tts-player.h \
$(adaptor_public_api_dir)/adaptor-framework/native-image-source.h \
- $(adaptor_public_api_dir)/adaptor-framework/window.h \
- $(adaptor_public_api_dir)/adaptor-framework/watch-application.h \
- $(adaptor_public_api_dir)/adaptor-framework/watch-time.h
+ $(adaptor_public_api_dir)/adaptor-framework/window.h
adaptor_dali_header_file = \
$(adaptor_public_api_dir)/dali.h
// INTERNAL INCLUDES
#include <callback-manager.h>
-#include <watch-application-impl.h>
-#include <watch-time.h>
namespace Dali
{
*/
// INTERNAL INCLUDES
-#include <dali/public-api/adaptor-framework/watch-application.h>
+#include <dali/public-api/watch/watch-application.h>
#endif // __DALI_WEARABLE_H__
\ No newline at end of file
# wearable profile public files
-adaptor_dali_wearable_header_files = \
+adaptor_internal_wearable_profile_src_files = \
+ $(adaptor_wearable_dir)/watch-application-impl.cpp \
+ $(adaptor_wearable_dir)/watch/watch-application.cpp \
+ $(adaptor_wearable_dir)/watch/watch-time.cpp
+
+adaptor_dali_wearable_header_file = \
$(adaptor_wearable_dir)/dali-wearable.h
+
+public_dali_watch_header_files = \
+ $(adaptor_wearable_dir)/watch/watch-application.h \
+ $(adaptor_wearable_dir)/watch/watch-time.h
--- /dev/null
+/*
+ * Copyright (c) 2016 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 "watch-application-impl.h"
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+WatchApplicationPtr WatchApplication::New(
+ int* argc,
+ char **argv[],
+ const std::string& stylesheet,
+ Dali::WatchApplication::WINDOW_MODE windowMode)
+{
+ WatchApplicationPtr watch ( new WatchApplication (argc, argv, stylesheet, windowMode ) );
+ return watch;
+}
+
+WatchApplication::WatchApplication( int* argc, char** argv[], const std::string& stylesheet, Dali::Application::WINDOW_MODE windowMode )
+: Application(argc, argv, stylesheet, windowMode, Framework::WATCH)
+{
+}
+
+WatchApplication::~WatchApplication()
+{
+}
+
+void WatchApplication::OnTimeTick(WatchTime& time)
+{
+ Dali::WatchApplication watch(this);
+ mTickSignal.Emit( watch, time );
+}
+
+void WatchApplication::OnAmbientTick(WatchTime& time)
+{
+ Dali::WatchApplication watch(this);
+ mAmbientTickSignal.Emit( watch, time );
+}
+
+void WatchApplication::OnAmbientChanged(bool ambient)
+{
+ Dali::WatchApplication watch(this);
+ mAmbientChangeSignal.Emit( watch, ambient );
+}
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
--- /dev/null
+#ifndef __DALI_INTERNAL_WATCH_APPLICATION_H__
+#define __DALI_INTERNAL_WATCH_APPLICATION_H__
+
+/*
+ * Copyright (c) 2016 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 <wearable/watch/watch-application.h>
+#include <application-impl.h>
+
+namespace Dali
+{
+class Adaptor;
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+class WatchApplication;
+typedef IntrusivePtr<WatchApplication> WatchApplicationPtr;
+
+/**
+ * Implementation of the WatchApplication class.
+ */
+class WatchApplication : public Application
+{
+public:
+ typedef Dali::WatchApplication::WatchTimeSignal WatchTimeSignal;
+ typedef Dali::WatchApplication::WatchBoolSignal WatchBoolSignal;
+
+ /**
+ * Create a new watch
+ * @param[in] argc A pointer to the number of arguments
+ * @param[in] argv A pointer to the argument list
+ * @param[in] stylesheet The path to user defined theme file
+ * @param[in] windowMode A member of Dali::Watch::WINDOW_MODE
+ */
+ static WatchApplicationPtr New( int* argc, char **argv[], const std::string& stylesheet, WINDOW_MODE windowMode );
+
+ /**
+ * 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
+ * @param[in] windowMode A member of Dali::Watch::WINDOW_MODE
+ */
+ WatchApplication( int* argc, char **argv[], const std::string& stylesheet, WINDOW_MODE windowMode );
+
+ /**
+ * Destructor
+ */
+ virtual ~WatchApplication();
+
+ /**
+ * Called every second
+ */
+ void OnTimeTick(WatchTime& time);
+
+ /**
+ * Called every second in ambient mode
+ */
+ void OnAmbientTick(WatchTime& time);
+
+ /**
+ * Called when the device enters or exits ambient mode
+ */
+ void OnAmbientChanged(bool ambient);
+
+private:
+
+ // @brief Undefined copy constructor.
+ WatchApplication( const WatchApplication& );
+
+ // @brief Undefined assignment operator.
+ WatchApplication& operator=( const WatchApplication& );
+
+public:
+
+ // Signals
+ WatchTimeSignal mTickSignal;
+ WatchTimeSignal mAmbientTickSignal;
+ WatchBoolSignal mAmbientChangeSignal;
+};
+
+inline WatchApplication& GetImplementation(Dali::WatchApplication& watch)
+{
+ DALI_ASSERT_ALWAYS(watch && "watch handle is empty");
+
+ BaseObject& handle = watch.GetBaseObject();
+
+ return static_cast<Internal::Adaptor::WatchApplication&>(handle);
+}
+
+inline const WatchApplication& GetImplementation(const Dali::WatchApplication& watch)
+{
+ DALI_ASSERT_ALWAYS(watch && "Time handle is empty");
+
+ const BaseObject& handle = watch.GetBaseObject();
+
+ return static_cast<const Internal::Adaptor::WatchApplication&>(handle);
+}
+
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
+
+#endif // __DALI_INTERNAL_WATCH_APPLICATION_H__
--- /dev/null
+/*
+ * Copyright (c) 2016 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 "watch-application.h"
+
+// EXTERNAL INCLUDES
+#include <dali/integration-api/debug.h>
+
+// INTERNAL INCLUDES
+#include <wearable/watch-application-impl.h>
+
+namespace Dali
+{
+
+WatchApplication WatchApplication::New()
+{
+ return New( NULL, NULL );
+}
+
+WatchApplication WatchApplication::New( int* argc, char **argv[] )
+{
+ Internal::Adaptor::WatchApplicationPtr internal = Internal::Adaptor::WatchApplication::New( argc, argv, "", OPAQUE );
+ return WatchApplication(internal.Get());
+}
+
+WatchApplication WatchApplication::New( int* argc, char **argv[], const std::string& stylesheet )
+{
+ Internal::Adaptor::WatchApplicationPtr internal = Internal::Adaptor::WatchApplication::New( argc, argv, stylesheet, OPAQUE );
+ return WatchApplication(internal.Get());
+}
+
+WatchApplication::~WatchApplication()
+{
+}
+
+WatchApplication::WatchApplication()
+{
+}
+
+WatchApplication::WatchApplication(const WatchApplication& implementation)
+: Application(implementation)
+{
+}
+
+WatchApplication& WatchApplication::operator=(const WatchApplication& application)
+{
+ if( *this != application )
+ {
+ BaseHandle::operator=( application );
+ }
+ return *this;
+}
+
+WatchApplication::WatchTimeSignal& WatchApplication::TimeTickSignal()
+{
+ return Internal::Adaptor::GetImplementation(*this).mTickSignal;
+}
+
+WatchApplication::WatchTimeSignal& WatchApplication::AmbientTickSignal()
+{
+ return Internal::Adaptor::GetImplementation(*this).mAmbientTickSignal;
+}
+
+WatchApplication::WatchBoolSignal& WatchApplication::AmbientChangedSignal()
+{
+ return Internal::Adaptor::GetImplementation(*this).mAmbientChangeSignal;
+}
+
+WatchApplication::WatchApplication(Internal::Adaptor::WatchApplication* implementation)
+: Application(implementation)
+{
+}
+
+
+} // namespace Dali
--- /dev/null
+#ifndef __DALI_WATCH_APPLICATION_H__
+#define __DALI_WATCH_APPLICATION_H__
+
+/*
+ * Copyright (c) 2016 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 <string>
+#include <dali/public-api/object/base-handle.h>
+#include <dali/public-api/signals/callback.h>
+
+// INTERNAL INCLUDES
+#include <public-api/adaptor-framework/application.h>
+#include "watch-time.h"
+
+namespace Dali
+{
+/**
+ * @addtogroup dali_adaptor_framework
+ * @{
+ */
+namespace Internal DALI_INTERNAL
+{
+namespace Adaptor
+{
+class WatchApplication;
+}
+}
+
+/**
+ * @brief A WatchApplication class object should be created by every watch application
+ * that wishes to use Dali.
+ *
+ * It provides a means for initialising the resources required by the Dali::Core.
+ * Like Application class, the WatchApplication class manages Tizen watch application life cycle.
+ *
+ * The WatchApplication class emits additional signals which are availalble only in the watch application
+ * (TimeTick, AmbientTick, AmbientChanged)
+ *
+ * This feature is supported in wearable applications only.
+ *
+ * WatchApplication should follow the example below:
+ *
+ * @code
+ * class ExampleController: public ConnectionTracker
+ * {
+ * public:
+ * ExampleController( WatchApplication& application )
+ * : mApplication( application )
+ * {
+ * mApplication.InitSignal().Connect( this, &ExampleController::Create );
+ * }
+ *
+ * void Create( Application& application )
+ * {
+ * // Create Dali components...
+ * }
+ * ...
+ * private:
+ * WatchApplication& mApplication;
+ * };
+ *
+ * int DALI_EXPORT_API main (int argc, char **argv)
+ * {
+ * WatchApplication app = WatchApplication::New(&argc, &argv);
+ * ExampleController example( app );
+ * app.MainLoop();
+ * }
+ * @endcode
+ *
+ * If required, you can also connect class member functions to a signal:
+ *
+ * @code
+ * MyApplication app;
+ * app.ResumeSignal().Connect(&app, &MyApplication::Resume);
+ * @endcode
+ *
+ * When the above options are found, they are stripped from argv, and argc is updated appropriately.
+ * @SINCE_1_1.37
+ */
+
+class DALI_IMPORT_API WatchApplication : public Application
+{
+public:
+ typedef Signal< void (Application&, const WatchTime &) > WatchTimeSignal; ///< Watch pointer signal callback type @SINCE_1_1.37
+ typedef Signal< void (Application&, bool) > WatchBoolSignal; ///< Watch bool signal callback type @SINCE_1_1.37
+
+public:
+
+ /**
+ * @brief This is the constructor for applications without an argument list.
+ * @SINCE_1_1.37
+ */
+ static WatchApplication New();
+
+ /**
+ * @brief This is the constructor for applications.
+ *
+ * @SINCE_1_1.37
+ * @param[in,out] argc A pointer to the number of arguments
+ * @param[in,out] argv A pointer the the argument list
+ */
+ static WatchApplication New( int* argc, char **argv[] );
+
+ /**
+ * @brief This is the constructor for applications with a name
+ *
+ * @SINCE_1_1.37
+ * @param[in,out] argc A pointer to the number of arguments
+ * @param[in,out] argv A pointer the the argument list
+ * @param[in] stylesheet The path to user defined theme file
+ */
+ static WatchApplication New( int* argc, char **argv[], const std::string& stylesheet );
+
+ /**
+ * @brief Construct an empty handle
+ * @SINCE_1_1.37
+ */
+ WatchApplication();
+
+ /**
+ * @brief Copy Constructor
+ * @SINCE_1_1.37
+ */
+ WatchApplication( const WatchApplication& implementation );
+
+ /**
+ * @brief Assignment operator
+ * @SINCE_1_1.37
+ */
+ WatchApplication& operator=( const WatchApplication& applicaton );
+
+ /**
+ * @brief Destructor
+ *
+ * This is non-virtual since derived Handle types must not contain data or virtual methods.
+ * @SINCE_1_1.37
+ */
+ ~WatchApplication();
+
+public:
+ /**
+ * @brief This signal is emitted at every second
+ * A callback of the following type may be connected:
+ * @code
+ * void YourCallbackName(Application& application, WatchTimeSignal &time);
+ * @endcode
+ * time(watch time handle) will not be available after returning this callback. It will be freed by the framework.
+ * @SINCE_1_1.37
+ */
+ WatchTimeSignal& TimeTickSignal();
+
+ /**
+ * @brief This signal is emitted at every second in ambient mode
+ * A callback of the following type may be connected:
+ * @code
+ * void YourCallbackName(Application& application, WatchTimeSignal &time);
+ * @endcode
+ * time(watch time handle) will not be available after returning this callback. It will be freed by the framework.
+ * @SINCE_1_1.37
+ */
+ WatchTimeSignal& AmbientTickSignal();
+
+ /**
+ * @brief This signal is emitted when the device enters or exits ambient mode
+ * A callback of the following type may be connected:
+ * @code
+ * void YourCallbackName(Application& application, bool ambient);
+ * @endcode
+ * ambient_mode If true the device enters the ambient mode, otherwise false
+ * @SINCE_1_1.37
+ */
+ WatchBoolSignal& AmbientChangedSignal();
+
+public: // Not intended for application developers
+ /**
+ * @brief Internal constructor
+ * @SINCE_1_1.37
+ */
+ explicit DALI_INTERNAL WatchApplication(Internal::Adaptor::WatchApplication* implementation);
+};
+
+/**
+ * @}
+ */
+} // namespace Dali
+
+#endif // __DALI_WATCH_APPLICATION_H__
--- /dev/null
+/*
+ * Copyright (c) 2016 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 <wearable/watch/watch-time.h>
+
+// EXTERNAL INCLUDES
+#ifdef APPCORE_WATCH_AVAILABLE
+#include <appcore-watch/watch_app.h>
+#endif
+
+namespace Dali
+{
+
+struct WatchTime::Impl
+{
+ Impl(void *time_handle)
+ : mTimeHandle(time_handle)
+ {
+ }
+
+ void *mTimeHandle;
+};
+
+WatchTime::WatchTime()
+ :mImpl(NULL)
+{
+}
+
+WatchTime::WatchTime(void *time_handle)
+{
+ mImpl = new Impl(time_handle);
+}
+
+WatchTime::~WatchTime()
+{
+ if( mImpl )
+ {
+ delete mImpl;
+ mImpl = NULL;
+ }
+}
+
+#ifdef APPCORE_WATCH_AVAILABLE
+
+int WatchTime::GetHour() const
+{
+ int hour;
+
+ watch_time_get_hour(reinterpret_cast<watch_time_h>(mImpl->mTimeHandle), &hour);
+ return hour;
+}
+
+int WatchTime::GetHour24() const
+{
+ int hour24;
+
+ watch_time_get_hour24(reinterpret_cast<watch_time_h>(mImpl->mTimeHandle), &hour24);
+ return hour24;
+}
+
+int WatchTime::GetMinute() const
+{
+ int minute;
+
+ watch_time_get_minute(reinterpret_cast<watch_time_h>(mImpl->mTimeHandle), &minute);
+ return minute;
+}
+
+int WatchTime::GetSecond() const
+{
+ int second;
+
+ watch_time_get_second(reinterpret_cast<watch_time_h>(mImpl->mTimeHandle), &second);
+ return second;
+}
+
+#else
+
+int WatchTime::GetHour() const
+{
+ return 0;
+}
+
+int WatchTime::GetHour24() const
+{
+ return 0;
+}
+
+int WatchTime::GetMinute() const
+{
+ return 0;
+}
+
+int WatchTime::GetSecond() const
+{
+ return 0;
+}
+
+#endif
+
+} // namespace Dali
--- /dev/null
+#ifndef __DALI_WATCH_TIME_H__
+#define __DALI_WATCH_TIME_H__
+
+/*
+ * Copyright (c) 2016 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
+
+// INTERNAL INCLUDES
+#include <dali/public-api/dali-core.h>
+
+namespace Dali
+{
+/**
+ * @addtogroup dali_adaptor_framework
+ * @{
+ */
+
+/**
+ * @brief The WatchTime class is used to get time for the WatchApplication.
+ *
+ * A WatchTime has a time handle from watch application framework.
+ * You can get time(hour, minute, second) on receiving timeTick signal
+ * @SINCE_1_1.37
+ */
+class DALI_IMPORT_API WatchTime
+{
+public:
+
+ /**
+ * @brief Constructor
+ * @SINCE_1_1.37
+ */
+ WatchTime();
+
+ /**
+ * @brief Destructor
+ * @SINCE_1_1.37
+ */
+ ~WatchTime();
+
+ /**
+ * @brief return current hour
+ *
+ * @SINCE_1_1.37
+ * @pre The WatchTime needs to be initialized.
+ */
+ int GetHour() const;
+
+ /**
+ * @brief return current hour24
+ *
+ * @SINCE_1_1.37
+ * @pre The WatchTime needs to be initialized.
+ */
+ int GetHour24() const;
+
+ /**
+ * @brief return current minute
+ *
+ * @SINCE_1_1.37
+ * @pre The WatchTime needs to be initialized.
+ */
+ int GetMinute() const;
+
+ /**
+ * @brief return current second
+ *
+ * @SINCE_1_1.37
+ * @pre The WatchTime needs to be initialized.
+ */
+ int GetSecond() const;
+
+public: // Not intended for application developers
+ DALI_INTERNAL WatchTime(void *time_handle);
+
+private: // Internal Data
+
+ struct Impl;
+ Impl* mImpl;
+};
+
+/**
+ * @}
+ */
+} // namespace Dali
+
+#endif // __DALI_WATCH_TIME_H__
endif # USE_ECORE_WAYLAND
adaptor_internal_src_files += $(adaptor_tizen_internal_egl_extension_src_files) \
- $(adaptor_tizen_internal_native_image_src_files)
+ $(adaptor_tizen_internal_native_image_src_files) \
+ $(adaptor_internal_wearable_profile_src_files)
else
adaptor_internal_src_files += $(adaptor_x11_tizen_internal_src_files) \
$(adaptor_common_internal_egl_extension_src_files)
tizenadaptorpublicapidir = $(devincludepath)/dali/public-api
tizenadaptorpublicapi_HEADERS = $(public_api_header_files)
-if WEARABLE_PROFILE
-tizenadaptorpublicapi_HEADERS += $(adaptor_dali_wearable_header_files)
-endif
tizenadaptordevelapidir= $(devincludepath)/dali/devel-api
tizenadaptordaliheaderdir = $(devincludepath)/dali
tizenadaptordaliheader_HEADERS = $(adaptor_dali_header_file)
+if WEARABLE_PROFILE
+tizenadaptorpublicapi_HEADERS += $(adaptor_dali_wearable_header_file)
+
+tizenwatchpublicapidir = $(tizenadaptorpublicapidir)/watch
+tizenwatchpublicapi_HEADERS = $(public_dali_watch_header_files)
+endif
+
install-data-local:
$(MKDIR_P) ${DESTDIR}/${daliUserFontCacheDir} ${DESTDIR}/${daliShaderbinCacheDir}