Implement WatchApplication class 11/70111/12
authorsuhyung Eom <suhyung.eom@samsung.com>
Thu, 28 Apr 2016 07:28:44 +0000 (16:28 +0900)
committersu hyung Eom <suhyung.eom@samsung.com>
Wed, 1 Jun 2016 01:08:57 +0000 (18:08 -0700)
Signed-off-by: suhyung Eom <suhyung.eom@samsung.com>
Change-Id: Ic18e12302823303adff8faaa14a36f063ac6d0f6

19 files changed:
adaptors/common/application-impl.cpp
adaptors/common/application-impl.h
adaptors/common/file.list
adaptors/common/framework.h
adaptors/common/watch-application-impl.cpp [new file with mode: 0644]
adaptors/common/watch-application-impl.h [new file with mode: 0644]
adaptors/common/watch-time.cpp [new file with mode: 0644]
adaptors/libuv/framework-libuv.cpp
adaptors/public-api/adaptor-framework/application.cpp
adaptors/public-api/adaptor-framework/watch-application.cpp [new file with mode: 0644]
adaptors/public-api/adaptor-framework/watch-application.h [new file with mode: 0644]
adaptors/public-api/adaptor-framework/watch-time.h [new file with mode: 0644]
adaptors/public-api/dali.h
adaptors/public-api/file.list
adaptors/tizen/framework-tizen.cpp
adaptors/ubuntu/framework-ubuntu.cpp
build/tizen/adaptor/Makefile.am
build/tizen/adaptor/configure.ac
packaging/dali-adaptor.spec

index 87daa3c..e43871f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * 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.
@@ -51,13 +51,15 @@ ApplicationPtr Application::New(
   int* argc,
   char **argv[],
   const std::string& stylesheet,
-  Dali::Application::WINDOW_MODE windowMode)
+  Dali::Application::WINDOW_MODE windowMode,
+  Framework::Type applicationType)
 {
-  ApplicationPtr application ( new Application (argc, argv, stylesheet, windowMode ) );
+  ApplicationPtr application ( new Application (argc, argv, stylesheet, windowMode, applicationType ) );
   return application;
 }
 
-Application::Application( int* argc, char** argv[], const std::string& stylesheet, Dali::Application::WINDOW_MODE windowMode )
+Application::Application( int* argc, char** argv[], const std::string& stylesheet,
+  Dali::Application::WINDOW_MODE windowMode, Framework::Type applicationType )
 : mInitSignal(),
   mTerminateSignal(),
   mPauseSignal(),
@@ -91,8 +93,7 @@ Application::Application( int* argc, char** argv[], const std::string& styleshee
   }
 
   mCommandLineOptions = new CommandLineOptions(argc, argv);
-
-  mFramework = new Framework( *this, argc, argv );
+  mFramework = new Framework( *this, argc, argv, applicationType );
 }
 
 Application::~Application()
