ManaPlus
desktop.h
Go to the documentation of this file.
1 /*
2  * The ManaPlus Client
3  * Copyright (C) 2009-2010 The Mana World Development Team
4  * Copyright (C) 2011-2019 The ManaPlus Developers
5  * Copyright (C) 2019-2021 Andrei Karas
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 #ifndef GUI_WIDGETS_DESKTOP_H
24 #define GUI_WIDGETS_DESKTOP_H
25 
26 #include "gui/widgets/container.h"
27 
29 
31 
32 #include "localconsts.h"
33 
34 class StaticBrowserBox;
35 class Image;
36 class Skin;
37 
51 class Desktop final : public Container,
52  public LinkHandler,
53  public WidgetListener
54 {
55  public:
56  explicit Desktop(const Widget2 *const widget);
57 
59 
60  ~Desktop() override final;
61 
65  void reloadWallpaper();
66 
67  void widgetResized(const Event &event) override final;
68 
69  void draw(Graphics *const graphics) override final A_NONNULL(2);
70 
71  void safeDraw(Graphics *const graphics) override final A_NONNULL(2);
72 
73  void postInit() override final;
74 
75  void handleLink(const std::string &link,
76  MouseEvent *event) override final;
77  private:
79 
85 };
86 
87 extern Desktop *desktop;
88 
89 #endif // GUI_WIDGETS_DESKTOP_H
Definition: color.h:76
void setBestFittingWallpaper()
Definition: desktop.cpp:181
void reloadWallpaper()
Definition: desktop.cpp:122
void draw(Graphics *const graphics)
Definition: desktop.cpp:135
Desktop(const Widget2 *const widget)
Definition: desktop.cpp:51
void safeDraw(Graphics *const graphics)
Definition: desktop.cpp:176
StaticBrowserBox * mVersionLabel
Definition: desktop.h:81
void handleLink(const std::string &link, MouseEvent *event)
Definition: desktop.cpp:233
Color mBackgroundGrayColor
Definition: desktop.h:83
~Desktop()
Definition: desktop.cpp:97
bool mShowBackground
Definition: desktop.h:84
Skin * mSkin
Definition: desktop.h:82
void widgetResized(const Event &event)
Definition: desktop.cpp:128
Image * mWallpaper
Definition: desktop.h:80
void postInit()
Definition: desktop.cpp:108
Definition: event.h:79
Definition: skin.h:37
Desktop * desktop
Definition: desktop.cpp:49
#define A_NONNULL(...)
Definition: localconsts.h:168
#define final
Definition: localconsts.h:46
#define A_DELETE_COPY(func)
Definition: localconsts.h:53