[dali_1.3.2] Merge branch 'devel/master' 54/162454/1
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Fri, 1 Dec 2017 09:23:53 +0000 (09:23 +0000)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Fri, 1 Dec 2017 09:23:53 +0000 (09:23 +0000)
Change-Id: Ie7a94dab1f525143eff4f42a70256be115b0f733

30 files changed:
adaptors/common/framework.h
adaptors/common/key-impl.h
adaptors/common/pixel-buffer-impl.h
adaptors/devel-api/adaptor-framework/key-devel.h [new file with mode: 0644]
adaptors/devel-api/adaptor-framework/pixel-buffer.cpp
adaptors/devel-api/adaptor-framework/pixel-buffer.h
adaptors/devel-api/adaptor-framework/widget-application.cpp [new file with mode: 0644]
adaptors/devel-api/adaptor-framework/widget-application.h [new file with mode: 0644]
adaptors/devel-api/adaptor-framework/widget-impl.cpp [new file with mode: 0644]
adaptors/devel-api/adaptor-framework/widget-impl.h [new file with mode: 0644]
adaptors/devel-api/adaptor-framework/widget.cpp [new file with mode: 0644]
adaptors/devel-api/adaptor-framework/widget.h [new file with mode: 0644]
adaptors/devel-api/file.list
adaptors/ecore/wayland/event-handler-ecore-wl.cpp
adaptors/ecore/wayland/key-mapping-ecore-wl.cpp
adaptors/public-api/dali-adaptor-version.cpp
adaptors/tizen/file.list
adaptors/tizen/framework-tizen.cpp
adaptors/tizen/key-grab.h
adaptors/tizen/widget-application-impl.cpp [new file with mode: 0644]
adaptors/tizen/widget-application-impl.h [new file with mode: 0644]
adaptors/tizen/widget-controller.cpp [new file with mode: 0644]
adaptors/tizen/widget-controller.h [new file with mode: 0644]
adaptors/tv/key-mapping-tv.cpp
adaptors/ubuntu/key-mapping-ubuntu.cpp
adaptors/wayland/input/key-mapping-wl.cpp
adaptors/x11/key-mapping-x.cpp
build/tizen/adaptor/Makefile.am
build/tizen/adaptor/configure.ac
packaging/dali-adaptor.spec

index 6b5965a..c741734 100644 (file)
@@ -52,8 +52,9 @@ public:
 
   enum Type
   {
-    NORMAL,       ///<  normal appFramework
-    WATCH     ///< watch appFramework
+    NORMAL,       ///< normal appFramework
+    WATCH,        ///< watch appFramework
+    WIDGET        ///< widget appFramework
   };
 
   /**
index 25400f3..2bbe379 100644 (file)
@@ -21,6 +21,7 @@
 // INTERNAL INCLUDES
 #include <key.h>
 #include <key-extension-plugin.h>
+#include <key-devel.h>
 
 namespace Dali
 {
index 3484416..1882909 100644 (file)
@@ -140,9 +140,11 @@ public:
   Dali::PixelData CreatePixelData() const;
 
   /**
-   * Apply the mask to the current buffer. This method may update the
-   * internal object - e.g. the new buffer may have a different pixel
-   * format - as an alpha channel may be added.
+   * @brief Apply the mask to the current buffer.
+   *
+   * This method may update the internal object - e.g. the new buffer
+   * may have a different pixel format - as an alpha channel may be
+   * added.
    * @param[in] mask The mask to apply to this pixel buffer
    * @param[in] contentScale The scaling factor to apply to the content
    * @param[in] cropToMask Whether to crop the output to the mask size (true) or scale the
@@ -151,12 +153,28 @@ public:
   void ApplyMask( const PixelBuffer& mask, float contentScale, bool cropToMask );
 
   /**
-   * Apply a Gaussian blur to the current buffer with the given radius.
+   * @brief Apply a Gaussian blur to the current buffer with the given radius.
    *
    * @param[in] blurRadius The radius for Gaussian blur
    */
   void ApplyGaussianBlur( const float blurRadius );
 
+  /**
+   * Crops this buffer to the given crop rectangle. Assumes the crop rectangle
+   * is within the bounds of this size.
+   * @param[in] x The top left corner's X
+   * @param[in] y The top left corner's y
+   * @param[in] cropDimensions The dimensions of the crop
+   */
+  void Crop( uint16_t x, uint16_t y, ImageDimensions cropDimensions );
+
+  /**
+   * Resizes the buffer to the given dimensions. Uses either Lanczos4 for downscaling
+   * or Mitchell for upscaling
+   * @param[in] outDimensions The new dimensions
+   */
+  void Resize( ImageDimensions outDimensions );
+
 private:
   /*
    * Undefined copy constructor.
@@ -210,21 +228,6 @@ private:
    */
   static PixelBufferPtr NewResize( const PixelBuffer& inBuffer, ImageDimensions outDimensions );
 
-  /**
-   * Crops this buffer to the given crop rectangle. Assumes the crop rectangle
-   * is within the bounds of this size.
-   * @param[in] x The top left corner's X
-   * @param[in] y The top left corner's y
-   * @param[in] cropDimensions The dimensions of the crop
-   */
-  void Crop( uint16_t x, uint16_t y, ImageDimensions cropDimensions );
-
-  /**
-   * Resizes the buffer to the given dimensions. Uses either Lanczos4 for downscaling
-   * or Mitchell for upscaling
-   * @param[in] outDimensions The new dimensions
-   */
-  void Resize( ImageDimensions outDimensions );
 
 private:
 
diff --git a/adaptors/devel-api/adaptor-framework/key-devel.h b/adaptors/devel-api/adaptor-framework/key-devel.h
new file mode 100644 (file)
index 0000000..2b8a477
--- /dev/null
@@ -0,0 +1,100 @@
+#ifndef DALI_KEY_DEVEL_H
+#define DALI_KEY_DEVEL_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
+#ifdef DALI_ADAPTOR_COMPILATION
+#include <key.h>
+#else
+#include <dali/public-api/adaptor-framework/key.h>
+#endif
+
+namespace Dali
+{
+
+namespace DevelKey
+{
+
+enum Key
+{
+  DALI_KEY_INVALID = Dali::DALI_KEY_INVALID,
+  DALI_KEY_ESCAPE = Dali::DALI_KEY_ESCAPE,
+  DALI_KEY_BACKSPACE = Dali::DALI_KEY_BACKSPACE,
+  DALI_KEY_SHIFT_LEFT = Dali::DALI_KEY_SHIFT_LEFT,
+  DALI_KEY_SHIFT_RIGHT = Dali::DALI_KEY_SHIFT_RIGHT,
+  DALI_KEY_CURSOR_UP = Dali::DALI_KEY_CURSOR_UP,
+  DALI_KEY_CURSOR_LEFT = Dali::DALI_KEY_CURSOR_LEFT,
+  DALI_KEY_CURSOR_RIGHT = Dali::DALI_KEY_CURSOR_RIGHT,
+  DALI_KEY_CURSOR_DOWN = Dali::DALI_KEY_CURSOR_DOWN,
+  DALI_KEY_BACK = Dali::DALI_KEY_BACK,
+  DALI_KEY_CAMERA = Dali::DALI_KEY_CAMERA,
+  DALI_KEY_CONFIG = Dali::DALI_KEY_CONFIG,
+  DALI_KEY_POWER = Dali::DALI_KEY_POWER,
+  DALI_KEY_PAUSE = Dali::DALI_KEY_PAUSE,
+  DALI_KEY_CANCEL = Dali::DALI_KEY_CANCEL,
+  DALI_KEY_PLAY_CD = Dali::DALI_KEY_PLAY_CD,
+  DALI_KEY_STOP_CD = Dali::DALI_KEY_STOP_CD,
+  DALI_KEY_PAUSE_CD = Dali::DALI_KEY_PAUSE_CD,
+  DALI_KEY_NEXT_SONG = Dali::DALI_KEY_NEXT_SONG,
+  DALI_KEY_PREVIOUS_SONG = Dali::DALI_KEY_PREVIOUS_SONG,
+  DALI_KEY_REWIND = Dali::DALI_KEY_REWIND,
+  DALI_KEY_FASTFORWARD = Dali::DALI_KEY_FASTFORWARD,
+  DALI_KEY_MEDIA = Dali::DALI_KEY_MEDIA,
+  DALI_KEY_PLAY_PAUSE = Dali::DALI_KEY_PLAY_PAUSE,
+  DALI_KEY_MUTE = Dali::DALI_KEY_MUTE,
+  DALI_KEY_MENU = Dali::DALI_KEY_MENU,
+  DALI_KEY_HOME = Dali::DALI_KEY_HOME,
+  DALI_KEY_HOMEPAGE = Dali::DALI_KEY_HOMEPAGE,
+  DALI_KEY_WEBPAGE = Dali::DALI_KEY_WEBPAGE,
+  DALI_KEY_MAIL = Dali::DALI_KEY_MAIL,
+  DALI_KEY_SCREENSAVER = Dali::DALI_KEY_SCREENSAVER,
+  DALI_KEY_BRIGHTNESS_UP = Dali::DALI_KEY_BRIGHTNESS_UP,
+  DALI_KEY_BRIGHTNESS_DOWN = Dali::DALI_KEY_BRIGHTNESS_DOWN,
+  DALI_KEY_SOFT_KBD = Dali::DALI_KEY_SOFT_KBD,
+  DALI_KEY_QUICK_PANEL = Dali::DALI_KEY_QUICK_PANEL,
+  DALI_KEY_TASK_SWITCH = Dali::DALI_KEY_TASK_SWITCH,
+  DALI_KEY_APPS = Dali::DALI_KEY_APPS,
+  DALI_KEY_SEARCH = Dali::DALI_KEY_SEARCH,
+  DALI_KEY_VOICE = Dali::DALI_KEY_VOICE,
+  DALI_KEY_LANGUAGE = Dali::DALI_KEY_LANGUAGE,
+  DALI_KEY_VOLUME_UP = Dali::DALI_KEY_VOLUME_UP,
+  DALI_KEY_VOLUME_DOWN = Dali::DALI_KEY_VOLUME_DOWN,
+
+  /**
+   * @brief Delete key.
+   */
+  DALI_KEY_DELETE = 119,
+
+  /**
+   * @brief Control Left key.
+   */
+  DALI_KEY_CONTROL_LEFT = 37,
+
+  /**
+   * @brief Control Right key.
+   */
+  DALI_KEY_CONTROL_RIGHT = 105
+
+};
+
+} // namespace DevelKey
+
+} // namespace Dali
+
+#endif // DALI_KEY_DEVEL_H
index b767d49..d8245b1 100644 (file)
@@ -106,6 +106,16 @@ void PixelBuffer::ApplyGaussianBlur( const float blurRadius )
   GetImplementation(*this).ApplyGaussianBlur( blurRadius );
 }
 