index e323b0e..68de173 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_APPLICATION_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * 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.
@@ -54,7 +54,6 @@ typedef IntrusivePtr<Application> ApplicationPtr;
 class Application : public BaseObject, public Framework::Observer
 {
 public:
-
   typedef Dali::Application::AppSignalType AppSignalType;
   typedef Dali::Application::AppControlSignalType AppControlSignalType;
   typedef Dali::Application::WINDOW_MODE WINDOW_MODE;
@@ -65,8 +64,10 @@ public:
    * @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::Application::WINDOW_MODE
+   * @param[in]  applicationType  A member of Dali::Framework::Type
    */
-  static ApplicationPtr New( int* argc, char **argv[], const std::string& stylesheet, WINDOW_MODE windowMode );
+  static ApplicationPtr New( int* argc, char **argv[], const std::string& stylesheet,
+    WINDOW_MODE windowMode, Framework::Type applicationType );
 
 public:
 
@@ -245,7 +246,7 @@ public:  // Signals
   */
   Dali::Application::AppSignalType& MemoryLowSignal() { return mMemoryLowSignal; }
 
-private:
+protected:
 
   /**
    * Private Constructor
@@ -254,7 +255,8 @@ private:
    * @param[in]  stylesheet  The path to user defined theme file
    * @param[in]  windowMode  A member of Dali::Application::WINDOW_MODE
    */
-  Application( int* argc, char **argv[], const std::string& stylesheet, WINDOW_MODE windowMode );
+  Application( int* argc, char **argv[], const std::string& stylesheet,
+      WINDOW_MODE windowMode, Framework::Type applicationType );
 
   /**
    * Destructor
@@ -265,7 +267,6 @@ private:
   Application(const Application&);
   Application& operator=(Application&);
 
-private:
   /**
    * Creates the window
    */
index a2532dc..35ef1db 100644 (file)
@@ -28,6 +28,8 @@ adaptor_common_internal_src_files = \
   $(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)/events/gesture-manager.cpp \
index 3704431..b0c88fd 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_FRAMEWORK_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * 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.
 // EXTERNAL INCLUDES
 #include <string>
 #include <dali/public-api/signals/callback.h>
+#include <watch-application.h>
 
 // INTERNAL INCLUDES
-#include "abort-handler.h"
+#include <abort-handler.h>
 
 namespace Dali
 {
@@ -42,6 +43,11 @@ namespace Adaptor
 class Framework
 {
 public:
+  enum Type
+  {
+    NORMAL,       ///<  normal appFramework
+    WATCH     ///< watch appFramework
+  };
 
   /**
    * Observer class for the framework.
@@ -82,6 +88,21 @@ public:
     virtual void OnAppControl(void *) {}
 
     /**
+     * Invoked at every second
+     */
+    virtual void OnTimeTick(WatchTime&) {}
+
+    /**
+     * Invoked at every second in ambient mode
+     */
+    virtual void OnAmbientTick(WatchTime&) {}
+
+    /**
+     * Invoked when the device enters or exits ambient mode
+     */
+    virtual void OnAmbientChanged(bool ambient) {}
+
+    /**
      * Invoked when the language of the device is changed.
      */
     virtual void OnLanguageChanged() {}
@@ -109,8 +130,9 @@ public:
    * @param[in]  observer  The observer of the Framework.
    * @param[in]  argc      A pointer to the number of arguments.
    * @param[in]  argv      A pointer the the argument list.
+   * @param[in]  type      The type of application
    */
-  Framework( Observer& observer, int* argc, char ***argv );
+  Framework( Observer& observer, int* argc, char ***argv, Type type = NORMAL );
 
   /**
    * Destructor
@@ -160,6 +182,12 @@ private:
   Framework& operator=(Framework&);
 
 private:
+
+  /**
+   * Called when the application is created.
+   */
+  bool Create();
+
   /**
    * Called by the App framework when an application lifecycle event occurs.
    * @param[in] type The type of event occurred.
@@ -201,7 +229,6 @@ private: // impl members
 
   struct Impl;
   Impl* mImpl;
-
 };
 
 } // namespace Adaptor
diff --git a/adaptors/common/watch-application-impl.cpp b/adaptors/common/watch-application-impl.cpp
new file mode 100644 (file)
index 0000000..da3eae8
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ * 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
diff --git a/adaptors/common/watch-application-impl.h b/adaptors/common/watch-application-impl.h
new file mode 100644 (file)
index 0000000..5466497
--- /dev/null
@@ -0,0 +1,126 @@
+#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__
diff --git a/adaptors/common/watch-time.cpp b/adaptors/common/watch-time.cpp
new file mode 100644 (file)
index 0000000..756b84e
--- /dev/null
@@ -0,0 +1,116 @@
+/*
+ * 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
index e1815f6..cc7dc77 100644 (file)
@@ -94,7 +94,7 @@ private:
   Impl& operator=( const Impl& impl );
 };
 
-Framework::Framework( Framework::Observer& observer, int *argc, char ***argv )
+Framework::Framework( Framework::Observer& observer, int *argc, char ***argv, Type type )
 : mObserver(observer),
   mInitialised(false),
   mRunning(false),
index fac96f1..0a5e4f3 100644 (file)
@@ -34,19 +34,22 @@ Application Application::New()
 
 Application Application::New( int* argc, char **argv[] )
 {
-  Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::New( argc, argv, "", OPAQUE );
+  Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::New( argc, argv, "", OPAQUE,
+    Internal::Adaptor::Framework::NORMAL);
   return Application(internal.Get());
 }
 
 Application Application::New( int* argc, char **argv[], const std::string& stylesheet )
 {
-  Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::New( argc, argv, stylesheet, OPAQUE );
+  Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::New( argc, argv, stylesheet, OPAQUE,
+    Internal::Adaptor::Framework::NORMAL);
   return Application(internal.Get());
 }
 
 Application Application::New( int* argc, char **argv[], const std::string& stylesheet, WINDOW_MODE windowMode )
 {
-  Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::New( argc, argv, stylesheet, windowMode );
+  Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::New( argc, argv, stylesheet, windowMode,
+    Internal::Adaptor::Framework::NORMAL);
   return Application(internal.Get());
 }
 
diff --git a/adaptors/public-api/adaptor-framework/watch-application.cpp b/adaptors/public-api/adaptor-framework/watch-application.cpp
new file mode 100644 (file)
index 0000000..102b1b9
--- /dev/null
@@ -0,0 +1,90 @@
+/*
+ * 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
diff --git a/adaptors/public-api/adaptor-framework/watch-application.h b/adaptors/public-api/adaptor-framework/watch-application.h
new file mode 100644 (file)
index 0000000..fd6e2b0
--- /dev/null
@@ -0,0 +1,202 @@
+#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.36
+ */
+
+class DALI_IMPORT_API WatchApplication : public Application
+{
+public:
+  typedef Signal< void (Application&, const WatchTime &) > WatchTimeSignal; ///< Watch pointer signal callback type @SINCE_1_1.36
+  typedef Signal< void (Application&, bool) > WatchBoolSignal; ///< Watch bool signal callback type @SINCE_1_1.36
+
+public:
+
+  /**
+   * @brief This is the constructor for applications without an argument list.
+   * @SINCE_1_1.36
+   */
+  static WatchApplication New();
+
+  /**
+   * @brief This is the constructor for applications.
+   *
+   * @SINCE_1_1.36
+   * @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.36
+   * @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.36
+   */
+  WatchApplication();
+
+  /**
+   * @brief Copy Constructor
+   * @SINCE_1_1.36
+   */
+  WatchApplication( const WatchApplication& implementation );
+
+  /**
+   * @brief Assignment operator
+   * @SINCE_1_1.36
+   */
+  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.36
+   */
+  ~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.36
+   */
+  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.36
+   */
+  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.36
+   */
+  WatchBoolSignal& AmbientChangedSignal();
+
+public: // Not intended for application developers
+  /**
+   * @brief Internal constructor
+   * @SINCE_1_1.36
+   */
+  explicit DALI_INTERNAL WatchApplication(Internal::Adaptor::WatchApplication* implementation);
+};
+
+/**
+ * @}
+ */
+} // namespace Dali
+
+#endif // __DALI_WATCH_APPLICATION_H__
diff --git a/adaptors/public-api/adaptor-framework/watch-time.h b/adaptors/public-api/adaptor-framework/watch-time.h
new file mode 100644 (file)
index 0000000..1aee86c
--- /dev/null
@@ -0,0 +1,102 @@
+#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.36
+ */
+class DALI_IMPORT_API WatchTime
+{
+public:
+
+  /**
+   * @brief Constructor
+   * @SINCE_1_1.36
+   */
+  WatchTime();
+
+  /**
+   * @brief Destructor
+   * @SINCE_1_1.36
+   */
+  ~WatchTime();
+
+  /**
+   * @brief return current hour
+   *
+   * @SINCE_1_1.36
+   * @pre The WatchTime needs to be initialized.
+   */
+  int GetHour() const;
+
+  /**
+   * @brief return current hour24
+   *
+   * @SINCE_1_1.36
+   * @pre The WatchTime needs to be initialized.
+   */
+  int GetHour24() const;
+
+  /**
+   * @brief return current minute
+   *
+   * @SINCE_1_1.36
+   * @pre The WatchTime needs to be initialized.
+   */
+  int GetMinute() const;
+
+  /**
+   * @brief return current second
+   *
+   * @SINCE_1_1.36
+   * @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__
index 240215e..15a5f09 100644 (file)
@@ -27,6 +27,7 @@
 #include <dali/public-api/adaptor-framework/timer.h>
 #include <dali/public-api/adaptor-framework/tts-player.h>
 #include <dali/public-api/adaptor-framework/native-image-source.h>
+#include <dali/public-api/adaptor-framework/watch-application.h>
 #include <dali/public-api/dali-adaptor-version.h>
 
 #endif //__DALI_H__
index dbf643f..febcab3 100644 (file)
@@ -5,6 +5,7 @@ public_api_src_files = \
   $(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
 
 
@@ -21,7 +22,9 @@ public_api_adaptor_framework_header_files = \
   $(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/window.h \
+  $(adaptor_public_api_dir)/adaptor-framework/watch-application.h \
+  $(adaptor_public_api_dir)/adaptor-framework/watch-time.h
 
 adaptor_dali_header_file = \
   $(adaptor_public_api_dir)/dali.h
index 1d7450e..55edd29 100644 (file)
 #include <bundle.h>
 #include <Ecore.h>
 
-#ifndef TIZEN_SDK_2_2_COMPATIBILITY
 #include <system_info.h>
 #include <app_control_internal.h>
 #include <bundle_internal.h>
+#ifdef APPCORE_WATCH_AVAILABLE
+#include <appcore-watch/watch_app.h>
 #endif
 
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
 #include <callback-manager.h>
+#include <watch-application-impl.h>
+#include <watch-time.h>
 
 namespace Dali
 {
@@ -43,62 +46,25 @@ namespace Internal
 namespace Adaptor
 {
 
-namespace
-{
-
-/// Application Status Enum
-enum
-{
-  APP_CREATE,
-  APP_TERMINATE,
-  APP_PAUSE,
-  APP_RESUME,
-  APP_RESET,
-  APP_CONTROL,
-  APP_LANGUAGE_CHANGE,
-  APP_DEVICE_ROTATED,
-  APP_REGION_CHANGED,
-  APP_BATTERY_LOW,
-  APP_MEMORY_LOW
-};
-
-} // Unnamed namespace
-
 /**
  * Impl to hide EFL data members
  */
 struct Framework::Impl
 {
-  // Constructor
-
-  Impl(void* data)
+// Constructor
+  Impl(void* data, Type type )
   : mAbortCallBack( NULL ),
     mCallbackManager( NULL )
   {
-    mEventCallback.create = AppCreate;
-    mEventCallback.terminate = AppTerminate;
-    mEventCallback.pause = AppPause;
-    mEventCallback.resume = AppResume;
-
-#ifdef TIZEN_SDK_2_2_COMPATIBILITY
-    mEventCallback.service = AppService;
-
-    mEventCallback.low_memory = NULL;
-    mEventCallback.low_battery = NULL;
-    mEventCallback.device_orientation = AppDeviceRotated;
-    mEventCallback.language_changed = AppLanguageChanged;
-    mEventCallback.region_format_changed = NULL;
-
-#else
-    mEventCallback.app_control = AppControl;
+    mFramework = static_cast<Framework*>(data);
 
-    ui_app_add_event_handler(&handlers[APP_EVENT_LOW_BATTERY], APP_EVENT_LOW_BATTERY, AppBatteryLow, data);
-    ui_app_add_event_handler(&handlers[APP_EVENT_LOW_MEMORY], APP_EVENT_LOW_MEMORY, AppMemoryLow, data);
-    ui_app_add_event_handler(&handlers[APP_EVENT_DEVICE_ORIENTATION_CHANGED], APP_EVENT_DEVICE_ORIENTATION_CHANGED, AppDeviceRotated, data);
-    ui_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], APP_EVENT_LANGUAGE_CHANGED, AppLanguageChanged, data);
-    ui_app_add_event_handler(&handlers[APP_EVENT_REGION_FORMAT_CHANGED], APP_EVENT_REGION_FORMAT_CHANGED, AppRegionChanged, data);
+#ifndef APPCORE_WATCH_AVAILABLE
+    if ( type == WATCH )
+    {
+      throw Dali::DaliException( "", "Watch Application is not supported." );
+    }
 #endif
-
+    mApplicationType = type;
     mCallbackManager = CallbackManager::New();
   }
 
@@ -112,48 +78,70 @@ struct Framework::Impl
     delete mCallbackManager;
   }
 
-  // Data
+  int AppMain()
+  {
+    int ret;
+
+    if (mApplicationType == NORMAL)
+    {
+      ret = AppNormalMain();
+    }
+    else
+    {
+      ret = AppWatchMain();
+    }
+    return ret;
+  }
 
+  void AppExit()
+  {
+    if (mApplicationType == NORMAL)
+    {
+      AppNormalExit();
+    }
+    else
+    {
+      AppWatchExit();
+    }
+  }
+
+
+  // Data
+  Type mApplicationType;
   CallbackBase* mAbortCallBack;
   CallbackManager *mCallbackManager;
 
-#ifdef TIZEN_SDK_2_2_COMPATIBILITY
-  app_event_callback_s mEventCallback;
-#else
-  ui_app_lifecycle_callback_s mEventCallback;
+  Framework* mFramework;
   app_event_handler_h handlers[5];
+  ui_app_lifecycle_callback_s mEventCallback;
+#ifdef APPCORE_WATCH_AVAILABLE
+  watch_app_lifecycle_callback_s mWatchCallback;
 #endif
 
-  /**
-   * Called by AppCore on application creation.
-   */
   static bool AppCreate(void *data)
   {
-    return static_cast<Framework*>(data)->AppStatusHandler(APP_CREATE, NULL);
+    return static_cast<Framework*>(data)->Create();
   }
 
-  /**
-   * Called by AppCore when the application should terminate.
-   */
   static void AppTerminate(void *data)
   {
-    static_cast<Framework*>(data)->AppStatusHandler(APP_TERMINATE, NULL);
+    Observer *observer = &static_cast<Framework*>(data)->mObserver;
+
+    observer->OnTerminate();
   }
 
-  /**
-   * Called by AppCore when the application is paused.
-   */
   static void AppPause(void *data)
   {
-    static_cast<Framework*>(data)->AppStatusHandler(APP_PAUSE, NULL);
+    Observer *observer = &static_cast<Framework*>(data)->mObserver;
+
+    observer->OnPause();
   }
 
-  /**
-   * Called by AppCore when the application is resumed.
-   */
   static void AppResume(void *data)
   {
-    static_cast<Framework*>(data)->AppStatusHandler(APP_RESUME, NULL);
+    Observer *observer = &static_cast<Framework*>(data)->mObserver;
+
+    observer->OnResume();
   }
 
   static void ProcessBundle(Framework* framework, bundle *bundleData)
@@ -178,82 +166,141 @@ struct Framework::Impl
     }
   }
 
