VR: Merge devel/master into devel/new_vr branch 88/88288/1
authorPaul Wisbey <p.wisbey@samsung.com>
Thu, 28 Jul 2016 12:13:32 +0000 (13:13 +0100)
committerTom Robinson <tom.robinson@samsung.com>
Thu, 15 Sep 2016 18:23:55 +0000 (19:23 +0100)
Change-Id: Ia9f7418b19791d87e48be222d3ce60664741687b

93 files changed:
adaptors/base/display-connection.cpp
adaptors/base/display-connection.h
adaptors/base/render-helper.cpp
adaptors/common/adaptor-impl.cpp
adaptors/common/adaptor-impl.h
adaptors/common/adaptor.cpp
adaptors/common/application-impl.cpp
adaptors/common/application-impl.h
adaptors/common/callback-manager.h
adaptors/common/clipboard-impl.h
adaptors/common/event-loop/ecore/ecore-callback-manager.cpp
adaptors/common/event-loop/ecore/ecore-callback-manager.h
adaptors/common/event-loop/lib-uv/uv-callback-manager.cpp
adaptors/common/event-loop/lib-uv/uv-callback-manager.h
adaptors/common/framework.h
adaptors/devel-api/adaptor-framework/clipboard.cpp
adaptors/devel-api/adaptor-framework/clipboard.h
adaptors/devel-api/adaptor-framework/imf-manager.cpp
adaptors/devel-api/adaptor-framework/imf-manager.h
adaptors/devel-api/adaptor-framework/render-surface.h
adaptors/ecore/common/ecore-indicator-impl.cpp
adaptors/ecore/common/ecore-indicator-impl.h
adaptors/ecore/wayland/clipboard-impl-ecore-wl.cpp
adaptors/ecore/wayland/display-connection-impl-ecore-wl.cpp
adaptors/ecore/wayland/display-connection-impl.h
adaptors/ecore/wayland/event-handler-ecore-wl.cpp
adaptors/ecore/wayland/imf-manager-impl-ecore-wl.cpp
adaptors/ecore/wayland/imf-manager-impl.h
adaptors/ecore/wayland/render-surface-ecore-wl.cpp
adaptors/ecore/wayland/window-impl-ecore-wl.cpp
adaptors/integration-api/adaptor.h
adaptors/integration-api/file.list
adaptors/integration-api/native-render-surface-factory.h [new file with mode: 0644]
adaptors/integration-api/trigger-event-factory-interface.h
adaptors/integration-api/trigger-event-factory.h
adaptors/integration-api/wayland/ecore-wl-render-surface.h
adaptors/integration-api/wayland/native-render-surface.h [new file with mode: 0644]
adaptors/integration-api/x11/ecore-x-render-surface.h
adaptors/integration-api/x11/imf-manager-impl.h
adaptors/integration-api/x11/pixmap-render-surface.h
adaptors/libuv/framework-libuv.cpp
adaptors/mobile/file.list
adaptors/mobile/native-render-surface-factory.cpp [new file with mode: 0644]
adaptors/public-api/adaptor-framework/application.cpp
adaptors/public-api/adaptor-framework/application.h
adaptors/public-api/adaptor-framework/native-image-source.h
adaptors/public-api/adaptor-framework/tts-player.h
adaptors/public-api/adaptor-framework/window.h
adaptors/public-api/dali-adaptor-version.cpp
adaptors/tizen/display-connection-impl-tizen.cpp [new file with mode: 0644]
adaptors/tizen/file.list
adaptors/tizen/framework-tizen.cpp
adaptors/tizen/native-render-surface-tizen.cpp [new file with mode: 0644]
adaptors/ubuntu/framework-ubuntu.cpp
adaptors/wayland/clipboard/clipboard-impl-wl.cpp
adaptors/wayland/display-connection-impl-wl.cpp
adaptors/wayland/display-connection-impl.h
adaptors/wayland/input/text/imf/imf-manager-impl-wl.cpp
adaptors/wayland/input/text/imf/imf-manager-impl.h
adaptors/wayland/render-surface/render-surface-wl.cpp
adaptors/wayland/render-surface/render-surface-wl.h
adaptors/wearable/watch/watch-application.h
adaptors/wearable/watch/watch-time.cpp
adaptors/x11/clipboard-impl-x.cpp
adaptors/x11/display-connection-impl-x.cpp
adaptors/x11/display-connection-impl.h
adaptors/x11/ecore-x-render-surface.cpp
adaptors/x11/imf-manager-impl-x.cpp
adaptors/x11/pixmap-render-surface-x.cpp
automated-tests/patch-coverage.pl
automated-tests/src/dali-adaptor-internal/utc-Dali-FontClient.cpp
automated-tests/src/dali-adaptor/dali-test-suite-utils/dali-test-suite-utils.cpp
automated-tests/src/dali-adaptor/dali-test-suite-utils/dali-test-suite-utils.h
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-trace-call-stack.cpp
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-trace-call-stack.h
automated-tests/src/dali-adaptor/utc-Dali-Application.cpp
build/tizen/adaptor-uv/Makefile.am
build/tizen/adaptor-uv/configure.ac
build/tizen/adaptor/Makefile.am
build/tizen/adaptor/configure.ac
packaging/dali-adaptor.spec
platform-abstractions/tizen/image-loaders/loader-gif.cpp
text/dali/devel-api/text-abstraction/font-client.cpp
text/dali/devel-api/text-abstraction/font-client.h
text/dali/devel-api/text-abstraction/font-list.h
text/dali/devel-api/text-abstraction/script.cpp
text/dali/devel-api/text-abstraction/script.h
text/dali/internal/text-abstraction/font-client-helper.cpp
text/dali/internal/text-abstraction/font-client-impl.cpp
text/dali/internal/text-abstraction/font-client-impl.h
text/dali/internal/text-abstraction/font-client-plugin-impl.cpp
text/dali/internal/text-abstraction/font-client-plugin-impl.h
text/dali/internal/text-abstraction/shaping-impl.cpp

index 1dc44e9205ed25748e287d135164204f77ec07a5..d34a14f4245e9058a207fdfe0bc110067b763aef 100644 (file)
@@ -34,6 +34,14 @@ DisplayConnection* DisplayConnection::New()
   return new DisplayConnection(internal);
 }
 
+DisplayConnection* DisplayConnection::New( RenderSurface::Type type )
+{
+  Internal::Adaptor::DisplayConnection* internal(Internal::Adaptor::DisplayConnection::New());
+  internal->SetSurfaceType( type );
+
+  return new DisplayConnection(internal);
+}
+
 DisplayConnection::DisplayConnection()
 : mImpl( NULL )
 {
index e38cc78d205d51156750401fffba475e600f3ad2..e59f74c86633e5684cdaccaee53010c5ac7ba509 100644 (file)
@@ -22,6 +22,7 @@
 #include <dali/public-api/object/any.h>
 
 // INTERNAL INCLUDES
+#include <render-surface.h>
 
 
 namespace Dali
@@ -48,6 +49,15 @@ public:
    */
   static DisplayConnection* New();
 
+  /**
+   * @brief Create an initialized DisplayConnection.
+   * Native surface will need this instead of DisplayConnection::New()
+   *
+   * @param[in] type Render surface type
+   * @return A handle to a newly allocated DisplayConnection resource.
+   */
+  static DisplayConnection* New( RenderSurface::Type type );
+
   /**
    * @brief Create a DisplayConnection handle; this can be initialised with DisplayConnection::New().
    *
index d3a771aabbdf4b09e1c19e9db6eca8a3b7baa1e1..b4ee99943a077e9642bc1ed4615c86431fa2b4b4 100644 (file)
@@ -43,7 +43,14 @@ RenderHelper::RenderHelper( AdaptorInternalServices& adaptorInterfaces )
   // set the initial values before render thread starts
   mSurface = adaptorInterfaces.GetRenderSurfaceInterface();
 
-  mDisplayConnection = Dali::DisplayConnection::New();
+  if( mSurface )
+  {
+    mDisplayConnection = Dali::DisplayConnection::New( mSurface->GetSurfaceType() );
+  }
+  else
+  {
+    mDisplayConnection = Dali::DisplayConnection::New();
+  }
 }
 
 RenderHelper::~RenderHelper()
index b39744792777952b3f176b389a4342ac1519f024..bacca1429243ffbbfc4ab8cd42fe74be914bde6c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -470,6 +470,10 @@ bool Adaptor::AddIdle( CallbackBase* callback )
   return idleAdded;
 }
 
+void Adaptor::RemoveIdle( CallbackBase* callback )
+{
+  mCallbackManager->RemoveIdleCallback( callback );
+}
 
 Dali::Adaptor& Adaptor::Get()
 {
index 056ad47b1916a4aab3a65e495f778552eb665c7a..e52a190d4676595f0434a415ba1dc383ef9abac3 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_ADAPTOR_IMPL_H__
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -221,6 +221,11 @@ public: // AdaptorInternalServices implementation
    */
   virtual bool AddIdle( CallbackBase* callback );
 
+  /**
+   * @copydoc Dali::Adaptor::RemoveIdle()
+   */
+  virtual void RemoveIdle( CallbackBase* callback );
+
 public:
 
   /**
index 9c6701c739f6541de2524105ea9d972cad28e79b..a2e80adbc45e2cc51f24eaaf4748e7b3e4377923 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -84,6 +84,11 @@ bool Adaptor::AddIdle( CallbackBase* callback )
   return mImpl->AddIdle( callback );
 }
 
+void Adaptor::RemoveIdle( CallbackBase* callback )
+{
+  mImpl->RemoveIdle( callback );
+}
+
 void Adaptor::ReplaceSurface( Any nativeWindow, Dali::RenderSurface& surface )
 {
   mImpl->ReplaceSurface(nativeWindow, surface);
index c471eb315910cd355652d076a9d805eee5b674e8..fca53370d42f1616316e16cedf90ab2b1fb3454e 100644 (file)
@@ -25,6 +25,7 @@
 #include <style-monitor.h>
 #include <command-line-options.h>
 #include <common/adaptor-impl.h>
+#include <common/framework.h>
 #include <singleton-service-impl.h>
 #include <lifecycle-controller-impl.h>
 #include <iostream> //TODOVR
@@ -353,6 +354,11 @@ void Application::ReplaceWindow(PositionSize windowPosition, const std::string&
   mWindow = newWindow;
 }
 
+std::string Application::GetResourcePath()
+{
+  return Internal::Adaptor::Framework::GetResourcePath();
+}
+
 } // namespace Adaptor
 
 } // namespace Internal
index 68de173f788b985344cb8a82558fe915faece886..506496f19ab29d7a419d86eea747c0a6125e11e6 100644 (file)
@@ -106,6 +106,11 @@ public:
    */
   void ReplaceWindow(PositionSize windowPosition, const std::string& name);
 
+  /**
+   * @copydoc Dali::Application::GetResourcePath();
+   */
+  static std::string GetResourcePath();
+
 public: // Stereoscopy
 
   /**
index 20f87986c12cc43fbde761b2c7d69c1b033453b8..fc16aca37d36b587a2e966d807c1b2b67c248bd2 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_CALLBACK_MANAGER_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -50,14 +50,25 @@ public:
     virtual ~CallbackManager() {}
 
     /**
-     * Adds a call back to be run on idle.
-     * Must be call from main thread only.
-     * @param callback custom call back function
-     * @param priority call back priority
+     * @brief Adds a @p callback to be run on idle.
+     * @note Must be called from the main thread only.
+     *
+     * @param[in] callback custom callback function.
+     *
      * @return true on success
      */
     virtual bool AddIdleCallback( CallbackBase* callback ) = 0;
 
+    /**
+     * @brief Removes a previously added @p callback.
+     * @note Must be called from main thread only.
+     *
+     * Does nothing if the @p callback doesn't exist.
+     *
+     * @param[in] callback The callback to be removed.
+     */
+    virtual void RemoveIdleCallback( CallbackBase* callback ) = 0;
+
     /**
      * Starts the callback manager.
      */
index da164a99a52fe97e4cca2b47e629a509a34379b9..75f70e993c4bd0ff7c445206044ecee9a710b0d3 100644 (file)
@@ -66,9 +66,9 @@ public:
   bool SetItem(const std::string &itemData);
 
   /**
-   * @copydoc Dali::Clipboard::GetItem()
+   * @copydoc Dali::Clipboard::RequestItem()
    */
-  std::string GetItem( unsigned int index );
+  void RequestItem();
 
   /**
    * @copydoc Dali::Clipboard::NumberOfClipboardItems()
@@ -83,7 +83,21 @@ public:
   /**
    * @copydoc Dali::Clipboard::HideClipboard()
    */
-  void HideClipboard();
+  void HideClipboard(bool skipFirstHide);
+
+  /**
+  * @copydoc Dali::Clipboard::IsVisible()
+  */
+  bool IsVisible() const;
+
+  /**
+  * @brief exchange either sending or receiving buffered data
+  *
+  * @param[in] type true for send buffered data, false for receive data to buffer
+  * @param[in] event information pointer
+  * @return The buffer pointer for send or receive data
+  */
+  char* ExcuteBuffered( bool type, void *event );
 
 private:
 
@@ -95,26 +109,27 @@ private:
 
   Impl* mImpl;
 
-}; // class clipboard
+public:
 
+}; // class clipboard
 
 } // namespace Adaptor
 
 } // namespace Internal
 
-  inline static Internal::Adaptor::Clipboard& GetImplementation(Dali::Clipboard& clipboard)
-  {
-    DALI_ASSERT_ALWAYS( clipboard && "Clipboard handle is empty" );
-    BaseObject& handle = clipboard.GetBaseObject();
-    return static_cast<Internal::Adaptor::Clipboard&>(handle);
-  }
-
-  inline static const  Internal::Adaptor::Clipboard& GetImplementation(const Dali::Clipboard& clipboard)
-  {
-    DALI_ASSERT_ALWAYS( clipboard && "Clipboard handle is empty" );
-    const BaseObject& handle = clipboard.GetBaseObject();
-    return static_cast<const Internal::Adaptor::Clipboard&>(handle);
-  }
+inline static Internal::Adaptor::Clipboard& GetImplementation(Dali::Clipboard& clipboard)
+{
+  DALI_ASSERT_ALWAYS( clipboard && "Clipboard handle is empty" );
+  BaseObject& handle = clipboard.GetBaseObject();
+  return static_cast<Internal::Adaptor::Clipboard&>(handle);
+}
+
+inline static const  Internal::Adaptor::Clipboard& GetImplementation(const Dali::Clipboard& clipboard)
+{
+  DALI_ASSERT_ALWAYS( clipboard && "Clipboard handle is empty" );
+  const BaseObject& handle = clipboard.GetBaseObject();
+  return static_cast<const Internal::Adaptor::Clipboard&>(handle);
+}
 
 } // namespace Dali
 
index b6e5f3cd9bdf247a189c724b62944fa094dca9ce..77b525e5ddfd9fa77e4afd6e8328af532e4d50de 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -120,7 +120,7 @@ bool EcoreCallbackManager::AddIdleCallback( CallbackBase* callback )
     return false;
   }
 
-  CallbackData *callbackData = new CallbackData( callback );
+  CallbackDatacallbackData = new CallbackData( callback );
 
   callbackData->mRemoveFromContainerFunction =  MakeCallback( this, &EcoreCallbackManager::RemoveCallbackFromContainer );
 
@@ -135,6 +135,25 @@ bool EcoreCallbackManager::AddIdleCallback( CallbackBase* callback )
   return true;
 }
 
+void EcoreCallbackManager::RemoveIdleCallback( CallbackBase* callback )
+{
+  for( CallbackList::iterator it = mCallbackContainer.begin(),
+         endIt = mCallbackContainer.end();
+       it != endIt;
+       ++it )
+  {
+    CallbackData* data = *it;
+
+    if( data->mCallback == callback )
+    {
+      // remove callback data from the container.
+      CallbackBase::Execute( *data->mRemoveFromContainerFunction, data );
+
+      ecore_idler_del( data->mIdler );
+    }
+  }
+}
+
 void EcoreCallbackManager::RemoveCallbackFromContainer(CallbackData *callbackData)
 {
   mCallbackContainer.remove(callbackData);
index f93cc72b7a5967c2dd6db1c485a8ddb777baad69..a158a4ec45a25f9d14aec6733a3b1c258115824a 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_ECORE_CALLBACK_MANAGER_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -57,10 +57,15 @@ public:
     }
 
     /**
-     * @copydoc CallbackManager::AddCallback()
+     * @copydoc CallbackManager::AddIdleCallback()
      */
     virtual bool AddIdleCallback( CallbackBase* callback );
 
+    /**
+     * @copydoc CallbackManager::RemoveIdleCallback()
+     */
+    virtual void RemoveIdleCallback( CallbackBase* callback );
+
     /**
      * @copydoc CallbackManager::Start()
      */
index ab8552dcda67b95ab843bef3e316654440878084..9aca9c8c837c296cc359c16dbd3daa9875df6816 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -154,7 +154,7 @@ bool UvCallbackManager::AddIdleCallback( CallbackBase* callback )
     return false;
   }
 
-  CallbackData *callbackData = new CallbackData(callback );
+  CallbackData *callbackData = new CallbackData( callback );
 
   // To inform the manager a callback has finished, we get it to call RemoveCallbackFromContainer
   callbackData->mRemoveFromContainerFunction =  MakeCallback( this, &UvCallbackManager::RemoveCallbackFromContainer );
@@ -168,6 +168,25 @@ bool UvCallbackManager::AddIdleCallback( CallbackBase* callback )
   return true;
 }
 
+void UvCallbackManager::RemoveIdleCallback( CallbackBase* callback )
+{
+  for( CallbackList::iterator it = mCallbackContainer.begin(),
+         endIt = mCallbackContainer.end();
+       it != endIt;
+       ++it )
+  {
+    CallbackData* data = *it;
+
+    if( data->mCallback == callback )
+    {
+      // remove callback data from the container.
+      CallbackBase::Execute( *data->mRemoveFromContainerFunction, data );
+
+      delete data;
+    }
+  }
+}
+
 void UvCallbackManager::RemoveCallbackFromContainer(CallbackData *callbackData)
 {
   mCallbackContainer.remove(callbackData);
index 78abab67484c2252df1856f4788a66aea0b92f60..0fcc2c1e1a1e5e51cfd1e8d20afb605eb204ddcb 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_UV_CALLBACK_MANAGER_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -56,10 +56,15 @@ public:
     ~UvCallbackManager(){}
 
     /**
-     * @copydoc CallbackManager::AddCallback()
+     * @copydoc CallbackManager::AddIdleCallback()
      */
     virtual bool AddIdleCallback( CallbackBase* callback );
 
+    /**
+     * @copydoc CallbackManager::RemoveIdleCallback()
+     */
+    virtual void RemoveIdleCallback( CallbackBase* callback );
+
     /**
      * @copydoc CallbackManager::Start()
      */
index 4dacf5f581aee7c263a5a42d1bc64bb62c5d408d..6037d57ec15f63a914def71e266564841651fac3 100644 (file)
@@ -38,9 +38,12 @@ namespace Adaptor
 {
 
 /**
- * The Framework class is used to register callbacks with the TIZEN platform so that
+ * The Framework class is ideally placed to provide key API required by Applications.
+ *
+ * The class is also used to register callbacks with the TIZEN platform so that
  * we know when any of the application lifecycle events occur.  This includes events
  * like when our application is to be initialised, terminated, paused, resumed etc.
+ *
  */
 class Framework
 {
@@ -179,6 +182,11 @@ public:
    */
   std::string GetBundleId() const;
 
+  /**
+   *  Gets the path at which application resources are stored.
+   */
+  static std::string GetResourcePath();
+
 private:
 
   // Undefined
index 95f1b5281c78a502e4b1ece2395f5ba78636e318..38264a50cc9027a16d648bdf2166770ec0770ad7 100644 (file)
@@ -39,14 +39,15 @@ Clipboard Clipboard::Get()
 {
   return Internal::Adaptor::Clipboard::Get();
 }
+
 bool Clipboard::SetItem( const std::string &itemData)
 {
   return GetImplementation(*this).SetItem( itemData );
 }
 
-std::string Clipboard::GetItem( unsigned int index )
+void Clipboard::RequestItem()
 {
-  return GetImplementation(*this).GetItem( index );
+  GetImplementation(*this).RequestItem();
 }
 
 unsigned int Clipboard::NumberOfItems()
@@ -61,7 +62,12 @@ void Clipboard::ShowClipboard()
 
 void Clipboard::HideClipboard()
 {
-  GetImplementation(*this).HideClipboard();
+  GetImplementation(*this).HideClipboard(false);
+}
+
+bool Clipboard::IsVisible() const
+{
+  return GetImplementation(*this).IsVisible();
 }
 
 } // namespace Dali
index 9b5a54a60bd0d7fa827e63f4f32c7f2d05510980..5d84c8f71f983982e6144fc3a81e4e17f6d19f11 100644 (file)
@@ -2,7 +2,7 @@
 #define  __DALI_CLIPBOARD_H__
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -82,12 +82,12 @@ public:
   bool SetItem( const std::string& itemData );
 
   /**
-   * @brief Retreive the string at the given index in the clipboard.
+   * @brief Request clipboard service to retrieve an item
    *
-   * @param[in] index item in clipboard list to retrieve
-   * @return string the text item at the current index.
+   * Calling this method will trigger a signal from the clipboard event notifier.
+   * @see Dali::ClipboardEventNotifier::ContentSelectedSignal()
    */
-  std::string GetItem( unsigned int index );
+  void RequestItem();
 
   /**
    * @brief Returns the number of item currently in the clipboard.
@@ -106,6 +106,12 @@ public:
    */
   void HideClipboard();
 
+  /**
+  * @brief Retrieves the clipboard's visibility
+  * @return bool true if the clipboard is visible.
+  */
+  bool IsVisible() const;
+
 };
 } // namespace Dali
 
index f083c8b1f2f81e5f1d8b8cbf09a084468c31d594..4410609288235364cb0dd18b11c5c21825d400f1 100644 (file)
@@ -88,6 +88,11 @@ const std::string& ImfManager::GetSurroundingText() const
   return Internal::Adaptor::ImfManager::GetImplementation(*this).GetSurroundingText();
 }
 
+void ImfManager::NotifyTextInputMultiLine( bool multiLine )
+{
+  Internal::Adaptor::ImfManager::GetImplementation(*this).NotifyTextInputMultiLine( multiLine );
+}
+
 ImfManager::ImfManagerSignalType& ImfManager::ActivatedSignal()
 {
   return Internal::Adaptor::ImfManager::GetImplementation(*this).ActivatedSignal();
index a674ce777d43489e0b7d5d304dc8d8878bbfdeb0..8123b9dae5d6e43768e3af0167f3e97c0451dd9e 100644 (file)
@@ -211,6 +211,13 @@ public:
    */
   const std::string& GetSurroundingText() const;
 
+  /**
+ * @brief Notifies IMF context that text input is set to multi line or not
+ *
+ * @param[in] multiLine True if multiline text input is used
+ */
+  void NotifyTextInputMultiLine( bool multiLine );
+
 public:
 
   // Signals
index 28441053ba86faf0ed75e79de87148fc44a42147..61fd74d79d712e926564c8b61e17464fc56194fc 100644 (file)
@@ -62,6 +62,13 @@ class RenderSurface
 {
 public:
 
+  enum Type
+  {
+    ECORE_RENDER_SURFACE,
+    WAYLAND_RENDER_SURFACE,
+    NATIVE_RENDER_SURFACE
+  };
+
   /**
    * @brief Constructor
    * Inlined as this is a pure abstract interface
@@ -157,6 +164,8 @@ public:
    */
   virtual void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization ) = 0;
 
+  virtual RenderSurface::Type GetSurfaceType() = 0;
+
 private:
 
   /**
index a57aaa6980f41ea0e18da7364e20bb3b71d21486..b954b6965e0ff0c819d37de221b537a546340ddf 100644 (file)
 // EXTERNAL INCLUDES
 #include <Ecore.h>
 #include <Evas.h>
+#ifdef WAYLAND
+#include <Ecore_Wayland.h>
+#else
+#include <Ecore_X.h>
+#endif
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -148,6 +153,8 @@ const char* INDICATOR_SERVICE_NAME("elm_indicator");
 
 // Copied from ecore_evas_extn_engine.h
 
+#define NBUF 2
+
 enum // opcodes
 {
    OP_RESIZE,
@@ -175,7 +182,8 @@ enum // opcodes
    OP_EV_KEY_DOWN,
    OP_EV_HOLD,
    OP_MSG_PARENT,
-   OP_MSG
+   OP_MSG,
+   OP_PIXMAP_REF,
 };
 
 // Copied from elm_conform.c
@@ -285,6 +293,107 @@ namespace Adaptor
 Debug::Filter* gIndicatorLogFilter = Debug::Filter::New(Debug::Concise, false, "LOG_INDICATOR");
 #endif
 
+// Impl to hide EFL implementation.
+
+struct Indicator::Impl
+{
+  enum // operation mode
+  {
+    INDICATOR_HIDE,
+    INDICATOR_STAY_WITH_DURATION
+  };
+
+  /**
+   * Constructor
+   */
+  Impl(Indicator* indicator)
+  : mIndicator(indicator),
+    mEcoreEventHandler(NULL)
+  {
+#if defined(DALI_PROFILE_MOBILE)
+#if defined(WAYLAND)
+    mEcoreEventHandler = ecore_event_handler_add(ECORE_WL_EVENT_INDICATOR_FLICK,  EcoreEventIndicator, this);
+#else
+    mEcoreEventHandler = ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE,  EcoreEventClientMessage, this);
+#endif
+#endif // WAYLAND && DALI_PROFILE_MOBILE
+  }
+
+  /**
+   * Destructor
+   */
+  ~Impl()
+  {
+    if ( mEcoreEventHandler )
+    {
+      ecore_event_handler_del(mEcoreEventHandler);
+    }
+  }
+
+  static void SetIndicatorVisibility( void* data, int operation )
+  {
+    Indicator::Impl* indicatorImpl((Indicator::Impl*)data);
+
+    if ( indicatorImpl == NULL || indicatorImpl->mIndicator == NULL)
+    {
+      return;
+    }
+    if ( operation == INDICATOR_STAY_WITH_DURATION )
+    {
+      // if indicator is not showing, INDICATOR_FLICK_DONE is given
+      if( indicatorImpl->mIndicator->mVisible == Dali::Window::AUTO &&
+          !indicatorImpl->mIndicator->mIsShowing )
+      {
+        indicatorImpl->mIndicator->ShowIndicator( AUTO_INDICATOR_STAY_DURATION );
+      }
+    }
+    else if( operation == INDICATOR_HIDE )
+    {
+      if( indicatorImpl->mIndicator->mVisible == Dali::Window::AUTO &&
+          indicatorImpl->mIndicator->mIsShowing )
+      {
+        indicatorImpl->mIndicator->ShowIndicator( HIDE_NOW );
+      }
+    }
+  }
+#if defined(DALI_PROFILE_MOBILE)
+#if defined(WAYLAND)
+  /**
+   * Called when the Ecore indicator event is received.
+   */
+  static Eina_Bool EcoreEventIndicator( void* data, int type, void* event )
+  {
+    SetIndicatorVisibility( data, INDICATOR_STAY_WITH_DURATION );
+    return ECORE_CALLBACK_PASS_ON;
+  }
+#else
+  /**
+   * Called when the client messages (i.e. quick panel state) are received.
+   */
+  static Eina_Bool EcoreEventClientMessage( void* data, int type, void* event )
+  {
+    Ecore_X_Event_Client_Message* clientMessageEvent((Ecore_X_Event_Client_Message*)event);
+
+    if ( clientMessageEvent != NULL )
+    {
+      if (clientMessageEvent->message_type == ECORE_X_ATOM_E_INDICATOR_FLICK_DONE)
+      {
+        SetIndicatorVisibility( data, INDICATOR_STAY_WITH_DURATION );
+      }
+      else if ( clientMessageEvent->message_type == ECORE_X_ATOM_E_MOVE_QUICKPANEL_STATE )
+      {
+        SetIndicatorVisibility( data, INDICATOR_HIDE );
+      }
+    }
+    return ECORE_CALLBACK_PASS_ON;
+  }
+#endif
+#endif // WAYLAND && DALI_PROFILE_MOBILE
+
+  // Data
+  Indicator*           mIndicator;
+  Ecore_Event_Handler* mEcoreEventHandler;
+};
 
 Indicator::LockFile::LockFile(const std::string filename)
 : mFilename(filename),
