1 #ifndef __DALI_TOOLKIT_TEXT_LAYOUT_PARAMETERS_H__
2 #define __DALI_TOOLKIT_TEXT_LAYOUT_PARAMETERS_H__
5 * Copyright (c) 2015 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali/public-api/math/vector2.h>
25 #include <dali-toolkit/internal/text/text-definitions.h>
36 struct BidirectionalLineInfoRun;
39 * @brief Struct used to pass parameters.
41 struct LayoutParameters
44 * Constructor with the needed parameters to layout the text.
46 * @param[in] boundingBox The size of the box containing the text.
47 * @param[in] textBuffer The text buffer.
48 * @param[in] lineBreakInfoBuffer The line break info.
49 * @param[in] wordBreakInfoBuffer The word break info.
50 * @param[in] characterDirectionBuffer Vector with the direction of each character.
51 * @param[in] glyphsBuffer Vector with glyphs.
52 * @param[in] glyphsToCharactersBuffer Vector with indices pointing the first character of each glyph.
53 * @param[in] charactersPerGlyphBuffer Vector with the number of characters that forms each glyph.
54 * @param[in] charactersToGlyphsBuffer Vector with indices pointing the first glyph of each character.
55 * @param[in] glyphsPerCharacterBuffer Vector with the number of glyphs shaped from the character.
56 * @param[in] totalNumberOfGlyphs The number of glyphs.
58 LayoutParameters( const Vector2& boundingBox,
59 const Character* const textBuffer,
60 const LineBreakInfo* const lineBreakInfoBuffer,
61 const WordBreakInfo* const wordBreakInfoBuffer,
62 const CharacterDirection* const characterDirectionBuffer,
63 const GlyphInfo* const glyphsBuffer,
64 const CharacterIndex* const glyphsToCharactersBuffer,
65 const Length* const charactersPerGlyphBuffer,
66 const GlyphIndex* const charactersToGlyphsBuffer,
67 const Length* const glyphsPerCharacterBuffer,
68 Length totalNumberOfGlyphs )
69 : boundingBox( boundingBox ),
70 textBuffer( textBuffer ),
71 lineBreakInfoBuffer( lineBreakInfoBuffer ),
72 wordBreakInfoBuffer( wordBreakInfoBuffer ),
73 characterDirectionBuffer( characterDirectionBuffer ),
74 glyphsBuffer( glyphsBuffer ),
75 glyphsToCharactersBuffer( glyphsToCharactersBuffer ),
76 charactersPerGlyphBuffer( charactersPerGlyphBuffer ),
77 charactersToGlyphsBuffer( charactersToGlyphsBuffer ),
78 glyphsPerCharacterBuffer( glyphsPerCharacterBuffer ),
79 lineBidirectionalInfoRunsBuffer( NULL ),
80 numberOfBidirectionalInfoRuns( 0u ),
81 startGlyphIndex( 0u ),
83 totalNumberOfGlyphs( totalNumberOfGlyphs ),
85 estimatedNumberOfLines( 0u ),
86 isLastNewParagraph( false )
89 Vector2 boundingBox; ///< The size of the box containing the text.
90 const Character* const textBuffer; ///< The text buffer.
91 const LineBreakInfo* const lineBreakInfoBuffer; ///< The line break info.
92 const WordBreakInfo* const wordBreakInfoBuffer; ///< The word break info.
93 const CharacterDirection* const characterDirectionBuffer; ///< Vector with the direction of each character.
94 const GlyphInfo* const glyphsBuffer; ///< Vector with glyphs.
95 const CharacterIndex* const glyphsToCharactersBuffer; ///< Vector with indices pointing the first character of each glyph.
96 const Length* const charactersPerGlyphBuffer; ///< Vector with the number of characters that forms each glyph.
97 const GlyphIndex* const charactersToGlyphsBuffer; ///< Vector with indices pointing the first glyph of each character.
98 const Length* const glyphsPerCharacterBuffer; ///< Vector with the number of glyphs shaped from the character.
99 BidirectionalLineInfoRun* lineBidirectionalInfoRunsBuffer; ///< Bidirectional conversion tables per line.
100 Length numberOfBidirectionalInfoRuns; ///< The number of lines with bidirectional info.
101 GlyphIndex startGlyphIndex; ///< Index to the first glyph to layout.
102 Length numberOfGlyphs; ///< The number of glyphs to layout.
103 Length totalNumberOfGlyphs; ///< The number of glyphs.
104 LineIndex startLineIndex; ///< The line index where to insert the new lines.
105 Length estimatedNumberOfLines; ///< The estimated number of lines.
106 bool isLastNewParagraph; ///< Whether the last character is a new paragraph character.
111 } // namespace Toolkit
115 #endif // __DALI_TOOLKIT_TEXT_LAYOUT_PARAMETERS_H__