Remove mesh from text input. 58/36458/1
authorFrancisco Santos <f1.santos@samsung.com>
Fri, 6 Mar 2015 14:41:41 +0000 (14:41 +0000)
committerFrancisco Santos <f1.santos@samsung.com>
Fri, 6 Mar 2015 14:41:41 +0000 (14:41 +0000)
Change-Id: Ie887ef2fdd28cb8857695f9a1bf5c7841071ec0b

dali-toolkit/internal/controls/text-input/text-input-decorator-impl.cpp
dali-toolkit/internal/controls/text-input/text-input-decorator-impl.h
dali-toolkit/internal/controls/text-input/text-input-impl.cpp
dali-toolkit/internal/controls/text-input/text-input-impl.h
dali-toolkit/internal/controls/text-input/text-input-text-highlight-impl.cpp
dali-toolkit/internal/controls/text-input/text-input-text-highlight-impl.h
dali-toolkit/public-api/controls/text-input/text-input.cpp

index 9887238..7ce238a 100644 (file)
@@ -580,30 +580,14 @@ void Decorator::CreateHighlight( Actor parent )
 {
   DALI_ASSERT_DEBUG( parent && "Highlight target parent does not exist" );
 
-  if ( !mHighlightMeshActor )
-  {
-    mHighlightMeshActor = MeshActor::New( mTextHighlight.CreateHighLightMesh() );
-    mHighlightMeshActor.SetName( "HighlightMeshActor" );
-    parent.Add( mHighlightMeshActor );
-  }
 }
 
 void Decorator::RemoveHighlight()
 {
-  if ( mHighlightMeshActor )
-  {
-    mHighlightMeshActor.Unparent();
-    mHighlightMeshActor.Reset();
-    // NOTE: We cannot dereference mHighlightMesh, due to a how the scene-graph MeshRenderer uses the Mesh data.
-  }
 }
 
 void Decorator::HighlightVisibility( bool visiblility )
 {
-  if ( mHighlightMeshActor )
-  {
-    mHighlightMeshActor.SetVisible( visiblility );
-  }
 }
 
 /**
@@ -790,11 +774,6 @@ void Decorator::ShowPopUp()
 
   DALI_ASSERT_DEBUG( mPopUpTarget && "PopUp Target Actor does not exist" );
 
-  if( mHighlightMeshActor ) // Text Selection mode
-  {
-    position = PositionOfPopUpRelativeToSelectionHandles();
-  }
-  else // Not in Text Selection mode so position relative to cursor.
   {
     position = PositionOfPopUpRelativeToCursor();
   }
@@ -818,7 +797,7 @@ void Decorator::ShowPopupCutCopyPaste()
 {
   bool isAllTextSelectedAlready = ( mTextViewCharacterPositioning.StyledTextSize() == GetSelectedText().size() );
   bool isTextEmpty = mTextViewCharacterPositioning.IsStyledTextEmpty() ;
-  bool isSubsetOfTextAlreadySelected = ( !isAllTextSelectedAlready ) && mHighlightMeshActor;
+  bool isSubsetOfTextAlreadySelected = ( !isAllTextSelectedAlready ) &&false;
 
   Clipboard clipboard = Clipboard::Get();
   bool hasClipboardGotContent = clipboard.NumberOfItems();
@@ -845,11 +824,6 @@ void Decorator::PopUpLeavesVerticalBoundary( PropertyNotification& source)
 {
   Vector3 position, alternativePosition;
 
-  if( mHighlightMeshActor ) // Text Selection mode
-  {
-    alternativePosition = AlternatePopUpPositionRelativeToSelectionHandles();
-  }
-  else // Not in Text Selection mode
   {
     alternativePosition = AlternatePopUpPositionRelativeToCursor();
     // if can't be positioned above, then position below row.
@@ -947,11 +921,6 @@ void Decorator::TextViewScrolled( Toolkit::TextView textView, Vector2 scrollPosi
     PositionSelectionHandle( selectionHandleOne, mSelectionHandleOneActualPosition, mSelectionHandleOnePosition );
     PositionSelectionHandle( selectionHandleTwo, mSelectionHandleTwoActualPosition, mSelectionHandleTwoPosition );
 
-    if( mHighlightMeshActor )
-    {
-      mHighlightMeshActor.SetVisible( true );
-      ShowUpdatedHighlight();
-    }
   }
 }
 
@@ -1061,17 +1030,6 @@ MarkupProcessor::StyledTextArray Decorator::GetSelectedText()
 {
   MarkupProcessor::StyledTextArray currentSelectedText;
 
-  if ( mHighlightMeshActor ) // Text Selected
-  {
-    MarkupProcessor::StyledTextArray::iterator it = mTextViewCharacterPositioning.GetStyledTextArray().begin() + std::min(mSelectionHandleOnePosition, mSelectionHandleTwoPosition);
-    MarkupProcessor::StyledTextArray::iterator end = mTextViewCharacterPositioning.GetStyledTextArray().begin() + std::max(mSelectionHandleOnePosition, mSelectionHandleTwoPosition);
-
-    for(; it != end; ++it)
-    {
-      MarkupProcessor::StyledText& styledText( *it );
-      currentSelectedText.push_back( styledText );
-    }
-  }
   return currentSelectedText;
 }
 
index 7de78bf..46a03e6 100644 (file)
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/actors/image-actor.h>
-#include <dali/public-api/actors/mesh-actor.h>
 #include <dali/public-api/adaptor-framework/timer.h>
 #include <dali/public-api/animation/animation.h>
 #include <dali/public-api/common/intrusive-ptr.h>
-#include <dali/public-api/geometry/mesh.h>
 #include <dali/public-api/signals/connection-tracker.h>
 
 // INTERNAL INCLUDES
@@ -609,7 +607,6 @@ private:
   Timer mScrollTimer;                           // Timer to scroll text over a period of time not all in one update.
 
   TextHighlight mTextHighlight;                 // Holds data required to construct the highlight
-  MeshActor mHighlightMeshActor;                // Mesh Actor to display highlight
 
   PanGestureDetector mPanGestureDetector;
 
index 37ed62d..34eabee 100644 (file)
@@ -534,11 +534,6 @@ std::size_t TextInput::GetNumberOfCharacters() const
 void TextInput::SetMaterialDiffuseColor( const Vector4& color )
 {
   mMaterialColor = color;
-  if ( mCustomMaterial )
-  {
-    mCustomMaterial.SetDiffuseColor( mMaterialColor );
-    mMeshData.SetMaterial( mCustomMaterial );
-  }
 }
 
 const Vector4& TextInput::GetMaterialDiffuseColor() const
@@ -697,7 +692,7 @@ bool TextInput::IsTextSelectable() const
 
 bool TextInput::IsTextSelected() const
 {
-  return mHighlightMeshActor;
+  return false;
 }
 
 void TextInput::DeSelectText()
@@ -1537,10 +1532,6 @@ void TextInput::OnLongPress(Dali::Actor actor, const Dali::LongPressGesture& lon
   DALI_LOG_INFO( gLogFilter, Debug::General, "OnLongPress\n" );
 
   // Ignore longpress if in selection mode already
-  if( mHighlightMeshActor )
-  {
-    return;
-  }
 
   if(longPress.state == Dali::Gesture::Started)
   {
@@ -1708,10 +1699,6 @@ void TextInput::OnPopupHideFinished(TextInputPopup& popup)
   popup.HideFinishedSignal().Disconnect( this, &TextInput::OnPopupHideFinished );
 
   // Change Popup menu to Cut/Copy/Paste if text has been selected.
-  if(mHighlightMeshActor && mState == StateEdit)
-  {
-    ShowPopupCutCopyPaste();
-  }
 }
 
 //FIXME this routine needs to be re-written as it contains too many branches.
@@ -1776,11 +1763,6 @@ bool TextInput::OnKeyDownEvent(const KeyEvent& event)
   } // Return
   else if ( keyName == "space" )
   {
-    if ( mHighlightMeshActor )
-    {
-      // Some text is selected so erase it before adding space.
-      DeleteHighlightedText( true );
-    }
 
     mCursorPosition = mCursorPosition + InsertAt(Text(keyString), mCursorPosition, 0);
 
@@ -1795,13 +1777,6 @@ bool TextInput::OnKeyDownEvent(const KeyEvent& event)
   } // space
   else if (keyName == "BackSpace")
   {
-    if ( mHighlightMeshActor )
-    {
-      // Some text is selected so erase it
-      DeleteHighlightedText( true );
-      update = true;
-    }
-    else
     {
       if ( mCursorPosition > 0 )
       {
@@ -2007,11 +1982,6 @@ void TextInput::OnTextViewScrolled( Toolkit::TextView textView, Vector2 scrollPo
     mSelectionHandleOne.SetPosition( mSelectionHandleOneActualPosition + UI_OFFSET + mSelectionHandleOneOffset );
     mSelectionHandleTwo.SetPosition( mSelectionHandleTwoActualPosition + UI_OFFSET + mSelectionHandleTwoOffset );
 
-    if( mHighlightMeshActor )
-    {
-      mHighlightMeshActor.SetVisible( true );
-      UpdateHighlight();
-    }
   }
 }
 
@@ -2265,11 +2235,6 @@ ImfManager::ImfCallbackData TextInput::ImfEventReceived( Dali::ImfManager& imfMa
       mIgnoreFirstCommitFlag = false;
 
       // Some text may be selected, hiding keyboard causes an empty predictive string to be sent, we don't want to delete highlight in this case
-      if ( mHighlightMeshActor &&  (!imfEvent.predictiveString.empty()) )
-      {
-        // replaces highlighted text with new character
-        DeleteHighlightedText( false );
-      }
 
       preeditResetRequired = PreEditReceived( imfEvent.predictiveString, imfEvent.cursorOffset );
 
@@ -2296,11 +2261,6 @@ ImfManager::ImfCallbackData TextInput::ImfEventReceived( Dali::ImfManager& imfMa
         // A Commit message is a word that has been accepted, it may have been a pre-edit word previously but now commited.
 
         // Some text may be selected, hiding keyboard causes an empty predictive string to be sent, we don't want to delete highlight in this case
-        if ( mHighlightMeshActor &&  (!imfEvent.predictiveString.empty()) )
-        {
-          // replaces highlighted text with new character
-          DeleteHighlightedText( false );
-        }
 
        // A PreEditReset can cause a commit message to be sent, the Ignore Commit flag is used in scenarios where the word is
        // not needed, one such scenario is when the pre-edit word is too long to fit.
@@ -2336,13 +2296,6 @@ ImfManager::ImfCallbackData TextInput::ImfEventReceived( Dali::ImfManager& imfMa
       std::size_t toDelete = 0;
       std::size_t numberOfCharacters = 0;
 
-      if( mHighlightMeshActor )
-      {
-        // delete highlighted text.
-        toDelete = std::min( mSelectionHandleOnePosition, mSelectionHandleTwoPosition );
-        numberOfCharacters = std::max( mSelectionHandleOnePosition, mSelectionHandleTwoPosition ) - toDelete;
-      }
-      else
       {
         if( static_cast<std::size_t>(std::abs( imfEvent.cursorOffset )) < mCursorPosition )
         {
@@ -2372,7 +2325,7 @@ ImfManager::ImfCallbackData TextInput::ImfEventReceived( Dali::ImfManager& imfMa
     {
       // If text is selected/highlighted and surrounding text received we do not want the keyboard to store the word at cursor and return it as a predictive word along with
       // the next key pressed.  Instead the Select function sets the cursor position and surrounding text.
-      if (! ( mHighlightMeshActor || mSelectingText ) )
+      if (! ( false || mSelectingText ) )
       {
         std::string text( GetText() );
         DALI_LOG_INFO( gLogFilter, Debug::General, "OnKey - surrounding text - set text [%s] and cursor[%u] \n", text.c_str(), mCursorPosition );
@@ -2657,78 +2610,6 @@ void TextInput::DeleteHighlightedText( bool inheritStyle )
 {
   DALI_LOG_INFO( gLogFilter, Debug::General, "DeleteHighlightedText handlePosOne[%u] handlePosTwo[%u]\n", mSelectionHandleOnePosition, mSelectionHandleTwoPosition);
 
-  if( mHighlightMeshActor )
-  {
-    mCursorPosition = std::min( mSelectionHandleOnePosition, mSelectionHandleTwoPosition );
-
-    MarkupProcessor::StyledTextArray::iterator start = mStyledText.begin() + mCursorPosition;
-    MarkupProcessor::StyledTextArray::iterator end =  mStyledText.begin() + std::max( mSelectionHandleOnePosition, mSelectionHandleTwoPosition );
-
-    // Get the styled text of the characters to be deleted as it may be needed if
-    // the "exceed the text-input's boundaries" option is disabled.
-    MarkupProcessor::StyledTextArray styledCharactersToDelete;
-
-    styledCharactersToDelete.insert( styledCharactersToDelete.begin(), start, end );
-
-    mStyledText.erase( start, end ); // erase range of characters
-
-    // Remove text from TextView and update place holder text if required
-
-    // Set the placeholder text only if the styled text is empty.
-    if( mStyledText.empty() )
-    {
-      ShowPlaceholderText( mStyledPlaceHolderText );
-    }
-    else
-    {
-      const std::size_t numberOfCharacters = std::max( mSelectionHandleOnePosition, mSelectionHandleTwoPosition ) - mCursorPosition;
-
-      mDisplayedTextView.RemoveTextFrom( mCursorPosition, numberOfCharacters );
-
-      // It may happen than after removing a white space or a new line character,
-      // two words merge, this new word could be big enough to not fit in its
-      // current line, so moved to the next one, and make some part of the text to
-      // exceed the text-input's boundary.
-      if( !mExceedEnabled )
-      {
-        // Get the new text layout after removing some characters.
-        mDisplayedTextView.GetTextLayoutInfo( mTextLayoutInfo );
-
-        // Get text-input's size.
-        const Vector3& size = GetControlSize();
-
-        if( ( mTextLayoutInfo.mTextSize.width > size.width ) ||
-            ( mTextLayoutInfo.mTextSize.height > size.height ) )
-        {
-          mDisplayedTextView.InsertTextAt( mCursorPosition, styledCharactersToDelete );
-
-          mStyledText.insert( mStyledText.begin() + mCursorPosition,
-                              styledCharactersToDelete.begin(),
-                              styledCharactersToDelete.end() );
-        }
-      }
-    }
-    GetTextLayoutInfo();
-
-    RemoveHighlight();
-
-    EmitTextModified();
-
-    if( inheritStyle )
-    {
-      const TextStyle oldInputStyle( mInputStyle );
-
-      mInputStyle = GetStyleAtCursor(); // Inherit style from cursor position
-
-      if( oldInputStyle != mInputStyle )
-      {
-        // Updates the line height accordingly with the input style.
-        UpdateLineHeight();
-
-        EmitStyleChangedSignal();
-      }
-    }
-  }
 }
 
 void TextInput::DeleteRange( const std::size_t start, const std::size_t ncharacters )
@@ -2747,29 +2628,6 @@ void TextInput::DeleteRange( const std::size_t start, const std::size_t ncharact
     mStyledText.erase(itStart, itEnd);
 
     // update the selection handles if they are visible.
-    if( mHighlightMeshActor )
-    {
-      std::size_t& minHandle = ( mSelectionHandleOnePosition <= mSelectionHandleTwoPosition ? mSelectionHandleOnePosition : mSelectionHandleTwoPosition );
-      std::size_t& maxHandle = ( mSelectionHandleTwoPosition > mSelectionHandleOnePosition ? mSelectionHandleTwoPosition : mSelectionHandleOnePosition );
-
-      if( minHandle >= start + ncharacters )
-      {
-        minHandle -= ncharacters;
-      }
-      else if( ( minHandle > start ) && ( minHandle < start + ncharacters ) )
-      {
-        minHandle = start;
-      }
-
-      if( maxHandle >= start + ncharacters )
-      {
-        maxHandle -= ncharacters;
-      }
-      else if( ( maxHandle > start ) && ( maxHandle < start + ncharacters ) )
-      {
-        maxHandle = start;
-      }
-    }
 
     // Set text is not called here as currently it can not process the set text from deletion and then the set text from the in-coming pre-edit.
   }
@@ -3778,74 +3636,6 @@ void TextInput::UpdateHighlight()
 //  9*    *7
 //
 
-  if ( mHighlightMeshActor )
-  {
-    // vertex and triangle buffers should always be present if MeshActor is alive.
-    HighlightInfo newHighlightInfo = CalculateHighlightInfoRtl();
-    MeshData::VertexContainer vertices;
-    Dali::MeshData::FaceIndices faceIndices;
-
-    if( !newHighlightInfo.mQuadList.empty() )
-    {
-      std::vector<QuadCoordinates>::iterator iter = newHighlightInfo.mQuadList.begin();
-      std::vector<QuadCoordinates>::iterator endIter = newHighlightInfo.mQuadList.end();
-
-      // vertex position defaults to (0 0 0)
-      MeshData::Vertex vertex;
-      // set normal for all vertices as (0 0 1) pointing outward from TextInput Actor.
-      vertex.nZ = 1.0f;
-
-      for(std::size_t v = 0; iter != endIter; ++iter,v+=4 )
-      {
-        // Add each quad geometry (a sub-selection) to the mesh data.
-
-        // 0-----1
-        // |\    |
-        // | \ A |
-        // |  \  |
-        // | B \ |
-        // |    \|
-        // 2-----3
-
-        QuadCoordinates& quad = *iter;
-        // top-left (v+0)
-        vertex.x = quad.min.x;
-        vertex.y = quad.min.y;
-        vertices.push_back( vertex );
-
-        // top-right (v+1)
-        vertex.x = quad.max.x;
-        vertex.y = quad.min.y;
-        vertices.push_back( vertex );
-
-        // bottom-left (v+2)
-        vertex.x = quad.min.x;
-        vertex.y = quad.max.y;
-        vertices.push_back( vertex );
-
-        // bottom-right (v+3)
-        vertex.x = quad.max.x;
-        vertex.y = quad.max.y;
-        vertices.push_back( vertex );
-
-        // triangle A (3, 1, 0)
-        faceIndices.push_back( v + 3 );
-        faceIndices.push_back( v + 1 );
-        faceIndices.push_back( v );
-
-        // triangle B (0, 2, 3)
-        faceIndices.push_back( v );
-        faceIndices.push_back( v + 2 );
-        faceIndices.push_back( v + 3 );
-
-        mMeshData.SetFaceIndices( faceIndices );
-      }
-
-      BoneContainer bones(0); // passed empty as bones not required
-      mMeshData.SetData( vertices, faceIndices, bones, mCustomMaterial );
-      mHighlightMesh.UpdateMeshData(mMeshData);
-    }
-  }
 }
 
 void TextInput::ClearPopup()
@@ -3917,7 +3707,7 @@ void TextInput::ShowPopup( bool animate )
   Vector3 position;
   Vector2 alternativePopupPosition;
 
-  if(mHighlightMeshActor && mState == StateEdit)
+  if(false && mState == StateEdit)
   {
     Vector3 topHandle;
     Vector3 bottomHandle; // referring to the bottom most point of the handle or the bottom line of selection.
@@ -4710,7 +4500,7 @@ void TextInput::OnStageTouched(const TouchEvent& event)
 
       bool textInputTouched = (touchedActor && WasTouchedCheck( touchedActor ));
 
-      if ( ( mHighlightMeshActor || popUpShown ) && !textInputTouched )
+      if ( ( false || popUpShown ) && !textInputTouched )
       {
         EndMonitoringStageForTouch();
         HidePopup( true, false );
@@ -4838,7 +4628,7 @@ void TextInput::RemoveHighlight( bool hidePopup )
 {
   DALI_LOG_INFO(gLogFilter, Debug::General, "RemoveHighlight\n");
 
-  if ( mHighlightMeshActor )
+  if ( false )
   {
     if ( mSelectionHandleOne )
     {
@@ -4855,12 +4645,10 @@ void TextInput::RemoveHighlight( bool hidePopup )
 
     mNewHighlightInfo.mQuadList.clear();
 
-    Self().Remove( mHighlightMeshActor );
 
     SetCursorVisibility( true );
     StartCursorBlinkTimer();
 
-    mHighlightMeshActor.Reset();
     // NOTE: We cannot dereference mHighlightMesh, due
     // to a bug in how the scene-graph MeshRenderer uses the Mesh data incorrectly.
 
@@ -4876,26 +4664,6 @@ void TextInput::RemoveHighlight( bool hidePopup )
 
 void TextInput::CreateHighlight()
 {
-  if ( !mHighlightMeshActor )
-  {
-    mMeshData = MeshData( );
-    mMeshData.SetHasNormals( true );
-
-    mCustomMaterial = Material::New("CustomMaterial");
-    mCustomMaterial.SetDiffuseColor( mMaterialColor );
-
-    mMeshData.SetMaterial( mCustomMaterial );
-
-    mHighlightMesh = Mesh::New( mMeshData );
-
-    mHighlightMeshActor = MeshActor::New( mHighlightMesh );
-    mHighlightMeshActor.SetName( "HighlightMeshActor" );
-    mHighlightMeshActor.SetParentOrigin( ParentOrigin::TOP_LEFT );
-    mHighlightMeshActor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
-    mHighlightMeshActor.SetPosition( 0.0f, 0.0f, DISPLAYED_HIGHLIGHT_Z_OFFSET );
-
-    Self().Add(mHighlightMeshActor);
-  }
 }
 
 
@@ -4923,7 +4691,7 @@ void TextInput::PasteText( const Text& text )
   // Any key stroke that results in a visual change of the text-input should
   // set this flag to true.
   bool update = false;
-  if( mHighlightMeshActor )
+  if( false )
   {
     /* if highlighted, delete entire text, and position cursor at start of deleted text. */
     mCursorPosition = std::min(mSelectionHandleOnePosition, mSelectionHandleTwoPosition);
