36df1e60d13208aec981526f5e233e9682bc7334
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / text-view / text-view-character-processor.cpp
1 //
2 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
3 //
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
7 //
8 //     http://floralicense.org/license/
9 //
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.
15 //
16
17 // INTERNAL INCLUDES
18 #include "text-view-processor-types.h"
19
20 namespace Dali
21 {
22
23 namespace Toolkit
24 {
25
26 namespace Internal
27 {
28
29 namespace TextViewProcessor
30 {
31
32 /////////////////////
33 // Layout info.
34 /////////////////////
35
36 CharacterLayoutInfo::CharacterLayoutInfo()
37 : mHeight( 0.f ),
38   mAdvance( 0.f ),
39   mBearing( 0.f ),
40   mPosition(),
41   mOffset(),
42   mSize(),
43   mAscender( 0.f ),
44   mUnderlineThickness( 0.f ),
45   mUnderlinePosition( 0.f ),
46   mTextActor(),
47   mStyledText(),
48   mColorAlpha( 1.f ),
49   mGradientColor(),
50   mStartPoint(),
51   mEndPoint(),
52   mIsVisible( true ),
53   mSetText( true ),
54   mSetStyle( true )
55 {
56 }
57
58 CharacterLayoutInfo::CharacterLayoutInfo( const CharacterLayoutInfo& character )
59 : mHeight( character.mHeight ),
60   mAdvance( character.mAdvance ),
61   mBearing( character.mBearing ),
62   mPosition( character.mPosition ),
63   mOffset( character.mOffset ),
64   mSize( character.mSize ),
65   mAscender( character.mAscender ),
66   mUnderlineThickness( character.mUnderlineThickness ),
67   mUnderlinePosition( character.mUnderlinePosition ),
68   mTextActor( character.mTextActor ),
69   mStyledText( character.mStyledText ),
70   mColorAlpha( character.mColorAlpha ),
71   mGradientColor( character.mGradientColor ),
72   mStartPoint( character.mStartPoint ),
73   mEndPoint( character.mEndPoint ),
74   mIsVisible( character.mIsVisible ),
75   mSetText( character.mSetText ),
76   mSetStyle( character.mSetStyle )
77 {
78 }
79
80 CharacterLayoutInfo& CharacterLayoutInfo::operator=( const CharacterLayoutInfo& character )
81 {
82   mHeight = character.mHeight;
83   mAdvance = character.mAdvance;
84   mBearing = character.mBearing;
85
86   mPosition = character.mPosition;
87   mOffset = character.mOffset;
88   mSize = character.mSize;
89   mAscender = character.mAscender;
90   mUnderlineThickness = character.mUnderlineThickness;
91   mUnderlinePosition = character.mUnderlinePosition;
92
93   mStyledText = character.mStyledText;
94   mColorAlpha = character.mColorAlpha;
95   mGradientColor = character.mGradientColor;
96   mStartPoint = character.mStartPoint;
97   mEndPoint = character.mEndPoint;
98   mIsVisible = character.mIsVisible;
99   mSetText = character.mSetText;
100   mSetStyle = character.mSetStyle;
101
102   mTextActor = character.mTextActor;
103
104   return *this;
105 }
106
107 } //namespace TextViewProcessor
108
109 } //namespace Internal
110
111 } //namespace Toolkit
112
113 } //namespace Dali