+void PixelBuffer::Crop( uint16_t x, uint16_t y, uint16_t width, uint16_t height )
+{
+  GetImplementation(*this).Crop( x, y, ImageDimensions( width, height ) );
+}
+
+void PixelBuffer::Resize( uint16_t width, uint16_t height )
+{
+  GetImplementation(*this).Resize( ImageDimensions( width, height ) );
+}
+
 } // namespace Devel
 
 } // namespace Dali
index dfe228b..8a777bf 100644 (file)
@@ -33,6 +33,7 @@ class PixelBuffer;
 }
 }
 
+
 // Use namespace to separate from PixelBuffer typedef in buffer-image.h
 namespace Devel
 {
@@ -179,6 +180,26 @@ public:
    */
   void ApplyGaussianBlur( const float blurRadius );
 
+  /**
+   * @brief Crops this buffer to the given crop rectangle.
+   *
+   * The crop rectangle will be clamped to the edges of the buffer if it is larger.
+   * @param[in] x The top left corner's X
+   * @param[in] y The top left corner's y
+   * @param[in] width The crop width
+   * @param[in] height The crop height
+   */
+  void Crop( uint16_t x, uint16_t y, uint16_t width, uint16_t height );
+
+  /**
+   * @brief Resizes the buffer to the given dimensions.
+   *
+   * Uses either Lanczos4 for downscaling or Mitchell for upscaling
+   * @param[in] width The new width
+   * @param[in] height The new height
+   */
+  void Resize( uint16_t width, uint16_t height );
+
 public:
 
   /**
diff --git a/adaptors/devel-api/adaptor-framework/widget-application.cpp b/adaptors/devel-api/adaptor-framework/widget-application.cpp
new file mode 100644 (file)
index 0000000..dce9aed
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * 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
diff --git a/adaptors/devel-api/adaptor-framework/widget-application.h b/adaptors/devel-api/adaptor-framework/widget-application.h
new file mode 100644 (file)
index 0000000..6923849
--- /dev/null
@@ -0,0 +1,167 @@
+#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()
+ *   {
+ *     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
+ *
+ */
+class DALI_IMPORT_API WidgetApplication : public Application
+{
+public:
+
+  /**
+   * @brief This is the typedef for Widget creator.
+   */
+  typedef Widget(*CreateWidgetFunction)(void);
+
+public:
+
+  /**
+   * @brief This is the constructor for WidgetApplications with a name.
+   *
+   * @param[in,out]  argc        A pointer to the number of arguments
+   * @param[in,out]  argv        A pointer to the argument list
+   * @param[in]      stylesheet  The path to user defined theme file
+   * @return A handle to the WidgetApplication
+   * @note If the stylesheet is not specified, then the library's default stylesheet will not be overridden.
+   */
+  static WidgetApplication New( int* argc, char **argv[], const std::string& stylesheet );
+
+  /**
+   * @brief The default constructor.
+   *
+   */
+  WidgetApplication();
+
+  /**
+   * @brief Copy Constructor.
+   *
+   * @param[in] WidgetApplication Handle to an object
+   */
+  WidgetApplication( const WidgetApplication& widgetApplication );
+
+  /**
+   * @brief Assignment operator.
+   *
+   * @param[in] WidgetApplication Handle to an object
+   * @return A reference to this
+   */
+  WidgetApplication& operator=( const WidgetApplication& widgetApplication );
+
+ /**
+   * @brief Destructor
+   *
+   *
+   */
+  ~WidgetApplication();
+
+  /**
+   * @brief Register create function for widget.
+   *
+   * @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
diff --git a/adaptors/devel-api/adaptor-framework/widget-impl.cpp b/adaptors/devel-api/adaptor-framework/widget-impl.cpp
new file mode 100644 (file)
index 0000000..55f1f90
--- /dev/null
@@ -0,0 +1,121 @@
+/*
+ * 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
+{
+
+Dali::Widget Widget::New()
+{
+  IntrusivePtr<Widget> widget = new Widget();
+  Dali::Widget handle( widget.Get() );
+  return handle;
+}
+
+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 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
diff --git a/adaptors/devel-api/adaptor-framework/widget-impl.h b/adaptors/devel-api/adaptor-framework/widget-impl.h
new file mode 100644 (file)
index 0000000..b63b970
--- /dev/null
@@ -0,0 +1,183 @@
+#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
+{
+
+/**
+ * @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.
+ */
+class DALI_IMPORT_API Widget : public BaseObject, public ConnectionTrackerInterface
+{
+public:
+
+  /**
+   * @brief Creates a new WidgetImpl instance.
+   *
+   * @return A handle to the WidgetImpl instance
+   */
+  static Dali::Widget New();
+
+  /**
+   * @brief The user should override this function to determine when they create widget.
+   *
+   * @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.
+   *
+   * @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 type );
+
+  /**
+   * @brief The user should override this function to determine when they pause widget.
+   */
+  virtual void OnPause();
+
+  /**
+   * @brief The user should override this function to determine when they resume widget.
+   */
+  virtual void OnResume();
+
+  /**
+   * @brief The user should override this function to determine when they resize widget.
+   *
+   * @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.
+   *
+   * @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.
+   *
+   * @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.
+   */
+  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.
+ *
+ * @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.
+ *
+ * @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
diff --git a/adaptors/devel-api/adaptor-framework/widget.cpp b/adaptors/devel-api/adaptor-framework/widget.cpp
new file mode 100644 (file)
index 0000000..85a00bc
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * 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()
+{
+  return Internal::Adaptor::Widget::New();
+}
+
+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
diff --git a/adaptors/devel-api/adaptor-framework/widget.h b/adaptors/devel-api/adaptor-framework/widget.h
new file mode 100644 (file)
index 0000000..aabdb23
--- /dev/null
@@ -0,0 +1,110 @@
+#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.
+ *
+ */
+class DALI_IMPORT_API Widget : public BaseHandle
+{
+public:
+
+  /**
+   * @brief Struct for termination type of widget instance.
+   */
+  struct Termination
+  {
+    /**
+     * @brief Enumeration for termination type of widget instance.
+     */
+    enum Type
+    {
+      PERMANENT, //< User deleted this widget from the viewer
+      TEMPORARY, //< Widget is deleted because of other reasons (e.g. widget process is terminated temporarily by the system)
+    };
+  };
+
+public:
+
+  /**
+   * @brief This is the constructor for Widget.
+   * @return A handle to the Widget
+   */
+  static Widget New();
+
+  /**
+   * @brief The default constructor.
+   *
+   */
+  Widget();
+
+  /**
+   * @brief Copy Constructor.
+   * @param[in] Widget Handle to an object
+   */
+  Widget( const Widget& widget );
+
+  /**
+   * @brief Assignment operator.
+   * @param[in] Widget Handle to an object
+   * @return A reference to this
+   */
+  Widget& operator=( const Widget& widget );
+
+  /**
+   * @brief Destructor
+   */
+  ~Widget();
+
+public: // Not intended for application developers
+  explicit Widget(Internal::Adaptor::Widget* widget);
+};
+
+/**
+ * @}
+ */
+} // namespace Dali
+
+#endif // DALI_WIDGET_H
index 4a074a5..470bda7 100644 (file)
@@ -28,7 +28,6 @@ devel_api_src_files = \
   $(adaptor_devel_api_dir)/adaptor-framework/video-player.cpp \
   $(adaptor_devel_api_dir)/adaptor-framework/virtual-keyboard.cpp
 
-
 devel_api_adaptor_framework_header_files = \
   $(adaptor_devel_api_dir)/adaptor-framework/accessibility-adaptor.h \
   $(adaptor_devel_api_dir)/adaptor-framework/accessibility-action-handler.h \
@@ -62,7 +61,18 @@ devel_api_adaptor_framework_header_files = \
   $(adaptor_devel_api_dir)/adaptor-framework/tilt-sensor.h \
   $(adaptor_devel_api_dir)/adaptor-framework/video-player.h \
   $(adaptor_devel_api_dir)/adaptor-framework/video-player-plugin.h \
+  $(adaptor_devel_api_dir)/adaptor-framework/key-devel.h \
   $(adaptor_devel_api_dir)/adaptor-framework/key-extension-plugin.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
+
index 9790533..f3f1169 100644 (file)
@@ -589,9 +589,9 @@ struct EventHandler::Impl
         ecoreKeyDownEvent.timestamp = keyEvent->timestamp;
         ecoreKeyDownEvent.modifiers = EcoreInputModifierToEcoreIMFModifier ( keyEvent->modifiers );
         ecoreKeyDownEvent.locks     = (Ecore_IMF_Keyboard_Locks) ECORE_IMF_KEYBOARD_LOCK_NONE;
-        ecoreKeyDownEvent.dev_name  = "";
-        ecoreKeyDownEvent.dev_class = ECORE_IMF_DEVICE_CLASS_KEYBOARD;
-        ecoreKeyDownEvent.dev_subclass = ECORE_IMF_DEVICE_SUBCLASS_NONE;
+        ecoreKeyDownEvent.dev_name  = ecore_device_name_get( keyEvent->dev );
+        ecoreKeyDownEvent.dev_class = static_cast<Ecore_IMF_Device_Class>( ecore_device_class_get( keyEvent->dev ) );
+        ecoreKeyDownEvent.dev_subclass = static_cast<Ecore_IMF_Device_Subclass>( ecore_device_subclass_get( keyEvent->dev ) );
 
         std::string checkDevice;
         GetDeviceName( keyEvent, checkDevice );
@@ -694,9 +694,9 @@ struct EventHandler::Impl
         ecoreKeyUpEvent.timestamp = keyEvent->timestamp;
         ecoreKeyUpEvent.modifiers = EcoreInputModifierToEcoreIMFModifier ( keyEvent->modifiers );
         ecoreKeyUpEvent.locks     = (Ecore_IMF_Keyboard_Locks) ECORE_IMF_KEYBOARD_LOCK_NONE;
-        ecoreKeyUpEvent.dev_name  = "";
-        ecoreKeyUpEvent.dev_class = ECORE_IMF_DEVICE_CLASS_KEYBOARD;
-        ecoreKeyUpEvent.dev_subclass = ECORE_IMF_DEVICE_SUBCLASS_NONE;
+        ecoreKeyUpEvent.dev_name  = ecore_device_name_get( keyEvent->dev );
+        ecoreKeyUpEvent.dev_class = static_cast<Ecore_IMF_Device_Class>( ecore_device_class_get( keyEvent->dev ) );
+        ecoreKeyUpEvent.dev_subclass = static_cast<Ecore_IMF_Device_Subclass>( ecore_device_subclass_get( keyEvent->dev ) );
 
         eventHandled = ecore_imf_context_filter_event( imfContext,
                                                        ECORE_IMF_EVENT_KEY_UP,
index 6603b27..9b1f447 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * 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.
@@ -36,56 +36,61 @@ KeyLookup KeyLookupTable[]=
   // more than one key name can be assigned to a single dali-key code
   // e.g. "Menu" and "XF86Menu" are both assigned to  DALI_KEY_MENU
 
-  { "Escape",                DALI_KEY_ESCAPE,          false },
-  { "Menu",                  DALI_KEY_MENU,            false },
+  { "Escape",                DALI_KEY_ESCAPE  ,                                          false },
+  { "Menu",                  DALI_KEY_MENU,                                              false },
 
   // Now literal strings are used as key names instead of defined symbols in utilX,
   // since these definition in utilX.h is deprecated
-  { "XF86Camera",            DALI_KEY_CAMERA,          false },
-  { "XF86Camera_Full",       DALI_KEY_CONFIG,          false },
-  { "XF86PowerOff",          DALI_KEY_POWER,           true  },
-  { "XF86Standby",           DALI_KEY_PAUSE,           false },
-  { "Cancel",                DALI_KEY_CANCEL,          false },
-  { "XF86AudioPlay",         DALI_KEY_PLAY_CD,         false },
-  { "XF86AudioStop",         DALI_KEY_STOP_CD,         false },
-  { "XF86AudioPause",        DALI_KEY_PAUSE_CD,        false },
-  { "XF86AudioNext",         DALI_KEY_NEXT_SONG,       false },
-  { "XF86AudioPrev",         DALI_KEY_PREVIOUS_SONG,   false },
-  { "XF86AudioRewind",       DALI_KEY_REWIND,          false },
-  { "XF86AudioForward",      DALI_KEY_FASTFORWARD,     false },
-  { "XF86AudioMedia",        DALI_KEY_MEDIA,           false },
-  { "XF86AudioPlayPause",    DALI_KEY_PLAY_PAUSE,      false },
-  { "XF86AudioMute",         DALI_KEY_MUTE,            false },
-  { "XF86Menu",              DALI_KEY_MENU,            true  },
-  { "XF86Home",              DALI_KEY_HOME,            true  },
-  { "XF86Back",              DALI_KEY_BACK,            true  },
-  { "XF86Send",              DALI_KEY_MENU,            true  },
-  { "XF86Phone",             DALI_KEY_HOME,            true  },
-  { "XF86Stop",              DALI_KEY_BACK,            true  },
-  { "XF86HomePage",          DALI_KEY_HOMEPAGE,        false },
-  { "XF86WWW",               DALI_KEY_WEBPAGE,         false },
-  { "XF86Mail",              DALI_KEY_MAIL,            false },
-  { "XF86ScreenSaver",       DALI_KEY_SCREENSAVER,     false },
-  { "XF86MonBrightnessUp",   DALI_KEY_BRIGHTNESS_UP,   false },
-  { "XF86MonBrightnessDown", DALI_KEY_BRIGHTNESS_DOWN, false },
-  { "XF86SoftKBD",           DALI_KEY_SOFT_KBD,        false },
-  { "XF86QuickPanel",        DALI_KEY_QUICK_PANEL,     false },
-  { "XF86TaskPane",          DALI_KEY_TASK_SWITCH,     false },
-  { "XF86Apps",              DALI_KEY_APPS,            false },
-  { "XF86Search",            DALI_KEY_SEARCH,          false },
-  { "XF86Voice",             DALI_KEY_VOICE,           false },
-  { "Hangul",                DALI_KEY_LANGUAGE,        false },
-  { "XF86AudioRaiseVolume",  DALI_KEY_VOLUME_UP,       true  },
-  { "XF86AudioLowerVolume",  DALI_KEY_VOLUME_DOWN,     true  },
+  { "XF86Camera",            DALI_KEY_CAMERA,                                            false },
+  { "XF86Camera_Full",       DALI_KEY_CONFIG,                                            false },
+  { "XF86PowerOff",          DALI_KEY_POWER,                                             true  },
+  { "XF86Standby",           DALI_KEY_PAUSE,                                             false },
+  { "Cancel",                DALI_KEY_CANCEL,                                            false },
+  { "XF86AudioPlay",         DALI_KEY_PLAY_CD,                                           false },
+  { "XF86AudioStop",         DALI_KEY_STOP_CD,                                           false },
+  { "XF86AudioPause",        DALI_KEY_PAUSE_CD,                                          false },
+  { "XF86AudioNext",         DALI_KEY_NEXT_SONG,                                         false },
+  { "XF86AudioPrev",         DALI_KEY_PREVIOUS_SONG,                                     false },
+  { "XF86AudioRewind",       DALI_KEY_REWIND,                                            false },
+  { "XF86AudioForward",      DALI_KEY_FASTFORWARD,                                       false },
+  { "XF86AudioMedia",        DALI_KEY_MEDIA,                                             false },
+  { "XF86AudioPlayPause",    DALI_KEY_PLAY_PAUSE,                                        false },
+  { "XF86AudioMute",         DALI_KEY_MUTE,                                              false },
+  { "XF86Menu",              DALI_KEY_MENU,                                              true  },
+  { "XF86Home",              DALI_KEY_HOME,                                              true  },
+  { "XF86Back",              DALI_KEY_BACK,                                              true  },
+  { "XF86Send",              DALI_KEY_MENU,                                              true  },
+  { "XF86Phone",             DALI_KEY_HOME,                                              true  },
+  { "XF86Stop",              DALI_KEY_BACK,                                              true  },
+  { "XF86HomePage",          DALI_KEY_HOMEPAGE,                                          false },
+  { "XF86WWW",               DALI_KEY_WEBPAGE,                                           false },
+  { "XF86Mail",              DALI_KEY_MAIL,                                              false },
+  { "XF86ScreenSaver",       DALI_KEY_SCREENSAVER,                                       false },
+  { "XF86MonBrightnessUp",   DALI_KEY_BRIGHTNESS_UP,                                     false },
+  { "XF86MonBrightnessDown", DALI_KEY_BRIGHTNESS_DOWN,                                   false },
+  { "XF86SoftKBD",           DALI_KEY_SOFT_KBD,                                          false },
+  { "XF86QuickPanel",        DALI_KEY_QUICK_PANEL,                                       false },
+  { "XF86TaskPane",          DALI_KEY_TASK_SWITCH,                                       false },
+  { "XF86Apps",              DALI_KEY_APPS,                                              false },
+  { "XF86Search",            DALI_KEY_SEARCH,                                            false },
+  { "XF86Voice",             DALI_KEY_VOICE,                                             false },
+  { "Hangul",                DALI_KEY_LANGUAGE,                                          false },
+  { "XF86AudioRaiseVolume",  DALI_KEY_VOLUME_UP,                                         true  },
+  { "XF86AudioLowerVolume",  DALI_KEY_VOLUME_DOWN,                                       true  },
 
-  { "BackSpace",             DALI_KEY_BACKSPACE,       false },
-  { "Left",                  DALI_KEY_CURSOR_LEFT,     false },
-  { "Right",                 DALI_KEY_CURSOR_RIGHT,    false },
-  { "Shift_L",               DALI_KEY_SHIFT_LEFT,      false },
-  { "Shift_R",               DALI_KEY_SHIFT_RIGHT,     false }
+  { "BackSpace",             DALI_KEY_BACKSPACE,                                         false },
+  { "Left",                  DALI_KEY_CURSOR_LEFT,                                       false },
+  { "Right",                 DALI_KEY_CURSOR_RIGHT,                                      false },
+  { "left",                  DALI_KEY_CURSOR_LEFT,                                       false }, // To be removed after the key name is fixed in the platform
+  { "right",                 DALI_KEY_CURSOR_RIGHT,                                      false }, // To be removed after the key name is fixed in the platform
+  { "Shift_L",               DALI_KEY_SHIFT_LEFT,                                        false },
+  { "Shift_R",               DALI_KEY_SHIFT_RIGHT,                                       false },
+  { "Delete",                static_cast<Dali::KEY>( DevelKey::DALI_KEY_DELETE ),        false },
+  { "Control_L",             static_cast<Dali::KEY>( DevelKey::DALI_KEY_CONTROL_LEFT ),  false },
+  { "Control_R",             static_cast<Dali::KEY>( DevelKey::DALI_KEY_CONTROL_RIGHT ), false }
 };
 
-const std::size_t KEY_LOOKUP_COUNT = (sizeof( KeyLookupTable))/ (sizeof(KeyLookup));
+const std::size_t KEY_LOOKUP_COUNT = (sizeof( KeyLookupTable ))/ (sizeof( KeyLookup ));
 
 } // namespace KeyLookup
 
index bc8577b..0e3c7e9 100644 (file)
@@ -28,7 +28,7 @@ namespace Dali
 
 const unsigned int ADAPTOR_MAJOR_VERSION = 1;
 const unsigned int ADAPTOR_MINOR_VERSION = 3;
-const unsigned int ADAPTOR_MICRO_VERSION = 1;
+const unsigned int ADAPTOR_MICRO_VERSION = 2;
 const char * const ADAPTOR_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index 247a9a3..8231f32 100644 (file)
@@ -20,5 +20,9 @@ adaptor_tizen_internal_native_image_src_files = \
   $(adaptor_tizen_dir)/native-render-surface-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
index addc5a7..9628bdd 100644 (file)
@@ -28,7 +28,7 @@
 #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>
@@ -55,13 +55,36 @@ namespace Internal
 namespace Adaptor
 {
 
-#if defined(DEBUG_ENABLED)
 namespace
 {
+#if defined(DEBUG_ENABLED)
 Integration::Log::Filter* gDBusLogging = Integration::Log::Filter::New( Debug::NoLogging, false, "LOG_ADAPTOR_EVENTS_DBUS" );
-} // anonymous namespace
 #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
+
 namespace AppCore
 {
 
@@ -196,6 +219,10 @@ struct Framework::Impl
     {
       ret = AppNormalMain();
     }
+    else if(mApplicationType == WIDGET)
+    {
+      ret = AppWidgetMain();
+    }
     else
     {
       ret = AppWatchMain();
@@ -209,6 +236,10 @@ struct Framework::Impl
     {
       AppNormalExit();
     }
+    else if(mApplicationType == WIDGET)
+    {
+      AppWidgetExit();
+    }
     else
     {
       AppWatchExit();
@@ -381,8 +412,16 @@ struct Framework::Impl
   {
     Framework* framework = static_cast<Framework*>(data);
     Observer *observer = &framework->mObserver;
-    framework->SetLanguage( std::string( static_cast<const char *>(event->value) ) );
-    observer->OnLanguageChanged();
+
+    if( event && event->value )
+    {
+      framework->SetLanguage( std::string( static_cast<const char *>(event->value) ) );
+      observer->OnLanguageChanged();
+    }
+    else
+    {
+      DALI_LOG_ERROR( "NULL pointer in Language changed event\n" );
+    }
   }
 
   static void AppDeviceRotated(AppCore::AppEventInfoPtr event_info, void *data)
@@ -393,8 +432,16 @@ struct Framework::Impl
   {
     Framework* framework = static_cast<Framework*>(data);
     Observer *observer = &framework->mObserver;
-    framework->SetRegion( std::string( static_cast<const char *>(event->value) ) );
-    observer->OnRegionChanged();
+
+    if( event && event->value )
+    {
+      framework->SetRegion( std::string( static_cast<const char *>(event->value) ) );
+      observer->OnRegionChanged();
+    }
+    else
+    {
+      DALI_LOG_ERROR( "NULL pointer in Region changed event\n" );
+    }
   }
 
   static void AppBatteryLow(AppCore::AppEventInfoPtr event, void *data)
@@ -495,6 +542,57 @@ struct Framework::Impl
     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)
   {
index 725c282..0608dc9 100755 (executable)
@@ -113,7 +113,7 @@ DALI_IMPORT_API bool UngrabKey( Window window, Dali::KEY daliKey );
 
 /**
  * @PLATFORM
- * @brief Grabs the list of keys specified by @Dali::Vector of keys for @a window in @Vector of grabModes.
+ * @brief Grabs the list of keys specified by Dali::Vector of keys for @a window in Dali::Vector of grabModes.
  *
  * @details This function can be used for following example scenarios:
  * - TV - A user might want to change the volume or channel of the background TV contents while focusing on the foregrund app.
@@ -134,7 +134,7 @@ DALI_IMPORT_API bool GrabKeyList( Window window, const Dali::Vector<Dali::KEY>&
 
 /**
  * @PLATFORM
- * @brief Ungrabs the list of keys specified by @Dali::Vector of keys for @a window.
+ * @brief Ungrabs the list of keys specified by Dali::Vector of keys for @a window.
  *
  * @SINCE_1_2.0
  * @PRIVLEVEL_PLATFORM
diff --git a/adaptors/tizen/widget-application-impl.cpp b/adaptors/tizen/widget-application-impl.cpp
new file mode 100644 (file)
index 0000000..22101b4
--- /dev/null
@@ -0,0 +1,258 @@
+/*
+ * 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::WidgetApplication::CreateWidgetFunction createFunction = application->GetWidgetCreatingFunction(std::string(id));
+
+  Dali::Widget widgetInstance = createFunction();
+
+  Dali::Internal::Adaptor::Widget::Impl *widgetImpl = new Dali::Internal::Adaptor::Widget::Impl(instanceHandle);
+
+  Internal::Adaptor::GetImplementation(widgetInstance).SetImpl( widgetImpl );
+
+  bundle_raw *bundleRaw;
+  int len;
+  bundle_encode(content, &bundleRaw, &len);
+  char* encodedContent = reinterpret_cast< char* >( bundleRaw );
+  std::string encodedContentString( encodedContent );
+
+  application->AddWidget( instanceHandle, widgetInstance );
+  Internal::Adaptor::GetImplementation(widgetInstance).OnCreate( encodedContentString, window );
+  free(bundleRaw);
+
+  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::Type destroyReason = Dali::Widget::Termination::TEMPORARY;
+
+  if(reason == WIDGET_BASE_DESTROY_TYPE_PERMANENT)
+  {
+    destroyReason = Dali::Widget::Termination::PERMANENT;
+  }
+
+  bundle_raw *bundleRaw;
+  int len;
+  bundle_encode(content, &bundleRaw, &len);
+  char* encodedContent = reinterpret_cast< char* >( bundleRaw );
+  std::string encodedContentString( encodedContent );
+  Internal::Adaptor::GetImplementation(widgetInstance).OnTerminate( encodedContentString, destroyReason );
+
+  free(bundleRaw);
+  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 );
+
+  bundle_raw *bundleRaw;
+  int len;
+  bundle_encode(content, &bundleRaw, &len);
+  char* encodedContent = reinterpret_cast< char* >( bundleRaw );
+  std::string encodedContentString( encodedContent );
+  Internal::Adaptor::GetImplementation(widgetInstance).OnUpdate( encodedContentString, force );
+
+  free(bundleRaw);
+
+  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 )
+{
+  AddWidgetCreatingFunction( 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::AddWidgetCreatingFunction( const std::string& widgetName, Dali::WidgetApplication::CreateWidgetFunction createFunction )
+{
+  mCreateWidgetFunctionContainer.push_back( CreateWidgetFunctionPair(widgetName, createFunction) );
+}
+
+Dali::WidgetApplication::CreateWidgetFunction WidgetApplication::GetWidgetCreatingFunction( 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).second;
+    }
+  }
+
+  return nullptr;
+}
+
+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
diff --git a/adaptors/tizen/widget-application-impl.h b/adaptors/tizen/widget-application-impl.h
new file mode 100644 (file)
index 0000000..6b6f782
--- /dev/null
@@ -0,0 +1,144 @@
+#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:
+
+  /**
+   * 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 - WidgetCreator pair to container.
+   */
+  void AddWidgetCreatingFunction( const std::string& widgetName, Dali::WidgetApplication::CreateWidgetFunction createFunction );
+
+  /**
+   * Find and get WidgetCreator in container by widget name.
+   */
+  Dali::WidgetApplication::CreateWidgetFunction GetWidgetCreatingFunction( 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<const std::string, Dali::WidgetApplication::CreateWidgetFunction >  CreateWidgetFunctionPair;
+  typedef std::pair< widget_base_instance_h, Dali::Widget >                             WidgetInstancePair;
+
+  typedef std::vector< CreateWidgetFunctionPair >   CreateWidgetFunctionContainer;
+  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
diff --git a/adaptors/tizen/widget-controller.cpp b/adaptors/tizen/widget-controller.cpp
new file mode 100644 (file)
index 0000000..dce7f64
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * 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
diff --git a/adaptors/tizen/widget-controller.h b/adaptors/tizen/widget-controller.h
new file mode 100644 (file)
index 0000000..3a6a485
--- /dev/null
@@ -0,0 +1,72 @@
+#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
index 1009157..88da0fc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * 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.
@@ -36,56 +36,61 @@ KeyLookup KeyLookupTable[]=
   // more than one key name can be assigned to a single dali-key code
   // e.g. "Menu" and "XF86Menu" are both assigned to  DALI_KEY_MENU
 
-  { "Escape",                DALI_KEY_ESCAPE,          false },
-  { "Menu",                  DALI_KEY_MENU,            false },
+  { "Escape",                DALI_KEY_ESCAPE,                                            false },
+  { "Menu",                  DALI_KEY_MENU,                                              false },
 
   // Now literal strings are used as key names instead of defined symbols in utilX,
   // since these definition in utilX.h is deprecated
-  { "XF86Camera",            DALI_KEY_CAMERA,          false },
-  { "XF86Camera_Full",       DALI_KEY_CONFIG,          false },
-  { "XF86PowerOff",          DALI_KEY_POWER,           true  },
-  { "XF86Standby",           DALI_KEY_PAUSE,           false },
-  { "Cancel",                DALI_KEY_CANCEL,          false },
-  { "XF86AudioPlay",         DALI_KEY_PLAY_CD,         false },
-  { "XF86AudioStop",         DALI_KEY_STOP_CD,         false },
-  { "XF86AudioPause",        DALI_KEY_PAUSE_CD,        false },
-  { "XF86AudioNext",         DALI_KEY_NEXT_SONG,       false },
-  { "XF86AudioPrev",         DALI_KEY_PREVIOUS_SONG,   false },
-  { "XF86AudioRewind",       DALI_KEY_REWIND,          false },
-  { "XF86AudioForward",      DALI_KEY_FASTFORWARD,     false },
-  { "XF86AudioMedia",        DALI_KEY_MEDIA,           false },
-  { "XF86AudioPlayPause",    DALI_KEY_PLAY_PAUSE,      false },
-  { "XF86AudioMute",         DALI_KEY_MUTE,            false },
-  { "XF86Menu",              DALI_KEY_MENU,            true  },
-  { "XF86Home",              DALI_KEY_HOME,            true  },
-  { "XF86Back",              DALI_KEY_BACK,            true  },
-  { "XF86Send",              DALI_KEY_MENU,            true  },
-  { "XF86Phone",             DALI_KEY_HOME,            true  },
-  { "XF86Stop",              DALI_KEY_BACK,            true  },
-  { "XF86HomePage",          DALI_KEY_HOMEPAGE,        false },
-  { "XF86WWW",               DALI_KEY_WEBPAGE,         false },
-  { "XF86Mail",              DALI_KEY_MAIL,            false },
-  { "XF86ScreenSaver",       DALI_KEY_SCREENSAVER,     false },
-  { "XF86MonBrightnessUp",   DALI_KEY_BRIGHTNESS_UP,   false },
-  { "XF86MonBrightnessDown", DALI_KEY_BRIGHTNESS_DOWN, false },
-  { "XF86SoftKBD",           DALI_KEY_SOFT_KBD,        false },
-  { "XF86QuickPanel",        DALI_KEY_QUICK_PANEL,     false },
-  { "XF86TaskPane",          DALI_KEY_TASK_SWITCH,     false },
-  { "XF86Apps",              DALI_KEY_APPS,            false },
-  { "XF86Search",            DALI_KEY_SEARCH,          false },
-  { "XF86Voice",             DALI_KEY_VOICE,           false },
-  { "Hangul",                DALI_KEY_LANGUAGE,        false },
-  { "XF86AudioRaiseVolume",  DALI_KEY_VOLUME_UP,       true  },
-  { "XF86AudioLowerVolume",  DALI_KEY_VOLUME_DOWN,     true  },
+  { "XF86Camera",            DALI_KEY_CAMERA,                                            false },
+  { "XF86Camera_Full",       DALI_KEY_CONFIG,                                            false },
+  { "XF86PowerOff",          DALI_KEY_POWER,                                             true  },
+  { "XF86Standby",           DALI_KEY_PAUSE,                                             false },
+  { "Cancel",                DALI_KEY_CANCEL,                                            false },
+  { "XF86AudioPlay",         DALI_KEY_PLAY_CD,                                           false },
+  { "XF86AudioStop",         DALI_KEY_STOP_CD,                                           false },
+  { "XF86AudioPause",        DALI_KEY_PAUSE_CD,                                          false },
+  { "XF86AudioNext",         DALI_KEY_NEXT_SONG,                                         false },
+  { "XF86AudioPrev",         DALI_KEY_PREVIOUS_SONG,                                     false },
+  { "XF86AudioRewind",       DALI_KEY_REWIND,                                            false },
+  { "XF86AudioForward",      DALI_KEY_FASTFORWARD,                                       false },
+  { "XF86AudioMedia",        DALI_KEY_MEDIA,                                             false },
+  { "XF86AudioPlayPause",    DALI_KEY_PLAY_PAUSE,                                        false },
+  { "XF86AudioMute",         DALI_KEY_MUTE,                                              false },
+  { "XF86Menu",              DALI_KEY_MENU,                                              true  },
+  { "XF86Home",              DALI_KEY_HOME,                                              true  },
+  { "XF86Back",              DALI_KEY_BACK,                                              true  },
+  { "XF86Send",              DALI_KEY_MENU,                                              true  },
+  { "XF86Phone",             DALI_KEY_HOME,                                              true  },
+  { "XF86Stop",              DALI_KEY_BACK,                                              true  },
+  { "XF86HomePage",          DALI_KEY_HOMEPAGE,                                          false },
+  { "XF86WWW",               DALI_KEY_WEBPAGE,                                           false },
+  { "XF86Mail",              DALI_KEY_MAIL,                                              false },
+  { "XF86ScreenSaver",       DALI_KEY_SCREENSAVER,                                       false },
+  { "XF86MonBrightnessUp",   DALI_KEY_BRIGHTNESS_UP,                                     false },
+  { "XF86MonBrightnessDown", DALI_KEY_BRIGHTNESS_DOWN,                                   false },
+  { "XF86SoftKBD",           DALI_KEY_SOFT_KBD,                                          false },
+  { "XF86QuickPanel",        DALI_KEY_QUICK_PANEL,                                       false },
+  { "XF86TaskPane",          DALI_KEY_TASK_SWITCH,                                       false },
+  { "XF86Apps",              DALI_KEY_APPS,                                              false },
+  { "XF86Search",            DALI_KEY_SEARCH,                                            false },
+  { "XF86Voice",             DALI_KEY_VOICE,                                             false },
+  { "Hangul",                DALI_KEY_LANGUAGE,                                          false },
+  { "XF86AudioRaiseVolume",  DALI_KEY_VOLUME_UP,                                         true  },
+  { "XF86AudioLowerVolume",  DALI_KEY_VOLUME_DOWN,                                       true  },
 
-  { "BackSpace",             DALI_KEY_BACKSPACE,       false },
-  { "Left",                  DALI_KEY_CURSOR_LEFT,     false },
-  { "Right",                 DALI_KEY_CURSOR_RIGHT,    false },
-  { "Shift_L",               DALI_KEY_SHIFT_LEFT,      false },
-  { "Shift_R",               DALI_KEY_SHIFT_RIGHT,     false }
+  { "BackSpace",             DALI_KEY_BACKSPACE,                                         false },
+  { "Left",                  DALI_KEY_CURSOR_LEFT,                                       false },
+  { "Right",                 DALI_KEY_CURSOR_RIGHT,                                      false },
+  { "left",                  DALI_KEY_CURSOR_LEFT,                                       false }, // To be removed after the key name is fixed in the platform
+  { "right",                 DALI_KEY_CURSOR_RIGHT,                                      false }, // To be removed after the key name is fixed in the platform
+  { "Shift_L",               DALI_KEY_SHIFT_LEFT,                                        false },
+  { "Shift_R",               DALI_KEY_SHIFT_RIGHT,                                       false },
+  { "Delete",                static_cast<Dali::KEY>( DevelKey::DALI_KEY_DELETE ),        false },
+  { "Control_L",             static_cast<Dali::KEY>( DevelKey::DALI_KEY_CONTROL_LEFT ),  false },
+  { "Control_R",             static_cast<Dali::KEY>( DevelKey::DALI_KEY_CONTROL_RIGHT ), false }
 };
 
-const std::size_t KEY_LOOKUP_COUNT = (sizeof( KeyLookupTable))/ (sizeof(KeyLookup));
+const std::size_t KEY_LOOKUP_COUNT = (sizeof( KeyLookupTable ))/ (sizeof( KeyLookup ));
 
 } // namespace KeyLookup
 
index 2864cfe..73f3e81 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * 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.
@@ -36,53 +36,56 @@ KeyLookup KeyLookupTable[]=
   // more than one key name can be assigned to a single dali-key code
   // e.g. "Menu" and "XF86Menu" are both assigned to  DALI_KEY_MENU
 
-  { "Escape",                DALI_KEY_ESCAPE,          false },
-  { "Menu",                  DALI_KEY_MENU,            false },
+  { "Escape",                DALI_KEY_ESCAPE,                                            false },
+  { "Menu",                  DALI_KEY_MENU,                                              false },
 
   // Now literal strings are used as key names instead of defined symbols in utilX,
   // since these definition in utilX.h is deprecated
-  { "XF86Camera",            DALI_KEY_CAMERA,          false },
-  { "XF86Camera_Full",       DALI_KEY_CONFIG,          false },
-  { "XF86PowerOff",          DALI_KEY_POWER,           true  },
-  { "XF86Standby",           DALI_KEY_PAUSE,           false },
-  { "Cancel",                DALI_KEY_CANCEL,          false },
-  { "XF86AudioPlay",         DALI_KEY_PLAY_CD,         false },
-  { "XF86AudioStop",         DALI_KEY_STOP_CD,         false },
-  { "XF86AudioPause",        DALI_KEY_PAUSE_CD,        false },
-  { "XF86AudioNext",         DALI_KEY_NEXT_SONG,       false },
-  { "XF86AudioPrev",         DALI_KEY_PREVIOUS_SONG,   false },
-  { "XF86AudioRewind",       DALI_KEY_REWIND,          false },
-  { "XF86AudioForward",      DALI_KEY_FASTFORWARD,     false },
-  { "XF86AudioMedia",        DALI_KEY_MEDIA,           false },
-  { "XF86AudioPlayPause",    DALI_KEY_PLAY_PAUSE,      false },
-  { "XF86AudioMute",         DALI_KEY_MUTE,            false },
-  { "XF86Menu",              DALI_KEY_MENU,            true  },
-  { "XF86Home",              DALI_KEY_HOME,            true  },
-  { "XF86Back",              DALI_KEY_BACK,            true  },
-  { "XF86Send",              DALI_KEY_MENU,            true  },
-  { "XF86Phone",             DALI_KEY_HOME,            true  },
-  { "XF86Stop",              DALI_KEY_BACK,            true  },
-  { "XF86HomePage",          DALI_KEY_HOMEPAGE,        false },
-  { "XF86WWW",               DALI_KEY_WEBPAGE,         false },
-  { "XF86Mail",              DALI_KEY_MAIL,            false },
-  { "XF86ScreenSaver",       DALI_KEY_SCREENSAVER,     false },
-  { "XF86MonBrightnessUp",   DALI_KEY_BRIGHTNESS_UP,   false },
-  { "XF86MonBrightnessDown", DALI_KEY_BRIGHTNESS_DOWN, false },
-  { "XF86SoftKBD",           DALI_KEY_SOFT_KBD,        false },
-  { "XF86QuickPanel",        DALI_KEY_QUICK_PANEL,     false },
-  { "XF86TaskPane",          DALI_KEY_TASK_SWITCH,     false },
-  { "XF86Apps",              DALI_KEY_APPS,            false },
-  { "XF86Search",            DALI_KEY_SEARCH,          false },
-  { "XF86Voice",             DALI_KEY_VOICE,           false },
-  { "Hangul",                DALI_KEY_LANGUAGE,        false },
-  { "XF86AudioRaiseVolume",  DALI_KEY_VOLUME_UP,       true  },
-  { "XF86AudioLowerVolume",  DALI_KEY_VOLUME_DOWN,     true  },
+  { "XF86Camera",            DALI_KEY_CAMERA,                                            false },
+  { "XF86Camera_Full",       DALI_KEY_CONFIG,                                            false },
+  { "XF86PowerOff",          DALI_KEY_POWER,                                             true  },
+  { "XF86Standby",           DALI_KEY_PAUSE,                                             false },
+  { "Cancel",                DALI_KEY_CANCEL,                                            false },
+  { "XF86AudioPlay",         DALI_KEY_PLAY_CD,                                           false },
+  { "XF86AudioStop",         DALI_KEY_STOP_CD,                                           false },
+  { "XF86AudioPause",        DALI_KEY_PAUSE_CD,                                          false },
+  { "XF86AudioNext",         DALI_KEY_NEXT_SONG,                                         false },
+  { "XF86AudioPrev",         DALI_KEY_PREVIOUS_SONG,                                     false },
+  { "XF86AudioRewind",       DALI_KEY_REWIND,                                            false },
+  { "XF86AudioForward",      DALI_KEY_FASTFORWARD,                                       false },
+  { "XF86AudioMedia",        DALI_KEY_MEDIA,                                             false },
+  { "XF86AudioPlayPause",    DALI_KEY_PLAY_PAUSE,                                        false },
+  { "XF86AudioMute",         DALI_KEY_MUTE,                                              false },
+  { "XF86Menu",              DALI_KEY_MENU,                                              true  },
+  { "XF86Home",              DALI_KEY_HOME,                                              true  },
+  { "XF86Back",              DALI_KEY_BACK,                                              true  },
+  { "XF86Send",              DALI_KEY_MENU,                                              true  },
+  { "XF86Phone",             DALI_KEY_HOME,                                              true  },
+  { "XF86Stop",              DALI_KEY_BACK,                                              true  },
+  { "XF86HomePage",          DALI_KEY_HOMEPAGE,                                          false },
+  { "XF86WWW",               DALI_KEY_WEBPAGE,                                           false },
+  { "XF86Mail",              DALI_KEY_MAIL,                                              false },
+  { "XF86ScreenSaver",       DALI_KEY_SCREENSAVER,                                       false },
+  { "XF86MonBrightnessUp",   DALI_KEY_BRIGHTNESS_UP,                                     false },
+  { "XF86MonBrightnessDown", DALI_KEY_BRIGHTNESS_DOWN,                                   false },
+  { "XF86SoftKBD",           DALI_KEY_SOFT_KBD,                                          false },
+  { "XF86QuickPanel",        DALI_KEY_QUICK_PANEL,                                       false },
+  { "XF86TaskPane",          DALI_KEY_TASK_SWITCH,                                       false },
+  { "XF86Apps",              DALI_KEY_APPS,                                              false },
+  { "XF86Search",            DALI_KEY_SEARCH,                                            false },
+  { "XF86Voice",             DALI_KEY_VOICE,                                             false },
+  { "Hangul",                DALI_KEY_LANGUAGE,                                          false },
+  { "XF86AudioRaiseVolume",  DALI_KEY_VOLUME_UP,                                         true  },
+  { "XF86AudioLowerVolume",  DALI_KEY_VOLUME_DOWN,                                       true  },
 
-  { "BackSpace",             DALI_KEY_BACKSPACE,       false },
-  { "Left",                  DALI_KEY_CURSOR_LEFT,     false },
-  { "Right",                 DALI_KEY_CURSOR_RIGHT,    false },
-  { "Shift_L",               DALI_KEY_SHIFT_LEFT,      false },
-  { "Shift_R",               DALI_KEY_SHIFT_RIGHT,     false }
+  { "BackSpace",             DALI_KEY_BACKSPACE,                                         false },
+  { "Left",                  DALI_KEY_CURSOR_LEFT,                                       false },
+  { "Right",                 DALI_KEY_CURSOR_RIGHT,                                      false },
+  { "Shift_L",               DALI_KEY_SHIFT_LEFT,                                        false },
+  { "Shift_R",               DALI_KEY_SHIFT_RIGHT,                                       false },
+  { "Delete",                static_cast<Dali::KEY>( DevelKey::DALI_KEY_DELETE ),        false },
+  { "Control_L",             static_cast<Dali::KEY>( DevelKey::DALI_KEY_CONTROL_LEFT ),  false },
+  { "Control_R",             static_cast<Dali::KEY>( DevelKey::DALI_KEY_CONTROL_RIGHT ), false }
 };
 
 const std::size_t KEY_LOOKUP_COUNT = (sizeof( KeyLookupTable ))/ (sizeof( KeyLookup ));
index bcf581d..4152e83 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -36,56 +36,61 @@ KeyLookup KeyLookupTable[]=
   // more than one key name can be assigned to a single dali-key code
   // e.g. "Menu" and "XF86Menu" are both assigned to  DALI_KEY_MENU
 
-  { "Escape",                DALI_KEY_ESCAPE,          false },
-  { "Menu",                  DALI_KEY_MENU,            false },
+  { "Escape",                DALI_KEY_ESCAPE,                                            false },
+  { "Menu",                  DALI_KEY_MENU,                                              false },
 
   // Now literal strings are used as key names instead of defined symbols in utilX,
   // since these definition in utilX.h is deprecated
-  { "XF86Camera",            DALI_KEY_CAMERA,          false },
-  { "XF86Camera_Full",       DALI_KEY_CONFIG,          false },
-  { "XF86PowerOff",          DALI_KEY_POWER,           true  },
-  { "XF86Standby",           DALI_KEY_PAUSE,           false },
-  { "Cancel",                DALI_KEY_CANCEL,          false },
-  { "XF86AudioPlay",         DALI_KEY_PLAY_CD,         false },
-  { "XF86AudioStop",         DALI_KEY_STOP_CD,         false },
-  { "XF86AudioPause",        DALI_KEY_PAUSE_CD,        false },
-  { "XF86AudioNext",         DALI_KEY_NEXT_SONG,       false },
-  { "XF86AudioPrev",         DALI_KEY_PREVIOUS_SONG,   false },
-  { "XF86AudioRewind",       DALI_KEY_REWIND,          false },
-  { "XF86AudioForward",      DALI_KEY_FASTFORWARD,     false },
-  { "XF86AudioMedia",        DALI_KEY_MEDIA,           false },
-  { "XF86AudioPlayPause",    DALI_KEY_PLAY_PAUSE,      false },
-  { "XF86AudioMute",         DALI_KEY_MUTE,            false },
-  { "XF86Menu",              DALI_KEY_MENU,            true  },
-  { "XF86Home",              DALI_KEY_HOME,            true  },
-  { "XF86Back",              DALI_KEY_BACK,            true  },
-  { "XF86Send",              DALI_KEY_MENU,            true  },
-  { "XF86Phone",             DALI_KEY_HOME,            true  },
-  { "XF86Stop",              DALI_KEY_BACK,            true  },
-  { "XF86HomePage",          DALI_KEY_HOMEPAGE,        false },
-  { "XF86WWW",               DALI_KEY_WEBPAGE,         false },
-  { "XF86Mail",              DALI_KEY_MAIL,            false },
-  { "XF86ScreenSaver",       DALI_KEY_SCREENSAVER,     false },
-  { "XF86MonBrightnessUp",   DALI_KEY_BRIGHTNESS_UP,   false },
-  { "XF86MonBrightnessDown", DALI_KEY_BRIGHTNESS_DOWN, false },
-  { "XF86SoftKBD",           DALI_KEY_SOFT_KBD,        false },
-  { "XF86QuickPanel",        DALI_KEY_QUICK_PANEL,     false },
-  { "XF86TaskPane",          DALI_KEY_TASK_SWITCH,     false },
-  { "XF86Apps",              DALI_KEY_APPS,            false },
-  { "XF86Search",            DALI_KEY_SEARCH,          false },
-  { "XF86Voice",             DALI_KEY_VOICE,           false },
-  { "Hangul",                DALI_KEY_LANGUAGE,        false },
-  { "XF86AudioRaiseVolume",  DALI_KEY_VOLUME_UP,       true  },
-  { "XF86AudioLowerVolume",  DALI_KEY_VOLUME_DOWN,     true  },
+  { "XF86Camera",            DALI_KEY_CAMERA,                                            false },
+  { "XF86Camera_Full",       DALI_KEY_CONFIG,                                            false },
+  { "XF86PowerOff",          DALI_KEY_POWER,                                             true  },
+  { "XF86Standby",           DALI_KEY_PAUSE,                                             false },
+  { "Cancel",                DALI_KEY_CANCEL,                                            false },
+  { "XF86AudioPlay",         DALI_KEY_PLAY_CD,                                           false },
+  { "XF86AudioStop",         DALI_KEY_STOP_CD,                                           false },
+  { "XF86AudioPause",        DALI_KEY_PAUSE_CD,                                          false },
+  { "XF86AudioNext",         DALI_KEY_NEXT_SONG,                                         false },
+  { "XF86AudioPrev",         DALI_KEY_PREVIOUS_SONG,                                     false },
+  { "XF86AudioRewind",       DALI_KEY_REWIND,                                            false },
+  { "XF86AudioForward",      DALI_KEY_FASTFORWARD,                                       false },
+  { "XF86AudioMedia",        DALI_KEY_MEDIA,                                             false },
+  { "XF86AudioPlayPause",    DALI_KEY_PLAY_PAUSE,                                        false },
+  { "XF86AudioMute",         DALI_KEY_MUTE,                                              false },
+  { "XF86Menu",              DALI_KEY_MENU,                                              true  },
+  { "XF86Home",              DALI_KEY_HOME,                                              true  },
+  { "XF86Back",              DALI_KEY_BACK,                                              true  },
+  { "XF86Send",              DALI_KEY_MENU,                                              true  },
+  { "XF86Phone",             DALI_KEY_HOME,                                              true  },
+  { "XF86Stop",              DALI_KEY_BACK,                                              true  },
+  { "XF86HomePage",          DALI_KEY_HOMEPAGE,                                          false },
+  { "XF86WWW",               DALI_KEY_WEBPAGE,                                           false },
+  { "XF86Mail",              DALI_KEY_MAIL,                                              false },
+  { "XF86ScreenSaver",       DALI_KEY_SCREENSAVER,                                       false },
+  { "XF86MonBrightnessUp",   DALI_KEY_BRIGHTNESS_UP,                                     false },
+  { "XF86MonBrightnessDown", DALI_KEY_BRIGHTNESS_DOWN,                                   false },
+  { "XF86SoftKBD",           DALI_KEY_SOFT_KBD,                                          false },
+  { "XF86QuickPanel",        DALI_KEY_QUICK_PANEL,                                       false },
+  { "XF86TaskPane",          DALI_KEY_TASK_SWITCH,                                       false },
+  { "XF86Apps",              DALI_KEY_APPS,                                              false },
+  { "XF86Search",            DALI_KEY_SEARCH,                                            false },
+  { "XF86Voice",             DALI_KEY_VOICE,                                             false },
+  { "Hangul",                DALI_KEY_LANGUAGE,                                          false },
+  { "XF86AudioRaiseVolume",  DALI_KEY_VOLUME_UP,                                         true  },
+  { "XF86AudioLowerVolume",  DALI_KEY_VOLUME_DOWN,                                       true  },
 
-  { "BackSpace",             DALI_KEY_BACKSPACE,       false },
-  { "Left",                  DALI_KEY_CURSOR_LEFT,     false },
-  { "Right",                 DALI_KEY_CURSOR_RIGHT,    false },
-  { "Shift_L",               DALI_KEY_SHIFT_LEFT,      false },
-  { "Shift_R",               DALI_KEY_SHIFT_RIGHT,     false }
+  { "BackSpace",             DALI_KEY_BACKSPACE,                                         false },
+  { "Left",                  DALI_KEY_CURSOR_LEFT,                                       false },
+  { "Right",                 DALI_KEY_CURSOR_RIGHT,                                      false },
+  { "left",                  DALI_KEY_CURSOR_LEFT,                                       false }, // To be removed after the key name is fixed in the platform
+  { "right",                 DALI_KEY_CURSOR_RIGHT,                                      false }, // To be removed after the key name is fixed in the platform
+  { "Shift_L",               DALI_KEY_SHIFT_LEFT,                                        false },
+  { "Shift_R",               DALI_KEY_SHIFT_RIGHT,                                       false },
+  { "Delete",                static_cast<Dali::KEY>( DevelKey::DALI_KEY_DELETE ),        false },
+  { "Control_L",             static_cast<Dali::KEY>( DevelKey::DALI_KEY_CONTROL_LEFT ),  false },
+  { "Control_R",             static_cast<Dali::KEY>( DevelKey::DALI_KEY_CONTROL_RIGHT ), false }
 };
 
-const std::size_t KEY_LOOKUP_COUNT = (sizeof( KeyLookupTable))/ (sizeof(KeyLookup));
+const std::size_t KEY_LOOKUP_COUNT = (sizeof( KeyLookupTable ))/ (sizeof( KeyLookup ));
 
 } // namespace KeyLookup
 
index 6603b27..f280088 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * 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.
@@ -36,56 +36,61 @@ KeyLookup KeyLookupTable[]=
   // more than one key name can be assigned to a single dali-key code
   // e.g. "Menu" and "XF86Menu" are both assigned to  DALI_KEY_MENU
 
-  { "Escape",                DALI_KEY_ESCAPE,          false },
-  { "Menu",                  DALI_KEY_MENU,            false },
+  { "Escape",                DALI_KEY_ESCAPE,                                            false },
+  { "Menu",                  DALI_KEY_MENU,                                              false },
 
   // Now literal strings are used as key names instead of defined symbols in utilX,
   // since these definition in utilX.h is deprecated
-  { "XF86Camera",            DALI_KEY_CAMERA,          false },
-  { "XF86Camera_Full",       DALI_KEY_CONFIG,          false },
-  { "XF86PowerOff",          DALI_KEY_POWER,           true  },
-  { "XF86Standby",           DALI_KEY_PAUSE,           false },
-  { "Cancel",                DALI_KEY_CANCEL,          false },
-  { "XF86AudioPlay",         DALI_KEY_PLAY_CD,         false },
-  { "XF86AudioStop",         DALI_KEY_STOP_CD,         false },
-  { "XF86AudioPause",        DALI_KEY_PAUSE_CD,        false },
-  { "XF86AudioNext",         DALI_KEY_NEXT_SONG,       false },
-  { "XF86AudioPrev",         DALI_KEY_PREVIOUS_SONG,   false },
-  { "XF86AudioRewind",       DALI_KEY_REWIND,          false },
-  { "XF86AudioForward",      DALI_KEY_FASTFORWARD,     false },
-  { "XF86AudioMedia",        DALI_KEY_MEDIA,           false },
-  { "XF86AudioPlayPause",    DALI_KEY_PLAY_PAUSE,      false },
-  { "XF86AudioMute",         DALI_KEY_MUTE,            false },
-  { "XF86Menu",              DALI_KEY_MENU,            true  },
-  { "XF86Home",              DALI_KEY_HOME,            true  },
-  { "XF86Back",              DALI_KEY_BACK,            true  },
-  { "XF86Send",              DALI_KEY_MENU,            true  },
-  { "XF86Phone",             DALI_KEY_HOME,            true  },
-  { "XF86Stop",              DALI_KEY_BACK,            true  },
-  { "XF86HomePage",          DALI_KEY_HOMEPAGE,        false },
-  { "XF86WWW",               DALI_KEY_WEBPAGE,         false },
-  { "XF86Mail",              DALI_KEY_MAIL,            false },
-  { "XF86ScreenSaver",       DALI_KEY_SCREENSAVER,     false },
-  { "XF86MonBrightnessUp",   DALI_KEY_BRIGHTNESS_UP,   false },
-  { "XF86MonBrightnessDown", DALI_KEY_BRIGHTNESS_DOWN, false },
-  { "XF86SoftKBD",           DALI_KEY_SOFT_KBD,        false },
-  { "XF86QuickPanel",        DALI_KEY_QUICK_PANEL,     false },
-  { "XF86TaskPane",          DALI_KEY_TASK_SWITCH,     false },
-  { "XF86Apps",              DALI_KEY_APPS,            false },
-  { "XF86Search",            DALI_KEY_SEARCH,          false },
-  { "XF86Voice",             DALI_KEY_VOICE,           false },
-  { "Hangul",                DALI_KEY_LANGUAGE,        false },
-  { "XF86AudioRaiseVolume",  DALI_KEY_VOLUME_UP,       true  },
-  { "XF86AudioLowerVolume",  DALI_KEY_VOLUME_DOWN,     true  },
+  { "XF86Camera",            DALI_KEY_CAMERA,                                            false },
+  { "XF86Camera_Full",       DALI_KEY_CONFIG,                                            false },
+  { "XF86PowerOff",          DALI_KEY_POWER,                                             true  },
+  { "XF86Standby",           DALI_KEY_PAUSE,                                             false },
+  { "Cancel",                DALI_KEY_CANCEL,                                            false },
+  { "XF86AudioPlay",         DALI_KEY_PLAY_CD,                                           false },
+  { "XF86AudioStop",         DALI_KEY_STOP_CD,                                           false },
+  { "XF86AudioPause",        DALI_KEY_PAUSE_CD,                                          false },
+  { "XF86AudioNext",         DALI_KEY_NEXT_SONG,                                         false },
+  { "XF86AudioPrev",         DALI_KEY_PREVIOUS_SONG,                                     false },
+  { "XF86AudioRewind",       DALI_KEY_REWIND,                                            false },
+  { "XF86AudioForward",      DALI_KEY_FASTFORWARD,                                       false },
+  { "XF86AudioMedia",        DALI_KEY_MEDIA,                                             false },
+  { "XF86AudioPlayPause",    DALI_KEY_PLAY_PAUSE,                                        false },
+  { "XF86AudioMute",         DALI_KEY_MUTE,                                              false },
+  { "XF86Menu",              DALI_KEY_MENU,                                              true  },
+  { "XF86Home",              DALI_KEY_HOME,                                              true  },
+  { "XF86Back",              DALI_KEY_BACK,                                              true  },
+  { "XF86Send",              DALI_KEY_MENU,                                              true  },
+  { "XF86Phone",             DALI_KEY_HOME,                                              true  },
+  { "XF86Stop",              DALI_KEY_BACK,                                              true  },
+  { "XF86HomePage",          DALI_KEY_HOMEPAGE,                                          false },
+  { "XF86WWW",               DALI_KEY_WEBPAGE,                                           false },
+  { "XF86Mail",              DALI_KEY_MAIL,                                              false },
+  { "XF86ScreenSaver",       DALI_KEY_SCREENSAVER,                                       false },
+  { "XF86MonBrightnessUp",   DALI_KEY_BRIGHTNESS_UP,                                     false },
+  { "XF86MonBrightnessDown", DALI_KEY_BRIGHTNESS_DOWN,                                   false },
+  { "XF86SoftKBD",           DALI_KEY_SOFT_KBD,                                          false },
+  { "XF86QuickPanel",        DALI_KEY_QUICK_PANEL,                                       false },
+  { "XF86TaskPane",          DALI_KEY_TASK_SWITCH,                                       false },
+  { "XF86Apps",              DALI_KEY_APPS,                                              false },
+  { "XF86Search",            DALI_KEY_SEARCH,                                            false },
+  { "XF86Voice",             DALI_KEY_VOICE,                                             false },
+  { "Hangul",                DALI_KEY_LANGUAGE,                                          false },
+  { "XF86AudioRaiseVolume",  DALI_KEY_VOLUME_UP,                                         true  },
+  { "XF86AudioLowerVolume",  DALI_KEY_VOLUME_DOWN,                                       true  },
 
-  { "BackSpace",             DALI_KEY_BACKSPACE,       false },
-  { "Left",                  DALI_KEY_CURSOR_LEFT,     false },
-  { "Right",                 DALI_KEY_CURSOR_RIGHT,    false },
-  { "Shift_L",               DALI_KEY_SHIFT_LEFT,      false },
-  { "Shift_R",               DALI_KEY_SHIFT_RIGHT,     false }
+  { "BackSpace",             DALI_KEY_BACKSPACE,                                         false },
+  { "Left",                  DALI_KEY_CURSOR_LEFT,                                       false },
+  { "Right",                 DALI_KEY_CURSOR_RIGHT,                                      false },
+  { "left",                  DALI_KEY_CURSOR_LEFT,                                       false }, // To be removed after the key name is fixed in the platform
+  { "right",                 DALI_KEY_CURSOR_RIGHT,                                      false }, // To be removed after the key name is fixed in the platform
+  { "Shift_L",               DALI_KEY_SHIFT_LEFT,                                        false },
+  { "Shift_R",               DALI_KEY_SHIFT_RIGHT,                                       false },
+  { "Delete",                static_cast<Dali::KEY>( DevelKey::DALI_KEY_DELETE ),        false },
+  { "Control_L",             static_cast<Dali::KEY>( DevelKey::DALI_KEY_CONTROL_LEFT ),  false },
+  { "Control_R",             static_cast<Dali::KEY>( DevelKey::DALI_KEY_CONTROL_RIGHT ), false }
 };
 