@@ -392,6 +501,8 @@ Indicator::Indicator( Adaptor* adaptor, Dali::Window::WindowOrientation orientat
   mIsShowing( true ),
   mIsAnimationPlaying( false ),
   mCurrentSharedFile( 0 ),
+  mSharedBufferType( BUFFER_TYPE_SHM ),
+  mImpl( NULL ),
   mBackgroundVisible( false )
 {
   mIndicatorContentActor = Dali::Actor::New();
@@ -429,10 +540,19 @@ Indicator::Indicator( Adaptor* adaptor, Dali::Window::WindowOrientation orientat
   }
   // hide the indicator by default
   mIndicatorActor.SetVisible( false );
+
+  // create impl to handle ecore event
+  mImpl = new Impl(this);
 }
 
 Indicator::~Indicator()
 {
+  if(mImpl)
+  {
+    delete mImpl;
+    mImpl = NULL;
+  }
+
   if(mEventActor)
   {
     mEventActor.TouchedSignal().Disconnect( this, &Indicator::OnTouched );
@@ -541,9 +661,22 @@ void Indicator::SetVisible( Dali::Window::IndicatorVisibleMode visibleMode, bool
     {
       UpdateImageData( mCurrentSharedFile );
     }
-    if ( visibleMode != Dali::Window::INVISIBLE )
+
+    if ( visibleMode == Dali::Window::INVISIBLE )
+    {
+      if (mServerConnection)
+      {
+        mServerConnection->SendEvent( OP_HIDE, NULL, 0 );
+      }
+    }
+    else
     {
       mIndicatorActor.SetVisible( true );
+
+      if( mServerConnection )
+      {
+         mServerConnection->SendEvent( OP_SHOW, NULL, 0 );
+      }
     }
 
     mVisible = visibleMode;
@@ -566,6 +699,10 @@ void Indicator::SetVisible( Dali::Window::IndicatorVisibleMode visibleMode, bool
         ShowIndicator( HIDE_NOW );
       }
     }
+    else
+    {
+      mIsShowing = false;
+    }
   }
 }
 
@@ -620,6 +757,7 @@ bool Indicator::OnTouched(Dali::Actor indicator, const Dali::TouchEvent& touchEv
         break;
 
         case Dali::PointState::UP:
+        case Dali::PointState::INTERRUPTED:
         {
           IpcDataEvMouseUp ipcUp( touchEvent.time );
           mServerConnection->SendEvent( OP_EV_MOUSE_UP, &ipcUp, sizeof(ipcUp) );
@@ -814,6 +952,11 @@ void Indicator::LoadSharedImage( Ecore_Ipc_Event_Server_Data *epcEvent )
   // epcEvent->ref_to == sys
   // epcEvent->response == buffer num
 
+  if ( mSharedBufferType != BUFFER_TYPE_SHM )
+  {
+    return ;
+  }
+
   int n = epcEvent->response;
 
   if( n >= 0 && n < SHARED_FILE_NUMBER )
@@ -846,19 +989,7 @@ void Indicator::LoadSharedImage( Ecore_Ipc_Event_Server_Data *epcEvent )
       }
 
       CreateNewImage( n );
-
-      if( CheckVisibleState() )
-      {
-        // set default indicator type (enable the quick panel)
-        OnIndicatorTypeChanged( INDICATOR_TYPE_1 );
-      }
-      else
-      {
-        // set default indicator type (disable the quick panel)
-        OnIndicatorTypeChanged( INDICATOR_TYPE_2 );
-      }
-
-      SetVisible(mVisible, true);
+      UpdateVisibility();
     }
   }
 }
@@ -867,38 +998,43 @@ void Indicator::LoadPixmapImage( Ecore_Ipc_Event_Server_Data *epcEvent )
 {
   DALI_LOG_TRACE_METHOD( gIndicatorLogFilter );
 
-  // epcEvent->ref == w
-  // epcEvent->ref_to == h
-  // epcEvent->response == alpha
-  // epcEvent->data = pixmap id
+  // epcEvent->ref == pixmap id
+  // epcEvent->ref_to == type
+  // epcEvent->response == buffer num
 
-  if( ( epcEvent->data ) &&
-      (epcEvent->size >= (int)sizeof(PixmapId)) )
+  if( (epcEvent->ref > 0) && (epcEvent->ref_to > 0) )
   {
+    mSharedBufferType = (BufferType)(epcEvent->ref_to);
+
     ClearSharedFileInfo();
 
-    if( (epcEvent->ref > 0) && (epcEvent->ref_to > 0) )
-    {
-      mImageWidth  = epcEvent->ref;
-      mImageHeight = epcEvent->ref_to;
+    mPixmap = static_cast<PixmapId>(epcEvent->ref);
+    DALI_LOG_INFO( gIndicatorLogFilter, Debug::General, "mPixmap [%x]", mPixmap);
 
-      mPixmap = *(static_cast<PixmapId*>(epcEvent->data));
-      CreateNewPixmapImage();
+    CreateNewPixmapImage();
+    UpdateVisibility();
+  }
+}
 
-      if( CheckVisibleState() )
-      {
-        // set default indicator type (enable the quick panel)
-        OnIndicatorTypeChanged( INDICATOR_TYPE_1 );
-      }
-      else
-      {
-        // set default indicator type (disable the quick panel)
-        OnIndicatorTypeChanged( INDICATOR_TYPE_2 );
-      }
+void Indicator::UpdateVisibility()
+{
+  if( CheckVisibleState() )
+  {
+    // set default indicator type (enable the quick panel)
+    OnIndicatorTypeChanged( INDICATOR_TYPE_1 );
+  }
+  else
+  {
+    // set default indicator type (disable the quick panel)
+    OnIndicatorTypeChanged( INDICATOR_TYPE_2 );
+  }
 
-      SetVisible(mVisible, true);
-    }
+  if( !mIsShowing )
+  {
+    mIndicatorContentActor.SetPosition( 0.0f, -mImageHeight, 0.0f );
   }
+
+  SetVisible(mVisible, true);
 }
 
 void Indicator::UpdateImageData( int bufferNumber )
@@ -1174,7 +1310,7 @@ void Indicator::DataReceived( void* event )
       DALI_LOG_INFO( gIndicatorLogFilter, Debug::General, "Indicator client received: OP_UPDATE\n" );
       if( mIsShowing )
       {
-        mAdaptor->RequestUpdateOnce();
+        //mAdaptor->RequestUpdateOnce();
       }
       break;
     }
@@ -1182,7 +1318,7 @@ void Indicator::DataReceived( void* event )
     {
       DALI_LOG_INFO( gIndicatorLogFilter, Debug::General, "Indicator client received: OP_UPDATE_DONE [%d]\n", epcEvent->response );
       // epcEvent->response == display buffer #
-      UpdateImageData( epcEvent->response );
+      //UpdateImageData( epcEvent->response );
       break;
     }
     case OP_SHM_REF0:
@@ -1203,6 +1339,12 @@ void Indicator::DataReceived( void* event )
       LoadSharedImage( epcEvent );
       break;
     }
+    case OP_PIXMAP_REF:
+    {
+      DALI_LOG_INFO( gIndicatorLogFilter, Debug::General, "Indicator client received: OP_PIXMAP_REF\n" );
+      LoadPixmapImage( epcEvent );
+      break;
+    }
     case OP_RESIZE:
     {
       DALI_LOG_INFO( gIndicatorLogFilter, Debug::General, "Indicator client received: OP_RESIZE\n" );
@@ -1256,7 +1398,6 @@ void Indicator::DataReceived( void* event )
             }
             break;
           }
-
         }
       }
       break;
@@ -1281,7 +1422,8 @@ bool Indicator::CheckVisibleState()
 {
   if( mOrientation == Dali::Window::LANDSCAPE
     || mOrientation == Dali::Window::LANDSCAPE_INVERSE
-    || (mVisible != Dali::Window::VISIBLE) )
+    || (mVisible == Dali::Window::INVISIBLE)
+    || (mVisible == Dali::Window::AUTO && !mIsShowing) )
   {
     return false;
   }
@@ -1332,6 +1474,8 @@ void Indicator::ShowIndicator(float duration)
   }
   else
   {
+    mIndicatorAnimation.Clear();
+
     if( EqualsZero(duration) )
     {
       mIndicatorAnimation.AnimateTo( Property( mIndicatorContentActor, Dali::Actor::Property::POSITION ), Vector3(0, -mImageHeight, 0), Dali::AlphaFunction::EASE_OUT );
@@ -1396,17 +1540,16 @@ void Indicator::OnAnimationFinished(Dali::Animation& animation)
 {
   mIsAnimationPlaying = false;
   // once animation is finished and indicator is hidden, take it off stage
-  if( !mIsShowing )
+  if( mObserver != NULL )
   {
-    if( mObserver != NULL )
-    {
-      mObserver->IndicatorVisibilityChanged( mIsShowing ); // is showing?
-    }
+    mObserver->IndicatorVisibilityChanged( mIsShowing ); // is showing?
   }
 }
 
 void Indicator::OnPan( Dali::Actor actor, const Dali::PanGesture& gesture )
 {
+  return ;
+
   if( mServerConnection )
   {
     switch( gesture.state )
@@ -1470,7 +1613,11 @@ void Indicator::OnStageTouched(const Dali::TouchEvent& touchEvent)
     {
       case Dali::PointState::DOWN:
       {
-        ShowIndicator( HIDE_NOW );
+        // if touch point is inside the indicator, indicator is not hidden
+        if( mImageHeight < int(touchPoint.screen.y) )
+        {
+          ShowIndicator( HIDE_NOW );
+        }
         break;
       }
 
index 801c12e1d8f61477369bcc1ff5da1a532dff3af7..53e93d1195f66af72fc51dde34f39ab7e63c64e2 100644 (file)
@@ -62,6 +62,16 @@ public:
     CONNECTED
   };
 
+  /**
+   * copied from ecore_evas_extn_engine.h
+   */
+  enum BufferType
+  {
+    BUFFER_TYPE_SHM = 0,        ///< shared memory-based buffer backend
+    BUFFER_TYPE_DRI2_PIXMAP,    ///< dri2 pixmap-based buffer backend
+    BUFFER_TYPE_EVASGL_PIXMAP,  ///< pixmap backend for Evas GL only (DEPRECATED)
+    BUFFER_TYPE_GL_PIXMAP,      ///< double buffered GL pixmap backend
+  };
 
 protected:
   /**
@@ -279,6 +289,11 @@ private:
    */
   void LoadPixmapImage( Ecore_Ipc_Event_Server_Data *epcEvent );
 
+  /**
+   * Update the visibility and position of the actors
+   */
+  void UpdateVisibility();
+
   /**
    * Inform dali that the indicator data has been updated.
    * @param[in] bufferNumber The shared file number
@@ -424,6 +439,11 @@ private:
   int                              mCurrentSharedFile;   ///< Current shared file number
   SharedFileInfo                   mSharedFileInfo[SHARED_FILE_NUMBER];    ///< Table to store shared file info
 
+  BufferType                       mSharedBufferType;    ///< Shared buffer type which is used to render indicator
+
+  struct Impl; ///< Contains Ecore specific information
+  Impl* mImpl; ///< Created on construction and destroyed on destruction.
+
   bool                             mBackgroundVisible;   ///< Indicate whether background is visible
 };
 
index cea687c1510e4fe07c45c6786b2d21d99220f91d..1744b2dbe19f07281b730ef2e933748f7d11f1e1 100644 (file)
 #include <dali/public-api/object/any.h>
 #include <dali/public-api/object/type-registry.h>
 #include <dali/integration-api/debug.h>
+#include <unistd.h>
+
+#ifdef DALI_ELDBUS_AVAILABLE
+#include <Eldbus.h>
+#endif // DALI_ELDBUS_AVAILABLE
 
 // INTERNAL INCLUDES
 #include <singleton-service-impl.h>
 
-namespace //unnamed namespace
-{
-const char* const CBHM_WINDOW = "CBHM_XWIN";
-const char* const CBHM_MSG = "CBHM_MSG";
-const char* const CBHM_ITEM = "CBHM_ITEM";
-const char* const CBHM_cCOUNT = "CBHM_cCOUNT";
-const char* const CBHM_ERROR = "CBHM_ERROR";
-const char* const SET_ITEM = "SET_ITEM";
-const char* const SHOW = "show0";
-const char* const HIDE = "cbhm_hide";
-}
+#define CBHM_DBUS_OBJPATH "/org/tizen/cbhm/dbus"
+#ifndef CBHM_DBUS_INTERFACE
+#define CBHM_DBUS_INTERFACE "org.tizen.cbhm.dbus"
+#endif /* CBHM_DBUS_INTERFACE */
+
+#define CLIPBOARD_STR  "CLIPBOARD_STR"
+#define CLIPBOARD_BUFFER_SIZE 512
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 // Clipboard
@@ -55,7 +56,168 @@ namespace Adaptor
 
 struct Clipboard::Impl
 {
-  // Put implementation here.
+  Impl()
+  {
+    Eldbus_Object *eldbus_obj;
+    cbhm_conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION);
+    eldbus_obj = eldbus_object_get(cbhm_conn, CBHM_DBUS_INTERFACE, CBHM_DBUS_OBJPATH);
+    eldbus_proxy = eldbus_proxy_get(eldbus_obj, CBHM_DBUS_INTERFACE);
+    eldbus_name_owner_changed_callback_add(cbhm_conn, CBHM_DBUS_INTERFACE, NULL, cbhm_conn, EINA_TRUE);
+    eldbus_proxy_signal_handler_add(eldbus_proxy, "ItemClicked", _on_item_clicked, this);
+    mVisible = false;
+    mIsFirstTimeHidden = true;
+  }
+
+  ~Impl()
+  {
+    if (cbhm_conn)
+      eldbus_connection_unref(cbhm_conn);
+  }
+
+  Eldbus_Proxy* cbhm_proxy_get()
+  {
+    return eldbus_proxy;
+  }
+
+  Eldbus_Connection* cbhm_connection_get()
+  {
+    return cbhm_conn;
+  }
+
+  void SetItem( const std::string &itemData )
+  {
+    const char *data = itemData.c_str();
+    const char *types[10] = {0, };
+    int i = -1;
+
+    if (data == NULL)
+    {
+      return;
+    }
+    strcpy(mSendBuf, data);
+
+    // ELM_SEL_TYPE_CLIPBOARD - To distinguish clipboard selection in cbhm
+    types[++i] = "CLIPBOARD_BEGIN";
+
+    types[++i] = "application/x-elementary-markup";
+    types[++i] = "text/plain";
+    types[++i] = "text/plain;charset=utf-8";
+
+    // ELM_SEL_TYPE_CLIPBOARD - To distinguish clipboard selection in cbhm
+    types[++i] = "CLIPBOARD_END";
+    ecore_wl_dnd_selection_set(ecore_wl_input_get(), types);
+  }
+
+  void RequestItem()
+  {
+    const char *types[10] = {0, };
+    int i = -1;
+
+    types[++i] = "application/x-elementary-markup";
+    types[++i] = "text/plain";
+    types[++i] = "text/plain;charset=utf-8";
+    ecore_wl_dnd_selection_get(ecore_wl_input_get(), *types);
+  }
+
+  char *ExcuteSend( void *event )
+  {
+    Ecore_Wl_Event_Data_Source_Send *ev = (Ecore_Wl_Event_Data_Source_Send *)event;
+    int len_buf = strlen(mSendBuf);
+    int len_remained = len_buf;
+    int len_written = 0, ret;
+    char *buf = mSendBuf;
+
+    while (len_written < len_buf)
+    {
+       ret = write(ev->fd, buf, len_remained);
+       if (ret == -1) break;
+       buf += ret;
+       len_written += ret;
+       len_remained -= ret;
+    }
+    close(ev->fd);
+    return (char *)mSendBuf;
+  }
+
+  char *ExcuteReceive( void *event )
+  {
+    Ecore_Wl_Event_Selection_Data_Ready *ev = (Ecore_Wl_Event_Selection_Data_Ready *)event;
+
+    strncpy(mReceiveBuf, (char *)ev->data, ev->len);
+    mReceiveBuf[ev->len] = '\0';
+    return (char *)mReceiveBuf;
+  }
+
+  int GetCount()
+  {
+    Eldbus_Message *reply, *req;
+    const char *errname = NULL, *errmsg = NULL;
+    int count = -1;
+
+    if (!(req = eldbus_proxy_method_call_new(eldbus_proxy, "CbhmGetCount")))
+    {
+      DALI_LOG_ERROR("Failed to create method call on org.freedesktop.DBus.Properties.Get");
+      return -1;
+    }
+
+    eldbus_message_ref(req);
+    reply = eldbus_proxy_send_and_block(eldbus_proxy, req, 100);
+    if (!reply || eldbus_message_error_get(reply, &errname, &errmsg))
+    {
+      DALI_LOG_ERROR("Unable to call method org.freedesktop.DBus.Properties.Get: %s %s",
+      errname, errmsg);
+      eldbus_message_unref(req);
+      return -1;
+    }
+
+    if (!eldbus_message_arguments_get(reply, "i", &count))
+    {
+      DALI_LOG_ERROR("Cannot get arguments from eldbus");
+      eldbus_message_unref(req);
+      return -1;
+    }
+
+    eldbus_message_unref(req);
+    DALI_LOG_ERROR("cbhm item count(%d)", count);
+    return count;
+  }
+
+  void ShowClipboard()
+  {
+    eldbus_proxy_call(cbhm_proxy_get(), "CbhmShow", NULL, NULL, -1, "s", "0");
+    mIsFirstTimeHidden = true;
+    mVisible = true;
+  }
+
+  void HideClipboard( bool skipFirstHide )
+  {
+    if ( skipFirstHide && mIsFirstTimeHidden )
+    {
+      mIsFirstTimeHidden = false;
+      return;
+    }
+    eldbus_proxy_call(cbhm_proxy_get(), "CbhmHide", NULL, NULL, -1, "");
+    mIsFirstTimeHidden = false;
+    mVisible = false;
+  }
+
+  bool IsVisible() const
+  {
+    return mVisible;
+  }
+
+  static void _on_item_clicked(void *data, const Eldbus_Message *msg EINA_UNUSED)
+  {
+    static_cast<Clipboard::Impl*>(data)->RequestItem();
+  }
+
+  Eldbus_Proxy *eldbus_proxy;
+  Eldbus_Connection *cbhm_conn;
+
+  char mSendBuf[CLIPBOARD_BUFFER_SIZE];
+  char mReceiveBuf[CLIPBOARD_BUFFER_SIZE];
+  bool mVisible;
+  bool mIsFirstTimeHidden;
 };
 
 Clipboard::Clipboard(Impl* impl)
@@ -94,24 +256,16 @@ Dali::Clipboard Clipboard::Get()
 
 bool Clipboard::SetItem(const std::string &itemData )
 {
+  mImpl->SetItem( itemData );
   return true;
 }
 
 /*
- * Get string at given index of clipboard
+ * Request clipboard service to give an item
  */
-std::string Clipboard::GetItem( unsigned int index )  // change string to a Dali::Text object.
+void Clipboard::RequestItem()
 {
-  if ( index >= NumberOfItems() )
-  {
-    return "";
-  }
-
-  std::string emptyString( "" );
-  char sendBuf[20];
-
-  snprintf( sendBuf, 20,  "%s%d", CBHM_ITEM, index );
-  return emptyString;
+  mImpl->RequestItem();
 }
 
 /*
@@ -119,24 +273,28 @@ std::string Clipboard::GetItem( unsigned int index )  // change string to a Dali
  */
 unsigned int Clipboard::NumberOfItems()
 {
-  int count = -1;
-
-  return count;
+  return mImpl->GetCount();
 }
 
-/**
- * Show clipboard window
- * Function to send message to show the Clipboard (cbhm) as no direct API available
- * Reference elementary/src/modules/ctxpopup_copypasteUI/cbhm_helper.c
- */
 void Clipboard::ShowClipboard()
 {
+  mImpl->ShowClipboard();
 }
 
-void Clipboard::HideClipboard()
+void Clipboard::HideClipboard(bool skipFirstHide)
 {
+  mImpl->HideClipboard(skipFirstHide);
 }
 
+bool Clipboard::IsVisible() const
+{
+  return mImpl->IsVisible();
+}
+
+char* Clipboard::ExcuteBuffered( bool type, void *event )
+{
+  return (type ?  mImpl->ExcuteSend( event ) : mImpl->ExcuteReceive( event ));
+}
 
 } // namespace Adaptor
 
index 49d293c17afadfa011abc7a323960ab14275752f..eb262c576f71d0eb41f6f6a5c2e0ad37352a18a5 100644 (file)
@@ -23,7 +23,7 @@
 #include <dali/integration-api/debug.h>
 
 // INTERNAL HEADERS
-#include <pixmap-render-surface.h>
+#include <native-render-surface.h>
 
 namespace Dali
 {
@@ -42,19 +42,20 @@ DisplayConnection* DisplayConnection::New()
 }
 
 DisplayConnection::DisplayConnection()
-: mDisplay(NULL)
 {
-  mDisplay = ecore_wl_display_get();
 }
 
 DisplayConnection::~DisplayConnection()
 {
-  //FIXME
+  if( mSurfaceType == RenderSurface::NATIVE_RENDER_SURFACE )
+  {
+    ReleaseNativeDisplay();
+  }
 }
 
 Any DisplayConnection::GetDisplay()
 {
-  return Any(mDisplay);
+  return Any( mDisplay );
 }
 
 void DisplayConnection::ConsumeEvents()
@@ -65,7 +66,7 @@ bool DisplayConnection::InitializeEgl(EglInterface& egl)
 {
   EglImplementation& eglImpl = static_cast<EglImplementation&>(egl);
 
-  if (!eglImpl.InitializeGles(reinterpret_cast<EGLNativeDisplayType>(mDisplay)))
+  if( !eglImpl.InitializeGles( mDisplay ) )
   {
     DALI_LOG_ERROR("Failed to initialize GLES.\n");
     return false;
@@ -74,6 +75,20 @@ bool DisplayConnection::InitializeEgl(EglInterface& egl)
   return true;
 }
 
+void DisplayConnection::SetSurfaceType( RenderSurface::Type type )
+{
+  mSurfaceType = type;
+
+  if( mSurfaceType == RenderSurface::NATIVE_RENDER_SURFACE )
+  {
+    mDisplay = GetNativeDisplay();
+  }
+  else
+  {
+    mDisplay = reinterpret_cast< EGLNativeDisplayType >( ecore_wl_display_get() );
+  }
+}
+
 void DisplayConnection::GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical)
 {
   // calculate DPI
index b9134d19b72593129ba57f83c603c41ecca287f1..fc647ccb1fe89a5441f0edcaf07098b8f1aecbb0 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __DALI_INTERNAL_ECORE_X_DIPLAY_CONNECTION_H__
-#define __DALI_INTERNAL_ECORE_X_DIPLAY_CONNECTION_H__
+#ifndef __DALI_INTERNAL_ECORE_WAYLAND_DIPLAY_CONNECTION_H__
+#define __DALI_INTERNAL_ECORE_WAYLAND_DIPLAY_CONNECTION_H__
 
 /*
  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
@@ -81,6 +81,11 @@ public:
    */
   bool InitializeEgl(EglInterface& egl);
 
+  /**
+   * @brief Sets surface type
+   */
+  void SetSurfaceType( RenderSurface::Type type );
+
 public:
 
   /**
@@ -90,6 +95,16 @@ public:
 
 protected:
 
+  /**
+   * @brief Gets display connection for native surface
+   */
+  EGLNativeDisplayType GetNativeDisplay();
+
+  /**
+   * @brief Release display connection for native surface
+   */
+  void ReleaseNativeDisplay();
+
   // Undefined
   DisplayConnection(const DisplayConnection&);
 
@@ -97,7 +112,8 @@ protected:
   DisplayConnection& operator=(const DisplayConnection& rhs);
 
 private:
-  WlDisplay*   mDisplay;        ///< Wayland-display for rendering
+  EGLNativeDisplayType mDisplay;        ///< Wayland-display for rendering
+  RenderSurface::Type mSurfaceType;
 };
 
 } // namespace Adaptor
index 1d38c49b1dc439f8fc8ae13c4ebeb80f5e47063c..6d29d8016fbc885217af5f8ff35bd61539d26860 100644 (file)
@@ -193,6 +193,13 @@ struct EventHandler::Impl
       mEcoreEventHandler.push_back( ecore_event_handler_add( ECORE_EVENT_KEY_DOWN,           EcoreEventKeyDown,         handler ) );
       mEcoreEventHandler.push_back( ecore_event_handler_add( ECORE_EVENT_KEY_UP,             EcoreEventKeyUp,           handler ) );
 
+      // Register Selection event - clipboard selection
+      mEcoreEventHandler.push_back( ecore_event_handler_add( ECORE_WL_EVENT_DATA_SOURCE_SEND, EcoreEventDataSend, handler ) );
+      mEcoreEventHandler.push_back( ecore_event_handler_add( ECORE_WL_EVENT_SELECTION_DATA_READY, EcoreEventDataReceive, handler ) );
+
+      // Register Detent event
+      mEcoreEventHandler.push_back( ecore_event_handler_add( ECORE_EVENT_DETENT_ROTATE, EcoreEventDetent, handler) );
+
 #ifndef DALI_PROFILE_UBUNTU
       // Register Vconf notify - font name and size
       vconf_notify_key_changed( DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, VconfNotifyFontNameChanged, handler );
@@ -500,7 +507,8 @@ struct EventHandler::Impl
           }
         }
       }