-#ifdef TIZEN_SDK_2_2_COMPATIBILITY
   /**
    * Called by AppCore when the application is launched from another module (e.g. homescreen).
    * @param[in] b the bundle data which the launcher module sent
    */
-  static void AppService(service_h service, void *data)
+  static void AppControl(app_control_h app_control, void *data)
   {
     Framework* framework = static_cast<Framework*>(data);
-
-    if(framework == NULL)
-    {
-      return;
-    }
+    Observer *observer = &framework->mObserver;
     bundle *bundleData = NULL;
 
-    service_to_bundle(service, &bundleData);
+    app_control_to_bundle(app_control, &bundleData);
     ProcessBundle(framework, bundleData);
 
-    framework->AppStatusHandler(APP_RESET, NULL);
+    observer->OnReset();
+    observer->OnAppControl(app_control);
   }
 
-  static void AppLanguageChanged(void* user_data)
+  int AppNormalMain()
   {
-    static_cast<Framework*>(user_data)->AppStatusHandler(APP_LANGUAGE_CHANGE, NULL);
+    int ret;
+
+    mEventCallback.create = AppCreate;
+    mEventCallback.terminate = AppTerminate;
+    mEventCallback.pause = AppPause;
+    mEventCallback.resume = AppResume;
+    mEventCallback.app_control = AppControl;
+
+    ui_app_add_event_handler(&handlers[APP_EVENT_LOW_BATTERY], APP_EVENT_LOW_BATTERY, AppBatteryLow, mFramework);
+    ui_app_add_event_handler(&handlers[APP_EVENT_LOW_MEMORY], APP_EVENT_LOW_MEMORY, AppMemoryLow, mFramework);
+    ui_app_add_event_handler(&handlers[APP_EVENT_DEVICE_ORIENTATION_CHANGED], APP_EVENT_DEVICE_ORIENTATION_CHANGED, AppDeviceRotated, mFramework);
+    ui_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], APP_EVENT_LANGUAGE_CHANGED, AppLanguageChanged, mFramework);
+    ui_app_add_event_handler(&handlers[APP_EVENT_REGION_FORMAT_CHANGED], APP_EVENT_REGION_FORMAT_CHANGED, AppRegionChanged, mFramework);
+
+    ret = ui_app_main(*mFramework->mArgc, *mFramework->mArgv, &mEventCallback, mFramework);
+
+    return ret;
   }
 
