Moved TextAbstraction to use absolute paths 18/34618/7
authorPaul Wisbey <p.wisbey@samsung.com>
Thu, 29 Jan 2015 13:11:50 +0000 (13:11 +0000)
committerPaul Wisbey <p.wisbey@samsung.com>
Fri, 30 Jan 2015 11:11:11 +0000 (11:11 +0000)
Minor tweak to GlyphMetrics structure

Change-Id: Ibf803bcc2dfe705974d314ccf79d451d56989c42

25 files changed:
build/tizen/adaptor/Makefile.am
platform-abstractions/slp/data-cache/metrics-cache.cpp [deleted file]
text-abstraction/file.list [deleted file]
text/dali/internal/text-abstraction/font-client-impl.cpp [moved from text-abstraction/internal/font-client-impl.cpp with 96% similarity]
text/dali/internal/text-abstraction/font-client-impl.h [moved from text-abstraction/internal/font-client-impl.h with 95% similarity]
text/dali/internal/text-abstraction/reordering-impl.cpp [moved from text-abstraction/internal/reordering-impl.cpp with 100% similarity]
text/dali/internal/text-abstraction/reordering-impl.h [moved from text-abstraction/internal/reordering-impl.h with 96% similarity]
text/dali/internal/text-abstraction/segmentation-impl.cpp [moved from text-abstraction/internal/segmentation-impl.cpp with 100% similarity]
text/dali/internal/text-abstraction/segmentation-impl.h [moved from text-abstraction/internal/segmentation-impl.h with 96% similarity]
text/dali/internal/text-abstraction/shaping-impl.cpp [moved from text-abstraction/internal/shaping-impl.cpp with 100% similarity]
text/dali/internal/text-abstraction/shaping-impl.h [moved from text-abstraction/internal/shaping-impl.h with 96% similarity]
text/dali/public-api/text-abstraction/font-client.cpp [moved from text-abstraction/public-api/font-client.cpp with 80% similarity]
text/dali/public-api/text-abstraction/font-client.h [moved from text-abstraction/public-api/font-client.h with 84% similarity]
text/dali/public-api/text-abstraction/font-list.cpp [moved from text-abstraction/public-api/font-list.cpp with 94% similarity]
text/dali/public-api/text-abstraction/font-list.h [moved from text-abstraction/public-api/font-list.h with 100% similarity]
text/dali/public-api/text-abstraction/glyph-info.h [moved from text-abstraction/public-api/glyph-metrics.h with 68% similarity]
text/dali/public-api/text-abstraction/reordering.cpp [moved from text-abstraction/public-api/reordering.cpp with 89% similarity]
text/dali/public-api/text-abstraction/reordering.h [moved from text-abstraction/public-api/reordering.h with 100% similarity]
text/dali/public-api/text-abstraction/segmentation.cpp [moved from text-abstraction/public-api/segmentation.cpp with 89% similarity]
text/dali/public-api/text-abstraction/segmentation.h [moved from text-abstraction/public-api/segmentation.h with 100% similarity]
text/dali/public-api/text-abstraction/shaping.cpp [moved from text-abstraction/public-api/shaping.cpp with 89% similarity]
text/dali/public-api/text-abstraction/shaping.h [moved from text-abstraction/public-api/shaping.h with 100% similarity]
text/dali/public-api/text-abstraction/text-abstraction-definitions.h [moved from text-abstraction/public-api/text-type-definitions.h with 87% similarity]
text/dali/public-api/text-abstraction/text-abstraction.h [moved from text-abstraction/public-api/text-abstraction.h with 87% similarity]
text/file.list [new file with mode: 0644]

index 1fb2967..6494152 100644 (file)
@@ -29,8 +29,8 @@ portable_platform_abstraction_src_dir = ../../../platform-abstractions/portable
 include ../../../platform-abstractions/slp/file.list
 
 # Text Abstraction
-text_abstraction_src_dir = ../../../text-abstraction
-include ../../../text-abstraction/file.list
+text_src_dir = ../../../text
+include ../../../text/file.list
 
 # Internal Common
 adaptor_common_dir = ../../../adaptors/common
@@ -185,7 +185,7 @@ libdali_adaptor_la_includes = \
                       -I../../../adaptors/public-api \
                       -I../../../adaptors/public-api/adaptor-framework \
                       -I../../../adaptors/common \