-      // No need to connect callbacks as KeyboardStatusChanged will be called.
+      Dali::Clipboard clipboard = Clipboard::Get();
+      clipboard.HideClipboard();
     }
 
     return ECORE_CALLBACK_PASS_ON;
@@ -532,9 +540,13 @@ struct EventHandler::Impl
         }
       }
 
-      // Clipboard don't support that whether clipboard is shown or not. Hide clipboard.
+      // Hiding clipboard event will be ignored once because window focus out event is always received on showing clipboard
       Dali::Clipboard clipboard = Clipboard::Get();
-      clipboard.HideClipboard();
+      if ( clipboard )
+      {
+        Clipboard& clipBoardImpl( GetImplementation( clipboard ) );
+        clipBoardImpl.HideClipboard(true);
+      }
     }
 
     return ECORE_CALLBACK_PASS_ON;
@@ -649,6 +661,65 @@ struct EventHandler::Impl
     return ECORE_CALLBACK_PASS_ON;
   }
 
+  /**
+  * Called when the source window notifies us the content in clipboard is selected.
+  */
+  static Eina_Bool EcoreEventDataSend( void* data, int type, void* event )
+  {
+    DALI_LOG_INFO(gSelectionEventLogFilter, Debug::Concise, "EcoreEventDataSend\n" );
+
+    Dali::Clipboard clipboard = Clipboard::Get();
+    if ( clipboard )
+    {
+      Clipboard& clipBoardImpl( GetImplementation( clipboard ) );
+      clipBoardImpl.ExcuteBuffered( true, event );
+    }
+    return ECORE_CALLBACK_PASS_ON;
+  }
+
+   /**
+    * Called when the source window sends us about the selected content.
+    * For example, when item is selected in the clipboard.
+    */
+   static Eina_Bool EcoreEventDataReceive( void* data, int type, void* event )
+   {
+     DALI_LOG_INFO(gSelectionEventLogFilter, Debug::Concise, "EcoreEventDataReceive\n" );
+
+     EventHandler* handler( (EventHandler*)data );
+      Dali::Clipboard clipboard = Clipboard::Get();
+      char *selectionData = NULL;
+      if ( clipboard )
+      {
+        Clipboard& clipBoardImpl( GetImplementation( clipboard ) );
+        selectionData = clipBoardImpl.ExcuteBuffered( false, event );
+      }
+      if ( selectionData && handler->mClipboardEventNotifier )
+      {
+        ClipboardEventNotifier& clipboardEventNotifier( ClipboardEventNotifier::GetImplementation( handler->mClipboardEventNotifier ) );
+        std::string content( selectionData, strlen(selectionData) );
+
+        clipboardEventNotifier.SetContent( content );
+        clipboardEventNotifier.EmitContentSelectedSignal();
+      }
+     return ECORE_CALLBACK_PASS_ON;
+   }
+
+  /*
+  * Called when detent event is recevied
+  */
+  static Eina_Bool EcoreEventDetent( void* data, int type, void* event )
+  {
+    DALI_LOG_INFO(gSelectionEventLogFilter, Debug::Concise, "EcoreEventDetent\n" );
+    EventHandler* handler( (EventHandler*)data );
+    Ecore_Event_Detent_Rotate *e((Ecore_Event_Detent_Rotate *)event);
+    int direction = (e->direction == ECORE_DETENT_DIRECTION_CLOCKWISE) ? 1 : -1;
+    int timeStamp = e->timestamp;
+
+    WheelEvent wheelEvent( WheelEvent::CUSTOM_WHEEL, 0, 0, Vector2(0.0f, 0.0f), direction, timeStamp );
+    handler->SendWheelEvent( wheelEvent );
+    return ECORE_CALLBACK_PASS_ON;
+  }
+
   /////////////////////////////////////////////////////////////////////////////////////////////////
   // Font Callbacks
   /////////////////////////////////////////////////////////////////////////////////////////////////
index 825b44471b6f05ff749eb210103090937628f461..e88e30aed6aaa76e187d37e897e1a973d32727d5 100644 (file)
@@ -516,6 +516,14 @@ const std::string& ImfManager::GetSurroundingText() const
   return mSurroundingText;
 }
 
+void ImfManager::NotifyTextInputMultiLine( bool multiLine )
+{
+  Ecore_IMF_Input_Hints currentHint = ecore_imf_context_input_hint_get(mIMFContext);
+  ecore_imf_context_input_hint_set(mIMFContext, (Ecore_IMF_Input_Hints)(multiLine ?
+    (currentHint | ECORE_IMF_INPUT_HINT_MULTILINE) :
+    (currentHint & ~ECORE_IMF_INPUT_HINT_MULTILINE)));
+}
+
 } // Adaptor
 
 } // Internal
index 1fd8e161305cdf6df51a0dc65d0d77ca92737f18..391c56d505d8fb8c879f85926519d12086583a2f 100644 (file)
@@ -151,6 +151,11 @@ public:
    */
   const std::string& GetSurroundingText() const;
 
+  /**
+  * @copydoc Dali::ImfManager::NotifyTextInputMultiLine()
+  */
+  void NotifyTextInputMultiLine( bool multiLine );
+
 public:  // Signals
 
   /**
index dbb495a2facea5eda20691263adf02b600adf519..8ef5cc0c10b93f67514ea6808f95750804c467e3 100644 (file)
@@ -126,6 +126,11 @@ unsigned int EcoreWlRenderSurface::GetSurfaceId( Any surface ) const
   return surfaceId;
 }
 
+RenderSurface::Type EcoreWlRenderSurface::GetSurfaceType()
+{
+  return RenderSurface::ECORE_RENDER_SURFACE;
+}
+
 } // namespace ECore
 
 } // namespace Dali
index 41c7f36bf1133a1b74bc4bda5fb4d815253e86a4..4738eecf21c3bc81374814ac2e297d0313b8db6d 100644 (file)
@@ -331,10 +331,46 @@ void Window::DoRotateIndicator( Dali::Window::WindowOrientation orientation )
 
 void Window::SetIndicatorProperties( bool isShow, Dali::Window::WindowOrientation lastOrientation )
 {
+  ECore::WindowRenderSurface* wlSurface( dynamic_cast< ECore::WindowRenderSurface * >( mSurface ) );
+
+  if( wlSurface )
+  {
+    Ecore_Wl_Window* wlWindow = wlSurface->GetWlWindow();
+    if ( isShow )
+    {
+      ecore_wl_window_indicator_state_set(wlWindow, ECORE_WL_INDICATOR_STATE_ON);
+    }
+    else
+    {
+      ecore_wl_window_indicator_state_set(wlWindow, ECORE_WL_INDICATOR_STATE_OFF);
+    }
+  }
 }
 
 void Window::IndicatorTypeChanged(Indicator::Type type)
 {
+#if defined(DALI_PROFILE_MOBILE)
+  ECore::WindowRenderSurface* wlSurface( dynamic_cast< ECore::WindowRenderSurface * >( mSurface ) );
+
+  if( wlSurface )
+  {
+    Ecore_Wl_Window* wlWindow = wlSurface->GetWlWindow();
+    switch(type)
+    {
+      case Indicator::INDICATOR_TYPE_1:
+        ecore_wl_indicator_visible_type_set(wlWindow, ECORE_WL_INDICATOR_VISIBLE_TYPE_SHOWN);
+        break;
+
+      case Indicator::INDICATOR_TYPE_2:
+        ecore_wl_indicator_visible_type_set(wlWindow, ECORE_WL_INDICATOR_VISIBLE_TYPE_HIDDEN);
+        break;
+
+      case Indicator::INDICATOR_TYPE_UNKNOWN:
+      default:
+        break;
+    }
+  }
+#endif //MOBILE
 }
 
 void Window::IndicatorClosed( IndicatorInterface* indicator )
index 8eabd4a41b6ef600907b90dc3e41b96e9009efda..7de4d655d93cbc2f3009bd89a48b173ef402996c 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTEGRATION_ADAPTOR_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -197,6 +197,16 @@ public:
    */
   bool AddIdle( CallbackBase* callback );
 
+  /**
+   * @brief Removes a previously added @p callback.
+   * @note Function must be called from the main event thread only.
+   *
+   * Does nothing if the @p callback doesn't exist.
+   *
+   * @param[in] callback The callback to be removed.
+   */
+  void RemoveIdle( CallbackBase* callback );
+
   /**
    * @brief Replaces the rendering surface
    *
index 45fcc772d275e9207c92fb37c884725e7f88a7d1..16014d244881fb5cc0c2dc47687f82d7cc740ee0 100644 (file)
@@ -4,16 +4,17 @@ adaptor_integration_api_header_files = \
   $(adaptor_integration_api_dir)/thread-synchronization-interface.h \
   $(adaptor_integration_api_dir)/trigger-event-interface.h \
   $(adaptor_integration_api_dir)/trigger-event-factory-interface.h \
-  $(adaptor_integration_api_dir)/trigger-event-factory.h \
-  $(adaptor_integration_api_dir)/pixmap-render-surface-factory.h
+  $(adaptor_integration_api_dir)/trigger-event-factory.h
 
 adaptor_integration_wayland_api_header_files = \
   $(adaptor_integration_api_dir)/wayland/wl-types.h \
   $(adaptor_integration_api_dir)/wayland/ecore-wl-render-surface.h \
-  $(adaptor_integration_api_dir)/wayland/pixmap-render-surface.h
+  $(adaptor_integration_api_dir)/wayland/native-render-surface.h \
+  $(adaptor_integration_api_dir)/native-render-surface-factory.h
 
 adaptor_integration_x11_api_header_files = \
   $(adaptor_integration_api_dir)/x11/ecore-x-types.h \
   $(adaptor_integration_api_dir)/x11/ecore-x-render-surface.h \
   $(adaptor_integration_api_dir)/x11/pixmap-render-surface.h \
-  $(adaptor_integration_api_dir)/x11/imf-manager-impl.h
+  $(adaptor_integration_api_dir)/x11/imf-manager-impl.h \
+  $(adaptor_integration_api_dir)/pixmap-render-surface-factory.h
diff --git a/adaptors/integration-api/native-render-surface-factory.h b/adaptors/integration-api/native-render-surface-factory.h
new file mode 100644 (file)
index 0000000..fdc0469
--- /dev/null
@@ -0,0 +1,47 @@
+#ifndef __DALI_INTEGRATION_NATIVE_RENDER_SURFACE_FACTORY_H__
+#define __DALI_INTEGRATION_NATIVE_RENDER_SURFACE_FACTORY_H__
+
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <string>
+#include <dali/public-api/object/any.h>
+#include <dali/public-api/common/dali-common.h>
+
+// INTERNAL INCLUDES
+
+namespace Dali
+{
+
+class NativeRenderSurface;
+
+/**
+ * Factory function for native surface
+ * A native surface is created.
+ *
+ * @param [in] positionSize the position and size of the surface to create
+ * @param [in] name Name of surface passed in
+ * @param [in] isTransparent Whether the surface has an alpha channel
+ */
+NativeRenderSurface* CreateNativeSurface( PositionSize positionSize,
+                                          const std::string& name,
+                                          bool isTransparent );
+
+} // namespace Dali
+
+#endif // __DALI_INTEGRATION_NATIVE_RENDER_SURFACE_FACTORY_H__
index 947f812e6288df2b6c7c976f36932e0052469d60..ebf5c0db93292b297a79906cb61d24644eed50ae 100644 (file)
 #include <dali/public-api/signals/callback.h>
 
 // INTERNAL INCLUDES
+#ifdef DALI_ADAPTOR_COMPILATION
 #include <trigger-event-interface.h>
+#else
+#include <dali/integration-api/adaptors/trigger-event-interface.h>
+#endif
 
 namespace Dali
 {
index 1633a0de80caa40c939ea8f843f29f40e1001621..a90890a7996f4c6cbc2df7a533e3f5b4a60e20d1 100644 (file)
  */
 
 // INTERNAL INCLUDES
-#include <trigger-event-factory-interface.h>
 #include <dali/public-api/common/dali-common.h>
+#ifdef DALI_ADAPTOR_COMPILATION
+#include <trigger-event-factory-interface.h>
+#else
+#include <dali/integration-api/adaptors/trigger-event-factory-interface.h>
+#endif
 
 namespace Dali
 {
index 4a30da7ab80e2ea58b22d99ce095d893b1f0c078..aa747c4177667b66caddb610d7a5fdd47cb13aeb 100644 (file)
@@ -146,6 +146,11 @@ public: // from Dali::RenderSurface
    */
   virtual void ReleaseLock() = 0;
 
+  /**
+   * @copydoc Dali::RenderSurface::GetSurfaceType()
+   */
+  virtual RenderSurface::Type GetSurfaceType();
+
 private:
 
   /**
diff --git a/adaptors/integration-api/wayland/native-render-surface.h b/adaptors/integration-api/wayland/native-render-surface.h
new file mode 100644 (file)
index 0000000..44caaa2
--- /dev/null
@@ -0,0 +1,176 @@
+#ifndef __DALI_NATIVE_RENDER_SURFACE_H__
+#define __DALI_NATIVE_RENDER_SURFACE_H__
+
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <tbm_surface.h>
+#include <dali/public-api/common/dali-common.h>
+
+// INTERNAL INCLUDES
+#ifdef DALI_ADAPTOR_COMPILATION
+#include <render-surface.h>
+#include <egl-interface.h>
+#else
+#include <dali/devel-api/adaptor-framework/render-surface.h>
+#include <dali/integration-api/adaptors/egl-interface.h>
+#endif
+
+namespace Dali
+{
+
+class TriggerEventInterface;
+
+/**
+ * Ecore X11 implementation of render surface.
+ */
+class DALI_IMPORT_API NativeRenderSurface : public Dali::RenderSurface
+{
+public:
+
+  /**
+    * Uses an Wayland surface to render to.
+    * @param [in] positionSize the position and size of the surface
+    * @param [in] name optional name of surface passed in
+    * @param [in] isTransparent if it is true, surface has 32 bit color depth, otherwise, 24 bit
+    */
+  NativeRenderSurface( Dali::PositionSize positionSize,
+                             const std::string& name,
+                             bool isTransparent = false );
+
+  /**
+   * @copydoc Dali::RenderSurface::~RenderSurface
+   */
+  virtual ~NativeRenderSurface();
+
+public: // API
+
+  /**
+   * @brief Sets the render notification trigger to call when render thread is completed a frame
+   *
+   * @param renderNotification to use
+   */
+  void SetRenderNotification( TriggerEventInterface* renderNotification );
+
+  /**
+   * @brief Gets the tbm surface for offscreen rendering
+   */
+  virtual tbm_surface_h GetDrawable();
+
+  /**
+   * @brief Get the surface
+   *
+   * @return tbm surface
+   */
+  virtual Any GetSurface();
+
+  /**
+   * @brief Release the surface
+   */
+  virtual void ReleaseSurface();
+
+public: // from Dali::RenderSurface
+
+  /**
+   * @copydoc Dali::RenderSurface::GetPositionSize()
+   */
+  virtual PositionSize GetPositionSize() const;
+
+  /**
+   * @copydoc Dali::RenderSurface::InitializeEgl()
+   */
+  virtual void InitializeEgl( EglInterface& egl );
+
+  /**
+   * @copydoc Dali::RenderSurface::CreateEglSurface()
+   */
+  virtual void CreateEglSurface( EglInterface& egl );
+
+  /**
+   * @copydoc Dali::RenderSurface::DestroyEglSurface()
+   */
+  virtual void DestroyEglSurface( EglInterface& egl );
+
+  /**
+   * @copydoc Dali::RenderSurface::ReplaceEGLSurface()
+   */
+  virtual bool ReplaceEGLSurface( EglInterface& egl );
+
+  /**
+   * @copydoc Dali::RenderSurface::MoveResize()
+   */
+  virtual void MoveResize( Dali::PositionSize positionSize);
+
+  /**
+   * @copydoc Dali::RenderSurface::SetViewMode()
+   */
+  void SetViewMode( ViewMode viewMode );
+
+  /**
+   * @copydoc Dali::RenderSurface::StartRender()
+   */
+  virtual void StartRender();
+
+  /**
+   * @copydoc Dali::RenderSurface::PreRender()
+   */
+  virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction );
+
+  /**
+   * @copydoc Dali::RenderSurface::PostRender()
+   */
+  virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface );
+
+  /**
+   * @copydoc Dali::RenderSurface::StopRender()
+   */
+  virtual void StopRender();
+
+  /**
+   * @copydoc Dali::RenderSurface::SetThreadSynchronization
+   */
+  virtual void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization );
+
+  /**
+   * @copydoc Dali::RenderSurface::GetSurfaceType()
+   */
+  virtual RenderSurface::Type GetSurfaceType();
+
+private:
+
+  /**
+   * Release any locks.
+   */
+  void ReleaseLock();
+
+  /**
+   * Create tbm surface
+   */
+  virtual void CreateNativeRenderable();
+
+private: // Data
+
+  struct Impl;
+
+  Impl* mImpl;
+
+};
+
+} // namespace Dali
+
+#endif // __DALI_NATIVE_RENDER_SURFACE_H__
index 1eaa8232e4c7a70a9f7b95f9b4ec4efbae62e6f9..3f9b97cc1a7b26422e3193659ed1a122746eb59a 100644 (file)
@@ -154,6 +154,11 @@ public: // from Dali::RenderSurface
    */
   virtual void ReleaseLock() = 0;
 
+  /**
+   * @copydoc Dali::RenderSurface::GetSurfaceType()
+   */
+  virtual RenderSurface::Type GetSurfaceType();
+
 private:
 
   /**
index 1791792bfe9ae6b65611f2f485fa5a0bbad3f337..ea7fe87c08c971d0befcba4fecf3d383311e0662 100644 (file)
@@ -154,6 +154,11 @@ public:
    */
   const std::string& GetSurroundingText() const;
 
+  /**
+  * @copydoc Dali::ImfManager::NotifyTextInputMultiLine()
+  */
+  void NotifyTextInputMultiLine( bool multiLine );
+
 public:  // Signals
 
   /**
index 471462fe9a24573956c1e04096eef2846ccc1c79..f31a0c7fc41eee010b5059bbaa7aac07f69bb4da 100644 (file)
@@ -112,6 +112,8 @@ public: // from Dali::RenderSurface
    */
   virtual void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization );
 
+  virtual RenderSurface::Type GetSurfaceType();
+
 private:
 
   /**
index cc7dc7771d4fe4798cf97e2ab74b137e72e9b23f..3a8f3aee7d4861f868a054575642cb2dcd6f49f4 100644 (file)
@@ -158,6 +158,12 @@ std::string Framework::GetBundleId() const
   return "";
 }
 
+std::string Framework::GetResourcePath()
+{
+  // TIZEN_PLATFORM_CONFIG_SUPPORTED not defined for libuv so path not available.
+  return "";
+}
+
 void Framework::SetBundleId(const std::string& id)
 {
 }
index abe484d3455e9aa4c7ce36df420c8c6f5cac46c8..1a294b634134d14303f0134c6b117519ce9a890a 100644 (file)
@@ -1,6 +1,11 @@
 # mobile profile internal files
 adaptor_common_internal_mobile_profile_src_files = \
   $(adaptor_mobile_dir)/accessibility-adaptor-impl-mobile.cpp \
-  $(adaptor_mobile_dir)/pixmap-render-surface-factory.cpp \
   $(adaptor_mobile_dir)/mobile-system-settings.cpp \
   $(adaptor_mobile_dir)/mobile-color-controller-impl.cpp
+
+adaptor_common_internal_wayland_mobile_profile_src_files = \
+  $(adaptor_mobile_dir)/native-render-surface-factory.cpp
+
+adaptor_common_internal_x_mobile_profile_src_files = \
+  $(adaptor_mobile_dir)/pixmap-render-surface-factory.cpp
diff --git a/adaptors/mobile/native-render-surface-factory.cpp b/adaptors/mobile/native-render-surface-factory.cpp
new file mode 100644 (file)
index 0000000..ba57dfc
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <native-render-surface.h>
+
+namespace Dali
+{
+
+DALI_EXPORT_API NativeRenderSurface* CreateNativeSurface(
+                                     PositionSize       positionSize,
+                                     const std::string& name,
+                                     bool               isTransparent)
+{
+  return new NativeRenderSurface( positionSize, name, isTransparent );
+}
+
+} // namespace Dali
index 0a5e4f3d6096a9e8fcf89c6ccf6f59104185d547..62908dd387541b047bd932f861e14ffda5e2d926 100644 (file)
@@ -110,6 +110,11 @@ void Application::ReplaceWindow(PositionSize windowPosition, const std::string&
   Internal::Adaptor::GetImplementation(*this).ReplaceWindow(windowPosition, name);
 }
 
+std::string Application::GetResourcePath()
+{
+  return Internal::Adaptor::Application::GetResourcePath();
+}
+
 void Application::SetViewMode( ViewMode viewMode )
 {
   Internal::Adaptor::GetImplementation(*this).SetViewMode( viewMode );
index 371b533a96eeb9bca7ad8d921f9a8e57cc40d8e0..ea15cc79c8ef1a86b1b73533964d0c21f7328af3 100644 (file)
@@ -126,6 +126,8 @@ public:
   /**
    * @brief This is the constructor for applications without an argument list.
    * @SINCE_1_0.0
+   * @PRIVLEVEL_PUBLIC
+   * @PRIVILEGE_DISPLAY
    */
   static Application New();
 
@@ -133,6 +135,8 @@ public:
    * @brief This is the constructor for applications.
    *
    * @SINCE_1_0.0
+   * @PRIVLEVEL_PUBLIC
+   * @PRIVILEGE_DISPLAY
    * @param[in,out]  argc        A pointer to the number of arguments
    * @param[in,out]  argv        A pointer the the argument list
    */
@@ -142,9 +146,12 @@ public:
    * @brief This is the constructor for applications with a name
    *
    * @SINCE_1_0.0
+   * @PRIVLEVEL_PUBLIC
+   * @PRIVILEGE_DISPLAY
    * @param[in,out]  argc        A pointer to the number of arguments
    * @param[in,out]  argv        A pointer the the argument list
    * @param[in]      stylesheet  The path to user defined theme file
+   * @note If the stylesheet is not specified, then the library's default stylesheet will not be overridden.
    */
   static Application New( int* argc, char **argv[], const std::string& stylesheet );
 
@@ -152,10 +159,13 @@ public:
    * @brief This is the constructor for applications with a name
    *
    * @SINCE_1_0.0
+   * @PRIVLEVEL_PUBLIC
+   * @PRIVILEGE_DISPLAY
    * @param[in,out]  argc        A pointer to the number of arguments
    * @param[in,out]  argv        A pointer the the argument list
    * @param[in]      stylesheet  The path to user defined theme file
    * @param[in]      windowMode  A member of WINDOW_MODE
+   * @note If the stylesheet is not specified, then the library's default stylesheet will not be overridden.
    */
   static Application New( int* argc, char **argv[], const std::string& stylesheet, WINDOW_MODE windowMode );
 
@@ -258,6 +268,15 @@ public:
    */
   void ReplaceWindow(PositionSize windowPosition, const std::string& name);
 
+  /**
+   * @brief Get path application resources are stored at
+   *
+   * @SINCE_1_2.2
+   * @return the full path of the resources
+   */
+  static std::string GetResourcePath();
+
+
 public: // Stereoscopy
 
   /**
@@ -277,6 +296,8 @@ public: // Stereoscopy
   /**
    * @brief Set the stereo base (eye separation) for Stereoscopic 3D
    *
+   * The stereo base is the distance in millimetres between the eyes. Typical values are
+   * between 50mm and 70mm. The default value is 65mm.
    * @SINCE_1_0.0
    * @param[in] stereoBase The stereo base (eye separation) for Stereoscopic 3D
    */
@@ -366,11 +387,13 @@ public:  // Signals
   AppSignalType& MemoryLowSignal();
 
 public: // Not intended for application developers
+  /// @cond internal
   /**
    * @brief Internal constructor
    * @SINCE_1_0.0
    */
   explicit DALI_INTERNAL Application(Internal::Adaptor::Application* application);
+  /// @endcond
 };
 
 /**
index d26511cc60f05c85cd8ff62242d3c4560f91162c..0332739d84ba51ff5a6b9fe0814638b2c1c7cec1 100755 (executable)
@@ -53,8 +53,11 @@ typedef Dali::IntrusivePtr<Dali::NativeImageSource> NativeImageSourcePtr;
  *
  * NativeImageSource can be created internally or
  * externally by native image source.
+ * NativeImage is a platform specific way of providing pixel data to the GPU for rendering,
+ * for example via an EGL image.
  *
  * @SINCE_1_1.4
+ * @see NativeImage
  */
 class DALI_IMPORT_API NativeImageSource : public NativeImageInterface
 {
@@ -91,6 +94,7 @@ public:
    * @SINCE_1_0.0
    * @param[in] nativeImageSource must be a any handle with native image source
    * @return A smart-pointer to a newly allocated image.
+   * @see NativeImageInterface
    */
   static NativeImageSourcePtr New( Any nativeImageSource );
 
@@ -189,6 +193,7 @@ private:   // native image
 
 private:
 
+  /// @cond internal
   /**
    * @brief Private constructor
    * @SINCE_1_0.0
@@ -224,10 +229,13 @@ private:
    * @param[in] rhs A reference to the object to copy.
    */
   DALI_INTERNAL NativeImageSource& operator=(const NativeImageSource& rhs);
+  /// @endcond
 
 private:
 
+  /// @cond internal
   Internal::Adaptor::NativeImageSource* mImpl; ///< Implementation pointer
+  /// @endcond
 };
 
 /**
index 68591557d909f8dcfa800361b06849337d4d37f3..cef2e9215187199f8d6a5291a320786fa9718347 100644 (file)
@@ -52,8 +52,8 @@ public: // ENUMs
   enum Mode
   {
     DEFAULT = 0,  ///< Default mode for normal application @SINCE_1_0.0
-    NOTIFICATION, ///< Notification mode @SINCE_1_0.0
-    SCREEN_READER, ///< Screen reader mode @SINCE_1_0.0
+    NOTIFICATION, ///< Notification mode, such as playing utterance is started or completed @SINCE_1_0.0
+    SCREEN_READER, ///< Screen reader mode. To help visually impaired users interact with their devices, screen reader reads text or graphic elements on the screen using the TTS engine. @SINCE_1_0.0
     MODE_NUM
   };
 
@@ -168,12 +168,14 @@ public: // API
 
 public: // Not intended for application developers
 
+  /// @cond internal
   /**
    * @brief This constructor is used by TtsPlayer::Get().
    * @SINCE_1_0.0
    * @param[in] ttsPlayer A pointer to the TTS player.
    */
   explicit DALI_INTERNAL TtsPlayer( Internal::Adaptor::TtsPlayer* ttsPlayer );
