Merge "Stop using ImageActor in PageTurnView" into devel/master
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Tue, 12 Apr 2016 15:13:39 +0000 (08:13 -0700)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Tue, 12 Apr 2016 15:13:39 +0000 (08:13 -0700)
48 files changed:
automated-tests/src/dali-toolkit-internal/utc-Dali-LogicalModel.cpp
automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Segmentation.cpp
automated-tests/src/dali-toolkit-internal/utc-Dali-VisualModel.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dummy-control.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-text-model.cpp
dali-toolkit/internal/controls/bloom-view/bloom-view-impl.cpp
dali-toolkit/internal/controls/bloom-view/bloom-view-impl.h
dali-toolkit/internal/controls/buttons/button-impl.cpp
dali-toolkit/internal/controls/buttons/button-impl.h
dali-toolkit/internal/controls/buttons/check-box-button-impl.cpp
dali-toolkit/internal/controls/buttons/check-box-button-impl.h
dali-toolkit/internal/controls/buttons/push-button-impl.cpp
dali-toolkit/internal/controls/buttons/push-button-impl.h
dali-toolkit/internal/controls/buttons/radio-button-impl.cpp
dali-toolkit/internal/controls/buttons/radio-button-impl.h
dali-toolkit/internal/controls/effects-view/effects-view-impl.cpp
dali-toolkit/internal/controls/gaussian-blur-view/gaussian-blur-view-impl.cpp
dali-toolkit/internal/controls/gaussian-blur-view/gaussian-blur-view-impl.h
dali-toolkit/internal/controls/image-view/image-view-impl.cpp
dali-toolkit/internal/controls/magnifier/magnifier-impl.cpp
dali-toolkit/internal/controls/popup/popup-impl.cpp
dali-toolkit/internal/controls/popup/popup-impl.h
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp
dali-toolkit/internal/controls/shadow-view/shadow-view-impl.cpp
dali-toolkit/internal/controls/shadow-view/shadow-view-impl.h
dali-toolkit/internal/controls/table-view/table-view-impl.cpp
dali-toolkit/internal/controls/table-view/table-view-impl.h
dali-toolkit/internal/controls/tool-bar/tool-bar-impl.cpp
dali-toolkit/internal/controls/tool-bar/tool-bar-impl.h
dali-toolkit/internal/text/logical-model-impl.cpp
dali-toolkit/internal/text/logical-model-impl.h
dali-toolkit/internal/text/paragraph-run.h [new file with mode: 0644]
dali-toolkit/internal/text/segmentation.cpp
dali-toolkit/internal/text/segmentation.h
dali-toolkit/internal/text/shaper.cpp
dali-toolkit/internal/text/text-controller-impl.cpp
dali-toolkit/internal/text/text-controller.cpp
dali-toolkit/internal/text/text-controller.h
dali-toolkit/internal/text/text-definitions.h
dali-toolkit/internal/text/text-run-container.h
dali-toolkit/internal/text/visual-model-impl.cpp
dali-toolkit/internal/text/visual-model-impl.h
dali-toolkit/internal/transition-effects/cube-transition-effect-impl.cpp
dali-toolkit/public-api/controls/control-impl.cpp
dali-toolkit/public-api/controls/control-impl.h
dali-toolkit/public-api/dali-toolkit-version.cpp
docs/content/shared-javascript-and-cpp-documentation/creating-custom-controls.md
packaging/dali-toolkit.spec

index 9ec9930..fa28d61 100644 (file)
@@ -20,6 +20,7 @@
 #include <stdlib.h>
 
 #include <dali-toolkit-test-suite-utils.h>
+#include <dali-toolkit/internal/text/text-run-container.h>
 #include <dali-toolkit/dali-toolkit.h>
 #include <toolkit-text-model.h>
 
