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-types.h>
30 namespace TextViewProcessor
37 GradientInfo::GradientInfo()
44 GradientInfo::~GradientInfo()
48 GradientInfo::GradientInfo( const GradientInfo& info )
49 : mGradientColor( info.mGradientColor ),
50 mStartPoint( info.mStartPoint ),
51 mEndPoint( info.mEndPoint )
55 GradientInfo& GradientInfo::operator=( const GradientInfo& info )
59 mGradientColor = info.mGradientColor;
60 mStartPoint = info.mStartPoint;
61 mEndPoint = info.mEndPoint;
67 CharacterLayoutInfo::CharacterLayoutInfo()
71 mUnderlineThickness( 0.f ),
72 mUnderlinePosition( 0.f ),
77 mGradientInfo( NULL ),
81 mIsColorGlyph( false )
85 CharacterLayoutInfo::~CharacterLayoutInfo()
87 // Deletes the gradient info.
91 CharacterLayoutInfo::CharacterLayoutInfo( const CharacterLayoutInfo& character )
92 : mSize( character.mSize ),
93 mBearing( character.mBearing ),
94 mAscender( character.mAscender ),
95 mUnderlineThickness( character.mUnderlineThickness ),
96 mUnderlinePosition( character.mUnderlinePosition ),
97 mPosition( character.mPosition ),
98 mOffset( character.mOffset ),
99 mGlyphActor( character.mGlyphActor ),
100 mColorAlpha( character.mColorAlpha ),
101 mGradientInfo( ( NULL == character.mGradientInfo ) ? NULL : new GradientInfo( *character.mGradientInfo ) ), // Copies the gradient info.
102 mIsVisible( character.mIsVisible ),
103 mSetText( character.mSetText ),
104 mSetStyle( character.mSetStyle ),
105 mIsColorGlyph( character.mIsColorGlyph )
109 CharacterLayoutInfo& CharacterLayoutInfo::operator=( const CharacterLayoutInfo& character )
111 mSize = character.mSize;
112 mAscender = character.mAscender;
113 mBearing = character.mBearing;
114 mUnderlineThickness = character.mUnderlineThickness;
115 mUnderlinePosition = character.mUnderlinePosition;
117 mPosition = character.mPosition;
118 mOffset = character.mOffset;
120 mGlyphActor = character.mGlyphActor;
122 mColorAlpha = character.mColorAlpha;
124 // Copies the gradient info.
125 if( NULL == character.mGradientInfo )
127 // The source doesn't have. Deletes the current one.
128 delete mGradientInfo;
129 mGradientInfo = NULL;
133 // The source has gradient info.
134 if( NULL != mGradientInfo )
136 // It it has, copy to it.
137 *mGradientInfo = *character.mGradientInfo;
141 // If it doesn't have, create a new one.
142 mGradientInfo = new GradientInfo( *character.mGradientInfo );
146 mIsVisible = character.mIsVisible;
147 mSetText = character.mSetText;
148 mSetStyle = character.mSetStyle;
149 mIsColorGlyph = character.mIsColorGlyph;
154 } //namespace TextViewProcessor
156 } //namespace Internal
158 } //namespace Toolkit