GCC Code Coverage Report
Directory: src/ Exec Total Coverage
File: src/gui/widgets/linepart.h Lines: 9 11 81.8 %
Date: 2017-11-29 Branches: 0 0 0.0 %

Line Branch Exec Source
1
/*
2
 *  The ManaPlus Client
3
 *  Copyright (C) 2009  Aethyra Development Team
4
 *  Copyright (C) 2011-2017  The ManaPlus Developers
5
 *
6
 *  This file is part of The ManaPlus Client.
7
 *
8
 *  This program is free software; you can redistribute it and/or modify
9
 *  it under the terms of the GNU General Public License as published by
10
 *  the Free Software Foundation; either version 2 of the License, or
11
 *  any later version.
12
 *
13
 *  This program is distributed in the hope that it will be useful,
14
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 *  GNU General Public License for more details.
17
 *
18
 *  You should have received a copy of the GNU General Public License
19
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
 */
21
22
#ifndef GUI_WIDGETS_LINEPART_H
23
#define GUI_WIDGETS_LINEPART_H
24
25
#include "gui/color.h"
26
27
#include <string>
28
29
#include "localconsts.h"
30
31
class Image;
32
33
class LinePart final
34
{
35
    public:
36
        LinePart(const int x, const int y, const Color &color,
37
                 const Color &color2, const std::string &text,
38
12
                 const bool bold) :
39
            mX(x),
40
            mY(y),
41
            mColor(color),
42
            mColor2(color2),
43
            mText(text),
44
            mType(0),
45
            mImage(nullptr),
46
24
            mBold(bold)
47
        {
48
        }
49
50
        LinePart(const int x, const int y, const Color &color,
51
                 const Color &color2, Image *const image) :
52
            mX(x),
53
            mY(y),
54
            mColor(color),
55
            mColor2(color2),
56
            mText(),
57
            mType(1),
58
            mImage(image),
59
            mBold(false)
60
        {
61
        }
62
63
14
        LinePart(const LinePart &l) :
64
14
            mX(l.mX),
65
14
            mY(l.mY),
66
            mColor(l.mColor),
67
            mColor2(l.mColor2),
68
            mText(l.mText),
69
14
            mType(l.mType),
70
14
            mImage(l.mImage),
71
70
            mBold(l.mBold)
72
        {
73
14
        }
74
75
        LinePart &operator=(const LinePart &l)
76
        {
77
            mX = l.mX;
78
            mY = l.mY;
79
            mColor = l.mColor;
80
            mColor2 = l.mColor2;
81
            mText = l.mText;
82
            mType = l.mType;
83
            mImage = l.mImage;
84
            mBold = l.mBold;
85
            return *this;
86
        }
87
88
        A_DEFAULT_COPY(LinePart)
89
90
        ~LinePart();
91
92
        int mX;
93
        int mY;
94
        Color mColor;
95
        Color mColor2;
96
        std::string mText;
97
        unsigned char mType;
98
        Image *mImage;
99
        bool mBold;
100
};
101
102
#endif  // GUI_WIDGETS_LINEPART_H