@@ -39,6 +40,26 @@ using namespace Text;
 
 namespace
 {
+struct CreateParagraphData
+{
+  std::string    description;                    ///< Description of the test.
+  std::string    text;                           ///< Input text.
+  CharacterIndex index;                          ///< The first character index.
+  Length         numberOfCharacters;             ///< The number of characters.
+  unsigned int   numberOfParagraphs;             ///< The expected number of paragraphs.
+  unsigned int*  indices;                        ///< The expected paragraph info indices.
+  unsigned int*  numberOfCharactersPerParagraph; ///< The expected number of characters of each paragraph.
+};
+
+struct FindParagraphData
+{
+  std::string    description;        ///< Description of the test.
+  std::string    text;               ///< Input text.
+  CharacterIndex index;              ///< The first character index.
+  Length         numberOfCharacters; ///< The number of characters.
+  unsigned int   numberOfParagraphs; ///< The expected number of paragraphs.
+  unsigned int*  paragraphs;         ///< The expected paragraph info.
+};
 
 struct SetVisualToLogicalMapData
 {
@@ -51,6 +72,109 @@ struct SetVisualToLogicalMapData
   unsigned int* visualToLogical;            ///< The expected visual to logical conversion table.
 };
 
+bool CreateParagraphTest( const CreateParagraphData& data )
+{
+  // 1) Create the model.
+  LogicalModelPtr logicalModel = LogicalModel::New();
+  VisualModelPtr visualModel = VisualModel::New();
+  Size textArea(100.f, 60.f);
+  Size layoutSize;
+
+  Vector<FontDescriptionRun> fontDescriptionRuns;
+  LayoutOptions options;
+  CreateTextModel( data.text,
+                   textArea,
+                   fontDescriptionRuns,
+                   options,
+                   layoutSize,
+                   logicalModel,
+                   visualModel );
+
+  // 2) Clear the paragraphs.
+  Vector<ParagraphRun>& paragraphs = logicalModel->mParagraphInfo;
+  ClearCharacterRuns( data.index,
+                      data.index + data.numberOfCharacters - 1u,
+                      paragraphs );
+
+  // 3) Call the LogicalModel::CreateParagraphInfo() method
+  logicalModel->CreateParagraphInfo( data.index,
+                                     data.numberOfCharacters );
+
+  // 4) Compare the results.
+  if( data.numberOfParagraphs != paragraphs.Count() )
+  {
+    std::cout << "  Different number of paragraphs : " << paragraphs.Count() << ", expected : " << data.numberOfParagraphs << std::endl;
+    return false;
+  }
+
+  unsigned int index = 0u;
+  for( Vector<ParagraphRun>::ConstIterator it = paragraphs.Begin(),
+         endIt = paragraphs.End();
+       it != endIt;
+       ++it, ++index )
+  {
+    const ParagraphRun& paragraph( *it );
+
+    if( data.indices[index] != paragraph.characterRun.characterIndex )
+    {
+      std::cout << "  Different character index for paragraph : " << index << ", " << paragraph.characterRun.characterIndex << ", expected : " << data.indices[index] << std::endl;
+      return false;
+    }
+    if( data.numberOfCharactersPerParagraph[index] != paragraph.characterRun.numberOfCharacters )
+    {
+      std::cout << "  Different number of characters for paragraph : " << index << ", " << paragraph.characterRun.numberOfCharacters << ", expected : " << data.numberOfCharactersPerParagraph[index] << std::endl;
+      return false;
+    }
+  }
+
+  return true;
+}
+
+bool FindParagraphTest( const FindParagraphData& data )
+{
+  // 1) Create the model.
+  LogicalModelPtr logicalModel = LogicalModel::New();
+  VisualModelPtr visualModel = VisualModel::New();
+  Size textArea(100.f, 60.f);
+  Size layoutSize;
+
+  Vector<FontDescriptionRun> fontDescriptionRuns;
+  LayoutOptions options;
+  CreateTextModel( data.text,
+                   textArea,
+                   fontDescriptionRuns,
+                   options,
+                   layoutSize,
+                   logicalModel,
+                   visualModel );
+
+  // 2) Find the paragraphs.
+  Vector<ParagraphRunIndex> paragraphs;
+  logicalModel->FindParagraphs( data.index, data.numberOfCharacters, paragraphs );
+
+  // 3) compare the results.
+  if( data.numberOfParagraphs != paragraphs.Count() )
+  {
+    return false;
+  }
+
+  unsigned int index = 0u;
+  for( Vector<ParagraphRunIndex>::ConstIterator it = paragraphs.Begin(),
+         endIt = paragraphs.End();
+       it != endIt;
+       ++it, ++index )
+  {
+    const ParagraphRunIndex paragraphIndex = *it;
+
+    if( paragraphIndex != data.paragraphs[index] )
+    {
+      return false;
+    }
+  }
+
+  return true;
+}
+
 bool SetVisualToLogicalMapTest( const SetVisualToLogicalMapData& data )
 {
   std::cout << "  testing : " << data.description << std::endl;
@@ -106,10 +230,158 @@ bool SetVisualToLogicalMapTest( const SetVisualToLogicalMapData& data )
 } // namespace
 
 //////////////////////////////////////////////////////////
+//
+// UtcDaliCreateParagraph
+// UtcDaliFindParagraph
+// UtcDaliSetVisualToLogicalMap
+//
+//////////////////////////////////////////////////////////
 
-int UtcDaliSetVisualToLogicalMap(void)
+int UtcDaliCreateParagraph(void)
 {
   ToolkitTestApplication application;
+  tet_infoline(" UtcDaliCreateParagraph");
+
+  unsigned int paragraphsIndices01[] = { 0u };
+  unsigned int paragraphsNumberOfCharacters01[] = { 0u };
+  unsigned int paragraphsIndices02[] = { 0u, 12u, 17u };
+  unsigned int paragraphsNumberOfCharacters02[] = { 12u, 5u, 1u };
+  unsigned int paragraphsIndices03[] = { 0u, 12u, 17u, 34u };
+  unsigned int paragraphsNumberOfCharacters03[] = { 12u, 5u, 17u ,1u };
+
+  struct CreateParagraphData data[] =
+  {
+    {
+      "Zero characters",
+      "",
+      0u,
+      0u,
+      0u,
+      paragraphsIndices01,
+      paragraphsNumberOfCharacters01,
+    },
+    {
+      "Some paragraphs",
+      "Hello world\ndemo\n\n",
+      0u,
+      18u,
+      3u,
+      paragraphsIndices02,
+      paragraphsNumberOfCharacters02,
+    },
+    {
+      "Some paragraphs. Update the initial paragraphs.",
+      "Hello world\ndemo\nhello world demo\n\n",
+      0u,
+      17u,
+      4u,
+      paragraphsIndices03,
+      paragraphsNumberOfCharacters03,
+    },
+    {
+      "Some paragraphs. Update the mid paragraphs.",
+      "Hello world\ndemo\nhello world demo\n\n",
+      12u,
+      5u,
+      4u,
+      paragraphsIndices03,
+      paragraphsNumberOfCharacters03,
+    },
+    {
+      "Some paragraphs. Update the final paragraphs.",
+      "Hello world\ndemo\nhello world demo\n\n",
+      17u,
+      18u,
+      4u,
+      paragraphsIndices03,
+      paragraphsNumberOfCharacters03,
+    },
+  };
+  const unsigned int numberOfTests = 5u;
+
+  for( unsigned int index = 0u; index < numberOfTests; ++index )
+  {
+    // ToolkitTestApplication application;
+    if( !CreateParagraphTest( data[index] ) )
+    {
+      tet_result(TET_FAIL);
+    }
+  }
+
+  tet_result(TET_PASS);
+  END_TEST;
+}
+
+int UtcDaliFindParagraph(void)
+{
+  tet_infoline(" UtcDaliFindParagraph");
+
+  unsigned int paragraphs01[] = {};
+  unsigned int paragraphs02[] = { 0u, 1u, 2u };
+  unsigned int paragraphs03[] = { 0u };
+  unsigned int paragraphs04[] = { 1u };
+  unsigned int paragraphs05[] = { 0u, 1u, 2u };
+
+  struct FindParagraphData data[] =
+  {
+    {
+      "Zero characters",
+      "",
+      0u,
+      100u,
+      0u,
+      paragraphs01,
+    },
+    {
+      "Some paragraphs",
+      "Hello world\ndemo\n\n",
+      0u,
+      18u,
+      3u,
+      paragraphs02
+    },
+    {
+      "Some paragraphs",
+      "Hello world\ndemo\n\n",
+      0u,
+      12u,
+      1u,
+      paragraphs03
+    },
+    {
+      "Some paragraphs",
+      "Hello world\ndemo\n\n",
+      12u,
+      5u,
+      1u,
+      paragraphs04
+    },
+    {
+      "Some paragraphs",
+      "Hello world\ndemo\n\n",
+      3u,
+      15u,
+      3u,
+      paragraphs05
+    },
+  };
+  const unsigned int numberOfTests = 5u;
+
+  for( unsigned int index = 0u; index < numberOfTests; ++index )
+  {
+    ToolkitTestApplication application;
+    if( !FindParagraphTest( data[index] ) )
+    {
+      tet_result(TET_FAIL);
+    }
+  }
+
+  tet_result(TET_PASS);
+  END_TEST;
+}
+
+int UtcDaliSetVisualToLogicalMap(void)
+{
   tet_infoline(" UtcDaliSetVisualToLogicalMap");
 
   unsigned int* visualToLogical01 = NULL;
@@ -210,6 +482,7 @@ int UtcDaliSetVisualToLogicalMap(void)
 
   for( unsigned int index = 0u; index < numberOfTests; ++index )
   {
+    ToolkitTestApplication application;
     if( !SetVisualToLogicalMapTest( data[index] ) )
     {
       tet_result(TET_FAIL);
index 0023240..5366164 100644 (file)
@@ -62,13 +62,31 @@ bool LineBreakInfoTest( const BreakInfoData& data )
 
   utf32.Resize( numberOfCharacters );
 
-  // 2) Set the line break info.
+  // 2) Set the line break info for the whole text.
   Vector<LineBreakInfo> lineBreakInfo;
   lineBreakInfo.Resize( numberOfCharacters );
 
-  SetLineBreakInfo( utf32, lineBreakInfo );
+  SetLineBreakInfo( utf32,
+                    0u,
+                    numberOfCharacters,
+                    lineBreakInfo );
+
+  // 3) Update the word text info if it's requested for part of the text.
+  if( ( 0u != data.index ) &&
+      ( numberOfCharacters != data.numberOfCharacters ) )
+  {
+    // Clear part of the line break info.
+    lineBreakInfo.Erase( lineBreakInfo.Begin() + data.index,
+                         lineBreakInfo.Begin() + data.index + data.numberOfCharacters );
 
-  // 3) compare the results
+    // Update the word line info.
+    SetLineBreakInfo( utf32,
+                      data.index,
+                      data.numberOfCharacters,
+                      lineBreakInfo );
+  }
+
+  // 4) compare the results
   std::ostringstream breakInfo;
 
   for( unsigned int index = 0u; index < numberOfCharacters; ++index )
@@ -78,8 +96,11 @@ bool LineBreakInfoTest( const BreakInfoData& data )
 
   if( data.breakInfo != breakInfo.str() )
   {
-    std::cout << "  expected : [" << data.breakInfo << "]" << std::endl;
-    std::cout << "       got : [" << breakInfo.str() << "]" << std::endl;
+    std::cout << "                text : [" << data.text << "]" << std::endl;
+    std::cout << "               index : " <<  data.index << std::endl;
+    std::cout << "  numberOfCharacters : " <<  data.numberOfCharacters << std::endl;
+    std::cout << "            expected : [" << data.breakInfo << "]" << std::endl;
+    std::cout << "                 got : [" << breakInfo.str() << "]" << std::endl;
     return false;
   }
 
@@ -149,7 +170,6 @@ bool WordBreakInfoTest( const BreakInfoData& data )
 
 int UtcDaliTextSegnemtationSetLineBreakInfo(void)
 {
-  ToolkitTestApplication application;
   tet_infoline(" UtcDaliTextSegnemtationSetLineBreakInfo");
 
   struct BreakInfoData data[] =
@@ -177,6 +197,51 @@ int UtcDaliTextSegnemtationSetLineBreakInfo(void)
       "222222122222221221222212212221222222122222222220",
     },
     {
+      "Latin script. Update initial paragraphs.",
+      "Lorem ipsum dolor sit amet, aeque definiebas ea mei, posse iracundia ne cum.\n"
+      "Usu ne nisl maiorum iudicabit, veniam epicurei oporteat eos an.\n"
+      "Ne nec nulla regione albucius, mea doctus delenit ad!\n"
+      "Et everti blandit adversarium mei, eam porro neglegentur suscipiantur an.\n"
+      "Quidam corpora at duo. An eos possim scripserit?",
+      0u,
+      141u,
+      "22222122222122222122212222212222212222222222122122221222221222222222122122220"
+      "2221221222212222222122222222221222222122222222122222222122212220"
+      "221222122222122222221222222222122212222221222222212220"
+      "22122222212222222122222222222122221222122222122222222222122222222222212220"
+      "222222122222221221222212212221222222122222222220",
+    },
+    {
+      "Latin script. Update mid paragraphs.",
+      "Lorem ipsum dolor sit amet, aeque definiebas ea mei, posse iracundia ne cum.\n"
+      "Usu ne nisl maiorum iudicabit, veniam epicurei oporteat eos an.\n"
+      "Ne nec nulla regione albucius, mea doctus delenit ad!\n"
+      "Et everti blandit adversarium mei, eam porro neglegentur suscipiantur an.\n"
+      "Quidam corpora at duo. An eos possim scripserit?",
+      141u,
+      128u,
+      "22222122222122222122212222212222212222222222122122221222221222222222122122220"
+      "2221221222212222222122222222221222222122222222122222222122212220"
+      "221222122222122222221222222222122212222221222222212220"
+      "22122222212222222122222222222122221222122222122222222222122222222222212220"
+      "222222122222221221222212212221222222122222222220",
+    },
+    {
+      "Latin script. Update final paragraphs.",
+      "Lorem ipsum dolor sit amet, aeque definiebas ea mei, posse iracundia ne cum.\n"
+      "Usu ne nisl maiorum iudicabit, veniam epicurei oporteat eos an.\n"
+      "Ne nec nulla regione albucius, mea doctus delenit ad!\n"
+      "Et everti blandit adversarium mei, eam porro neglegentur suscipiantur an.\n"
+      "Quidam corpora at duo. An eos possim scripserit?",
+      195u,
+      122u,
+      "22222122222122222122212222212222212222222222122122221222221222222222122122220"
+      "2221221222212222222122222222221222222122222222122222222122212220"
+      "221222122222122222221222222222122212222221222222212220"
+      "22122222212222222122222222222122221222122222122222222222122222222222212220"
+      "222222122222221221222212212221222222122222222220",
+    },
+    {
       "Japanese script",
       "韓国側は北朝鮮当局を通じて米ドルで賃金を支払う。\n"
       "国際社会から様々な経済制裁を受ける北朝鮮にとっては出稼ぎ労働などと並んで重要な外貨稼ぎの手段となっている。\n"
@@ -199,10 +264,11 @@ int UtcDaliTextSegnemtationSetLineBreakInfo(void)
       "21111112112111111111111211121111111111120",
     }
   };
-  const unsigned int numberOfTests = 4u;
+  const unsigned int numberOfTests = 7u;
 
   for( unsigned int index = 0u; index < numberOfTests; ++index )
   {
+    ToolkitTestApplication application;
     if( !LineBreakInfoTest( data[index] ) )
     {
       tet_result(TET_FAIL);
@@ -215,7 +281,6 @@ int UtcDaliTextSegnemtationSetLineBreakInfo(void)
 
 int UtcDaliTextSegnemtationSetWordBreakInfo(void)
 {
-  ToolkitTestApplication application;
   tet_infoline(" UtcDaliTextSegnemtationSetWordBreakInfo");
 
   struct BreakInfoData data[] =
@@ -380,6 +445,7 @@ int UtcDaliTextSegnemtationSetWordBreakInfo(void)
 
   for( unsigned int index = 0u; index < numberOfTests; ++index )
   {
+    ToolkitTestApplication application;
     if( !WordBreakInfoTest( data[index] ) )
     {
       tet_result(TET_FAIL);
index fdde254..fe6d4cb 100644 (file)
@@ -84,10 +84,12 @@ bool SetGlyphsPerCharacterTest( const SetGlyphsPerCharacterData& data )
   Vector<GlyphIndex>& charactersToGlyph = visualModel->mCharactersToGlyph;
   Vector<Length>& glyphsPerCharacter = visualModel->mGlyphsPerCharacter;
 
+  GlyphIndex startGlyphIndex = 0u;
   if( 0u != charactersToGlyph.Count() )
   {
     // The number of glyphs to be removed.
     const Length numberOfGlyphs = charactersToGlyph[data.startIndex + data.numberOfCharacters - 1u] + glyphsPerCharacter[data.startIndex + data.numberOfCharacters - 1u] - charactersToGlyph[data.startIndex];
+    startGlyphIndex = charactersToGlyph[data.startIndex];
 
     charactersToGlyph.Erase( charactersToGlyph.Begin() + data.startIndex,
                              charactersToGlyph.Begin() + data.startIndex + data.numberOfCharacters );
@@ -106,6 +108,7 @@ bool SetGlyphsPerCharacterTest( const SetGlyphsPerCharacterData& data )
 
   // 3) Call the CreateGlyphsPerCharacterTable() function
   visualModel->CreateGlyphsPerCharacterTable( data.startIndex,
+                                              startGlyphIndex,
                                               data.numberOfCharacters );
 
   // 4) Compare the results.
@@ -160,10 +163,12 @@ bool SetCharacterToGlyphTest( const SetCharacterToGlyphData& data )
   Vector<GlyphIndex>& charactersToGlyph = visualModel->mCharactersToGlyph;
   Vector<Length>& glyphsPerCharacter = visualModel->mGlyphsPerCharacter;
 
+  GlyphIndex startGlyphIndex = 0u;
   if( 0u != charactersToGlyph.Count() )
   {
     // The number of glyphs to be removed.
     const Length numberOfGlyphs = charactersToGlyph[data.startIndex + data.numberOfCharacters - 1u] + glyphsPerCharacter[data.startIndex + data.numberOfCharacters - 1u] - charactersToGlyph[data.startIndex];
+    startGlyphIndex = charactersToGlyph[data.startIndex];
 
     charactersToGlyph.Erase( charactersToGlyph.Begin() + data.startIndex,
                              charactersToGlyph.Begin() + data.startIndex + data.numberOfCharacters );
@@ -180,6 +185,7 @@ bool SetCharacterToGlyphTest( const SetCharacterToGlyphData& data )
 
   // 3) Call the CreateCharacterToGlyphTable() function
   visualModel->CreateCharacterToGlyphTable( data.startIndex,
+                                            startGlyphIndex,
                                             data.numberOfCharacters );
 
   // 4) Compare the results.
index 7b0ca45..c4dac4e 100644 (file)
@@ -122,12 +122,12 @@ void DummyControlImplOverride::OnPinch(const PinchGesture& pinch) { pinchCalled
 void DummyControlImplOverride::OnPan(const PanGesture& pan) { panCalled = true; }
 void DummyControlImplOverride::OnTap(const TapGesture& tap) { tapCalled = true; }
 void DummyControlImplOverride::OnLongPress(const LongPressGesture& longPress) { longPressCalled = true; }
-void DummyControlImplOverride::OnStageConnection( int depth ) { stageConnectionCalled = true; }
-void DummyControlImplOverride::OnStageDisconnection() { stageDisconnectionCalled = true; }
+void DummyControlImplOverride::OnStageConnection( int depth ) { Control::OnStageConnection( depth ); stageConnectionCalled = true; }
+void DummyControlImplOverride::OnStageDisconnection() { stageDisconnectionCalled = true; Control::OnStageDisconnection(); }
 void DummyControlImplOverride::OnChildAdd(Actor& child) { childAddCalled = true; }
 void DummyControlImplOverride::OnChildRemove(Actor& child) { childRemoveCalled = true; }
-void DummyControlImplOverride::OnSizeSet(const Vector3& targetSize) { sizeSetCalled = true; }
-void DummyControlImplOverride::OnSizeAnimation(Animation& animation, const Vector3& targetSize) { sizeAnimationCalled = true; }
+void DummyControlImplOverride::OnSizeSet(const Vector3& targetSize) { Control::OnSizeSet( targetSize ); sizeSetCalled = true; }
+void DummyControlImplOverride::OnSizeAnimation(Animation& animation, const Vector3& targetSize) { Control::OnSizeAnimation( animation, targetSize ); sizeAnimationCalled = true; }
 bool DummyControlImplOverride::OnTouchEvent(const TouchEvent& event) { touchEventCalled = true; return false; }
 bool DummyControlImplOverride::OnHoverEvent(const HoverEvent& event) { hoverEventCalled = true; return false; }
 bool DummyControlImplOverride::OnWheelEvent(const WheelEvent& event) { wheelEventCalled = true; return false; }
index 5bde6be..aff7eb7 100644 (file)
@@ -116,7 +116,10 @@ void CreateTextModel( const std::string& text,
   Vector<LineBreakInfo>& lineBreakInfo = logicalModel->mLineBreakInfo;
   lineBreakInfo.Resize( numberOfCharacters );
 
-  SetLineBreakInfo( utf32Characters, lineBreakInfo );
+  SetLineBreakInfo( utf32Characters,
+                    0u,
+                    numberOfCharacters,
+                    lineBreakInfo );
 
   if( 0u == numberOfCharacters )
   {
@@ -184,6 +187,10 @@ void CreateTextModel( const std::string& text,
                         numberOfCharacters,
                         bidirectionalInfo );
 
+  // Create the paragraph info.
+  logicalModel->CreateParagraphInfo( 0u,
+                                     numberOfCharacters );
+
   // 6) Set character directions.
   Vector<CharacterDirection>& characterDirections = logicalModel->mCharacterDirections;
   if( 0u != bidirectionalInfo.Count() )
@@ -232,8 +239,8 @@ void CreateTextModel( const std::string& text,
              newParagraphGlyphs );
 
   // Create the 'number of glyphs' per character and the glyph to character conversion tables.
-  visualModel->CreateGlyphsPerCharacterTable( 0u, numberOfCharacters );
-  visualModel->CreateCharacterToGlyphTable( 0u, numberOfCharacters );
+  visualModel->CreateGlyphsPerCharacterTable( 0u, 0u, numberOfCharacters );
+  visualModel->CreateCharacterToGlyphTable( 0u, 0u, numberOfCharacters );
 
   const Length numberOfGlyphs = glyphs.Count();
 
index 4d088d1..474a16e 100644 (file)
@@ -290,6 +290,8 @@ void BloomView::OnInitialize()
 
 void BloomView::OnSizeSet(const Vector3& targetSize)
 {
+  Control::OnSizeSet( targetSize );
+
   mTargetSize = Vector2(targetSize);
   mChildrenRoot.SetSize(targetSize);
   mCompositeImageActor.SetSize(targetSize);
@@ -313,17 +315,21 @@ void BloomView::OnSizeSet(const Vector3& targetSize)
   }
 }
 
-void BloomView::OnControlChildAdd( Actor& child )
+void BloomView::OnChildAdd( Actor& child )
 {
+  Control::OnChildAdd( child );
+
   if( child != mChildrenRoot && child != mInternalRoot)
   {
     mChildrenRoot.Add( child );
   }
 }
 
-void BloomView::OnControlChildRemove( Actor& child )
+void BloomView::OnChildRemove( Actor& child )
 {
   mChildrenRoot.Remove( child );
+
+  Control::OnChildRemove( child );
 }
 
 void BloomView::AllocateResources()
index ea3f7e5..14e1d3c 100644 (file)
@@ -85,14 +85,14 @@ private:
   virtual void OnSizeSet(const Vector3& targetSize);
 
   /**
-   * @copydoc Control::OnControlChildAdd()
+   * @copydoc Control::OnChildAdd()
    */
-  virtual void OnControlChildAdd( Actor& child );
+  virtual void OnChildAdd( Actor& child );
 
   /**
-   * @copydoc Control::OnControlChildRemove()
+   * @copydoc Control::OnChildRemove()
    */
-  virtual void OnControlChildRemove( Actor& child );
+  virtual void OnChildRemove( Actor& child );
 
   void AllocateResources();
   void CreateRenderTasks();
index 3132b20..6df5fcf 100644 (file)
@@ -823,22 +823,6 @@ bool Button::DoClickAction( const Property::Map& attributes )
   return false;
 }
 
-void Button::OnButtonStageDisconnection()
-{
-  if( ButtonDown == mState )
-  {
-    if( !mTogglableButton )
-    {
-      Released();
-
-      if( mAutoRepeating )
-      {
-        mAutoRepeatingTimer.Reset();
-      }
-    }
-  }
-}
-
 void Button::OnButtonDown()
 {
   if( !mTogglableButton )
@@ -1030,8 +1014,6 @@ void Button::OnInitialize()
   mTapDetector.Attach( self );
   mTapDetector.DetectedSignal().Connect(this, &Button::OnTap);
 
-  OnButtonInitialize();
-
   self.SetKeyboardFocusable( true );
 }
 
@@ -1049,10 +1031,24 @@ bool Button::OnKeyboardEnter()
   return ret;
 }
 
-void Button::OnControlStageDisconnection()
+void Button::OnStageDisconnection()
 {
-  OnButtonStageDisconnection(); // Notification for derived classes.
+  if( ButtonDown == mState )
+  {
+    if( !mTogglableButton )
+    {
+      Released();
+
+      if( mAutoRepeating )
+      {
+        mAutoRepeatingTimer.Reset();
+      }
+    }
+  }
+
   mState = ButtonUp;
+
+  Control::OnStageDisconnection();
 }
 
 void Button::OnTap(Actor actor, const TapGesture& tap)
index 7adb67c..6f1e313 100644 (file)
@@ -335,12 +335,6 @@ private:
   bool DoClickAction( const Property::Map& attributes );
 
   /**
-   * This method is called after the button initialization.
-   * Could be reimplemented in subclasses to provide specific behaviour.
-   */
-  virtual void OnButtonInitialize() { }
-
-  /**
    * This method is called when the label is set.
    * @param[in] noPadding Used to bypass padding if the label is to be treated generically.
    */
@@ -407,12 +401,6 @@ private:
   virtual void OnTouchPointInterrupted();
 
   /**
-   * This method is called when the button is removed from the stage.
-   * Could be reimplemented in subclasses to provide specific behaviour.
-   */
-  virtual void OnButtonStageDisconnection();
-
-  /**
    * This method is called when the \e selected property is changed.
    */
   virtual void OnSelected() {}
@@ -483,17 +471,16 @@ public:
    */
   static Property::Value GetProperty( BaseObject* object, Property::Index propertyIndex );
 
-protected: // From CustomActorImpl
+protected: // From Control
 
   /**
-   * @copydoc Dali::CustomActorImpl::OnTouchEvent( const TouchEvent& event )
+   * @copydoc Dali::Control::OnTouchEvent( const TouchEvent& event )
    */
   virtual bool OnTouchEvent( const TouchEvent& event );
 
-private: // From Control
-
   /**
    * @copydoc Toolkit::Control::OnInitialize()
+   * @note If overridden by deriving button classes, then an up-call to Button::OnInitialize MUST be made at the start.
    */
   virtual void OnInitialize();
 
@@ -508,10 +495,10 @@ private: // From Control
   virtual bool OnKeyboardEnter();
 
   /**
-   * Callback received when the button is disconnected from the stage.
-   * It resets the button status.
+   * @copydoc Toolkit::Control::OnStageDisconnection()
+   * @note If overridden by deriving button classes, then an up-call to Button::OnStageDisconnection MUST be made at the end.
    */
-  void OnControlStageDisconnection();
+  void OnStageDisconnection();
 
 private:
 
index 79ef935..6607c5c 100644 (file)
@@ -97,8 +97,10 @@ void CheckBoxButton::SetTickUVEffect()
   }
 }
 
-void CheckBoxButton::OnButtonInitialize()
+void CheckBoxButton::OnInitialize()
 {
+  Button::OnInitialize();
+
   // Wrap around all children
   Self().SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::ALL_DIMENSIONS );
 
index e80b838..7e9d314 100644 (file)
@@ -73,9 +73,9 @@ private: // From Button
 
 
   /**
-   * @copydoc Toolkit::Internal::Button::OnButtonInitialize
+   * @copydoc Toolkit::Internal::Button::OnInitialize
    */
-  virtual void OnButtonInitialize();
+  virtual void OnInitialize();
 
   /**
    * @copydoc Toolkit::Internal::Button::OnLabelSet
index 50d85e5..9a47206 100644 (file)
@@ -127,8 +127,10 @@ PushButton::~PushButton()
 {
 }
 
-void PushButton::OnButtonInitialize()
+void PushButton::OnInitialize()
 {
+  Button::OnInitialize();
+
   // Push button requires the Leave event.
   Actor self = Self();
   self.SetLeaveRequired( true );
index 44e447c..a003e6d 100644 (file)
@@ -96,9 +96,9 @@ public:
 private: // From Button
 
   /**
-   * @copydoc Toolkit::Internal::Button::OnButtonInitialize
+   * @copydoc Toolkit::Internal::Button::OnInitialize
    */
-  virtual void OnButtonInitialize();
+  virtual void OnInitialize();
 
   /**
    * @copydoc Toolkit::Internal::Button::OnLabelSet
index e980ec9..142dba1 100644 (file)
@@ -74,8 +74,10 @@ RadioButton::~RadioButton()
 {
 }
 
-void RadioButton::OnButtonInitialize()
+void RadioButton::OnInitialize()
 {
+  Button::OnInitialize();
+
   Actor self = Self();
 
   // Wrap size of radio button around all its children
index 34130ae..630e1a3 100644 (file)
@@ -64,9 +64,9 @@ private:
 private: // From Button
 
   /**
-   * @copydoc Toolkit::Internal::Button::OnButtonInitialize
+   * @copydoc Toolkit::Internal::Button::OnInitialize
    */
-  virtual void OnButtonInitialize();
+  virtual void OnInitialize();
 
   /**
    * @copydoc Toolkit::Internal::Button::OnButtonUp
index 8d1a3b3..28b64fa 100644 (file)
@@ -317,6 +317,8 @@ void EffectsView::OnInitialize()
 
 void EffectsView::OnSizeSet(const Vector3& targetSize)
 {
+  Control::OnSizeSet( targetSize );
+
   mTargetSize = Vector2(targetSize);
 
   // if we are already on stage, need to update render target sizes now to reflect the new size of this actor
@@ -365,6 +367,8 @@ void EffectsView::OnStageDisconnection()
   {
     mFilters[i]->Disable();
   }
+
+  Control::OnStageDisconnection();
 }
 
 void EffectsView::SetupFilters()
index 8a608f1..6081c0b 100644 (file)
@@ -331,6 +331,8 @@ void GaussianBlurView::OnInitialize()
 
 void GaussianBlurView::OnSizeSet(const Vector3& targetSize)
 {
+  Control::OnSizeSet( targetSize );
+
   mTargetSize = Vector2(targetSize);
 
   mChildrenRoot.SetSize(targetSize);
@@ -357,17 +359,21 @@ void GaussianBlurView::OnSizeSet(const Vector3& targetSize)
   }
 }
 
-void GaussianBlurView::OnControlChildAdd( Actor& child )
+void GaussianBlurView::OnChildAdd( Actor& child )
 {
+  Control::OnChildAdd( child );
+
   if( child != mChildrenRoot && child != mInternalRoot)
   {
     mChildrenRoot.Add( child );
   }
 }
 
-void GaussianBlurView::OnControlChildRemove( Actor& child )
+void GaussianBlurView::OnChildRemove( Actor& child )
 {
   mChildrenRoot.Remove( child );
+
+  Control::OnChildRemove( child );
 }
 
 void GaussianBlurView::AllocateResources()
index 1d8332e..9b6d564 100644 (file)
@@ -99,14 +99,14 @@ private:
   virtual void OnSizeSet(const Vector3& targetSize);
 
   /**
-   * @copydoc Control::OnControlChildAdd()
+   * @copydoc Control::OnChildAdd()
    */
-  virtual void OnControlChildAdd( Actor& child );
+  virtual void OnChildAdd( Actor& child );
 
   /**
-   * @copydoc Control::OnControlChildRemove()
+   * @copydoc Control::OnChildRemove()
    */
-  virtual void OnControlChildRemove( Actor& child );
+  virtual void OnChildRemove( Actor& child );
 
   void SetBlurBellCurveWidth(float blurBellCurveWidth);
   float CalcGaussianWeight(float x);
index f7c36a7..3eb0144 100644 (file)
@@ -246,6 +246,8 @@ void ImageView::OnStageDisconnection()
 
 void ImageView::OnSizeSet( const Vector3& targetSize )
 {
+  Control::OnSizeSet( targetSize );
+
   if( mRenderer )
   {
     Vector2 size( targetSize );
index 796e7bb..dfc7e1b 100644 (file)
@@ -280,6 +280,8 @@ void Magnifier::SetFrameVisibility(bool visible)
 
 void Magnifier::OnSizeSet(const Vector3& targetSize)
 {
+  Control::OnSizeSet( targetSize );
+
   // TODO: Once Camera/CameraActor properties function as proper animatable properties
   // this code can disappear.
   // whenever the size of the magnifier changes, the field of view needs to change
index 4a260c5..de35289 100755 (executable)
@@ -1506,14 +1506,18 @@ bool Popup::OnDialogTouched(Actor actor, const TouchEvent& event)
   return true;
 }
 
-void Popup::OnControlStageConnection()
+void Popup::OnStageConnection( int depth )
 {
+  Control::OnStageConnection( depth );
+
   mLayoutDirty = true;
   RelayoutRequest();
 }
 
-void Popup::OnControlChildAdd( Actor& child )
+void Popup::OnChildAdd( Actor& child )
 {
+  Control::OnChildAdd( child );
+
   // Re-parent any children added by user to the body layer.
   if( mAlterAddedChild )
   {
index 6893716..91d68b7 100755 (executable)
@@ -432,13 +432,13 @@ private:
   /**
    * Called when the popup is directly or indirectly parented to the stage.
    */
-  virtual void OnControlStageConnection();
+  virtual void OnStageConnection( int depth );
 
   /**
    * From Control; called after a child has been added to the owning actor.
    * @param[in] child The child which has been added.
    */
-  virtual void OnControlChildAdd( Actor& child );
+  virtual void OnChildAdd( Actor& child );
 
   /**
    * @copydoc Control::OnRelayOut()
index 82df8cc..33dbe22 100644 (file)
@@ -1956,6 +1956,8 @@ void ScrollView::OnSizeSet( const Vector3& size )
 
 void ScrollView::OnChildAdd(Actor& child)
 {
+  ScrollBase::OnChildAdd( child );
+
   Dali::Toolkit::ScrollBar scrollBar = Dali::Toolkit::ScrollBar::DownCast(child);
   if(scrollBar)
   {
@@ -1987,6 +1989,8 @@ void ScrollView::OnChildRemove(Actor& child)
 {
   // TODO: Actor needs a RemoveConstraint method to take out an individual constraint.
   UnbindActor(child);
+
+  ScrollBase::OnChildRemove( child );
 }
 
 void ScrollView::StartTouchDownTimer()
index d3f3f87..7ae8fa4 100644 (file)
@@ -293,17 +293,21 @@ void ShadowView::OnInitialize()
   blurStrengthConstraint.Apply();
 }
 
-void ShadowView::OnControlChildAdd( Actor& child )
+void ShadowView::OnChildAdd( Actor& child )
 {
+  Control::OnChildAdd( child );
+
   if( child != mChildrenRoot && child != mBlurRootActor)
   {
     mChildrenRoot.Add( child );
   }
 }
 
-void ShadowView::OnControlChildRemove( Actor& child )
+void ShadowView::OnChildRemove( Actor& child )
 {
   mChildrenRoot.Remove( child );
+
+  Control::OnChildRemove( child );
 }
 
 void ShadowView::ConstrainCamera()
index 9f7d9d6..10c0887 100644 (file)
@@ -118,14 +118,14 @@ private:
   virtual void OnInitialize();
 
   /**
-   * @copydoc Control::OnControlChildAdd()
+   * @copydoc Control::OnChildAdd()
    */
-  virtual void OnControlChildAdd( Actor& child );
+  virtual void OnChildAdd( Actor& child );
 
   /**
-   * @copydoc Control::OnControlChildRemove()
+   * @copydoc Control::OnChildRemove()
    */
-  virtual void OnControlChildRemove( Actor& child );
+  virtual void OnChildRemove( Actor& child );
 
   /**
    * Constrain the camera actor to the position of the point light, pointing
index a730e40..bac0402 100644 (file)
@@ -287,7 +287,7 @@ Actor TableView::RemoveChildAt( const Toolkit::TableView::CellPosition& position
   if( child )
   {
     RelayoutingLock lock( *this );
-    // Remove the child, this will trigger a call to OnControlChildRemove
+    // Remove the child, this will trigger a call to OnChildRemove
     Self().Remove( child );
 
     // relayout the table only if instances were found
@@ -968,8 +968,10 @@ Property::Value TableView::GetProperty( BaseObject* object, Property::Index inde
   return value;
 }
 
-void TableView::OnControlChildAdd( Actor& child )
+void TableView::OnChildAdd( Actor& child )
 {
+  Control::OnChildAdd( child );
+
   if( mLayoutingChild )
   {
     // we're in the middle of laying out children so no point doing anything here
@@ -1061,7 +1063,7 @@ void TableView::OnControlChildAdd( Actor& child )
   RelayoutRequest();
 }
 
-void TableView::OnControlChildRemove( Actor& child )
+void TableView::OnChildRemove( Actor& child )
 {
   // dont process if we're in the middle of bigger operation like delete row, column or resize
   if( !mLayoutingChild )
@@ -1072,6 +1074,8 @@ void TableView::OnControlChildRemove( Actor& child )
       RelayoutRequest();
     }
   }
+
+  Control::OnChildRemove( child );
 }
 
 TableView::TableView( unsigned int initialRows, unsigned int initialColumns )
index d6ccf4b..d6e62b6 100644 (file)
@@ -212,14 +212,14 @@ public:
 private: // From Control
 
   /**
-   * @copydoc Control::OnControlChildAdd(Actor& child)
+   * @copydoc Control::OnChildAdd(Actor& child)
    */
-  virtual void OnControlChildAdd( Actor& child );
+  virtual void OnChildAdd( Actor& child );
 
   /**
-   * @copydoc Control::OnControlChildRemove(Actor& child)
+   * @copydoc Control::OnChildRemove(Actor& child)
    */
-  virtual void OnControlChildRemove( Actor& child );
+  virtual void OnChildRemove( Actor& child );
 
   /**
    * @copydoc Control::OnRelayout
index a3e4d00..4cb2ec6 100644 (file)
@@ -315,8 +315,10 @@ void ToolBar::OnInitialize()
   mLayout.SetRelativeWidth( 1, mRightRelativeSpace );
 }
 
-void ToolBar::OnControlChildAdd(Actor& child)
+void ToolBar::OnChildAdd(Actor& child)
 {
+  Control::OnChildAdd( child );
+
   if( !mInitializing )
   {
     // An actor is being added through the Actor's API.
@@ -330,7 +332,7 @@ void ToolBar::OnControlChildAdd(Actor& child)
     AddControl( child, DEFAULT_RELATIVE_SIZE, DEFAULT_ALIGNMENT, Toolkit::ToolBar::DEFAULT_PADDING );
   }
 
-  // No OnControlChildRemove method required because Actors are added to the mLayout table view, so if an
+  // No OnChildRemove method required because Actors are added to the mLayout table view, so if an
   // actor is removed using the Actor::RemoveChild method it will not remove anything because the
   // actor is in mLayout not in Self().
 }
index 7caaed5..f64d9e8 100644 (file)
@@ -72,9 +72,9 @@ private: // From Control
    * Adds a control using some default values (the control uses 10% of the tool bar space and is placed on the left group).
    * @param child The control to be added.
    *
-   * @see Control::OnControlChildAdd()
+   * @see Control::OnChildAdd()
    */
-  virtual void OnControlChildAdd(Actor& child);
+  virtual void OnChildAdd(Actor& child);
 
 private:
   /**
index 8af3e91..239a2f8 100644 (file)
@@ -420,6 +420,131 @@ void LogicalModel::ClearFontDescriptionRuns()
   FreeFontFamilyNames( mFontDescriptionRuns );
 }
 
+void LogicalModel::CreateParagraphInfo( CharacterIndex startIndex,
+                                        Length numberOfCharacters )
+{
+  const Length totalNumberOfCharacters = mLineBreakInfo.Count();
+
+  // Count the number of LINE_MUST_BREAK to reserve some space for the vector of paragraph's info.
+  Vector<CharacterIndex> paragraphs;
+  paragraphs.Reserve( numberOfCharacters );
+  const TextAbstraction::LineBreakInfo* lineBreakInfoBuffer = mLineBreakInfo.Begin();
+  const CharacterIndex lastCharacterIndexPlusOne = startIndex + numberOfCharacters;
+  for( Length index = startIndex; index < lastCharacterIndexPlusOne; ++index )
+  {
+    if( TextAbstraction::LINE_MUST_BREAK == *( lineBreakInfoBuffer + index ) )
+    {
+      paragraphs.PushBack( index );
+    }
+  }
+
+  // Whether the current paragraphs are updated or set from scratch.
+  const bool updateCurrentParagraphs = numberOfCharacters < totalNumberOfCharacters;
+
+  // Reserve space for current paragraphs plus new ones.
+  const Length numberOfNewParagraphs = paragraphs.Count();
+  const Length totalNumberOfParagraphs = mParagraphInfo.Count() + numberOfNewParagraphs;
+  mParagraphInfo.Resize( totalNumberOfParagraphs );
+
+  ParagraphRun* paragraphInfoBuffer = NULL;
+  Vector<ParagraphRun> newParagraphs;
+
+  if( updateCurrentParagraphs )
+  {
+    newParagraphs.Resize( numberOfNewParagraphs );
+    paragraphInfoBuffer = newParagraphs.Begin();
+  }
+  else
+  {
+    paragraphInfoBuffer = mParagraphInfo.Begin();
+  }
+
+  // Find where to insert the new paragraphs.
+  ParagraphRunIndex paragraphIndex = 0u;
+  CharacterIndex firstIndex = startIndex;
+
+  if( updateCurrentParagraphs )
+  {
+    for( Vector<ParagraphRun>::ConstIterator it = mParagraphInfo.Begin(),
+           endIt = mParagraphInfo.Begin() + totalNumberOfParagraphs - numberOfNewParagraphs;
+         it != endIt;
+         ++it )
+    {
+      const ParagraphRun& paragraph( *it );
+
+      if( startIndex < paragraph.characterRun.characterIndex + paragraph.characterRun.numberOfCharacters )
+      {
+        firstIndex = paragraph.characterRun.characterIndex;
+        break;
+      }
+
+      ++paragraphIndex;
+    }
+  }
+
+  // Create the paragraph info.
+  ParagraphRunIndex newParagraphIndex = 0u;
+  for( Vector<CharacterIndex>::ConstIterator it = paragraphs.Begin(),
+         endIt = paragraphs.End();
+       it != endIt;
+       ++it, ++newParagraphIndex )
+  {
+    const CharacterIndex index = *it;
+
+    ParagraphRun& paragraph = *( paragraphInfoBuffer + newParagraphIndex );
+    paragraph.characterRun.characterIndex = firstIndex;
+    paragraph.characterRun.numberOfCharacters = 1u + index - firstIndex;
+
+    firstIndex += paragraph.characterRun.numberOfCharacters;
+  }
+
+
+  // Insert the new paragraphs.
+  if( updateCurrentParagraphs )
+  {
+    mParagraphInfo.Insert( mParagraphInfo.Begin() + paragraphIndex,
+                           newParagraphs.Begin(),
+                           newParagraphs.End() );
+
+    mParagraphInfo.Resize( totalNumberOfParagraphs );
+
+    // Update the next paragraph indices.
+    for( Vector<ParagraphRun>::Iterator it = mParagraphInfo.Begin() + paragraphIndex + newParagraphs.Count(),
+           endIt = mParagraphInfo.End();
+         it != endIt;
+         ++it )
+    {
+      ParagraphRun& paragraph( *it );
+
+      paragraph.characterRun.characterIndex += numberOfCharacters;
+    }
+  }
+}
+
+void LogicalModel::FindParagraphs( CharacterIndex index,
+                                   Length numberOfCharacters,
+                                   Vector<ParagraphRunIndex>& paragraphs )
+{
+  // Reserve som space for the paragraph indices.
+  paragraphs.Reserve( mParagraphInfo.Count() );
+
+  // Traverse the paragraphs to find which ones contain the given characters.
+  ParagraphRunIndex paragraphIndex = 0u;
+  for( Vector<ParagraphRun>::ConstIterator it = mParagraphInfo.Begin(),
+         endIt = mParagraphInfo.End();
+       it != endIt;
+       ++it, ++paragraphIndex )
+  {
+    const ParagraphRun& paragraph( *it );
+
+    if( ( paragraph.characterRun.characterIndex + paragraph.characterRun.numberOfCharacters > index ) &&
+        ( paragraph.characterRun.characterIndex < index + numberOfCharacters ) )
+    {
+      paragraphs.PushBack( paragraphIndex );
+    }
+  }
+}
+
 LogicalModel::~LogicalModel()
 {
   ClearFontDescriptionRuns();
index 7085d79..e41f0fa 100644 (file)
@@ -29,6 +29,7 @@
 #include <dali-toolkit/internal/text/color-run.h>
 #include <dali-toolkit/internal/text/font-run.h>
 #include <dali-toolkit/internal/text/font-description-run.h>
+#include <dali-toolkit/internal/text/paragraph-run.h>
 #include <dali-toolkit/internal/text/script-run.h>
 
 namespace Dali
@@ -136,6 +137,30 @@ public:
    */
   void ClearFontDescriptionRuns();
 
+  // Paragraphs
+
+  /**
+   * @brief Creates the paragraph info.
+   *
+   * @pre The line break info must be set.
+   *
+   * @param[in] startIndex The character from where the paragraph info is set.
+   * @param[in] numberOfCharacters The number of characters.
+   */
+  void CreateParagraphInfo( CharacterIndex startIndex,
+                            Length numberOfCharacters );
+
+  /**
+   * @brief Find the paragraphs which contains the given characters.
+   *
+   * @param[in] index The first character's index of the run.
+   * @param[in] numberOfCharacters The number of characters of the run.
+   * @param[out] paragraphs Indices to the paragraphs which contain the characters.
+   */
+  void FindParagraphs( CharacterIndex index,
+                       Length numberOfCharacters,
+                       Vector<ParagraphRunIndex>& paragraphs );
+
 protected:
 
   /**
@@ -165,6 +190,7 @@ public:
   Vector<FontDescriptionRun>            mFontDescriptionRuns;
   Vector<LineBreakInfo>                 mLineBreakInfo;
   Vector<WordBreakInfo>                 mWordBreakInfo;
+  Vector<ParagraphRun>                  mParagraphInfo;
   Vector<BidirectionalParagraphInfoRun> mBidirectionalParagraphInfo;
   Vector<CharacterDirection>            mCharacterDirections;        ///< For each character, whether is right to left. ( @e flase is left to right, @e true right to left ).
   Vector<BidirectionalLineInfoRun>      mBidirectionalLineInfo;
diff --git a/dali-toolkit/internal/text/paragraph-run.h b/dali-toolkit/internal/text/paragraph-run.h
new file mode 100644 (file)
index 0000000..7a90363
--- /dev/null
@@ -0,0 +1,54 @@
+#ifndef __DALI_TOOLKIT_TEXT_PARAGRAPH_RUN_H__
+#define __DALI_TOOLKIT_TEXT_PARAGRAPH_RUN_H__
+
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/math/vector2.h>
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/internal/text/character-run.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace Text
+{
+
+/**
+ * @brief ParagraphRun
+ *
+ * In terms of the bidirectional algorithm, a 'paragraph' is understood as a run of characters between Paragraph Separators or appropriate Newline Functions.
+ * A 'paragraph' may also be determined by higher-level protocols like a mark-up tag.
+ */
+struct ParagraphRun
+{
+  CharacterRun  characterRun; ///< The initial character index within the whole text and the number of characters of the run.
+  Size          layoutSize;   ///< The size of the paragraph when is laid-out.
+};
+
+} // namespace Text
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // __DALI_TOOLKIT_TEXT_PARAGRAPH_RUN_H__
index 5e590b5..61afef1 100644 (file)
@@ -50,21 +50,51 @@ namespace Text
 {
 
 void SetLineBreakInfo( const Vector<Character>& text,
+                       CharacterIndex startIndex,
+                       Length numberOfCharacters,
                        Vector<LineBreakInfo>& lineBreakInfo )
 {
-  const Length numberOfCharacters = text.Count();
+  const Length totalNumberOfCharacters = text.Count();
 
-  if( 0u == numberOfCharacters )
+  if( 0u == totalNumberOfCharacters )
   {
     // Nothing to do if there are no characters.
     return;
   }
 
   // Retrieve the line break info.
-  lineBreakInfo.Resize( numberOfCharacters );
-  TextAbstraction::Segmentation::Get().GetLineBreakPositions( text.Begin(),
+  lineBreakInfo.Resize( totalNumberOfCharacters );
+
+  // Whether the current buffer is being updated or is set from scratch.
+  const bool updateCurrentBuffer = numberOfCharacters < totalNumberOfCharacters;
+
+  LineBreakInfo* lineBreakInfoBuffer = NULL;
+  Vector<LineBreakInfo> newLineBreakInfo;
+
+  if( updateCurrentBuffer )
+  {
+    newLineBreakInfo.Resize( numberOfCharacters );
+    lineBreakInfoBuffer = newLineBreakInfo.Begin();
+  }
+  else
+  {
+    lineBreakInfoBuffer = lineBreakInfo.Begin();
+  }
+
+  // Retrieve the line break info.
+  TextAbstraction::Segmentation::Get().GetLineBreakPositions( text.Begin() + startIndex,
                                                               numberOfCharacters,
-                                                              lineBreakInfo.Begin() );
+                                                              lineBreakInfoBuffer );
+
+  // If the line break info is updated, it needs to be inserted in the model.
+  if( updateCurrentBuffer )
+  {
+    lineBreakInfo.Insert( lineBreakInfo.Begin() + startIndex,
+                          newLineBreakInfo.Begin(),
+                          newLineBreakInfo.End() );
+    lineBreakInfo.Resize( totalNumberOfCharacters );
+  }
+
 #ifdef DEBUG_ENABLED
   if( gLogFilter->IsEnabledFor(Debug::Verbose) )
   {
index 61ddcc7..e23065a 100644 (file)
@@ -45,9 +45,13 @@ class LogicalModel;
  *  - 2 is a LINE_NO_BREAK.    Text can't be broken into a new line.
  *
  * @param[in] text Vector of UTF-32 characters.
+ * @param[in] startIndex The character from where the break info is set.
+ * @param[in] numberOfCharacters The number of characters.
  * @param[out] lineBreakInfo The line break info
  */
 void SetLineBreakInfo( const Vector<Character>& text,
+                       CharacterIndex startIndex,
+                       Length numberOfCharacters,
                        Vector<LineBreakInfo>& lineBreakInfo );
 
 /**
index 5313d0c..cd0b1d7 100644 (file)
@@ -175,7 +175,7 @@ void ShapeText( const Vector<Character>& text,
     shaping.GetGlyphs( tmpGlyphs.Begin(),
                        tmpGlyphToCharacterMap.Begin() );
 
-    // Update the indices.
+    // Update the new indices of the glyph to character map.
     if( 0u != totalNumberOfGlyphs )
     {
       for( Vector<CharacterIndex>::Iterator it = tmpGlyphToCharacterMap.Begin(),
index d681730..5571f94 100644 (file)
@@ -336,7 +336,13 @@ void Controller::Impl::UpdateModel( OperationsMask operationsRequired )
     lineBreakInfo.Resize( numberOfCharacters, TextAbstraction::LINE_NO_BREAK );
 
     SetLineBreakInfo( utf32Characters,
+                      startIndex,
+                      requestedNumberOfCharacters,
                       lineBreakInfo );
+
+    // Create the paragraph info.
+    mLogicalModel->CreateParagraphInfo( startIndex,
+                                        requestedNumberOfCharacters );
   }
 
   Vector<WordBreakInfo>& wordBreakInfo = mLogicalModel->mWordBreakInfo;
@@ -471,8 +477,8 @@ void Controller::Impl::UpdateModel( OperationsMask operationsRequired )
                newParagraphGlyphs );
 
     // Create the 'number of glyphs' per character and the glyph to character conversion tables.
-    mVisualModel->CreateGlyphsPerCharacterTable( startIndex, numberOfCharacters );
-    mVisualModel->CreateCharacterToGlyphTable( startIndex, numberOfCharacters );
+    mVisualModel->CreateGlyphsPerCharacterTable( startIndex, startGlyphIndex, numberOfCharacters );
+    mVisualModel->CreateCharacterToGlyphTable( startIndex, startGlyphIndex, numberOfCharacters );
   }
 
   const Length numberOfGlyphs = glyphs.Count();
index 153a36c..ab41790 100644 (file)
@@ -466,7 +466,7 @@ float Controller::GetDefaultPointSize() const
   return 0.0f;
 }
 
-void Controller::UpdateAfterFontChange( std::string& newDefaultFont )
+void Controller::UpdateAfterFontChange( const std::string& newDefaultFont )
 {
   DALI_LOG_INFO( gLogFilter, Debug::Concise, "Controller::UpdateAfterFontChange");
 
@@ -499,7 +499,7 @@ const Vector4& Controller::GetTextColor() const
   return mImpl->mTextColor;
 }
 
-bool Controller::RemoveText( int cursorOffset, int numberOfChars )
+bool Controller::RemoveText( int cursorOffset, int numberOfCharacters )
 {
   bool removed = false;
 
@@ -508,8 +508,8 @@ bool Controller::RemoveText( int cursorOffset, int numberOfChars )
     return removed;
   }
 
-  DALI_LOG_INFO( gLogFilter, Debug::General, "Controller::RemoveText %p mText.Count() %d cursor %d cursorOffset %d numberOfChars %d\n",
-                 this, mImpl->mLogicalModel->mText.Count(), mImpl->mEventData->mPrimaryCursorPosition, cursorOffset, numberOfChars );
+  DALI_LOG_INFO( gLogFilter, Debug::General, "Controller::RemoveText %p mText.Count() %d cursor %d cursorOffset %d numberOfCharacters %d\n",
+                 this, mImpl->mLogicalModel->mText.Count(), mImpl->mEventData->mPrimaryCursorPosition, cursorOffset, numberOfCharacters );
 
   if( !mImpl->IsShowingPlaceholderText() )
   {
@@ -525,12 +525,12 @@ bool Controller::RemoveText( int cursorOffset, int numberOfChars )
       cursorIndex = oldCursorIndex + cursorOffset;
     }
 
-    if( ( cursorIndex + numberOfChars ) > currentText.Count() )
+    if( ( cursorIndex + numberOfCharacters ) > currentText.Count() )
     {
-      numberOfChars = currentText.Count() - cursorIndex;
+      numberOfCharacters = currentText.Count() - cursorIndex;
     }
 
-    if( ( cursorIndex + numberOfChars ) <= currentText.Count() )
+    if( ( cursorIndex + numberOfCharacters ) <= currentText.Count() )
     {
       // Update the input style and remove the text's style before removing the text.
 
@@ -541,18 +541,18 @@ bool Controller::RemoveText( int cursorOffset, int numberOfChars )
       mImpl->mLogicalModel->RetrieveStyle( cursorIndex, mImpl->mEventData->mInputStyle );
 
       // Remove the text's style before removing the text.
-      mImpl->mLogicalModel->UpdateTextStyleRuns( cursorIndex, -numberOfChars );
+      mImpl->mLogicalModel->UpdateTextStyleRuns( cursorIndex, -numberOfCharacters );
 
       // Remove the characters.
       Vector<Character>::Iterator first = currentText.Begin() + cursorIndex;
-      Vector<Character>::Iterator last  = first + numberOfChars;
+      Vector<Character>::Iterator last  = first + numberOfCharacters;
 
       currentText.Erase( first, last );
 
       // Cursor position retreat
       oldCursorIndex = cursorIndex;
 
-      DALI_LOG_INFO( gLogFilter, Debug::General, "Controller::RemoveText %p removed %d\n", this, numberOfChars );
+      DALI_LOG_INFO( gLogFilter, Debug::General, "Controller::RemoveText %p removed %d\n", this, numberOfCharacters );
       removed = true;
     }
   }
@@ -1776,14 +1776,14 @@ void Controller::InsertText( const std::string& text, Controller::InsertType typ
 
   // Remove the previous IMF pre-edit (predicitive text)
   if( mImpl->mEventData->mPreEditFlag &&
-      ( 0 != mImpl->mEventData->mPreEditLength ) )
+      ( 0u != mImpl->mEventData->mPreEditLength ) )
   {
-    CharacterIndex offset = mImpl->mEventData->mPrimaryCursorPosition - mImpl->mEventData->mPreEditStartPosition;
+    const CharacterIndex offset = mImpl->mEventData->mPrimaryCursorPosition - mImpl->mEventData->mPreEditStartPosition;
 
-    removedPrevious = RemoveText( -static_cast<int>(offset), mImpl->mEventData->mPreEditLength );
+    removedPrevious = RemoveText( -static_cast<int>( offset ), mImpl->mEventData->mPreEditLength );
 
     mImpl->mEventData->mPrimaryCursorPosition = mImpl->mEventData->mPreEditStartPosition;
-    mImpl->mEventData->mPreEditLength = 0;
+    mImpl->mEventData->mPreEditLength = 0u;
   }
   else
   {
@@ -1842,7 +1842,7 @@ void Controller::InsertText( const std::string& text, Controller::InsertType typ
 
     const Length numberOfCharactersInModel = mImpl->mLogicalModel->mText.Count();
 
-    // Restrict new text to fit within Maximum characters setting
+    // Restrict new text to fit within Maximum characters setting.
     Length maxSizeOfNewText = std::min( ( mImpl->mMaximumNumberOfCharacters - numberOfCharactersInModel ), characterCount );
     maxLengthReached = ( characterCount > maxSizeOfNewText );
 
@@ -2514,7 +2514,7 @@ void Controller::ShowPlaceholderText()
 
     // Transform a text array encoded in utf8 into an array encoded in utf32.
     // It returns the actual number of characters.
-    Length characterCount = Utf8ToUtf32( utf8, size, utf32Characters.Begin() );
+    const Length characterCount = Utf8ToUtf32( utf8, size, utf32Characters.Begin() );
     utf32Characters.Resize( characterCount );
 
     // Reset the cursor position
index d239d13..7e22134 100644 (file)
@@ -151,10 +151,10 @@ public:
    * @brief Remove a given number of characters
    *
    * @param[in] cursorOffset Start position from the current cursor position to start deleting characters.
-   * @param[in] numberOfChars The number of characters to delete from the cursorOffset.
+   * @param[in] numberOfCharacters The number of characters to delete from the cursorOffset.
    * @return True if the remove was successful.
    */
-  bool RemoveText( int cursorOffset, int numberOfChars );
+  bool RemoveText( int cursorOffset, int numberOfCharacters );
 
   /**
    * @brief Retrieve the current cursor position.
@@ -283,7 +283,7 @@ public:
    * @ brief Update the text after a font change
    * @param[in] newDefaultFont The new font to change to
    */
-  void UpdateAfterFontChange( std::string& newDefaultFont );
+  void UpdateAfterFontChange( const std::string& newDefaultFont );
 
   /**
    * @brief Set the text color
index 4879090..0e9fb3f 100644 (file)
@@ -59,6 +59,7 @@ typedef uint32_t                         UnderlineRunIndex;         ///< An inde
 typedef uint32_t                         BidirectionalRunIndex;     ///< An index into an array of bidirectional info.
 typedef uint32_t                         BidirectionalLineRunIndex; ///< An index into an array of bidirectional line info.
 typedef uint32_t                         LineIndex;                 ///< An index into an array of lines.
+typedef uint32_t                         ParagraphRunIndex;         ///< An index into an array of paragraphs.
 
 } // namespace Text
 
index 37d7b00..ecac39d 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_TOOLKIT_TEXT_STYLE_RUN_CONTAINER_H__
-#define __DALI_TOOLKIT_TEXT_STYLE_RUN_CONTAINER_H__
+#ifndef __DALI_TOOLKIT_TEXT_RUN_CONTAINER_H__
+#define __DALI_TOOLKIT_TEXT_RUN_CONTAINER_H__
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -300,6 +300,7 @@ void ClearGlyphRuns( GlyphIndex startIndex,
         ( startIndex >= run->glyphRun.glyphIndex + run->glyphRun.numberOfGlyphs ) )
     {
       // Run found. Nothing else to do.
+      break;
     }
 
     ++run;
@@ -352,4 +353,4 @@ void ClearGlyphRuns( GlyphIndex startIndex,
 
 } // namespace Dali
 
-#endif // __DALI_TOOLKIT_TEXT_STYLE_RUN_CONTAINER_H__
+#endif // __DALI_TOOLKIT_TEXT_RUN_CONTAINER_H__
index 138ce54..c1faee7 100644 (file)
@@ -36,6 +36,7 @@ VisualModelPtr VisualModel::New()
 }
 
 void VisualModel::CreateCharacterToGlyphTable( CharacterIndex startIndex,
+                                               GlyphIndex startGlyphIndex,
                                                Length numberOfCharacters )
 {
   if( 0u == numberOfCharacters )
@@ -72,7 +73,6 @@ void VisualModel::CreateCharacterToGlyphTable( CharacterIndex startIndex,
   // 2) Traverse the glyphs and set the glyph indices per character.
 
   // Index to the glyph.
-  const GlyphIndex startGlyphIndex = updateCurrentBuffer ? *( mCharactersToGlyph.Begin() + startIndex ) : 0u;
   GlyphIndex glyphIndex = startGlyphIndex;
   CharacterIndex characterIndex = startIndex;
   const CharacterIndex lastCharacterIndexPlusOne = startIndex + numberOfCharacters;
@@ -115,6 +115,7 @@ void VisualModel::CreateCharacterToGlyphTable( CharacterIndex startIndex,
 }
 
 void VisualModel::CreateGlyphsPerCharacterTable( CharacterIndex startIndex,
+                                                 GlyphIndex startGlyphIndex,
                                                  Length numberOfCharacters )
 {
   if( 0u == numberOfCharacters )
@@ -146,14 +147,12 @@ void VisualModel::CreateGlyphsPerCharacterTable( CharacterIndex startIndex,
 
   // 2) Traverse the glyphs and set the number of glyphs per character.
 
-  // The glyph index.
-  const GlyphIndex glyphIndex = updateCurrentBuffer  ? *( mCharactersToGlyph.Begin() + startIndex ) : 0u;
   Length traversedCharacters = 0;
 
   // The number of 'characters per glyph' equal to zero.
   Length zeroCharactersPerGlyph = 0u;
 
-  for( Vector<Length>::ConstIterator it = mCharactersPerGlyph.Begin() + glyphIndex,
+  for( Vector<Length>::ConstIterator it = mCharactersPerGlyph.Begin() + startGlyphIndex,
          endIt = mCharactersPerGlyph.End();
        ( it != endIt ) && ( traversedCharacters < numberOfCharacters );
        ++it )
index a0339a4..5aa90af 100644 (file)
@@ -67,18 +67,22 @@ public:
    * @pre The glyphs per character table needs to be created first.
    *
    * @param[in] startIndex The character from where the conversion table is created.
+   * @param[in] startGlyphIndex The glyph from where the conversion table is created.
    * @param[in] numberOfCharacters The number of characters.
    */
   void CreateCharacterToGlyphTable( CharacterIndex startIndex,
+                                    GlyphIndex startGlyphIndex,
                                     Length numberOfCharacters );
 
   /**
    * @brief Creates an array containing the number of glyphs per character.
    *
    * @param[in] startIndex The character from where the table is created.
+   * @param[in] startGlyphIndex The glyph from where the conversion table is created.
    * @param[in] numberOfCharacters The number of characters.
    */
   void CreateGlyphsPerCharacterTable( CharacterIndex startIndex,
+                                      GlyphIndex startGlyphIndex,
                                       Length numberOfCharacters );
 
   /**
index b8ecd96..5a76197 100644 (file)
@@ -270,6 +270,8 @@ void CubeTransitionEffect::Initialize()
 
 void CubeTransitionEffect::OnStageConnection( int depth )
 {
+  Control::OnStageConnection( depth );
+
   Geometry geometry = CreateQuadGeometry();
   Shader shader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER );
 
@@ -306,6 +308,8 @@ void CubeTransitionEffect::OnStageDisconnection()
     }
     mTargetRenderer.Reset();
   }
+
+  Control::OnStageDisconnection();
 }
 
 void CubeTransitionEffect::SetTransitionDuration( float duration )
index 7cc7571..841e3d3 100644 (file)
@@ -187,8 +187,7 @@ public:
   mLongPressGestureDetector(),
   mFlags( Control::ControlBehaviour( ACTOR_BEHAVIOUR_NONE ) ),
   mIsKeyboardNavigationSupported( false ),
-  mIsKeyboardFocusGroup( false ),
-  mAddRemoveBackgroundChild( false )
+  mIsKeyboardFocusGroup( false )
 {
 }
 
@@ -384,7 +383,6 @@ public:
   ControlBehaviour mFlags :CONTROL_BEHAVIOUR_FLAG_COUNT;    ///< Flags passed in from constructor.
   bool mIsKeyboardNavigationSupported :1;  ///< Stores whether keyboard navigation is supported by the control.
   bool mIsKeyboardFocusGroup :1;           ///< Stores whether the control is a focus group.
-  bool mAddRemoveBackgroundChild:1;        ///< Flag to know when we are adding or removing our own actor to avoid call to OnControlChildAdd
 
   // Properties - these need to be members of Internal::Control::Impl as they need to function within this class.
   static const PropertyRegistration PROPERTY_1;
@@ -841,31 +839,23 @@ void Control::OnKeyInputFocusLost()
 
 void Control::OnChildAdd(Actor& child)
 {
-  // If this is the background actor, then we do not want to inform deriving classes
-  if ( mImpl->mAddRemoveBackgroundChild )
-  {
-    return;
-  }
-
   // Notify derived classes.
   OnControlChildAdd( child );
 }
 
 void Control::OnChildRemove(Actor& child)
 {
-  // If this is the background actor, then we do not want to inform deriving classes
-  if ( mImpl->mAddRemoveBackgroundChild )
-  {
-    return;
-  }
-
   // Notify derived classes.
   OnControlChildRemove( child );
 }
 
 void Control::OnSizeSet(const Vector3& targetSize)
 {
-  // Background is resized through size negotiation
+  if( mImpl->mBackgroundRenderer )
+  {
+    Vector2 size( targetSize );
+    mImpl->mBackgroundRenderer.SetSize( size );
+  }
 }
 
 void Control::OnSizeAnimation(Animation& animation, const Vector3& targetSize)
index b3d0c1e..4779d58 100644 (file)
@@ -301,31 +301,37 @@ protected: // From CustomActorImpl, not to be used by application developers
 
   /**
    * @copydoc CustomActorImpl::OnStageConnection()
+   * @note If overridden, then an up-call to Control::OnStageConnection MUST be made at the start.
    */
   virtual void OnStageConnection( int depth );
 
   /**
    * @copydoc CustomActorImpl::OnStageDisconnection()
+   * @note If overridden, then an up-call to Control::OnStageDisconnection MUST be made at the end.
    */
   virtual void OnStageDisconnection();
 
   /**
    * @copydoc CustomActorImpl::OnChildAdd()
+   * @note If overridden, then an up-call to Control::OnChildAdd MUST be made at the start.
    */
   virtual void OnChildAdd( Actor& child );
 
   /**
    * @copydoc CustomActorImpl::OnChildRemove()
+   * @note If overridden, then an up-call to Control::OnChildRemove MUST be made at the end.
    */
   virtual void OnChildRemove( Actor& child );
 
   /**
    * @copydoc CustomActorImpl::OnSizeSet()
+   * @note If overridden, then an up-call to Control::OnSizeSet MUST be made at the start.
    */
   virtual void OnSizeSet( const Vector3& targetSize );
 
   /**
    * @copydoc CustomActorImpl::OnSizeAnimation()
+   * @note If overridden, then an up-call to Control::OnSizeAnimation MUST be made at the start.
    */
   virtual void OnSizeAnimation( Animation& animation, const Vector3& targetSize );
 
@@ -436,6 +442,8 @@ public: // API for derived classes to override
   virtual void OnInitialize();
 
   /**
+   * @DEPRECATED_1_1.30. Override OnChildAdd instead.
+   *
    * @brief Called whenever an Actor is added to the control.
    *
    * Could be overridden by derived classes.
@@ -446,6 +454,8 @@ public: // API for derived classes to override
   virtual void OnControlChildAdd( Actor& child );
 
   /**
+   * @DEPRECATED_1_1.30. Override OnChildRemove instead.
+   *
    * @brief Called whenever an Actor is removed from the control.
    *
    * Could be overridden by derived classes.
index 95d3f93..62ea7a1 100644 (file)
@@ -31,7 +31,7 @@ namespace Toolkit
 
 const unsigned int TOOLKIT_MAJOR_VERSION = 1;
 const unsigned int TOOLKIT_MINOR_VERSION = 1;
-const unsigned int TOOLKIT_MICRO_VERSION = 28;
+const unsigned int TOOLKIT_MICRO_VERSION = 29;
 const char * const TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index b40262b..7410978 100644 (file)
@@ -327,6 +327,93 @@ void AppFunction()
 
 customControl.MyCustomSignal.Connect( this, &AppFunction );
 ~~~
+___________________________________________________________________________________________________
+
+### Children Added/Removed {#creating-controls-children}
+
+Methods are provided that can be overridden if notification is required when a child is added or removed from our control.
+An up call to the Control class is necessary if these methods are overridden.
+~~~{.cpp}
+// C++
+void MyUIControlImpl::OnChildAdd( Actor& child );
+{
+  // Up call to Control first
+  Control::OnChildAdd( child );
+
+  // Do any other operations required upon child addition
+}
+~~~
+~~~{.cpp}
+// C++
+void MyUIControlImpl::OnChildRemove( Actor& child );
+{
+  // Do any other operations required upon child removal
+
+  // Up call to Control at the end
+  Control::OnChildRemove( child );
+}
+~~~
+Avoid adding or removing the child again within these methods.
+___________________________________________________________________________________________________
+
+### Stage Connection {#creating-controls-stage}
+
+Methods are provided that can be overridden if notification is required when our control is connected to or disconnected from the stage.
+An up call to the Control class is necessary if these methods are overridden.
+~~~{.cpp}
+// C++
+void MyUIControlImpl::OnStageConnection( int depth )
+{
+  // Up call to Control first
+  Control::OnStageConnection( depth );
+
+  // Do any other operations required upon stage connection
+}
+~~~
+~~~{.cpp}
+// C++
+void MyUIControlImpl::OnStageDisconnection()
+{
+  // Do any other operations required upon stage disconnection
+
+  // Up call to Control at the end
+  Control::OnStageDisconnection();
+}
+~~~
+___________________________________________________________________________________________________
+
+### Size {#creating-controls-size}
+
+Methods are provided that can be overridden if notification is required when our control's size is manipulated.
+An up call to the Control class is necessary if these methods are overridden.
+~~~{.cpp}
+// C++
+void MyUIControlImpl::OnSizeSet( const Vector3& targetSize )
+{
+  // Up call to Control
+  Control::OnSizeSet( targetSize );
+
+  // Do any other operations required upon size set
+}
+~~~
+~~~{.cpp}
+// C++
+void MyUIControlImpl::OnSizeAnimation( Animation& animation, const Vector3& targetSize )
+{
+  // Up call to Control
+  Control::OnSizeAnimation( animation, targetSize );
+
+  // Do any other operations required upon size animation
+}
+~~~
 ___________________________________________________________________________________________________
 
 ### Other Features {#creating-controls-other}
index 02da954..9cc1a48 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali-toolkit
 Summary:    The OpenGLES Canvas Core Library Toolkit
-Version:    1.1.28
+Version:    1.1.29
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-2-Clause and MIT