-  static void AppDeviceRotated(app_device_orientation_e orientation, void *user_data)
+  void AppNormalExit()
   {
-    static_cast<Framework*>(user_data)->AppStatusHandler(APP_DEVICE_ROTATED, NULL);
+      ui_app_exit();
   }
-#else
-  /**
-   * Called by AppCore when the application is launched from another module (e.g. homescreen).
-   * @param[in] b the bundle data which the launcher module sent
-   */
-  static void AppControl(app_control_h app_control, void *data)
+
+#ifdef APPCORE_WATCH_AVAILABLE
+  static bool AppCreateWatch(int width, int height, void *data)
   {
-    Framework* framework = static_cast<Framework*>(data);
-    if(framework == NULL)
-    {
-      return;
-    }
-    bundle *bundleData = NULL;
+    return static_cast<Framework*>(data)->Create();
+  }
 
-    app_control_to_bundle(app_control, &bundleData);
-    ProcessBundle(framework, bundleData);
+  static void AppTimeTick(watch_time_h time, void *data)
+  {
+    Observer *observer = &static_cast<Framework*>(data)->mObserver;
+    WatchTime curTime(time);
 
-    framework->AppStatusHandler(APP_RESET, NULL);
-    framework->AppStatusHandler(APP_CONTROL, app_control);
+    observer->OnTimeTick(curTime);
   }
 