-                      -I../../../text-abstraction \
+                      -I../../../text \
                       -I../../../adaptors/
 if WAYLAND
 libdali_adaptor_la_includes += \
diff --git a/platform-abstractions/slp/data-cache/metrics-cache.cpp b/platform-abstractions/slp/data-cache/metrics-cache.cpp
deleted file mode 100644 (file)
index 822bb08..0000000
+++ /dev/null
@@ -1,297 +0,0 @@
-/*
- * 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.
- *
- */
-
-// CLASS HEADER
-#include "metrics-cache.h"
-
-// EXTERNAL HEADERS
-#include <iostream>
-#include <fstream>
-#include <string>
-#include <algorithm>
-#include <boost/functional/hash.hpp>
-#include <string.h>
-
-// INTERNAL HEADERS
-#include <dali/integration-api/glyph-set.h>
-
-
-namespace Dali
-{
-
-namespace // Anonymous namespace
-{
-
-const std::size_t VERSION_SIZE( sizeof(__DATE__ "-" __TIME__) );  // (date-time)
-const char FILE_VERSION[ VERSION_SIZE ] =  __DATE__ "-" __TIME__; // Updates with each build
-
-const size_t CHECKSUM_SIZE( sizeof( size_t ) );
-const size_t NUMBER_GLOBAL_METRICS( 9 ); // line height, ascender, unitsPerEM, underlinePosition, underlineThickness, maxWidth, maxHeight, padAdjustX, padAdjustY
-const size_t GLOBAL_METRICS_SIZE( NUMBER_GLOBAL_METRICS * sizeof( float ) );
-const size_t GLOBAL_METRIC_HEADER_SIZE( GLOBAL_METRICS_SIZE + CHECKSUM_SIZE + VERSION_SIZE );
-const std::string DALI_DEFAULT_FONT_CACHE_PATH( DALI_USER_FONT_CACHE_DIR );
-const std::string METRICS_EXTENSION( ".metrics" );
-
-
-std::string CreateFileName(const std::string& fontFamily, const std::string& fontStyle)
-{
-  std::string cacheFileName(DALI_DEFAULT_FONT_CACHE_PATH + fontFamily + "-" + fontStyle + METRICS_EXTENSION);
-
-  std::replace(cacheFileName.begin(), cacheFileName.end(), ' ', '-' );
-  return cacheFileName;
-}
-
-std::size_t CalculateGlobalMetricCheckSum( const Integration::GlobalMetrics& globalMetrics )
-{
-  int checksum = static_cast<int>( globalMetrics.lineHeight ) +
-                 static_cast<int>( globalMetrics.ascender )   +
-                 static_cast<int>( globalMetrics.unitsPerEM ) +
-                 static_cast<int>( globalMetrics.underlinePosition ) +
-                 static_cast<int>( globalMetrics.underlineThickness ) +
-                 static_cast<int>( globalMetrics.maxWidth ) +
-                 static_cast<int>( globalMetrics.maxHeight ) +
-                 static_cast<int>( globalMetrics.padAdjustX ) +
-                 static_cast<int>( globalMetrics.padAdjustY );
-
-
-  return boost::hash_value( checksum );
-
-}
-
-std::size_t CalculateGlyphCheckSum( const Integration::GlyphMetrics& metrics )
-{
-  int checksum =  static_cast<int>( metrics.code )    +
-                  static_cast<int>( metrics.width )   +
-                  static_cast<int>( metrics.height )  +
-                  static_cast<int>( metrics.top )     +
-                  static_cast<int>( metrics.left )    +
-                  static_cast<int>( metrics.xAdvance);
-
-  return boost::hash_value( checksum );
-}
-
-bool ReadGlyphMetrics( std::ifstream& file,  Integration::GlyphMetrics& metrics )
-{
-  std::size_t checkSumRead;
-  uint32_t code;
-
-  file.read( reinterpret_cast<char*>( &code ),         sizeof( uint32_t ) );
-  file.read( reinterpret_cast<char*>( &metrics.width ),   sizeof( float ) );
-  file.read( reinterpret_cast<char*>( &metrics.height ),  sizeof( float ) );
-  file.read( reinterpret_cast<char*>( &metrics.top ),     sizeof( float ) );
-  file.read( reinterpret_cast<char*>( &metrics.left ),    sizeof( float ) );
-  file.read( reinterpret_cast<char*>( &metrics.xAdvance), sizeof( float ) );
-  file.read( reinterpret_cast<char*>( &checkSumRead ),    sizeof( std::size_t ) );
-
-  metrics.code = code;  // code is now stored as a bit mask so we can't read directly in to it
-  metrics.quality = Integration::GlyphMetrics::LOW_QUALITY;
-
-  const std::size_t calcCheckSum = CalculateGlyphCheckSum( metrics );
-
-  return ( calcCheckSum == checkSumRead );
-}
-
-void WriteGlyphMetrics( std::ofstream& file, const Integration::GlyphMetrics& metrics )
-{
-  uint32_t code = metrics.code; // code is stored as a bitmask so we can't write directly from it
-  file.write( reinterpret_cast<const char*>( &code ),     sizeof( uint32_t ) );
-  file.write( reinterpret_cast<const char*>( &metrics.width ),    sizeof( float ) );
-  file.write( reinterpret_cast<const char*>( &metrics.height ),   sizeof( float ) );
-  file.write( reinterpret_cast<const char*>( &metrics.top ),      sizeof( float ) );
-  file.write( reinterpret_cast<const char*>( &metrics.left ),     sizeof( float ) );
-  file.write( reinterpret_cast<const char*>( &metrics.xAdvance ), sizeof( float ) );
-
-  const std::size_t calcCheckSum = CalculateGlyphCheckSum( metrics );
-
-  file.write( reinterpret_cast<const char*>( &calcCheckSum ), sizeof( std::size_t ) );
-}
-
-bool ReadGlyphGlobalMetrics( std::ifstream& file, Integration::GlobalMetrics& globalMetrics )
-{
-  char version_string[ VERSION_SIZE ];
-
-  // Check file version
-  file.read( version_string, VERSION_SIZE );
-  if( strncmp( version_string, FILE_VERSION, VERSION_SIZE ) != 0 )
-  {
-    DALI_LOG_WARNING( "Glyph metrics file version mismatch\n" );
-    return false;
-  }
-
-  std::size_t checkSumRead;
-
-  file.read( reinterpret_cast<char*>( &globalMetrics.lineHeight ), sizeof( float ) );
-  file.read( reinterpret_cast<char*>( &globalMetrics.ascender ), sizeof( float ) );
-  file.read( reinterpret_cast<char*>( &globalMetrics.unitsPerEM ), sizeof( float ) );
-  file.read( reinterpret_cast<char*>( &globalMetrics.underlinePosition ), sizeof( float ) );
-  file.read( reinterpret_cast<char*>( &globalMetrics.underlineThickness), sizeof( float ) );
-  file.read( reinterpret_cast<char*>( &globalMetrics.maxWidth), sizeof( float ) );
-  file.read( reinterpret_cast<char*>( &globalMetrics.maxHeight), sizeof( float ) );
-  file.read( reinterpret_cast<char*>( &globalMetrics.padAdjustX), sizeof( float ) );
-  file.read( reinterpret_cast<char*>( &globalMetrics.padAdjustY), sizeof( float ) );
-  file.read( reinterpret_cast<char*>( &checkSumRead ), sizeof( std::size_t ) );
-
-  const std::size_t calcCheckSum = CalculateGlobalMetricCheckSum( globalMetrics );
-
-  return (calcCheckSum == checkSumRead);
-}
-
-void WriteGlyphGlobalMetrics( std::ofstream &file, const Integration::GlobalMetrics& globalMetrics )
-{
-  file.write( FILE_VERSION, VERSION_SIZE );
-
-  file.write( reinterpret_cast<const char*>( &globalMetrics.lineHeight ), sizeof( float ) );
-  file.write( reinterpret_cast<const char*>( &globalMetrics.ascender ), sizeof( float ) );
-  file.write( reinterpret_cast<const char*>( &globalMetrics.unitsPerEM ), sizeof( float ) );
-  file.write( reinterpret_cast<const char*>( &globalMetrics.underlinePosition ), sizeof( float ) );
-  file.write( reinterpret_cast<const char*>( &globalMetrics.underlineThickness), sizeof( float ) );
-  file.write( reinterpret_cast<const char*>( &globalMetrics.maxWidth), sizeof( float ) );
-  file.write( reinterpret_cast<const char*>( &globalMetrics.maxHeight), sizeof( float ) );
-  file.write( reinterpret_cast<const char*>( &globalMetrics.padAdjustX ), sizeof( float ) );
-  file.write( reinterpret_cast<const char*>( &globalMetrics.padAdjustY ), sizeof( float ) );
-
-  const std::size_t calcCheckSum = CalculateGlobalMetricCheckSum( globalMetrics );
-
-  file.write( reinterpret_cast<const char*>( &calcCheckSum ), sizeof( std::size_t ) );
-}
-
-} // Anonymous namespace
-
-namespace SlpPlatform
-{
-namespace MetricsCache
-{
-
-bool ReadGlobal( const std::string& fontFamily, const std::string& fontStyle, Integration::GlobalMetrics& globalMetrics)
-{
-  bool success = false;
-
-  std::string fileName = CreateFileName( fontFamily, fontStyle );
-
-  std::ifstream file( fileName.c_str(), std::ios::in | std::ios::binary );
-
-  if( file.good() )
-  {
-    file.seekg( std::ios::beg );
-
-    success = ReadGlyphGlobalMetrics( file, globalMetrics );
-
-    // check the metrics had the correct size.
-    // this is just incase the metrics file is the wrong size, but the checksum magically worked.
-    if( file.eof() )
-    {
-      // file.eof is true only after an invalid read
-      success = false;
-      DALI_LOG_WARNING("Metrics file invalid read\n" );
-    }
-
-    file.close();
-  }
-
-  return success;
-}
-
-void WriteGlobal( const std::string& fontFamily, const std::string& fontStyle, const Integration::GlobalMetrics& globalMetrics)
-{
-  std::string fileName = CreateFileName( fontFamily, fontStyle );
-  std::ios_base::openmode mode = ( std::ios::out | std::ios::binary | std::ios::trunc );
-
-  std::ofstream file( fileName.c_str(), mode );
-
-  if( file.good() )
-  {
-    WriteGlyphGlobalMetrics( file, globalMetrics );
-
-    file.close();
-  }
-}
-
-bool Read( const std::string& fontFamily, const std::string& fontStyle, std::vector<Integration::GlyphMetrics>& glyphMetricsContainer )
-{
-  std::string fileName = CreateFileName( fontFamily, fontStyle );
-  bool success( false );
-
-  // Read from default glyph cache only when there is any metric loaded.
-  std::ifstream file( fileName.c_str(), std::ios::in | std::ios::binary );
-
-  if( file.good() )
-  {
-    // skip over the gobal metrics
-    file.seekg( GLOBAL_METRIC_HEADER_SIZE , std::ios::beg );
-
-    bool checkSumPassed(true);
-
-    // file.good() is set to false if end of file is reached, or an error occurred
-    while( checkSumPassed && file.good() )
-    {
-      Integration::GlyphMetrics glyphMetrics;
-
-      checkSumPassed = ReadGlyphMetrics( file, glyphMetrics );
-
-      // eof only returns true after a failed read
-      if( file.eof() )
-      {
-        // this will occur when we hit the end of the file.
-        checkSumPassed = true;
-        break;
-      }
-
-      if( checkSumPassed )
-      {
-        // fill the map with cached metrics.
-        glyphMetricsContainer.push_back(glyphMetrics);
-      }
-      else
-      {
-        DALI_LOG_WARNING("check sum failed for glyph %d in file \n", glyphMetrics.code, fileName.c_str() );
-      }
-    }
-
-    file.close();
-    success = checkSumPassed;
-  }
-
-  return success;
-}
-
-void Write( const std::string& fontFamily, const std::string& fontStyle, const Integration::GlyphSet& glyphSet )
-{
-  // append the file.
-  std::string fileName = CreateFileName( fontFamily, fontStyle );
-  std::ofstream file( fileName.c_str(), std::ios::out | std::ios::binary | std::ios::app );
-
-  if( file.good() )
-  {
-    const Integration::GlyphSet::CharacterList& characterList = glyphSet.GetCharacterList();
-
-    for( Integration::GlyphSet::CharacterConstIter it = characterList.begin(), endIt = characterList.end(); it != endIt; ++it )
-    {
-      WriteGlyphMetrics( file, it->second );
-    }
-
-    file.close();
-  }
-  else
-  {
-    DALI_LOG_WARNING( "Failed to open metric to file %s", fileName.c_str() );
-  }
-}
-
-
-} // MetricsCache
-} // SlpPlatform
-} // Dali
diff --git a/text-abstraction/file.list b/text-abstraction/file.list
deleted file mode 100644 (file)
index 1ec96a3..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-# Add local source files here
-
-text_abstraction_src_files = \
-   $(text_abstraction_src_dir)/public-api/font-client.cpp \
-   $(text_abstraction_src_dir)/public-api/font-list.cpp \
-   $(text_abstraction_src_dir)/public-api/reordering.cpp \
-   $(text_abstraction_src_dir)/public-api/segmentation.cpp \
-   $(text_abstraction_src_dir)/public-api/shaping.cpp \
-   $(text_abstraction_src_dir)/internal/font-client-impl.cpp \
-   $(text_abstraction_src_dir)/internal/reordering-impl.cpp \
-   $(text_abstraction_src_dir)/internal/segmentation-impl.cpp \
-   $(text_abstraction_src_dir)/internal/shaping-impl.cpp
-
-text_abstraction_header_files = \
-   $(text_abstraction_src_dir)/public-api/font-client.h \
-   $(text_abstraction_src_dir)/public-api/font-list.h \
-   $(text_abstraction_src_dir)/public-api/glyph-metrics.h \
-   $(text_abstraction_src_dir)/public-api/reordering.h \
-   $(text_abstraction_src_dir)/public-api/segmentation.h \
-   $(text_abstraction_src_dir)/public-api/shaping.h \
-   $(text_abstraction_src_dir)/public-api/text-abstraction.h \
-   $(text_abstraction_src_dir)/public-api/text-type-definitions.h
@@ -257,17 +257,19 @@ struct FontClient::Plugin
     return FontId(0);
   }
 