+  /// @endcond
 };
 
 /**
index ea44240c6a5951547d394295b2ab4a69889362a5..40872cd64e3bc4b15d79fdbc69e7221b856f5660 100644 (file)
@@ -63,13 +63,13 @@ public:
   // Enumerations
 
   /**
-   * @brief Orientation of the window.
+   * @brief Orientation of the window is the way in which a rectangular page is oriented for normal viewing.
    * @SINCE_1_0.0
    */
   enum WindowOrientation
   {
-    PORTRAIT = 0,  ///< Portrait orientation @SINCE_1_0.0
-    LANDSCAPE = 90,  ///< Landscape orientation @SINCE_1_0.0
+    PORTRAIT = 0,  ///< Portrait orientation. The height of the display area is greater than the width. @SINCE_1_0.0
+    LANDSCAPE = 90,  ///< Landscape orientation. A wide view area is needed. @SINCE_1_0.0
     PORTRAIT_INVERSE = 180,  ///< Portrait inverse orientation @SINCE_1_0.0
     LANDSCAPE_INVERSE = 270  ///< Landscape inverse orientation @SINCE_1_0.0
   };
@@ -232,6 +232,7 @@ public:
 
   /**
    * @brief Returns the Drag & drop detector which can be used to receive drag & drop events.
+   * @note  Not intended for application developers.
    * @SINCE_1_0.0
    * @return A handle to the DragAndDropDetector.
    */
@@ -239,6 +240,8 @@ public:
 
   /**
    * @brief Get the native handle of the window.
+   *
+   * When users call this function, it wraps the actual type used by the underlying window system.
    * @SINCE_1_0.0
    * @return The native handle of the window or an empty handle.
    */
@@ -252,12 +255,14 @@ public: // Signals
   IndicatorSignalType& IndicatorVisibilityChangedSignal();
 
 public: // Not intended for application developers
+  /// @cond internal
   /**
    * @brief This constructor is used by Dali::Application::GetWindow().
    * @SINCE_1_0.0
    * @param[in] window A pointer to the window.
    */
   explicit DALI_INTERNAL Window( Internal::Adaptor::Window* window );
+  /// @endcond
 };
 
 /**
index ee27115f07c076fe5dad6b3d87dfd33a13ea0705..5d8aa7dcc5a6c1b5db44e4c233203c0cfe0f9e9f 100644 (file)
@@ -27,8 +27,8 @@ namespace Dali
 {
 
 const unsigned int ADAPTOR_MAJOR_VERSION = 1;
-const unsigned int ADAPTOR_MINOR_VERSION = 1;
-const unsigned int ADAPTOR_MICRO_VERSION = 45;
+const unsigned int ADAPTOR_MINOR_VERSION = 2;
+const unsigned int ADAPTOR_MICRO_VERSION = 5;
 const char * const ADAPTOR_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
diff --git a/adaptors/tizen/display-connection-impl-tizen.cpp b/adaptors/tizen/display-connection-impl-tizen.cpp
new file mode 100644 (file)
index 0000000..0516ba2
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <display-connection-impl.h>
+
+// EXTERNAL_HEADERS
+#include <tbm_bufmgr.h>
+#include <dali/integration-api/debug.h>
+
+// INTERNAL HEADERS
+#include <native-render-surface.h>
+#include <gl/egl-implementation.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+EGLNativeDisplayType DisplayConnection::GetNativeDisplay()
+{
+  return (EGLNativeDisplayType)tbm_bufmgr_init( -1 );
+}
+
+void DisplayConnection::ReleaseNativeDisplay()
+{
+  if( mDisplay )
+  {
+    tbm_bufmgr_deinit( (tbm_bufmgr)mDisplay );
+  }
+}
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
index ecfc46169c8926c384110748729df4733fab6bbd..541cafd0f553592e7d231e8bf04fa2a5c2b1c958 100644 (file)
@@ -17,6 +17,8 @@ adaptor_tizen_internal_egl_extension_src_files = \
   $(adaptor_tizen_dir)/gl/egl-image-extensions-tizen.cpp
 
 adaptor_tizen_internal_native_image_src_files = \
+  $(adaptor_tizen_dir)/display-connection-impl-tizen.cpp \
+  $(adaptor_tizen_dir)/native-render-surface-tizen.cpp \
   $(adaptor_tizen_dir)/native-image-source-impl-tizen.cpp
 
 public_api_adaptor_tizen_header_files = \
index 1f0cf57b699bb2e3498f29ffe21d2c4a286ed089..d140a9979d6505a734e2803495e6237b86ae3988 100644 (file)
 #include <appcore-watch/watch_app.h>
 #endif
 
+#if defined( TIZEN_PLATFORM_CONFIG_SUPPORTED ) && TIZEN_PLATFORM_CONFIG_SUPPORTED
+#include <tzplatform_config.h>
+#endif // TIZEN_PLATFORM_CONFIG_SUPPORTED
+
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
@@ -325,7 +329,6 @@ Framework::Framework( Framework::Observer& observer, int *argc, char ***argv, Ty
   if( featureFlag == false )
   {
     set_last_result( TIZEN_ERROR_NOT_SUPPORTED );
-    throw Dali::DaliException( "", "OpenGL ES 2.0 is not supported." );
   }
   InitThreads();
 
@@ -392,6 +395,16 @@ std::string Framework::GetBundleId() const
   return mBundleId;
 }
 
+std::string Framework::GetResourcePath()
+{
+  std::string resourcePath = "";
+#if defined( TIZEN_PLATFORM_CONFIG_SUPPORTED ) && TIZEN_PLATFORM_CONFIG_SUPPORTED
+  resourcePath = app_get_resource_path();
+#endif //TIZEN_PLATFORM_CONFIG_SUPPORTED
+
+  return resourcePath;
+}
+
 void Framework::SetBundleId(const std::string& id)
 {
   mBundleId = id;
diff --git a/adaptors/tizen/native-render-surface-tizen.cpp b/adaptors/tizen/native-render-surface-tizen.cpp
new file mode 100644 (file)
index 0000000..7f1b1a7
--- /dev/null
@@ -0,0 +1,277 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <native-render-surface.h>
+
+// EXTERNAL INCLUDES
+#include <dali/integration-api/gl-abstraction.h>
+#include <dali/integration-api/debug.h>
+#include <dali/devel-api/threading/conditional-wait.h>
+
+#include <Ecore_Wayland.h>
+#include <tbm_bufmgr.h>
+#include <tbm_surface_queue.h>
+
+// INTERNAL INCLUDES
+#include <trigger-event.h>
+#include <gl/egl-implementation.h>
+#include <base/display-connection.h>
+#include <integration-api/thread-synchronization-interface.h>
+
+namespace Dali
+{
+
+#if defined(DEBUG_ENABLED)
+extern Debug::Filter* gRenderSurfaceLogFilter;
+#endif
+
+struct NativeRenderSurface::Impl
+{
+  Impl( Dali::PositionSize positionSize, const std::string& name, bool isTransparent )
+  : mPosition( positionSize ),
+    mTitle( name ),
+    mRenderNotification( NULL ),
+    mColorDepth( isTransparent ? COLOR_DEPTH_32 : COLOR_DEPTH_24 ),
+    mTbmFormat( isTransparent ? TBM_FORMAT_ARGB8888 : TBM_FORMAT_RGB888 ),
+    mOwnSurface( false ),
+    mConsumeSurface( NULL ),
+    mThreadSynchronization( NULL )
+  {
+  }
+
+  PositionSize mPosition;
+  std::string mTitle;
+  TriggerEventInterface* mRenderNotification;
+  ColorDepth mColorDepth;
+  tbm_format mTbmFormat;
+  bool mOwnSurface;
+
+  tbm_surface_queue_h mTbmQueue;
+  tbm_surface_h mConsumeSurface;
+  ThreadSynchronizationInterface* mThreadSynchronization;     ///< A pointer to the thread-synchronization
+  ConditionalWait mTbmSurfaceCondition;
+};
+
+NativeRenderSurface::NativeRenderSurface(Dali::PositionSize positionSize,
+                                         const std::string& name,
+                                         bool isTransparent)
+: mImpl( new Impl( positionSize, name, isTransparent ) )
+{
+  ecore_wl_init(NULL);
+  CreateNativeRenderable();
+}
+
+NativeRenderSurface::~NativeRenderSurface()
+{
+  // release the surface if we own one
+  if( mImpl->mOwnSurface )
+  {
+
+    if( mImpl->mConsumeSurface )
+    {
+      tbm_surface_queue_release( mImpl->mTbmQueue, mImpl->mConsumeSurface );
+      mImpl->mConsumeSurface = NULL;
+    }
+
+    if( mImpl->mTbmQueue )
+    {
+      tbm_surface_queue_destroy( mImpl->mTbmQueue );
+    }
+
+    delete mImpl;
+
+    DALI_LOG_INFO( gRenderSurfaceLogFilter, Debug::General, "Own tbm surface queue destroy\n" );
+  }
+}
+
+void NativeRenderSurface::SetRenderNotification( TriggerEventInterface* renderNotification )
+{
+  mImpl->mRenderNotification = renderNotification;
+}
+
+tbm_surface_h NativeRenderSurface::GetDrawable()
+{
+  ConditionalWait::ScopedLock lock( mImpl->mTbmSurfaceCondition );
+
+  return mImpl->mConsumeSurface;
+}
+
+Any NativeRenderSurface::GetSurface()
+{
+  return Any( NULL );
+}
+
+void NativeRenderSurface::InitializeEgl( EglInterface& egl )
+{
+  DALI_LOG_TRACE_METHOD( gRenderSurfaceLogFilter );
+
+  Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
+
+  eglImpl.ChooseConfig( true, mImpl->mColorDepth );
+}
+
+void NativeRenderSurface::CreateEglSurface( EglInterface& egl )
+{
+  DALI_LOG_TRACE_METHOD( gRenderSurfaceLogFilter );
+
+  Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
+
+  eglImpl.CreateSurfaceWindow( (EGLNativeWindowType)mImpl->mTbmQueue, mImpl->mColorDepth );
+}
+
+void NativeRenderSurface::DestroyEglSurface( EglInterface& egl )
+{
+  DALI_LOG_TRACE_METHOD( gRenderSurfaceLogFilter );
+
+  Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
+  eglImpl.DestroySurface();
+}
+
+bool NativeRenderSurface::ReplaceEGLSurface( EglInterface& egl )
+{
+  DALI_LOG_TRACE_METHOD( gRenderSurfaceLogFilter );
+
+  if( mImpl->mConsumeSurface )
+  {
+    tbm_surface_queue_release( mImpl->mTbmQueue, mImpl->mConsumeSurface );
+    mImpl->mConsumeSurface = NULL;
+  }
+
+  if( mImpl->mTbmQueue )
+  {
+    tbm_surface_queue_destroy( mImpl->mTbmQueue );
+  }
+
+  CreateNativeRenderable();
+
+  if( !mImpl->mTbmQueue )
+  {
+    return false;
+  }
+
+  Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
+
+  return eglImpl.ReplaceSurfaceWindow( (EGLNativeWindowType)mImpl->mTbmQueue ); // reinterpret_cast does not compile
+}
+
+void NativeRenderSurface::StartRender()
+{
+}
+
+bool NativeRenderSurface::PreRender( EglInterface&, Integration::GlAbstraction& )
+{
+  // nothing to do for pixmaps
+  return true;
+}
+
+void NativeRenderSurface::PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface )
+{
+  Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
+  eglImpl.SwapBuffers();
+
+  // flush gl instruction queue
+  glAbstraction.Flush();
+
+  {
+    if( tbm_surface_queue_can_acquire( mImpl->mTbmQueue, 1 ) )
+    {
+      if( tbm_surface_queue_acquire( mImpl->mTbmQueue, &mImpl->mConsumeSurface ) != TBM_SURFACE_QUEUE_ERROR_NONE )
+      {
+        DALI_LOG_ERROR( "Failed aquire consume tbm_surface\n" );
+        return;
+      }
+    }
+  }
+
+ // create damage for client applications which wish to know the update timing
+  if( mImpl->mRenderNotification )
+  {
+    // use notification trigger
+    // Tell the event-thread to render the pixmap
+    mImpl->mRenderNotification->Trigger();
+  }
+  else
+  {
+    // FIXME
+  }
+
+}
+
+void NativeRenderSurface::StopRender()
+{
+  ReleaseLock();
+}
+
+PositionSize NativeRenderSurface::GetPositionSize() const
+{
+  return mImpl->mPosition;
+}
+
+void NativeRenderSurface::MoveResize( Dali::PositionSize positionSize )
+{
+}
+
+void NativeRenderSurface::SetViewMode( ViewMode viewMode )
+{
+}
+
+void NativeRenderSurface::SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization )
+{
+  mImpl->mThreadSynchronization = &threadSynchronization;
+}
+
+RenderSurface::Type NativeRenderSurface::GetSurfaceType()
+{
+  return RenderSurface::NATIVE_RENDER_SURFACE;
+}
+
+void NativeRenderSurface::CreateNativeRenderable()
+{
+  // check we're creating one with a valid size
+  DALI_ASSERT_ALWAYS( mImpl->mPosition.width > 0 && mImpl->mPosition.height > 0 && "Pixmap size is invalid" );
+
+  mImpl->mTbmQueue = tbm_surface_queue_create( 3, mImpl->mPosition.width, mImpl->mPosition.height, mImpl->mTbmFormat, TBM_BO_DEFAULT );
+
+  if( mImpl->mTbmQueue )
+  {
+    mImpl->mOwnSurface = true;
+  }
+  else
+  {
+    mImpl->mOwnSurface = false;
+  }
+}
+
+void NativeRenderSurface::ReleaseSurface()
+{
+  if( mImpl->mConsumeSurface )
+  {
+    tbm_surface_queue_release( mImpl->mTbmQueue, mImpl->mConsumeSurface );
+    mImpl->mConsumeSurface = NULL;
+  }
+}
+
+void NativeRenderSurface::ReleaseLock()
+{
+  if( mImpl->mThreadSynchronization )
+  {
+    mImpl->mThreadSynchronization->PostRenderComplete();
+  }
+}
+
+} // namespace Dali
index fe706ea4544bb5203481b08f15de62f293a76e91..22203ccba3c9129fa02dfd7b4a0c7f6b6a7e1d07 100644 (file)
@@ -194,6 +194,20 @@ std::string Framework::GetBundleId() const
   return mBundleId;
 }
 
+std::string Framework::GetResourcePath()
+{
+  // "DALI_APPLICATION_PACKAGE" is used by Ubuntu specifically to get the already configured Application package path.
+  const char* ubuntuEnvironmentVariable = "DALI_APPLICATION_PACKAGE";
+  char* value = getenv( ubuntuEnvironmentVariable );
+  std::string resourcePath;
+  if ( value != NULL )
+  {
+    resourcePath = value;
+  }
+
+  return resourcePath;
+}
+
 void Framework::SetBundleId(const std::string& id)
 {
   mBundleId = id;
index e207e6fb7e021229aaa8f96a66598e11ec1cfdb3..611ddf3efd024156ea4c05c1776e229385471c09 100644 (file)
@@ -87,11 +87,10 @@ bool Clipboard::SetItem(const std::string &itemData )
 }
 
 /*
- * Get string at given index of clipboard
+ * Request clipboard service to retrieve an item
  */
-std::string Clipboard::GetItem( unsigned int index )  // change string to a Dali::Text object.
+void Clipboard::RequestItem()
 {
-  return "not supported";
 }
 
 /*
@@ -111,10 +110,19 @@ void Clipboard::ShowClipboard()
 {
 }
 
-void Clipboard::HideClipboard()
+void Clipboard::HideClipboard(bool skipFirstHide)
 {
 }
 
+bool Clipboard::IsVisible() const
+{
+  return false;
+}
+
+char* Clipboard::ExcuteBuffered( bool type, void *event )
+{
+  return NULL;
+}
 
 } // namespace Adaptor
 
index 3b8751944184e2b1dafc5efa5893e570ca8d792e..c08e05598804342310c3a6ff591c6f8c94d3152c 100644 (file)
@@ -60,6 +60,10 @@ bool DisplayConnection::InitializeEgl(EglInterface& egl)
   return true;
 }
 
+void DisplayConnection::SetSurfaceType( RenderSurface::Type type )
+{
+}
+
 void DisplayConnection::GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical)
 {
   CompositorOutput::GetDpi( dpiHorizontal, dpiVertical);
index f531628d656b5ed49ed30169d3f8127087f9c4e1..2f957394a3e944680c71d1800bbcd0369e3d4e01 100644 (file)
@@ -80,6 +80,8 @@ public:
    */
   bool InitializeEgl(EglInterface& egl);
 
+  void SetSurfaceType( RenderSurface::Type type );
+
 public:
 
   /**
@@ -89,6 +91,10 @@ public:
 
 protected:
 
+  EGLNativeDisplayType GetNativeDisplay();
+
+  void ReleaseNativeDisplay();
+
   // Undefined
   DisplayConnection(const DisplayConnection&);
 
index ad95ac5d7d48a4f1236ccb5fec3175556507f2fe..731763e9afc2000bca4466b4df66e94d644891c9 100644 (file)
@@ -303,6 +303,10 @@ const std::string& ImfManager::GetSurroundingText() const
   return mSurroundingText;
 }
 
+void ImfManager::NotifyTextInputMultiLine( bool multiLine )
+{
+}
+
 } // Adaptor
 
 } // Internal
index 7a0d2872b10416f6d62ac5f6a7f9f22742abdee4..1af41bcb6384c743b65a5a80f318b49d9397c4d5 100644 (file)
@@ -148,6 +148,11 @@ public:
    */
   const std::string& GetSurroundingText() const;
 
+  /**
+  * @copydoc Dali::ImfManager::NotifyTextInputMultiLine()
+  */
+  void NotifyTextInputMultiLine( bool multiLine );
+
 public:  // Signals
 
   /**
index 43750a8306e0030a0067de2af4eedd4d1f8c5c9f..f8323ea05e6f3d6e35bb215bb815a480b45aaf1f 100644 (file)
@@ -149,7 +149,10 @@ void RenderSurface::SetThreadSynchronization( ThreadSynchronizationInterface& th
 {
 }
 
-
+RenderSurface::Type RenderSurface::GetSurfaceType()
+{
+  return RenderSurface::WAYLAND_RENDER_SURFACE;
+}
 
 } // namespace Wayland
 
index b54c304fb8dadb22cc4f4116eee9c211c2b53095..bbbf4d26ee54de423be7df346d26b24b5b3f37fb 100644 (file)
@@ -161,6 +161,11 @@ public: // from Dali::RenderSurface
    */
   virtual void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization );
 
+  /**
+   * @copydoc Dali::RenderSurface::GetSurfaceType()
+   */
+  virtual RenderSurface::Type GetSurfaceType();
+
 protected: // Data
 
   Window                      mWindow;
index 37fb62b05c7fe8276452d91ea0125f0d189d66bb..f83355ff562c48b2d63e7ba00fc8b987dc25c7a5 100644 (file)
@@ -165,13 +165,15 @@ public:
   WatchTimeSignal& TimeTickSignal();
 
   /**
-   * @brief This signal is emitted at every second in ambient mode
+   * @brief This signal is emitted at each minute in ambient mode
    * A callback of the following type may be connected:
    * @code
    *   void YourCallbackName(Application& application, WatchTimeSignal &time);
    * @endcode
    * time(watch time handle) will not be available after returning this callback. It will be freed by the framework.
    * @SINCE_1_1.37
+   * @remarks http://tizen.org/privilege/alarm.set privilege is needed to receive ambient ticks at each minute.
+   * The AmbientTickSignal() will be ignored if your app doesn't have the privilege
    */
   WatchTimeSignal& AmbientTickSignal();
 
@@ -187,11 +189,13 @@ public:
   WatchBoolSignal& AmbientChangedSignal();
 
 public: // Not intended for application developers
+  /// @cond internal
   /**
    * @brief Internal constructor
    * @SINCE_1_1.37
    */
   explicit DALI_INTERNAL WatchApplication(Internal::Adaptor::WatchApplication* implementation);
+  /// @endcond
 };
 
 /**
index 34c4089716b0de1e4024dbfe47879b010b59085e..73890c2fb9b98aa4c7a49c6b907a4ca3130df0f3 100644 (file)
@@ -36,11 +36,6 @@ struct WatchTime::Impl
   void *mTimeHandle;
 };
 
-WatchTime::WatchTime()
-  :mImpl(NULL)
-{
-}
-
 WatchTime::WatchTime(void *time_handle)
 {
   mImpl = new Impl(time_handle);
@@ -57,6 +52,14 @@ WatchTime::~WatchTime()
 
 #ifdef APPCORE_WATCH_AVAILABLE
 
+WatchTime::WatchTime()
+{
+  watch_time_h watch_time = {0,};
+
+  watch_time_get_current_time(&watch_time);
+  mImpl = new Impl(watch_time);
+}
+
 int WatchTime::GetHour() const
 {
   int hour;
@@ -91,6 +94,11 @@ int WatchTime::GetSecond() const
 
 #else
 
+WatchTime::WatchTime()
+  :mImpl(NULL)
+{
+}
+
 int WatchTime::GetHour() const
 {
   return 0;
@@ -111,6 +119,6 @@ int WatchTime::GetSecond() const
   return 0;
 }
 
-#endif
+#endif  // APPCORE_WATCH_AVAILABLE
 
 } // namespace Dali
index 1982b5e58193673ce356fcd14e16bc35fbb6940f..de8c98d9ee255db290e04b00cfe2e8443f33d335 100644 (file)
@@ -28,6 +28,7 @@
 #include <adaptor-impl.h>
 #include <ecore-x-window-interface.h>
 #include <singleton-service-impl.h>
+#include <clipboard-event-notifier-impl.h>
 
 namespace //unnamed namespace
 {
@@ -127,15 +128,11 @@ bool Clipboard::SetItem(const std::string &itemData )
 }
 
 /*
- * Get string at given index of clipboard
+ * Request clipboard service to retrieve an item
  */
-std::string Clipboard::GetItem( unsigned int index )  // change string to a Dali::Text object.
+void Clipboard::RequestItem()
 {
-  if ( index >= NumberOfItems() )
-  {
-    return "";
-  }
-
+  int index = 0;
   char sendBuf[20];
   snprintf( sendBuf, 20,  "%s%d", CBHM_ITEM, index );
   Ecore_X_Atom xAtomCbhmItem = ecore_x_atom_get( sendBuf );
@@ -150,10 +147,17 @@ std::string Clipboard::GetItem( unsigned int index )  // change string to a Dali
     Ecore_X_Atom xAtomCbhmError = ecore_x_atom_get( CBHM_ERROR );
     if ( xAtomItemType != xAtomCbhmError )
     {
-      return clipboardString;
+      // Call ClipboardEventNotifier to notify event observe of retrieved string
+      Dali::ClipboardEventNotifier clipboardEventNotifier(ClipboardEventNotifier::Get());
+      if ( clipboardEventNotifier )
+      {
+        ClipboardEventNotifier& notifierImpl( ClipboardEventNotifier::GetImplementation( clipboardEventNotifier ) );
+
+        notifierImpl.SetContent( clipboardString );
+        notifierImpl.EmitContentSelectedSignal();
+      }
     }
   }
-  return "";
 }
 
 /*
@@ -190,7 +194,7 @@ void Clipboard::ShowClipboard()
   ECore::WindowInterface::SendXEvent( ecore_x_display_get(), cbhmWin, False, NoEventMask, atomCbhmMsg, 8, SHOW );
 }
 
-void Clipboard::HideClipboard()
+void Clipboard::HideClipboard(bool skipFirstHide)
 {
   Ecore_X_Window cbhmWin = ECore::WindowInterface::GetWindow();
   // Launch the clipboard window
@@ -201,6 +205,15 @@ void Clipboard::HideClipboard()
   ecore_x_selection_secondary_clear();
 }
 
+bool Clipboard::IsVisible() const
+{
+  return false;
+}
+
+char* Clipboard::ExcuteBuffered( bool type, void *event )
+{
+  return NULL;
+}
 
 } // namespace Adaptor
 
index b0c804b33e5a2ed21a42c140194753d47e939e32..b917458896837c70606975b976310d0055831cae 100644 (file)
@@ -44,8 +44,6 @@ DisplayConnection* DisplayConnection::New()
 DisplayConnection::DisplayConnection()
 : mDisplay(NULL)
 {
-  // Because of DDK issue, we need to use separated x display instead of ecore default display
-  mDisplay = XOpenDisplay(0);
 }
 
 DisplayConnection::~DisplayConnection()
@@ -95,6 +93,15 @@ bool DisplayConnection::InitializeEgl(EglInterface& egl)
   return true;
 }
 
+void DisplayConnection::SetSurfaceType( RenderSurface::Type type )
+{
+  if( type == RenderSurface::ECORE_RENDER_SURFACE )
+  {
+    // Because of DDK issue, we need to use separated x display instead of ecore default display
+    mDisplay = XOpenDisplay(0);
+  }
+}
+
 void DisplayConnection::GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical)
 {
   // calculate DPI
index c5b7a7088376dfd4bfaf369b7cf42970be4daa75..2c0eabd92c66a48953ae2d1b03318b9b68706e28 100644 (file)
@@ -80,6 +80,8 @@ public:
    */
   bool InitializeEgl(EglInterface& egl);
 