@@ -5119,10 +4887,6 @@ void TextInput::SetScrollEnabled( bool enable )
       mSelectionHandleOne.SetVisible( true );
       mSelectionHandleTwo.SetVisible( true );
 
-      if( mHighlightMeshActor )
-      {
-        mHighlightMeshActor.SetVisible( true );
-      }
     }
   }
 }
index f913ead..19d40b9 100644 (file)
  */
 
 // EXTERNAL INCLUDES
-#include <dali/public-api/actors/mesh-actor.h>
 #include <dali/public-api/adaptor-framework/clipboard.h>
 #include <dali/public-api/adaptor-framework/clipboard-event-notifier.h>
 #include <dali/public-api/adaptor-framework/imf-manager.h>
 #include <dali/public-api/adaptor-framework/timer.h>
 #include <dali/public-api/common/dali-vector.h>
-#include <dali/public-api/geometry/mesh.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/control-impl.h>
@@ -1469,10 +1467,6 @@ private:
   Actor mHandleOneGrabArea;                     ///< invisible actor that receives pans events for the selection handle.
   Actor mHandleTwoGrabArea;                     ///< invisible actor that receives pans events for the selection handle.
 
-  Mesh              mHighlightMesh;             ///< Mesh Data for highlight
-  MeshActor         mHighlightMeshActor;        ///< Mesh Actor to display highlight
-  MeshData          mMeshData;                  ///< Container to hold meshData for highlight
-  Material          mCustomMaterial;            ///< Custom material used for highlight
   HighlightInfo     mNewHighlightInfo;          ///< Geometry info to create highlight.
 
   Text mPreEditString;                          ///< Holds current input string prior to it being committed.