-  bool CreateMetrics( FontId fontId, GlyphMetrics* array, uint32_t size, bool horizontal )
+  bool GetGlyphMetrics( GlyphInfo* array, uint32_t size, bool horizontal )
   {
     bool success( true );
 
-    if( fontId > 0 &&
-        fontId-1 < mFontCache.size() )
+    for( unsigned int i=0; i<size; ++i )
     {
-      FT_Face ftFace = mFontCache[fontId-1].mFreeTypeFace;
+      FontId fontId = array[i].fontId;
 
-      for( unsigned int i=0; i<size; ++i )
+      if( fontId > 0 &&
+          fontId-1 < mFontCache.size() )
       {
+        FT_Face ftFace = mFontCache[fontId-1].mFreeTypeFace;
+
         int error = FT_Load_Glyph( ftFace, array[i].index, FT_LOAD_DEFAULT );
 
         if( FT_Err_Ok == error )
@@ -292,6 +294,10 @@ struct FontClient::Plugin
           success = false;
         }
       }
+      else
+      {
+        success = false;
+      }
     }
 
     return success;
@@ -478,11 +484,11 @@ GlyphIndex FontClient::GetGlyphIndex( FontId fontId, Character charcode )
   return mPlugin->GetGlyphIndex( fontId, charcode );
 }
 