+  void SetSurfaceType( RenderSurface::Type type );
+
 public:
 
   /**
index 6c0401ef8f970c3008aecc4a168fbdb5411ade4b..70b4694638dce1e488b45c9c451b93bdea87039a 100644 (file)
@@ -139,6 +139,11 @@ unsigned int EcoreXRenderSurface::GetSurfaceId( Any surface ) const
   return surfaceId;
 }
 
+RenderSurface::Type EcoreXRenderSurface::GetSurfaceType()
+{
+  return RenderSurface::ECORE_RENDER_SURFACE;
+}
+
 } // namespace ECore
 
 } // namespace Dali
index 57ffb35ba6406b9e06f12b54c4d85c5cc43e57bc..14dc3854c31bca3d5dfa9a1bd9005e26c8291d9b 100644 (file)
@@ -516,6 +516,10 @@ const std::string& ImfManager::GetSurroundingText() const
   return mSurroundingText;
 }
 
+void ImfManager::NotifyTextInputMultiLine( bool multiLine )
+{
+}
+
 } // Adaptor
 
 } // Internal
index 2cfc776848dd5f735f07acd129bce057a3cbb9b9..9447e8a13a582e8ff3d112c9291e151fe43aff1e 100644 (file)
@@ -314,6 +314,11 @@ void PixmapRenderSurface::ReleaseLock()
   }
 }
 
+RenderSurface::Type PixmapRenderSurface::GetSurfaceType()
+{
+  return RenderSurface::ECORE_RENDER_SURFACE;
+}
+
 } // namespace ECore
 
 } // namespace Dali
index 68754eb53f21015a2ac206d1aa35478c63a3f252..c19953b235b691ab943c839a2050a75cd9d788f9 100755 (executable)
@@ -45,16 +45,14 @@ our $repo = Git->repository();
 our $debug=0;
 our $pd_debug=0;
 our $opt_cached;
-our $opt_head;
-#our $opt_workingtree;
-#our $opt_diff=1;
 our $opt_help;
-our $opt_verbose;
+our $opt_output;
 our $opt_quiet;
+our $opt_verbose;
 
 my %options = (
     "cached"       => { "optvar"=>\$opt_cached, "desc"=>"Use index" },
-    "head"         => { "optvar"=>\$opt_head, "desc"=>"Use git show" },
+    "output:s"     => { "optvar"=>\$opt_output, "desc"=>"Generate html output"},
     "help"         => { "optvar"=>\$opt_help, "desc"=>""},
     "quiet"        => { "optvar"=>\$opt_quiet, "desc"=>""},
     "verbose"      => { "optvar"=>\$opt_verbose, "desc"=>"" });
@@ -323,6 +321,7 @@ sub get_coverage
 # output for the patch.
 sub run_diff
 {
+    #print "run_diff(" . join(" ", @_) . ")\n";
     my ($fh, $c) = $repo->command_output_pipe(@_);
     our @patch=();
     while(<$fh>)
@@ -332,6 +331,8 @@ sub run_diff
     }
     $repo->command_close_pipe($fh, $c);
 
+    print "Patch size: " . scalar(@patch) . "\n" if $debug;
+
     # @patch has slurped diff for all files...
     my $filesref = parse_diff ( \@patch );
     show_patch_lines($filesref) if $debug;
@@ -344,6 +345,7 @@ sub run_diff
     for my $file (keys(%$filesref))
     {
         my ($name, $path, $suffix) = fileparse($file, qr{\.[^.]*$});
+        next if($path !~ /^dali/);
         if($suffix eq ".cpp" || $suffix eq ".c" || $suffix eq ".h")
         {
             get_coverage($file, $filesref);
@@ -353,7 +355,6 @@ sub run_diff
     return $filesref;
 }
 
-
 sub calc_patch_coverage_percentage
 {
     my $filesref = shift;
@@ -362,6 +363,9 @@ sub calc_patch_coverage_percentage
 
     foreach my $file (keys(%$filesref))
     {
+        my ($name, $path, $suffix) = fileparse($file, qr{\.[^.]*$});
+        next if($path !~ /^dali/);
+
         my $covered_lines = 0;
         my $uncovered_lines = 0;
 
@@ -401,7 +405,7 @@ sub calc_patch_coverage_percentage
     my $percent = 0;
     if($total_exec > 0) { $percent = 100 * $total_covered_lines / $total_exec; }
 
-    return $percent;
+    return [ $total_exec, $percent ];
 }
 
 sub patch_output
@@ -480,6 +484,117 @@ sub patch_output
 }
 
 
+sub patch_html_output
+{
+    my $filesref = shift;
+
+    open( my $filehandle, ">", $opt_output ) || die "Can't open $opt_output for writing:$!\n";
+
+    my $OUTPUT_FH = select;
+    select $filehandle;
+    print <<EOH;
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
+"http://www.w3.org/TR/REC-html40/loose.dtd">
+<html>
+<head>
+<title>Patch Coverage</title>
+</head>
+<body bgcolor="white">
+EOH
+
+    foreach my $file (keys(%$filesref))
+    {
+        my ($name, $path, $suffix) = fileparse($file, qr{\.[^.]*$});
+        next if($path !~ /^dali/);
+
+        my $patchref = $filesref->{$file}->{"patch"};
+        my $b_lines_ref = $filesref->{$file}->{"b_lines"};
+        my $coverage_ref = $filesref->{$file}->{"coverage"};
+        print "<h2>$file</h2>\n";
+
+        if($coverage_ref)
+        {
+            if( $coverage_ref->{"covered_lines"} > 0
+                ||
+                $coverage_ref->{"uncovered_lines"} > 0 )
+            {
+                print "<p style=\"color:green;\">Covered: " .
+                    $coverage_ref->{"covered_lines"} . "<p>" .
+                    "<p style=\"color:red;\">Uncovered: " .
+                    $coverage_ref->{"uncovered_lines"} . "</span></p>";
+            }
+        }
+        else
+        {
+            print "<p>";
+            my $span=0;
+            if($suffix eq ".cpp" || $suffix eq ".c" || $suffix eq ".h")
+            {
+                print "<span style=\"color:red;\">";
+                $span=1;
+            }
+            print "No coverage found";
+            print "</span>" if $span;
+        }
+        print "</p>";
+
+        for my $patch (@$patchref)
+        {
+            my $hunkstr="Hunk: " . $patch->[0];
+            if( $patch->[1] > 1 )
+            {
+                $hunkstr .= " - " . ($patch->[0]+$patch->[1]-1);
+            }
+            print "<p style=\"font-weight:bold;\">" . $hunkstr . "</p>";
+
+            print "<pre>";
+            for(my $i = 0; $i < $patch->[1]; $i++ )
+            {
+                my $line = $i + $patch->[0];
+                my $num_line_digits=log($line)/log(10);
+                for $i (0..(6-$num_line_digits-1))
+                {
+                    print " ";
+                }
+                print "$line  ";
+
+                if($coverage_ref)
+                {
+                    my $color;
+                    if($coverage_ref->{"covered"}->{$line})
+                    {
+                        print("<span style=\"color:green;\">");
+                    }
+                    elsif($coverage_ref->{"uncovered"}->{$line})
+                    {
+                        print("<span style=\"color:red;font-weight:bold;\">");
+                    }
+                    else
+                    {
+                        #print("<span style=\"color:black;font-weight:normal;\">");
+                    }
+                    my $src=$coverage_ref->{"src"}->{$line};
+                    chomp($src);
+                    #print $color, "$src\n", RESET;
+                    print "$src</span>\n";
+                }
+                else
+                {
+                    # We don't have coverage data, so print it from the patch instead.
+                    my $src = $b_lines_ref->{$line};
+                    print "$src\n";
+                }
+            }
+            print "<\pre>\n";
+        }
+    }
+
+    print $filehandle "<hr>\n</body>\n</html>\n";
+    close $filehandle;
+    select $OUTPUT_FH;
+}
+
+
 ################################################################################
 ##                                    MAIN                                    ##
 ################################################################################
@@ -492,30 +607,82 @@ chdir "build/tizen";
 my @cmd=('--no-pager','diff','--no-ext-diff','-U0','--no-color');
 
 my $status = $repo->command("status", "-s");
-if( $status eq "" )
+if( $status eq "" && !scalar(@ARGV))
 {
-    # There are no changes in the index or working tree. Use the last patch instead
+    # There are no changes in the index or working tree, and
+    # no diff arguments to append. Use the last patch instead.
     push @cmd, ('HEAD~1','HEAD');
 }
-elsif($opt_cached) # TODO: Remove this option. Instead, need full diff
+else
 {
-    push @cmd, "--cached";
+    # detect if there are only cached changes or only working tree changes
+    my $cached = 0;
+    my $working = 0;
+    for my $fstat ( split(/\n/, $status) )
+    {
+        if(substr( $fstat, 0, 1 ) ne " "){ $cached++; }
+        if(substr( $fstat, 1, 1 ) ne " "){ $working++; }
+    }
+    if($cached > 0 )
+    {
+        if($working == 0)
+        {
+            push @cmd, "--cached";
+        }
+        else
+        {
+            die "Both cached & working files - cannot get correct patch from git\n";
+            # Would have to diff from separate clone.
+        }
+    }
 }
 
 push @cmd, @ARGV;
 my $filesref = run_diff(@cmd);
 
-my $percent = calc_patch_coverage_percentage($filesref);
-if( ! $opt_quiet )
+chdir $cwd;
+
+# Check how many actual source files there are in the patch
+my $filecount = 0;
+foreach my $file (keys(%$filesref))
+{
+    my ($name, $path, $suffix) = fileparse($file, qr{\.[^.]*$});
+    next if($path !~ /^dali/);
+    next if($suffix ne ".cpp" && $suffix ne ".c" && $suffix ne ".h");
+    $filecount++;
+}
+if( $filecount == 0 )
+{
+    print "No source files found\n";
+    exit 0;    # Exit with no error.
+}
+
+my $percentref = calc_patch_coverage_percentage($filesref);
+if($percentref->[0] == 0)
+{
+    print "No coverable lines found\n";
+    exit 0;
+}
+my $percent = $percentref->[1];
+
+my $color=BOLD RED;
+if($opt_output)
+{
+    print "Outputing to $opt_output\n" if $debug;
+    patch_html_output($filesref);
+}
+elsif( ! $opt_quiet )
 {
     patch_output($filesref);
-    my $color=BOLD RED;
     if($percent>=90)
     {
         $color=GREEN;
     }
-    printf("Percentage of change covered: $color %5.2f%\n" . RESET, $percent);
+    print RESET;
 }
+
+printf("Percentage of change covered: %5.2f%\n", $percent);
+
 exit($percent<90);
 
 
index fdb1df5b407c2abc43ca9f847dd6f2bbcd95b121..0134b9bbef93ff16c67857cafaf0510a6b929c27 100644 (file)
@@ -27,40 +27,61 @@ using namespace Dali;
 
 int UtcDaliFontClient(void)
 {
-  const int ORDERED_VALUES[] = { 50, 63, 75, 87, 100, 113, 125, 150, 200 };
+  const int ORDERED_VALUES[] = { -1, 50, 63, 75, 87, 100, 113, 125, 150, 200 };
 
   const unsigned int NUM_OF_ORDERED_VALUES = sizeof( ORDERED_VALUES ) / sizeof( int );
 
   TestApplication application;
-  int preciseIndex = 0;
   int result=0;
 
-  tet_infoline("UtcDaliFontClient center range");
-  preciseIndex = 4;
-  result = TextAbstraction::Internal::ValueToIndex( ORDERED_VALUES[preciseIndex], ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
-  DALI_TEST_EQUALS( preciseIndex, result, TEST_LOCATION );
+  tet_infoline("UtcDaliFontClient No table");
+  result = TextAbstraction::Internal::ValueToIndex( 100, NULL, 0u );
+  DALI_TEST_EQUALS( -1, result, TEST_LOCATION );
 
-  tet_infoline("UtcDaliFontClient start of range");
-  preciseIndex = 0;
-  result = TextAbstraction::Internal::ValueToIndex( ORDERED_VALUES[preciseIndex], ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
-  DALI_TEST_EQUALS( preciseIndex, result, TEST_LOCATION );
-
-  tet_infoline("UtcDaliFontClient end of range");
-  preciseIndex = 8;
-  result = TextAbstraction::Internal::ValueToIndex( ORDERED_VALUES[preciseIndex], ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
-  DALI_TEST_EQUALS( preciseIndex, result, TEST_LOCATION );
+  tet_infoline("UtcDaliFontClient Non defined values");
+  result = TextAbstraction::Internal::ValueToIndex( -1, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
+  DALI_TEST_EQUALS( 0, result, TEST_LOCATION );
+  result = TextAbstraction::Internal::ValueToIndex( -3, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
+  DALI_TEST_EQUALS( 0, result, TEST_LOCATION );
 
-  tet_infoline("UtcDaliFontClient below of range");
+  tet_infoline("UtcDaliFontClient Between non defined and first of range.");
+  result = TextAbstraction::Internal::ValueToIndex( 0, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
+  DALI_TEST_EQUALS( 1, result, TEST_LOCATION );
   result = TextAbstraction::Internal::ValueToIndex( 30, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
-  DALI_TEST_EQUALS( 0, result, TEST_LOCATION );
+  DALI_TEST_EQUALS( 1, result, TEST_LOCATION );
+  result = TextAbstraction::Internal::ValueToIndex( 49, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
+  DALI_TEST_EQUALS( 1, result, TEST_LOCATION );
 
-  tet_infoline("UtcDaliFontClient below of range");
-  result = TextAbstraction::Internal::ValueToIndex( 220, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
+  tet_infoline("UtcDaliFontClient Defined in range");
+  for( unsigned int index = 1u; index < NUM_OF_ORDERED_VALUES; ++index )
+  {
+    result = TextAbstraction::Internal::ValueToIndex( ORDERED_VALUES[index], ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
+    DALI_TEST_EQUALS( index, result, TEST_LOCATION );
+  }
+
+  tet_infoline("UtcDaliFontClient Non defined in range");
+  result = TextAbstraction::Internal::ValueToIndex( 51, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
+  DALI_TEST_EQUALS( 1, result, TEST_LOCATION );
+  result = TextAbstraction::Internal::ValueToIndex( 55, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
+  DALI_TEST_EQUALS( 1, result, TEST_LOCATION );
+  result = TextAbstraction::Internal::ValueToIndex( 62, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
+  DALI_TEST_EQUALS( 2, result, TEST_LOCATION );
+  result = TextAbstraction::Internal::ValueToIndex( 64, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
+  DALI_TEST_EQUALS( 2, result, TEST_LOCATION );
+  result = TextAbstraction::Internal::ValueToIndex( 151, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
   DALI_TEST_EQUALS( 8, result, TEST_LOCATION );
+  result = TextAbstraction::Internal::ValueToIndex( 175, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
+  DALI_TEST_EQUALS( 9, result, TEST_LOCATION );
+  result = TextAbstraction::Internal::ValueToIndex( 176, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
+  DALI_TEST_EQUALS( 9, result, TEST_LOCATION );
+  result = TextAbstraction::Internal::ValueToIndex( 199, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
+  DALI_TEST_EQUALS( 9, result, TEST_LOCATION );
 
-  tet_infoline("UtcDaliFontClient zero ");
-  result = TextAbstraction::Internal::ValueToIndex( 0, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
-  DALI_TEST_EQUALS( 0, result, TEST_LOCATION );
+  tet_infoline("UtcDaliFontClient above of range");
+  result = TextAbstraction::Internal::ValueToIndex( 220, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
+  DALI_TEST_EQUALS( 9, result, TEST_LOCATION );
+  result = TextAbstraction::Internal::ValueToIndex( 500, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
+  DALI_TEST_EQUALS( 9, result, TEST_LOCATION );
 
   END_TEST;
 }
index 467bb526280c47e3d8be9c943aa7e39a16464414..b50f506489cb409a7e291584187ab3a240ec60a7 100644 (file)
@@ -337,3 +337,51 @@ BufferImage CreateBufferImage()
 {
   return CreateBufferImage(4, 4, Color::WHITE);
 }
+
+namespace Test
+{
+
+struct ObjectDestructionFunctor
+{
+  // Create a ObjectDestructionFunctor passing in a Dali::RefObject* to be monitored and a bool variable.
+  // Create ObjectRegistry instance and connect to the ObjectDestroyedSignal passing in the above functor for the callback.
+  // Get the ObjectPointer (Actor::GetObjectPtr) of the Actor to be checked for destruction and assign it to the Dali::RefObject*
+  // Check the bool variable which would be true when object destroyed.
+  ObjectDestructionFunctor( Dali::RefObject* objectPtr, bool& refObjectDestroyed )
+  : refObjectPointerToCheck( objectPtr ),
+    refObjectDestroyedBoolean( refObjectDestroyed )
+  {
+    refObjectDestroyed = false;
+  }
+
+  void operator()( const Dali::RefObject* objectPointer )
+  {
+    if ( refObjectPointerToCheck == objectPointer )
+    {
+      refObjectDestroyedBoolean = true;
+    }
+  }
+
+  Dali::RefObject* refObjectPointerToCheck;
+  bool& refObjectDestroyedBoolean;
+};
+
+ObjectDestructionTracker::ObjectDestructionTracker()
+  :mRefObjectDestroyed( false)
+{
+}
+
+void ObjectDestructionTracker::Start( Actor actor )
+{
+  ObjectDestructionFunctor destructionFunctor( actor.GetObjectPtr(), mRefObjectDestroyed );
+
+  ObjectRegistry objectRegistry = Stage::GetCurrent().GetObjectRegistry();
+  objectRegistry.ObjectDestroyedSignal().Connect( this, destructionFunctor );
+}
+
+bool ObjectDestructionTracker::IsDestroyed()
+{
+   return mRefObjectDestroyed;
+}
+
+} // namespace Test
index 7f81872e1388101410e950f9cb6b514de80fd00e..8cefb7c53a7edc5b22769391ada8506ebab9d24e 100644 (file)
@@ -499,4 +499,45 @@ struct DefaultFunctionCoverage
 BufferImage CreateBufferImage();
 BufferImage CreateBufferImage(int width, int height, const Vector4& color);
 
+// Test namespace to prevent pollution of Dali namespace, add Test helper functions here
+namespace Test
+{
+/**
+ *  @brief
+ *
+ *  Helper to check object destruction occurred
+ *  1) In main part of code create an ObjectDestructionTracker
+ *  2) Within sub section of main create object Actor test and call Start with Actor to test for destruction
+ *  3) Perform code which is expected to destroy Actor
+ *  4) Back in main part of code use IsDestroyed() to test if Actor was destroyed
+ */
+class ObjectDestructionTracker : public ConnectionTracker
+{
+public:
+
+  /**
+   * @brief Call in main part of code
+   */
+  ObjectDestructionTracker();
+
+  /**
+   * @brief Call in sub bock of code where the Actor being checked is still alive.
+   *
+   * @param[in] actor Actor to be checked for destruction
+   */
+  void Start( Actor actor );
+
+  /**
+   * @brief Call to check if Actor alive or destroyed.
+   *
+   * @return bool true if Actor was destroyed
+   */
+  bool IsDestroyed();
+
+private:
+  bool mRefObjectDestroyed;
+};
+
+} // namespace Test
+
 #endif // __DALI_TEST_SUITE_UTILS_H__
index 3f2e6e5fe07e5e73c4efa451c39bc6d50dfa062e..0054e59f3e8401cbc9cb01c8e1da36708a921518 100644 (file)
@@ -130,6 +130,18 @@ bool TraceCallStack::FindMethodAndParams(std::string method, const NamedParams&
   return FindIndexFromMethodAndParams( method, params ) > -1;
 }
 
+bool TraceCallStack::FindMethodAndParamsFromStartIndex( std::string method, std::string params, size_t& startIndex ) const
+{
+  for( size_t i = startIndex; i < mCallStack.size(); ++i )
+  {
+    if( ( mCallStack[i].method.compare( method ) == 0 ) && ( mCallStack[i].paramList.compare( params ) == 0 ) )
+    {
+      startIndex = i;
+      return true;
+    }
+  }
+  return false;
+}
 
 /**
  * Search for a method in the stack with the given parameter list
index 137bfafefd920a27c50694cb370a9ac3fbc80dee..e1882ea0ee44b399ecbbe6ca23bc7f3d83c59d48 100644 (file)
@@ -101,6 +101,19 @@ public:
    */
   bool FindMethodAndParams(std::string method, const NamedParams& params) const;
 
