Move FontDefaults Declaration/Definition as it's needed by the TextInput.
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / text-controller.cpp
index 0796311..591dbaf 100644 (file)
@@ -70,6 +70,31 @@ namespace Toolkit
 namespace Text
 {
 
+struct Controller::FontDefaults
+{
+  FontDefaults()
+  : mDefaultPointSize(0.0f),
+    mFontId(0u)
+  {
+  }
+
+  FontId GetFontId( TextAbstraction::FontClient& fontClient )
+  {
+    if( !mFontId )
+    {
+      Dali::TextAbstraction::PointSize26Dot6 pointSize = mDefaultPointSize*64;
+      mFontId = fontClient.GetFontId( mDefaultFontFamily, mDefaultFontStyle, pointSize );
+    }
+
+    return mFontId;
+  }
+
+  std::string mDefaultFontFamily;
+  std::string mDefaultFontStyle;
+  float mDefaultPointSize;
+  FontId mFontId;
+};
+
 struct Controller::TextInput
 {
   // Used to queue input events until DoRelayout()
@@ -245,7 +270,7 @@ struct Controller::TextInput
       float yPosition = event.p3.mFloat - alignmentOffset.y;
       float height(0.0f);
       GetClosestCursorPosition( mPrimaryCursorPosition, xPosition, yPosition, height );
-      mDecorator->SetPosition( PRIMARY_CURSOR, xPosition, yPosition, height );
+      mDecorator->SetPosition( PRIMARY_CURSOR, xPosition, yPosition, height, height ); // TODO: To be fixed in the next patch.
       mUpdateCursorPosition = false;
 
       mDecoratorUpdated = true;
@@ -325,7 +350,8 @@ struct Controller::TextInput
 
       GetClosestCursorPosition( mPrimaryCursorPosition, xPosition, yPosition, height );
 
-      mDecorator->SetPosition( PRIMARY_CURSOR, xPosition, yPosition, height );
+      mDecorator->SetPosition( PRIMARY_CURSOR, xPosition, yPosition, height, height ); // TODO: To be fixed in the next patch.
+
       //mDecorator->HidePopup();
       ChangeState ( EDITING );
       mDecoratorUpdated = true;
@@ -567,7 +593,7 @@ struct Controller::TextInput
       }
     }
 
-    mDecorator->SetPosition( PRIMARY_CURSOR, visualX, visualY, height );
+    mDecorator->SetPosition( PRIMARY_CURSOR, visualX, visualY, height, height ); // TODO: To be fixed in the next patch.
     mDecoratorUpdated = true;
   }
 
@@ -604,31 +630,6 @@ struct Controller::TextInput
   bool mUpdateCursorPosition       : 1; ///< True if the visual position of the cursor must be recalculated
 };
 
-struct Controller::FontDefaults
-{
-  FontDefaults()
-  : mDefaultPointSize(0.0f),
-    mFontId(0u)
-  {
-  }
-
-  FontId GetFontId( TextAbstraction::FontClient& fontClient )
-  {
-    if( !mFontId )
-    {
-      Dali::TextAbstraction::PointSize26Dot6 pointSize = mDefaultPointSize*64;
-      mFontId = fontClient.GetFontId( mDefaultFontFamily, mDefaultFontStyle, pointSize );
-    }
-
-    return mFontId;
-  }
-
-  std::string mDefaultFontFamily;
-  std::string mDefaultFontStyle;
-  float mDefaultPointSize;
-  FontId mFontId;
-};
-
 struct Controller::Impl
 {
   Impl( ControlInterface& controlInterface )