ManaPlus
popupmanager.cpp
Go to the documentation of this file.
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-2019 The ManaPlus Developers
6  * Copyright (C) 2019-2021 Andrei Karas
7  *
8  * This file is part of The ManaPlus Client.
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program. If not, see <http://www.gnu.org/licenses/>.
22  */
23 
24 #include "gui/popupmanager.h"
25 
26 #include "sdlshared.h"
27 
28 #ifndef DYECMD
29 #include "gui/popups/beingpopup.h"
30 #include "gui/popups/itempopup.h"
31 #include "gui/popups/popupmenu.h"
32 #endif // DYECMD
33 #include "gui/popups/textpopup.h"
34 
35 #include "debug.h"
36 
38 
40 {
41 }
42 
44 {
45 }
46 
48 {
49 #ifndef DYECMD
50  if (popupMenu != nullptr)
51  popupMenu->handleLink("cancel", nullptr);
52 #endif // DYECMD
53 }
54 
56 {
57 #ifndef DYECMD
58  if (beingPopup != nullptr)
60 #endif // DYECMD
61 }
62 
64 {
65  if (textPopup != nullptr)
67 }
68 
70 {
71 #ifndef DYECMD
72  if (popupMenu != nullptr)
74 #endif // DYECMD
75 }
76 
78 {
79 #ifndef DYECMD
80  if (itemPopup != nullptr)
81  itemPopup->hide();
82 #endif // DYECMD
83 }
84 
86 {
87 #ifndef DYECMD
88  return popupMenu != nullptr ? popupMenu->isPopupVisible() : false;
89 #else
90  return false;
91 #endif // DYECMD
92 }
93 
95 {
96 #ifndef DYECMD
97  if (popupMenu != nullptr)
98  popupMenu->clear();
99 #endif // DYECMD
100 }
101 
103 {
104  return textPopup != nullptr ? textPopup->isPopupVisible() : false;
105 }
106 
108 {
109 #ifndef DYECMD
110  return beingPopup != nullptr ? beingPopup->isPopupVisible() : false;
111 #else // DYECMD
112  return false;
113 #endif // DYECMD
114 }
BeingPopup * beingPopup
Definition: beingpopup.cpp:47
static void clearPopup()
static void hideTextPopup()
static bool isTextPopupVisible()
static void hideBeingPopup()
static bool isBeingPopupVisible()
static void hidePopupMenu()
static void hideItemPopup()
static bool isPopupMenuVisible()
static void closePopupMenu()
void handleLink(const std::string &link, MouseEvent *event)
Definition: popupmenu.cpp:1251
void clear()
Definition: popupmenu.cpp:2758
void hide()
Definition: popup.cpp:265
bool isPopupVisible() const
Definition: popup.h:174
void setVisible(Visible visible)
Definition: widget.cpp:225
ItemPopup * itemPopup
Definition: itempopup.cpp:64
PopupManager * popupManager
PopupMenu * popupMenu
Definition: popupmenu.cpp:103
TextPopup * textPopup
Definition: textpopup.cpp:33
const bool Visible_false
Definition: visible.h:30