+  /**
+   * Search for a method in the stack with the given parameter list.
+   * The search is done from a given index.
+   * This allows the order of methods and parameters to be checked.
+   * @param[in] method The name of the method
+   * @param[in] params A comma separated list of parameter values
+   * @param[in/out] startIndex The method index to start looking from.
+   *                This is updated if a method is found so subsequent
+   *                calls can search for methods occuring after this one.
+   * @return True if the method was in the stack
+   */
+  bool FindMethodAndParamsFromStartIndex( std::string method, std::string params, size_t& startIndex ) const;
+
   /**
    * Search for a method in the stack with the given parameter list
    * @param[in] method The name of the method
index daaee0b078406c47ea77a9ab4ff9675ed16f445a..829997debaad78f253d6cb0711080315b39da229 100644 (file)
@@ -610,3 +610,14 @@ int UtcDaliApplicationMemoryLowSignalN(void)
 
   END_TEST;
 }
+
+int UtcDaliApplicationGetResourcePathP(void)
+{
+  Application application = Application::New();
+  std::string result ("**invalid path**"); // Calling GetResourcePath should replace this with a system dependent path or "".
+  result = application.GetResourcePath();
+  DALI_TEST_CHECK( result !="**invalid path**" );
+
+  END_TEST;
+}
+
index f05baca2b422e7cd3c557cd7c1ecba2a40463ffe..4e8e1d7d27179fea9bfb3f68e66f4acc08adcd6a 100644 (file)
@@ -234,6 +234,32 @@ endif # WAYLAND
 
 endif
 
+# IVI
+if IVI_PROFILE
+
+adaptor_internal_src_files += $(adaptor_common_internal_src_files) \
+                             $(adaptor_common_internal_mobile_profile_src_files) \
+                             $(adaptor_tizen_internal_src_files) \
+                             $(static_libraries_libunibreak_src_files)
+
+if WAYLAND
+if USE_ECORE_WAYLAND
+adaptor_internal_src_files += $(adaptor_ecore_wayland_tizen_internal_src_files)
+else
+adaptor_internal_src_files += $(adaptor_wayland_tizen_internal_src_files)
+endif # USE_ECORE_WAYLAND
+
+adaptor_internal_src_files += $(adaptor_tizen_internal_egl_extension_src_files)\
+                              $(adaptor_tizen_internal_native_image_src_files)
+
+else
+adaptor_internal_src_files += $(adaptor_x11_tizen_internal_src_files) \
+                              $(adaptor_common_internal_egl_extension_src_files)
+endif # WAYLAND
+
+endif # IVI_PROFILE
+
+
 # Node JS support for using an external libuv main loop. If not enabled then just use e-core as normal
 # Used for things like callbacks, file-monintors, x input handling
 if LIB_UV_EVENT_LOOP
@@ -330,6 +356,7 @@ libdali_adaptor_uv_la_CXXFLAGS = \
                       -DFONT_DOWNLOADED_PATH="\"${fontDownloadedPath}\"" \
                       -DFONT_APPLICATION_PATH="\"${fontApplicationPath}\"" \
                       -DFONT_CONFIGURATION_FILE="\"${fontConfigurationFile}\"" \
+                      -DTIZEN_PLATFORM_CONFIG_SUPPORTED=${tizenPlatformConfigSupported} \
                       -DNON_POWER_OF_TWO_TEXTURES \
                       -DDALI_COMPILATION -DDALI_ADAPTOR_COMPILATION \
                       -Werror -Wall -lgcc \
@@ -392,7 +419,10 @@ libdali_adaptor_uv_la_LIBADD += $(ELEMENTARY_LIBS) \
 
 else
 
-if MOBILE_PROFILE
+libdali_adaptor_uv_la_CXXFLAGS += $(ECORE_WAYLAND_CFLAGS)
+libdali_adaptor_uv_la_LIBADD += $(ECORE_WAYLAND_LIBS)
+
+if IVI_PROFILE
 libdali_adaptor_uv_la_CXXFLAGS += $(ECORE_WAYLAND_CFLAGS)
 libdali_adaptor_uv_la_LIBADD += $(ECORE_WAYLAND_LIBS)
 endif
@@ -457,6 +487,19 @@ libdali_adaptor_uv_la_CXXFLAGS += $(HAPTIC_CFLAGS)
 libdali_adaptor_uv_la_LIBADD +=
 endif
 
+if IVI_PROFILE
+libdali_adaptor_uv_la_CXXFLAGS += \
+                      $(DEVICED_CFLAGS) \
+                      $(EFL_ASSIST_CFLAGS) \
+                      $(NATIVE_BUFFER_CFLAGS) \
+                      $(NATIVE_BUFFER_POOL_CFLAGS)
+
+libdali_adaptor_uv_la_LIBADD += \
+                      $(EFL_ASSIST_LIBS) \
+                      $(NATIVE_BUFFER_LIBS) \
+                      $(NATIVE_BUFFER_POOL_LIBS)
+endif
+
 if UBUNTU_PROFILE
 libdali_adaptor_uv_la_LIBADD += -ljpeg
 CFLAGS += -fPIC
index dad8f61e3e310adf3e9c08f35d374112f7b20d83..e61fccfb6384cb5b0f91e00d5f2ba29443e16143 100644 (file)
@@ -189,13 +189,13 @@ AC_ARG_WITH([tizen-2-2-compatibility],
 
 # Tizen Profile options
 AC_ARG_ENABLE([profile],
-              [AC_HELP_STRING([--enable-profile=COMMON,MOBILE,WEARABLE,TV,UBUNTU],
+              [AC_HELP_STRING([--enable-profile=COMMON,MOBILE,WEARABLE,TV,IVI,UBUNTU],
                             [Select the variant of tizen])],
               [enable_profile=$enableval],
               [enable_profile=UBUNTU])
 
 # Ensure valid profile selected
-if test "x$enable_profile" != "xCOMMON" -a "x$enable_profile" != "xMOBILE" -a "x$enable_profile" != "xWEARABLE" -a "x$enable_profile" != "xTV" -a "x$enable_profile" != "xUBUNTU"; then
+if test "x$enable_profile" != "xCOMMON" -a "x$enable_profile" != "xMOBILE" -a "x$enable_profile" != "xWEARABLE" -a "x$enable_profile" != "xTV" -a "x$enable_profile" != "xIVI" -a "x$enable_profile" != "xUBUNTU"; then
   AC_MSG_ERROR([$enable_profile is an invalid profile])
 fi
 
@@ -210,6 +210,7 @@ AM_CONDITIONAL([COMMON_PROFILE], [test x$enable_profile = xCOMMON])
 AM_CONDITIONAL([MOBILE_PROFILE], [test x$enable_profile = xMOBILE])
 AM_CONDITIONAL([WEARABLE_PROFILE], [test x$enable_profile = xWEARABLE])
 AM_CONDITIONAL([TV_PROFILE], [test x$enable_profile = xTV])
+AM_CONDITIONAL([IVI_PROFILE], [test x$enable_profile = xIVI])
 AM_CONDITIONAL([UBUNTU_PROFILE], [test x$enable_profile = xUBUNTU])
 AM_CONDITIONAL([WAYLAND], [test x$enable_wayland = xyes])
 AM_CONDITIONAL([USE_EFL], [test x$enable_efl = xyes])
@@ -242,6 +243,10 @@ if test "x$enable_profile" = "xTV"; then
 PKG_CHECK_MODULES(OPENGLES20, glesv2)
 fi
 
+if test "x$enable_profile" = "xIVI"; then
+PKG_CHECK_MODULES(OPENGLES20, glesv2)
+fi
+
 if test "x$enable_profile" = "xUBUNTU"; then
 PKG_CHECK_MODULES(OPENGLES20, glesv2 egl)
 else
@@ -284,9 +289,10 @@ fi
 
 else
 
-# dali-adaptor-uv for MOBILE profile needs ecore-wayland even if enable_efl==no
-# because adaptors/mobile/pixmap-render-surface-factory.cpp uses it.
-if test "x$enable_profile" = "xMOBILE"; then
+# For adaptors/mobile/native-render-surface-factory.cpp
+PKG_CHECK_MODULES(ECORE_WAYLAND, ecore-wayland)
+
+if test "x$enable_profile" = "xIVI"; then
 PKG_CHECK_MODULES(ECORE_WAYLAND, ecore-wayland)
 fi
 
@@ -326,11 +332,18 @@ if test x$FONT_CONFIGURATION_FILE != x; then
   fontConfigurationFile=$FONT_CONFIGURATION_FILE
 fi
 
+if test x$TIZEN_PLATFORM_CONFIG_SUPPORTED != x; then
+  tizenPlatformConfigSupported=$TIZEN_PLATFORM_CONFIG_SUPPORTED
+else
+  tizenPlatformConfigSupported=0
+fi
+
 AC_SUBST(dataReadWriteDir)
 AC_SUBST(dataReadOnlyDir)
 AC_SUBST(DALI_ADAPTOR_CFLAGS)
 AC_SUBST(DALI_PROFILE_CFLAGS)
 AC_SUBST(fontConfigurationFile)
+AC_SUBST(tizenPlatformConfigSupported)
 
 # Specify the include directory for development headers
 #devincludepath=${includedir}/dali/internal
@@ -368,7 +381,9 @@ Configuration
   Font config file:                 $fontConfigurationFile
   Building with EFL Libraries:      $enable_efl
   Using Tizen APP FW libraries:     $enable_appfw
-  OpenGL ES version:                $enable_gles"
+  OpenGL ES version:                $enable_gles
+  Tizen Platform Config supported:  $tizenPlatformConfigSupported
+"
 # optional output of node.js source path if we're building with libuv
 if test "x$build_for_libuv" != "xno"; then
 echo "  LibUV header path                 $with_libuv"
index cf80ebd2f6a120006035b3ce968ec6af7f87ffa6..86701578b3b2d76da08ad78d072056143fcde920 100644 (file)
@@ -185,10 +185,12 @@ adaptor_internal_src_files += $(adaptor_wayland_tizen_internal_src_files)
 endif # USE_ECORE_WAYLAND
 
 adaptor_internal_src_files += $(adaptor_tizen_internal_egl_extension_src_files) \
-                              $(adaptor_tizen_internal_native_image_src_files)
+                              $(adaptor_tizen_internal_native_image_src_files) \
+                              $(adaptor_common_internal_wayland_mobile_profile_src_files)
 else
 adaptor_internal_src_files += $(adaptor_x11_tizen_internal_src_files) \
-                              $(adaptor_common_internal_egl_extension_src_files)
+                              $(adaptor_common_internal_egl_extension_src_files) \
+                              $(adaptor_common_internal_x_mobile_profile_src_files)
 endif # WAYLAND
 
 endif # MOBILE_PROFILE
@@ -210,10 +212,12 @@ endif # USE_ECORE_WAYLAND
 
 adaptor_internal_src_files += $(adaptor_tizen_internal_egl_extension_src_files) \
                               $(adaptor_tizen_internal_native_image_src_files) \
-                              $(adaptor_internal_wearable_profile_src_files)
+                              $(adaptor_internal_wearable_profile_src_files) \
+                              $(adaptor_common_internal_wayland_mobile_profile_src_files)
 else
 adaptor_internal_src_files += $(adaptor_x11_tizen_internal_src_files) \
-                              $(adaptor_common_internal_egl_extension_src_files)
+                              $(adaptor_common_internal_egl_extension_src_files) \
+                              $(adaptor_common_internal_x_mobile_profile_src_files)
 endif # WAYLAND
 
 endif # WEARABLE
@@ -245,6 +249,33 @@ endif # WAYLAND
 
 endif
 
+# IVI
+if IVI_PROFILE
+
+adaptor_internal_src_files += $(adaptor_common_internal_src_files) \
+                             $(adaptor_common_internal_mobile_profile_src_files) \
+                             $(adaptor_tizen_internal_src_files) \
+                             $(static_libraries_libunibreak_src_files)
+
+if WAYLAND
+
+if USE_ECORE_WAYLAND
+adaptor_internal_src_files += $(adaptor_ecore_wayland_tizen_internal_src_files)
+else
+adaptor_internal_src_files += $(adaptor_wayland_tizen_internal_src_files)
+endif # USE_ECORE_WAYLAND
+
+adaptor_internal_src_files += $(adaptor_tizen_internal_egl_extension_src_files) \
+                              $(adaptor_tizen_internal_native_image_src_files)
+else
+adaptor_internal_src_files += $(adaptor_x11_tizen_internal_src_files) \
+                              $(adaptor_common_internal_egl_extension_src_files)
+endif # WAYLAND
+
+endif # IVI_PROFILE
+
+
+
 # Node JS support for using an external libuv main loop. If not enabled then just use e-core as normal
 # Used for things like callbacks, file-monintors, x input handling
 if LIB_UV_EVENT_LOOP
@@ -344,6 +375,7 @@ libdali_adaptor_la_CXXFLAGS = \
                       -DFONT_DOWNLOADED_PATH="\"${fontDownloadedPath}\"" \
                       -DFONT_APPLICATION_PATH="\"${fontApplicationPath}\"" \
                       -DFONT_CONFIGURATION_FILE="\"${fontConfigurationFile}\"" \
+                      -DTIZEN_PLATFORM_CONFIG_SUPPORTED=${tizenPlatformConfigSupported} \
                       -DNON_POWER_OF_TWO_TEXTURES \
                       -DDALI_COMPILATION -DDALI_ADAPTOR_COMPILATION \
                       -Werror -Wall -lgcc \
@@ -466,6 +498,19 @@ libdali_adaptor_la_CXXFLAGS += $(HAPTIC_CFLAGS)
 libdali_adaptor_la_LIBADD +=
 endif
 
+if IVI_PROFILE
+libdali_adaptor_la_CXXFLAGS += \
+                      $(DEVICED_CFLAGS) \
+                      $(EFL_ASSIST_CFLAGS) \
+                      $(NATIVE_BUFFER_CFLAGS) \
+                      $(NATIVE_BUFFER_POOL_CFLAGS)
+
+libdali_adaptor_la_LIBADD += \
+                      $(EFL_ASSIST_LIBS) \
+                      $(NATIVE_BUFFER_LIBS) \
+                      $(NATIVE_BUFFER_POOL_LIBS)
+endif
+
 if UBUNTU_PROFILE
 libdali_adaptor_la_LIBADD += -ljpeg
 CFLAGS += -fPIC
index 6764320c237875ae997cd417971fd9da02d7bfa9..f008052d2b1f7c5ce07f44d301629d9769471889 100644 (file)
@@ -189,13 +189,13 @@ AC_ARG_WITH([tizen-2-2-compatibility],
 
 # Tizen Profile options
 AC_ARG_ENABLE([profile],
-              [AC_HELP_STRING([--enable-profile=COMMON,MOBILE,WEARABLE,TV,UBUNTU],
+              [AC_HELP_STRING([--enable-profile=COMMON,MOBILE,WEARABLE,TV,IVI,UBUNTU],
                             [Select the variant of tizen])],
               [enable_profile=$enableval],
               [enable_profile=UBUNTU])
 
 # Ensure valid profile selected
-if test "x$enable_profile" != "xCOMMON" -a "x$enable_profile" != "xMOBILE" -a "x$enable_profile" != "xWEARABLE" -a "x$enable_profile" != "xTV" -a "x$enable_profile" != "xUBUNTU"; then
+if test "x$enable_profile" != "xCOMMON" -a "x$enable_profile" != "xMOBILE" -a "x$enable_profile" != "xWEARABLE" -a "x$enable_profile" != "xTV" -a "x$enable_profile" != "xIVI" -a "x$enable_profile" != "xUBUNTU"; then
   AC_MSG_ERROR([$enable_profile is an invalid profile])
 fi
 
@@ -210,6 +210,7 @@ AM_CONDITIONAL([COMMON_PROFILE], [test x$enable_profile = xCOMMON])
 AM_CONDITIONAL([MOBILE_PROFILE], [test x$enable_profile = xMOBILE])
 AM_CONDITIONAL([WEARABLE_PROFILE], [test x$enable_profile = xWEARABLE])
 AM_CONDITIONAL([TV_PROFILE], [test x$enable_profile = xTV])
+AM_CONDITIONAL([IVI_PROFILE], [test x$enable_profile = xIVI])
 AM_CONDITIONAL([UBUNTU_PROFILE], [test x$enable_profile = xUBUNTU])
 AM_CONDITIONAL([WAYLAND], [test x$enable_wayland = xyes])
 AM_CONDITIONAL([USE_EFL], [test x$enable_efl = xyes])
@@ -251,6 +252,10 @@ if test "x$enable_profile" = "xTV"; then
 PKG_CHECK_MODULES(OPENGLES20, glesv2)
 fi
 
+if test "x$enable_profile" = "xIVI"; then
+PKG_CHECK_MODULES(OPENGLES20, glesv2)
+fi
+
 if test "x$enable_profile" = "xUBUNTU"; then
 PKG_CHECK_MODULES(OPENGLES20, glesv2 egl)
 #PKG_CHECK_MODULES(OPENGLES20, gl egl)
@@ -328,6 +333,12 @@ else
   dataReadOnlyDir=${prefix}/share/dali/
 fi
 
+if test x$TIZEN_PLATFORM_CONFIG_SUPPORTED != x; then
+  tizenPlatformConfigSupported=$TIZEN_PLATFORM_CONFIG_SUPPORTED
+else
+  tizenPlatformConfigSupported=0
+fi
+
 if test x$FONT_CONFIGURATION_FILE != x; then
   fontConfigurationFile=$FONT_CONFIGURATION_FILE
 fi
@@ -337,6 +348,7 @@ AC_SUBST(dataReadOnlyDir)
 AC_SUBST(DALI_ADAPTOR_CFLAGS)
 AC_SUBST(DALI_PROFILE_CFLAGS)
 AC_SUBST(fontConfigurationFile)
+AC_SUBST(tizenPlatformConfigSupported)
 
 # Specify the include directory for development headers
 #devincludepath=${includedir}/dali/internal
@@ -376,6 +388,7 @@ Configuration
   Building with EFL Libraries:      $enable_efl
   Using Tizen APP FW libraries:     $enable_appfw
   OpenGL ES version:                $enable_gles
+  Tizen Platform Config supported   $tizenPlatformConfigSupported
   TizenVR Engine:                   $enable_tizenvr
   TizenVR Engine Dir:               $with_tizenvr_dir
 "
index 2c77b5657b1c3c34c72996b029980bff93af7734..96ed70b1be17deedef9206b8695b12915d024559 100644 (file)
@@ -14,7 +14,7 @@
 
 Name:       dali-adaptor
 Summary:    The DALi Tizen Adaptor
-Version:    1.1.45
+Version:    1.2.5
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-2-Clause and MIT
@@ -27,7 +27,8 @@ Requires:       giflib
 
 #need libtzplatform-config for directory if tizen version is 3.x
 
-%if "%{tizen_version_major}" == "3"
+%if "%{tizen_version_major}" >= "3"
+%define tizen_platform_config_supported 1
 BuildRequires:  pkgconfig(libtzplatform-config)
 %endif
 
@@ -67,6 +68,15 @@ BuildRequires:  pkgconfig(appcore-watch)
 %define gles_requirement_setup 1
 %endif
 
+%if "%{profile}" == "ivi"
+%define dali_profile IVI
+%define dali_feedback_plugin 0
+%define dali_videoplayer_plugin 1
+%define shaderbincache_flag DISABLE
+BuildRequires:  pkgconfig(glesv2)
+%define gles_requirement_setup 1
+%endif
+
 %if "%{profile}" == "common"
 %define dali_profile COMMON
 %define dali_feedback_plugin 0
@@ -219,22 +229,22 @@ VideoPlayer plugin to play a video file for Dali
 %prep
 %setup -q
 
-#Use TZ_PATH when tizen version is 3.x
+#Use TZ_PATH when tizen version is 3.x or greater
 
-%if "%{tizen_version_major}" == "2"
-%define dali_data_rw_dir         /usr/share/dali/
-%define dali_data_ro_dir         /usr/share/dali/
-%define font_preloaded_path      /usr/share/fonts/
-%define font_downloaded_path     /opt/share/fonts/
-%define font_application_path    /usr/share/app_fonts/
-%define font_configuration_file  /opt/etc/fonts/conf.avail/99-slp.conf
-%else
+%if "%{tizen_version_major}" >= "3"
 %define dali_data_rw_dir         %TZ_SYS_RO_SHARE/dali/
 %define dali_data_ro_dir         %TZ_SYS_RO_SHARE/dali/
 %define font_preloaded_path      %TZ_SYS_RO_SHARE/fonts/
 %define font_downloaded_path     %TZ_SYS_SHARE/fonts/
 %define font_application_path    %TZ_SYS_RO_SHARE/app_fonts/
 %define font_configuration_file  %TZ_SYS_ETC/fonts/conf.avail/99-slp.conf
+%else
+%define dali_data_rw_dir         /usr/share/dali/
+%define dali_data_ro_dir         /usr/share/dali/
+%define font_preloaded_path      /usr/share/fonts/
+%define font_downloaded_path     /opt/share/fonts/
+%define font_application_path    /usr/share/app_fonts/
+%define font_configuration_file  /opt/etc/fonts/conf.avail/99-slp.conf
 %endif
 
 %define user_shader_cache_dir    %{dali_data_ro_dir}/core/shaderbin/
@@ -274,6 +284,9 @@ FONT_PRELOADED_PATH="%{font_preloaded_path}" ; export FONT_PRELOADED_PATH
 FONT_DOWNLOADED_PATH="%{font_downloaded_path}" ; export FONT_DOWNLOADED_PATH
 FONT_APPLICATION_PATH="%{font_application_path}"  ; export FONT_APPLICATION_PATH
 FONT_CONFIGURATION_FILE="%{font_configuration_file}" ; export FONT_CONFIGURATION_FILE
+%if 0%{?tizen_platform_config_supported}
+TIZEN_PLATFORM_CONFIG_SUPPORTED="%{tizen_platform_config_supported}" ; export TIZEN_PLATFORM_CONFIG_SUPPORTED
+%endif
 
 # Default to GLES 2.0 if not specified.
 %{!?target_gles_version: %define target_gles_version 20}
index 9bb365706fb2d18608dcf2a122d644bb4719325c..8f8481cc9177978ec463e6b4e21ba5617622ba09 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -259,13 +259,16 @@ bool HandleImageDescriptionRecordType( Bitmap& bitmap, GifFileType* gifInfo, uns
 bool HandleExtensionRecordType( GifFileType* gifInfo )
 {
   SavedImage image;
-  image.ExtensionBlocks     = NULL;
-  image.ExtensionBlockCount = 0;
   GifByteType *extensionByte( NULL );
 
 #ifdef LIBGIF_VERSION_5_1_OR_ABOVE
+  ExtensionBlock extensionBlocks;
+  image.ExtensionBlocks          = &extensionBlocks;
+  image.ExtensionBlockCount      = 1;
   int *extensionBlockTypePointer = &image.ExtensionBlocks->Function;
 #else
+  image.ExtensionBlocks     = NULL;
+  image.ExtensionBlockCount = 0;
   int *extensionBlockTypePointer = &image.Function;
 #endif
 
index 048a6f2918456739e80113a1847ef09b0f9683c0..e8fba7f2b4832af045207a9d197761fc7285ffc6 100644 (file)
@@ -93,14 +93,21 @@ PointSize26Dot6 FontClient::GetPointSize( FontId id )
   return GetImplementation(*this).GetPointSize( id );
 }
 
-FontId FontClient::FindDefaultFont( Character charcode, PointSize26Dot6 requestedPointSize, bool preferColor )
+FontId FontClient::FindDefaultFont( Character charcode,
+                                    PointSize26Dot6 requestedPointSize,
+                                    bool preferColor )
 {
-  return GetImplementation(*this).FindDefaultFont( charcode, requestedPointSize, preferColor );
+  return GetImplementation(*this).FindDefaultFont( charcode,
+                                                   requestedPointSize,
+                                                   preferColor );
 }
 
-FontId FontClient::FindFallbackFont( FontId preferredFont, Character charcode, PointSize26Dot6 requestedPointSize, bool preferColor )
+FontId FontClient::FindFallbackFont( Character charcode,
+                                     const FontDescription& preferredFontDescription,
+                                     PointSize26Dot6 requestedPointSize,
+                                     bool preferColor )
 {
-  return GetImplementation(*this).FindFallbackFont( preferredFont, charcode, requestedPointSize, preferColor );
+  return GetImplementation(*this).FindFallbackFont( charcode, preferredFontDescription, requestedPointSize, preferColor );
 }
 
 FontId FontClient::GetFontId( const FontPath& path, PointSize26Dot6 requestedPointSize, FaceIndex faceIndex )
index 326622cb68a3e8316a9c37465cefee1ba5c22fb5..885fe6c5b170f5932b24eaa5467112c111720db0 100644 (file)
@@ -132,36 +132,36 @@ public:
   /**
    * @brief Retrieve the list of default fonts supported by the system.
    *
-   * @param[out] defaultFonts A list of default font paths, family & style strings.
+   * @param[out] defaultFonts A list of default font paths, family, width, weight and slant.
    */
   void GetDefaultFonts( FontList& defaultFonts );
 
   /**
-   * @brief Retrieve the active default font from the system
+   * @brief Retrieve the active default font from the system.
    *
-   * @param[out] fontDescription font structure describing the default font
+   * @param[out] fontDescription font structure describing the default font.
    */
   void GetDefaultPlatformFontDescription( FontDescription& fontDescription );
 
   /**
    * @brief Retrieve the list of fonts supported by the system.
    *
-   * @param[out] systemFonts A list of font paths, family & style strings.
+   * @param[out] systemFonts A list of font paths, family, width, weight and slant.
    */
   void GetSystemFonts( FontList& systemFonts );
 
   /**
    * @brief Retrieves the font description of a given font @p id.
    *
-   * @param[in] id The font id.
-   * @param[out] fontDescription The path, family & style describing the font.
+   * @param[in] id The font identifier.
+   * @param[out] fontDescription The path, family & style (width, weight and slant) describing the font.
    */
   void GetDescription( FontId id, FontDescription& fontDescription );
 
   /**
    * @brief Retrieves the font point size of a given font @p id.
    *
-   * @param[in] id The font id.
+   * @param[in] id The font identifier.
    *
    * @return The point size in 26.6 fractional points.
    */
@@ -172,10 +172,12 @@ public:
    *
    * This is useful when localised strings are provided for multiple languages
    * i.e. when a single default font does not work for all languages.
+   *
    * @param[in] charcode The character for which a font is needed.
    * @param[in] requestedPointSize The point size in 26.6 fractional points; the default point size is 12*64.
-   * @param[in] preferColor True if a color font is preferred.
-   * @return A valid font ID, or zero if the font does not exist.
+   * @param[in] preferColor @e true if a color font is preferred.
+   *
+   * @return A valid font identifier, or zero if the font does not exist.
    */
   FontId FindDefaultFont( Character charcode,
                           PointSize26Dot6 requestedPointSize = DEFAULT_POINT_SIZE,
@@ -186,15 +188,17 @@ public:
    *
    * This is useful when localised strings are provided for multiple languages
    * i.e. when a single default font does not work for all languages.
-   * @param[in] preferredFont The preferred font which may not provide a glyph for charcode.
-   * The fallback-font will be the closest match to preferredFont, which does support the required glyph.
+   *
    * @param[in] charcode The character for which a font is needed.
+   * @param[in] preferredFontDescription Description of the preferred font which may not provide a glyph for @p charcode.
+   *                                     The fallback-font will be the closest match to @p preferredFontDescription, which does support the required glyph.
    * @param[in] requestedPointSize The point size in 26.6 fractional points; the default point size is 12*64.
-   * @param[in] preferColor True if a color font is preferred.
-   * @return A valid font ID, or zero if the font does not exist.
+   * @param[in] preferColor @e true if a color font is preferred.
+   *
+   * @return A valid font identifier, or zero if the font does not exist.
    */
-  FontId FindFallbackFont( FontId preferredFont,
-                           Character charcode,
+  FontId FindFallbackFont( Character charcode,
+                           const FontDescription& preferredFontDescription,
                            PointSize26Dot6 requestedPointSize = DEFAULT_POINT_SIZE,
                            bool preferColor = false );
 
@@ -204,23 +208,24 @@ public:
    * @param[in] path The path to a font file.
    * @param[in] requestedPointSize The point size in 26.6 fractional points; the default point size is 12*64.
    * @param[in] faceIndex The index of the font face (optional).
-   * @return A valid font ID, or zero if the font does not exist.
+   *
+   * @return A valid font identifier, or zero if the font does not exist.
    */
   FontId GetFontId( const FontPath& path,
                     PointSize26Dot6 requestedPointSize = DEFAULT_POINT_SIZE,
                     FaceIndex faceIndex = 0 );
 
   /**
-   * @brief Retrieve the unique identifier for a font.
+   * @brief Retrieves a unique font identifier for a given description.
    *
-   * @note It the font style is not empty, it will be used instead the font weight and font slant slant.
-   *
-   * @param[in] fontDescription A font description.
+   * @param[in] preferredFontDescription Description of the preferred font.
+   *                                     The font will be the closest match to @p preferredFontDescription.
    * @param[in] requestedPointSize The point size in 26.6 fractional points; the default point size is 12*64.
    * @param[in] faceIndex The index of the font face (optional).
-   * @return A valid font ID, or zero if the font does not exist.
+   *
+   * @return A valid font identifier, or zero if no font is found.
    */
-  FontId GetFontId( const FontDescription& fontDescription,
+  FontId GetFontId( const FontDescription& preferredFontDescription,
                     PointSize26Dot6 requestedPointSize = DEFAULT_POINT_SIZE,
                     FaceIndex faceIndex = 0 );
 
@@ -269,7 +274,7 @@ public:
   /**
    * @brief Query the metrics for a font.
    *
-   * @param[in] fontId The ID of the font for the required glyph.
+   * @param[in] fontId The identifier of the font for the required glyph.
    * @param[out] metrics The font metrics.
    */
   void GetFontMetrics( FontId fontId, FontMetrics& metrics );
@@ -277,8 +282,9 @@ public:
   /**
    * @brief Retrieve the glyph index for a UTF-32 character code.
    *
-   * @param[in] fontId The ID of the font for the required glyph.
+   * @param[in] fontId The identifier of the font for the required glyph.
    * @param[in] charcode The UTF-32 character code.
+   *
    * @return The glyph index, or zero if the character code is undefined.
    */
   GlyphIndex GetGlyphIndex( FontId fontId, Character charcode );
@@ -287,20 +293,22 @@ public:
    * @brief Retrieve the metrics for a series of glyphs.
    *
    * @param[in,out] array An array of glyph-info structures with initialized FontId & GlyphIndex values.
-   * It may contain the advance and an offset set into the bearing from the shaping tool.
-   * On return, the glyph's size value will be initialized. The bearing value will be updated by adding the font's glyph bearing to the one set by the shaping tool.
+   *                      It may contain the advance and an offset set into the bearing from the shaping tool.
+   *                      On return, the glyph's size value will be initialized. The bearing value will be updated by adding the font's glyph bearing to the one set by the shaping tool.
    * @param[in] size The size of the array.
    * @param[in] type The type of glyphs used for rendering; either bitmaps or vectors.
    * @param[in] horizontal True for horizontal layouts (set to false for vertical layouting).
-   * @return True if all of the requested metrics were found.
+   *
+   * @return @e true if all of the requested metrics were found.
    */
   bool GetGlyphMetrics( GlyphInfo* array, uint32_t size, GlyphType type, bool horizontal = true );
 
   /**
    * @brief Create a bitmap representation of a glyph.
    *
-   * @param[in] fontId The ID of the font.
+   * @param[in] fontId The identifier of the font.
    * @param[in] glyphIndex The index of a glyph within the specified font.
+   *
    * @return A valid BufferImage, or an empty handle if the glyph could not be rendered.
    */
   PixelData CreateBitmap( FontId fontId, GlyphIndex glyphIndex );
@@ -309,7 +317,7 @@ public:
    * @brief Create a vector representation of a glyph.
    *
    * @note This feature requires highp shader support and is not available on all platforms
-   * @param[in] fontId The ID of the font.
+   * @param[in] fontId The identifier of the font.
    * @param[in] glyphIndex The index of a glyph within the specified font.
    * @param[out] blob A blob of data; this is owned by FontClient and should be copied by the caller of CreateVectorData().
    * @param[out] blobLength The length of the blob data, or zero if the blob creation failed.
index 46e2438d7781473e61e39f5ff30c018d660b77ba..9170941dcf8ff48b2b7b9ffeef2066df378cbcd2 100644 (file)
@@ -39,6 +39,7 @@ namespace FontWidth
    */
   enum Type
   {
+    NONE,            ///< Means not defined. Will use what is set as default, currently NORMAL.
     ULTRA_CONDENSED,
     EXTRA_CONDENSED,
     CONDENSED,
@@ -47,7 +48,21 @@ namespace FontWidth
     SEMI_EXPANDED,
     EXPANDED,
     EXTRA_EXPANDED,
-    ULTRA_EXPANDED,
+    ULTRA_EXPANDED
+  };
+
+  const char* const Name[] =
+  {
+    "NONE",
+    "ULTRA_CONDENSED",
+    "EXTRA_CONDENSED",
+    "CONDENSED",
+    "SEMI_CONDENSED",
+    "NORMAL",
+    "SEMI_EXPANDED",
+    "EXPANDED",
+    "EXTRA_EXPANDED",
+    "ULTRA_EXPANDED"
   };
 } // namespace FontWidth
 
@@ -58,6 +73,7 @@ namespace FontWeight
    */
   enum Type
   {
+    NONE,                      ///< Means not defined. Will use what is set as default, currently NORMAL.
     THIN,
     ULTRA_LIGHT,
     EXTRA_LIGHT = ULTRA_LIGHT,
@@ -77,6 +93,22 @@ namespace FontWeight
     HEAVY = BLACK,
     EXTRA_BLACK = BLACK
   };
+
+  const char* const Name[] =
+  {
+    "NONE",
+    "THIN",
+    "ULTRA_LIGHT",
+    "LIGHT",
+    "DEMI_LIGHT",
+    "BOOK",
+    "NORMAL",
+    "MEDIUM",
+    "DEMI_BOLD",
+    "BOLD",
+    "ULTRA_BOLD",
+    "BLACK"
+  };
 }
 
 namespace FontSlant
@@ -86,11 +118,20 @@ namespace FontSlant
    */
   enum Type
   {
+    NONE,           ///< Means not defined. Will use what is set as default, currently NORMAL.
     NORMAL,
     ROMAN = NORMAL,
     ITALIC,
     OBLIQUE
   };
+
+  const char* const Name[] =
+  {
+    "NONE",
+    "NORMAL",
+    "ITALIC",
+    "OBLIQUE"
+  };
 } // namespace FontSlant
 
 struct FontDescription