-  static void AppLanguageChanged(app_event_info_h event_info, void *user_data)
+  static void AppAmbientTick(watch_time_h time, void *data)
   {
-    static_cast<Framework*>(user_data)->AppStatusHandler(APP_LANGUAGE_CHANGE, NULL);
+    Observer *observer = &static_cast<Framework*>(data)->mObserver;
+    WatchTime curTime(time);
+
+    observer->OnAmbientTick(curTime);
   }
 
-  static void AppDeviceRotated(app_event_info_h event_info, void *user_data)
+  static void AppAmbientChanged(bool ambient, void *data)
   {
-    static_cast<Framework*>(user_data)->AppStatusHandler(APP_DEVICE_ROTATED, NULL);
+    Observer *observer = &static_cast<Framework*>(data)->mObserver;
+
+    observer->OnAmbientChanged(ambient);
   }
+#endif
 
-  static void AppRegionChanged(app_event_info_h event_info, void *user_data)
+  int AppWatchMain()
   {
-    static_cast<Framework*>(user_data)->AppStatusHandler(APP_REGION_CHANGED, NULL);
+    int ret = true;
+
+#ifdef APPCORE_WATCH_AVAILABLE
+    mWatchCallback.create = AppCreateWatch;
+    mWatchCallback.app_control = AppControl;
+    mWatchCallback.terminate = AppTerminate;
+    mWatchCallback.pause = AppPause;
+    mWatchCallback.resume = AppResume;
+    mWatchCallback.time_tick = AppTimeTick;
+    mWatchCallback.ambient_tick = AppAmbientTick;
+    mWatchCallback.ambient_changed = AppAmbientChanged;
+
+    watch_app_add_event_handler(&handlers[APP_EVENT_LOW_BATTERY], APP_EVENT_LOW_BATTERY, AppBatteryLow, mFramework);
+    watch_app_add_event_handler(&handlers[APP_EVENT_LOW_MEMORY], APP_EVENT_LOW_MEMORY, AppMemoryLow, mFramework);
+    watch_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], APP_EVENT_LANGUAGE_CHANGED, AppLanguageChanged, mFramework);
+    watch_app_add_event_handler(&handlers[APP_EVENT_REGION_FORMAT_CHANGED], APP_EVENT_REGION_FORMAT_CHANGED, AppRegionChanged, mFramework);
+
+    ret = watch_app_main(*mFramework->mArgc, *mFramework->mArgv, &mWatchCallback, mFramework);
+#endif
+    return ret;
   }
 
