2 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
4 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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.
18 #include "text-view-processor-dbg.h"
29 namespace TextViewProcessor
32 #if defined(DEBUG_ENABLED)
33 Debug::Filter* gTextViewProcessorLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_TEXT_VIEW_PROCESSOR");
36 void dbgPrint( const WordLayoutInfo& word )
38 for( CharacterLayoutInfoContainer::const_iterator characterIt = word.mCharactersLayoutInfo.begin(), endCharacterIt = word.mCharactersLayoutInfo.end();
39 characterIt != endCharacterIt;
42 const CharacterLayoutInfo& character( *characterIt );
44 std::cout << "[" << character.mSize << std::endl;
45 std::cout << " ascender " << character.mAscender << std::endl;
47 TextActor textActor = TextActor::DownCast( character.mGlyphActor );
50 std::cout << "[" << textActor.GetText() << "]";
54 std::cout << "[ImageActor]" << std::endl;
56 std::cout << "{" << character.mStyledText.mText.GetText() << "}";
58 std::cout << " size " << word.mSize << std::endl;
59 std::cout << " ascender " << word.mAscender << std::endl;
60 std::cout << " num char " << word.mCharactersLayoutInfo.size() << std::endl;
61 std::cout << " type ";
66 std::cout << "NoSeparator" << std::endl;
71 std::cout << "LineSeparator" << std::endl;
76 std::cout << "WordSeparator" << std::endl;
82 void dbgPrint( const WordGroupLayoutInfo& group )
85 std::cout << group.mSize;
86 std::cout << group.mNumberOfCharacters;
87 for( WordLayoutInfoContainer::const_iterator wordIt = group.mWordsLayoutInfo.begin(), endWordIt = group.mWordsLayoutInfo.end();
96 void dbgPrint( const LineLayoutInfo& line )
99 std::cout << line.mSize;
100 for( WordGroupLayoutInfoContainer::const_iterator groupIt = line.mWordGroupsLayoutInfo.begin(), endGroupIt = line.mWordGroupsLayoutInfo.end();
101 groupIt != endGroupIt;
104 dbgPrint( *groupIt );
107 std::cout << std::endl;
110 void dbgPrint( const TextLayoutInfo& textInfo )
112 std::cout << "||" << std::endl;
113 std::cout << textInfo.mWholeTextSize;
114 for( LineLayoutInfoContainer::const_iterator it = textInfo.mLinesLayoutInfo.begin(), endIt = textInfo.mLinesLayoutInfo.end();
120 std::cout << "||" << std::endl;
123 void dbgPrint( const TextStyle& style )
125 std::cout << " font name : " << style.GetFontName() << std::endl;
126 std::cout << " font style : " << style.GetFontStyle() << std::endl;
127 std::cout << " font point size : " << style.GetFontPointSize() << std::endl;
128 std::cout << " weight : " << style.GetWeight() << std::endl;
129 std::cout << " text color : " << style.GetTextColor() << std::endl;
130 std::cout << " italics : " << style.GetItalics() << std::endl;
131 std::cout << " underline : " << style.GetUnderline() << std::endl;
132 std::cout << " shadow : " << style.GetShadow() << std::endl;
133 std::cout << " shadow color : " << style.GetShadowColor() << std::endl;
134 std::cout << " shadow offset : " << style.GetShadowOffset() << std::endl;
135 std::cout << " glow : " << style.GetGlow() << std::endl;
136 std::cout << " italics angle : " << style.GetItalicsAngle() << std::endl;
137 std::cout << " glow color : " << style.GetGlowColor() << std::endl;
138 std::cout << " glow intensity : " << style.GetGlowIntensity() << std::endl;
139 std::cout << " smooth edge : " << style.GetSmoothEdge() << std::endl;
140 std::cout << " outline : " << style.GetOutline() << std::endl;
141 std::cout << " outline color : " << style.GetOutlineColor() << std::endl;
142 std::cout << " outline thickness : " << style.GetOutlineThickness() << std::endl;
145 void dbgPrint( const TextInfoIndices& indices )
147 std::cout << " line : " << indices.mLineIndex << std::endl;
148 std::cout << " group : " << indices.mGroupIndex << std::endl;
149 std::cout << " word : " << indices.mWordIndex << std::endl;
150 std::cout << " char : " << indices.mCharacterIndex << std::endl;
153 void dbgPrint( const MarkupProcessor::StyledTextArray& textArray )
155 for( MarkupProcessor::StyledTextArray::const_iterator it = textArray.begin(), endIt = textArray.end(); it != endIt; ++it )
157 const MarkupProcessor::StyledText& text( *it );
159 std::cout << text.mText.GetText();
163 void dbgPrintText( const WordLayoutInfo& word )
165 for( CharacterLayoutInfoContainer::const_iterator characterIt = word.mCharactersLayoutInfo.begin(), endCharacterIt = word.mCharactersLayoutInfo.end();
166 characterIt != endCharacterIt;
169 const CharacterLayoutInfo& character( *characterIt );
171 std::cout << character.mStyledText.mText.GetText();
175 } // namespace TextViewProcessor
177 } // namespace Internal
179 } // namespace Toolkit