-bool FontClient::CreateMetrics( FontId fontId, GlyphMetrics* array, uint32_t size, bool horizontal )
+bool FontClient::GetGlyphMetrics( GlyphInfo* array, uint32_t size, bool horizontal )
 {
   CreatePlugin();
 
-  return mPlugin->CreateMetrics( fontId, array, size, horizontal );
+  return mPlugin->GetGlyphMetrics( array, size, horizontal );
 }
 
 BitmapImage FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex )
  */
 
 // EXTERNAL INCLUDES
-#include <public-api/font-client.h>
 #include <dali/public-api/object/base-object.h>
 
+// INTERNAL INCLUDES
+#include <dali/public-api/text-abstraction/font-client.h>
+
 namespace Dali
 {
 
@@ -86,7 +88,7 @@ public:
   /**
    * @copydoc Dali::FontClient::CreateMetrics()
    */
-  bool CreateMetrics( FontId fontId, GlyphMetrics* array, uint32_t size, bool horizontal );
+  bool GetGlyphMetrics( GlyphInfo* array, uint32_t size, bool horizontal );
 
   /**
    * @copydoc Dali::FontClient::CreateBitmap()
  */
 
 // EXTERNAL INCLUDES
-#include <public-api/reordering.h>
 #include <dali/public-api/object/base-object.h>
 
-
+// INTERNAL INCLUDES
+#include <dali/public-api/text-abstraction/reordering.h>
 
 namespace Dali
 {
  */
 
 // EXTERNAL INCLUDES
-#include <public-api/segmentation.h>
 #include <dali/public-api/object/base-object.h>
 
-
+// INTERNAL INCLUDES
+#include <dali/public-api/text-abstraction/segmentation.h>
 
 namespace Dali
 {
  */
 
 // EXTERNAL INCLUDES
-#include <public-api/shaping.h>
 #include <dali/public-api/object/base-object.h>
 
-
+// INTERNAL INCLUDES
+#include <dali/public-api/text-abstraction/shaping.h>
 
 namespace Dali
 {
  */
 
 // CLASS HEADER
-#include "font-client.h"
+#include <dali/public-api/text-abstraction/font-client.h>
 
 // INTERNAL INCLUDES
-#include <internal/font-client-impl.h>
+#include <dali/internal/text-abstraction/font-client-impl.h>
 
 namespace Dali
 {
@@ -27,6 +27,11 @@ namespace Dali
 namespace TextAbstraction
 {
 
+FontClient FontClient::Get()
+{
+  return Internal::FontClient::Get();
+}
+
 FontClient::FontClient()
 {
 }
@@ -35,14 +40,15 @@ FontClient::~FontClient()
 {
 }
 
-FontClient::FontClient( Internal::FontClient* internal )
-: BaseHandle( internal )
+FontClient::FontClient( const FontClient& handle )
+: BaseHandle( handle )
 {
 }
 
-FontClient FontClient::Get()
+FontClient& FontClient::operator=( const FontClient& handle )
 {
-  return Internal::FontClient::Get();
+  BaseHandle::operator=( handle );
+  return *this;
 }
 
 void FontClient::SetDpi( unsigned int horizontalDpi, unsigned int verticalDpi  )
@@ -75,9 +81,9 @@ GlyphIndex FontClient::GetGlyphIndex( FontId fontId, Character charcode )
   return GetImplementation(*this).GetGlyphIndex( fontId, charcode );
 }
 
-bool FontClient::CreateMetrics( FontId fontId, GlyphMetrics* array, uint32_t size, bool horizontal )
+bool FontClient::GetGlyphMetrics( GlyphInfo* array, uint32_t size, bool horizontal )
 {
-  return GetImplementation(*this).CreateMetrics( fontId, array, size, horizontal );
+  return GetImplementation(*this).GetGlyphMetrics( array, size, horizontal );
 }
 
 BitmapImage FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex )
@@ -85,6 +91,11 @@ BitmapImage FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex )
   return GetImplementation(*this).CreateBitmap( fontId, glyphIndex );
 }
 
+FontClient::FontClient( Internal::FontClient* internal )
+: BaseHandle( internal )
+{
+}
+
 } // namespace TextAbstraction
 
 } // namespace Dali
