[dali_2.3.21] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / color-run.h
index edae1e2..75bd27b 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_TEXT_COLOR_RUN_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
  *
  */
 
-// EXTERNAL INCLUDES
-#include <dali/public-api/math/vector4.h>
-
 // INTERNAL INCLUDES
-#include <dali-toolkit/internal/text/character-run.h>
-#include <dali-toolkit/internal/text/glyph-run.h>
+#include <dali-toolkit/internal/text/abstract-style-character-run.h>
 
 namespace Dali
 {
@@ -34,16 +30,33 @@ namespace Text
 /**
  * @brief Run of characters with the same color.
  */
-struct ColorRun
+struct ColorRun : public AbstractStyleCharacterRun
 {
-  CharacterRun characterRun; ///< The initial character index and the number of characters of the run.
-  Vector4      color;        ///< The color of the characters.
+  /**
+   * @brief Constructor.
+   * Default constructor to set the default values
+   */
+  ColorRun()
+  : AbstractStyleCharacterRun()
+  {
+  }
+  Vector4 color; ///< The color of the characters.
 };
 
 } // namespace Text
 
 } // namespace Toolkit
 
+// Allow ColorRun to be treated as a POD type
+template<>
+struct TypeTraits<Dali::Toolkit::Text::ColorRun> : public Dali::BasicTypes<Dali::Toolkit::Text::ColorRun>
+{
+  enum
+  {
+    IS_TRIVIAL_TYPE = true
+  };
+};
+
 } // namespace Dali
 
 #endif // DALI_TOOLKIT_TEXT_COLOR_RUN_H