@@ -98,9 +139,9 @@ struct FontDescription
   FontDescription()
   : path(),
     family(),
-    width( FontWidth::NORMAL ),
-    weight( FontWeight::NORMAL ),
-    slant( FontSlant::NORMAL )
+    width( FontWidth::NONE ),
+    weight( FontWeight::NONE ),
+    slant( FontSlant::NONE )
   {}
 
   ~FontDescription()
index 2b534f8b06eb8927d12d69f232695d84c498a5b3..265e9aa5e9c6c74d713b6f91483d1e49e8b82e0c 100644 (file)
@@ -51,24 +51,87 @@ bool IsRightToLeftScript( Script script )
 
 Script GetCharacterScript( Character character )
 {
-  // Latin script:
+  // Latin script:   It contains punctuation characters and symbols which are not part of the latin script. https://en.wikipedia.org/wiki/Latin_script_in_Unicode
   // 0x0000 - 0x007f C0 Controls and Basic Latin
+  //
+  //                 ASCII digits (not part of LATIN script):
+  //                 0x0030 - 0x0039
+  //
+  //                 ASCII punctuation and symbols (not part of LATIN script):
+  //                 0x0020 - 0x002F
+  //                 0x003A - 0x0040
+  //                 0x005B - 0x0060
+  //                 0x007B - 0x007E
+  //
+  //                 Controls (not part of LATIN script):
+  //                 0x007F
+  //
   // 0x0080 - 0x00ff C1 Controls and Latin-1 Supplement
+  //
+  //                 Controls (not part of LATIN script):
+  //                 0x0080 - 0x009F
+  //
+  //                 Punctuations and symbols (not part of LATIN script):
+  //                 0x00A0 - 0x00BF
+  //
+  //                 Mathematical operators (not part of LATIN script):
+  //                 0x00D7
+  //                 0x00F7
+  //
   // 0x0100 - 0x017f Latin Extended-A
   // 0x0180 - 0x024f Latin Extended-B
   // 0x0250 - 0x02af IPA Extensions
   // 0x02b0 - 0x02ff Spacing Modifier Letters
+  //
+  //                 Punctuation (not part of LATIN script):
+  //                 0x02B9 - 0x02BF
+  //
   // 0x1d00 - 0x1d7f Phonetic Extensions
+  //
+  //                 Uralic Phonetic (not part of LATIN script):
+  //                 0x1D26 - 0x1D2B
+  //
+  //                 Subscripts and superscripts
+  //                 0x1D5D - 0x1D61
+  //                 0x1D66 - 0x1D6A
+  //                 0x1D78
+  //
   // 0x1d80 - 0x1dbf Phonetic Extensions Supplement
+  //
+  //                 0x1DBF (subscript or superscript. Not part of LATIN script )
+  //
   // 0x1e00 - 0x1eff Latin Extended Additional
   // 0x2070 - 0x209f Superscripts and Subscripts
-  // 0x2100 - 0x214f Letterlike symbols
-  // 0x2150 - 0x218f Number Forms
+  //
+  //                 0x2070          (not part of LATIN script)
+  //                 0x2074 - 0x207E (not part of LATIN script)
+  //
+  // 0x2100 - 0x214f Letterlike symbols (not part of LATIN script)
+  //
+  //                 0x212A - 0x212B (are part of LATIN script)
+  //                 0x2132          (are part of LATIN script)
+  //                 0x214E          (are part of LATIN script)
+  //
+  // 0x2150 - 0x2189 Number Forms
+  //
+  //                 0x2150 - 0x215F Fractions (not part of LATIN script)
+  //                 0x2189          Fractions (not part of LATIN script)
+  //
   // 0x2c60 - 0x2c7f Latin Extended-C
   // 0xa720 - 0xa7ff Latin Extended-D
+  //
+  //                 0xA720 - 0xA721 Uralic Phonetic (not part of LATIN script)
+  //                 0xA788          (not part of LATIN script)
+  //                 0xA789 - 0xA78A Budu (not part of LATIN script)
+  //
   // 0xab30 - 0xab6f Latin Extended-E
+  //
   // 0xfb00 - 0xfb06 Latin Alphabetic Presentation Forms
   // 0xff00 - 0xffef Halfwidth and Fullwidth Forms
+  //
+  //                 0xFF00 - 0xFF20 HWFW Symbols (not part of LATIN script)
+  //                 0xFF3B - 0xFF40 HWFW Symbols (not part of LATIN script)
+  //                 0xFF5B - 0xFFEF HWFW Symbols (not part of LATIN script)
 
   // Brahmic scripts:
   // 0x0900 - 0x097f Devanagari
@@ -172,6 +235,19 @@ Script GetCharacterScript( Character character )
   // 6b. Additional transport and map symbols ( 1F681 - 1F6C5 )
   // 6c. Other additional symbols ( 1F30D - 1F567 )
 
+  // Symbols. Work around for these symbols.
+  // 0x25cb
+  // 0x25cf
+  // 0x25a1
+  // 0x25a0
+  // 0x2664
+  // 0x2661
+  // 0x2662
+  // 0x2667
+  // 0x2606
+  // 0x25aa
+  // 0x262a
+
   if( IsCommonScript( character ) )
   {
     return COMMON;
@@ -183,16 +259,63 @@ Script GetCharacterScript( Character character )
     {
       if( character <= 0x077f )
       {
-        if( character == 0x00A9 )
+        if( ( 0x0030 <= character ) && ( character <= 0x0039 ) )
+        {
+          return ASCII_DIGITS;
+        }
+        if( character <= 0x007E )
         {
-          return EMOJI; // 5. Uncategorized: copyright sign
+          if( ( 0x0020 <= character ) && ( character <= 0x002F ) )
+          {
+            return ASCII_PS;
+          }
+          if( ( 0x003A <= character ) && ( character <= 0x0040 ) )
+          {
+            return ASCII_PS;
+          }
+          if( ( 0x005B <= character ) && ( character <= 0x0060 ) )
+          {
+            return ASCII_PS;
+          }
+          if( ( 0x007B <= character ) && ( character <= 0x007E ) )
+          {
+            return ASCII_PS;
+          }
         }
-        if( character == 0x00AE )
+        if( ( 0x007F <= character ) && ( character <= 0x009F ) )
         {
-          return EMOJI; // 5. Uncategorized: registered sign
+          // 0x007F is actually part of C0 Controls and Basic Latin. However, is the last and only control character of its block
+          // and the following characters of the next block are consecutive.
+          return C1_CONTROLS;
+        }
+        if( ( 0x00A0 <= character ) && ( character <= 0x00BF ) )
+        {
+          if( character == 0x00A9 )
+          {
+            return EMOJI; // 5. Uncategorized: copyright sign
+          }
+          if( character == 0x00AE )
+          {
+            return EMOJI; // 5. Uncategorized: registered sign
+          }
+
+          return C1_PS;
+        }
+        if( character == 0x00D7 )
+        {
+          return C1_MATH;
+        }
+        if( character == 0x00F7 )
+        {
+          return  C1_MATH;
         }
         if( character <= 0x02ff )
         {
+          if( ( 0x02B9 <= character ) && ( character <= 0x02BF ) )
+          {
+            return SML_P;
+          }
+
           return LATIN;
         }
         if( ( 0x0370 <= character ) && ( character <= 0x03ff ) )
@@ -318,6 +441,27 @@ Script GetCharacterScript( Character character )
         }
         if( ( 0x1d00 <= character ) && ( character <= 0x1eff ) )
         {
+          if( ( 0x1D26 <= character ) && ( character <= 0x1D2B ) )
+          {
+            return PHONETIC_U;
+          }
+          if( ( 0x1D5D <= character ) && ( character <= 0x1D61 ) )
+          {
+            return PHONETIC_SS;
+          }
+          if( ( 0x1D66 <= character ) && ( character <= 0x1D6A ) )
+          {
+            return PHONETIC_SS;
+          }
+          if( character == 0x1D78 )
+          {
+            return PHONETIC_SS;
+          }
+          if( character == 0x1DBF)
+          {
+            return PHONETIC_SS;
+          }
+
           return LATIN;
         }
       }
@@ -337,6 +481,15 @@ Script GetCharacterScript( Character character )
         }
         if( ( 0x2070 <= character ) && ( character <= 0x209f ) )
         {
+          if( character == 0x2070 )
+          {
+            return NUMERIC_SS;
+          }
+          if( ( 0x2074 <= character ) && ( character <= 0x207E ) )
+          {
+            return NUMERIC_SS;
+          }
+
           return LATIN;
         }
         if( character == 0x20e3 )
@@ -351,10 +504,69 @@ Script GetCharacterScript( Character character )
         {
           return EMOJI; // 5. Uncategorized: information source
         }
-        if( ( 0x2100 <= character ) && ( character <= 0x218f ) )
-        {
+        if( ( 0x2100 <= character ) && ( character <= 0x2189 ) )
+        {
+          if( ( 0x2100 <= character ) && ( character <= 0x214f ) )
+          {
+            if( ( 0x212A <= character ) && ( character <= 0x212B ) )
+            {
+              return LATIN;
+            }
+            if( character == 0x2132 )
+            {
+              return LATIN;
+            }
+            if( character == 0x214E )
+            {
+              return LATIN;
+            }
+
+            return LETTER_LIKE;
+          }
+          if( ( 0x2150 <= character ) && ( character <= 0x215F ) )
+          {
+            return FRACTIONS_NF;
+          }
+          if( character == 0x2189 )
+          {
+            return FRACTIONS_NF;
+          }
+
           return LATIN;
         }
+
+        // Symbols
+        if( ( 0x25cb == character ) ||
+            ( 0x25cf == character ) ||
+            ( 0x25a1 == character ) )
+        {
+          return SYMBOLS1;
+        }
+
+        if( 0x25a0 == character )
+        {
+          return SYMBOLS2;
+        }
+
+        if( ( 0x2664 == character ) ||
+            ( 0x2661 == character ) ||
+            ( 0x2662 == character ) ||
+            ( 0x2667 == character ) )
+        {
+          return SYMBOLS3;
+        }
+
+        if( ( 0x2606 == character ) ||
+            ( 0x25aa == character ) )
+        {
+          return SYMBOLS4;
+        }
+
+        if( 0x262a == character )
+        {
+          return SYMBOLS5;
+        }
+
         // U+2194 5. Uncategorized: left right arrow
         // U+2B55 5. Uncategorized: heavy large circle
         if( ( 0x2194 <= character ) && ( character <= 0x2B55 ) )
@@ -441,6 +653,27 @@ Script GetCharacterScript( Character character )
         }
         if( ( 0xa720 <= character ) && ( character <= 0xa7ff ) )
         {
+          if( character == 0xA720 )
+          {
+            return PHONETIC_U;
+          }
+          if( character == 0xA721 )
+          {
+            return PHONETIC_U;
+          }
+          if( character == 0xA788 )
+          {
+            return NON_LATIN_LED;
+          }
+          if( character == 0xA789 )
+          {
+            return NON_LATIN_LED;
+          }
+          if( character == 0xA78A )
+          {
+            return NON_LATIN_LED;
+          }
+
           return LATIN;
         }
         if( ( 0xa960 <= character ) && ( character <= 0xa97f ) )
@@ -484,6 +717,19 @@ Script GetCharacterScript( Character character )
         }
         if( ( 0xff00 <= character ) && ( character <= 0xffef ) )
         {
+          if( ( 0xFF00 <= character ) && ( character <= 0xFF20 ) )
+          {
+            return HWFW_S;
+          }
+          if( ( 0xFF3B <= character ) && ( character <= 0xFF40 ) )
+          {
+            return HWFW_S;
+          }
+          if( ( 0xFF5B <= character ) && ( character <= 0xFFEF ) )
+          {
+            return HWFW_S;
+          }
+
           return LATIN;
         }
         if( ( 0x1ee00 <= character ) && ( character <= 0x1eeff ) )
index ee08ab2cd7834181d65f3205f7b02691e6ffae9c..753563e152fbdf96f39b2fed28a9b38142c24cbf 100644 (file)
@@ -36,84 +36,134 @@ namespace TextAbstraction
  */
 enum Script
 {
-  COMMON,     ///< Valid for all scripts. i.e white space or '\n'.
-
-  CYRILLIC,   ///< The Cyrillic script. Used by Russian, Bulgarian, Ukrainian, Macedonian, ...
-  GREEK,      ///< The Greek script. Used by Greek.
-  LATIN,      ///< The latin script. Used by many western languages and others around the world.
-
-  ARABIC,     ///< The arabic script. Used by Arab and Urdu among others.
-  HEBREW,     ///< The Hebrew script. Used by the Hebrew, Yiddish, Ladino, and Judeo-Arabic.
-
-  ARMENIAN,   ///< The Armenian script. Used by Armenian.
-  GEORGIAN,   ///< The Georgian script. Used by Georgian.
-
-  CJK,        ///< The CJK script. Used by Chinese, Japanese, Korean and Vietnamese(old writing system).
-  HANGUL,     ///< The Hangul jamo script. Used by Korean.
-  HIRAGANA,   ///< The Hiragana script. Used by the Japanese.
-  KATAKANA,   ///< The Katakana script. Used by the Japanese.
-  BOPOMOFO,   ///< The Bopomofo script. Also called Zhuyin fuhao or Zhuyin. A phonetic notation used for the transcription of spoken Chinese.
-
-  BENGALI,    ///< The Bengali script. Used by Bangla, Assamese, Bishnupriya Manipuri, Daphla, Garo, Hallam, Khasi, Mizo, Munda, Naga, Rian, and Santali.
-  BURMESE,    ///< The Burmese script. Used by the Burmese (Myanmar) language.
-  DEVANAGARI, ///< The devanagari script. Used by Hindi, Marathi, Sindhi, Nepali and Sanskrit.
-  GUJARATI,   ///< The Gujarati script. Used by Gujarati.
-  GURMUKHI,   ///< The Gurmukhi script. Used by Punjabi.
-  KANNADA,    ///< The Kannada script. Used by Kannada and Tulu.
-  MALAYALAM,  ///< The Malayalam script. Used by Malayalam.
-  ORIYA,      ///< The Oriya script. Used by Oriya (Odia), Khondi, and Santali.
-  SINHALA,    ///< The Sinhala script. Used by Sinhala and Pali.
-  TAMIL,      ///< The Tamil script. Used by Tamil, Badaga, and Saurashtra.
-  TELUGU,     ///< The Telugu script. Used by Telugu, Gondi, and Lambadi.
-
-  LAO,        ///< The Lao script. Used by the Lao language.
-  THAI,       ///< The Thai script. Used by the Thai language
-  KHMER,      ///< The Khmer script. Used by the Khmer language.
-
-  EMOJI,      ///< The Emoji which map to standardized Unicode characters.
-
-  UNKNOWN     ///< The script is unknown.
+  COMMON,        ///< Valid for all scripts. i.e white space or '\n'.
+
+  ASCII_DIGITS,  ///< ASCII digits.
+  ASCII_PS,      ///< ASCII punctuation and symbols.
+
+  C1_CONTROLS,   ///< Controls of the C1 Controls and Latin-1 Supplement unicode block.
+  C1_PS,         ///< Punctuation and symbols of the C1 Controls and Latin-1 Supplement unicode block.
+  C1_MATH,       ///< Math symbols of the C1 Controls and Latin-1 Supplement unicode block.
+
+  SML_P,         ///< Punctuation symbols of the Spacing Modifier Letters unicode block.
+  PHONETIC_U,    ///< Uralic phonetic symbols of the Phonetic Extensions unicode block.
+  PHONETIC_SS,   ///< Subscripts and superscripts of the Phonetic Extensions unicode block.
+
+  NUMERIC_SS,    ///< Numeric subscripts and superscripts.
+
+  LETTER_LIKE,   ///< Symbols of the Letterlike unicode block.
+  NUMBER_FORMS,  ///< Number Forms unicode block.
+  FRACTIONS_NF,  ///< Numeric fraction symbols of the Number Forms unicode block.
+  NON_LATIN_LED, ///< Non latin symbols within the Latin Extended D unicode block.
+  HWFW_S,        ///< Non latin symbols within the Halfwidth and fullwidth unicode block.
+
+  CYRILLIC,      ///< The Cyrillic script. Used by Russian, Bulgarian, Ukrainian, Macedonian, ...
+  GREEK,         ///< The Greek script. Used by Greek.
+  LATIN,         ///< The latin script. Used by many western languages and others around the world.
+
+  ARABIC,        ///< The arabic script. Used by Arab and Urdu among others.
+  HEBREW,        ///< The Hebrew script. Used by the Hebrew, Yiddish, Ladino, and Judeo-Arabic.
+
+  ARMENIAN,      ///< The Armenian script. Used by Armenian.
+  GEORGIAN,      ///< The Georgian script. Used by Georgian.
+
+  CJK,           ///< The CJK script. Used by Chinese, Japanese, Korean and Vietnamese(old writing system).
+  HANGUL,        ///< The Hangul jamo script. Used by Korean.
+  HIRAGANA,      ///< The Hiragana script. Used by the Japanese.
+  KATAKANA,      ///< The Katakana script. Used by the Japanese.
+  BOPOMOFO,      ///< The Bopomofo script. Also called Zhuyin fuhao or Zhuyin. A phonetic notation used for the transcription of spoken Chinese.
+
+  BENGALI,       ///< The Bengali script. Used by Bangla, Assamese, Bishnupriya Manipuri, Daphla, Garo, Hallam, Khasi, Mizo, Munda, Naga, Rian, and Santali.
+  BURMESE,       ///< The Burmese script. Used by the Burmese (Myanmar) language.
+  DEVANAGARI,    ///< The devanagari script. Used by Hindi, Marathi, Sindhi, Nepali and Sanskrit.
+  GUJARATI,      ///< The Gujarati script. Used by Gujarati.
+  GURMUKHI,      ///< The Gurmukhi script. Used by Punjabi.
+  KANNADA,       ///< The Kannada script. Used by Kannada and Tulu.
+  MALAYALAM,     ///< The Malayalam script. Used by Malayalam.
+  ORIYA,         ///< The Oriya script. Used by Oriya (Odia), Khondi, and Santali.
+  SINHALA,       ///< The Sinhala script. Used by Sinhala and Pali.
+  TAMIL,         ///< The Tamil script. Used by Tamil, Badaga, and Saurashtra.
+  TELUGU,        ///< The Telugu script. Used by Telugu, Gondi, and Lambadi.
+
+  LAO,           ///< The Lao script. Used by the Lao language.
+  THAI,          ///< The Thai script. Used by the Thai language
+  KHMER,         ///< The Khmer script. Used by the Khmer language.
+
+  EMOJI,         ///< The Emoji which map to standardized Unicode characters.
+
+  SYMBOLS1,      ///< Some symbols.
+  SYMBOLS2,      ///< Some symbols.
+  SYMBOLS3,      ///< Some symbols.
+  SYMBOLS4,      ///< Some symbols.
+  SYMBOLS5,      ///< Some symbols.
+
+  UNKNOWN        ///< The script is unknown.
 };
 
 const char* const ScriptName[] =
 {
-  "COMMON",     ///< Valid for all scripts. i.e white space or '\n'.
-
-  "CYRILLIC",   ///< The Cyrillic script. Used by Russian, Bulgarian, Ukrainian, Macedonian, ...
-  "GREEK",      ///< The Greek script. Used by Greek.
-  "LATIN",      ///< The latin script. Used by many western languages and others around the world.
-
-  "ARABIC",     ///< The arabic script. Used by Arab and Urdu among others.
-  "HEBREW",     ///< The Hebrew script. Used by the Hebrew, Yiddish, Ladino, and Judeo-Arabic.
-
-  "ARMENIAN",   ///< The Armenian script. Used by Armenian.
-  "GEORGIAN",   ///< The Georgian script. Used by Georgian.
-
-  "CJK",        ///< The CJK script. Used by Chinese, Japanese, Korean and Vietnamese(old writing system).
-  "HANGUL",     ///< The Hangul jamo script. Used by Korean.
-  "HIRAGANA",   ///< The Hiragana script. Used by the Japanese.
-  "KATAKANA",   ///< The Katakana script. Used by the Japanese.
-  "BOPOMOFO",   ///< The Bopomofo script. Also called Zhuyin fuhao or Zhuyin. A phonetic notation used for the transcription of spoken Chinese.
-
-  "BENGALI",    ///< The Bengali script. Used by Bangla, Assamese, Bishnupriya Manipuri, Daphla, Garo, Hallam, Khasi, Mizo, Munda, Naga, Rian, and Santali.
-  "BURMESE",    ///< The Burmese script. Used by the Burmese (Myanmar) language.
-  "DEVANAGARI", ///< The devanagari script. Used by Hindi, Marathi, Sindhi, Nepali and Sanskrit.
-  "GUJARATI",   ///< The Gujarati script. Used by Gujarati.
-  "GURMUKHI",   ///< The Gurmukhi script. Used by Punjabi.
-  "KANNADA",    ///< The Kannada script. Used by Kannada and Tulu.
-  "MALAYALAM",  ///< The Malayalam script. Used by Malayalam.
-  "ORIYA",      ///< The Oriya script. Used by Oriya (Odia), Khondi, and Santali.
-  "SINHALA",    ///< The Sinhala script. Used by Sinhala and Pali.
-  "TAMIL",      ///< The Tamil script. Used by Tamil, Badaga, and Saurashtra.
-  "TELUGU",     ///< The Telugu script. Used by Telugu, Gondi, and Lambadi.
-
-  "LAO",        ///< The Lao script. Used by the Lao language.
-  "THAI",       ///< The Thai script. Used by the Thai language
-  "KHMER",      ///< The Khmer script. Used by the Khmer language.
-
-  "EMOJI",      ///< The Emoji which map to standardized Unicode characters.
-
-  "UNKNOWN"     ///< The script is unknown.
+  "COMMON",        ///< Valid for all scripts. i.e white space or '\n'.
+
+  "ASCII_DIGITS",  ///< ASCII digits.
+  "ASCII_PS",      ///< ASCII punctuation and symbols.
+
+  "C1_CONTROLS",   ///< Controls of the C1 Controls and Latin-1 Supplement unicode block.
+  "C1_PS",         ///< Punctuation and symbols of the C1 Controls and Latin-1 Supplement unicode block.
+  "C1_MATH",       ///< Math symbols of the C1 Controls and Latin-1 Supplement unicode block.
+
+  "SML_P",         ///< Punctuation symbols of the Spacing Modifier Letters unicode block.
+  "PHONETIC_U",    ///< Uralic phonetic symbols of the Phonetic Extensions unicode block.
+  "PHONETIC_SS",   ///< Subscripts and superscripts of the Phonetic Extensions unicode block.
+
+  "NUMERIC_SS",    ///< Numeric subscripts and superscripts.
+
+  "LETTER_LIKE",   ///< Symbols of the Letterlike unicode block.
+  "NUMBER_FORMS",  ///< Number Forms unicode block.
+  "FRACTIONS_NF",  ///< Numeric fraction symbols of the Number Forms unicode block.
+  "NON_LATIN_LED", ///< Non latin symbols within the Latin Extended D unicode block.
+  "HWFW_S",        ///< Non latin symbols within the Halfwidth and fullwidth unicode block.
+
+  "CYRILLIC",      ///< The Cyrillic script. Used by Russian, Bulgarian, Ukrainian, Macedonian, ...
+  "GREEK",         ///< The Greek script. Used by Greek.
+  "LATIN",         ///< The latin script. Used by many western languages and others around the world.
+
+  "ARABIC",        ///< The arabic script. Used by Arab and Urdu among others.
+  "HEBREW",        ///< The Hebrew script. Used by the Hebrew, Yiddish, Ladino, and Judeo-Arabic.
+
+  "ARMENIAN",      ///< The Armenian script. Used by Armenian.
+  "GEORGIAN",      ///< The Georgian script. Used by Georgian.
+
+  "CJK",           ///< The CJK script. Used by Chinese, Japanese, Korean and Vietnamese(old writing system).
+  "HANGUL",        ///< The Hangul jamo script. Used by Korean.
+  "HIRAGANA",      ///< The Hiragana script. Used by the Japanese.
+  "KATAKANA",      ///< The Katakana script. Used by the Japanese.
+  "BOPOMOFO",      ///< The Bopomofo script. Also called Zhuyin fuhao or Zhuyin. A phonetic notation used for the transcription of spoken Chinese.
+
+  "BENGALI",       ///< The Bengali script. Used by Bangla, Assamese, Bishnupriya Manipuri, Daphla, Garo, Hallam, Khasi, Mizo, Munda, Naga, Rian, and Santali.
+  "BURMESE",       ///< The Burmese script. Used by the Burmese (Myanmar) language.
+  "DEVANAGARI",    ///< The devanagari script. Used by Hindi, Marathi, Sindhi, Nepali and Sanskrit.
+  "GUJARATI",      ///< The Gujarati script. Used by Gujarati.
+  "GURMUKHI",      ///< The Gurmukhi script. Used by Punjabi.
+  "KANNADA",       ///< The Kannada script. Used by Kannada and Tulu.
+  "MALAYALAM",     ///< The Malayalam script. Used by Malayalam.
+  "ORIYA",         ///< The Oriya script. Used by Oriya (Odia), Khondi, and Santali.
+  "SINHALA",       ///< The Sinhala script. Used by Sinhala and Pali.
+  "TAMIL",         ///< The Tamil script. Used by Tamil, Badaga, and Saurashtra.
+  "TELUGU",        ///< The Telugu script. Used by Telugu, Gondi, and Lambadi.
+
+  "LAO",           ///< The Lao script. Used by the Lao language.
+  "THAI",          ///< The Thai script. Used by the Thai language
+  "KHMER",         ///< The Khmer script. Used by the Khmer language.
+
+  "EMOJI",         ///< The Emoji which map to standardized Unicode characters.
+
+  "SYMBOLS1",      ///< Some symbols.
+  "SYMBOLS2",      ///< Some symbols.
+  "SYMBOLS3",      ///< Some symbols.
+  "SYMBOLS4",      ///< Some symbols.
+  "SYMBOLS5",      ///< Some symbols.
+
+  "UNKNOWN"        ///< The script is unknown.
 };
 
 /**
index d7e3e16422e5abc3c5a32b4f531f7c0daca161f2..d84e4ded2ed9d0da9ccf1d2cc7d5798138a356d2 100644 (file)
@@ -42,8 +42,13 @@ int ValueToIndex( int value, const int* const table, unsigned int maxIndex )
 {
   DALI_LOG_INFO( gLogFilter, Debug::Verbose, "-->FontClient::Plugin::ValueToIndex value(%d)\n", value);
 
-  if( ( NULL == table ) ||
-      ( value <= table[0] ) )
+  if( NULL == table )
+  {
+    // Return an invalid index if there is no table.
+    return -1;
+  }
+
+  if( value <= table[0] )
   {
     return 0;
   }
@@ -53,14 +58,14 @@ int ValueToIndex( int value, const int* const table, unsigned int maxIndex )
     return maxIndex;
   }
 
-  for( unsigned int index = 0u; index < maxIndex; )
+  for( unsigned int index = 0u; index < maxIndex; ++index )
   {
     const int v1 = table[index];
-    const unsigned int indexPlus = ++index;
+    const unsigned int indexPlus = index + 1u;
     const int v2 = table[indexPlus];
     if( ( v1 < value ) && ( value <= v2 ) )
     {
-      const int result = ( ( value - v1 ) < ( v2 - value ) ) ? index : indexPlus;
+      const int result = ( ( v1 > 0 ) && ( ( value - v1 ) < ( v2 - value ) ) ) ? index : indexPlus;
       DALI_LOG_INFO( gLogFilter, Debug::Verbose, "FontClient::Plugin::ValueToIndex result(%d)\n",  result );
       return result;
     }
index 42a2a8ad03db07d1f4991b9ca5aae7ad1d945c2b..040c557bee0588998120a01049d6f44f6af9aa20 100644 (file)
@@ -128,18 +128,28 @@ void FontClient::GetSystemFonts( FontList& systemFonts )
   mPlugin->GetSystemFonts( systemFonts );
 }
 
-FontId FontClient::FindDefaultFont( Character charcode, PointSize26Dot6 requestedPointSize, bool preferColor )
+FontId FontClient::FindDefaultFont( Character charcode,
+                                    PointSize26Dot6 requestedPointSize,
+                                    bool preferColor )
 {
   CreatePlugin();
 
-  return mPlugin->FindDefaultFont( charcode, requestedPointSize, preferColor );
+  return mPlugin->FindDefaultFont( charcode,
+                                   requestedPointSize,
+                                   preferColor );
 }
 
-FontId FontClient::FindFallbackFont( FontId preferredFont, Character charcode, PointSize26Dot6 requestedPointSize, bool preferColor )
+FontId FontClient::FindFallbackFont( Character charcode,
+                                     const FontDescription& preferredFontDescription,
+                                     PointSize26Dot6 requestedPointSize,
+                                     bool preferColor )
 {
   CreatePlugin();
 
-  return mPlugin->FindFallbackFont( preferredFont, charcode, requestedPointSize, preferColor );
+  return mPlugin->FindFallbackFont( charcode,
+                                    preferredFontDescription,
+                                    requestedPointSize,
+                                    preferColor );
 }
 
 bool FontClient::IsScalable( const FontPath& path )
index 783147cccab1d46f731af3df7ed50377899690ca..555fca861a34d37995be26dca04fd60be7d176a2 100644 (file)
@@ -98,12 +98,17 @@ public:
   /**
    * @copydoc Dali::FontClient::FindDefaultFont()
    */
