X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Ffont-description-run.h;h=77b8db8671b105f55a8bc558b332e225118830bf;hp=b14ab1d32ad1c088371c5aaccd9970b86ccde6d7;hb=64ec76af20d8d55ea78cd5726a19d76072a0a321;hpb=87a9019904ab49c42f1e32e7ebb6a1512b0dc28c diff --git a/dali-toolkit/internal/text/font-description-run.h b/dali-toolkit/internal/text/font-description-run.h index b14ab1d..77b8db8 100644 --- a/dali-toolkit/internal/text/font-description-run.h +++ b/dali-toolkit/internal/text/font-description-run.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_TEXT_FONT_DESCRIPTION_RUN_H /* - * Copyright (c) 2019 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. @@ -22,68 +22,66 @@ #include // INTERNAL INCLUDES -#include +#include #include namespace Dali { - namespace Toolkit { - namespace Text { - /** * @brief Run of characters with the same font. */ -struct FontDescriptionRun +struct FontDescriptionRun : public AbstractStyleCharacterRun { /** * Default constructor to set the default values of bitfields */ FontDescriptionRun() - : characterRun{}, - familyName{ nullptr }, - familyLength{ 0u }, - weight{ FontWeight::NONE }, - width{ FontWidth::NONE }, - slant{ FontSlant::NONE }, - size{ 0u }, - familyDefined{ false }, - weightDefined{ false }, - widthDefined{ false }, - slantDefined{ false }, - sizeDefined{ false } - {} + : AbstractStyleCharacterRun(), + familyName{nullptr}, + familyLength{0u}, + weight{FontWeight::NONE}, + width{FontWidth::NONE}, + slant{FontSlant::NONE}, + size{0u}, + familyDefined{false}, + weightDefined{false}, + widthDefined{false}, + slantDefined{false}, + sizeDefined{false} + { + } - FontDescriptionRun( const CharacterRun& characterRun, - char* familyName, - Length familyLength, - FontWeight weight, - FontWidth width, - FontSlant slant, - PointSize26Dot6 size, - bool familyDefined, - bool weightDefined, - bool widthDefined, - bool slantDefined, - bool sizeDefined ) - : characterRun{ characterRun }, - familyName{ familyName }, - familyLength{ familyLength }, - weight{ weight }, - width{ width }, - slant{ slant }, - size{ size }, - familyDefined{ familyDefined }, - weightDefined{ weightDefined }, - widthDefined{ widthDefined }, - slantDefined{ slantDefined }, - sizeDefined{ sizeDefined } - {} + FontDescriptionRun(const CharacterRun& characterRun, + char* familyName, + Length familyLength, + FontWeight weight, + FontWidth width, + FontSlant slant, + PointSize26Dot6 size, + bool familyDefined, + bool weightDefined, + bool widthDefined, + bool slantDefined, + bool sizeDefined) + : AbstractStyleCharacterRun(characterRun), + familyName{familyName}, + familyLength{familyLength}, + weight{weight}, + width{width}, + slant{slant}, + size{size}, + familyDefined{familyDefined}, + weightDefined{weightDefined}, + widthDefined{widthDefined}, + slantDefined{slantDefined}, + sizeDefined{sizeDefined} + { + } - CharacterRun characterRun; ///< The initial character index and the number of characters of the run. char* familyName; ///< The font's family name. Length familyLength; ///< The length of the font's family name. FontWeight weight; ///< The font's weight. @@ -91,17 +89,27 @@ struct FontDescriptionRun FontSlant slant; ///< The font's slant. PointSize26Dot6 size; ///< The font's size. - bool familyDefined : 1; ///< Whether the font's family is defined. - bool weightDefined : 1; ///< Whether the font's weight is defined. - bool widthDefined : 1; ///< Whether the font's width is defined. - bool slantDefined : 1; ///< Whether the font's slant is defined. - bool sizeDefined : 1; ///< Whether the font's size is defined. + bool familyDefined : 1; ///< Whether the font's family is defined. + bool weightDefined : 1; ///< Whether the font's weight is defined. + bool widthDefined : 1; ///< Whether the font's width is defined. + bool slantDefined : 1; ///< Whether the font's slant is defined. + bool sizeDefined : 1; ///< Whether the font's size is defined. }; } // namespace Text } // namespace Toolkit +// Allow FontDescriptionRun to be treated as a POD type +template<> +struct TypeTraits : public Dali::BasicTypes +{ + enum + { + IS_TRIVIAL_TYPE = true + }; +}; + } // namespace Dali #endif // DALI_TOOLKIT_TEXT_FONT_DESCRIPTION_RUN_H