[dali_1.2.42] Merge branch 'devel/master' 62/132362/1
authorNick Holland <nick.holland@partner.samsung.com>
Fri, 2 Jun 2017 11:56:27 +0000 (12:56 +0100)
committerNick Holland <nick.holland@partner.samsung.com>
Fri, 2 Jun 2017 11:56:27 +0000 (12:56 +0100)
Change-Id: Ibec3ad9a5bb9cfe60d7ca9bf4cbd0f3888b0d918

adaptors/common/application-impl.cpp
adaptors/common/singleton-service-impl.cpp
adaptors/common/singleton-service-impl.h
adaptors/ecore/wayland/window-impl-ecore-wl.cpp
adaptors/public-api/dali-adaptor-version.cpp
automated-tests/src/dali-adaptor/CMakeLists.txt
packaging/dali-adaptor.spec
text/dali/internal/text-abstraction/font-client-plugin-impl.cpp

index 931ba12..876cc98 100644 (file)
@@ -262,7 +262,9 @@ void Application::OnTerminate()
 
 void Application::OnPause()
 {
-  DoPause();
+  // A DALi app should handle Pause/Resume events.
+  // DALi just delivers the framework Pause event to the application, but not actually pause DALi core.
+  // Pausing DALi core only occurs on the Window Hidden framework event
   Dali::Application application(this);
   mPauseSignal.Emit( application );
 }
@@ -273,7 +275,9 @@ void Application::OnResume()
   // This ensures we do not just redraw the last frame before pausing if that's not required
   Dali::Application application(this);
   mResumeSignal.Emit( application );
-  DoResume();
+
+  // DALi just delivers the framework Resume event to the application.
+  // Resuming DALi core only occurs on the Window Show framework event
 }
 
 void Application::OnReset()
index 8ab6bda..d975d94 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -75,7 +75,7 @@ void SingletonService::Register( const std::type_info& info, BaseHandle singleto
   if( singleton )
   {
     DALI_LOG_SINGLETON_SERVICE( Debug::General, "Singleton Added: %s\n", info.name() );
-    mSingletonContainer.insert( SingletonPair( info.name(), singleton ) );
+    mSingletonContainer.push_back( SingletonPair( info.name(), singleton ) );
   }
 }
 
@@ -88,10 +88,14 @@ BaseHandle SingletonService::GetSingleton( const std::type_info& info ) const
 {
   BaseHandle object;
 
-  SingletonConstIter iter = mSingletonContainer.find(info.name());
-  if( iter != mSingletonContainer.end() )
+  const SingletonContainer::const_iterator end = mSingletonContainer.end();
+  for( SingletonContainer::const_iterator iter = mSingletonContainer.begin(); iter != end; ++iter )
   {
-    object = ( *iter ).second;
+    // comparing the addresses as these are allocated statically per library
+    if( ( *iter ).first == info.name() )
+    {
+      object = ( *iter ).second;
+    }
   }
 
   return object;
index e5d623c..3e74522 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_SINGLETON_SERVICE_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/object/base-object.h>
-#include <dali/devel-api/common/map-wrapper.h>
+#include <dali/public-api/common/vector-wrapper.h>
 
 // INTERNAL INCLUDES
 #include <singleton-service.h>
@@ -84,8 +84,10 @@ private:
 
 private:
 
-  typedef std::pair<std::string, BaseHandle> SingletonPair;
-  typedef std::map<std::string, BaseHandle>  SingletonContainer;
+  // using the address of the type name string as compiler will allocate these once per library
+  // and we don't support un/re-loading of dali libraries while singleton service is alive
+  typedef std::pair< const char*, BaseHandle> SingletonPair;
+  typedef std::vector< SingletonPair >  SingletonContainer;
   typedef SingletonContainer::const_iterator SingletonConstIter;
 
   SingletonContainer mSingletonContainer; ///< The container to look up singleton by its type name
index 51cb650..18e4c8d 100644 (file)
@@ -101,19 +101,22 @@ struct Window::EventHandler
 
     mDisplay = ecore_wl_display_get();
 
-    wl_display* displayWrapper = static_cast< wl_display* >( wl_proxy_create_wrapper( mDisplay ) );
-    if( displayWrapper )
+    if( mDisplay )
     {
-      mEventQueue = wl_display_create_queue( mDisplay );
-      if( mEventQueue )
+      wl_display* displayWrapper = static_cast< wl_display* >( wl_proxy_create_wrapper( mDisplay ) );
+      if( displayWrapper )
       {
-        wl_proxy_set_queue( reinterpret_cast< wl_proxy* >( displayWrapper ), mEventQueue );
+        mEventQueue = wl_display_create_queue( mDisplay );
+        if( mEventQueue )
+        {
+          wl_proxy_set_queue( reinterpret_cast< wl_proxy* >( displayWrapper ), mEventQueue );
 
-        wl_registry* registry = wl_display_get_registry( displayWrapper );
-        wl_registry_add_listener( registry, &mRegistryListener, this );
-      }
+          wl_registry* registry = wl_display_get_registry( displayWrapper );
+          wl_registry_add_listener( registry, &mRegistryListener, this );
+        }
 
-      wl_proxy_wrapper_destroy( displayWrapper );
+        wl_proxy_wrapper_destroy( displayWrapper );
+      }
     }
   }
 
index 3628b39..2c58e18 100644 (file)
@@ -28,7 +28,7 @@ namespace Dali
 
 const unsigned int ADAPTOR_MAJOR_VERSION = 1;
 const unsigned int ADAPTOR_MINOR_VERSION = 2;
-const unsigned int ADAPTOR_MICRO_VERSION = 41;
+const unsigned int ADAPTOR_MICRO_VERSION = 42;
 const char * const ADAPTOR_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index 90bb7ec..04311e0 100644 (file)
@@ -40,6 +40,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED
     dali-core
     dali-adaptor
     ecore
+    ecore-x
 )
 
 SET(CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -O0 -ggdb --coverage -Wall -Werror")
index 3e67986..6233fe3 100644 (file)
@@ -14,7 +14,7 @@
 
 Name:       dali-adaptor
 Summary:    The DALi Tizen Adaptor
-Version:    1.2.41
+Version:    1.2.42
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT
index dc09c0e..970f0ff 100644 (file)
@@ -340,11 +340,15 @@ void FontClient::Plugin::GetDefaultPlatformFontDescription( FontDescription& fon
     FcInitReinitialize(); // FcInitBringUptoDate did not seem to reload config file as was still getting old default font.
 
     FcPattern* matchPattern = FcPatternCreate();
-    FcConfigSubstitute(NULL, matchPattern, FcMatchPattern);
-    FcDefaultSubstitute( matchPattern );
 
-    MatchFontDescriptionToPattern( matchPattern, mDefaultFontDescription );
-    FcPatternDestroy( matchPattern );
+    if( matchPattern )
+    {
+      FcConfigSubstitute( NULL, matchPattern, FcMatchPattern );
+      FcDefaultSubstitute( matchPattern );
+
+      MatchFontDescriptionToPattern( matchPattern, mDefaultFontDescription );
+      FcPatternDestroy( matchPattern );
+    }
 
     mDefaultFontDescriptionCached = true;
   }