-  FontId FindDefaultFont( Character charcode, PointSize26Dot6 requestedPointSize, bool preferColor );
+  FontId FindDefaultFont( Character charcode,
+                          PointSize26Dot6 requestedPointSize,
+                          bool preferColor );
 
   /**
    * @copydoc Dali::FontClient::FindFallbackFont()
    */
-  FontId FindFallbackFont( FontId preferredFont, Character charcode, PointSize26Dot6 requestedPointSize, bool preferColor );
+  FontId FindFallbackFont( Character charcode,
+                           const FontDescription& preferredFontDescription,
+                           PointSize26Dot6 requestedPointSize,
+                           bool preferColor );
 
   /**
    * @copydoc Dali::FontClient::GetFontId( const FontPath& path, PointSize26Dot6 requestedPointSize, FaceIndex faceIndex )
index feaec05466ba5e765481f6672bbd7251027aceee..56e297cebd0814501530075ce524d6e50b83b2fa 100644 (file)
@@ -55,6 +55,7 @@ const bool FONT_FIXED_SIZE_BITMAP( true );
 
 // http://www.freedesktop.org/software/fontconfig/fontconfig-user.html
 
+// NONE            -1  --> DEFAULT_FONT_WIDTH (NORMAL) will be used.
 // ULTRA_CONDENSED 50
 // EXTRA_CONDENSED 63
 // CONDENSED       75
@@ -64,9 +65,10 @@ const bool FONT_FIXED_SIZE_BITMAP( true );
 // EXPANDED       125
 // EXTRA_EXPANDED 150
 // ULTRA_EXPANDED 200
-const int FONT_WIDTH_TYPE_TO_INT[] = { 50, 63, 75, 87, 100, 113, 125, 150, 200 };
+const int FONT_WIDTH_TYPE_TO_INT[] = { -1, 50, 63, 75, 87, 100, 113, 125, 150, 200 };
 const unsigned int NUM_FONT_WIDTH_TYPE = sizeof( FONT_WIDTH_TYPE_TO_INT ) / sizeof( int );
 
+// NONE                       -1  --> DEFAULT_FONT_WEIGHT (NORMAL) will be used.
 // THIN                        0
 // ULTRA_LIGHT, EXTRA_LIGHT   40
 // LIGHT                      50
@@ -78,13 +80,14 @@ const unsigned int NUM_FONT_WIDTH_TYPE = sizeof( FONT_WIDTH_TYPE_TO_INT ) / size
 // BOLD                      200
 // ULTRA_BOLD, EXTRA_BOLD    205
 // BLACK, HEAVY, EXTRA_BLACK 210
-const int FONT_WEIGHT_TYPE_TO_INT[] = { 0, 40, 50, 55, 75, 80, 100, 180, 200, 205, 210 };
+const int FONT_WEIGHT_TYPE_TO_INT[] = { -1, 0, 40, 50, 55, 75, 80, 100, 180, 200, 205, 210 };
 const unsigned int NUM_FONT_WEIGHT_TYPE = sizeof( FONT_WEIGHT_TYPE_TO_INT ) / sizeof( int );
 
-// NORMAL, ROMAN   0
-// ITALIC        100
-// OBLIQUE       110
-const int FONT_SLANT_TYPE_TO_INT[] = { 0, 100, 110 };
+// NONE             -1 --> DEFAULT_FONT_SLANT (NORMAL) will be used.
+// NORMAL, ROMAN     0
+// ITALIC          100
+// OBLIQUE         110
+const int FONT_SLANT_TYPE_TO_INT[] = { -1, 0, 100, 110 };
 const unsigned int NUM_FONT_SLANT_TYPE = sizeof( FONT_SLANT_TYPE_TO_INT ) / sizeof( int );
 
 } // namespace
@@ -158,11 +161,11 @@ FontClient::Plugin::FontIdCacheItem::FontIdCacheItem( FontDescriptionId validate
 {
 }
 
-FontClient::Plugin::CacheItem::CacheItem( FT_Face ftFace,
-                                          const FontPath& path,
-                                          PointSize26Dot6 requestedPointSize,
-                                          FaceIndex face,
-                                          const FontMetrics& metrics )
+FontClient::Plugin::FontFaceCacheItem::FontFaceCacheItem( FT_Face ftFace,
+                                                          const FontPath& path,
+                                                          PointSize26Dot6 requestedPointSize,
+                                                          FaceIndex face,
+                                                          const FontMetrics& metrics )
 : mFreeTypeFace( ftFace ),
   mPath( path ),
   mRequestedPointSize( requestedPointSize ),
@@ -175,13 +178,13 @@ FontClient::Plugin::CacheItem::CacheItem( FT_Face ftFace,
 {
 }
 
-FontClient::Plugin::CacheItem::CacheItem( FT_Face ftFace,
-                                          const FontPath& path,
-                                          PointSize26Dot6 requestedPointSize,
-                                          FaceIndex face,
-                                          const FontMetrics& metrics,
-                                          float fixedWidth,
-                                          float fixedHeight )
+FontClient::Plugin::FontFaceCacheItem::FontFaceCacheItem( FT_Face ftFace,
+                                                          const FontPath& path,
+                                                          PointSize26Dot6 requestedPointSize,
+                                                          FaceIndex face,
+                                                          const FontMetrics& metrics,
+                                                          float fixedWidth,
+                                                          float fixedHeight )
 : mFreeTypeFace( ftFace ),
   mPath( path ),
   mRequestedPointSize( requestedPointSize ),
@@ -408,12 +411,11 @@ FontId FontClient::Plugin::FindFontForCharacter( const FontList& fontList,
 {
   DALI_LOG_INFO( gLogFilter, Debug::Verbose, "FontClient::Plugin::FindFontForCharacter\n");
 
-  FontId fontId(0);
-  bool foundColor(false);
+  FontId fontId = 0u;
+  bool foundColor = false;
 
   // Traverse the list of fonts.
-  // Check for each default font if supports the character.
-
+  // Check for each font if supports the character.
   for( FontList::const_iterator it = fontList.begin(), endIt = fontList.end();
        it != endIt;
        ++it )
@@ -467,7 +469,7 @@ FontId FontClient::Plugin::FindFontForCharacter( const FontList& fontList,
         }
       }
 
-      // Keep going unless we prefer a different (color) font
+      // Keep going unless we prefer a different (color) font.
       if( !preferColor || foundColor )
       {
         FcPatternDestroy( match );
@@ -499,6 +501,7 @@ FontId FontClient::Plugin::FindDefaultFont( Character charcode,
     fontDescription.width = IntToWidthType( DEFAULT_FONT_WIDTH );
     fontDescription.weight = IntToWeightType( DEFAULT_FONT_WEIGHT );
     fontDescription.slant = IntToSlantType( DEFAULT_FONT_SLANT );
+
     SetFontList( fontDescription, mDefaultFonts );
   }
 
@@ -509,8 +512,8 @@ FontId FontClient::Plugin::FindDefaultFont( Character charcode,
   return fontId;
 }
 
-FontId FontClient::Plugin::FindFallbackFont( FontId preferredFont,
-                                             Character charcode,
+FontId FontClient::Plugin::FindFallbackFont( Character charcode,
+                                             const FontDescription& preferredFontDescription,
                                              PointSize26Dot6 requestedPointSize,
                                              bool preferColor )
 {
@@ -518,7 +521,12 @@ FontId FontClient::Plugin::FindFallbackFont( FontId preferredFont,
   FontId fontId = 0u;
 
   FontDescription fontDescription;
-  GetDescription( preferredFont, fontDescription );
+
+  // Fill the font description with the preferred font description and complete with the defaults.
+  fontDescription.family = preferredFontDescription.family.empty() ? DEFAULT_FONT_FAMILY_NAME : preferredFontDescription.family;
+  fontDescription.weight = ( ( FontWeight::NONE == preferredFontDescription.weight ) ? IntToWeightType( DEFAULT_FONT_WEIGHT ) : preferredFontDescription.weight );
+  fontDescription.width = ( ( FontWidth::NONE == preferredFontDescription.width ) ? IntToWidthType( DEFAULT_FONT_WIDTH ) : preferredFontDescription.width );
+  fontDescription.slant = ( ( FontSlant::NONE == preferredFontDescription.slant ) ? IntToSlantType( DEFAULT_FONT_SLANT ) : preferredFontDescription.slant );
 
   // Check first if the font's description has been queried before.
   FontList* fontList( NULL );
@@ -529,7 +537,7 @@ FontId FontClient::Plugin::FindFallbackFont( FontId preferredFont,
     SetFontList( fontDescription, *fontList );
 
     // Add the font-list to the cache.
-    mFallbackCache.push_back( FallbackCacheItem(fontDescription, fontList) );
+    mFallbackCache.push_back( FallbackCacheItem( fontDescription, fontList ) );
   }
 
   if( fontList )
@@ -683,7 +691,7 @@ void FontClient::Plugin::GetFontMetrics( FontId fontId,
   if( ( fontId > 0 ) &&
       ( fontId - 1u < mFontCache.size() ) )
   {
-    const CacheItem& font = mFontCache[fontId-1];
+    const FontFaceCacheItem& font = mFontCache[fontId-1];
 
     metrics = font.mMetrics;
 
@@ -754,7 +762,7 @@ bool FontClient::Plugin::GetBitmapMetrics( GlyphInfo* array,
     if( fontId > 0 &&
         fontId-1 < mFontCache.size() )
     {
-      const CacheItem& font = mFontCache[fontId-1];
+      const FontFaceCacheItem& font = mFontCache[fontId-1];
 
       FT_Face ftFace = font.mFreeTypeFace;
 
@@ -842,7 +850,7 @@ bool FontClient::Plugin::GetVectorMetrics( GlyphInfo* array,
     if( fontId > 0 &&
         fontId-1 < mFontCache.size() )
     {
-      CacheItem& font = mFontCache[fontId-1];
+      FontFaceCacheItem& font = mFontCache[fontId-1];
 
       if( ! font.mVectorFontId )
       {
@@ -942,7 +950,7 @@ void FontClient::Plugin::CreateVectorBlob( FontId fontId, GlyphIndex glyphIndex,
   if( fontId > 0 &&
       fontId-1 < mFontCache.size() )
   {
-    CacheItem& font = mFontCache[fontId-1];
+    FontFaceCacheItem& font = mFontCache[fontId-1];
 
     if( ! font.mVectorFontId )
     {
@@ -1056,6 +1064,7 @@ bool FontClient::Plugin::MatchFontDescriptionToPattern( FcPattern* pattern, Dali
     fontDescription.width = IntToWidthType( width );
     fontDescription.weight = IntToWeightType( weight );
     fontDescription.slant = IntToSlantType( slant );
+
     // destroyed the matched pattern
     FcPatternDestroy( match );
     ret = true;
@@ -1073,9 +1082,30 @@ FcPattern* FontClient::Plugin::CreateFontFamilyPattern( const FontDescription& f
   // add a property to the pattern for the font family
   FcPatternAddString( fontFamilyPattern, FC_FAMILY, reinterpret_cast<const FcChar8*>( fontDescription.family.c_str() ) );
 
-  FcPatternAddInteger( fontFamilyPattern, FC_WIDTH, FONT_WIDTH_TYPE_TO_INT[fontDescription.width] );
-  FcPatternAddInteger( fontFamilyPattern, FC_WEIGHT, FONT_WEIGHT_TYPE_TO_INT[fontDescription.weight] );
-  FcPatternAddInteger( fontFamilyPattern, FC_SLANT, FONT_SLANT_TYPE_TO_INT[fontDescription.slant] );
+  int width = FONT_WIDTH_TYPE_TO_INT[fontDescription.width];
+  if( width < 0 )
+  {
+    // Use default.
+    width = DEFAULT_FONT_WIDTH;
+  }
+
+  int weight = FONT_WEIGHT_TYPE_TO_INT[fontDescription.weight];
+  if( weight < 0 )
+  {
+    // Use default.
+    weight = DEFAULT_FONT_WEIGHT;
+  }
+
+  int slant = FONT_SLANT_TYPE_TO_INT[fontDescription.slant];
+  if( slant < 0 )
+  {
+    // Use default.
+    slant = DEFAULT_FONT_SLANT;
+  }
+
+  FcPatternAddInteger( fontFamilyPattern, FC_WIDTH, width );
+  FcPatternAddInteger( fontFamilyPattern, FC_WEIGHT, weight );
+  FcPatternAddInteger( fontFamilyPattern, FC_SLANT, slant );
 
   // Add a property of the pattern, to say we want to match TrueType fonts
   FcPatternAddString( fontFamilyPattern , FC_FONTFORMAT, reinterpret_cast<const FcChar8*>( FONT_FORMAT.c_str() ) );
@@ -1197,7 +1227,7 @@ FontId FontClient::Plugin::CreateFont( const FontPath& path,
                                  0.0f,
                                  0.0f );
 
-            mFontCache.push_back( CacheItem( ftFace, path, requestedPointSize, faceIndex, metrics, fixedWidth, fixedHeight ) );
+            mFontCache.push_back( FontFaceCacheItem( ftFace, path, requestedPointSize, faceIndex, metrics, fixedWidth, fixedHeight ) );
             id = mFontCache.size();
 
             if( cacheDescription )
@@ -1242,7 +1272,7 @@ FontId FontClient::Plugin::CreateFont( const FontPath& path,
                              static_cast< float >( ftFace->underline_position ) * FROM_266,
                              static_cast< float >( ftFace->underline_thickness ) * FROM_266 );
 
-        mFontCache.push_back( CacheItem( ftFace, path, requestedPointSize, faceIndex, metrics ) );
+        mFontCache.push_back( FontFaceCacheItem( ftFace, path, requestedPointSize, faceIndex, metrics ) );
         id = mFontCache.size();
 
         if( cacheDescription )
@@ -1311,12 +1341,12 @@ bool FontClient::Plugin::FindFont( const FontPath& path,
                                    FontId& fontId ) const
 {
   fontId = 0u;
-  for( std::vector<CacheItem>::const_iterator it = mFontCache.begin(),
+  for( std::vector<FontFaceCacheItem>::const_iterator it = mFontCache.begin(),
          endIt = mFontCache.end();
        it != endIt;
        ++it, ++fontId )
   {
-    const CacheItem& cacheItem = *it;
+    const FontFaceCacheItem& cacheItem = *it;
 
     if( cacheItem.mRequestedPointSize == requestedPointSize &&
         cacheItem.mFaceIndex == faceIndex &&
@@ -1524,9 +1554,9 @@ void FontClient::Plugin::CacheFontPath( FT_Face ftFace, FontId id, PointSize26Do
   FontDescription description;
   description.path = path;
   description.family = FontFamily( ftFace->family_name );
-  description.weight = FontWeight::NORMAL;
-  description.width = FontWidth::NORMAL;
-  description.slant = FontSlant::NORMAL;
+  description.weight = FontWeight::NONE;
+  description.width = FontWidth::NONE;
+  description.slant = FontSlant::NONE;
 
   // Note FreeType doesn't give too much info to build a proper font style.
   if( ftFace->style_flags & FT_STYLE_FLAG_ITALIC )
index 4f191a660fe6db7a41ff7f82a7cdc2c339f700d8..aad7d54b184b495e344b4266b120498757c47986 100644 (file)
@@ -91,27 +91,27 @@ struct FontClient::Plugin
 
     FontDescriptionId validatedFontId;    ///< Index to the vector with font descriptions.
     PointSize26Dot6   requestedPointSize; ///< The font point size.
-    FontId            fontId;             ///< The font id.
+    FontId            fontId;             ///< The font identifier.
   };
 
   /**
    * @brief Caches the FreeType face and font metrics of the triplet 'path to the font file name, font point size and face index'.
    */
-  struct CacheItem
+  struct FontFaceCacheItem
   {
-    CacheItem( FT_Face ftFace,
-               const FontPath& path,
-               PointSize26Dot6 requestedPointSize,
-               FaceIndex face,
-               const FontMetrics& metrics );
-
-    CacheItem( FT_Face ftFace,
-               const FontPath& path,
-               PointSize26Dot6 requestedPointSize,
-               FaceIndex face,
-               const FontMetrics& metrics,
-               float fixedWidth,
-               float fixedHeight );
+    FontFaceCacheItem( FT_Face ftFace,
+                       const FontPath& path,
+                       PointSize26Dot6 requestedPointSize,
+                       FaceIndex face,
+                       const FontMetrics& metrics );
+
+    FontFaceCacheItem( FT_Face ftFace,
+                       const FontPath& path,
+                       PointSize26Dot6 requestedPointSize,
+                       FaceIndex face,
+                       const FontMetrics& metrics,
+                       float fixedWidth,
+                       float fixedHeight );
 
     FT_Face mFreeTypeFace;               ///< The FreeType face.
     FontPath mPath;                      ///< The path to the font file name.
@@ -161,7 +161,7 @@ struct FontClient::Plugin
   /**
    * @copydoc Dali::FontClient::SetDefaultFont()
    */
-  void SetDefaultFont( const FontDescription& fontDescription );
+  void SetDefaultFont( const FontDescription& preferredFontDescription );
 
   /**
    * @copydoc Dali::FontClient::GetDefaultPlatformFontDescription()
@@ -189,7 +189,14 @@ struct FontClient::Plugin
   PointSize26Dot6 GetPointSize( FontId id );
 
   /**
-   * @copydoc Dali::FontClient::FindFontForCharacter()
+   * @brief Finds within the @p fontList a font which support the @p carcode.
+   *
+   * @param[in] fontList A list of font paths, family, width, weight and slant.
+   * @param[in] charcode The character for which a font is needed.
+   * @param[in] requestedPointSize The point size in 26.6 fractional points.
+   * @param[in] preferColor @e true if a color font is preferred.
+   *
+   * @return A valid font identifier, or zero if no font is found.
    */
   FontId FindFontForCharacter( const FontList& fontList,
                                Character charcode,
@@ -199,12 +206,17 @@ struct FontClient::Plugin
   /**
    * @copydoc Dali::FontClient::FindDefaultFont()
    */
-  FontId FindDefaultFont( Character charcode, PointSize26Dot6 requestedPointSize, bool preferColor );
+  FontId FindDefaultFont( Character charcode,
+                          PointSize26Dot6 requestedPointSize,
+                          bool preferColor );
 
   /**
    * @copydoc Dali::FontClient::FindFallbackFont()
    */
-  FontId FindFallbackFont( FontId preferredFont, Character charcode, PointSize26Dot6 requestedPointSize, bool preferColor );
+  FontId FindFallbackFont( Character charcode,
+                           const FontDescription& preferredFontDescription,
+                           PointSize26Dot6 requestedPointSize,
+                           bool preferColor );
 
   /**
    * @see Dali::FontClient::GetFontId( const FontPath& path, PointSize26Dot6 requestedPointSize, FaceIndex faceIndex )
@@ -219,7 +231,9 @@ struct FontClient::Plugin
                     bool cacheDescription = true );
 
   /**
-   * @copydoc Dali::FontClient::GetFontId( const FontDescription& fontDescription, PointSize26Dot6 requestedPointSize, FaceIndex faceIndex )
+   * @see Dali::FontClient::GetFontId( const FontDescription& preferredFontDescription, PointSize26Dot6 requestedPointSize, FaceIndex faceIndex )
+   *
+   * @param[in] actualPointSize The actual point size. In case of emojis the @p requestedPointSize is used to build the metrics and cache the font and the @p actualPointSize is used to load the glyph.
    */
   FontId GetFontId( const FontDescription& fontDescription,
                     PointSize26Dot6 requestedPointSize,
@@ -351,7 +365,7 @@ private:
    * @param[in] faceIndex A face index.
    * @param[in] cacheDescription Whether to cache the font description.
    *
-   * @return The font id.
+   * @return The font identifier.
    */
   FontId CreateFont( const FontPath& path,
                      PointSize26Dot6 requestedPointSize,
@@ -368,12 +382,12 @@ private:
 
   /**
    * @brief Finds in the cache if there is a triplet with the path to the font file name, the font point size and the face index.
-   * If there is one , if writes the font id in the param @p fontId.
+   * If there is one , if writes the font identifier in the param @p fontId.
    *
    * @param[in] path Path to the font file name.
    * @param[in] requestedPointSize The font point size.
    * @param[in] faceIndex The face index.
-   * @param[out] fontId The font id.
+   * @param[out] fontId The font identifier.
    *
    * @return @e true if there triplet is found.
    */
@@ -401,12 +415,12 @@ private:
                              FontList*& fontList );
 
   /**
-   * @brief Finds in the cache a pair 'validated font id and font point size'.
-   * If there is one it writes the font id in the param @p fontId.
+   * @brief Finds in the cache a pair 'validated font identifier and font point size'.
+   * If there is one it writes the font identifier in the param @p fontId.
    *
    * @param[in] validatedFontId Index to the vector with font descriptions.
    * @param[in] requestedPointSize The font point size.
-   * @param[out] fontId The font id.
+   * @param[out] fontId The font identifier.
    *
    * @return @e true if the pair is found.
    */
@@ -462,10 +476,10 @@ private:
 
   std::vector<FallbackCacheItem> mFallbackCache; ///< Cached fallback font lists.
 
-  std::vector<CacheItem>                mFontCache;            ///< Caches the FreeType face and font metrics of the triplet 'path to the font file name, font point size and face index'.
+  std::vector<FontFaceCacheItem>        mFontCache;            ///< Caches the FreeType face and font metrics of the triplet 'path to the font file name, font point size and face index'.
   std::vector<FontDescriptionCacheItem> mValidatedFontCache;   ///< Caches indices to the vector of font descriptions for a given font.
   FontList                              mFontDescriptionCache; ///< Caches font descriptions for the validated font.
-  std::vector<FontIdCacheItem>          mFontIdCache;          ///< Caches font ids for the pairs of font point size and the index to the vector with font descriptions of the validated fonts.
+  std::vector<FontIdCacheItem>          mFontIdCache;          ///< Caches font identifiers for the pairs of font point size and the index to the vector with font descriptions of the validated fonts.
 
   VectorFontCache* mVectorFontCache; ///< Separate cache for vector data blobs etc.
 
index ccdf4bc1f88d6e97100a8ba40f31ae8d1a1679fe..ae87d9448a1f2153b85ae921f28beaa0315d6439 100644 (file)
@@ -47,6 +47,22 @@ const hb_script_t SCRIPT_TO_HARFBUZZ[] =
 {
   HB_SCRIPT_COMMON,
 
+  HB_SCRIPT_COMMON, // ASCII_DIGITS
+  HB_SCRIPT_COMMON, // ASCII_PS
+
+  HB_SCRIPT_COMMON, // C1_CONTROLS
+  HB_SCRIPT_COMMON, // C1_PS
+  HB_SCRIPT_COMMON, // C1_MATH
+  HB_SCRIPT_COMMON, // SML_P
+  HB_SCRIPT_COMMON, // PHONETIC_U
+  HB_SCRIPT_COMMON, // PHONETIC_SS
+  HB_SCRIPT_COMMON, // NUMERIC_SS
+  HB_SCRIPT_COMMON, // LETTER_LIKE
+  HB_SCRIPT_COMMON, // NUMBER_FORMS
+  HB_SCRIPT_COMMON, // FRACTIONS_NF
+  HB_SCRIPT_COMMON, // NON_LATIN_LED
+  HB_SCRIPT_COMMON, // HWFW_S
+
   HB_SCRIPT_CYRILLIC,
   HB_SCRIPT_GREEK,
   HB_SCRIPT_LATIN,
@@ -80,6 +96,11 @@ const hb_script_t SCRIPT_TO_HARFBUZZ[] =
   HB_SCRIPT_KHMER,
 
   HB_SCRIPT_UNKNOWN, // EMOJI
+  HB_SCRIPT_UNKNOWN, // SYMBOLS1
+  HB_SCRIPT_UNKNOWN, // SYMBOLS2
+  HB_SCRIPT_UNKNOWN, // SYMBOLS3
+  HB_SCRIPT_UNKNOWN, // SYMBOLS4
+  HB_SCRIPT_UNKNOWN, // SYMBOLS5
   HB_SCRIPT_UNKNOWN
 };