@@ -21,9 +21,9 @@
 #include <dali/public-api/object/base-handle.h>
 #include <dali/public-api/images/bitmap-image.h>
 #include <dali/public-api/common/dali-vector.h>
-#include "text-type-definitions.h"
-#include "glyph-metrics.h"
-#include "font-list.h"
+#include <dali/public-api/text-abstraction/text-abstraction-definitions.h>
+#include <dali/public-api/text-abstraction/glyph-info.h>
+#include <dali/public-api/text-abstraction/font-list.h>
 
 namespace Dali
 {
@@ -60,6 +60,13 @@ class DALI_IMPORT_API FontClient : public BaseHandle
 public:
 
   /**
+   * @brief Retrieve a handle to the FontClient instance.
+   *
+   * @return A handle to the FontClient
+   */
+  static FontClient Get();
+
+  /**
    * @brief Create an uninitialized TextAbstraction handle.
    */
   FontClient();
@@ -72,11 +79,19 @@ public:
   ~FontClient();
 
   /**
-   * @brief Retrieve a handle to the FontClient instance.
+   * @brief This copy constructor is required for (smart) pointer semantics.
    *
-   * @return A handle to the FontClient
+   * @param[in] handle A reference to the copied handle.
    */
-  static FontClient Get();
+  FontClient( const FontClient& handle );
+
+  /**
+   * @brief This assignment operator is required for (smart) pointer semantics.
+   *
+   * @param [in] handle  A reference to the copied handle.
+   * @return A reference to this.
+   */
+  FontClient& operator=( const FontClient& handle );
 
   /**
    * @brief Set the DPI of the target window.
@@ -110,7 +125,7 @@ public:
    *
    * @param[in] path The path to a font file.
    * @param[in] pointSize The point size in 26.6 fractional points; the default point size is 12.
-   * @param[in] face The index of the font face (optional).
+   * @param[in] faceIndex The index of the font face (optional).
    * @return A valid font ID, or zero if the font does not exist.
    */
   FontId GetFontId( const FontPath& path, PointSize26Dot6 pointSize = 12*64, FaceIndex faceIndex = 0 );
@@ -137,14 +152,13 @@ public:
   /**
    * @brief Retrieve the metrics for a series of glyphs.
    *
-   * @param[in] fontId The ID of the font for these glyphs.
-   * @param[in,out] metrics An array of metrics with initialized glyph IDs.
-   * On return, the remaining values will be initialized e.g. glyph size & bearing values.
+   * @param[in,out] array An array of glyph-info structures with initialized FontId & GlyphIndex values.
+   * On return, the remaining metrics values will be initialized e.g. glyph size & bearing values.
    * @param[in] size The size of the array.
    * @param[in] horizontal True for horizontal layouts (set to false for vertical layouting).
-   * @return True if metrics were found.
+   * @return True if all of the requested metrics were found.
    */
-  bool CreateMetrics( FontId fontId, GlyphMetrics* array, uint32_t size, bool horizontal = true );
+  bool GetGlyphMetrics( GlyphInfo* array, uint32_t size, bool horizontal = true );
 
   /**
    * @brief Render a bitmap representation of a glyph.
@@ -16,7 +16,7 @@
  */
 
 // CLASS HEADER
-#include "font-list.h"
+#include <dali/public-api/text-abstraction/font-list.h>
 
 namespace Dali
 {
@@ -1,5 +1,5 @@
-#ifndef __DALI_TEXT_ABSTRACTION_GLYPH_METRICS_H__
-#define __DALI_TEXT_ABSTRACTION_GLYPH_METRICS_H__
+#ifndef __DALI_TEXT_ABSTRACTION_GLYPH_INFO_H__
+#define __DALI_TEXT_ABSTRACTION_GLYPH_INFO_H__
 
 /*
  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
@@ -19,7 +19,7 @@
  */
 
 // INTERNAL INCLUDES
-#include "text-type-definitions.h"
+#include <dali/public-api/text-abstraction/text-abstraction-definitions.h>
 
 namespace Dali
 {
@@ -28,13 +28,14 @@ namespace TextAbstraction
 {
 
 /**
- * POD structure for storing glyph metric information.
- * The values are expressed in 26.6 fractional pixel format.
+ * The information describing a glyph (font ID, index, metrics)
+ * The metrics are expressed in 26.6 fractional pixel format.
  */
-struct GlyphMetrics
+struct GlyphInfo
 {
-  GlyphMetrics()
-  : index( 0 ),
+  GlyphInfo()
+  : fontId( 0 ),
+    index( 0 ),
     width( 0 ),
     height( 0 ),
     xBearing( 0 ),
@@ -43,7 +44,8 @@ struct GlyphMetrics
   {
   }
 
-  GlyphIndex index; ///< Uniquely identifies a glyph for a given FontId
+  FontId fontId;       ///< Identifies the font containing the glyph
+  GlyphIndex index;    ///< Uniquely identifies a glyph for a given FontId
   uint32_t width;      ///< The width of the glyph
   uint32_t height;     ///< The height of the glyph
   uint32_t xBearing;   ///< The distance from the cursor position to the leftmost border of the glyph
@@ -55,4 +57,4 @@ struct GlyphMetrics
 
 } // TextAbstraction
 
-#endif //__DALI_TEXT_ABSTRACTION_GLYPH_METRICS_H__
+#endif //__DALI_TEXT_ABSTRACTION_GLYPH_INFO_H__
  */
 
 // CLASS HEADER
-#include "reordering.h"
+#include <dali/public-api/text-abstraction/reordering.h>
 
 // INTERNAL INCLUDES
-#include <internal/reordering-impl.h>
+#include <dali/internal/text-abstraction/reordering-impl.h>
 
 namespace Dali
 {
  */
 
 // CLASS HEADER
-#include "segmentation.h"
+#include <dali/public-api/text-abstraction/segmentation.h>
 
 // INTERNAL INCLUDES
-#include <internal/segmentation-impl.h>
+#include <dali/internal/text-abstraction/segmentation-impl.h>
 
 namespace Dali
 {
similarity index 89%
rename from text-abstraction/public-api/shaping.cpp
rename to text/dali/public-api/text-abstraction/shaping.cpp
index 8d94e8b..49e3bd8 100644 (file)
  */
 
 // CLASS HEADER
-#include "shaping.h"
+#include <dali/public-api/text-abstraction/shaping.h>
 
 // INTERNAL INCLUDES
-#include <internal/shaping-impl.h>
+#include <dali/internal/text-abstraction/shaping-impl.h>
 
 namespace Dali
 {
@@ -1,5 +1,5 @@
-#ifndef __DALI_TEXT_ABSTRACTION_TEXT_TYPE_DEFINITIONS_H__
-#define __DALI_TEXT_ABSTRACTION_TEXT_TYPE_DEFINITIONS_H__
+#ifndef __DALI_TEXT_ABSTRACTION_DEFINITIONS_H__
+#define __DALI_TEXT_ABSTRACTION_DEFINITIONS_H__
 
 /*
  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
@@ -38,4 +38,4 @@ typedef uint32_t Character;       ///< A UTF-32 representation of a character
 
 } // namespace Dali
 
-#endif // __DALI_TEXT_ABSTRACTION_TEXT_TYPE_DEFINITIONS_H__
+#endif // __DALI_TEXT_ABSTRACTION_DEFINITIONS_H__
  *
  */
 
+#include <dali/public-api/text-abstraction/text-abstraction-definitions.h>
 #include <dali/public-api/text-abstraction/font-client.h>
-#include <dali/public-api/text-abstraction/glyph-metrics.h>
+#include <dali/public-api/text-abstraction/glyph-info.h>
 #include <dali/public-api/text-abstraction/reordering.h>
 #include <dali/public-api/text-abstraction/segmentation.h>
 #include <dali/public-api/text-abstraction/shaping.h>
-#include <dali/public-api/text-abstraction/text-type-definitions.h>
 
 #endif //__DALI_TEXT_ABSTRACTION_H__
diff --git a/text/file.list b/text/file.list
new file mode 100644 (file)
index 0000000..db5b7db
--- /dev/null
@@ -0,0 +1,22 @@
+# Add local source files here
+
+text_abstraction_src_files = \
+   $(text_src_dir)/dali/public-api/text-abstraction/font-client.cpp \
+   $(text_src_dir)/dali/public-api/text-abstraction/font-list.cpp \
+   $(text_src_dir)/dali/public-api/text-abstraction/reordering.cpp \
+   $(text_src_dir)/dali/public-api/text-abstraction/segmentation.cpp \
+   $(text_src_dir)/dali/public-api/text-abstraction/shaping.cpp \
+   $(text_src_dir)/dali/internal/text-abstraction/font-client-impl.cpp \
+   $(text_src_dir)/dali/internal/text-abstraction/reordering-impl.cpp \
+   $(text_src_dir)/dali/internal/text-abstraction/segmentation-impl.cpp \
+   $(text_src_dir)/dali/internal/text-abstraction/shaping-impl.cpp
+
+text_abstraction_header_files = \
+   $(text_src_dir)/dali/public-api/text-abstraction/font-client.h \
+   $(text_src_dir)/dali/public-api/text-abstraction/font-list.h \
+   $(text_src_dir)/dali/public-api/text-abstraction/glyph-info.h \
+   $(text_src_dir)/dali/public-api/text-abstraction/reordering.h \
+   $(text_src_dir)/dali/public-api/text-abstraction/segmentation.h \
+   $(text_src_dir)/dali/public-api/text-abstraction/shaping.h \
+   $(text_src_dir)/dali/public-api/text-abstraction/text-abstraction.h \
+   $(text_src_dir)/dali/public-api/text-abstraction/text-abstraction-definitions.h