-const std::size_t KEY_LOOKUP_COUNT = (sizeof( KeyLookupTable))/ (sizeof(KeyLookup));
+const std::size_t KEY_LOOKUP_COUNT = (sizeof( KeyLookupTable ))/ (sizeof( KeyLookup ));
 
 } // namespace KeyLookup
 
index f1bfe8c..c79d5bd 100644 (file)
@@ -257,6 +257,13 @@ endif # WAYLAND
 
 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)
 
@@ -290,6 +297,14 @@ LIBDALI_ADAPTOR_LA_SOURCES += \
   $(base_adaptor_networking_src_files)
 endif
 
+if USE_APPFW
+if USE_APPFW_EFL_BASE
+else # over Tizen 3.0
+LIBDALI_ADAPTOR_LA_SOURCES += \
+                     $(adaptor_widget_src_files)
+endif
+endif
+
 libdali_adaptor_la_DEPENDENCIES =
 
 # List include directories with more platform-specific (tizen) before portable root:
@@ -438,13 +453,17 @@ LIBDALI_ADAPTOR_LA_CXXFLAGS += $(ELEMENTARY_CFLAGS)
 LIBDALI_ADAPTOR_LA_LIBADD += $(ELEMENTARY_LIBS)
 
 else
-LIBDALI_ADAPTOR_LA_CXXFLAGS += $(CAPI_APPFW_COMMON_CFLAGS) \
+LIBDALI_ADAPTOR_LA_CXXFLAGS += $(BUNDLE_CFLAGS) \
+                               $(CAPI_APPFW_COMMON_CFLAGS) \
                                $(CAPI_APPFW_CONTROL_CFLAGS) \
