Tizen 2.4.0 rev3 SDK Public Release accepted/tizen/2.4/mobile/20160307.015825 submit/tizen_2.4/20160306.235735
authorjk7744.park <jk7744.park@samsung.com>
Fri, 4 Mar 2016 10:53:07 +0000 (19:53 +0900)
committerjk7744.park <jk7744.park@samsung.com>
Fri, 4 Mar 2016 10:53:07 +0000 (19:53 +0900)
45 files changed:
adaptors/base/conditional-wait.h
adaptors/base/render-thread.cpp
adaptors/base/thread-synchronization.cpp
adaptors/base/thread-synchronization.h
adaptors/common/indicator-impl.cpp
adaptors/common/virtual-keyboard-impl.cpp
adaptors/devel-api/adaptor-framework/bitmap-saver.cpp
adaptors/devel-api/adaptor-framework/imf-manager.cpp
adaptors/devel-api/adaptor-framework/imf-manager.h
adaptors/integration-api/file.list
adaptors/integration-api/x11/imf-manager-impl.h [moved from adaptors/x11/imf-manager-impl.h with 85% similarity]
adaptors/public-api/adaptor-framework/application-configuration.h
adaptors/public-api/adaptor-framework/application.h
adaptors/public-api/adaptor-framework/input-method.h
adaptors/public-api/adaptor-framework/native-image-source.h
adaptors/public-api/adaptor-framework/style-change.h
adaptors/public-api/adaptor-framework/timer.h
adaptors/public-api/adaptor-framework/tts-player.h
adaptors/public-api/adaptor-framework/window.h
adaptors/tizen/key-grab.h
adaptors/wayland/event-handler-wl.cpp
adaptors/wayland/imf-manager-impl-wl.cpp
adaptors/wayland/imf-manager-impl.h
adaptors/x11/ecore-x-event-handler.cpp
adaptors/x11/imf-manager-impl-x.cpp
adaptors/x11/virtual-keyboard-impl-x.cpp
automated-tests/packaging/core-dali-adaptor-tests.spec
automated-tests/packaging/core-dali-platform-abstraction-tests.spec
build/tizen/adaptor/Makefile.am
doc/dali-adaptor_doc.h
packaging/dali-adaptor.spec
platform-abstractions/tizen/image-loaders/loader-bmp.cpp
platform-abstractions/tizen/image-loaders/loader-jpeg-turbo.cpp
platform-abstractions/tizen/image-loaders/loader-jpeg.h
platform-abstractions/tizen/image-loaders/loader-png.cpp
platform-abstractions/tizen/image-loaders/loader-png.h
platform-abstractions/tizen/resource-loader/resource-loader.cpp
platform-abstractions/tizen/resource-loader/resource-loader.h
platform-abstractions/tizen/resource-loader/resource-thread-base.cpp
platform-abstractions/tizen/resource-loader/resource-thread-base.h
platform-abstractions/tizen/resource-loader/resource-thread-image.cpp
platform-abstractions/tizen/resource-loader/resource-thread-image.h
platform-abstractions/tizen/tizen-platform-abstraction.cpp
platform-abstractions/tizen/tizen-platform-abstraction.h
text/dali/devel-api/text-abstraction/font-client.cpp

index f3f6d5a..3aa537f 100644 (file)
@@ -116,7 +116,7 @@ private:
 
   // Not implemented as ConditionalWait is not copyable
   ConditionalWait( const ConditionalWait& );
-  const ConditionalWait& operator= ( const ConditionalWait& );
+  const ConditionalWait& operator=( const ConditionalWait& );
 
   struct ConditionalWaitImpl;
   ConditionalWaitImpl* mImpl;
index 1556f8d..c0e381b 100644 (file)
@@ -199,6 +199,9 @@ bool RenderThread::Run()
         mCore.Render( renderStatus );
         mThreadSynchronization.AddPerformanceMarker( PerformanceInterface::RENDER_END );
 
+        // Decrement the count of how far update is ahead of render
+        mThreadSynchronization.RenderFinished();
+
         // Perform any post-render operations
         if ( renderStatus.HasRendered() )
         {
index 875fb3f..04688f1 100644 (file)
@@ -368,6 +368,8 @@ bool ThreadSynchronization::UpdateReady( bool notifyEvent, bool runUpdate, float
       {
         ConditionalWait::ScopedLock lock( mRenderThreadWaitCondition );
         ++mUpdateAheadOfRender;
+        DALI_ASSERT_ALWAYS( mUpdateAheadOfRender >= 0 );
+        DALI_ASSERT_ALWAYS( mUpdateAheadOfRender <= mMaximumUpdateCount );
         LOG_UPDATE_COUNTER_UPDATE( "updateAheadOfRender(%d)", mUpdateAheadOfRender );
       }
       mRenderThreadWaitCondition.Notify();
@@ -462,12 +464,6 @@ bool ThreadSynchronization::RenderReady( RenderRequest*& requestPtr )
       {
         mRenderThreadSurfaceReplaced = FALSE;
       }
-      else
-      {
-        // decrement update-ahead-of-render
-        ConditionalWait::ScopedLock renderLock( mRenderThreadWaitCondition );
-        --mUpdateAheadOfRender;
-      }
     }
 
     // Check if we've had an update, if we haven't then we just wait
@@ -488,14 +484,6 @@ bool ThreadSynchronization::RenderReady( RenderRequest*& requestPtr )
       }
     }
   }
-  else
-  {
-    LOG_RENDER( "Just Rendered, now Replacing surface" );
-
-    // ... also decrement update-ahead-of-render
-    ConditionalWait::ScopedLock renderLock( mRenderThreadWaitCondition );
-    --mUpdateAheadOfRender;
-  }
 
   // We may have been asked to replace the surface while we were waiting so check again here
   if( IsRenderThreadReplacingSurface() )
@@ -512,6 +500,17 @@ bool ThreadSynchronization::RenderReady( RenderRequest*& requestPtr )
   return IsRenderThreadRunning(); // Call to this function locks so should not be called if we have a scoped-lock
 }
 