index 7475678..2659f48 100644 (file)
@@ -252,110 +252,10 @@ TextHighlight::HighlightInfo TextHighlight::CalculateHighlightInfo( std::size_t
 
 void TextHighlight::UpdateHighlight( TextHighlight::HighlightInfo& newHighlightInfo )
 {
-//  Construct a Mesh with a texture to be used as the highlight 'box' for selected text
-//
-//  Example scenarios where mesh is made from 3, 1, 2, 2 ,3 or 3 quads.
-//
-//   [ TOP   ]  [ TOP ]      [TOP ]  [ TOP    ]      [ TOP  ]      [ TOP  ]
-//  [ MIDDLE ]             [BOTTOM]  [BOTTOM]      [ MIDDLE ]   [ MIDDLE  ]
-//  [ BOTTOM]                                      [ MIDDLE ]   [ MIDDLE  ]
-//                                                 [BOTTOM]     [ MIDDLE  ]
-//                                                              [BOTTOM]
-//
-//  Each quad is created as 2 triangles.
-//  Middle is just 1 quad regardless of its size.
-//
-//  (0,0)         (0,0)
-//     0*    *2     0*       *2
-//     TOP          TOP
-//     3*    *1     3*       *1
-//  4*       *1     4*     *6
-//     MIDDLE         BOTTOM
-//  6*       *5     7*     *5
-//  6*    *8
-//   BOTTOM
-//  9*    *7
-//
-
-  // vertex and triangle buffers should always be present if MeshActor is alive.
-  //HighlightInfo newHighlightInfo = CalculateHighlightInfo( handlePositionStart, handlePositionEnd );
-  MeshData::VertexContainer vertices;
-  Dali::MeshData::FaceIndices faceIndices;
-
-  if( !newHighlightInfo.mQuadList.empty() )
-  {
-    std::vector<QuadCoordinates>::iterator iter = newHighlightInfo.mQuadList.begin();
-    std::vector<QuadCoordinates>::iterator endIter = newHighlightInfo.mQuadList.end();
-
-    // vertex position defaults to (0 0 0)
-    MeshData::Vertex vertex;
-    // set normal for all vertices as (0 0 1) pointing outward from TextInput Actor.
-    vertex.nZ = 1.0f;
-
-    for(std::size_t v = 0; iter != endIter; ++iter,v+=4 )
-    {
-      // Add each quad geometry (a sub-selection) to the mesh data.
-
-      // 0-----1
-      // |\    |
-      // | \ A |
-      // |  \  |
-      // | B \ |
-      // |    \|
-      // 2-----3
-
-      QuadCoordinates& quad = *iter;
-      // top-left (v+0)
-      vertex.x = quad.min.x;
-      vertex.y = quad.min.y;
-      vertices.push_back( vertex );
-
-      // top-right (v+1)
-      vertex.x = quad.max.x;
-      vertex.y = quad.min.y;
-      vertices.push_back( vertex );
-
-      // bottom-left (v+2)
-      vertex.x = quad.min.x;
-      vertex.y = quad.max.y;
-      vertices.push_back( vertex );
-
-      // bottom-right (v+3)
-      vertex.x = quad.max.x;
-      vertex.y = quad.max.y;
-      vertices.push_back( vertex );
-
-      // triangle A (3, 1, 0)
-      faceIndices.push_back( v + 3 );
-      faceIndices.push_back( v + 1 );
-      faceIndices.push_back( v );
-
-      // triangle B (0, 2, 3)
-      faceIndices.push_back( v );
-      faceIndices.push_back( v + 2 );
-      faceIndices.push_back( v + 3 );
-    }
-
-    mMeshData.SetVertices( vertices );
-    mMeshData.SetFaceIndices( faceIndices );
-
-    mHighlightMesh.UpdateMeshData(mMeshData);
-  }
 }
 
-Mesh TextHighlight::CreateHighLightMesh()
+void TextHighlight::CreateHighLightMesh()
 {
-  mMeshData = MeshData( );
-  mMeshData.SetHasNormals( true );
-
-  mCustomMaterial = Material::New("CustomMaterial");
-  mCustomMaterial.SetDiffuseColor( LIGHTBLUE );
-
-  mMeshData.SetMaterial( mCustomMaterial );
-
-  mHighlightMesh = Mesh::New( mMeshData );
-
-  return mHighlightMesh;
 }
 
 void TextHighlight::HighlightInfo::AddQuad( float x1, float y1, float x2, float y2 )
index 74a3421..8fdbcd9 100644 (file)
  *
  */
 
-// EXTERNAL INCLUDES
-#include <dali/public-api/geometry/mesh.h>
-#include <dali/public-api/modeling/material.h>
-
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/controls/text-input/textview-character-positions-impl.h>
 #include <dali-toolkit/public-api/controls/text-view/text-view.h>
@@ -141,7 +137,7 @@ public:
   /**
    * Creates the Mesh data needed by the Mesh Actor
    */
-  Mesh CreateHighLightMesh();
+  void CreateHighLightMesh();
 
 private:
 
@@ -163,9 +159,6 @@ private:
 
   TextViewCharacterPositioning& mTextViewCharacterPositioning;
 
-  Mesh              mHighlightMesh;             ///< Mesh Data for highlight
-  MeshData          mMeshData;                  ///< Container to hold meshData for highlight
-  Material          mCustomMaterial;            ///< Custom material used for highlight
   HighlightInfo     mNewHighlightInfo;          ///< Geometry info to create highlight.
 
 };
index f0a43e3..f38b516 100644 (file)
@@ -19,7 +19,6 @@
 #include <dali-toolkit/public-api/controls/text-input/text-input.h>
 
 // EXTERNAL INCLUDES
-#include <dali/public-api/actors/mesh-actor.h>
 #include <dali/public-api/adaptor-framework/clipboard.h>
 #include <dali/public-api/adaptor-framework/clipboard-event-notifier.h>
 #include <dali/public-api/adaptor-framework/imf-manager.h>