2 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <dali-toolkit/internal/controls/text-view/text-view-processor-dbg.h>
22 #include <dali/public-api/actors/text-actor.h>
33 namespace TextViewProcessor
36 #if defined(DEBUG_ENABLED)
37 Debug::Filter* gTextViewProcessorLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_TEXT_VIEW_PROCESSOR");
40 void dbgPrint( const WordLayoutInfo& word )
42 for( CharacterLayoutInfoContainer::const_iterator characterIt = word.mCharactersLayoutInfo.begin(), endCharacterIt = word.mCharactersLayoutInfo.end();
43 characterIt != endCharacterIt;
46 const CharacterLayoutInfo& character( *characterIt );
48 std::cout << "[" << character.mSize << std::endl;
49 std::cout << " ascender " << character.mAscender << std::endl;
51 TextActor textActor = TextActor::DownCast( character.mGlyphActor );
54 std::cout << "[" << textActor.GetText() << "]";
58 std::cout << "[ImageActor]" << std::endl;
60 std::cout << "{" << character.mStyledText.mText.GetText() << "}";
62 std::cout << " size " << word.mSize << std::endl;
63 std::cout << " ascender " << word.mAscender << std::endl;
64 std::cout << " num char " << word.mCharactersLayoutInfo.size() << std::endl;
65 std::cout << " type ";
70 std::cout << "NoSeparator" << std::endl;
75 std::cout << "LineSeparator" << std::endl;
80 std::cout << "WordSeparator" << std::endl;
86 void dbgPrint( const WordGroupLayoutInfo& group )
89 std::cout << group.mSize;
90 std::cout << group.mNumberOfCharacters;
91 for( WordLayoutInfoContainer::const_iterator wordIt = group.mWordsLayoutInfo.begin(), endWordIt = group.mWordsLayoutInfo.end();
100 void dbgPrint( const LineLayoutInfo& line )
103 std::cout << line.mSize;
104 for( WordGroupLayoutInfoContainer::const_iterator groupIt = line.mWordGroupsLayoutInfo.begin(), endGroupIt = line.mWordGroupsLayoutInfo.end();
105 groupIt != endGroupIt;
108 dbgPrint( *groupIt );
111 std::cout << std::endl;
114 void dbgPrint( const TextLayoutInfo& textInfo )
116 std::cout << "||" << std::endl;
117 std::cout << textInfo.mWholeTextSize;
118 for( LineLayoutInfoContainer::const_iterator it = textInfo.mLinesLayoutInfo.begin(), endIt = textInfo.mLinesLayoutInfo.end();
124 std::cout << "||" << std::endl;
127 void dbgPrint( const TextStyle& style )
129 std::cout << " font name : " << style.GetFontName() << std::endl;
130 std::cout << " font style : " << style.GetFontStyle() << std::endl;
131 std::cout << " font point size : " << style.GetFontPointSize() << std::endl;
132 std::cout << " weight : " << style.GetWeight() << std::endl;
133 std::cout << " text color : " << style.GetTextColor() << std::endl;
134 std::cout << " italics : " << style.IsItalicsEnabled() << std::endl;
135 std::cout << " underline : " << style.IsUnderlineEnabled() << std::endl;
136 std::cout << " shadow : " << style.IsShadowEnabled() << std::endl;
137 std::cout << " shadow color : " << style.GetShadowColor() << std::endl;
138 std::cout << " shadow offset : " << style.GetShadowOffset() << std::endl;
139 std::cout << " glow : " << style.IsGlowEnabled() << std::endl;
140 std::cout << " italics angle : " << style.GetItalicsAngle() << std::endl;
141 std::cout << " glow color : " << style.GetGlowColor() << std::endl;
142 std::cout << " glow intensity : " << style.GetGlowIntensity() << std::endl;
143 std::cout << " smooth edge : " << style.GetSmoothEdge() << std::endl;
144 std::cout << " outline : " << style.IsOutlineEnabled() << std::endl;
145 std::cout << " outline color : " << style.GetOutlineColor() << std::endl;
146 std::cout << " outline thickness : " << style.GetOutlineThickness() << std::endl;
147 std::cout << " gradient : " << style.IsGradientEnabled() << std::endl;
148 std::cout << " gradient color : " << style.GetGradientColor() << std::endl;
149 std::cout << " gradient start point : " << style.GetGradientStartPoint() << std::endl;
150 std::cout << " gradient end point : " << style.GetGradientEndPoint() << std::endl;
153 void dbgPrint( const TextInfoIndices& indices )
155 std::cout << " line : " << indices.mLineIndex << std::endl;
156 std::cout << " group : " << indices.mGroupIndex << std::endl;
157 std::cout << " word : " << indices.mWordIndex << std::endl;
158 std::cout << " char : " << indices.mCharacterIndex << std::endl;
161 void dbgPrint( const MarkupProcessor::StyledTextArray& textArray )
163 for( MarkupProcessor::StyledTextArray::const_iterator it = textArray.begin(), endIt = textArray.end(); it != endIt; ++it )
165 const MarkupProcessor::StyledText& text( *it );
167 std::cout << text.mText.GetText();
171 void dbgPrintText( const WordLayoutInfo& word )
173 for( CharacterLayoutInfoContainer::const_iterator characterIt = word.mCharactersLayoutInfo.begin(), endCharacterIt = word.mCharactersLayoutInfo.end();
174 characterIt != endCharacterIt;
177 const CharacterLayoutInfo& character( *characterIt );
179 std::cout << character.mStyledText.mText.GetText();
183 } // namespace TextViewProcessor
185 } // namespace Internal
187 } // namespace Toolkit