-  static void AppBatteryLow(app_event_info_h event_info, void *user_data)
+  void AppWatchExit()
   {
-    static_cast<Framework*>(user_data)->AppStatusHandler(APP_BATTERY_LOW, NULL);
+#ifdef APPCORE_WATCH_AVAILABLE
+    watch_app_exit();
+#endif
   }
 
-  static void AppMemoryLow(app_event_info_h event_info, void *user_data)
+  static void AppLanguageChanged(app_event_info_h event, void *data)
   {
-    static_cast<Framework*>(user_data)->AppStatusHandler(APP_MEMORY_LOW, NULL);
+    Observer *observer = &static_cast<Framework*>(data)->mObserver;
+
+    observer->OnLanguageChanged();
+  }
+
+  static void AppDeviceRotated(app_event_info_h event_info, void *data)
+  {
+  }
+
+  static void AppRegionChanged(app_event_info_h event, void *data)
+  {
+    Observer *observer = &static_cast<Framework*>(data)->mObserver;
+
+    observer->OnRegionChanged();
+  }
+
+  static void AppBatteryLow(app_event_info_h event, void *data)
+  {
+    Observer *observer = &static_cast<Framework*>(data)->mObserver;
+
+    observer->OnBatteryLow();
+  }
+
+  static void AppMemoryLow(app_event_info_h event, void *data)
+  {
+    Observer *observer = &static_cast<Framework*>(data)->mObserver;
+
+    observer->OnMemoryLow();
   }
