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 "text-view-processor-dbg.h"
30 namespace TextViewProcessor
33 #if defined(DEBUG_ENABLED)
34 Debug::Filter* gTextViewProcessorLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_TEXT_VIEW_PROCESSOR");
37 void dbgPrint( const WordLayoutInfo& word )
39 for( CharacterLayoutInfoContainer::const_iterator characterIt = word.mCharactersLayoutInfo.begin(), endCharacterIt = word.mCharactersLayoutInfo.end();
40 characterIt != endCharacterIt;
43 const CharacterLayoutInfo& character( *characterIt );
45 std::cout << "[" << character.mSize << std::endl;
46 std::cout << " ascender " << character.mAscender << std::endl;
48 TextActor textActor = TextActor::DownCast( character.mGlyphActor );
51 std::cout << "[" << textActor.GetText() << "]";
55 std::cout << "[ImageActor]" << std::endl;
57 std::cout << "{" << character.mStyledText.mText.GetText() << "}";
59 std::cout << " size " << word.mSize << std::endl;
60 std::cout << " ascender " << word.mAscender << std::endl;
61 std::cout << " num char " << word.mCharactersLayoutInfo.size() << std::endl;
62 std::cout << " type ";
67 std::cout << "NoSeparator" << std::endl;
72 std::cout << "LineSeparator" << std::endl;
77 std::cout << "WordSeparator" << std::endl;
83 void dbgPrint( const WordGroupLayoutInfo& group )
86 std::cout << group.mSize;
87 std::cout << group.mNumberOfCharacters;
88 for( WordLayoutInfoContainer::const_iterator wordIt = group.mWordsLayoutInfo.begin(), endWordIt = group.mWordsLayoutInfo.end();
97 void dbgPrint( const LineLayoutInfo& line )
100 std::cout << line.mSize;
101 for( WordGroupLayoutInfoContainer::const_iterator groupIt = line.mWordGroupsLayoutInfo.begin(), endGroupIt = line.mWordGroupsLayoutInfo.end();
102 groupIt != endGroupIt;
105 dbgPrint( *groupIt );
108 std::cout << std::endl;
111 void dbgPrint( const TextLayoutInfo& textInfo )
113 std::cout << "||" << std::endl;
114 std::cout << textInfo.mWholeTextSize;
115 for( LineLayoutInfoContainer::const_iterator it = textInfo.mLinesLayoutInfo.begin(), endIt = textInfo.mLinesLayoutInfo.end();
121 std::cout << "||" << std::endl;
124 void dbgPrint( const TextStyle& style )
126 std::cout << " font name : " << style.GetFontName() << std::endl;
127 std::cout << " font style : " << style.GetFontStyle() << std::endl;
128 std::cout << " font point size : " << style.GetFontPointSize() << std::endl;
129 std::cout << " weight : " << style.GetWeight() << std::endl;
130 std::cout << " text color : " << style.GetTextColor() << std::endl;
131 std::cout << " italics : " << style.GetItalics() << std::endl;
132 std::cout << " underline : " << style.GetUnderline() << std::endl;
133 std::cout << " shadow : " << style.GetShadow() << std::endl;
134 std::cout << " shadow color : " << style.GetShadowColor() << std::endl;
135 std::cout << " shadow offset : " << style.GetShadowOffset() << std::endl;
136 std::cout << " glow : " << style.GetGlow() << std::endl;
137 std::cout << " italics angle : " << style.GetItalicsAngle() << std::endl;
138 std::cout << " glow color : " << style.GetGlowColor() << std::endl;
139 std::cout << " glow intensity : " << style.GetGlowIntensity() << std::endl;
140 std::cout << " smooth edge : " << style.GetSmoothEdge() << std::endl;
141 std::cout << " outline : " << style.GetOutline() << std::endl;
142 std::cout << " outline color : " << style.GetOutlineColor() << std::endl;
143 std::cout << " outline thickness : " << style.GetOutlineThickness() << std::endl;
146 void dbgPrint( const TextInfoIndices& indices )
148 std::cout << " line : " << indices.mLineIndex << std::endl;
149 std::cout << " group : " << indices.mGroupIndex << std::endl;
150 std::cout << " word : " << indices.mWordIndex << std::endl;
151 std::cout << " char : " << indices.mCharacterIndex << std::endl;
154 void dbgPrint( const MarkupProcessor::StyledTextArray& textArray )
156 for( MarkupProcessor::StyledTextArray::const_iterator it = textArray.begin(), endIt = textArray.end(); it != endIt; ++it )
158 const MarkupProcessor::StyledText& text( *it );
160 std::cout << text.mText.GetText();
164 void dbgPrintText( const WordLayoutInfo& word )
166 for( CharacterLayoutInfoContainer::const_iterator characterIt = word.mCharactersLayoutInfo.begin(), endCharacterIt = word.mCharactersLayoutInfo.end();
167 characterIt != endCharacterIt;
170 const CharacterLayoutInfo& character( *characterIt );
172 std::cout << character.mStyledText.mText.GetText();
176 } // namespace TextViewProcessor
178 } // namespace Internal
180 } // namespace Toolkit