+void ThreadSynchronization::RenderFinished()
+{
+  // A frame has been rendered; decrement counter
+  ConditionalWait::ScopedLock renderLock( mRenderThreadWaitCondition );
+  --mUpdateAheadOfRender;
+
+  LOG_RENDER( "mUpdateAheadOfRender %d\n", mUpdateAheadOfRender );
+  DALI_ASSERT_ALWAYS( mUpdateAheadOfRender < mMaximumUpdateCount );
+  DALI_ASSERT_ALWAYS( mUpdateAheadOfRender >= 0 );
+}
+
 void ThreadSynchronization::RenderInformSurfaceReplaced()
 {
   LOG_RENDER_TRACE;
index 940864a..5ce5f11 100644 (file)
@@ -177,6 +177,13 @@ public:
   bool RenderReady( RenderRequest*& request );
 
   /**
+   * Called by the render thread after it renders a frame.
+   * Used to notify the update-thread that a frame has been rendered.
+   * @pre Called by render thread only.
+   */
+  void RenderFinished();
+
+  /**
    * Called by the Render thread to inform the synchronization class that the surface has been replaced.
    *
    * @note Should only be called by the Render thread.
index e2a697f..171c2b4 100644 (file)
@@ -1342,6 +1342,8 @@ void Indicator::ShowIndicator(float duration)
   }
   else
   {
+    mIndicatorAnimation.Clear();
+
     if( EqualsZero(duration) )
     {
       mIndicatorAnimation.AnimateTo( Property( mIndicatorImageContainerActor, Dali::Actor::Property::POSITION ), Vector3(0, -mImageHeight, 0), Dali::AlphaFunction::EASE_OUT );
index 9fca891..472db0c 100644 (file)
@@ -21,7 +21,6 @@
 // EXTERNAL INCLUDES
 #include <algorithm>
 
-#include <dali/public-api/common/vector-wrapper.h>
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
@@ -134,7 +133,7 @@ void DisconnectCallbacks( Ecore_IMF_Context *imfContext )
 void Show()
 {
   Dali::ImfManager imfManager = ImfManager::Get(); // Create ImfManager instance (if required) to show the keyboard
-  Ecore_IMF_Context* imfContext = reinterpret_cast<Ecore_IMF_Context*>( imfManager.GetContext() );
+  Ecore_IMF_Context* imfContext = ImfManager::GetImplementation( imfManager ).GetContext();
 
   if( imfContext )
   {
@@ -147,7 +146,7 @@ void Hide()
   if( ImfManager::IsAvailable() /* We do not want to create an ImfManager instance*/ )
   {
     Dali::ImfManager imfManager = ImfManager::Get();
-    Ecore_IMF_Context* imfContext = reinterpret_cast<Ecore_IMF_Context*>( imfManager.GetContext() );
+    Ecore_IMF_Context* imfContext = ImfManager::GetImplementation( imfManager ).GetContext();
 
     if( imfContext )
     {
@@ -163,7 +162,7 @@ bool IsVisible()
     DALI_LOG_INFO( gLogFilter, Debug::General, "IsVisible\n" );
 
     Dali::ImfManager imfManager = ImfManager::Get();
-    Ecore_IMF_Context* imfContext = reinterpret_cast<Ecore_IMF_Context*>( imfManager.GetContext() );
+    Ecore_IMF_Context* imfContext = ImfManager::GetImplementation( imfManager ).GetContext();
 
     if ( imfContext )
     {
@@ -205,7 +204,7 @@ void ApplySettings( const Property::Map& settingsMap )
 void EnablePrediction(const bool enable)
 {
   Dali::ImfManager imfManager = ImfManager::Get(); // Create ImfManager instance (if required) when enabling prediction
-  Ecore_IMF_Context* imfContext = reinterpret_cast<Ecore_IMF_Context*>( imfManager.GetContext() );
+  Ecore_IMF_Context* imfContext = ImfManager::GetImplementation( imfManager ).GetContext();
 
   if ( imfContext )
   {
@@ -218,7 +217,7 @@ bool IsPredictionEnabled()
   if ( ImfManager::IsAvailable() /* We do not want to create an instance of ImfManger */ )
   {
     Dali::ImfManager imfManager = ImfManager::Get();
-    Ecore_IMF_Context* imfContext = reinterpret_cast<Ecore_IMF_Context*>( imfManager.GetContext() );
+    Ecore_IMF_Context* imfContext = ImfManager::GetImplementation( imfManager ).GetContext();
 
     if ( imfContext )
     {
@@ -239,7 +238,7 @@ Rect<int> GetSizeAndPosition()
 
   width = height = xPos = yPos = 0;
   Dali::ImfManager imfManager = ImfManager::Get(); // Create ImfManager instance (if required) as we may need to do some size related setup in the application
-  Ecore_IMF_Context* imfContext = reinterpret_cast<Ecore_IMF_Context*>( imfManager.GetContext() );
+  Ecore_IMF_Context* imfContext = ImfManager::GetImplementation( imfManager ).GetContext();
 
   if( imfContext )
   {
@@ -279,7 +278,7 @@ Dali::VirtualKeyboard::TextDirection GetTextDirection()
 
     if ( imfManager )
     {
-      Ecore_IMF_Context* imfContext = reinterpret_cast<Ecore_IMF_Context*>( imfManager.GetContext() );
+      Ecore_IMF_Context* imfContext = ImfManager::GetImplementation( imfManager ).GetContext();
 
       if ( imfContext )
       {
index 4340e6d..ae83571 100644 (file)
@@ -19,6 +19,7 @@
 
 // EXTERNAL INCLUDES
 #include <dali/integration-api/debug.h>
+#include <dali/public-api/common/dali-vector.h>
 
 // INTERNAL INCLUDES
 #include <platform-abstractions/tizen/resource-loader/resource-loader.h>
@@ -85,7 +86,7 @@ FileFormat GetFormatFromFileName( const std::string& filename )
 }
 
 bool EncodeToFormat( const unsigned char* pixelBuffer,
-                     std::vector< unsigned char >& encodedPixels,
+                     Vector< unsigned char >& encodedPixels,
                      FileFormat formatEncoding,
                      std::size_t width,
                      std::size_t height,
@@ -121,7 +122,7 @@ bool EncodeToFile(const unsigned char* const pixelBuffer,
                   const std::size_t height )
 {
   DALI_ASSERT_DEBUG(pixelBuffer != 0 && filename.size() > 4 && width > 0 && height > 0);
-  std::vector< unsigned char > pixbufEncoded;
+  Vector< unsigned char > pixbufEncoded;
   const FileFormat format = GetFormatFromFileName( filename );
   const bool encodeResult = EncodeToFormat( pixelBuffer, pixbufEncoded, format, width, height, pixelFormat );
   if(!encodeResult)
@@ -129,7 +130,7 @@ bool EncodeToFile(const unsigned char* const pixelBuffer,
     DALI_LOG_ERROR("Encoding pixels failed");
     return false;
   }
-  return TizenPlatform::ResourceLoader::SaveFile( filename, pixbufEncoded );
+  return TizenPlatform::ResourceLoader::SaveFile( filename, pixbufEncoded.Begin(), pixbufEncoded.Count() );
 }
 
 } // namespace Dali
index 94d5fc1..f083c8b 100644 (file)
@@ -38,11 +38,6 @@ ImfManager ImfManager::Get()
   return Internal::Adaptor::ImfManager::Get();
 }
 
-ImfContext ImfManager::GetContext()
-{
-  return reinterpret_cast<ImfContext>( Internal::Adaptor::ImfManager::GetImplementation(*this).GetContext() );
-}
-
 void ImfManager::Activate()
 {
   Internal::Adaptor::ImfManager::GetImplementation(*this).Activate();
@@ -78,17 +73,17 @@ void ImfManager::SetCursorPosition( unsigned int SetCursorPosition )
   Internal::Adaptor::ImfManager::GetImplementation(*this).SetCursorPosition( SetCursorPosition );
 }
 
-int ImfManager::GetCursorPosition()
+unsigned int ImfManager::GetCursorPosition() const
 {
   return Internal::Adaptor::ImfManager::GetImplementation(*this).GetCursorPosition();
 }
 
-void ImfManager::SetSurroundingText( std::string text )
+void ImfManager::SetSurroundingText( const std::string& text )
 {
   Internal::Adaptor::ImfManager::GetImplementation(*this).SetSurroundingText( text );
 }
 
-std::string ImfManager::GetSurroundingText()
+const std::string& ImfManager::GetSurroundingText() const
 {
   return Internal::Adaptor::ImfManager::GetImplementation(*this).GetSurroundingText();
 }
index 00e589e..a674ce7 100644 (file)
@@ -33,9 +33,6 @@ class ImfManager;
 }
 }
 
-// TODO: Temporary patch to hidden ecore dependency. Must fix it.
-typedef void* ImfContext;
-
 /**
  * @brief The ImfManager class
  *
@@ -66,8 +63,8 @@ public:
      * @brief Default Constructor.
      */
     ImfEventData()
-    : eventName( VOID ),
-      predictiveString(""),
+    : predictiveString(),
+      eventName( VOID ),
       cursorOffset( 0 ),
       numberOfChars ( 0 )
     {
@@ -81,16 +78,19 @@ public:
      * @param[in] aCursorOffset Start position from the current cursor position to start deleting characters.
      * @param[in] aNumberOfChars The number of characters to delete from the cursorOffset.
      */
-    ImfEventData(ImfEvent aEventName, const std::string& aPredictiveString, int aCursorOffset,int aNumberOfChars  )
-    : eventName(aEventName), predictiveString(aPredictiveString), cursorOffset( aCursorOffset ), numberOfChars( aNumberOfChars )
+    ImfEventData( ImfEvent aEventName, const std::string& aPredictiveString, int aCursorOffset, int aNumberOfChars )
+    : predictiveString( aPredictiveString ),
+      eventName( aEventName ),
+      cursorOffset( aCursorOffset ),
+      numberOfChars( aNumberOfChars )
     {
     }
 
     // Data
-    ImfEvent eventName; ///< The name of the event from the IMF.
     std::string predictiveString; ///< The pre-edit or commit string.
-    int cursorOffset; ///< Start position from the current cursor position to start deleting characters.
-    int numberOfChars; ///< number of characters to delete from the cursorOffset.
+    ImfEvent eventName;           ///< The name of the event from the IMF.
+    int cursorOffset;             ///< Start position from the current cursor position to start deleting characters.
+    int numberOfChars;            ///< number of characters to delete from the cursorOffset.
   };
 
   /**
@@ -101,8 +101,11 @@ public:
     /**
      * @brief Constructor
      */
-    ImfCallbackData( )
-    : update( false ), cursorPosition( 0 ), preeditResetRequired ( false )
+    ImfCallbackData()
+    : currentText(),
+      cursorPosition( 0 ),
+      update( false ),
+      preeditResetRequired( false )
     {
     }
 
@@ -113,19 +116,21 @@ public:
      * @param[in] aCurrentText current text string
      * @param[in] aPreeditResetRequired flag if preedit reset is required.
      */
-    ImfCallbackData(bool aUpdate, int aCursorPosition, std::string aCurrentText, bool aPreeditResetRequired )
-    : update(aUpdate), cursorPosition(aCursorPosition), currentText( aCurrentText ), preeditResetRequired( aPreeditResetRequired )
+    ImfCallbackData( bool aUpdate, int aCursorPosition, const std::string& aCurrentText, bool aPreeditResetRequired )
+    : currentText( aCurrentText ),
+      cursorPosition( aCursorPosition ),
+      update( aUpdate ),
+      preeditResetRequired( aPreeditResetRequired )
     {
     }
 
-    bool update; ///< if cursor position needs to be updated
-    int cursorPosition; ///< new position of cursor
-    std::string currentText; ///< current text string
-    bool preeditResetRequired; ///< flag if preedit reset is required.
+    std::string currentText;      ///< current text string
+    int cursorPosition;           ///< new position of cursor
+    bool update               :1; ///< if cursor position needs to be updated
+    bool preeditResetRequired :1; ///< flag if preedit reset is required.
   };
 
   typedef Signal< void (ImfManager&) > ImfManagerSignalType; ///< Keyboard actived signal
-
   typedef Signal< ImfCallbackData ( ImfManager&, const ImfEventData& ) > ImfEventSignalType; ///< keyboard events
 
 public:
@@ -137,12 +142,6 @@ public:
   static ImfManager Get();
 
   /**
-   * @brief Get the current imf context.
-   * @return current imf context.
-   */
-  ImfContext GetContext();
-
-  /**
    * @brief Activate the IMF.
    *
    * It means that the text editing is started at somewhere.
@@ -196,21 +195,21 @@ public:
    *
    * @return current position of cursor
    */
-  int GetCursorPosition();
+  unsigned int GetCursorPosition() const;
 
   /**
    * @brief Method to store the string required by the IMF, this is used to provide predictive word suggestions.
    *
    * @param[in] text The text string surrounding the current cursor point.
    */
-  void SetSurroundingText( std::string text );
+  void SetSurroundingText( const std::string& text );
 
   /**
    * @brief Gets current text string set within the IMF manager, this is used to offer predictive suggestions.
    *
    * @return current position of cursor
    */
-  std::string GetSurroundingText();
+  const std::string& GetSurroundingText() const;
 
 public:
 
index 2779d84..c245a1d 100644 (file)
@@ -15,4 +15,5 @@ adaptor_integration_wayland_api_header_files = \
 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/pixmap-render-surface.h \
+  $(adaptor_integration_api_dir)/x11/imf-manager-impl.h
similarity index 85%
rename from adaptors/x11/imf-manager-impl.h
rename to adaptors/integration-api/x11/imf-manager-impl.h
index 0ae0f9f..1791792 100644 (file)
@@ -23,7 +23,6 @@
 #include <Ecore_X.h>
 
 #include <dali/public-api/object/base-object.h>
-#include <dali/integration-api/events/key-event-integ.h>
 
 // INTERNAL INCLUDES
 #include <imf-manager.h>
@@ -39,7 +38,7 @@ namespace Internal
 namespace Adaptor
 {
 
-class ImfManager : public Dali::BaseObject
+class DALI_IMPORT_API ImfManager : public Dali::BaseObject
 {
 public:
   typedef Dali::ImfManager::ImfManagerSignalType ImfManagerSignalType;
@@ -112,22 +111,22 @@ public:
   /**
    * @copydoc Dali::ImfManager::PreEditChanged()
    */
-  void PreEditChanged( void *data, Ecore_IMF_Context *imfContext, void *event_info );
+  void PreEditChanged( void* data, Ecore_IMF_Context* imfContext, void* event_info );
 
   /**
    * @copydoc Dali::ImfManager::NotifyCursorPosition()
    */
-  void CommitReceived( void *data, Ecore_IMF_Context *imfContext, void *event_info );
+  void CommitReceived( void* data, Ecore_IMF_Context* imfContext, void* event_info );
 
   /**
    * @copydoc Dali::ImfManager::NotifyCursorPosition()
    */
-  Eina_Bool RetrieveSurrounding( void *data, Ecore_IMF_Context *imfContext, char** text, int* cursorPosition );
+  Eina_Bool RetrieveSurrounding( void* data, Ecore_IMF_Context* imfContext, char** text, int* cursorPosition );
 
   /**
    * @copydoc Dali::ImfManager::DeleteSurrounding()
    */
-  void DeleteSurrounding( void *data, Ecore_IMF_Context *imfContext, void *event_info );
+  void DeleteSurrounding( void* data, Ecore_IMF_Context* imfContext, void* event_info );
 
   // Cursor related
   /**
@@ -136,24 +135,24 @@ public:
   void NotifyCursorPosition();
 
   /**
-   * @copydoc Dali::ImfManager::GetCursorPosition()
+   * @copydoc Dali::ImfManager::SetCursorPosition()
    */
-  int GetCursorPosition();
+  void SetCursorPosition( unsigned int cursorPosition );
 
   /**
-   * @copydoc Dali::ImfManager::SetCursorPosition()
+   * @copydoc Dali::ImfManager::GetCursorPosition()
    */
-  void SetCursorPosition( unsigned int cursorPosition );
+  unsigned int GetCursorPosition() const;
 
   /**
    * @copydoc Dali::ImfManager::SetSurroundingText()
    */
-  void SetSurroundingText( std::string text );
+  void SetSurroundingText( const std::string& text );
 
   /**
    * @copydoc Dali::ImfManager::GetSurroundingText()
    */
-  std::string GetSurroundingText();
+  const std::string& GetSurroundingText() const;
 
 public:  // Signals
 
@@ -199,14 +198,12 @@ private:
   bool mRestoreAfterFocusLost:1;             ///< Whether the keyboard needs to be restored (activated ) after focus regained.
   bool mIdleCallbackConnected:1;             ///< Whether the idle callback is already connected.
 
-  std::vector<Dali::Integration::KeyEvent> mKeyEvents; ///< Stores key events to be sent from idle call-back.
-
   ImfManagerSignalType      mActivatedSignal;
   ImfEventSignalType        mEventSignal;
 
 public:
 
-inline static Internal::Adaptor::ImfManager& GetImplementation(Dali::ImfManager& imfManager)
+DALI_IMPORT_API inline static Internal::Adaptor::ImfManager& GetImplementation(Dali::ImfManager& imfManager)
 {
   DALI_ASSERT_ALWAYS( imfManager && "ImfManager handle is empty" );
 
@@ -215,7 +212,7 @@ inline static Internal::Adaptor::ImfManager& GetImplementation(Dali::ImfManager&
   return static_cast<Internal::Adaptor::ImfManager&>(handle);
 }
 
-inline static const  Internal::Adaptor::ImfManager& GetImplementation(const Dali::ImfManager& imfManager)
+DALI_IMPORT_API inline static const  Internal::Adaptor::ImfManager& GetImplementation(const Dali::ImfManager& imfManager)
 {
   DALI_ASSERT_ALWAYS( imfManager && "ImfManager handle is empty" );
 
index fbcc0bd..4f574d2 100644 (file)
@@ -37,8 +37,8 @@ namespace Configuration
  */
 enum ContextLoss
 {
-  APPLICATION_HANDLES_CONTEXT_LOSS,  ///< Application will tear down and recreate UI on context loss and context regained signals. Dali doesn't need to retain data.
-  APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS, ///< Application expects Dali to retain data ( increased memory footprint )
+  APPLICATION_HANDLES_CONTEXT_LOSS,  ///< Application will tear down and recreate UI on context loss and context regained signals. Dali doesn't need to retain data. @since_tizen 2.4
+  APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS, ///< Application expects Dali to retain data ( increased memory footprint ) @since_tizen 2.4
 };
 
 } // Configuration
index 8efc3a9..e683bf7 100644 (file)
@@ -45,7 +45,9 @@ class Application;
 }
 /**
  * @brief An Application class object should be created by every application
- * that wishes to use Dali.  It provides a means for initialising the
+ * that wishes to use Dali.
+ *
+ * It provides a means for initialising the
  * resources required by the Dali::Core.
  *
  * The Application class emits several signals which the user can
@@ -94,8 +96,8 @@ class DALI_IMPORT_API Application : public BaseHandle
 {
 public:
 
-  typedef Signal< void (Application&) > AppSignalType;
-  typedef Signal< void (Application&, void *) > AppControlSignalType;
+  typedef Signal< void (Application&) > AppSignalType;  ///< Application lifecycle signal and system signal callback type @since_tizen 2.4
+  typedef Signal< void (Application&, void *) > AppControlSignalType; ///< Application control signal callback type @since_tizen 2.4
 
   /**
    * @brief Decides whether a Dali application window is opaque or transparent.
@@ -103,8 +105,8 @@ public:
    */
   enum WINDOW_MODE
   {
-    OPAQUE = 0,       ///< The window will be opaque
-    TRANSPARENT = 1   ///< The window transparency will match the alpha value set in Dali::Stage::SetBackgroundcolor()
+    OPAQUE = 0,       ///< The window will be opaque @since_tizen 2.4
+    TRANSPARENT = 1   ///< The window transparency will match the alpha value set in Dali::Stage::SetBackgroundcolor() @since_tizen 2.4
   };
 
 public:
@@ -181,7 +183,9 @@ public:
 
 public:
   /**
-   * @brief This starts the application. Choosing this form of main loop indicates that the default
+   * @brief This starts the application.
+   *
+   * Choosing this form of main loop indicates that the default
    * application configuration of APPLICATION_HANDLES_CONTEXT_LOSS is used. On platforms where
    * context loss can occur, the application is responsible for tearing down and re-loading UI.
    * The application should listen to Stage::ContextLostSignal and Stage::ContextRegainedSignal.
@@ -191,6 +195,7 @@ public:
 
   /**
    * @brief This starts the application, and allows the app to choose a different configuration.
+   *
    * If the application plans on using the ReplaceSurface or ReplaceWindow API, then this will
    * trigger context loss & regain.
    * The application should listen to Stage::ContextLostSignal and Stage::ContextRegainedSignal.
@@ -229,6 +234,7 @@ public:
 
   /**
    * @brief Retrieves the window used by the Application class.
+   *
    * The application writer can use the window to change indicator and orientation
    * properties.
    * @since_tizen 2.4
@@ -238,6 +244,7 @@ public:
 
   /**
    * @brief Replace the current window.
+   *
    * This will force context loss.
    * If you plan on using this API in your application, then you should configure
    * it to prevent discard behaviour when handling the Init signal.
@@ -323,6 +330,7 @@ public:  // Signals
 
   /**
   * @brief This signal is emitted when another application sends a launch request to the application.
+  *
   * When the application is launched, this signal is emitted after the main loop of the application starts up.
   * The passed parameter describes the launch request and contains the information about why the application is launched.
   * @since_tizen 2.4
index 3eab4bb..27e0831 100644 (file)
@@ -28,6 +28,10 @@ namespace Dali
  * @{
  */
 
+/**
+ * @brief Enumerations for input method.
+ * @since_tizen 2.4
+ */
 namespace InputMethod
 {
 /**
index c9af690..806561e 100644 (file)
@@ -66,11 +66,11 @@ public:
     */
    enum ColorDepth
    {
-     COLOR_DEPTH_DEFAULT,     ///< Uses the current X screen default depth (recommended)
-     COLOR_DEPTH_8,           ///< 8 bits per pixel
-     COLOR_DEPTH_16,          ///< 16 bits per pixel
-     COLOR_DEPTH_24,          ///< 24 bits per pixel
-     COLOR_DEPTH_32           ///< 32 bits per pixel
+     COLOR_DEPTH_DEFAULT,     ///< Uses the current X screen default depth (recommended) @since_tizen 2.4
+     COLOR_DEPTH_8,           ///< 8 bits per pixel @since_tizen 2.4
+     COLOR_DEPTH_16,          ///< 16 bits per pixel @since_tizen 2.4
+     COLOR_DEPTH_24,          ///< 24 bits per pixel @since_tizen 2.4
+     COLOR_DEPTH_32           ///< 32 bits per pixel @since_tizen 2.4
    };
 
   /**
index 0765f56..a775a3a 100644 (file)
@@ -29,14 +29,18 @@ namespace Dali
  * @{
  */
 
+/**
+ * @brief Style change information.
+ * @since_tizen 2.4
+ */
 namespace StyleChange
 {
 
 enum Type
 {
-  DEFAULT_FONT_CHANGE,      ///< Denotes that the default font has changed.
-  DEFAULT_FONT_SIZE_CHANGE, ///< Denotes that the default font size has changed.
-  THEME_CHANGE              ///< Denotes that the theme has changed.
+  DEFAULT_FONT_CHANGE,      ///< Denotes that the default font has changed. @since_tizen 2.4
+  DEFAULT_FONT_SIZE_CHANGE, ///< Denotes that the default font size has changed. @since_tizen 2.4
+  THEME_CHANGE              ///< Denotes that the theme has changed. @since_tizen 2.4
 };
 
 } // namespace StyleChange
index cbe67ff..d00e9a5 100644 (file)
@@ -55,7 +55,7 @@ class DALI_IMPORT_API Timer : public BaseHandle
 {
 public: // Signal typedefs
 
-  typedef Signal< bool () > TimerSignalType; ///< Timer finished signal callback type
+  typedef Signal< bool () > TimerSignalType; ///< Timer finished signal callback type @since_tizen 2.4
 
 public: // API
 
@@ -103,7 +103,7 @@ public: // API
   ~Timer();
 
   /**
-   * @brief Downcast an Object handle to Timer handle.
+   * @brief Downcast a handle to Timer handle.
    *
    * If handle points to a Timer object the downcast produces a valid
    * handle. If not the returned handle is left uninitialized.
@@ -139,6 +139,7 @@ public: // API
 
   /**
    * @brief Get the interval of timer.
+   *
    * @returns  Interval in milliseconds.
    * @since_tizen 2.4
    */
index acc9f2a..ca4faf8 100644 (file)
@@ -51,9 +51,9 @@ public: // ENUMs
    */
   enum Mode
   {
-    DEFAULT = 0,  ///< Default mode for normal application
-    NOTIFICATION, ///< Notification mode
-    SCREEN_READER, ///< Screen reader mode
+    DEFAULT = 0,  ///< Default mode for normal application @since_tizen 2.4
+    NOTIFICATION, ///< Notification mode @since_tizen 2.4
+    SCREEN_READER, ///< Screen reader mode @since_tizen 2.4
     MODE_NUM
   };
 
@@ -63,10 +63,10 @@ public: // ENUMs
    */
   enum State
   {
-    UNAVAILABLE = 0,    ///< Player is not available
-    READY,              ///< Player is ready to play
-    PLAYING,            ///< Player is playing
-    PAUSED              ///< Player is paused
+    UNAVAILABLE = 0,    ///< Player is not available @since_tizen 2.4
+    READY,              ///< Player is ready to play @since_tizen 2.4
+    PLAYING,            ///< Player is playing @since_tizen 2.4
+    PAUSED              ///< Player is paused @since_tizen 2.4
   };
 
 public: // Typedefs
@@ -160,9 +160,9 @@ public: // API
 
   /**
    * @brief Allows connection TTS state change signal.
-   * Note: Only supported by some adaptor types.
    * @since_tizen 2.4
    * @return A reference to the signal for connection.
+   * @note Only supported by some adaptor types.
    */
   Dali::TtsPlayer::StateChangedSignalType& StateChangedSignal();
 
index 48cd640..34dc9bf 100644 (file)
@@ -33,7 +33,7 @@ namespace Dali
  * @{
  */
 
-typedef Dali::Rect<int> PositionSize;
+typedef Dali::Rect<int> PositionSize; ///< Type for widow poisition and size. @since_tizen 2.4
 
 namespace Internal DALI_INTERNAL
 {
@@ -49,14 +49,14 @@ class Orientation;
 /**
  * @brief The window class is used internally for drawing.
  *
- * It has an orientation
- * and indicator properties.
+ * A Window has an orientation and indicator properties.
+ * You can get a valid Window handle by calling Dali::Application::GetWindow().
  * @since_tizen 2.4
  */
 class DALI_IMPORT_API Window : public BaseHandle
 {
 public:
-  typedef Signal< void (bool) > IndicatorSignalType;
+  typedef Signal< void (bool) > IndicatorSignalType;  ///< Indicator signal callback type @since_tizen 2.4
 
 public:
 
@@ -68,10 +68,10 @@ public:
    */
   enum WindowOrientation
   {
-    PORTRAIT = 0,
-    LANDSCAPE = 90,
-    PORTRAIT_INVERSE = 180,
-    LANDSCAPE_INVERSE = 270
+    PORTRAIT = 0,  ///< Portrait orientation @since_tizen 2.4
+    LANDSCAPE = 90,  ///< Landscape orientation @since_tizen 2.4
+    PORTRAIT_INVERSE = 180,  ///< Portrait inverse orientation @since_tizen 2.4
+    LANDSCAPE_INVERSE = 270  ///< Landscape inverse orientation @since_tizen 2.4
   };
 
   /**
@@ -80,9 +80,9 @@ public:
    */
   enum IndicatorBgOpacity
   {
-    OPAQUE = 100, // Fully opaque indicator Bg
-    TRANSLUCENT = 50, // Semi translucent indicator Bg
-    TRANSPARENT = 0 // Fully transparent indicator Bg
+    OPAQUE = 100, ///< Fully opaque indicator Bg @since_tizen 2.4
+    TRANSLUCENT = 50, ///< Semi translucent indicator Bg @since_tizen 2.4
+    TRANSPARENT = 0 ///< Fully transparent indicator Bg @since_tizen 2.4
   };
 
   /**
@@ -91,9 +91,9 @@ public:
    */
   enum IndicatorVisibleMode
   {
-    INVISIBLE = 0, // hide indicator
-    VISIBLE = 1, // show indicator
-    AUTO = 2 // hide in default, will show when necessary
+    INVISIBLE = 0, ///< hide indicator @since_tizen 2.4
+    VISIBLE = 1, ///< show indicator @since_tizen 2.4
+    AUTO = 2 ///< hide in default, will show when necessary @since_tizen 2.4
   };
 
   // Methods
@@ -122,8 +122,7 @@ public:
   /**
    * @brief Create an uninitalized handle.
    *
-   * This can be initialized using Dali::Application::GetWindow() or
-   * Dali::Window::New()
+   * This can be initialized using Dali::Window::New()
    * @since_tizen 2.4
    */
   Window();
index b697375..0f53adf 100644 (file)
@@ -67,10 +67,10 @@ DALI_IMPORT_API bool UngrabKeyTopmost( Window window, Dali::KEY daliKey );
  */
 enum KeyGrabMode
 {
-  TOPMOST = 0,             ///< Grab a key only when on the top of the grabbing-window stack mode.
-  SHARED,                  ///< Grab a key together with the other client window(s) mode.
-  OVERRIDE_EXCLUSIVE,      ///< Grab a key exclusively regardless of the grabbing-window's position on the window stack with the possibility of overriding the grab by the other client window mode.
-  EXCLUSIVE                ///< Grab a key exclusively regardless of the grabbing-window's position on the window stack mode.
+  TOPMOST = 0,             ///< Grab a key only when on the top of the grabbing-window stack mode. @since_tizen 2.4
+  SHARED,                  ///< Grab a key together with the other client window(s) mode. @since_tizen 2.4
+  OVERRIDE_EXCLUSIVE,      ///< Grab a key exclusively regardless of the grabbing-window's position on the window stack with the possibility of overriding the grab by the other client window mode. @since_tizen 2.4
+  EXCLUSIVE                ///< Grab a key exclusively regardless of the grabbing-window's position on the window stack mode. @since_tizen 2.4
 };
 
 /**
index 76e6dda..c32bec4 100644 (file)
@@ -319,7 +319,7 @@ struct EventHandler::Impl
       Dali::ImfManager imfManager( ImfManager::Get() );
       if ( imfManager )
       {
-        imfContext = reinterpret_cast<Ecore_IMF_Context*>( imfManager.GetContext() );
+        imfContext = ImfManager::GetImplementation( imfManager ).GetContext();
       }
 
       if ( imfContext )
@@ -402,7 +402,7 @@ struct EventHandler::Impl
       Dali::ImfManager imfManager( ImfManager::Get() );
       if ( imfManager )
       {
-        imfContext = reinterpret_cast<Ecore_IMF_Context*>( imfManager.GetContext() );
+        imfContext = ImfManager::GetImplementation( imfManager ).GetContext();
       }
 
       if ( imfContext )
index 84bbdd2..99b3a0e 100644 (file)
@@ -126,22 +126,22 @@ void ImfManager::NotifyCursorPosition()
 {
 }
 
-int ImfManager::GetCursorPosition()
+void ImfManager::SetCursorPosition( unsigned int cursorPosition )
 {
-  return mIMFCursorPosition;
+  mIMFCursorPosition = static_cast<int>( cursorPosition );
 }
 
-void ImfManager::SetCursorPosition( unsigned int cursorPosition )
+unsigned int ImfManager::GetCursorPosition() const
 {
-  mIMFCursorPosition = ( int )cursorPosition;
+  return static_cast<unsigned int>( mIMFCursorPosition );
 }
 
-void ImfManager::SetSurroundingText( std::string text )
+void ImfManager::SetSurroundingText( const std::string& text )
 {
   mSurroundingText = text;
 }
 
-std::string ImfManager::GetSurroundingText()
+const std::string& ImfManager::GetSurroundingText() const
 {
   return mSurroundingText;
 }
index 07ec6e3..ff5c61f 100644 (file)
@@ -131,24 +131,24 @@ public:
   void NotifyCursorPosition();
 
   /**
-   * @copydoc Dali::ImfManager::GetCursorPosition()
+   * @copydoc Dali::ImfManager::SetCursorPosition()
    */
-  int GetCursorPosition();
+  void SetCursorPosition( unsigned int cursorPosition );
 
   /**
-   * @copydoc Dali::ImfManager::SetCursorPosition()
+   * @copydoc Dali::ImfManager::GetCursorPosition()
    */
-  void SetCursorPosition( unsigned int cursorPosition );
+  unsigned int GetCursorPosition() const;
 
   /**
    * @copydoc Dali::ImfManager::SetSurroundingText()
    */
-  void SetSurroundingText( std::string text );
+  void SetSurroundingText( const std::string& text );
 
   /**
    * @copydoc Dali::ImfManager::GetSurroundingText()
    */
-  std::string GetSurroundingText();
+  const std::string& GetSurroundingText() const;
 
 public:  // Signals
 
index 2e1d4ec..c4c8304 100644 (file)
@@ -657,7 +657,7 @@ struct EventHandler::Impl
       Dali::ImfManager imfManager( ImfManager::Get() );
       if ( imfManager )
       {
-        imfContext = reinterpret_cast<Ecore_IMF_Context*>( imfManager.GetContext() );
+        imfContext = ImfManager::GetImplementation( imfManager ).GetContext();
       }
 
       if ( imfContext )
@@ -738,7 +738,7 @@ struct EventHandler::Impl
       Dali::ImfManager imfManager( ImfManager::Get() );
       if ( imfManager )
       {
-        imfContext = reinterpret_cast<Ecore_IMF_Context*>( imfManager.GetContext() );
+        imfContext = ImfManager::GetImplementation( imfManager ).GetContext();
       }
 
       if ( imfContext )
index f64fdd0..bd1bb16 100644 (file)
@@ -41,7 +41,6 @@ namespace Adaptor
 
 namespace
 {
-
 #if defined(DEBUG_ENABLED)
 Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_IMF_MANAGER");
 #endif
@@ -184,10 +183,9 @@ Dali::ImfManager ImfManager::Get()
 ImfManager::ImfManager( Ecore_X_Window ecoreXwin )
 : mIMFContext(),
   mIMFCursorPosition( 0 ),
-  mSurroundingText(""),
+  mSurroundingText(),
   mRestoreAfterFocusLost( false ),
-  mIdleCallbackConnected( false ),
-  mKeyEvents()
+  mIdleCallbackConnected( false )
 {
   ecore_imf_init();
   CreateContext( ecoreXwin );
@@ -334,16 +332,16 @@ void ImfManager::SetRestoreAfterFocusLost( bool toggle )
  * We are still predicting what the user is typing.  The latest string is what the IMF module thinks
  * the user wants to type.
  */
-void ImfManager::PreEditChanged( void *, Ecore_IMF_Context *imfContext, void *event_info )
+void ImfManager::PreEditChanged( void*, Ecore_IMF_Context* imfContext, void* event_info )
 {
   DALI_LOG_INFO( gLogFilter, Debug::General, "ImfManager::PreEditChanged\n" );
 
-  char *preEditString( NULL );
+  charpreEditString( NULL );
   int cursorPosition( 0 );
-  Eina_List *attrs = NULL;
-  Eina_List *l = NULL;
+  Eina_Listattrs = NULL;
+  Eina_Listl = NULL;
 
-  Ecore_IMF_Preedit_Attr *attr;
+  Ecore_IMF_Preedit_Attrattr;
 
   // Retrieves attributes as well as the string the cursor position offset from start of pre-edit string.
   // the attributes (attrs) is used in languages that use the soft arrows keys to insert characters into a current pre-edit string.
@@ -352,7 +350,7 @@ void ImfManager::PreEditChanged( void *, Ecore_IMF_Context *imfContext, void *ev
   if ( attrs )
   {
     // iterate through the list of attributes getting the type, start and end position.
-    for ( l = attrs, (attr =  (Ecore_IMF_Preedit_Attr*)eina_list_data_get(l) ); l; l = eina_list_next(l), ( attr = (Ecore_IMF_Preedit_Attr*)eina_list_data_get(l) ))
+    for ( l = attrs, (attr =  static_cast<Ecore_IMF_Preedit_Attr*>( eina_list_data_get(l) ) ); l; l = eina_list_next(l), ( attr = static_cast<Ecore_IMF_Preedit_Attr*>( eina_list_data_get(l) ) ))
     {
 #ifdef DALI_PROFILE_UBUNTU
       if ( attr->preedit_type == ECORE_IMF_PREEDIT_TYPE_SUB3 ) // (Ecore_IMF)
@@ -366,10 +364,11 @@ void ImfManager::PreEditChanged( void *, Ecore_IMF_Context *imfContext, void *ev
         size_t byteIndex = 0;
 
         // iterate through null terminated string checking each character's position against the given byte position ( attr->end_index ).
-        while ( preEditString[byteIndex] != '\0' )
+        const char leadByte = preEditString[byteIndex];
+        while( leadByte != '\0' )
         {
           // attr->end_index is provided as a byte position not character and we need to know the character position.
-          size_t currentSequenceLength = Utf8SequenceLength(preEditString[byteIndex]); // returns number of bytes used to represent character.
+          const size_t currentSequenceLength = Utf8SequenceLength( leadByte ); // returns number of bytes used to represent character.
           if ( byteIndex == attr->end_index )
           {
             cursorPosition = visualCharacterIndex;
@@ -390,11 +389,8 @@ void ImfManager::PreEditChanged( void *, Ecore_IMF_Context *imfContext, void *ev
 
   if ( Dali::Adaptor::IsAvailable() )
   {
-    std::string keyString ( preEditString );
-    int numberOfChars( 0 );
-
     Dali::ImfManager handle( this );
-    Dali::ImfManager::ImfEventData imfEventData ( Dali::ImfManager::PREEDIT, keyString, cursorPosition, numberOfChars );
+    Dali::ImfManager::ImfEventData imfEventData( Dali::ImfManager::PREEDIT, preEditString, cursorPosition, 0 );
     Dali::ImfManager::ImfCallbackData callbackData = mEventSignal.Emit( handle, imfEventData );
 
     if ( callbackData.update )
@@ -413,21 +409,19 @@ void ImfManager::PreEditChanged( void *, Ecore_IMF_Context *imfContext, void *ev
   free( preEditString );
 }
 
-void ImfManager::CommitReceived( void *, Ecore_IMF_Context *imfContext, void *event_info )
+void ImfManager::CommitReceived( void*, Ecore_IMF_Context* imfContext, void* event_info )
 {
   DALI_LOG_INFO( gLogFilter, Debug::General, "ImfManager::CommitReceived\n" );
 
   if ( Dali::Adaptor::IsAvailable() )
   {
-    const std::string keyString( (char *)event_info );
-    const int cursorOffset( 0 );
-    const int numberOfChars( 0 );
+    const std::string keyString( static_cast<char*>( event_info ) );
 
     Dali::ImfManager handle( this );
-    Dali::ImfManager::ImfEventData imfEventData ( Dali::ImfManager::COMMIT, keyString, cursorOffset, numberOfChars );
+    Dali::ImfManager::ImfEventData imfEventData( Dali::ImfManager::COMMIT, keyString, 0, 0 );
     Dali::ImfManager::ImfCallbackData callbackData = mEventSignal.Emit( handle, imfEventData );
 
-    if ( callbackData.update )
+    if( callbackData.update )
     {
       SetCursorPosition( callbackData.cursorPosition );
       SetSurroundingText( callbackData.currentText );
@@ -442,38 +436,24 @@ void ImfManager::CommitReceived( void *, Ecore_IMF_Context *imfContext, void *ev
  * Here the IMF module wishes to know the string we are working with and where within the string the cursor is
  * We need to signal the application to tell us this information.
  */
-Eina_Bool ImfManager::RetrieveSurrounding( void *data, Ecore_IMF_Context *imfContext, char** text, int* cursorPosition )
+Eina_Bool ImfManager::RetrieveSurrounding( void* data, Ecore_IMF_Context* imfContext, char** text, int* cursorPosition )
 {
   DALI_LOG_INFO( gLogFilter, Debug::General, "ImfManager::RetrieveSurrounding\n" );
 
-  std::string keyString ( "" );
-  int cursorOffset( 0 );
-  int numberOfChars( 0 );
-
-  Dali::ImfManager::ImfEventData imfData ( Dali::ImfManager::GETSURROUNDING , keyString, cursorOffset, numberOfChars );
+  Dali::ImfManager::ImfEventData imfData( Dali::ImfManager::GETSURROUNDING, std::string(), 0, 0 );
   Dali::ImfManager handle( this );
   mEventSignal.Emit( handle, imfData );
 
-  if ( text )
+  if( text )
   {
-    std::string surroundingText( GetSurroundingText() );
-
-    if ( !surroundingText.empty() )
-    {
-      *text = strdup( surroundingText.c_str() );
-    }
-    else
-    {
-      *text = strdup( "" );
-    }
+    *text = strdup( mSurroundingText.c_str() );
   }
 
-  if ( cursorPosition )
+  if( cursorPosition )
   {
-    *cursorPosition = GetCursorPosition();
+    *cursorPosition = mIMFCursorPosition;
   }
 
-
   return EINA_TRUE;
 }
 
@@ -481,19 +461,15 @@ Eina_Bool ImfManager::RetrieveSurrounding( void *data, Ecore_IMF_Context *imfCon
  * Called when an IMF delete surrounding event is received.
  * Here we tell the application that it should delete a certain range.
  */
-void ImfManager::DeleteSurrounding( void *data, Ecore_IMF_Context *imfContext, void *event_info )
+void ImfManager::DeleteSurrounding( void* data, Ecore_IMF_Context* imfContext, void* event_info )
 {
   DALI_LOG_INFO( gLogFilter, Debug::General, "ImfManager::DeleteSurrounding\n" );
 
-  if ( Dali::Adaptor::IsAvailable() )
+  if( Dali::Adaptor::IsAvailable() )
   {
-    Ecore_IMF_Event_Delete_Surrounding* deleteSurroundingEvent = (Ecore_IMF_Event_Delete_Surrounding*) event_info;
-
-    const std::string keyString( "" );
-    const int cursorOffset( deleteSurroundingEvent->offset );
-    const int numberOfChars( deleteSurroundingEvent->n_chars );
+    Ecore_IMF_Event_Delete_Surrounding* deleteSurroundingEvent = static_cast<Ecore_IMF_Event_Delete_Surrounding*>( event_info );
 
-    Dali::ImfManager::ImfEventData imfData ( Dali::ImfManager::DELETESURROUNDING , keyString, cursorOffset, numberOfChars );
+    Dali::ImfManager::ImfEventData imfData( Dali::ImfManager::DELETESURROUNDING, std::string(), deleteSurroundingEvent->offset, deleteSurroundingEvent->n_chars );
     Dali::ImfManager handle( this );
     mEventSignal.Emit( handle, imfData );
   }
@@ -503,34 +479,34 @@ void ImfManager::NotifyCursorPosition()
 {
   DALI_LOG_INFO( gLogFilter, Debug::General, "ImfManager::NotifyCursorPosition\n" );
 
-  if ( mIMFContext )
+  if( mIMFContext )
   {
     ecore_imf_context_cursor_position_set( mIMFContext, mIMFCursorPosition );
   }
 }
 
-int ImfManager::GetCursorPosition()
+void ImfManager::SetCursorPosition( unsigned int cursorPosition )
 {
-  DALI_LOG_INFO( gLogFilter, Debug::General, "ImfManager::GetCursorPosition\n" );
+  DALI_LOG_INFO( gLogFilter, Debug::General, "ImfManager::SetCursorPosition\n" );
 
-  return mIMFCursorPosition;
+  mIMFCursorPosition = static_cast<int>( cursorPosition );
 }
 
-void ImfManager::SetCursorPosition( unsigned int cursorPosition )
+unsigned int ImfManager::GetCursorPosition() const
 {
-  DALI_LOG_INFO( gLogFilter, Debug::General, "ImfManager::SetCursorPosition\n" );
+  DALI_LOG_INFO( gLogFilter, Debug::General, "ImfManager::GetCursorPosition\n" );
 
-  mIMFCursorPosition = ( int )cursorPosition;
+  return static_cast<unsigned int>( mIMFCursorPosition );
 }
 
-void ImfManager::SetSurroundingText( std::string text )
+void ImfManager::SetSurroundingText( const std::string& text )
 {
   DALI_LOG_INFO( gLogFilter, Debug::General, "ImfManager::SetSurroundingText\n" );
 
   mSurroundingText = text;
 }
 
-std::string ImfManager::GetSurroundingText()
+const std::string& ImfManager::GetSurroundingText() const
 {
   DALI_LOG_INFO( gLogFilter, Debug::General, "ImfManager::GetSurroundingText\n" );
 
index b1fdc60..f1a4c6f 100644 (file)
@@ -23,7 +23,6 @@
 #include <Ecore_X.h>
 #include <algorithm>
 
-#include <dali/public-api/common/vector-wrapper.h>
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
@@ -77,9 +76,9 @@ void RotateTo(int angle)
     // Get Focus window
     XGetInputFocus(display, &focusWindow, &revert);
 
-    ecore_x_window_prop_property_set(focusWindow,
+    ecore_x_window_prop_property_set( focusWindow,
                                       ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE,
-                                      ECORE_X_ATOM_CARDINAL, 32, &angle, 1);
+                                      ECORE_X_ATOM_CARDINAL, 32, &angle, 1 );
     XCloseDisplay(display);
   }
 }
@@ -87,7 +86,7 @@ void RotateTo(int angle)
 void SetReturnKeyType( const InputMethod::ActionButton type )
 {
   Dali::ImfManager imfManager = ImfManager::Get(); // Create ImfManager instance (if required) when setting values
-  Ecore_IMF_Context* imfContext = reinterpret_cast<Ecore_IMF_Context*>( imfManager.GetContext() );
+  Ecore_IMF_Context* imfContext = ImfManager::GetImplementation( imfManager ).GetContext();
 
   if( imfContext )
   {
index a6c1dd1..beddb14 100644 (file)
@@ -12,7 +12,7 @@ Requires: dali
 BuildRequires:  dali-integration-devel
 BuildRequires:  pkgconfig(dali-core)
 BuildRequires:  pkgconfig(dali)
-BuildRequires:  boost-devel
+BuildRequires:  libxml2-devel
 BuildRequires:  cmake
 BuildRequires:  pkgconfig(ecore)
 
index 89161ab..26183a4 100644 (file)
@@ -12,7 +12,7 @@ Requires: dali
 BuildRequires:  dali-integration-devel
 BuildRequires:  pkgconfig(dali-core)
 BuildRequires:  pkgconfig(dali)
-BuildRequires:  boost-devel
+BuildRequires:  libxml2-devel
 BuildRequires:  cmake
 
 
index e45ad1d..3defb66 100644 (file)
@@ -301,7 +301,6 @@ libdali_adaptor_la_LIBADD = \
                       $(ELDBUS_LIBS) \
                       -lgif \
                       -lpthread \
-                      -lboost_thread \
                       -lturbojpeg
 
 if WAYLAND
index bbb5954..3707bfb 100644 (file)
@@ -1,14 +1,48 @@
 #ifndef __DALI_ADAPTOR_DOC_H__
 #define __DALI_ADAPTOR_DOC_H__
 
+/*
+ * Copyright (c) 2015 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.
+ *
+ */
+
 /**
  * @defgroup dali_adaptor DALi Adaptor
  *
- * @brief This module is a platform adaptation layer. It initializes and sets up DALi appropriately.
- * The module provides many platform-related services with its internal module,
+ * @brief DALi Adaptor is a platform adaptation layer. 
+ *
+ * It initializes and sets up DALi appropriately and
+ * provides many platform-related services with its internal module,
  * platform abstraction. Several signals can be connected to it to keep you informed when
  * certain platform-related activities occur.
  *
+ * @section dali_adaptor_overview Overview
+ *
+ * DALi Adaptor consists of the following groups of API:
+ *
+ * <table>
+ * <tr>
+ *    <th>API Group</th>
+ *    <th>Description</th>
+ * </tr>
+ * <tr>
+ *    <td>@ref dali_adaptor_framework</td>
+ *    <td>Classes for the adaption layer.</td>
+ * </tr>
+ * </table>
+ *
  * @ingroup dali
  * @{
  *   @defgroup dali_adaptor_framework Adaptor Framework
index e01ba6f..20619f1 100644 (file)
@@ -41,14 +41,11 @@ Source0:    %{name}-%{version}.tar.gz
 
 Requires(post): /sbin/ldconfig
 Requires(postun): /sbin/ldconfig
-Requires:       boost-thread
-Requires:       boost-chrono
 Requires:       giflib
 BuildRequires:  pkgconfig
 BuildRequires:  gawk
 BuildRequires:  pkgconfig(sensor)
 BuildRequires:  pkgconfig(aul)
-BuildRequires:  boost-devel
 BuildRequires:  giflib-devel
 BuildRequires:  pkgconfig(fontconfig)
 BuildRequires:  pkgconfig(elementary)
@@ -99,7 +96,6 @@ Summary:    Development components for the DALi Tizen Adaptor
 Group:      Development/Building
 Requires:   %{name} = %{version}-%{release}
 Requires:   %{name}-integration-devel = %{version}-%{release}
-Requires:   boost-devel
 
 %description devel
 Development components for the DALi Tizen Adaptor - public headers and package configs
index 9371b11..2219b31 100644 (file)
@@ -108,7 +108,7 @@ bool LoadBmpHeader(FILE *fp, unsigned int &width, unsigned int &height, BmpFileH
   }
 
   width = infoHeader.width;
-  height = infoHeader.height;
+  height = abs(infoHeader.height);
 
   return true;
 }
index 1e41437..b567b6a 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 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.
@@ -240,17 +240,17 @@ bool LoadBitmapFromJpeg( const ResourceLoadingClient& client, const ImageLoader:
     return false;
   }
 
-  std::vector<unsigned char> jpegBuffer(0);
+  Vector<unsigned char> jpegBuffer;
   try
   {
-    jpegBuffer.reserve( jpegBufferSize );
+    jpegBuffer.Reserve( jpegBufferSize );
   }
   catch(...)
   {
     DALI_LOG_ERROR( "Could not allocate temporary memory to hold JPEG file of size %uMB.\n", jpegBufferSize / 1048576U );
     return false;
   }
-  unsigned char * const jpegBufferPtr = &jpegBuffer[0];
+  unsigned char * const jpegBufferPtr = jpegBuffer.Begin();
 
   // Pull the compressed JPEG image bytes out of a file and into memory:
   if( fread( jpegBufferPtr, 1, jpegBufferSize, fp ) != jpegBufferSize )
@@ -390,8 +390,9 @@ bool JpegRotate90(unsigned char *buffer, int width, int height, int bpp)
   int ix, iy = 0;
   iw = width;
   ih = height;
-  std::vector<unsigned char> data(width * height * bpp);
-  unsigned char *dataPtr = &data[0];
+  Vector<unsigned char> data;
+  data.Reserve(width * height * bpp);
+  unsigned char *dataPtr = data.Begin();
   memcpy(dataPtr, buffer, width * height * bpp);
   w = ih;
   ih = iw;
@@ -466,8 +467,9 @@ bool JpegRotate270(unsigned char *buffer, int width, int height, int bpp)
 
   iw = width;
   ih = height;
-  std::vector<unsigned char> data(width * height * bpp);
-  unsigned char *dataPtr = &data[0];
+  Vector<unsigned char> data;
+  data.Reserve(width * height * bpp);
+  unsigned char *dataPtr = data.Begin();
   memcpy(dataPtr, buffer, width * height * bpp);
   w = ih;
   ih = iw;
@@ -504,7 +506,8 @@ bool JpegRotate270(unsigned char *buffer, int width, int height, int bpp)
   return true;
 }
 
-bool EncodeToJpeg( const unsigned char* const pixelBuffer, std::vector< unsigned char >& encodedPixels, const std::size_t width, const std::size_t height, const Pixel::Format pixelFormat, unsigned quality)
+bool EncodeToJpeg( const unsigned char* const pixelBuffer, Vector< unsigned char >& encodedPixels,
+                   const std::size_t width, const std::size_t height, const Pixel::Format pixelFormat, unsigned quality )
 {
   if( !pixelBuffer )
   {
@@ -576,9 +579,9 @@ bool EncodeToJpeg( const unsigned char* const pixelBuffer, std::vector< unsigned
     // Safely wrap the jpeg codec's buffer in case we are about to throw, then
     // save the pixels to a persistent buffer that we own and let our cleaner
     // class clean up the buffer as it goes out of scope:
-    AutoJpgMem cleaner(dstBuffer);
-    encodedPixels.resize(dstBufferSize);
-    memcpy(&encodedPixels[0], dstBuffer, dstBufferSize);
+    AutoJpgMem cleaner( dstBuffer );
+    encodedPixels.Reserve( dstBufferSize );
+    memcpy( encodedPixels.Begin(), dstBuffer, dstBufferSize );
   }
   return true;
 }
@@ -708,44 +711,28 @@ bool TransformSize( int requiredWidth, int requiredHeight,
       {
         bool widthLessRequired  = TJSCALED( postXformImageWidth,  factors[i]) < requiredWidth;
         bool heightLessRequired = TJSCALED( postXformImageHeight, factors[i]) < requiredHeight;
-        switch( fittingMode )
+        // If either scaled dimension is smaller than the desired one, we were done at the last iteration
+        if ( (fittingMode == FittingMode::SCALE_TO_FILL) && (widthLessRequired || heightLessRequired) )
         {
-          // If either scaled dimension is smaller than the desired one, we were done at the last iteration:
-          case FittingMode::SCALE_TO_FILL:
-          {
-            if ( widthLessRequired || heightLessRequired )
-            {
-              break;
-            }
-          }
-          // If both dimensions are smaller than the desired one, we were done at the last iteration:
-          case FittingMode::SHRINK_TO_FIT:
-          {
-            if ( widthLessRequired && heightLessRequired )
-            {
-              break;
-            }
-          }
-          // If the width is smaller than the desired one, we were done at the last iteration:
-          case FittingMode::FIT_WIDTH:
-          {
-            if ( widthLessRequired )
-            {
-              break;
-            }
-          }
-          // If the width is smaller than the desired one, we were done at the last iteration:
-          case FittingMode::FIT_HEIGHT:
-          {
-            if ( heightLessRequired )
-            {
-              break;
-            }
-          }
-
-          // This factor stays is within our fitting mode constraint so remember it:
-          scaleFactorIndex = i;
+          break;
         }
+        // If both dimensions are smaller than the desired one, we were done at the last iteration:
+        if ( (fittingMode == FittingMode::SHRINK_TO_FIT) && ( widthLessRequired && heightLessRequired ) )
+        {
+          break;
+        }
+        // If the width is smaller than the desired one, we were done at the last iteration:
+        if ( fittingMode == FittingMode::FIT_WIDTH && widthLessRequired )
+        {
+          break;
+        }
+        // If the width is smaller than the desired one, we were done at the last iteration:
+        if ( fittingMode == FittingMode::FIT_HEIGHT && heightLessRequired )
+        {
+          break;
+        }
+        // This factor stays is within our fitting mode constraint so remember it:
+        scaleFactorIndex = i;
       }
     }
 
index c233fd5..65ccc2e 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TIZEN_PLATFORM_LOADER_JPEG_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 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.
@@ -19,7 +19,7 @@
  */
 
 #include <stdio.h>
-#include <dali/public-api/common/vector-wrapper.h>
+#include <dali/public-api/common/dali-vector.h>
 #include <dali/public-api/images/pixel.h>
 #include "image-encoder.h"
 #include "image-loader-input.h"
@@ -75,7 +75,7 @@ bool LoadJpegHeader( const ImageLoader::Input& input, unsigned int& width, unsig
  * @param[in]  pixelFormat    Input pixel format (must be Pixel::RGB888)
  * @param[in]  quality        JPEG quality on usual 1 to 100 scale.
  */
-bool EncodeToJpeg(const unsigned char* pixelBuffer, std::vector< unsigned char >& encodedPixels, std::size_t width, std::size_t height, Pixel::Format pixelFormat, unsigned quality = 80);
+bool EncodeToJpeg(const unsigned char* pixelBuffer, Vector< unsigned char >& encodedPixels, std::size_t width, std::size_t height, Pixel::Format pixelFormat, unsigned quality = 80);
 
 } // namespace TizenPlatform
 
index d6d6273..04ef78c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 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.
@@ -347,28 +347,29 @@ namespace
    * */
   extern "C" void WriteData(png_structp png_ptr, png_bytep data, png_size_t length)
   {
-    using Dali::TizenPlatform::PngBuffer;
     DALI_ASSERT_DEBUG(png_ptr && data);
     if(!png_ptr || !data)
     {
       return;
     }
     // Make sure we don't try to propagate a C++ exception up the call stack of a pure C library:
-    try {
+    try
+    {
       // Recover our buffer for writing into:
-      PngBuffer* const encoded_img = (PngBuffer*) png_get_io_ptr(png_ptr);
+      Vector<unsigned char>* const encoded_img = static_cast< Vector<unsigned char>* >( png_get_io_ptr(png_ptr) );
       if(encoded_img)
       {
-        const PngBuffer::size_type bufferSize = encoded_img->size();
-        encoded_img->resize(encoded_img->size() + length); //< Can throw OOM.
-        PngBuffer::value_type* const bufferBack = &((*encoded_img)[bufferSize]);
+        const Vector<unsigned char>::SizeType bufferSize = encoded_img->Count();
+        encoded_img->Reserve( bufferSize + length ); //< Can throw OOM.
+        unsigned char* const bufferBack = encoded_img->Begin() + bufferSize;
         memcpy(bufferBack, data, length);
       }
       else
       {
         DALI_LOG_ERROR("PNG buffer for write to memory was passed from libpng as null.");
       }
-    } catch(...)
+    }
+    catch(...)
     {
       DALI_LOG_ERROR("C++ Exception caught");
     }
@@ -395,7 +396,7 @@ namespace
  * 7. If caller asks for no compression, bypass libpng and blat raw data to
  *    disk, topped and tailed with header/tail blocks.
  */
-bool EncodeToPng( const unsigned char* const pixelBuffer, PngBuffer& encodedPixels, std::size_t width, std::size_t height, Pixel::Format pixelFormat )
+bool EncodeToPng( const unsigned char* const pixelBuffer, Vector<unsigned char>& encodedPixels, std::size_t width, std::size_t height, Pixel::Format pixelFormat )
 {
   // Translate pixel format enum:
   int pngPixelFormat = -1;
@@ -455,7 +456,7 @@ bool EncodeToPng( const unsigned char* const pixelBuffer, PngBuffer& encodedPixe
 
   // Since we are going to write to memory instead of a file, lets provide
   // libpng with a custom write function and ask it to pass back our
-  // std::vector buffer each time it calls back to flush data to "file":
+  // Vector buffer each time it calls back to flush data to "file":
   png_set_write_fn(png_ptr, &encodedPixels, WriteData, FlushData);
 
   // png_set_compression_level( png_ptr, Z_BEST_COMPRESSION);
index 484226b..bfaab88 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TIZEN_PLATFORM_LOADER_PNG_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 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.
@@ -19,7 +19,7 @@
  */
 
 #include <cstdio>
-#include <dali/public-api/common/vector-wrapper.h>
+#include <dali/public-api/common/dali-vector.h>
 #include <dali/public-api/images/pixel.h>
 #include "image-encoder.h"
 #include "image-loader-input.h"
@@ -64,11 +64,6 @@ bool LoadBitmapFromPng( const ResourceLoadingClient& client, const ImageLoader::
 bool LoadPngHeader( const ImageLoader::Input& input, unsigned int& width, unsigned int& height );
 
 /**
- * A bucket of bytes representing a PNG image.
- **/
-typedef std::vector<unsigned char> PngBuffer;
-
-/**
  * Encode raw pixel data to PNG format.
  * @param[in]  pixelBuffer    Pointer to raw pixel data to be encoded
  * @param[out] encodedPixels  Encoded pixel data. Existing contents will be overwritten
@@ -76,7 +71,7 @@ typedef std::vector<unsigned char> PngBuffer;
  * @param[in]  height         Image height
  * @param[in]  pixelFormat    Input pixel format (must be Pixel::RGB888)
  */
-bool EncodeToPng( const unsigned char* pixelBuffer, PngBuffer& encodedPixels, std::size_t width, std::size_t height, Pixel::Format pixelFormat );
+bool EncodeToPng( const unsigned char* pixelBuffer, Vector<unsigned char>& encodedPixels, std::size_t width, std::size_t height, Pixel::Format pixelFormat );
 
 } // namespace TizenPlatform
 
index 89328aa..2caa5ef 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 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.
 #include "resource-loader.h"
 
 // EXTERNAL HEADERS
-#include <boost/thread.hpp>
 #include <iostream>
 #include <fstream>
 #include <queue>
+#include <cstring>
+#include <dali/devel-api/common/map-wrapper.h>
+#include <dali/devel-api/common/mutex.h>
 
 // INTERNAL HEADERS
 #include <dali/integration-api/bitmap.h>
 #include "resource-bitmap-requester.h"
 #include "debug/resource-loader-debug.h"
 
-
-/**
- * A macro to expand an argument to a compile time constant string literal.
- * Wrapping the stringify in an outer macro, means that any macro passed as
- * "x" will be expanded before being turned into a string.
- * Use this for example to turn the current line number into a string:
- *   puts("The current line number is " DALI_TO_STRING(__LINE__) ".");
- */
-#define DALI_TO_STRING_INNER(x) #x
-#define DALI_TO_STRING(x) DALI_TO_STRING_INNER(x)
-
 using namespace Dali::Integration;
-using boost::mutex;
-using boost::unique_lock;
 
 namespace Dali
 {
@@ -56,12 +45,6 @@ namespace Dali
 namespace TizenPlatform
 {
 
-namespace
-{
-
-} // unnamed namespace
-
-
 struct ResourceLoader::ResourceLoaderImpl
 {
   typedef std::pair<ResourceId, ResourceRequest>  RequestStorePair;
@@ -75,8 +58,7 @@ struct ResourceLoader::ResourceLoaderImpl
   typedef std::map<ResourceTypeId,  ResourceRequesterBase*> RequestHandlers;
   typedef RequestHandlers::iterator                         RequestHandlersIter;
 
-  boost::mutex mQueueMutex;             ///< used to synchronize access to mLoadedQueue and mFailedQueue
-  LoadedQueue  mPartiallyLoadedQueue;   ///< Partially complete load requests notifications are stored here until fetched by core
+  Dali::Mutex  mQueueMutex;             ///< used to synchronize access to mLoadedQueue and mFailedQueue
   LoadedQueue  mLoadedQueue;            ///< Completed load requests notifications are stored here until fetched by core
   FailedQueue  mFailedLoads;            ///< Failed load request notifications are stored here until fetched by core
 
@@ -153,7 +135,7 @@ struct ResourceLoader::ResourceLoaderImpl
     else
     {
       DALI_LOG_ERROR( "Unknown resource type (%u) with path \"%s\" in load request.\n", request.GetType()->id, request.GetPath().c_str() );
-      DALI_ASSERT_DEBUG( 0 == "Unknown resource type in load request at " __FILE__ ", line " DALI_TO_STRING(__LINE__) ".\n" );
+      DALI_ASSERT_DEBUG( 0 == "Unknown resource type in load request at " __FILE__ ".\n" );
     }
   }
 
@@ -192,27 +174,11 @@ struct ResourceLoader::ResourceLoaderImpl
     return loadStatus;
   }
 
-  bool IsLoading()
-  {
-    // TODO - not used - remove?
-    DALI_ASSERT_DEBUG( 0 == "IsLoading() Is not implemented so don't call it." );
-    return true;
-  }
-
   void GetResources(ResourceCache& cache)
   {
     // Fill the resource cache
 
-    unique_lock<mutex> lock(mQueueMutex);
-
-    // iterate through the partially loaded resources
-    while (!mPartiallyLoadedQueue.empty())
-    {
-      LoadedResource loaded( mPartiallyLoadedQueue.front() );
-      mPartiallyLoadedQueue.pop();
-      LoadStatus loadStatus = LoadFurtherResources( loaded );
-      cache.LoadResponse( loaded.id, loaded.type, loaded.resource, loadStatus );
-    }
+    Mutex::ScopedLock lock( mQueueMutex );
 
     // iterate through the successfully loaded resources
     while (!mLoadedQueue.empty())
@@ -233,18 +199,10 @@ struct ResourceLoader::ResourceLoaderImpl
     }
   }
 
-  void AddPartiallyLoadedResource( LoadedResource& resource)
-  {
-    // Lock the LoadedQueue to store the loaded resource
-    unique_lock<mutex> lock(mQueueMutex);
-
-    mPartiallyLoadedQueue.push( resource );
-  }
-
   void AddLoadedResource(LoadedResource& resource)
   {
     // Lock the LoadedQueue to store the loaded resource
-    unique_lock<mutex> lock(mQueueMutex);
+    Mutex::ScopedLock lock( mQueueMutex );
 
     mLoadedQueue.push( resource );
   }
@@ -252,7 +210,7 @@ struct ResourceLoader::ResourceLoaderImpl
   void AddFailedLoad(FailedResource& resource)
   {
     // Lock the FailedQueue to store the failed resource information
-    unique_lock<mutex> lock(mQueueMutex);
+    Mutex::ScopedLock lock( mQueueMutex );
 
     mFailedLoads.push(resource);
   }
@@ -327,11 +285,6 @@ void ResourceLoader::GetResources(ResourceCache& cache)
 /**************************   CALLED FROM LOADER THREADS   **********************/
 /********************************************************************************/
 
-void ResourceLoader::AddPartiallyLoadedResource( LoadedResource& resource)
-{
-  mImpl->AddPartiallyLoadedResource( resource );
-}
-
 void ResourceLoader::AddLoadedResource(LoadedResource& resource)
 {
   mImpl->AddLoadedResource( resource );
@@ -356,16 +309,6 @@ void ResourceLoader::CancelLoad(ResourceId id, ResourceTypeId typeId)
   mImpl->CancelLoad(id, typeId);
 }
 
-bool ResourceLoader::IsLoading()
-{
-  return mImpl->IsLoading();
-}
-
-void ResourceLoader::SetDpi(unsigned int dpiHor, unsigned int dpiVer)
-{
-  // Unused
-}
-
 bool ResourceLoader::LoadFile( const std::string& filename, std::vector< unsigned char >& buffer ) const
 {
   Dali::Vector<unsigned char> daliVec;
@@ -446,11 +389,6 @@ std::string ResourceLoader::LoadFile(const std::string& filename) const
   return contents;
 }
 
-bool ResourceLoader::SaveFile(const std::string& filename, std::vector< unsigned char >& buffer)
-{
-  return SaveFile( filename, &buffer[0], buffer.size() );
-}
-
 bool ResourceLoader::SaveFile(const std::string& filename, const unsigned char * buffer, unsigned int numBytes )
 {
   DALI_LOG_TRACE_METHOD(gLoaderFilter);
index d493c56..27028ee 100644 (file)
@@ -84,45 +84,6 @@ struct LoadedResource
 };
 
 /**
- * Contains information about a successfully saved resource
- */
-struct SavedResource
-{
-  /**
-   * Constructor
-   * @param[in] savedId   The ID of the resource
-   * @param[in] savedType The resource type
-   */
-  SavedResource(Integration::ResourceId     savedId,
-                Integration::ResourceTypeId savedType)
-  : id(savedId),
-    type(savedType)
-  {
-  }
-
-  /// Copy constructor
-  SavedResource(const LoadedResource& loaded)
-  : id(loaded.id),
-    type(loaded.type)
-  {
-  }
-
-  /// Assignment operator
-  SavedResource& operator=(const SavedResource& rhs)
-  {
-    if( this != &rhs )
-    {
-      id = rhs.id;
-      type = rhs.type;
-    }
-    return *this;
-  }
-
-  Integration::ResourceId     id;
-  Integration::ResourceTypeId type;
-};
-
-/**
  * Contains information about a failed resource load/save request
  */
 struct FailedResource
@@ -194,36 +155,17 @@ public:
   bool IsTerminating();
 
   /**
-   * Add a partially loaded resource to the PartiallyLoadedResource queue
-   * @param[in] resource The resource's information and data
-   */
-  void AddPartiallyLoadedResource(LoadedResource& resource);
-
-  /**
    * Add a completely loaded resource to the LoadedResource queue
    * @param[in] resource The resource's information and data
    */
   void AddLoadedResource(LoadedResource& resource);
 
   /**
-   * Add a successfully saved resource to the SavedResource queue
-   * @param[in] resource The resource's information
-   */
-  void AddSavedResource(SavedResource& resource);
-
-  /**
    * Add information about a failed resource load to the FailedLoads queue
    * @param[in] resource The failed resource's information
    */
   void AddFailedLoad(FailedResource& resource);
 
-  /**
-   * Add information about a failed resource save to the FailedSaves queue
-   * @param[in] resource The failed resource's information
-   */
-  void AddFailedSave(FailedResource& resource);
-
-
   // From PlatformAbstraction
 
   /**
@@ -237,22 +179,11 @@ public:
   void CancelLoad(Integration::ResourceId id, Integration::ResourceTypeId typeId);
 
   /**
-   * @copydoc PlatformAbstraction::IsLoading()
-   * @deprecated This is not implemented: always returns true.
-   */
-  bool IsLoading();
-
-  /**
    * @copydoc PlatformAbstraction::GetResources()
    */
   void GetResources(Integration::ResourceCache& cache);
 
   /**
-   * @copydoc PlatformAbstraction::SetDpi()
-   */
-  void SetDpi(unsigned int dpiHor, unsigned int dpiVer);
-
-  /**
    * @copydoc SlpPlatformAbstraction::LoadFile()
    */
   bool LoadFile( const std::string& filename, std::vector< unsigned char >& buffer ) const;
@@ -266,7 +197,6 @@ public:
   /**
    * @copydoc TizenPlatformAbstraction::SaveFile()
    */
-  static bool SaveFile( const std::string& filename, std::vector< unsigned char >& buffer );
   static bool SaveFile( const std::string& filename, const unsigned char * buffer, unsigned int numBytes );
 
 private:
index e3f101f..ffa029f 100644 (file)
  *
  */
 
+// EXTERNAL INCLUDES
+#include <memory>
 #include <dali/integration-api/debug.h>
+
+// INTERNAL INCLUDES
 #include "resource-thread-base.h"
 #include "tizen-logging.h"
 #include "atomics.h"
 
 using namespace Dali::Integration;
-using boost::mutex;
-using boost::unique_lock;
 
 namespace Dali
 {
@@ -35,10 +37,11 @@ const Integration::ResourceId NO_REQUEST_CANCELLED = Integration::ResourceId(0)
 
 namespace TizenPlatform
 {
+using Internal::Adaptor::ConditionalWait;
 
 namespace
 {
-const char * const IDLE_PRIORITY_ENVIRONMENT_VARIABLE_NAME = "DALI_RESOURCE_THREAD_IDLE_PRIORITY"; ///@Todo Move this to somewhere that other environment variables are declared and document it there.
+const char * const IDLE_PRIORITY_ENVIRONMENT_VARIABLE_NAME = "DALI_RESOURCE_THREAD_IDLE_PRIORITY";
 } // unnamed namespace
 
 /** Thrown by InterruptionPoint() to abort a request early. */
@@ -46,6 +49,7 @@ class CancelRequestException {};
 
 ResourceThreadBase::ResourceThreadBase( ResourceLoader& resourceLoader ) :
   mResourceLoader( resourceLoader ),
+  mThread( 0 ),
   mCurrentRequestId( NO_REQUEST_IN_FLIGHT ),
   mCancelRequestId( NO_REQUEST_CANCELLED ),
   mPaused( false )
@@ -54,7 +58,8 @@ ResourceThreadBase::ResourceThreadBase( ResourceLoader& resourceLoader ) :
   mLogFilter = Debug::Filter::New(Debug::Concise, false, "LOG_RESOURCE_THREAD_BASE");
 #endif
 
-  mThread = new boost::thread(boost::bind(&ResourceThreadBase::ThreadLoop, this));
+  int error = pthread_create( &mThread, NULL, InternalThreadEntryFunc, this );
+  DALI_ASSERT_ALWAYS( !error && "Error in pthread_create()" );
 }
 
 ResourceThreadBase::~ResourceThreadBase()
@@ -71,13 +76,12 @@ void ResourceThreadBase::TerminateThread()
   if (mThread)
   {
     // wake thread
-    mCondition.notify_all();
+    mCondition.Notify();
+
     // wait for thread to exit
-    mThread->join();
-    // delete thread instance
-    delete mThread;
-    // mark thread terminated
-    mThread = NULL;
+    pthread_join( mThread, NULL );
+
+    mThread = 0;
   }
 }
 
@@ -88,7 +92,7 @@ void ResourceThreadBase::AddRequest(const ResourceRequest& request, const Reques
 
   {
     // Lock while adding to the request queue
-    unique_lock<mutex> lock( mMutex );
+    ConditionalWait::ScopedLock lock( mCondition );
 
     wasEmpty = mQueue.empty();
     wasPaused = mPaused;
@@ -99,7 +103,7 @@ void ResourceThreadBase::AddRequest(const ResourceRequest& request, const Reques
   if( wasEmpty && !wasPaused )
   {
     // Wake-up the thread
-    mCondition.notify_all();
+    mCondition.Notify();
   }
 }
 
@@ -112,7 +116,7 @@ void ResourceThreadBase::CancelRequest( const Integration::ResourceId resourceId
   // Eliminate the cancelled request from the request queue if it is in there:
   {
     // Lock while searching and removing from the request queue:
-    unique_lock<mutex> lock( mMutex );
+    ConditionalWait::ScopedLock lock( mCondition );
 
     for( RequestQueueIter iterator = mQueue.begin();
          iterator != mQueue.end();
@@ -149,9 +153,15 @@ void ResourceThreadBase::InterruptionPoint() const
   }
 }
 
+void* ResourceThreadBase::InternalThreadEntryFunc( void* This )
+{
+    ( static_cast<ResourceThreadBase*>( This ) )->ThreadLoop();
+    return NULL;
+}
+
 void ResourceThreadBase::Pause()
 {
-  unique_lock<mutex> lock( mMutex );
+  ConditionalWait::ScopedLock lock( mCondition );
   mPaused = true;
 }
 
@@ -160,7 +170,7 @@ void ResourceThreadBase::Resume()
   // Clear the paused flag and if we weren't running already, also wake up the background thread:
   bool wasPaused = false;
   {
-    unique_lock<mutex> lock( mMutex );
+    ConditionalWait::ScopedLock lock( mCondition );
     wasPaused = mPaused;
     mPaused = false;
   }
@@ -169,7 +179,7 @@ void ResourceThreadBase::Resume()
   // chance to do some work:
   if( wasPaused )
   {
-    mCondition.notify_all();
+    mCondition.Notify();
   }
 }
 
@@ -231,13 +241,13 @@ void ResourceThreadBase::ThreadLoop()
 
 void ResourceThreadBase::WaitForRequests()
 {
-  unique_lock<mutex> lock( mMutex );
+  ConditionalWait::ScopedLock lock( mCondition );
 
   if( mQueue.empty() || mPaused == true )
   {
     // Waiting for a wake up from resource loader control thread
     // This will be to process a new request or terminate
-    mCondition.wait(lock);
+    mCondition.Wait( lock );
   }
 }
 
@@ -248,7 +258,7 @@ void ResourceThreadBase::ProcessNextRequest()
 
   {
     // lock the queue and extract the next request
-    unique_lock<mutex> lock(mMutex);
+    ConditionalWait::ScopedLock lock( mCondition );
 
     if (!mQueue.empty())
     {
@@ -283,12 +293,6 @@ void ResourceThreadBase::ProcessNextRequest()
         Decode(*request);
       }
       break;
-
-      case RequestSave:
-      {
-        Save(*request);
-      }
-      break;
     }
   }
 }
index 9a88a67..6395e6e 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TIZEN_PLATFORM_RESOURCE_THREAD_BASE_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 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.
 // INTERNAL INCLUDES
 #include "resource-loader.h"
 #include "resource-loading-client.h"
-#include <dali/integration-api/platform-abstraction.h>
-#include <dali/integration-api/resource-cache.h>
+#include <base/conditional-wait.h>
 
 // EXTERNAL INCLUDES
 #include <deque>
-#include <boost/thread.hpp>
 
 namespace Dali
 {
@@ -51,9 +49,7 @@ public:
     /** Pull a resource from the network. */
     RequestDownload,
     /** Pull a resource out of a memory buffer. */
-    RequestDecode,
-    /** Push a resource's data out to the file system. */
-    RequestSave
+    RequestDecode
   };
 
   typedef std::pair<Integration::ResourceRequest, RequestType>  RequestInfo;
@@ -142,28 +138,28 @@ protected:
   virtual void Decode(const Integration::ResourceRequest& request);
 
   /**
-   * Save a resource
-   * @param[in] request  The requested resource/file url and attributes
-   */
-  virtual void Save(const Integration::ResourceRequest& request) = 0;
-
-  /**
    * @brief Cancels current resource request if it matches the one latched to be cancelled.
    *
    * @copydoc ResourceLoadingClient::InterruptionPoint
    */
   virtual void InterruptionPoint() const;
 
+private:
+  /**
+   * Helper for the thread calling the entry function
+   * @param[in] This A pointer to the current UpdateThread object
+   */
+  static void* InternalThreadEntryFunc( void* This );
+
 protected:
-  ResourceLoader& mResourceLoader;
-  boost::thread* mThread;                       ///< thread instance
-  boost::condition_variable mCondition;         ///< condition variable
-  boost::mutex mMutex;                          ///< used to protect mQueue
-  RequestQueue mQueue;                          ///< Request queue
+  ResourceLoader&                    mResourceLoader;
+  pthread_t                          mThread;    ///< thread instance
+  Internal::Adaptor::ConditionalWait mCondition; ///< condition variable
+  RequestQueue                       mQueue;     ///< Request queue
 private:
-  Integration::ResourceId mCurrentRequestId;    ///< Current request, set by worker thread
-  volatile Integration::ResourceId mCancelRequestId; ///< Request to be cancelled on thread: written by external thread and read by worker.
-  bool mPaused;                                ///< Whether to process work in mQueue
+  Integration::ResourceId          mCurrentRequestId; ///< Current request, set by worker thread
+  volatile Integration::ResourceId mCancelRequestId;  ///< Request to be cancelled on thread: written by external thread and read by worker.
+  bool                             mPaused;           ///< Whether to process work in mQueue
 
 private:
 
index 5838721..02886c0 100755 (executable)
@@ -102,13 +102,6 @@ void ResourceThreadImage::Decode(const ResourceRequest& request)
   }
 }
 
-void ResourceThreadImage::Save(const Integration::ResourceRequest& request)
-{
-  DALI_LOG_TRACE_METHOD( mLogFilter );
-  DALI_ASSERT_DEBUG( request.GetType()->id == ResourceBitmap );
-  DALI_LOG_WARNING( "Image saving not supported on background resource threads." );
-}
-
 bool ResourceThreadImage::DownloadRemoteImageIntoMemory(const Integration::ResourceRequest& request, Dali::Vector<uint8_t>& dataBuffer, size_t& dataSize)
 {
   bool ok = Network::DownloadRemoteFileIntoMemory( request.GetPath(), dataBuffer,  dataSize, MAXIMUM_DOWNLOAD_IMAGE_SIZE );
index 91d5188..6d9a009 100644 (file)
@@ -62,11 +62,6 @@ private:
   virtual void Decode(const Integration::ResourceRequest& request);
 
   /**
-   *@copydoc ResourceThreadBase::Save
-   */
-  virtual void Save(const Integration::ResourceRequest& request);
-
-  /**
    * Download a requested image into a memory buffer.
    * @param[in] request  The requested resource/file url and attributes
    * @param[out] dataBuffer  A memory buffer object to be written with downloaded image data.
index ebc9fad..26debc0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 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.
@@ -152,16 +152,6 @@ void TizenPlatformAbstraction::CancelLoad(Integration::ResourceId id, Integratio
   }
 }
 
-bool TizenPlatformAbstraction::IsLoading()
-{
-  if (mResourceLoader)
-  {
-    return mResourceLoader->IsLoading();
-  }
-
-  return false;
-}
-
 void TizenPlatformAbstraction::GetResources(Integration::ResourceCache& cache)
 {
   if (mResourceLoader)
@@ -170,14 +160,6 @@ void TizenPlatformAbstraction::GetResources(Integration::ResourceCache& cache)
   }
 }
 
-void TizenPlatformAbstraction::SetDpi(unsigned int dpiHor, unsigned int dpiVer)
-{
-  if (mResourceLoader)
-  {
-    mResourceLoader->SetDpi(dpiHor, dpiVer);
-  }
-}
-
 bool TizenPlatformAbstraction::LoadFile( const std::string& filename, Dali::Vector< unsigned char >& buffer ) const
 {
   bool result = false;
@@ -201,18 +183,6 @@ std::string TizenPlatformAbstraction::LoadFile( const std::string& filename )
   return result;
 }
 
-bool TizenPlatformAbstraction::SaveFile(const std::string& filename, const unsigned char * buffer, unsigned int numBytes ) const
-{
-  bool result = false;
-
-  if( mResourceLoader )
-  {
-    result = mResourceLoader->SaveFile( filename, buffer, numBytes );
-  }
-
-  return result;
-}
-
 void TizenPlatformAbstraction::JoinLoaderThreads()
 {
   delete mResourceLoader;
index 58d6c1d..99c54a9 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TIZEN_PLATFORM_ABSTRACTION_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 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.
@@ -116,11 +116,6 @@ public: // PlatformAbstraction overrides
   virtual void GetResources(Integration::ResourceCache& cache);
 
   /**
-   * @copydoc PlatformAbstraction::IsLoading()
-   */
-  virtual bool IsLoading();
-
-  /**
    * @copydoc PlatformAbstraction::JoinLoaderThreads()
    */
   virtual void JoinLoaderThreads();
@@ -131,11 +126,6 @@ public: // PlatformAbstraction overrides
   virtual int GetDefaultFontSize() const;
 
   /**
-   * @copydoc PlatformAbstraction::SetDpi()
-   */
-  virtual void SetDpi (unsigned int DpiHorizontal, unsigned int DpiVertical);
-
-  /**
    * @copydoc PlatformAbstraction::LoadFile()
    */
   virtual bool LoadFile( const std::string& filename, Dali::Vector< unsigned char >& buffer ) const;
@@ -146,11 +136,6 @@ public: // PlatformAbstraction overrides
   virtual std::string LoadFile( const std::string& filename );
 
   /**
-   * @copydoc PlatformAbstraction::SaveFile()
-   */
-  virtual bool SaveFile(const std::string& filename, const unsigned char * buffer, unsigned int numBytes ) const;
-
-  /**
    * @copydoc PlatformAbstraction::LoadShaderBinaryFile()
    */
   virtual bool LoadShaderBinaryFile( const std::string& filename, Dali::Vector< unsigned char >& buffer ) const;
index 997e999..f6b8fc9 100644 (file)
@@ -119,7 +119,7 @@ FontId FontClient::GetFontId( const FontDescription& fontDescription,
 
 bool FontClient::IsScalable( const FontPath& path )
 {
-  return GetImplementation(*this).IsScalable( path );;
+  return GetImplementation(*this).IsScalable( path );
 }
 
 bool FontClient::IsScalable( const FontDescription& fontDescription )