+                               $(CAPI_APPFW_WIDGET_BASE_CFLAGS) \
                                $(ECORE_IMF_CFLAGS) \
                                $(FRIBIDI_CFLAGS)
 
-LIBDALI_ADAPTOR_LA_LIBADD += $(CAPI_APPFW_COMMON_LIBS) \
+LIBDALI_ADAPTOR_LA_LIBADD += $(BUNDLE_LIBS) \
+                             $(CAPI_APPFW_COMMON_LIBS) \
                              $(CAPI_APPFW_CONTROL_LIBS) \
+                             $(CAPI_APPFW_WIDGET_BASE_LIBS) \
                              $(ECORE_IMF_LIBS) \
                              $(FRIBIDI_LIBS)
 endif
@@ -560,6 +579,13 @@ tizenadaptorpublicapi_HEADERS += $(adaptor_dali_wearable_header_file)
 tizenwatchpublicapidir = $(tizenadaptorpublicapidir)/watch
 tizenwatchpublicapi_HEADERS = $(public_dali_watch_header_files)
 
+if USE_APPFW
+if USE_APPFW_EFL_BASE
+else
+tizenadaptorframeworkdevelapi_HEADERS += $(adaptor_widget_header_files)
+endif
+endif
+
 install-data-local:
        $(MKDIR_P) ${DESTDIR}/${daliUserFontCacheDir} ${DESTDIR}/${daliShaderbinCacheDir}
 
index 2bd1a7c..4a7f614 100644 (file)
@@ -277,7 +277,10 @@ if test "x$enable_tizen_major_version" = "x3"; then
 PKG_CHECK_MODULES(CAPI_APPFW_APPLICATION, capi-appfw-application)
 PKG_CHECK_MODULES(ELEMENTARY, elementary)
 else
+DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DWIDGET_AVAILABLE"
+PKG_CHECK_MODULES(BUNDLE, bundle)
 PKG_CHECK_MODULES(CAPI_APPFW_APPLICATION, appcore-ui)
+PKG_CHECK_MODULES(CAPI_APPFW_WIDGET_BASE, appcore-widget-base)
 PKG_CHECK_MODULES(CAPI_APPFW_COMMON, capi-appfw-app-common)
 PKG_CHECK_MODULES(CAPI_APPFW_CONTROL, capi-appfw-app-control)
 fi
index 9cc9af8..9a595bd 100644 (file)
@@ -19,7 +19,7 @@
 
 Name:       dali-adaptor
 Summary:    The DALi Tizen Adaptor
-Version:    1.3.1
+Version:    1.3.2
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT
@@ -120,6 +120,8 @@ BuildRequires:  pkgconfig(capi-appfw-application)
 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)