GCC Code Coverage Report
Directory: src/ Exec Total Coverage
File: src/gui/popupmanager.cpp Lines: 0 26 0.0 %
Date: 2017-11-29 Branches: 0 28 0.0 %

Line Branch Exec Source
1
/*
2
 *  The ManaPlus Client
3
 *  Copyright (C) 2004-2009  The Mana World Development Team
4
 *  Copyright (C) 2009-2010  The Mana Developers
5
 *  Copyright (C) 2011-2017  The ManaPlus Developers
6
 *
7
 *  This file is part of The ManaPlus Client.
8
 *
9
 *  This program is free software; you can redistribute it and/or modify
10
 *  it under the terms of the GNU General Public License as published by
11
 *  the Free Software Foundation; either version 2 of the License, or
12
 *  any later version.
13
 *
14
 *  This program is distributed in the hope that it will be useful,
15
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 *  GNU General Public License for more details.
18
 *
19
 *  You should have received a copy of the GNU General Public License
20
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
 */
22
23
#include "gui/popupmanager.h"
24
25
#include "sdlshared.h"
26
27
#ifndef DYECMD
28
#include "gui/popups/beingpopup.h"
29
#include "gui/popups/itempopup.h"
30
#include "gui/popups/popupmenu.h"
31
#endif  // DYECMD
32
#include "gui/popups/textpopup.h"
33
34
#include "debug.h"
35
36
PopupManager *popupManager = nullptr;
37
38
PopupManager::PopupManager()
39
{
40
}
41
42
PopupManager::~PopupManager()
43
{
44
}
45
46
void PopupManager::closePopupMenu()
47
{
48
#ifndef DYECMD
49
    if (popupMenu != nullptr)
50
        popupMenu->handleLink("cancel", nullptr);
51
#endif  // DYECMD
52
}
53
54
void PopupManager::hideBeingPopup()
55
{
56
#ifndef DYECMD
57
    if (beingPopup != nullptr)
58
        beingPopup->setVisible(Visible_false);
59
#endif  // DYECMD
60
}
61
62
void PopupManager::hideTextPopup()
63
{
64
    if (textPopup != nullptr)
65
        textPopup->setVisible(Visible_false);
66
}
67
68
void PopupManager::hidePopupMenu()
69
{
70
#ifndef DYECMD
71
    if (popupMenu != nullptr)
72
        popupMenu->setVisible(Visible_false);
73
#endif  // DYECMD
74
}
75
76
void PopupManager::hideItemPopup()
77
{
78
#ifndef DYECMD
79
    if (itemPopup != nullptr)
80
        itemPopup->hide();
81
#endif  // DYECMD
82
}
83
84
bool PopupManager::isPopupMenuVisible()
85
{
86
#ifndef DYECMD
87
    return popupMenu != nullptr ? popupMenu->isPopupVisible() : false;
88
#else
89
    return false;
90
#endif  // DYECMD
91
}
92
93
void PopupManager::clearPopup()
94
{
95
#ifndef DYECMD
96
    if (popupMenu != nullptr)
97
        popupMenu->clear();
98
#endif  // DYECMD
99
}
100
101
bool PopupManager::isTextPopupVisible()
102
{
103
    return textPopup != nullptr ? textPopup->isPopupVisible() : false;
104
}
105
106
bool PopupManager::isBeingPopupVisible()
107
{
108
#ifndef DYECMD
109
    return beingPopup != nullptr ? beingPopup->isPopupVisible() : false;
110
#else  // DYECMD
111
    return false;
112
#endif  // DYECMD
113
}