-#endif
 
 private:
   // Undefined
@@ -263,7 +310,7 @@ private:
   Impl& operator=( const Impl& impl );
 };
 
-Framework::Framework( Framework::Observer& observer, int *argc, char ***argv )
+Framework::Framework( Framework::Observer& observer, int *argc, char ***argv, Type type )
 : mObserver(observer),
   mInitialised(false),
   mRunning(false),
@@ -274,8 +321,6 @@ Framework::Framework( Framework::Observer& observer, int *argc, char ***argv )
   mAbortHandler( MakeCallback( this, &Framework::AbortCallback ) ),
   mImpl(NULL)
 {
-
-#ifndef TIZEN_SDK_2_2_COMPATIBILITY
   bool featureFlag = true;
   system_info_get_platform_bool( "tizen.org/feature/opengles.version.2_0", &featureFlag );
 
@@ -284,10 +329,9 @@ Framework::Framework( Framework::Observer& observer, int *argc, char ***argv )
     set_last_result( TIZEN_ERROR_NOT_SUPPORTED );
     throw Dali::DaliException( "", "OpenGL ES 2.0 is not supported." );
   }
-#endif
-
   InitThreads();
-  mImpl = new Impl(this);
+
+  mImpl = new Impl(this, type);
 }
 
 Framework::~Framework()
@@ -300,30 +344,29 @@ Framework::~Framework()
   delete mImpl;
 }
 
+bool Framework::Create()
+{
+  mInitialised = true;
+  mObserver.OnInit();
+  return true;
+}
+
 void Framework::Run()
 {
   mRunning = true;
+  int ret;
 
-#ifdef TIZEN_SDK_2_2_COMPATIBILITY
-  app_efl_main(mArgc, mArgv, &mImpl->mEventCallback, this);
-#else
-  int ret = ui_app_main(*mArgc, *mArgv, &mImpl->mEventCallback, this);
+  ret = mImpl->AppMain();
   if (ret != APP_ERROR_NONE)
   {
     DALI_LOG_ERROR("Framework::Run(), ui_app_main() is failed. err = %d", ret);
   }
-#endif
-
   mRunning = false;
 }
 
 void Framework::Quit()
 {
-#ifdef TIZEN_SDK_2_2_COMPATIBILITY
-  app_efl_exit();
-#else
-  ui_app_exit();
-#endif
+  mImpl->AppExit();
 }
 
 bool Framework::IsMainLoopRunning()
@@ -369,79 +412,6 @@ void Framework::AbortCallback( )
   }
 }
 
-bool Framework::AppStatusHandler(int type, void *bundleData)
-{
-  switch (type)
-  {
-    case APP_CREATE:
-    {
-      mInitialised = true;
-
-      mObserver.OnInit();
-      break;
-    }
-
-    case APP_RESET:
-    {
-      mObserver.OnReset();
-      break;
-    }
-
-    case APP_RESUME:
-    {
-      mObserver.OnResume();
-      break;
-    }
-
-    case APP_TERMINATE:
-    {
-      mObserver.OnTerminate();
-      break;
-    }
-
-    case APP_PAUSE:
-    {
-      mObserver.OnPause();
-      break;
-    }
-
-    case APP_CONTROL:
-    {
-      mObserver.OnAppControl(bundleData);
-      break;
-    }
-
-    case APP_LANGUAGE_CHANGE:
-    {
-      mObserver.OnLanguageChanged();
-      break;
-    }
-
-    case APP_REGION_CHANGED:
-    {
-      mObserver.OnRegionChanged();
-      break;
-    }
-
-    case APP_BATTERY_LOW:
-    {
-      mObserver.OnBatteryLow();
-      break;
-    }
-
-    case APP_MEMORY_LOW:
-    {
-      mObserver.OnMemoryLow();
-      break;
-    }
-
-    default:
-      break;
-  }
-
-  return true;
-}
-
 } // namespace Adaptor
 
 } // namespace Internal
index cb7252b..fe706ea 100644 (file)
@@ -124,7 +124,7 @@ struct Framework::Impl
 
 };
 
-Framework::Framework( Framework::Observer& observer, int *argc, char ***argv )
+Framework::Framework( Framework::Observer& observer, int *argc, char ***argv, Type type )
 : mObserver(observer),
   mInitialised(false),
   mRunning(false),
index 81df290..aba7f9e 100644 (file)
@@ -383,6 +383,7 @@ libdali_adaptor_la_LIBADD = \
                       $(HARFBUZZ_LIBS) \
                       $(TPKP_CURL_LIBS) \
                       $(UTILX_LIBS) \
+                      $(APPCORE_WATCH_LIBS) \
                       -lgif \
                       -lpthread \
                       -lturbojpeg \
index ab9cb70..4037024 100644 (file)
@@ -50,7 +50,6 @@ PKG_CHECK_MODULES(TTRACE,  ttrace, AC_DEFINE(ENABLE_TTRACE, 1, [ttrace available
                   [ AC_MSG_NOTICE([Tizen Trace not avaiable]) ]
                   )
 
-
 # Currently, dali-adaptor always requires EFL on all platforms.
 # (on Wayland & X11, on Tizen devices & Ubuntu PC).
 enable_efl=yes
@@ -222,6 +221,12 @@ fi
 
 if test "x$enable_profile" = "xWEARABLE"; then
 PKG_CHECK_MODULES(OPENGLES20, glesv2)
+PKG_CHECK_MODULES(APPFW_WATCH, capi-appfw-watch-application,
+   [watch_available=yes], [watch_available=no] )
+PKG_CHECK_MODULES(APPCORE_WATCH, appcore-watch)
+if test "x$watch_available" = "xyes"; then
+  DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DAPPCORE_WATCH_AVAILABLE"
+fi
 fi
 
 if test "x$enable_profile" = "xTV"; then
index 62edabf..d605db6 100644 (file)
@@ -52,6 +52,8 @@ BuildRequires:  pkgconfig(glesv2)
 %define dali_feedback_plugin 0
 %define shaderbincache_flag DISABLE
 BuildRequires:  pkgconfig(gles20)
+BuildRequires:  pkgconfig(capi-appfw-watch-application)
+BuildRequires:  pkgconfig(appcore-watch)
 %define gles_requirement_setup 1
 %endif